Compare commits

..

19 Commits

Author SHA1 Message Date
64ac836e4e Fixes 2025-12-09 12:22:43 +03:00
97608010ec Fix bug 2025-11-21 14:27:48 +03:00
0c18faa594 Fix compiler version detection 2025-11-21 14:21:21 +03:00
c50a027a61 Fix core build 2025-11-19 18:42:39 +03:00
cae736081d Add ARM64 sysroot in flags 2025-11-12 07:18:18 +03:00
52bf1a6988 Merge pull request 'Fix bugs' (#517) from fix/bug-77446 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/517
2025-11-10 12:46:20 +00:00
27746f5c2b Merge pull request 'fix bug #76076' (#519) from fix/bug76076 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/519
2025-11-10 11:57:02 +00:00
d3710a755e Merge pull request 'Fix md bugs' (#518) from fix/md into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/518
2025-11-10 11:56:06 +00:00
5c8dcd7ed2 Merge pull request 'Fix bug 78035' (#520) from fix/pdf-bugs into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/520
2025-11-10 11:51:18 +00:00
5c0b3744ee Fix bug 78035 2025-11-10 13:53:51 +03:00
1f3467d75f Fix serNum loading 2025-11-10 15:38:25 +06:00
a1d8597b4f fix bug #76076 2025-11-10 15:02:27 +06:00
15dc718211 Fix bug #74969 2025-11-08 00:23:30 +03:00
1db12e66c6 For bug #74743 2025-11-08 00:07:43 +03:00
5de19652f2 Fix bug #74726 2025-11-07 14:36:31 +03:00
76b5bd594d Fix bug #77446 2025-11-07 13:22:07 +03:00
61b55c9230 Merge pull request 'Fix bugs in svg' (#516) from fix/bug-78017 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/516
2025-11-07 09:51:04 +00:00
22aecb56ec Fix bug in svg 2025-11-07 12:48:08 +03:00
3586a010a8 Fix bug #78017 2025-11-06 20:48:57 +03:00
19 changed files with 156 additions and 97 deletions

View File

@ -69,7 +69,8 @@ namespace NSCSS
R_Highlight,
R_Shd,
R_SmallCaps,
R_Kern
R_Kern,
R_Vanish
} RunnerProperties;
typedef enum

View File

@ -509,6 +509,9 @@ namespace NSCSS
else if (L"serif" == wsFontFamily)
wsFontFamily = L"Times New Roman";
if (oStyle.m_oDisplay.GetDisplay() == L"none")
oXmlElement.AddPropertiesInR(RProperties::R_Vanish, L"true");
oXmlElement.AddPropertiesInR(RProperties::R_RFonts, oStyle.m_oFont.GetFamily().ToWString());
oXmlElement.AddPropertiesInR(RProperties::R_I, oStyle.m_oFont.GetStyle().ToWString());
oXmlElement.AddPropertiesInR(RProperties::R_B, oStyle.m_oFont.GetWeight().ToWString());

View File

@ -473,6 +473,12 @@ std::wstring CXmlElement::ConvertRStyle(bool bIsLite) const
sRStyle += L"<w:kern w:val=\"" + oItem.second + L"\"/>";
break;
}
case CSSProperties::RunnerProperties::R_Vanish:
{
if (oItem.second == L"true")
sRStyle += L"<w:vanish/>";
break;
}
default:
break;
}

View File

@ -5,6 +5,9 @@
namespace Md
{
#define MD_PARSER_FLAGS MD_DIALECT_GITHUB | MD_FLAG_NOINDENTEDCODEBLOCKS | MD_HTML_FLAG_SKIP_UTF8_BOM | MD_FLAG_HARD_SOFT_BREAKS | MD_HTML_FLAG_XHTML
#define MD_RENDERER_FLAGS MD_HTML_FLAG_XHTML
void ToHtml(const MD_CHAR* pValue, MD_SIZE uSize, void* pData)
{
if (NULL != pData)
@ -14,7 +17,7 @@ void ToHtml(const MD_CHAR* pValue, MD_SIZE uSize, void* pData)
std::string ConvertMdStringToHtml(const std::string& sMdString)
{
std::string sData;
md_html(sMdString.c_str(), sMdString.length(), ToHtml, &sData, 0, 0);
md_html(sMdString.c_str(), sMdString.length(), ToHtml, &sData, MD_PARSER_FLAGS, MD_RENDERER_FLAGS);
return sData;
}
@ -36,13 +39,13 @@ void WriteBaseHtmlStyles(NSFile::CFileBinary& oFile)
oFile.WriteStringUTF8(L"img { vertical-align: middle; }");
// Styles for tables
oFile.WriteStringUTF8(L"table { margin-bottom: 20px; width: 100%; max-width: 100%; border-spacing:0; border-collapse: collapse; border-color: gray;}");
oFile.WriteStringUTF8(L"thead { display: table-header-group; vertical-align: middle; }");
oFile.WriteStringUTF8(L"table { margin-bottom: 20px; width: 100%; max-width: 100%; border-spacing:0; border-collapse: collapse; border-color: gray; vertical-align:middle;}");
oFile.WriteStringUTF8(L"thead { display: table-header-group;}");
oFile.WriteStringUTF8(L"tr { display: table-row; }");
oFile.WriteStringUTF8(L"th { text-align: center; display: table-cell; font-weight: bold; }");
oFile.WriteStringUTF8(L"table thead tr th, table thead tr td { vertical-align: bottom; border-bottom: 2px solid #ddd; border-top: none; }");
oFile.WriteStringUTF8(L"table tbody tr th, table tbody tr td { padding 8px; line-height: 1.4; vertical-align: top; border-top: 1px solid #ddd; }");
oFile.WriteStringUTF8(L"table thead tr th, table thead tr td { border-bottom: 2px solid #ddd; border-top: none; }");
oFile.WriteStringUTF8(L"table tbody tr th, table tbody tr td { padding 8px; line-height: 1.4; border-top: 1px solid #ddd; }");
// Styles for blockquote
oFile.WriteStringUTF8(L"blockquote { border-left: 3px solid #e9e9e9; margin: 1.5em 0; padding: 0.5em 10px 0.5em 24px; font-size: 1.25rem; display: block; margin-top: 8pt; font-style: italic; color: #404040; }");
@ -86,9 +89,7 @@ bool ConvertMdFileToHtml(const std::wstring& wsPathToMdFile, const std::wstring&
bool bResult = true;
if (0 != md_html(sMdData.c_str(), sMdData.length(), ToHtmlFile, &oFile,
MD_DIALECT_GITHUB | MD_FLAG_NOINDENTEDCODEBLOCKS | MD_HTML_FLAG_SKIP_UTF8_BOM | MD_FLAG_HARD_SOFT_BREAKS,
0))
if (0 != md_html(sMdData.c_str(), sMdData.length(), ToHtmlFile, &oFile, MD_PARSER_FLAGS, MD_RENDERER_FLAGS))
bResult = false;
oFile.WriteStringUTF8(L"</body></html>");

View File

@ -202,12 +202,10 @@ core_win_64 {
core_linux {
DEFINES += LINUX _LINUX
QMAKE_CUSTOM_SYSROOT = $$(QMAKE_CUSTOM_SYSROOT)
QMAKE_CUSTOM_SYSROOT_BIN = $$(QMAKE_CUSTOM_SYSROOT)/usr/bin/
core_linux_64 {
!linux_arm64 { # x86_64
QMAKE_CUSTOM_SYSROOT = $$(QMAKE_CUSTOM_SYSROOT)
QMAKE_CUSTOM_SYSROOT_BIN = $$(QMAKE_CUSTOM_SYSROOT)/usr/bin/
QMAKE_CUSTOM_SYSROOT_LIB = $$(QMAKE_CUSTOM_SYSROOT)/usr/lib/x86_64-linux-gnu
!isEmpty(QMAKE_CUSTOM_SYSROOT) {
message("using custom sysroot $$QMAKE_CUSTOM_SYSROOT")
@ -224,6 +222,41 @@ core_linux {
}
}
core_linux_32 {
CORE_BUILDS_PLATFORM_PREFIX = linux_32
}
core_linux_64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_64
}
core_linux_arm {
CORE_BUILDS_PLATFORM_PREFIX = arm
}
linux_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_arm64
DEFINES += _ARM_ALIGN_
ARM64_TOOLCHAIN_BIN = $$(ARM64_TOOLCHAIN_BIN)
ARM64_TOOLCHAIN_BIN_PREFIX = $$(ARM64_TOOLCHAIN_BIN_PREFIX)
ARM64_SYSROOT = $$(ARM64_SYSROOT)
!isEmpty(ARM64_TOOLCHAIN_BIN){
!isEmpty(ARM64_TOOLCHAIN_BIN_PREFIX){
ARM64_TOOLCHAIN_BIN_FULL = $$ARM64_TOOLCHAIN_BIN/$$ARM64_TOOLCHAIN_BIN_PREFIX
message("using arm64 toolchain $$ARM64_TOOLCHAIN_BIN")
QMAKE_CC = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "gcc")
QMAKE_CXX = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK_SHLIB = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_AR = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "ar cqs")
QMAKE_OBJCOPY = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "objcopy")
QMAKE_NM = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "nm -P")
QMAKE_STRIP = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "strip")
}
}
}
gcc {
COMPILER_VERSION = $$system($$QMAKE_CXX " -dumpversion")
COMPILER_MAJOR_VERSION_ARRAY = $$split(COMPILER_VERSION, ".")
@ -324,12 +357,6 @@ core_win_64 {
core_win_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = win_arm64
}
core_linux_32 {
CORE_BUILDS_PLATFORM_PREFIX = linux_32
}
core_linux_64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_64
}
core_mac_64 {
CORE_BUILDS_PLATFORM_PREFIX = mac_64
@ -338,34 +365,6 @@ core_mac_64 {
QMAKE_APPLE_DEVICE_ARCHS = arm64
}
}
core_linux_arm {
CORE_BUILDS_PLATFORM_PREFIX = arm
}
linux_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_arm64
DEFINES += _ARM_ALIGN_
ARM64_TOOLCHAIN_BIN = $$(ARM64_TOOLCHAIN_BIN)
ARM64_TOOLCHAIN_BIN_PREFIX = $$(ARM64_TOOLCHAIN_BIN_PREFIX)
!isEmpty(ARM64_TOOLCHAIN_BIN){
!isEmpty(ARM64_TOOLCHAIN_BIN_PREFIX){
ARM64_TOOLCHAIN_BIN_FULL = $$ARM64_TOOLCHAIN_BIN/$$ARM64_TOOLCHAIN_BIN_PREFIX
message("using arm64 toolchain $$ARM64_TOOLCHAIN_BIN")
QMAKE_CC = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "gcc")
QMAKE_CXX = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK_SHLIB = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_AR = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "ar cqs")
QMAKE_OBJCOPY = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "objcopy")
QMAKE_NM = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "nm -P")
QMAKE_STRIP = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "strip")
}
}
}
core_ios {
CORE_BUILDS_PLATFORM_PREFIX = ios

View File

@ -159,8 +159,7 @@ bool CSvgFile::Draw(IRenderer *pRenderer, double dX, double dY, double dWidth, d
dTranslateY -= oViewBox.m_oY.ToDouble(NSCSS::Pixel) * dScaleY * dM22;
}
const double dMinScale = std::min(dScaleX, dScaleY);
pRenderer->SetTransform(dM11 * dMinScale, 0, 0, dM22 * dMinScale, dTranslateX, dTranslateY);
pRenderer->SetTransform(dM11 * dScaleX, 0, 0, dM22 * dScaleY, dTranslateX, dTranslateY);
bool bResult = m_pContainer->Draw(pRenderer, this);

View File

@ -294,7 +294,7 @@ namespace SVG
}
else if ("font" == sElementName)
{
pObject = CObject::Create<CFont>(oReader, pFile);
pObject = CObject::Create<CFont>(oReader, pFile, pFile);
}
if (NULL == pObject)

