chart2/source/tools/DiagramHelper.cxx | 2 - cui/source/options/optsave.cxx | 1 cui/source/options/optsave.src | 1 sc/source/filter/xml/XMLExportDataPilot.cxx | 10 +++--- sc/source/filter/xml/xmlstyle.cxx | 2 - sd/source/ui/annotations/annotationmanager.cxx | 2 - sfx2/source/doc/objstor.cxx | 4 +- sw/source/filter/xml/xmlexp.cxx | 2 - unotools/inc/unotools/saveopt.hxx | 1 xmloff/inc/xexptran.hxx | 9 +++--- xmloff/source/chart/SchXMLExport.cxx | 8 ++--- xmloff/source/core/xmlexp.cxx | 1 xmloff/source/draw/shapeexport2.cxx | 6 ++-- xmloff/source/draw/shapeexport3.cxx | 2 - xmloff/source/draw/xexptran.cxx | 36 +++++++++++++++---------- xmloff/source/meta/MetaExportComponent.cxx | 1 xmloff/source/style/MarkerStyle.cxx | 2 - xmloff/source/style/PageMasterStyleMap.cxx | 2 - xmloff/source/text/txtparae.cxx | 8 ++--- xmloff/source/text/txtprmap.cxx | 10 +++--- 20 files changed, 61 insertions(+), 49 deletions(-)
New commits: commit 3fb24e6307e0ec3e09b1e48e9a4ce5f6787d2cc9 Author: Thorsten Behrens <[email protected]> Date: Tue Jun 5 05:03:06 2012 +0200 Fix fdo#50704 Default to absolute svg:d paths for ODF1.2 compat-mode This writes out absolute paths, to side-step buggy odf consumers' wrong handling of the 'z' statement (i.e. they ignore it for current positions). diff --git a/xmloff/inc/xexptran.hxx b/xmloff/inc/xexptran.hxx index 86883cf..b38860a 100644 --- a/xmloff/inc/xexptran.hxx +++ b/xmloff/inc/xexptran.hxx @@ -36,7 +36,6 @@ #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/drawing/HomogenMatrix.hpp> #include <tools/mapunit.hxx> -#include <xmloff/xmlimp.hxx> #include <vector> @@ -46,6 +45,8 @@ struct ImpSdXMLExpTransObj2DBase; struct ImpSdXMLExpTransObj3DBase; class SvXMLUnitConverter; +class SvXMLImport; +class SvXMLExport; namespace basegfx { @@ -160,14 +161,14 @@ class SdXMLImExSvgDElement const SdXMLImExViewBox& mrViewBox; bool mbIsClosed; bool mbIsCurve; - + bool mbRelative; sal_Int32 mnLastX; sal_Int32 mnLastY; com::sun::star::drawing::PolyPolygonBezierCoords maPoly; public: - SdXMLImExSvgDElement(const SdXMLImExViewBox& rViewBox); + SdXMLImExSvgDElement(const SdXMLImExViewBox& rViewBox, const SvXMLExport& rExport); SdXMLImExSvgDElement(const rtl::OUString& rNew, const SdXMLImExViewBox& rViewBox, const com::sun::star::awt::Point& rObjectPos, @@ -179,7 +180,7 @@ public: com::sun::star::drawing::FlagSequence* pFlags, const com::sun::star::awt::Point& rObjectPos, const com::sun::star::awt::Size& rObjectSize, - bool bClosed = false, bool bRelative = true); + bool bClosed = false); const rtl::OUString& GetExportString() const { return msString; } bool IsClosed() const { return mbIsClosed; } diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index 43d9711..00856c8 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -999,7 +999,7 @@ void XMLShapeExport::ImpExportPolygonShape( if(pOuterSequence && pOuterFlags) { // prepare svx:d element export - SdXMLImExSvgDElement aSvgDElement(aViewBox); + SdXMLImExSvgDElement aSvgDElement(aViewBox, GetExport()); for(sal_Int32 a(0L); a < nOuterCnt; a++) { @@ -1066,7 +1066,7 @@ void XMLShapeExport::ImpExportPolygonShape( if(pOuterSequence) { // prepare svx:d element export - SdXMLImExSvgDElement aSvgDElement(aViewBox); + SdXMLImExSvgDElement aSvgDElement(aViewBox, GetExport()); for(sal_Int32 a(0L); a < nOuterCnt; a++) { @@ -1432,7 +1432,7 @@ void XMLShapeExport::ImpExportConnectorShape( awt::Point aPoint( 0, 0 ); awt::Size aSize( 1, 1 ); SdXMLImExViewBox aViewBox( 0, 0, 1, 1 ); - SdXMLImExSvgDElement aSvgDElement(aViewBox); + SdXMLImExSvgDElement aSvgDElement(aViewBox, GetExport()); for(sal_Int32 a(0L); a < nOuterCnt; a++) { diff --git a/xmloff/source/draw/shapeexport3.cxx b/xmloff/source/draw/shapeexport3.cxx index 7e111d6..888f4b6 100644 --- a/xmloff/source/draw/shapeexport3.cxx +++ b/xmloff/source/draw/shapeexport3.cxx @@ -263,7 +263,7 @@ void XMLShapeExport::ImpExport3DShape( aViewBox.GetExportString()); // prepare svx:d element export - SdXMLImExSvgDElement aSvgDElement(aViewBox); + SdXMLImExSvgDElement aSvgDElement(aViewBox, GetExport()); pInnerSequenceX = xPolyPolygon3D.SequenceX.getArray(); pInnerSequenceY = xPolyPolygon3D.SequenceY.getArray(); diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx index 0504096..545e0a4 100644 --- a/xmloff/source/draw/xexptran.cxx +++ b/xmloff/source/draw/xexptran.cxx @@ -31,6 +31,8 @@ #include <rtl/ustrbuf.hxx> #include <sax/tools/converter.hxx> #include <xmloff/xmluconv.hxx> +#include <xmloff/xmlexp.hxx> +#include <xmloff/xmlimp.hxx> #include <tools/gen.hxx> #include <basegfx/vector/b2dvector.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> @@ -1469,10 +1471,17 @@ SdXMLImExPointsElement::SdXMLImExPointsElement(const OUString& rNew, ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// -SdXMLImExSvgDElement::SdXMLImExSvgDElement(const SdXMLImExViewBox& rViewBox) +SdXMLImExSvgDElement::SdXMLImExSvgDElement(const SdXMLImExViewBox& rViewBox, + const SvXMLExport& rExport) : mrViewBox( rViewBox ), mbIsClosed( false ), mbIsCurve( false ), + // fdo#47406 - handle writing svg:d path slightly different for + // old odf versions and ODF1.2 compat mode - since ~all the legacy + // ODF ecosystem interprets relative svg:d paths incorrectly, + // write out absolute paths in those cases. + mbRelative( rExport.getDefaultVersion() >= SvtSaveOptions::ODFVER_012 && + rExport.getDefaultVersion() != SvtSaveOptions::ODFVER_012_EXT_COMPAT ), mnLastX( 0L ), mnLastY( 0L ), maPoly() @@ -1535,7 +1544,7 @@ void SdXMLImExSvgDElement::AddPolygon( drawing::FlagSequence* pFlags, const awt::Point& rObjectPos, const awt::Size& rObjectSize, - bool bClosed, bool bRelative) + bool bClosed) { // Leaving the export stuff for the while, should eventually also // consolidated with basegfx svg support @@ -1722,7 +1731,7 @@ void SdXMLImExSvgDElement::AddPolygon( if(bPrevPointIsSymmetric) { // write a shorthand/smooth quadratic curveto entry (T) - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('t')) aNewString += OUString(sal_Unicode('t')); @@ -1752,7 +1761,7 @@ void SdXMLImExSvgDElement::AddPolygon( mrViewBox, bScale, bTranslate); // write a quadratic curveto entry (Q) - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('q')) aNewString += OUString(sal_Unicode('q')); @@ -1814,7 +1823,7 @@ void SdXMLImExSvgDElement::AddPolygon( if(bPrevPointIsSmooth) { // write a shorthand/smooth quadratic curveto entry (T) - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('t')) aNewString += rtl::OUString(static_cast<sal_Unicode>('t')); @@ -1844,7 +1853,7 @@ void SdXMLImExSvgDElement::AddPolygon( mrViewBox, bScale, bTranslate); // write a quadratic curveto entry (Q) - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('q')) aNewString += rtl::OUString(static_cast<sal_Unicode>('q')); @@ -1903,7 +1912,7 @@ void SdXMLImExSvgDElement::AddPolygon( if(bPrevPointIsSymmetric) { // write a shorthand/smooth curveto entry (S) - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('s')) aNewString += rtl::OUString(static_cast<sal_Unicode>('s')); @@ -1937,7 +1946,7 @@ void SdXMLImExSvgDElement::AddPolygon( mrViewBox, bScale, bTranslate); // write a curveto entry (C) - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('c')) aNewString += rtl::OUString(static_cast<sal_Unicode>('c')); @@ -1993,7 +2002,7 @@ void SdXMLImExSvgDElement::AddPolygon( // write as normal point if(mnLastX == nX) { - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('v')) aNewString += rtl::OUString(static_cast<sal_Unicode>('v')); @@ -2014,7 +2023,7 @@ void SdXMLImExSvgDElement::AddPolygon( } else if(mnLastY == nY) { - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('h')) aNewString += rtl::OUString(static_cast<sal_Unicode>('h')); @@ -2035,7 +2044,7 @@ void SdXMLImExSvgDElement::AddPolygon( } else { - if(bRelative) + if(mbRelative) { if(aLastCommand != sal_Unicode('l')) aNewString += rtl::OUString(static_cast<sal_Unicode>('l')); @@ -2060,7 +2069,7 @@ void SdXMLImExSvgDElement::AddPolygon( else { // write as start point - if(bRelative) + if(mbRelative) { aNewString += rtl::OUString(static_cast<sal_Unicode>('m')); @@ -2099,7 +2108,7 @@ void SdXMLImExSvgDElement::AddPolygon( // close path if closed poly if(bClosed) { - if(bRelative) + if(mbRelative) aNewString += rtl::OUString(static_cast<sal_Unicode>('z')); else aNewString += rtl::OUString(static_cast<sal_Unicode>('Z')); @@ -2126,6 +2135,7 @@ SdXMLImExSvgDElement::SdXMLImExSvgDElement(const OUString& rNew, mrViewBox( rViewBox ), mbIsClosed( false ), mbIsCurve( false ), + mbRelative( true ), mnLastX( 0L ), mnLastY( 0L ), maPoly() diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx index 4e51a57..5c0c0ec 100644 --- a/xmloff/source/style/MarkerStyle.cxx +++ b/xmloff/source/style/MarkerStyle.cxx @@ -253,7 +253,7 @@ sal_Bool XMLMarkerStyleExport::exportXML( // Pathdata pOuterSequence = aBezier.Coordinates.getArray(); drawing::FlagSequence* pOuterFlags = aBezier.Flags.getArray(); - SdXMLImExSvgDElement aSvgDElement(aViewBox); + SdXMLImExSvgDElement aSvgDElement(aViewBox, rExport); for (a = 0; a < nOuterCnt; a++) { diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 99f3230..e7b370b 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3019,7 +3019,7 @@ void XMLTextParagraphExport::exportContour( if(pOuterSequence) { // prepare svx:d element export - SdXMLImExSvgDElement aSvgDElement( aViewBox ); + SdXMLImExSvgDElement aSvgDElement( aViewBox, GetExport() ); for(sal_Int32 a(0L); a < nOuterCnt; a++) { commit d3c189fa742f0b21f99a8f3b1ebafe71c130d8d5 Author: Thorsten Behrens <[email protected]> Date: Tue Jun 5 04:20:32 2012 +0200 Fix fdo#50703 clamp ODF1.2 compatibility-mode to use old encryption. As requested for better interop inside the ODF ecosystem, asking for compatible odf output gets you blowfish/sha1-based encryption unconditionally. diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 9c53e22..3700d57 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -370,12 +370,12 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { } - if ( !aSaveOpt.IsUseSHA1InODF12() ) + if ( !aSaveOpt.IsUseSHA1InODF12() && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT ) { aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA256; aEncryptionAlgs[2].Value <<= xml::crypto::DigestID::SHA256_1K; } - if ( !aSaveOpt.IsUseBlowfishInODF12() ) + if ( !aSaveOpt.IsUseBlowfishInODF12() && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT ) aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING; } commit d0af38eaa029c2f2c2617544c8b6798c463381b9 Author: Thorsten Behrens <[email protected]> Date: Tue Jun 5 03:59:46 2012 +0200 Add ODF1.2 extended-but-more-compatible mode With several legacy pre-ODF1.2 and ODF1.2-only consumers out there, folks wanted a more backward-compatible ODF1.2 extended mode, that uses stuff deprecated in 1.2, and/or is 'bug-compatible' to older OOo-versions. Therefore, adding ODFVER_012_EXT_COMPAT, and sticking it to several attributes that were ODFVER_LATEST before. diff --git a/cui/source/options/optsave.src b/cui/source/options/optsave.src index 8bce711..8e275f4 100644 --- a/cui/source/options/optsave.src +++ b/cui/source/options/optsave.src @@ -157,6 +157,7 @@ TabPage RID_SFXPAGE_SAVE { < "1.0/1.1" ; 2 ; > ; < "1.2" ; 4 ; > ; + < "1.2 Extended (compat mode)"; 8 ; > ; < "1.2 Extended (recommended)"; 0x7fffffff ; > ; }; }; diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index ad965b1..25beb3e 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -67,7 +67,7 @@ using namespace ::formula; using ::rtl::OUString; #define MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010 } -#define MAP_EXT(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_LATEST } +#define MAP_EXT(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_012_EXT_COMPAT } #define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 } const XMLPropertyMapEntry aXMLScCellStylesProperties[] = diff --git a/unotools/inc/unotools/saveopt.hxx b/unotools/inc/unotools/saveopt.hxx index 0f20d62..f16d859 100644 --- a/unotools/inc/unotools/saveopt.hxx +++ b/unotools/inc/unotools/saveopt.hxx @@ -67,6 +67,7 @@ public: ODFVER_011 = 2, // ODF 1.1 DO_NOT_USE = 3, // Do not use this, only here for compatibility with pre OOo 3.2 configuration ODFVER_012 = 4, // ODF 1.2 + ODFVER_012_EXT_COMPAT = 8, // ODF 1.2 extended, but with compatibility fallbacks ODFVER_LATEST = SAL_MAX_ENUM, // ODF latest version with enhancements }; diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index e0748fa..9dc41e6 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1359,6 +1359,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) 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; diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx index 26aa8f9..9fb1976 100644 --- a/xmloff/source/meta/MetaExportComponent.cxx +++ b/xmloff/source/meta/MetaExportComponent.cxx @@ -150,6 +150,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum ) switch( getDefaultVersion() ) { case SvtSaveOptions::ODFVER_LATEST: pVersion = "1.2"; break; + case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = "1.2"; break; case SvtSaveOptions::ODFVER_012: pVersion = "1.2"; break; case SvtSaveOptions::ODFVER_011: pVersion = "1.1"; break; case SvtSaveOptions::ODFVER_010: break; diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index 231ec37..f6057e8 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -39,7 +39,7 @@ using namespace ::xmloff::token; #define PLMAP_12(name,prefix,token,type,context) \ MAP(name,prefix,token,type|XML_TYPE_PROP_PAGE_LAYOUT,context, SvtSaveOptions::ODFVER_012) #define PLMAP_EX(name,prefix,token,type,context) \ - MAP(name,prefix,token,type|XML_TYPE_PROP_PAGE_LAYOUT,context, SvtSaveOptions::ODFVER_LATEST) + MAP(name,prefix,token,type|XML_TYPE_PROP_PAGE_LAYOUT,context, SvtSaveOptions::ODFVER_012_EXT_COMPAT) #define HFMAP(name,prefix,token,type,context) \ MAP(name,prefix,token,type|XML_TYPE_PROP_HEADER_FOOTER,context, SvtSaveOptions::ODFVER_010) diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index c1ec7e0..edf8c2d 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -101,7 +101,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] = MP_E( "ParaTopMarginRelative", FO, MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), MP_E( "ParaBottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ), MP_E( "ParaBottomMarginRelative",FO, MARGIN_BOTTOM, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ), - { "ParaContextMargin", sizeof("ParaContextMargin")-1, XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0, SvtSaveOptions::ODFVER_LATEST }, + { "ParaContextMargin", sizeof("ParaContextMargin")-1, XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, // RES_CHRATR_CASEMAP MT_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), MT_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ), @@ -149,9 +149,9 @@ XMLPropertyMapEntry aXMLParaPropMap[] = // RES_CHRATR_WEIGHT MT_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_RSID - { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_LATEST }, + { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, // RES_PARATR_RSID - { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_LATEST }, + { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, // RES_CHRATR_WORDLINEMODE MT_E( "CharWordMode", STYLE, TEXT_UNDERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), MT_E( "CharWordMode", STYLE, TEXT_OVERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), @@ -448,9 +448,9 @@ XMLPropertyMapEntry aXMLTextPropMap[] = // RES_CHRATR_WEIGHT MT_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), // RES_CHRATR_RSID - { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_LATEST }, + { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, // RES_PARATR_RSID - { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_LATEST }, + { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, // RES_CHRATR_WORDLINEMODE MT_E( "CharWordMode", STYLE, TEXT_UNDERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), MT_E( "CharWordMode", STYLE, TEXT_OVERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), commit 24c260a271ec5f086b7883a6ed258e02af799d61 Author: Thorsten Behrens <[email protected]> Date: Tue Jun 5 03:57:55 2012 +0200 Unify ODF extended vs. ODF1.2 handling Make "export extended ODF" consistently mean "version > ODF1.2". Future ODF versions need manual review anyway, of the various changes/additions we ship. Change-Id: I0f6c1646b306e18f0abcdd1a1802fece821b2e93 diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 27026c5..bf755d6 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -1710,7 +1710,7 @@ bool DiagramHelper::switchDiagramPositioningToExcludingPositioning( { //return true if something was changed const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); - if( nCurrentODFVersion == SvtSaveOptions::ODFVER_LATEST )//#i100778# todo: change this dependent on fileformat evolution + if( nCurrentODFVersion > SvtSaveOptions::ODFVER_012 ) { uno::Reference< ::com::sun::star::chart::XChartDocument > xOldDoc( xChartModel, uno::UNO_QUERY ) ; if( xOldDoc.is() ) diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index ade9d7d..5b5622c 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -444,7 +444,7 @@ void ScXMLExportDataPilot::WriteSubTotals(ScDPSaveDimension* pDim) sal_Int32 nSubTotalCount = pDim->GetSubTotalsCount(); const OUString* pLayoutName = NULL; - if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + if (rExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012) // Export display names only for 1.2 extended or later. pLayoutName = pDim->GetSubtotalName(); @@ -476,7 +476,7 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rtl::OUString((*i)->GetName())); - if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + if (rExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012) { // Export display names only for ODF 1.2 extended or later. const OUString* pLayoutName = (*i)->GetLayoutName(); @@ -685,7 +685,7 @@ void ScXMLExportDataPilot::WriteGroupDimElements(ScDPSaveDimension* pDim, const void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, rtl::OUString(pDim->GetName())); - if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + if (rExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012) { // Export display names only for ODF 1.2 extended or later. const OUString* pLayoutName = pDim->GetLayoutName(); @@ -817,7 +817,7 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads // grand total elements. const OUString* pGrandTotalName = pDPSave->GetGrandTotalName(); - if (pGrandTotalName && rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + if (pGrandTotalName && rExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012) { // Use the new data-pilot-grand-total element. if (bRowGrand && bColumnGrand) @@ -836,7 +836,7 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads { const ScSheetSourceDesc* pSheetSource = (*pDPs)[i]->GetSheetDesc(); - if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + if (rExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012) { if (pSheetSource->HasRangeName()) rExport.AddAttribute( diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 0561ddb..bae35a7 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -604,7 +604,7 @@ void AnnotationManagerImpl::GetAnnotationState(SfxItemSet& rSet) const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); - if( bReadOnly || bWrongPageKind || (nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST) ) + if( bReadOnly || bWrongPageKind || (nCurrentODFVersion <= SvtSaveOptions::ODFVER_012) ) rSet.DisableItem( SID_INSERT_POSTIT ); rSet.Put(SfxBoolItem(SID_SHOW_POSTIT, mbShowAnnotations)); diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 9faf522..d6017d2 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -155,7 +155,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) if( (getExportFlags() & (EXPORT_FONTDECLS|EXPORT_STYLES| EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 ) { - if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST ) + if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE_EXT), diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index f0c7783..9cb5bc5 100755 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1494,7 +1494,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& // export legend size const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); - if( xLegendShape.is() && nCurrentODFVersion >= SvtSaveOptions::ODFVER_012 && nCurrentODFVersion == SvtSaveOptions::ODFVER_LATEST )//do not export legend-expansion to ODF 1.0 and export size only if extensions are enabled //#i28670# todo: change this dependent on fileformat evolution + if( xLegendShape.is() && nCurrentODFVersion >= SvtSaveOptions::ODFVER_012 ) { try { @@ -2255,8 +2255,6 @@ void SchXMLExportHelper_Impl::exportCoordinateRegion( const uno::Reference< char const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); if( nCurrentODFVersion <= SvtSaveOptions::ODFVER_012 )//do not export to ODF 1.2 or older return; - if( nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST )//export only if extensions are enabled //#i100778# todo: change this dependent on fileformat evolution - return; Reference< chart::XDiagramPositioning > xDiaPos( xDiagram, uno::UNO_QUERY ); DBG_ASSERT( xDiaPos.is(), "Invalid xDiaPos as parameter" ); @@ -2379,7 +2377,7 @@ bool lcl_exportAxisType( const Reference< chart2::XAxis > xChart2Axis, SvXMLExpo return bExportDateScale; const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); - if( nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST ) //#i25706#todo: change version for next ODF version + if( nCurrentODFVersion <= SvtSaveOptions::ODFVER_012 )//do not export to ODF 1.2 or older return bExportDateScale; chart2::ScaleData aScale( xChart2Axis->getScaleData() ); @@ -3658,7 +3656,7 @@ SchXMLExport::SchXMLExport( maAutoStylePool( *this ), maExportHelper( *this, maAutoStylePool ) { - if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST ) + if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) _GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT); } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index b1decab..99f3230 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -2266,7 +2266,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( else if (sType.equals(sTextFieldStart)) { /* As of now, textmarks are a proposed extension to the OpenDocument standard. */ - if ( GetExport().getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST ) + if ( GetExport().getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) { Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); if (xBookmark.is()) @@ -2328,7 +2328,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( } else if (sType.equals(sTextFieldEnd)) { - if ( GetExport().getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST ) + if ( GetExport().getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) { GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_END, sal_False); GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_END, sal_False); @@ -2357,7 +2357,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration( } else if (sType.equals(sTextFieldStartEnd)) { - if ( GetExport().getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST ) + if ( GetExport().getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) { Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY); if (xBookmark.is()) commit ecdd0501c809e8f283a09cc320a539b828bfec2f Author: Thorsten Behrens <[email protected]> Date: Tue Jun 5 03:54:42 2012 +0200 Dupe code removal in cui diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 6abeaed..efae17b 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -657,7 +657,6 @@ IMPL_LINK_NOARG(SfxSaveTabPage, ODFVersionHdl_Impl) } aODFWarningFI.Show( bShown ); - aODFWarningFT.Show( bShown ); return 0; } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
