[Libreoffice-commits] core.git: sw/qa writerfilter/source
Justin Luth
justin_luth at sil.org
Sat Jul 7 17:56:41 UTC 2018
sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 8 ++++++++
writerfilter/source/dmapper/StyleSheetTable.cxx | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
New commits:
commit ac540c1d743250062b3e71b094209ec1428872e9
Author: Justin Luth <justin_luth at sil.org>
Date: Fri Jul 6 10:03:07 2018 +0300
tdf#95114 writerfilter: follow correctly converted stylename
Using styleIdentifierD works *if* you do an bExtendedSearch.
But since we already took the pains of ensuring that sStyleName
is not empty, and ExtendedSearch is expensive, just use sStylename.
(I don't know *why* we ensure that styleName exists, and this
code was originally flakey enough that it might be a fake
requirement...)
This only affects the few styles which have a different "name"
than their ID. The primary one affected is TextBody/Body Text.
Change-Id: I77f143760c10be4b7853f16bce2b57474b70d3f1
Reviewed-on: https://gerrit.libreoffice.org/57073
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth at sil.org>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 2543f000a52d..cc0ddb3f99de 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -251,6 +251,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97648_relativeWidth,"tdf97648_relativeWidth.docx
DECLARE_OOXMLEXPORT_TEST(testTdf104061_tableSectionColumns,"tdf104061_tableSectionColumns.docx")
{
CPPUNIT_ASSERT_MESSAGE("There should be two or three pages", getPages() <= 3 );
+
+ //tdf#95114 - follow style is Text Body - DOCX test
+ uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("annotation subject"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("annotation text"), getProperty<OUString>(properties, "FollowStyle"));
}
DECLARE_OOXMLEXPORT_TEST(testTdf46940_dontEquallyDistributeColumns, "tdf46940_dontEquallyDistributeColumns.docx")
@@ -270,6 +274,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf98700_keepWithNext, "tdf98700_keepWithNext.odt")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 1 style inherits keeps with next", true, getProperty<bool>(getParagraph(3), "ParaKeepTogether"));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Heading 2 style disabled keep with next", false, getProperty<bool>(getParagraph(4), "ParaKeepTogether"));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Text Body style toggled off keep with next", false, getProperty<bool>(getParagraph(5), "ParaKeepTogether"));
+
+ //tdf#95114 - follow style is Text Body - ODT test
+ uno::Reference< beans::XPropertySet > properties(getStyles("ParagraphStyles")->getByName("Heading 1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("Text body"), getProperty<OUString>(properties, "FollowStyle"));
}
// base class to supply a helper method for testHFLinkToPrev
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 5d65e9339a28..383ac0d5a0f9 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1135,7 +1135,7 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
{
beans::PropertyValue aNew;
aNew.Name = "FollowStyle";
- aNew.Value <<= ConvertStyleName((*it)->sStyleIdentifierD);
+ aNew.Value <<= ConvertStyleName((*it)->sStyleName);
aSortedPropVals.Insert(aNew);
break;
}
More information about the Libreoffice-commits
mailing list