mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Merge pull request #760 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
This commit is contained in:
@ -890,10 +890,10 @@ public:
|
||||
std::wstring sType;
|
||||
switch(byteType)
|
||||
{
|
||||
case styletype_Character: sType = _T("character");break;
|
||||
case styletype_Numbering: sType = _T("numbering");break;
|
||||
case styletype_Table: sType = _T("table");break;
|
||||
default: sType = _T("paragraph");break;
|
||||
case styletype_Character: sType = _T("character");break;
|
||||
case styletype_Numbering: sType = _T("numbering");break;
|
||||
case styletype_Table: sType = _T("table");break;
|
||||
default: sType = _T("paragraph");break;
|
||||
}
|
||||
if(!Id.empty())
|
||||
{
|
||||
@ -915,12 +915,31 @@ public:
|
||||
|
||||
sStyle += L">";
|
||||
pCStringWriter->WriteString(sStyle);
|
||||
if(!Aliases.empty())
|
||||
|
||||
if(!Name.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:name w:val=\"" + Name + L"\"/>");
|
||||
}
|
||||
if (!Aliases.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:aliases w:val=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Aliases);
|
||||
pCStringWriter->WriteString(L"\"/>");
|
||||
}
|
||||
if (!BasedOn.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:basedOn w:val=\"" + BasedOn + L"\"/>");
|
||||
}
|
||||
if (!NextId.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:next w:val=\"" + NextId + L"\"/>");
|
||||
}
|
||||
if (!Link.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:link w:val=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Link);
|
||||
pCStringWriter->WriteString(L"\"/>");
|
||||
}
|
||||
if(bautoRedefine)
|
||||
{
|
||||
if(autoRedefine)
|
||||
@ -928,17 +947,44 @@ public:
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:autoRedefine val=\"false\"/>");
|
||||
}
|
||||
if(!Name.empty())
|
||||
if (bhidden)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:name w:val=\"" + Name + L"\"/>");
|
||||
if (hidden)
|
||||
pCStringWriter->WriteString(L"<w:hidden/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:hidden val=\"false\"/>");
|
||||
}
|
||||
if(!BasedOn.empty())
|
||||
if (buiPriority)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:basedOn w:val=\"" + BasedOn + L"\"/>");
|
||||
pCStringWriter->WriteString(L"<w:uiPriority w:val=\"" + std::to_wstring(uiPriority) + L"\"/>");
|
||||
}
|
||||
if(!NextId.empty())
|
||||
if (bsemiHidden)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:next w:val=\"" + NextId + L"\"/>");
|
||||
if (semiHidden)
|
||||
pCStringWriter->WriteString(L"<w:semiHidden/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:semiHidden val=\"false\"/>");
|
||||
}
|
||||
if (bunhideWhenUsed)
|
||||
{
|
||||
if (unhideWhenUsed)
|
||||
pCStringWriter->WriteString(L"<w:unhideWhenUsed/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:unhideWhenUsed val=\"false\"/>");
|
||||
}
|
||||
if (bqFormat)
|
||||
{
|
||||
if (qFormat)
|
||||
pCStringWriter->WriteString(L"<w:qFormat/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:qFormat val=\"false\"/>");
|
||||
}
|
||||
if (blocked)
|
||||
{
|
||||
if (locked)
|
||||
pCStringWriter->WriteString(L"<w:locked/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:locked val=\"false\"/>");
|
||||
}
|
||||
if(bpersonal)
|
||||
{
|
||||
@ -961,61 +1007,17 @@ public:
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:personalReply val=\"false\"/>");
|
||||
}
|
||||
if(!Link.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:link w:val=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Link);
|
||||
pCStringWriter->WriteString(L"\"/>");
|
||||
}
|
||||
if(blocked)
|
||||
{
|
||||
if(locked)
|
||||
pCStringWriter->WriteString(L"<w:locked/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:locked val=\"false\"/>");
|
||||
}
|
||||
if(bqFormat)
|
||||
{
|
||||
if(qFormat)
|
||||
pCStringWriter->WriteString(L"<w:qFormat/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:qFormat val=\"false\"/>");
|
||||
}
|
||||
if(buiPriority)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:uiPriority w:val=\"" + std::to_wstring(uiPriority) + L"\"/>");
|
||||
}
|
||||
if(bhidden)
|
||||
{
|
||||
if(hidden)
|
||||
pCStringWriter->WriteString(L"<w:hidden/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:hidden val=\"false\"/>");
|
||||
}
|
||||
if(bsemiHidden)
|
||||
{
|
||||
if(semiHidden)
|
||||
pCStringWriter->WriteString(L"<w:semiHidden/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:semiHidden val=\"false\"/>");
|
||||
}
|
||||
if(bunhideWhenUsed)
|
||||
{
|
||||
if(unhideWhenUsed)
|
||||
pCStringWriter->WriteString(L"<w:unhideWhenUsed/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:unhideWhenUsed val=\"false\"/>");
|
||||
}
|
||||
if(!TextPr.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(TextPr);
|
||||
}
|
||||
if(!ParaPr.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:pPr>");
|
||||
pCStringWriter->WriteString(ParaPr);
|
||||
pCStringWriter->WriteString(L"</w:pPr>");
|
||||
}
|
||||
if(!TextPr.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(TextPr);
|
||||
}
|
||||
|
||||
if(!TablePr.empty())
|
||||
pCStringWriter->WriteString(TablePr);
|
||||
if(!RowPr.empty())
|
||||
|
||||
@ -1466,37 +1466,41 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
|
||||
CP_XML_NODE(L"pageSetup")
|
||||
{
|
||||
double h = 0, w = 0;
|
||||
if (attlist_.fo_page_height_)
|
||||
{
|
||||
h = attlist_.fo_page_height_->get_value_unit(length::mm);
|
||||
CP_XML_ATTR(L"paperHeight", (int)h);
|
||||
}
|
||||
if (attlist_.fo_page_width_)
|
||||
{
|
||||
w = attlist_.fo_page_width_->get_value_unit(length::mm);
|
||||
CP_XML_ATTR(L"paperWidth", (int)w);
|
||||
}
|
||||
if (attlist_.fo_page_height_)
|
||||
{
|
||||
h = attlist_.fo_page_height_->get_value_unit(length::mm);
|
||||
CP_XML_ATTR(L"paperHeight", (int)h);
|
||||
}
|
||||
CP_XML_ATTR(L"paperUnits", L"mm");
|
||||
if (attlist_.style_print_orientation_)
|
||||
|
||||
if (attlist_.style_scale_to_)
|
||||
{
|
||||
CP_XML_ATTR(L"orientation", *attlist_.style_print_orientation_);
|
||||
}
|
||||
CP_XML_ATTR(L"scale", (int)attlist_.style_scale_to_->get_value());
|
||||
}
|
||||
if (attlist_.loext_scale_to_X_)
|
||||
{
|
||||
CP_XML_ATTR(L"fitToWidth", *attlist_.loext_scale_to_X_);
|
||||
}
|
||||
if (attlist_.common_page_number_attlist_.style_first_page_number_)
|
||||
{
|
||||
CP_XML_ATTR(L"firstPageNumber", *attlist_.common_page_number_attlist_.style_first_page_number_);
|
||||
}
|
||||
if (attlist_.loext_scale_to_Y_)
|
||||
{
|
||||
CP_XML_ATTR(L"fitToHeight", *attlist_.loext_scale_to_Y_);
|
||||
}
|
||||
if (attlist_.style_scale_to_)
|
||||
if (attlist_.style_print_orientation_)
|
||||
{
|
||||
CP_XML_ATTR(L"scale", (int)attlist_.style_scale_to_->get_value());
|
||||
CP_XML_ATTR(L"orientation", *attlist_.style_print_orientation_);
|
||||
}
|
||||
if (attlist_.common_page_number_attlist_.style_first_page_number_)
|
||||
{
|
||||
CP_XML_ATTR(L"useFirstPageNumber", 1);
|
||||
CP_XML_ATTR(L"firstPageNumber", *attlist_.common_page_number_attlist_.style_first_page_number_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -258,19 +258,20 @@ int PAGESETUP::serialize(std::wostream & stream)
|
||||
CP_XML_ATTR(L"firstPageNumber", setup->iPageStart);
|
||||
|
||||
CP_XML_ATTR(L"scale", setup->iScale);
|
||||
|
||||
CP_XML_ATTR(L"orientation", setup->fPortrait ? L"portrait" : L"landscape");
|
||||
CP_XML_ATTR(L"horizontalDpi", setup->iRes);
|
||||
CP_XML_ATTR(L"verticalDpi", setup->iVRes);
|
||||
|
||||
if (setup->fUsePage)
|
||||
CP_XML_ATTR(L"useFirstPageNumber", true);
|
||||
|
||||
if (setup->iFitWidth > 0 && setup->iFitWidth < 32767)
|
||||
CP_XML_ATTR(L"fitToWidth", setup->iFitWidth);
|
||||
|
||||
if (setup->iFitHeight > 0 && setup->iFitHeight < 32767)
|
||||
CP_XML_ATTR(L"fitToHeight", setup->iFitHeight);
|
||||
CP_XML_ATTR(L"fitToHeight", setup->iFitHeight);
|
||||
|
||||
CP_XML_ATTR(L"orientation", setup->fPortrait ? L"portrait" : L"landscape");
|
||||
|
||||
if (setup->fUsePage)
|
||||
CP_XML_ATTR(L"useFirstPageNumber", true);
|
||||
|
||||
CP_XML_ATTR(L"horizontalDpi", setup->iRes);
|
||||
CP_XML_ATTR(L"verticalDpi", setup->iVRes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,26 +270,26 @@ namespace OOX
|
||||
if(m_oPaperSize.IsInit() || m_oOrientation.IsInit())
|
||||
{
|
||||
writer.WriteString(L"<pageSetup");
|
||||
WritingStringNullableAttrBool(L"blackAndWhite", m_oBlackAndWhite);
|
||||
WritingStringNullableAttrString(L"cellComments", m_oCellComments, m_oCellComments->ToString());
|
||||
WritingStringNullableAttrInt(L"copies", m_oCopies, m_oCopies->GetValue());
|
||||
WritingStringNullableAttrBool(L"draft", m_oDraft);
|
||||
WritingStringNullableAttrString(L"errors", m_oErrors, m_oErrors->ToString());
|
||||
WritingStringNullableAttrInt(L"firstPageNumber", m_oFirstPageNumber, m_oFirstPageNumber->GetValue());
|
||||
WritingStringNullableAttrInt(L"fitToHeight", m_oFitToHeight, m_oFitToHeight->GetValue());
|
||||
WritingStringNullableAttrInt(L"fitToWidth", m_oFitToWidth, m_oFitToWidth->GetValue());
|
||||
WritingStringNullableAttrInt(L"horizontalDpi", m_oHorizontalDpi, m_oHorizontalDpi->GetValue());
|
||||
WritingStringNullableAttrString(L"r:id", m_oRId, m_oRId->ToString());
|
||||
WritingStringNullableAttrString(L"orientation", m_oOrientation, m_oOrientation->ToString());
|
||||
WritingStringNullableAttrString(L"pageOrder", m_oPageOrder, m_oPageOrder->ToString());
|
||||
WritingStringNullableAttrDouble(L"paperHeight", m_oPaperHeight, m_oPaperHeight->GetValue());
|
||||
WritingStringNullableAttrString(L"paperSize", m_oPaperSize, m_oPaperSize->ToString());
|
||||
WritingStringNullableAttrDouble(L"paperHeight", m_oPaperHeight, m_oPaperHeight->GetValue());
|
||||
WritingStringNullableAttrDouble(L"paperWidth", m_oPaperWidth, m_oPaperWidth->GetValue());
|
||||
WritingStringNullableAttrString(L"paperUnits", m_oPaperUnits, m_oPaperUnits->ToString());
|
||||
WritingStringNullableAttrInt(L"scale", m_oScale, m_oScale->GetValue());
|
||||
WritingStringNullableAttrBool(L"useFirstPageNumber", m_oUseFirstPageNumber);
|
||||
WritingStringNullableAttrUInt(L"scale", m_oScale, m_oScale->GetValue());
|
||||
WritingStringNullableAttrUInt(L"firstPageNumber", m_oFirstPageNumber, m_oFirstPageNumber->GetValue());
|
||||
WritingStringNullableAttrInt(L"fitToWidth", m_oFitToWidth, m_oFitToWidth->GetValue());
|
||||
WritingStringNullableAttrInt(L"fitToHeight", m_oFitToHeight, m_oFitToHeight->GetValue());
|
||||
WritingStringNullableAttrString(L"pageOrder", m_oPageOrder, m_oPageOrder->ToString());
|
||||
WritingStringNullableAttrString(L"orientation", m_oOrientation, m_oOrientation->ToString());
|
||||
WritingStringNullableAttrBool(L"usePrinterDefaults", m_oUsePrinterDefaults);
|
||||
WritingStringNullableAttrInt(L"verticalDpi", m_oVerticalDpi, m_oVerticalDpi->GetValue());
|
||||
WritingStringNullableAttrBool(L"blackAndWhite", m_oBlackAndWhite);
|
||||
WritingStringNullableAttrBool(L"draft", m_oDraft);
|
||||
WritingStringNullableAttrString(L"cellComments", m_oCellComments, m_oCellComments->ToString());
|
||||
WritingStringNullableAttrBool(L"useFirstPageNumber", m_oUseFirstPageNumber);
|
||||
WritingStringNullableAttrString(L"errors", m_oErrors, m_oErrors->ToString());
|
||||
WritingStringNullableAttrUInt(L"horizontalDpi", m_oHorizontalDpi, m_oHorizontalDpi->GetValue());
|
||||
WritingStringNullableAttrUInt(L"verticalDpi", m_oVerticalDpi, m_oVerticalDpi->GetValue());
|
||||
WritingStringNullableAttrUInt(L"copies", m_oCopies, m_oCopies->GetValue());
|
||||
WritingStringNullableAttrString(L"paperUnits", m_oPaperUnits, m_oPaperUnits->ToString());
|
||||
WritingStringNullableAttrString(L"r:id", m_oRId, m_oRId->ToString());
|
||||
writer.WriteString(L"/>");
|
||||
}
|
||||
}
|
||||
|
||||
@ -4746,22 +4746,22 @@ int BinaryWorksheetsTableReader::ReadPageSetup(BYTE type, long length, void* poR
|
||||
else if(c_oSer_PageSetup::FirstPageNumber == type)
|
||||
{
|
||||
pPageSetup->m_oFirstPageNumber.Init();
|
||||
pPageSetup->m_oFirstPageNumber->SetValue(m_oBufferedStream.GetLong());
|
||||
pPageSetup->m_oFirstPageNumber->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if(c_oSer_PageSetup::FitToHeight == type)
|
||||
{
|
||||
pPageSetup->m_oFitToHeight.Init();
|
||||
pPageSetup->m_oFitToHeight->SetValue(m_oBufferedStream.GetLong());
|
||||
pPageSetup->m_oFitToHeight->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if(c_oSer_PageSetup::FitToWidth == type)
|
||||
{
|
||||
pPageSetup->m_oFitToWidth.Init();
|
||||
pPageSetup->m_oFitToWidth->SetValue(m_oBufferedStream.GetLong());
|
||||
pPageSetup->m_oFitToWidth->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if(c_oSer_PageSetup::HorizontalDpi == type)
|
||||
{
|
||||
pPageSetup->m_oHorizontalDpi.Init();
|
||||
pPageSetup->m_oHorizontalDpi->SetValue(m_oBufferedStream.GetLong());
|
||||
pPageSetup->m_oHorizontalDpi->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if(c_oSer_PageSetup::Orientation == type)
|
||||
{
|
||||
@ -4796,7 +4796,7 @@ int BinaryWorksheetsTableReader::ReadPageSetup(BYTE type, long length, void* poR
|
||||
else if(c_oSer_PageSetup::Scale == type)
|
||||
{
|
||||
pPageSetup->m_oScale.Init();
|
||||
pPageSetup->m_oScale->SetValue(m_oBufferedStream.GetLong());
|
||||
pPageSetup->m_oScale->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if(c_oSer_PageSetup::UseFirstPageNumber == type)
|
||||
{
|
||||
@ -4811,7 +4811,7 @@ int BinaryWorksheetsTableReader::ReadPageSetup(BYTE type, long length, void* poR
|
||||
else if(c_oSer_PageSetup::VerticalDpi == type)
|
||||
{
|
||||
pPageSetup->m_oVerticalDpi.Init();
|
||||
pPageSetup->m_oVerticalDpi->SetValue(m_oBufferedStream.GetLong());
|
||||
pPageSetup->m_oVerticalDpi->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
|
||||
Reference in New Issue
Block a user