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

Mark Hung marklh9 at gmail.com
Tue Oct 24 14:12:07 UTC 2017


 sw/qa/extras/odfexport/data/tdf77961.odt        |binary
 sw/qa/extras/odfexport/odfexport.cxx            |    7 +++++++
 xmloff/source/text/XMLTextMasterPageContext.cxx |    3 +++
 3 files changed, 10 insertions(+)

New commits:
commit 48a4cf1021c471ebf1ecbc351292511131c2d4ca
Author: Mark Hung <marklh9 at gmail.com>
Date:   Fri Oct 20 07:15:21 2017 +0800

    tdf#77961 set display grid to false if the attribute is missing
    
    Display-grid attribute is absent in the ODT file created by
    Word. We prefer it to be invisible in this case.
    
    Change-Id: I5abc301f76f547f78a55a507b61396bae0de1f71
    Reviewed-on: https://gerrit.libreoffice.org/43619
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/sw/qa/extras/odfexport/data/tdf77961.odt b/sw/qa/extras/odfexport/data/tdf77961.odt
new file mode 100644
index 000000000000..a6205e018d5f
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf77961.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index a2f9923b57d7..173807889849 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1695,6 +1695,13 @@ DECLARE_ODFEXPORT_TEST(testTdf100492, "tdf100492.odt")
     //assertXPath(pXmlDoc, "/svg/path", 4);
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf77961, "tdf77961.odt")
+{
+    uno::Reference<container::XNameAccess> xStyles(getStyles("PageStyles"));
+    uno::Reference<beans::XPropertySet> xStyle(xStyles->getByName("Standard"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL( false , getProperty<bool>(xStyle, "GridDisplay"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx
index 0d9944a6f706..6fa630c1182d 100644
--- a/xmloff/source/text/XMLTextMasterPageContext.cxx
+++ b/xmloff/source/text/XMLTextMasterPageContext.cxx
@@ -157,6 +157,9 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport,
         if( xMultiStates.is() )
             xMultiStates->setAllPropertiesToDefault();
 
+        if ( xPropSetInfo->hasPropertyByName( "GridDisplay" ) )
+            xPropSet->setPropertyValue( "GridDisplay", Any(false) );
+
         bInsertHeader = bInsertFooter = true;
         bInsertHeaderLeft = bInsertFooterLeft = true;
         bInsertHeaderFirst = bInsertFooterFirst = true;


More information about the Libreoffice-commits mailing list