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

Mike Kaganski mike.kaganski at collabora.com
Tue Nov 7 13:26:50 UTC 2017


 sc/qa/unit/bugfix-test.cxx                    |   15 +++++++++++++++
 sc/qa/unit/data/ods/tdf31231.ods              |binary
 sc/source/filter/xml/XMLTableShapeResizer.cxx |    2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit f657454b69c813b90a8b3c1adb2feef1066dbd35
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Tue Nov 7 13:33:48 2017 +0300

    tdf#31231: properly check for SvXMLImportFlags::ALL
    
    A regression from commit dc28e90d200a839d4017d548217ee5ce8a23f84
    
    Change-Id: I8982522d16d8335b1bb3522076030a023c0c297f
    Reviewed-on: https://gerrit.libreoffice.org/44396
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index f776bbf5f8cb..94fa2d188189 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -10,6 +10,7 @@
 #include <validat.hxx>
 #include <tabvwsh.hxx>
 #include <com/sun/star/frame/Desktop.hpp>
+#include <vcl/scheduler.hxx>
 #include "helper/qahelper.hxx"
 
 using namespace ::com::sun::star;
@@ -36,6 +37,7 @@ public:
     void testTdf103960();
     void testRhbz1390776();
     void testTdf104310();
+    void testTdf31231();
 
     CPPUNIT_TEST_SUITE(ScFiltersTest);
     CPPUNIT_TEST(testTdf64229);
@@ -50,6 +52,7 @@ public:
     CPPUNIT_TEST(testTdf103960);
     CPPUNIT_TEST(testRhbz1390776);
     CPPUNIT_TEST(testTdf104310);
+    CPPUNIT_TEST(testTdf31231);
     CPPUNIT_TEST_SUITE_END();
 private:
     uno::Reference<uno::XInterface> m_xCalcComponent;
@@ -282,6 +285,18 @@ void ScFiltersTest::testTdf104310()
     }
 }
 
+void ScFiltersTest::testTdf31231()
+{
+    // We must open it read-write to allow setting modified flag
+    ScDocShellRef xDocSh = loadDoc("tdf31231.", FORMAT_ODS, true);
+    xDocSh->DoHardRecalc();
+
+    CPPUNIT_ASSERT_MESSAGE("The spreadsheet must be allowed to set modified state", xDocSh->IsEnableSetModified());
+    CPPUNIT_ASSERT_MESSAGE("The spreadsheet must not be modified on open", !xDocSh->IsModified());
+
+    xDocSh->DoClose();
+}
+
 ScFiltersTest::ScFiltersTest()
       : ScBootstrapFixture( "sc/qa/unit/data" )
 {
diff --git a/sc/qa/unit/data/ods/tdf31231.ods b/sc/qa/unit/data/ods/tdf31231.ods
new file mode 100644
index 000000000000..2a9916aca0c3
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf31231.ods differ
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index 659eba5fd64b..e71445f9a4d9 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.cxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx
@@ -93,7 +93,7 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc,
         //for loading binary files e.g.
         //if we have the flat filter we need to set the dirty flag thus the visible charts get repainted
         //otherwise the charts keep their first visual representation which was created at a moment where the calc itself was not loaded completely and is therefore incorrect
-        if( rImport.getImportFlags() & SvXMLImportFlags::ALL )
+        if( (rImport.getImportFlags() & SvXMLImportFlags::ALL) == SvXMLImportFlags::ALL )
             pCL->SetDirty( true );
         else
         {


More information about the Libreoffice-commits mailing list