[Libreoffice-commits] core.git: sw/qa writerfilter/source
Justin Luth
justin_luth at sil.org
Wed Jul 4 15:45:46 UTC 2018
sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 10 ++++++++++
writerfilter/source/dmapper/StyleSheetTable.cxx | 2 +-
3 files changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 58eb31be2dff045aa29e328c73a505104181b563
Author: Justin Luth <justin_luth at sil.org>
Date: Wed Jul 4 08:01:23 2018 +0300
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 at collabora.com>
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
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf82175_noStyleInheritance.docx 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( "" );
}
}
}
More information about the Libreoffice-commits
mailing list