[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - 2 commits - sw/qa writerfilter/source

Cédric Bosdonnat cedric.bosdonnat at free.fr
Tue Jun 18 07:03:50 PDT 2013


 sw/qa/extras/ooxmlimport/data/n820504.docx      |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx        |   12 ++++++++++++
 writerfilter/source/dmapper/StyleSheetTable.cxx |    3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 60443905cdc004397322b5beef0e2bd8594a8ebf
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Jun 18 09:50:41 2013 +0200

    added unit test for n#820504
    
    Change-Id: I804e081a564d24d3896160f817051b19da884c34
    (cherry picked from commit f9610ed634318c27382d79089d022fb8175eb90a)
    Reviewed-on: https://gerrit.libreoffice.org/4330
    Reviewed-by: Noel Power <noel.power at suse.com>
    Tested-by: Noel Power <noel.power at suse.com>

diff --git a/sw/qa/extras/ooxmlimport/data/n820504.docx b/sw/qa/extras/ooxmlimport/data/n820504.docx
new file mode 100644
index 0000000..36279a9
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n820504.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index ce66980..c895db2 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -119,6 +119,7 @@ public:
     void testPageBorderShadow();
     void testN820509();
     void testN820788();
+    void testN820504();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -205,6 +206,7 @@ void Test::run()
         {"page-border-shadow.docx", &Test::testPageBorderShadow},
         {"n820509.docx", &Test::testN820509},
         {"n820788.docx", &Test::testN820788},
+        {"n820504.docx", &Test::testN820504},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1457,6 +1459,16 @@ void Test::testN820788()
     CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty<sal_Int16>(xFrame, "SizeType"));
 }
 
+void Test::testN820504()
+{
+    uno::Reference<style::XStyleFamiliesSupplier> xFamiliesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XNameAccess> xFamiliesAccess(xFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
+    uno::Reference<container::XNameAccess> xStylesAccess(xFamiliesAccess->getByName("ParagraphStyles"), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xStyle(xStylesAccess->getByName("Default Style"), uno::UNO_QUERY);
+    // The problem was that the CharColor was set to AUTO (-1) even if we have some default char color set
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(4040635), getProperty<sal_Int32>(xStyle, "CharColor"));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 97a46454b39fa54c4110b2e24cfec1f18b32e596
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Mon Jun 17 13:42:34 2013 +0200

    n#820504: default color hidden by Default style in writerfilter
    
    Setting the font color of the default paragraph style to Auto makes the
    color set in the Writer defaults (from rPrDefault) ignored.
    
    Change-Id: I1dcd92bcd0774f5229785373242899a492ab7b7c
    (cherry picked from commit d7acb5ba0924f848f1ae96eceab50a0169d18445)
    (cherry picked from commit 122db845e057cfd83bb2b5fde442200bc742eb8d)
    Reviewed-on: https://gerrit.libreoffice.org/4329
    Reviewed-by: Noel Power <noel.power at suse.com>
    Tested-by: Noel Power <noel.power at suse.com>

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 74adb0b..8352b1b 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -786,8 +786,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable )
                         pEntry->pProperties->Insert(PROP_PARA_ORPHANS, true, aTwo, false);
     //                  Left-to-right direction if not already set
                         pEntry->pProperties->Insert(PROP_WRITING_MODE, true, uno::makeAny( sal_Int16(text::WritingMode_LR_TB) ), false);
-    //                  font color COL_AUTO if not already set
-                        pEntry->pProperties->Insert(PROP_CHAR_COLOR, true, uno::makeAny( sal_Int32(0xffffffff) ), false);
+                        // Don't set font color to Auto if not already set: this could hide the default font color setting
                     }
 
                     uno::Sequence< beans::PropertyValue > aPropValues = pEntry->pProperties->GetPropertyValues();


More information about the Libreoffice-commits mailing list