Compare commits

...

24 Commits

Author SHA1 Message Date
5a0bc5a19d Merge pull request 'fix bugs' (#749) from fix/fix-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/749
2026-04-23 09:02:45 +00:00
38bbe37f40 fix bug #81042 2026-04-23 11:50:35 +03:00
eb4c5cfc2a fix bug #81038 2026-04-23 11:26:25 +03:00
6262048e75 fix bug #81038 2026-04-23 11:13:49 +03:00
7877f542b3 fix bug #81037 2026-04-23 10:56:59 +03:00
f00581fd1d fix bug #81039 2026-04-23 10:52:25 +03:00
bd3dd15a4f fix bug #81040 2026-04-23 10:41:30 +03:00
a796e92fe1 fix bug #81215 2026-04-23 10:32:30 +03:00
3d7381dc68 Merge pull request 'Fix bug 81092' (#748) from fix/bug-81092 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/748
2026-04-21 13:46:39 +00:00
e33e3d6b42 Fix bug 81092 2026-04-21 16:13:34 +03:00
c03fd25b6d Fix build 2026-04-21 16:06:19 +03:00
c7c98d3f69 Merge pull request 'fix bug #81148' (#747) from fix/bug81148- into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/747
2026-04-21 10:00:55 +00:00
d9d7ffef26 fix bug #81148 2026-04-21 12:50:49 +03:00
b0efeafd27 Merge pull request 'Add patch for fix build Xcode 26+ Clang treats enum-constexpr-conversion as hard error' (#742) from fix/boost-integral-wrapper-xcode into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/742
2026-04-16 07:18:21 +00:00
8a3a922dba Merge pull request 'Fix bug 81029' (#744) from fix/bug-81029 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/744
2026-04-14 13:20:10 +00:00
b78bcb10dc Fix bug 81029 2026-04-14 16:16:38 +03:00
653ff24c0e Merge pull request 'Fix AP removal for modified annotations' (#743) from fix/pdf-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/743
2026-04-14 07:52:40 +00:00
a62f97627b Fix AP removal for modified annotations 2026-04-14 10:50:07 +03:00
612c26cf6c Add patch for fix build Xcode 26+ Clang treats enum-constexpr-conversion as hard error 2026-04-09 11:07:45 +03:00
2873418d74 Merge pull request 'Fix bug 80951' (#741) from fix/bug-80951 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/741
2026-04-08 12:52:43 +00:00
77346270a4 Fix bug 80951 2026-04-08 15:07:22 +03:00
5f39acbe51 Merge pull request 'For bug 80374' (#740) from fix/forbug80374 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/740
2026-04-08 08:34:04 +00:00
6badba384c For bug 80374 2026-04-08 11:27:44 +03:00
c96df4e62e Fix bugs in fromUnicode method 2026-04-07 22:11:37 +03:00
25 changed files with 216 additions and 84 deletions

View File

@ -0,0 +1,36 @@
<<<<<<<
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
private:
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
public:
typedef AUX_WRAPPER_INST(next_value) next;
typedef AUX_WRAPPER_INST(prior_value) prior;
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|| (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
#else
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
#endif
=======
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \
|| defined(__clang__)
private:
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
public:
typedef AUX_WRAPPER_INST(next_value) next;
typedef AUX_WRAPPER_INST(prior_value) prior;
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|| (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
#else
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
#endif
>>>>>>>

View File

@ -233,20 +233,98 @@ namespace NSHtmlRenderer
NSWasm::CHChar* pLastChar = m_oLine.GetTail();
if (dOffsetX > (pLastChar->width + 0.5))
{
// insert space. Our space will not be a regular space. But a specific one
NSWasm::CHChar* pSpaceChar = m_oLine.AddTail();
pLastChar = &m_oLine.m_pChars[m_oLine.m_lCharsTail - 2];
pSpaceChar->x = pLastChar->width;
pSpaceChar->width = dOffsetX - pLastChar->width;
pSpaceChar->unicode = 0xFFFF;
dOffsetX -= pLastChar->width;
if (pLastChar->unicode == 32 || pLastChar->unicode == 9)
{
pLastChar->width = dOffsetX;
}
else
{
// insert space. Our space will not be a regular space. But a specific one
NSWasm::CHChar* pSpaceChar = m_oLine.AddTail();
pLastChar = &m_oLine.m_pChars[m_oLine.m_lCharsTail - 2];
pSpaceChar->x = pLastChar->width;
pSpaceChar->width = dOffsetX - pLastChar->width;
pSpaceChar->unicode = 0xFFFF;
dOffsetX -= pLastChar->width;
}
}
}
else
{
// letter is shifted left relative to previous letter
// we react to this situation simply - just start a new line,
// after dumping the old one
// check if new glyph lands inside a synthetic space (0xFFFF) in current line
double sx = _x1 - m_oLine.m_dX;
double sy = _y1 - m_oLine.m_dY;
double newGlyphOffset = sx * m_oLine.m_ex + sy * m_oLine.m_ey;
// walk through chars accumulating offset to find which char we hit
double charOffset = 0;
LONG nCount = m_oLine.GetCountChars();
LONG nSplitIndex = -1;
for (LONG i = 0; i < nCount; ++i)
{
NSWasm::CHChar* pCh = &m_oLine.m_pChars[i];
if (i > 0)
charOffset += pCh->x; // x here is offset from previous char
if (pCh->unicode == 0xFFFF &&
newGlyphOffset >= charOffset &&
newGlyphOffset < charOffset + pCh->width)
{
nSplitIndex = i;
break;
}
}
if (nSplitIndex >= 0)
{
NSWasm::CHLine oSaved;
oSaved = m_oLine;
// --- Dump head: chars [0 .. nSplitIndex - 1] ---
m_oLine.m_lCharsTail = nSplitIndex; // truncate before the 0xFFFF
DumpLine(); // clears m_oLine
// --- Dump tail: chars [nSplitIndex + 1 .. nCount - 1] ---
LONG nTailStart = nSplitIndex + 1;
LONG nTailCount = nCount - nTailStart;
if (nTailCount > 0)
{
// Reconstruct baseline origin for the tail.
// Walk offsets up to nTailStart to find its position along baseline.
double tailOffset = 0;
for (LONG i = 1; i <= nTailStart; ++i)
tailOffset += oSaved.m_pChars[i].x;
m_oLine.m_bIsConstX = oSaved.m_bIsConstX;
m_oLine.m_dK = oSaved.m_dK;
m_oLine.m_dB = oSaved.m_dB;
m_oLine.m_ex = oSaved.m_ex;
m_oLine.m_ey = oSaved.m_ey;
m_oLine.m_dAscent = oSaved.m_dAscent;
m_oLine.m_dDescent = oSaved.m_dDescent;
m_oLine.m_bIsSetUpTransform = oSaved.m_bIsSetUpTransform;
m_oLine.m_sx = oSaved.m_sx;
m_oLine.m_sy = oSaved.m_sy;
m_oLine.m_shx = oSaved.m_shx;
m_oLine.m_shy = oSaved.m_shy;
// Origin of tail shifted along baseline
m_oLine.m_dX = oSaved.m_dX + tailOffset * oSaved.m_ex;
m_oLine.m_dY = oSaved.m_dY + tailOffset * oSaved.m_ey;
m_oLine.m_dEndX = m_oLine.m_dX;
m_oLine.m_dEndY = m_oLine.m_dY;
// Copy tail chars; first tail char has x=0 (it's now the line origin)
for (LONG i = 0; i < nTailCount; ++i)
{
NSWasm::CHChar* pDst = m_oLine.AddTail();
*pDst = oSaved.m_pChars[nTailStart + i];
if (i == 0)
pDst->x = 0; // first char offset is always 0
}
}
}
DumpLine();
m_oLine.m_bIsConstX = _isConstX;

View File

@ -424,8 +424,14 @@ namespace NSWasm
m_dX = oLine.m_dX;
m_dY = oLine.m_dY;
m_dEndX = oLine.m_dEndX;
m_dEndY = oLine.m_dEndY;
m_dK = oLine.m_dK;
m_dB = oLine.m_dB;
m_ex = oLine.m_ex;
m_ey = oLine.m_ey;
m_bIsConstX = oLine.m_bIsConstX;
m_lSizeChars = oLine.m_lSizeChars;
m_lCharsTail = oLine.m_lCharsTail;

View File

@ -367,7 +367,8 @@ namespace NSDocxRenderer
bForcedBold,
m_bUseDefaultFont,
m_bWriteStyleRaw,
m_bCollectMetaInfo
m_bCollectMetaInfo,
m_bFontSubstitution
);
}

View File

@ -2544,7 +2544,7 @@ void XlsConverter::convert(XLS::Obj * obj)
std::wstring objectId_bin = xlsx_context->get_mediaitems().add_control_activeX(target_bin);
NSFile::CFileBinary file;
if(xls_global_info->controls_data.second >= obj->pictFmla.lPosInCtlStm + obj->pictFmla.cbBufInCtlStm)
if (obj->pictFmla.lPosInCtlStm <= xls_global_info->controls_data.second && obj->pictFmla.cbBufInCtlStm <= xls_global_info->controls_data.second - obj->pictFmla.lPosInCtlStm)
{
if ( file.CreateFileW(xlsx_context->get_mediaitems().activeX_path() + target_bin) )
{

View File

@ -140,6 +140,8 @@ void AutoFilter::readFields(CFRecord& record)
if (record.getRdPtr() - pos_record < size)
{
int sz = size - (record.getRdPtr() - pos_record);
sz = (std::min)(sz, (int)(record.getDataSize() - record.getRdPtr()));
char *dd = new char [sz];
memcpy(dd, record.getCurData<char>(), sz);

View File

@ -54,7 +54,7 @@ void RichTextStream::readFields(CFRecord& record)
{
record >> frtHeader >> dwCheckSum >> cb;
if (cb > 0 &&cb < 0xffff)
if (cb > 0 && cb < 0xffff && cb <= record.getDataSize() - record.getRdPtr())
{
rgb = std::string(record.getCurData<char>(), cb);
record.skipNunBytes(cb);

View File

@ -44,7 +44,7 @@ void SXViewEx::readFields(CFRecord& record)
{
record >> frtHeaderOld >> csxth >> csxpi >> csxvdtex >> cbFuture;
if (cbFuture)
if (cbFuture > 0 && cbFuture <= record.getDataSize() - record.getRdPtr())
rgbFuture = std::string(record.getCurData<char>(), cbFuture);
record.skipNunBytes(record.getDataSize() - record.getRdPtr());

View File

@ -58,7 +58,7 @@ void TextPropsStream::readFields(CFRecord& record)
_UINT32 cb=0;
record >> cb;
if (cb > 0)
if (cb > 0 && cb <= record.getDataSize() - record.getRdPtr())
{
xml_ = std::string( record.getCurData<char>(), cb);
record.skipNunBytes(cb);

View File

@ -782,6 +782,8 @@ void AnyString::ReadComplexData(IBinaryReader* reader)
}
void AnyString::ReadComplexData(XLS::CFRecord& record)
{
if (op > record.getDataSize() - record.getRdPtr()) return;
std::wstring tmp;
#if defined(_WIN32) || defined(_WIN64)
tmp = std::wstring(record.getCurData<wchar_t>(), op / 2);
@ -1029,6 +1031,8 @@ void XmlString::ReadComplexData(IBinaryReader* reader)
}
void XmlString::ReadComplexData(XLS::CFRecord& record)
{
if (op > record.getDataSize() - record.getRdPtr()) return;
boost::shared_array<char> buffer(new char[op]);
memcpy(buffer.get(), record.getCurData<char>(), op);
@ -1044,7 +1048,7 @@ void MetroBlob::ReadComplexData(IBinaryReader* reader)
}
void MetroBlob::ReadComplexData(XLS::CFRecord& record)
{
int pos = record.getRdPtr();
if (op > record.getDataSize() - record.getRdPtr()) return;
data = std::make_pair(boost::shared_array<unsigned char>(new unsigned char[op]), op);

View File

@ -150,16 +150,16 @@ int XLUnicodeRichExtendedString::serialize (std::wostream & _stream)
}
int XLUnicodeRichExtendedString::serialize_rPr (std::wostream & _stream, int iFmt)
{
if (!pGlobalWorkbookInfoPtr) return 0;
if (!pGlobalWorkbookInfoPtr) return 0;
int sz = pGlobalWorkbookInfoPtr->m_arFonts.size();
if (iFmt -1 > sz || iFmt < 1) return 0;
if (iFmt > sz || iFmt < 1) return 0;
CP_XML_WRITER(_stream)
{
CP_XML_NODE(L"rPr")
{
Font * font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts[iFmt-1].get());
Font * font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts[iFmt - 1].get());
if (font) font->serialize_properties(CP_XML_STREAM(), true);
}

View File

@ -126,12 +126,15 @@ const bool ATTACHEDLABEL::loadContent(BinProcessor& proc)
elements_.pop_back();
ObjectLink *o_l = dynamic_cast<ObjectLink*>(m_ObjectLink.get());
m_iLinkObject = o_l->wLinkObj;
Pos * pos = dynamic_cast<Pos*>(m_Pos.get());
if (pos)
pos->m_iLinkObject = m_iLinkObject;
if (o_l)
{
m_iLinkObject = o_l->wLinkObj;
Pos* pos = dynamic_cast<Pos*>(m_Pos.get());
if (pos)
pos->m_iLinkObject = m_iLinkObject;
}
}
if (proc.optional<DataLabExtContents>())
@ -393,12 +396,12 @@ int ATTACHEDLABEL::serialize(std::wostream & _stream, bool isPosition)
int ATTACHEDLABEL::serialize_rPr (std::wostream & _stream, int iFnt, bool rtl, bool defRPr)
{
if (!pGlobalWorkbookInfoPtr) return 0;
if (!pGlobalWorkbookInfoPtr) return 0;
int sz = pGlobalWorkbookInfoPtr->m_arFonts.size();
if (iFnt - 1 > sz || iFnt < 1) return 0;
if (iFnt > sz || iFnt < 1) return 0;
Font * font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts[iFnt -1].get());
Font * font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts[iFnt - 1].get());
Text * text_props = dynamic_cast<Text*>(m_TextProperties.get());

View File

@ -128,7 +128,9 @@ void AXISPARENT::concatinate_second (BaseObjectPtr & addit)
for (size_t i = 0; i < second->m_arCRT.size(); i++)
{
CRT* crt = dynamic_cast<CRT*>(second->m_arCRT[i].get());
crt->m_indAXISPARENT = 1;
if (crt)
crt->m_indAXISPARENT = 1;
m_arCRT.push_back(second->m_arCRT[i]);
}

View File

@ -323,13 +323,15 @@ int SUPBOOK::serialize_book(std::wostream & strm)
for (size_t k = j; k < m_arXCT[i].m_arCRN.size(); k++)
{
cell = dynamic_cast<CRN*>(m_arXCT[i].m_arCRN[k].get());
if (!cell) continue;
if (cell->row != current_row)
{
j = k - 1;
break;
}
for (unsigned char col = cell->colFirst, v = 0; col <= cell->colLast; col++, v++)
for (unsigned char col = cell->colFirst, v = 0; col <= cell->colLast && v < cell->crnOper.size(); col++, v++)
{
CP_XML_NODE(L"cell")
{

View File

@ -509,7 +509,7 @@ void ChartSheetSubstream::recalc(CHARTFORMATS* charts)
iCrt = serCrt->id;
while ((parent0->m_arCRT.size() <= iCrt) && (ind_AXIS < charts->m_arAXISPARENT.size()) && (charts->m_arAXISPARENT.size() > 1))
while ((parent0->m_arCRT.size() <= iCrt) && (ind_AXIS + 1 < charts->m_arAXISPARENT.size()) && (charts->m_arAXISPARENT.size() > 1))
{
parent0 = dynamic_cast<AXISPARENT*>(charts->m_arAXISPARENT[++ind_AXIS].get());

View File

@ -31,7 +31,8 @@
*/
#include "Unit.h"
#include <cwchar>
#include <mutex>
#include "../../Common/3dParty/cryptopp/osrng.h"
double Cm_To_Mm (const double &dValue)
{
@ -764,30 +765,36 @@ namespace XmlUtils
}
return std::rand();
}
static unsigned int Rand1()
{
static CryptoPP::AutoSeededRandomPool prng;
static std::mutex prng_mutex;
unsigned int result;
std::lock_guard<std::mutex> lock(prng_mutex);
prng.GenerateBlock(reinterpret_cast<unsigned char*>(&result), sizeof(result));
return result;
}
int GenerateInt()
{
//todo c++11 <random>
return ((Rand() & 0x7FFF) | ((Rand() & 0x7FFF) << 15) | ((Rand() & 0x3) << 30));
return static_cast<int>(Rand1());
}
std::wstring GenerateGuid()
{
std::wstring result;
//#if defined (_WIN32) || defined(_WIN64)
// GUID guid;
// CoCreateGuid(&guid);
//
// OLECHAR* guidString;
// StringFromCLSID(guid, &guidString);
//
// result = std::wstring(guidString);
//
// CoTaskMemFree(guidString);
//#else
std::wstringstream sstream;
sstream << boost::wformat(L"%04X%04X-%04X-%04X-%04X-%04X%04X%04X") % (Rand() & 0xff) % (Rand() & 0xff) % (Rand() & 0xff) % ((Rand() & 0x0fff) | 0x4000) % ((Rand() % 0x3fff) + 0x8000) % (Rand() & 0xff) % (Rand() & 0xff) % (Rand() & 0xff);
sstream << boost::wformat(L"%04X%04X-%04X-%04X-%04X-%04X%04X%04X")
% (Rand1() & 0xffff)
% (Rand1() & 0xffff)
% (Rand1() & 0xffff)
% ((Rand1() & 0x0fff) | 0x4000)
% ((Rand1() & 0x3fff) | 0x8000)
% (Rand1() & 0xffff)
% (Rand1() & 0xffff)
% (Rand1() & 0xffff);
result = sstream.str();
//#endif
return result;
}
std::wstring DoubleToString( double value, wchar_t* format )

View File

@ -81,6 +81,9 @@ namespace PPTX
{
pWriter->StartRecord(EFFECT_TYPE_ALPHAINV);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->WriteRecord1(0, Color);
pWriter->EndRecord();

View File

@ -87,6 +87,9 @@ namespace PPTX
{
pWriter->StartRecord(EFFECT_TYPE_ALPHAMOD);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->WriteRecord1(0, cont);
pWriter->EndRecord();

View File

@ -82,6 +82,9 @@ namespace PPTX
{
pWriter->StartRecord(EFFECT_TYPE_CLRREPL);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->WriteRecord1(0, Color);
pWriter->EndRecord();

View File

@ -82,6 +82,9 @@ namespace PPTX
{
pWriter->StartRecord(EFFECT_TYPE_FILL);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->WriteRecord1(0, Fill);
pWriter->EndRecord();

View File

@ -16,6 +16,7 @@ include($$CORE_ROOT_DIR/Common/base.pri)
include($$CORE_ROOT_DIR/Common/3dParty/icu/icu.pri)
include($$CORE_ROOT_DIR/Common/3dParty/boost/boost.pri)
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib
ADD_DEPENDENCY(kernel)
SOURCES += $$PWD/cconversionsmtoooxml.cpp \

View File

@ -2674,6 +2674,9 @@ HRESULT CPdfWriter::AddAnnotField(NSFonts::IApplicationFonts* pAppFonts, CAnnotF
CAnnotFieldInfo::CWidgetAnnotPr::CSignatureWidgetPr* pPr = oInfo.GetWidgetAnnotPr()->GetSignatureWidgetPr();
PdfWriter::CSignatureWidget* pSignatureWidget = (PdfWriter::CSignatureWidget*)pAnnot;
}
if (m_bSplit)
pWidgetAnnot->RemoveAP();
}
else if (oInfo.IsLink())
{

View File

@ -4082,6 +4082,15 @@ void Gfx::opXObject(Object args[], int numArgs) {
Object opiDict;
#endif
double *ctm;
double det;
ctm = state->getCTM();
det = ctm[0] * ctm[3] - ctm[1] * ctm[2];
if (fabs(det) <= 1e-10) {
return;
}
if (!ocState && !out->needCharCount()) {
return;
}

View File

@ -100,45 +100,8 @@ const std::vector<std::string> TxtFile::readUtf8Lines(int IdxEncoding)
{
unicode_content = conv.toUnicode(file_data.get(), read_size, 65001);
}
#if !defined(_WIN32) && !defined(_WIN64)
std::wstring regular_text;
std::string utf8_result;
for (size_t i = 0; i < unicode_content.size(); i++)
{
unsigned int cp = static_cast<unsigned int>(unicode_content[i]);
if (cp > 0xFFFF)
{
if (!regular_text.empty())
{
utf8_result += conv.fromUnicode(regular_text, "UTF-8");
regular_text.clear();
}
utf8_result += static_cast<char>(0xF0 | ((cp >> 18) & 0x07));
utf8_result += static_cast<char>(0x80 | ((cp >> 12) & 0x3F));
utf8_result += static_cast<char>(0x80 | ((cp >> 6) & 0x3F));
utf8_result += static_cast<char>(0x80 | (cp & 0x3F));
}
else
{
regular_text += unicode_content[i];
}
}
if (!regular_text.empty())
{
utf8_result += conv.fromUnicode(regular_text, "UTF-8");
}
utf8_content = utf8_result;
#else
utf8_content = conv.fromUnicode(unicode_content, "UTF-8");
#endif
}
size_t lineCount = 0;
if (!utf8_content.empty())

View File

@ -105,6 +105,8 @@ namespace NSUnicodeConverter
UErrorCode status = U_ZERO_ERROR;
int32_t nUCharCapacity = (int32_t)nInputLen;// UTF-16 uses 2 code-points per char
if (sizeof(wchar_t) > 2)
nUCharCapacity *= 2;
UChar* pUChar = new UChar[(uint32_t)nUCharCapacity * sizeof(UChar)];
if (pUChar)
@ -169,8 +171,9 @@ namespace NSUnicodeConverter
if (U_SUCCESS(status))
{
int32_t nUCharCapacity = (int32_t)nInputLen;// UTF-16 uses 2 code-points per char
if (sizeof(wchar_t) > 2)
nUCharCapacity *= 2;
//UChar* pUChar = new UChar[nUCharCapacity];
UChar* pUChar = (UChar*)malloc((uint32_t)nUCharCapacity * sizeof(UChar));
if (pUChar)
{
@ -196,7 +199,7 @@ namespace NSUnicodeConverter
sRes.clear();
}
}
//delete []pUCharStart;
free(pUChar);
}
ucnv_close(conv);
}