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 f9610ed634318c27382d79089d022fb8175eb90a Author: Cédric Bosdonnat <[email protected]> Date: Tue Jun 18 09:50:41 2013 +0200 added unit test for n#820504 Change-Id: I804e081a564d24d3896160f817051b19da884c34 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 c0987d1..676fbbb 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -118,6 +118,7 @@ public: void testN816593(); void testN820509(); void testN820788(); + void testN820504(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -203,6 +204,7 @@ void Test::run() {"n816593.docx", &Test::testN816593}, {"n820509.docx", &Test::testN820509}, {"n820788.docx", &Test::testN820788}, + {"n820504.docx", &Test::testN820504}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1437,6 +1439,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 122db845e057cfd83bb2b5fde442200bc742eb8d Author: Cédric Bosdonnat <[email protected]> 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) 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();
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
