dbaccess/source/core/dataaccess/databasedocument.cxx | 8 ++++++-- include/comphelper/documentconstants.hxx | 1 + sfx2/source/doc/objstor.cxx | 6 +++++- xmloff/qa/unit/draw.cxx | 17 ++++------------- 4 files changed, 16 insertions(+), 16 deletions(-)
New commits: commit fc9155f8cdbddfb60f42f1514974846ec8a917a0 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Sep 26 15:56:50 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Sep 26 19:14:43 2024 +0200 CppunitTest_xmloff_draw: simplify a bit Change-Id: Ic36e2c50953e99d7509c1d16ffef2f9f5f3a7bf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173992 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx index e7073497c1d4..9b61b488e3e0 100644 --- a/xmloff/qa/unit/draw.cxx +++ b/xmloff/qa/unit/draw.cxx @@ -288,7 +288,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) { // Given a document that refers to a theme color: loadFromFile(u"Reference-ThemeColors-TextAndFill.pptx"); - save(u"impress8"_ustr); + saveAndReload(u"impress8"_ustr); // Make sure the export result has the theme reference: xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -345,9 +345,6 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) assertXPath(pXmlDoc, aShape3 + "/loext:transformation[1]", "type"_ostr, u"lummod"_ustr); assertXPath(pXmlDoc, aShape3 + "/loext:transformation[1]", "value"_ostr, u"5000"_ustr); - // reload - load(maTempFile.GetURL()); - // check fill color theme { uno::Reference<drawing::XShape> xShape(getShape(0)); @@ -463,9 +460,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColor_ShapeFill) { loadFromFile(u"ReferenceShapeFill.pptx"); - save(u"impress8"_ustr); - // reload - load(maTempFile.GetURL()); + saveAndReload(u"impress8"_ustr); // check fill color theme uno::Reference<drawing::XShape> xShape(getShape(0)); @@ -535,7 +530,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeExtended) lcl_assertMetalProperties("from doc", xShape); // Test, that new attribute is written with loext namespace. Adapt when attribute is added to ODF. - save(u"writer8"_ustr); + saveAndReload(u"writer8"_ustr); // assert XML. xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -544,8 +539,6 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionMetalTypeExtended) pXmlDoc, "//draw:enhanced-geometry[@loext:extrusion-metal-type='loext:MetalMSCompatible']"_ostr); - // reload - mxComponent = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr); // verify properties uno::Reference<drawing::XShape> xShapeReload(getShape(0)); lcl_assertMetalProperties("from ODF 1.3 extended", xShapeReload); @@ -596,7 +589,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularityExtended) // Test, that attribute is written in draw namespace with value 100% and in loext namespace with // value 122.0703125%. - save(u"writer8"_ustr); + saveAndReload(u"writer8"_ustr); // assert XML. xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); @@ -604,8 +597,6 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testExtrusionSpecularityExtended) assertXPath(pXmlDoc, "//draw:enhanced-geometry[@loext:extrusion-specularity-loext='122.0703125%']"_ostr); - // reload and verify, that the loext value is used - mxComponent = loadFromDesktop(maTempFile.GetURL(), u"com.sun.star.text.TextDocument"_ustr); // verify properties uno::Reference<drawing::XShape> xShapeReload(getShape(0)); lcl_assertSpecularityProperty("from ODF 1.3 extended", xShapeReload); commit b617ac73222d837af7ab6790764518174c517e1b Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Sep 26 14:23:41 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Sep 26 19:14:29 2024 +0200 ODF 1.4: add ODFVER_014_TEXT constant Change-Id: I219c854b11a5bd4be3d789b93a96e045e3dca29f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173991 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index ae4410d1ee3e..3cef96ab599a 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1658,7 +1658,11 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r GetODFSaneDefaultVersion(); // older versions can not have this property set, // it exists only starting from ODF1.2 - if (nDefVersion >= SvtSaveOptions::ODFSVER_013) + if (nDefVersion >= SvtSaveOptions::ODFSVER_014) + { + aVersion = ODFVER_014_TEXT; + } + else if (nDefVersion >= SvtSaveOptions::ODFSVER_013) { aVersion = ODFVER_013_TEXT; } @@ -2197,7 +2201,7 @@ com_sun_star_comp_dba_ODatabaseDocument(css::uno::XComponentContext* context, rtl::Reference<dbaccess::ODatabaseContext> pContext = dynamic_cast<dbaccess::ODatabaseContext*>(xDBContextTunnel.get()); assert(pContext); - + rtl::Reference pImpl( new dbaccess::ODatabaseModelImpl(context, *pContext)); rtl::Reference<dbaccess::ODatabaseDocument> inst(pImpl->createNewModel_deliverOwnership()); diff --git a/include/comphelper/documentconstants.hxx b/include/comphelper/documentconstants.hxx index c4372c200809..4461d7cbe2de 100644 --- a/include/comphelper/documentconstants.hxx +++ b/include/comphelper/documentconstants.hxx @@ -67,6 +67,7 @@ inline constexpr OUString ODFVER_010_TEXT = u"1.0"_ustr; inline constexpr OUString ODFVER_011_TEXT = u"1.1"_ustr; inline constexpr OUString ODFVER_012_TEXT = u"1.2"_ustr; inline constexpr OUString ODFVER_013_TEXT = u"1.3"_ustr; +inline constexpr OUString ODFVER_014_TEXT = u"1.4"_ustr; // filter flags // TODO/LATER: The flags should be part of the UNO specification diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 4da5ab63b7e5..d4d39b03573c 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -351,7 +351,11 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto bool const isBaseForm(xModule.is() && xModule->getIdentifier() == "com.sun.star.sdb.FormDesign"); SAL_INFO_IF(isBaseForm, "sfx.doc", "tdf#138209 force form export to ODF 1.2"); - if (!isBaseForm && SvtSaveOptions::ODFSVER_013 <= nDefVersion) + if (!isBaseForm && SvtSaveOptions::ODFSVER_014 <= nDefVersion) + { + xProps->setPropertyValue(u"Version"_ustr, uno::Any(ODFVER_014_TEXT)); + } + else if (!isBaseForm && SvtSaveOptions::ODFSVER_013 <= nDefVersion) { xProps->setPropertyValue(u"Version"_ustr, uno::Any(ODFVER_013_TEXT)); }