sw/qa/extras/ooxmlexport/data/tdf107684.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 7 +++++++ sw/qa/extras/rtfimport/data/tdf106950.rtf | 8 ++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 9 +++++++++ sw/source/core/unocore/unomapproperties.hxx | 1 + sw/source/filter/ww8/docxattributeoutput.cxx | 4 ++-- 6 files changed, 27 insertions(+), 2 deletions(-)
New commits: commit a41b599b307f77aea4196c064ef015d03ca26a14 Author: Miklos Vajna <[email protected]> Date: Tue May 30 12:48:52 2017 +0200 tdf#106950 sw: support CharShadingValue property on paragraph styles Regression from commit 26d40686128e70916a636e20f5ccc5763bbb6cc8 (fdo65400: fix for Character Shading being lost, 2013-06-23), though much more visible since commit a9e029ace41562e28e9242d63230ad1ca275f5d3 (tdf#104744 RTF import: fix unexpected zero para left margin wrt style dedup, 2017-01-03), when I fixed the RTF filter to not duplicate the "align paragraph to center" paragraph style property as a direct formatting as well. The problem was that the CharShadingValue property was not added as a paragraph style property, while in general all character properties are also allowed on paragraphs and paragraph styles as well. Change-Id: If1bdad96e45adc545a81a1f550ab7ccb3591c4f6 Reviewed-on: https://gerrit.libreoffice.org/38210 Tested-by: Jenkins <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 278bfe012a0e465cb8d08957fc07d2e5dcebdc81) Reviewed-on: https://gerrit.libreoffice.org/38268 diff --git a/sw/qa/extras/rtfimport/data/tdf106950.rtf b/sw/qa/extras/rtfimport/data/tdf106950.rtf new file mode 100644 index 000000000000..8ebaa3ce100f --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf106950.rtf @@ -0,0 +1,8 @@ +{\rtf1 +{\stylesheet +{\s20\chcbpat2\qc Title;} +} +\plain\plain\s20\chcbpat2\qc\plain +hello +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 8cefb3af2cfa..90fe265d8238 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2827,6 +2827,15 @@ DECLARE_RTFIMPORT_TEST(testTdf107116, "tdf107116.rtf") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(120)), getProperty<sal_Int32>(getParagraph(2), "TopBorderDistance")); } +DECLARE_RTFIMPORT_TEST(testTdf106950, "tdf106950.rtf") +{ + uno::Reference<text::XTextRange> xPara(getParagraph(1)); + // This was ParagraphAdjust_LEFT, trying to set CharShadingValue on a + // paragraph style thrown an exception, and remaining properties were not + // set. + CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xPara, "ParaAdjust"))); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unomapproperties.hxx b/sw/source/core/unocore/unomapproperties.hxx index b8b3091464d0..633fd3db3e2e 100644 --- a/sw/source/core/unocore/unomapproperties.hxx +++ b/sw/source/core/unocore/unomapproperties.hxx @@ -400,6 +400,7 @@ { OUString(UNO_NAME_PARA_BOTTOM_MARGIN_RELATIVE), RES_UL_SPACE, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_LO_REL_MARGIN},\ TABSTOPS_MAP_ENTRY\ { OUString(UNO_NAME_CHAR_WORD_MODE), RES_CHRATR_WORDLINEMODE,cppu::UnoType<bool>::get() , PROPERTY_NONE, 0},\ + { OUString(UNO_NAME_CHAR_SHADING_VALUE), RES_CHRATR_BACKGROUND, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_SHADING_VALUE }, \ { OUString(UNO_NAME_CHAR_LEFT_BORDER), RES_CHRATR_BOX, cppu::UnoType<css::table::BorderLine>::get(), PROPERTY_NONE, LEFT_BORDER |CONVERT_TWIPS },\ { OUString(UNO_NAME_CHAR_RIGHT_BORDER), RES_CHRATR_BOX, cppu::UnoType<css::table::BorderLine>::get(), PROPERTY_NONE, RIGHT_BORDER |CONVERT_TWIPS },\ { OUString(UNO_NAME_CHAR_TOP_BORDER), RES_CHRATR_BOX, cppu::UnoType<css::table::BorderLine>::get(), PROPERTY_NONE, TOP_BORDER |CONVERT_TWIPS },\ commit 287a33e5dadba7b284bbc1f25336c8bf0a6324de Author: Miklos Vajna <[email protected]> Date: Mon May 29 11:25:58 2017 +0200 tdf#107684 DOCX export: fix duplicated <w:outlineLvl> element for styles Next to the existing OutlineNumbering() (which is only used for styles), commit fd2d14d5543c82eb875e720c98b51518699a8fbc (Implement DOCX export of paragraph outline level, 2013-10-04) added ParaOutlineLevel() to the attribute output class that also wrote the outline level of a paragraph (style), but worked for the cases when the style was imported by writerfilter as well. As a side-effect styles imported by xmloff now have their outline level property handled twice, leading to duplicated elements. Fix the problem by only writing <w:outlineLvl> in ParaOutlineLevel(): it covers both use-cases, so no need to do anything in OutlineNumbering(). Change-Id: Ic982dd70a00609cdfc3744a8ab69aaa828410fd0 Reviewed-on: https://gerrit.libreoffice.org/38132 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins <[email protected]> (cherry picked from commit fe13c249c8964355e39869a357c393f3208b6def) Reviewed-on: https://gerrit.libreoffice.org/38267 diff --git a/sw/qa/extras/ooxmlexport/data/tdf107684.odt b/sw/qa/extras/ooxmlexport/data/tdf107684.odt new file mode 100644 index 000000000000..0ca7c53d23f3 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf107684.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 999adbcedf3c..271db2ebde9e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -506,6 +506,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107837, "tdf107837.odt") CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xTextSections->getByIndex(0), "DontBalanceTextColumns")); } +DECLARE_OOXMLEXPORT_TEST(testTdf107684, "tdf107684.odt") +{ + if (xmlDocPtr pXmlDoc = parseExport("word/styles.xml")) + // This was 1, <w:outlineLvl> was duplicated for Heading1. + assertXPath(pXmlDoc, "//w:style[@w:styleId='Heading1']/w:pPr/w:outlineLvl", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8153ebd2f28b..89597ef3baf6 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5458,9 +5458,9 @@ void lcl_OutlineLevel(sax_fastparser::FSHelperPtr const & pSerializer, sal_uInt1 } -void DocxAttributeOutput::OutlineNumbering(sal_uInt8 const nLvl) +void DocxAttributeOutput::OutlineNumbering(sal_uInt8 const /*nLvl*/) { - lcl_OutlineLevel(m_pSerializer, nLvl); + // Handled by ParaOutlineLevel() instead. } void DocxAttributeOutput::ParaOutlineLevel(const SfxUInt16Item& rItem) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