View File

@ -2,22 +2,23 @@
namespace SVG
{
CGlyph::CGlyph(CSvgReader& oReader)
CGlyph::CGlyph(CSvgReader& oReader, CSvgFile* pFile)
: CPath(oReader)
{
START_READ_ATTRIBUTES(oReader)
{
if ("unicode" == sAttributeName)
{
const std::wstring wsUnicode{oReader.GetText()};
{}
if (!wsUnicode.empty())
m_wchUnicode = wsUnicode[0];
}
else if ("horiz-adv-x" == sAttributeName)
m_oHorizAdvX.SetValue(oReader.GetText());
void CGlyph::SetAttribute(const std::string& sName, CSvgReader& oReader)
{
if ("unicode" == sName)
{
const std::wstring wsUnicode{oReader.GetText()};
if (!wsUnicode.empty())
m_wchUnicode = wsUnicode[0];
}
END_READ_ATTRIBUTES(oReader)
else if ("horiz-adv-x" == sName)
m_oHorizAdvX.SetValue(oReader.GetText());
else
CPath::SetAttribute(sName, oReader);
}
wchar_t CGlyph::GetUnicode() const
@ -28,10 +29,10 @@ namespace SVG
CFontFace::CFontFace(CSvgReader& oReader)
{}
CFont::CFont(CSvgReader& oReader)
CFont::CFont(CSvgReader& oReader, CSvgFile* pFile)
: CAppliedObject(oReader), m_pMissingGlyph(NULL)
{
ParseGlyphs(oReader);
ParseGlyphs(oReader, pFile);
}
CFont::~CFont()
@ -95,7 +96,7 @@ namespace SVG
{ \
oMatrix.Scale(1. / dGlyphScale, -1. / dGlyphScale); \
pRenderer->SetTransform(oMatrix.sx(), oMatrix.shy(), oMatrix.shx(), oMatrix.sy(), oMatrix.tx(), oMatrix.ty()); \
} \
}
for (wchar_t wchGlyph : wsText)
{
@ -128,13 +129,13 @@ namespace SVG
return true;
}
void CFont::ParseGlyphs(CSvgReader& oReader)
void CFont::ParseGlyphs(CSvgReader& oReader, CSvgFile* pFile)
{
WHILE_READ_NEXT_NODE_WITH_NAME(oReader)
{
if ("glyph" == sNodeName)
{
CGlyph *pGlyph = new CGlyph(oReader);
CGlyph *pGlyph = CObject::Create<CGlyph>(oReader, pFile, pFile);
if (NULL == pGlyph)
continue;

View File

@ -8,7 +8,9 @@ namespace SVG
class CGlyph : public CPath
{
public:
CGlyph(CSvgReader& oReader);
CGlyph(CSvgReader& oReader, CSvgFile* pFile = nullptr);
void SetAttribute(const std::string& sName, CSvgReader& oReader) override;
wchar_t GetUnicode() const;
private:
@ -37,7 +39,7 @@ namespace SVG
class CFont : public CAppliedObject
{
friend class CObject;
CFont(CSvgReader& oReader);
CFont(CSvgReader& oReader, CSvgFile* pFile = nullptr);
public:
~CFont();
@ -48,7 +50,7 @@ namespace SVG
bool Apply(IRenderer* pRenderer, const CSvgFile *pFile, const TBounds &oObjectBounds) override;
bool Draw(const std::wstring& wsText, const double& dX, const double& dY, const double& dFontHeight, IRenderer* pRenderer, const CSvgFile *pFile, CommandeMode oMode = CommandeModeDraw, const TSvgStyles* pStyles = NULL, const CRenderedObject* pContexObject = NULL) const;
private:
void ParseGlyphs(CSvgReader& oReader);
void ParseGlyphs(CSvgReader& oReader, CSvgFile* pFile = nullptr);
TFontArguments m_oArguments;

View File

@ -163,9 +163,9 @@ namespace SVG
else if (eNodeType == XmlUtils::XmlNodeType_Element && "tspan" == oReader.GetName())
{
const TBounds oBounds{GetBounds()};
const Point oPoint{oBounds.m_dRight, oBounds.m_dTop};
const Point oPoint{oBounds.m_dRight, oBounds.m_dBottom};
AddObject(CRenderedObject::Create<CTSpan>(oReader, pSvgFile, this, m_pFontManager, oPoint));
AddObject(CObject::Create<CTSpan>(oReader, pSvgFile, this, m_pFontManager, oPoint));
}
}
}
@ -187,8 +187,14 @@ namespace SVG
{
if (!m_wsText.empty())
{
ApplyFont(pRenderer, dX, dY);
Aggplus::CMatrix oCurrentMatrix;
ApplyFont(pRenderer, dX, dY, oCurrentMatrix);
pRenderer->CommandDrawText(m_wsText, dX, dY, 0, 0);
pRenderer->SetTransform(oCurrentMatrix.sx(), oCurrentMatrix.shy(),
oCurrentMatrix.shx(), oCurrentMatrix.sy(),
oCurrentMatrix.tx(), oCurrentMatrix.ty());
}
}
@ -230,12 +236,12 @@ namespace SVG
nTypePath += c_nWindingFillMode;
}
void CTSpan::ApplyFont(IRenderer* pRenderer, double& dX, double& dY) const
void CTSpan::ApplyFont(IRenderer* pRenderer, double& dX, double& dY, Aggplus::CMatrix& oOldMatrix) const
{
std::wstring wsFontFamily = DefaultFontFamily;
double dFontSize = ((!m_oFont.GetSize().Empty()) ? m_oFont.GetSize().ToDouble(NSCSS::Pixel) : DEFAULT_FONT_SIZE) * 72. / 25.4;
Normalize(pRenderer, dX, dY, dFontSize);
Normalize(pRenderer, dX, dY, dFontSize, oOldMatrix);
if (!m_oFont.GetFamily().Empty())
{
@ -340,7 +346,7 @@ namespace SVG
if (NULL != pParentTSpan)
{
m_oFont.UpdateSize((!pParentTSpan->m_oFont.GetSize().Empty()) ? pParentTSpan->m_oFont.GetSize().ToDouble(NSCSS::Pixel) : DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);
m_oFont.UpdateSize((!pParentTSpan->m_oFont.GetSize().Empty()) ? pParentTSpan->m_oFont.GetSize().ToDouble(NSCSS::Point) : DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);
return;
}
}
@ -478,7 +484,7 @@ namespace SVG
dY = m_oY.ToDouble(NSCSS::Pixel, oBounds.m_dBottom - oBounds.m_dTop);
}
void CTSpan::Normalize(IRenderer *pRenderer, double &dX, double &dY, double &dFontHeight) const
void CTSpan::Normalize(IRenderer *pRenderer, double &dX, double &dY, double &dFontHeight, Aggplus::CMatrix& oOldMatrix) const
{
if (NULL == pRenderer)
return;
@ -521,6 +527,8 @@ namespace SVG
pRenderer->GetTransform(&dM11, &dM12, &dM21, &dM22, &dDx, &dDy);
oOldMatrix.SetElements(dM11, dM12, dM21, dM22, dDx, dDy);
Aggplus::CMatrix oMatrix(dM11, dM12, dM21, dM22, dDx, dDy);
oMatrix.Scale(dXScale, dYScale);

View File

@ -32,7 +32,7 @@ namespace SVG
void InheritStyles(const CTSpan* pTSpan);
private:
void ApplyStyle(IRenderer* pRenderer, const TSvgStyles* pStyles, const CSvgFile* pFile, int& nTypePath, const CRenderedObject* pContexObject = NULL) const override;
void ApplyFont(IRenderer* pRenderer, double& dX, double& dY) const;
void ApplyFont(IRenderer* pRenderer, double& dX, double& dY, Aggplus::CMatrix& oOldMatrix) const;
void UpdateFontSize();
bool UseExternalFont(const CSvgFile* pFile, double dX, double dY, IRenderer* pRenderer, CommandeMode oMode = CommandeModeDraw, const TSvgStyles* pOtherStyles = NULL, const CRenderedObject* pContexObject = NULL) const;
@ -44,7 +44,7 @@ namespace SVG
void CalculatePosition(double& dX, double& dY) const;
void Normalize(IRenderer* pRenderer, double& dX, double& dY, double& dFontHeight) const;
void Normalize(IRenderer* pRenderer, double& dX, double& dY, double& dFontHeight, Aggplus::CMatrix& oOldMatrix) const;
void SetPosition(const Point& oPosition);
void SetPositionFromParent(CRenderedObject* pParent);

View File

@ -3059,12 +3059,6 @@ private:
std::wstring sNote = GetSubClass(oXml, sSelectors);
if (NULL != sSelectors.back().m_pCompiledStyle && L"none" == sSelectors.back().m_pCompiledStyle->m_oDisplay.GetDisplay().ToWString())
{
sSelectors.pop_back();
return false;
}
bool bResult = true;
const HtmlTag eHtmlTag{GetHtmlTag(sName)};

View File

@ -81,7 +81,12 @@ void PtgExtraArray::load(CFRecord& record)
for(int i = 0; i < (tempcols) * (temprows); ++i)
{
if (record.getRdPtr() >= record.getDataSize())
break;
{
unsigned char rec_type = SerAr::SerType::typeSerNil;
SerArPtr ser(SerAr::createSerAr(rec_type));
array_.push_back(ser);
continue;
}
unsigned char rec_type;
record >> rec_type;
if (record.getGlobalWorkbookInfo()->Version >= 0x0800)
@ -138,24 +143,31 @@ void PtgExtraArray::save(CFRecord& record)
const std::wstring PtgExtraArray::toString() const
{
std::wstring ret_val;
unsigned char col_cnt = cols + 1;
unsigned char col_cnt = cols;
if (array_.empty()) return L"";
for(std::vector<SerArPtr>::const_iterator it = array_.begin(), itEnd = --array_.end(); it != itEnd; ++it)
{
ret_val += (*it)->toString();
if(--col_cnt)
auto tempVal = (*it)->toString();
if(tempVal.empty())
tempVal = L"#N/A";
ret_val += tempVal;
if (col_cnt > 1)
{
ret_val += L',';
--col_cnt;
}
else
{
ret_val += L';';
col_cnt = cols + 1;
col_cnt = cols;
}
}
ret_val += array_.back()->toString();
auto tempVal = array_.back()->toString();
if(tempVal.empty())
tempVal = L"#N/A";
ret_val += tempVal;
return ret_val;
}

View File

@ -62,6 +62,16 @@ BiffStructurePtr SerNum::clone()
void SerNum::load(CFRecord& record)
{
record >> xnum;
// Excel limitations
constexpr double ExcelMinAbs = 2.229e-308;
constexpr double ExcelMax = 9.99999999999999e+307;
if(std::abs(xnum) < ExcelMinAbs && xnum != 0.0)
xnum = (xnum > 0) ? ExcelMinAbs : -ExcelMinAbs;
else if(xnum > ExcelMax)
xnum = ExcelMax;
else if(xnum < -ExcelMax)
xnum = -ExcelMax;
}
void SerNum::save(CFRecord& record)
@ -77,7 +87,10 @@ void SerNum::save(CFRecord& record)
const std::wstring SerNum::toString() const
{
return STR::double2str(xnum);
auto tempNum = STR::double2str(xnum);
if(tempNum == L"-nan")
tempNum = L"#NUM!";
return tempNum;
}

View File

@ -94,7 +94,11 @@ void SerStr::save(CFRecord& record)
const std::wstring SerStr::toString() const
{
return L"\"" + boost::algorithm::replace_all_copy(std::wstring(rgch), L"\"", L"\"\"") + L"\"";
std::wstring tempVal = rgch;
tempVal.erase(std::remove(tempVal.begin(), tempVal.end(), L'\0'), tempVal.end());
if(tempVal.size() > 255)
tempVal.resize(255);
return L"\"" + boost::algorithm::replace_all_copy(tempVal, L"\"", L"\"\"") + L"\"";
}

View File

@ -814,7 +814,10 @@ namespace OOX
if(m_oRowBreaks.IsInit())
m_oRowBreaks->toXML(writer);
if(m_oColBreaks.IsInit())
{
m_oColBreaks->m_fRowBreak = false;
m_oColBreaks->toXML(writer);
}
if (m_oCellWatches.IsInit())
m_oCellWatches->toXML(writer);
if(m_oDrawing.IsInit())

View File

@ -3193,7 +3193,10 @@ namespace OOX
}
void CRowColBreaks::toXML(NSStringUtils::CStringBuilder& writer) const
{
toXML2(writer, L"rowBreaks");
if(m_fRowBreak)
toXML2(writer, L"rowBreaks");
else
toXML2(writer, L"colBreaks");
}
void CRowColBreaks::toXML2(NSStringUtils::CStringBuilder& writer, const std::wstring& sName) const
{

View File

@ -754,6 +754,8 @@ namespace OOX
public:
nullable<SimpleTypes::CUnsignedDecimalNumber> m_oCount;
nullable<SimpleTypes::CUnsignedDecimalNumber> m_oManualBreakCount;
bool m_fRowBreak = true;
};
class CSheetProtection : public WritingElement

View File

@ -2525,6 +2525,8 @@ HRESULT CPdfWriter::AddAnnotField(NSFonts::IApplicationFonts* pAppFonts, CAnnotF
if (nFlags & (1 << 13))
{
pTextWidget->SetAPV();
m_pFont14 = NULL; m_pFont = NULL;
m_bNeedUpdateTextFont = true;
LONG nLen = 0;
BYTE* pRender = pPr->GetRender(nLen);
@ -2544,7 +2546,9 @@ HRESULT CPdfWriter::AddAnnotField(NSFonts::IApplicationFonts* pAppFonts, CAnnotF
if (m_bNeedUpdateTextFont)
UpdateFont();
if (m_pFont)
if (m_pFont14)
pFont = m_pFont14;
else if (m_pFont)
pFont = m_pDocument->CreateTrueTypeFont(m_pFont);
}
if (pFont)
@ -2592,6 +2596,8 @@ HRESULT CPdfWriter::AddAnnotField(NSFonts::IApplicationFonts* pAppFonts, CAnnotF
if (nFlags & (1 << 15))
{
pChoiceWidget->SetAPV();
m_pFont14 = NULL; m_pFont = NULL;
m_bNeedUpdateTextFont = true;
LONG nLen = 0;
BYTE* pRender = pPr->GetRender(nLen);
@ -2611,7 +2617,9 @@ HRESULT CPdfWriter::AddAnnotField(NSFonts::IApplicationFonts* pAppFonts, CAnnotF
if (m_bNeedUpdateTextFont)
UpdateFont();
if (m_pFont)
if (m_pFont14)
pFont = m_pFont14;
else if (m_pFont)
pFont = m_pDocument->CreateTrueTypeFont(m_pFont);
}
if (pFont)