diff options
author | Justin Luth <justin_luth@sil.org> | 2017-05-30 17:13:47 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2017-06-09 07:35:18 +0200 |
commit | fdfdea4d5af51a68f2d497cc5c3359d74c385fd5 (patch) | |
tree | 04f33b8186ac602769a0495193a664f6faae1229 | |
parent | 691d1e90f62ce3f1930d3faf74af385d92f00d59 (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>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx | bin | 0 -> 12867 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 14 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx Binary files differnew file mode 100644 index 000000000000..1c6c2f4f5b8c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx 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/>. diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index fe04cebf55fc..b1f4a45f0e22 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1691,7 +1691,7 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote ) uno::UNO_QUERY_THROW ); uno::Reference< text::XFootnote > xFootnote( xFootnoteText, uno::UNO_QUERY_THROW ); pTopContext->SetFootnote( xFootnote ); - uno::Sequence< beans::PropertyValue > aFontProperties; + uno::Sequence< beans::PropertyValue > aFontProperties = pTopContext->GetPropertyValues(); appendTextContent( uno::Reference< text::XTextContent >( xFootnoteText, uno::UNO_QUERY_THROW ), aFontProperties ); m_aTextAppendStack.push(TextAppendContext(uno::Reference< text::XTextAppend >( xFootnoteText, uno::UNO_QUERY_THROW ), xFootnoteText->createTextCursorByRange(xFootnoteText->getStart()))); |