Kaydet (Commit) 278bfe01 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#106950 sw: support CharShadingValue property on paragraph styles

Regression from commit 26d40686
(fdo65400: fix for Character Shading being lost, 2013-06-23), though
much more visible since commit a9e029ac
(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/38210Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 709040e0
{\rtf1
{\stylesheet
{\s20\chcbpat2\qc Title;}
}
\plain\plain\s20\chcbpat2\qc\plain
hello
\par
}
...@@ -2827,6 +2827,15 @@ DECLARE_RTFIMPORT_TEST(testTdf107116, "tdf107116.rtf") ...@@ -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")); 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(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -400,6 +400,7 @@ ...@@ -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},\ { OUString(UNO_NAME_PARA_BOTTOM_MARGIN_RELATIVE), RES_UL_SPACE, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_LO_REL_MARGIN},\
TABSTOPS_MAP_ENTRY\ TABSTOPS_MAP_ENTRY\
{ OUString(UNO_NAME_CHAR_WORD_MODE), RES_CHRATR_WORDLINEMODE,cppu::UnoType<bool>::get() , PROPERTY_NONE, 0},\ { 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_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_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 },\ { OUString(UNO_NAME_CHAR_TOP_BORDER), RES_CHRATR_BOX, cppu::UnoType<css::table::BorderLine>::get(), PROPERTY_NONE, TOP_BORDER |CONVERT_TWIPS },\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment