Kaydet (Commit) 58eb31be authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Mike Kaganski

tdf#82175 writerfilter: honor basedOn -none- for built-in styles

This section of code was introduced when
LO 5.3 commit b79b5e0d for tdf#53856 reset built-in inheritance to
Standard. (Not sure why I didn't try "none" at that time.)

This commit prevents settings specifically applied to LO's "Default"
paragraph style from affecting built-in styles that have been
re-defined by the document settings to not have any parent.

I don't know why this commit would cause regressions, but it probably
will so committing early in 6.2 development. Since both "Standard" and
every other built-in style has had LO-specific settings cleared
by SetPropertiesToDefault(), they ought to be identical, so
dependence on "Standard" should be irrelevant for default values.

Change-Id: Ie306d036f8667ef9ae1d51678f4e8e108d754641
Reviewed-on: https://gerrit.libreoffice.org/56919
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 94af1b11
...@@ -909,6 +909,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117297_tableStyle, "tdf117297_tableStyle.docx") ...@@ -909,6 +909,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf117297_tableStyle, "tdf117297_tableStyle.docx")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph3 double spacing", sal_Int16(200), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height); CPPUNIT_ASSERT_EQUAL_MESSAGE("Cell B1 Paragraph3 double spacing", sal_Int16(200), getProperty<style::LineSpacing>(xPara, "ParaLineSpacing").Height);
} }
DECLARE_OOXMLEXPORT_TEST(testTdf82175_noStyleInheritance, "tdf82175_noStyleInheritance.docx")
{
// The document's "Default" paragraph style is 1 inch fixed line spacing, and that is what should not be inherited.
style::LineSpacing aSpacing = getProperty<style::LineSpacing>(getParagraph(1), "ParaLineSpacing");
// MSWord uses 115% line spacing, but LO follows the documentation and sets single spacing.
CPPUNIT_ASSERT_MESSAGE("Text Body style 115% line spacing", sal_Int16(120) > aSpacing.Height);
CPPUNIT_ASSERT_MESSAGE("THANKS for *FIXING* line spacing", sal_Int16(115) != aSpacing.Height);
CPPUNIT_ASSERT_EQUAL(sal_Int16(style::LineSpacingMode::PROP), aSpacing.Mode);
}
DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx") DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx")
{ {
// Header was lost on export when the document had multiple columns. // Header was lost on export when the document had multiple columns.
......
...@@ -938,7 +938,7 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable ) ...@@ -938,7 +938,7 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
&& pEntry->sBaseStyleIdentifier.isEmpty() && pEntry->sBaseStyleIdentifier.isEmpty()
&& !xStyle->getParentStyle().isEmpty() ) && !xStyle->getParentStyle().isEmpty() )
{ {
xStyle->setParentStyle( "Standard" ); xStyle->setParentStyle( "" );
} }
} }
} }
......
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