Compare commits

...

9 Commits

5 changed files with 19 additions and 40 deletions

View File

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

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);
}