[Libreoffice-commits] core.git: 3 commits - sc/qa sw/qa test/source xmloff/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Sat Mar 8 09:37:17 PST 2014


 sc/qa/unit/helper/qahelper.cxx             |    2 ++
 sw/qa/extras/inc/swmodeltestbase.hxx       |   14 +++++++++++++-
 test/source/bootstrapfixture.cxx           |   12 +++++++++++-
 xmloff/source/style/PageMasterStyleMap.cxx |    6 ------
 4 files changed, 26 insertions(+), 8 deletions(-)

New commits:
commit 54195c53a915b28302bf36333d2b328e57881b30
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 18:28:02 2014 +0100

    add disabled support for export validation in writer tests
    
    Still too many validation errors to enable it.
    
    Change-Id: I45830f6cff8ef52bc63fdda61a99985f4f7d242a

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 77c32c2..a3c3dec 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -444,13 +444,25 @@ protected:
         uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
         uno::Sequence<beans::PropertyValue> aArgs(1);
         aArgs[0].Name = "FilterName";
-        aArgs[0].Value <<= OUString::createFromAscii(pFilter);
+        OUString aFilterName = OUString::createFromAscii(pFilter);
+        aArgs[0].Value <<= aFilterName;
         m_aTempFile.EnableKillingFile();
         xStorable->storeToURL(m_aTempFile.GetURL(), aArgs);
         uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY);
         xComponent->dispose();
         m_bExported = true;
         mxComponent = loadFromDesktop(m_aTempFile.GetURL(), "com.sun.star.text.TextDocument");
+        if(aFilterName == "Office Open XML Text")
+        {
+            // too many validation errors right now
+            // validate(m_aTempFile.GetFileName(), test::OOXML);
+        }
+        else if(aFilterName == "writer8")
+        {
+            // still a few validation errors
+            // validate(m_aTempFile.GetFileName(), test::ODF);
+        }
+
         if (mpXmlBuffer)
         {
             xmlBufferFree(mpXmlBuffer);
commit e896b8ecdbdf62a30c4097e283b0ad67a91ab60f
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 17:13:38 2014 +0100

    fix ODF validation error
    
    that attribute was only written for backwards compatibility
    
    Change-Id: Icf06300809c55c3a20a74ee3b9d36644d6f5c2d9

diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx
index 458bfdf..1fe2c17 100644
--- a/xmloff/source/style/PageMasterStyleMap.cxx
+++ b/xmloff/source/style/PageMasterStyleMap.cxx
@@ -28,8 +28,6 @@ using namespace ::xmloff::token;
         MAP(name,prefix,token,type|XML_TYPE_PROP_PAGE_LAYOUT,context, SvtSaveOptions::ODFVER_010)
 #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_012_EXT_COMPAT)
 #define HFMAP(name,prefix,token,type,context) \
         MAP(name,prefix,token,type|XML_TYPE_PROP_HEADER_FOOTER,context, SvtSaveOptions::ODFVER_010)
 
@@ -102,10 +100,6 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
     //text grid enhancement for better CJK support
     PLMAP_12( "GridBaseWidth", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_BASE_WIDTH, XML_TYPE_MEASURE, CTP_PM_GRID_BASE_WIDTH ),
     PLMAP_12( "GridSnapToChars", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_SNAP_TO, XML_TYPE_BOOL, CTP_PM_GRID_SNAP_TO ),
-    // fdo#44073: layout-grid-snap-to-characters does not exist in ODF:
-    // write this in extended mode purely for backward compatibility so old
-    // OOo/LO versions that don't understand layout-grid-snap-to read it
-    PLMAP_EX( "GridSnapToChars", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_SNAP_TO_CHARS, XML_TYPE_BOOL, CTP_PM_GRID_SNAP_TO_CHARS ),
       //export as a default attribute
     PLMAP_12( "StandardPageMode", XML_NAMESPACE_STYLE, XML_LAYOUT_GRID_STANDARD_MODE, XML_TYPE_BOOL|MID_FLAG_DEFAULT_ITEM_EXPORT, CTF_PM_STANDARD_MODE ),
 
commit 50532e3f63421f107e519242e58f03b90fdf3679
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 8 16:51:47 2014 +0100

    enable ODF export validation
    
    Change-Id: I09f517a49507a2eb31118f88f31dc2ff8b03de6a

diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 320ab5e..776955f 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -616,6 +616,8 @@ ScDocShellRef ScBootstrapFixture::saveAndReload(
     ScDocShellRef xDocSh = load(aTempFile.GetURL(), rFilter, rUserData, rTypeName, nFormatType, nFormat );
     if(nFormatType == XLSX_FORMAT_TYPE)
         validate(aTempFile.GetFileName(), test::OOXML);
+    else if (nFormatType == ODS_FORMAT_TYPE)
+        validate(aTempFile.GetFileName(), test::ODF);
     return xDocSh;
 }
 
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 137a284..a980731 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -150,7 +150,9 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor
         aValidator = "officeotron ";
     }
     else
-        return;
+    {
+        aValidator = "odfvalidator ";
+    }
 
     utl::TempFile aOutput;
     aOutput.EnableKillingFile();
@@ -184,6 +186,14 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor
             CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_Int32(0), nErrors);
         }
     }
+    else if( eFormat == test::ODF && !aContentOUString.isEmpty() )
+    {
+        if( aContentOUString.indexOf("Error") != -1 )
+        {
+            SAL_WARN("test", aContentOUString);
+            CPPUNIT_FAIL("validation errors during export");
+        }
+    }
 #endif
 }
 


More information about the Libreoffice-commits mailing list