summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-07-04 08:01:23 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-07-04 17:45:21 +0200
commit58eb31be2dff045aa29e328c73a505104181b563 (patch)
treed85b6e01ccca8f8c9ae986aae4c6bc96507e250c
parent94af1b1100e8b48f755ec66b190d2017aae1dc00 (diff)
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: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docxbin0 -> 5432 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx10
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx2
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docx b/sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docx
new file mode 100644
index 000000000000..e9df3b7048eb
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 96e0a342dc1a..c7a808a24e41 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -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);
}
+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")
{
// Header was lost on export when the document had multiple columns.
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 1047d9c20904..7bb43fe5c6de 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -938,7 +938,7 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
&& pEntry->sBaseStyleIdentifier.isEmpty()
&& !xStyle->getParentStyle().isEmpty() )
{
- xStyle->setParentStyle( "Standard" );
+ xStyle->setParentStyle( "" );
}
}
}