summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-05-30 17:13:47 +0300
committerJustin Luth <justin_luth@sil.org>2017-06-09 07:35:18 +0200
commitfdfdea4d5af51a68f2d497cc5c3359d74c385fd5 (patch)
tree04f33b8186ac602769a0495193a664f6faae1229 /sw
parent691d1e90f62ce3f1930d3faf74af385d92f00d59 (diff)
tdf#82173 writerfilter: apply char properties to footnote
The char property values as defined in w:rPr were not connected to the in-text footnote or endnote. Change-Id: I7729c534879e59ff5c9500dd1b16f9f1476abd76 Reviewed-on: https://gerrit.libreoffice.org/38372 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docxbin0 -> 12867 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx14
2 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx
new file mode 100644
index 000000000000..1c6c2f4f5b8c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index c7ef31f8d02d..1dc2618cced7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -12,6 +12,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
+#include <com/sun/star/text/XFootnote.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextColumns.hpp>
#include <com/sun/star/text/XTextFrame.hpp>
@@ -521,13 +522,24 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99227, "tdf99227.docx")
assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1);
}
-DECLARE_OOXMLIMPORT_TEST(testTdf82173_footnoteStyle, "tdf82173_footnoteStyle.docx")
+DECLARE_OOXMLEXPORT_TEST(testTdf82173_footnoteStyle, "tdf82173_footnoteStyle.docx")
{
uno::Reference<beans::XPropertySet> xPageStyle(getStyles("CharacterStyles")->getByName("Footnote Characters"), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL( sal_Int32(58), getProperty< sal_Int32 >(xPageStyle, "CharEscapementHeight") );
CPPUNIT_ASSERT_EQUAL( sal_Int32(0x00FF00), getProperty< sal_Int32 >(xPageStyle, "CharColor") );
}
+DECLARE_OOXMLEXPORT_TEST(testTdf82173_endnoteStyle, "tdf82173_endnoteStyle.docx")
+{
+ uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xEndnotes(xEndnotesSupplier->getEndnotes(), uno::UNO_QUERY);
+ uno::Reference<text::XFootnote> xEndnote;
+ xEndnotes->getByIndex(0) >>= xEndnote;
+ // character properties were previously not assigned to the footnote/endnote in-text anchor.
+ CPPUNIT_ASSERT_EQUAL( 24.0f, getProperty< float >(xEndnote->getAnchor(), "CharHeight") );
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(0xFF0000), getProperty< sal_Int32 >(xEndnote->getAnchor(), "CharColor") );
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf104162, "tdf104162.docx")
{
// This crashed: the comment field contained a table with a <w:hideMark/>.