include/xmloff/xmlexp.hxx | 4 ---- sw/source/filter/xml/xmlexp.cxx | 4 ---- xmloff/source/core/xmlexp.cxx | 32 ++++++++++++++------------------ 3 files changed, 14 insertions(+), 26 deletions(-)
New commits: commit 6640bfc66dca7fdad8a038b32fa062bff34219b7 Author: Michael Stahl <[email protected]> Date: Tue Jan 12 23:07:23 2016 +0100 xmloff: SvXMLExport::mbExtended is dead now Change-Id: Ie679259deccce87949d7bf8767af707827b4134c diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 4c4e9ef..f1cf97e 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -154,8 +154,6 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6< XMLImageMapExport* mpImageMapExport; XMLErrors* mpXMLErrors; - bool mbExtended; // Does document contain extens. - const enum ::xmloff::token::XMLTokenEnum meClass; SAL_DLLPRIVATE void _InitCtor(); @@ -222,8 +220,6 @@ protected: OUString GetSourceShellID() const; OUString GetDestinationShellID() const; - void SetExtended( bool bSet=true ) { mbExtended = bSet; } - // save linked sections? (may be false in global documents) bool mbSaveLinkedSections; diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 4a3d479..f8abc46 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -131,7 +131,6 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) SwDoc *pDoc = getDoc(); - bool bExtended = false; if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES| SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT)) { @@ -174,7 +173,6 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) pUnknown->GetNamespace( nIdx ) ); nIdx = pUnknown->GetNextNamespaceIndex( nIdx ); } - bExtended = true; } } } @@ -189,8 +187,6 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) pTwipUnitConv->SetXMLMeasureUnit( eUnit ); } - SetExtended( bExtended ); - if( getExportFlags() & SvXMLExportFlags::META) { // Update doc stat, so that correct values are exported and diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 012190e..389cb7e 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -450,7 +450,6 @@ SvXMLExport::SvXMLExport( mpEventExport( nullptr ), mpImageMapExport( nullptr ), mpXMLErrors( nullptr ), - mbExtended( false ), meClass( eClass ), mnExportFlags( nExportFlags ), mnErrorFlags( SvXMLErrorFlags::NO ), @@ -481,7 +480,6 @@ SvXMLExport::SvXMLExport( mpEventExport( nullptr ), mpImageMapExport( nullptr ), mpXMLErrors( nullptr ), - mbExtended( false ), meClass( XML_TOKEN_INVALID ), mnExportFlags( SvXMLExportFlags::NONE ), mnErrorFlags( SvXMLErrorFlags::NO ), @@ -520,7 +518,6 @@ SvXMLExport::SvXMLExport( mpEventExport( nullptr ), mpImageMapExport( nullptr ), mpXMLErrors( nullptr ), - mbExtended( false ), meClass( XML_TOKEN_INVALID ), mnExportFlags( SvXMLExportFlags::NONE ), mnErrorFlags( SvXMLErrorFlags::NO ), commit d277ac87455a599fbf4acd3c6401f09bc74d3dac Author: Michael Stahl <[email protected]> Date: Tue Jan 12 23:01:34 2016 +0100 xmloff: there is no reason why office:version should be omitted ... if a document contains foreign elements or attributes. In fact since ODF 1.2 the office:version attribute is mandatory and any document that omits it is therefore invalid, while "extended conforming" documents are allowed to contain foreign elements and attributes. This mysterious check was there since CVS initial import, but without any justification. Change-Id: Ifeafad2b7af41f06356461adb7ae65dbf7bae11d diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index ff8db66..012190e 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1414,24 +1414,23 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) } // office:version = ... - if( !mbExtended ) + const sal_Char* pVersion = nullptr; + switch (getDefaultVersion()) { - const sal_Char* pVersion = nullptr; - switch( getDefaultVersion() ) - { - case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break; - case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = sXML_1_2; break; - case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break; - case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break; - case SvtSaveOptions::ODFVER_010: break; + case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break; + case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = sXML_1_2; break; + case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break; + case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break; + case SvtSaveOptions::ODFVER_010: break; - default: - SAL_WARN("xmloff.core", "xmloff::SvXMLExport::exportDoc(), unexpected odf default version!"); - } + default: + SAL_WARN("xmloff.core", "xmloff::SvXMLExport::exportDoc(), unexpected odf default version!"); + } - if( pVersion ) - AddAttribute( XML_NAMESPACE_OFFICE, XML_VERSION, - OUString::createFromAscii(pVersion) ); + if (pVersion) + { + AddAttribute( XML_NAMESPACE_OFFICE, XML_VERSION, + OUString::createFromAscii(pVersion) ); } { _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
