[Libreoffice-commits] core.git: sw/qa writerfilter/source

Justin Luth justin_luth at sil.org
Fri Jun 9 05:35:39 UTC 2017


 sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx                |   14 +++++++++++++-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx        |    2 +-
 3 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit fdfdea4d5af51a68f2d497cc5c3359d74c385fd5
Author: Justin Luth <justin_luth at sil.org>
Date:   Tue May 30 17:13:47 2017 +0300

    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 at sil.org>
    Tested-by: Justin Luth <justin_luth at sil.org>

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
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf82173_endnoteStyle.docx 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/>.
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())));


More information about the Libreoffice-commits mailing list