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

Justin Luth justin_luth at sil.org
Tue Aug 15 19:51:47 UTC 2017


 sw/qa/extras/ooxmlimport/ooxmlimport.cxx          |    6 ++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 73e7619d903d5fc79ea339ab2c5b4c1ef3cf326e
Author: Justin Luth <justin_luth at sil.org>
Date:   Tue Aug 15 12:39:05 2017 -0400

    tdf#109319 writerfilter: set DropCap.Distance
    
    Change-Id: I3ec06e9a196897c095f227e9f765243c6c188898
    Reviewed-on: https://gerrit.libreoffice.org/41185
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b030043eed24..2c2da5e9e7f3 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -731,14 +731,20 @@ DECLARE_OOXMLIMPORT_TEST(testTdf109316_dropCaps, "tdf109316_dropCaps.docx")
     uno::Reference<beans::XPropertySet> xSet(getParagraph(1), uno::UNO_QUERY);
     css::style::DropCapFormat aDropCap = getProperty<css::style::DropCapFormat>(xSet,"DropCapFormat");
     CPPUNIT_ASSERT_EQUAL( sal_Int8(2), aDropCap.Lines );
+    CPPUNIT_ASSERT_EQUAL( sal_Int8(1), aDropCap.Count );
+    CPPUNIT_ASSERT_EQUAL( sal_Int16(1270), aDropCap.Distance );
 
     xSet.set(getParagraph(2), uno::UNO_QUERY);
     aDropCap = getProperty<css::style::DropCapFormat>(xSet,"DropCapFormat");
     CPPUNIT_ASSERT_EQUAL( sal_Int8(3), aDropCap.Lines );
+    CPPUNIT_ASSERT_EQUAL( sal_Int8(1), aDropCap.Count );
+    CPPUNIT_ASSERT_EQUAL( sal_Int16(508), aDropCap.Distance );
 
     xSet.set(getParagraph(3), uno::UNO_QUERY);
     aDropCap = getProperty<css::style::DropCapFormat>(xSet,"DropCapFormat");
     CPPUNIT_ASSERT_EQUAL( sal_Int8(4), aDropCap.Lines );
+    CPPUNIT_ASSERT_EQUAL( sal_Int8(7), aDropCap.Count );
+    CPPUNIT_ASSERT_EQUAL( sal_Int16(0), aDropCap.Distance );
 }
 
 DECLARE_OOXMLIMPORT_TEST(lineWpsOnly, "line-wps-only.docx")
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2c282ecc394a..589dbf1b6770 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1124,7 +1124,8 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap )
                     sal_Int32 nLines = rAppendContext.pLastParagraphProperties->GetLines();
                     aDrop.Lines = nLines > 0 && nLines < SAL_MAX_INT8 ? (sal_Int8)nLines : 2;
                     aDrop.Count = rAppendContext.pLastParagraphProperties->GetDropCapLength();
-                    aDrop.Distance  = 0; //TODO: find distance value
+                    sal_Int32 nHSpace = rAppendContext.pLastParagraphProperties->GethSpace();
+                    aDrop.Distance  = nHSpace > 0 && nHSpace < SAL_MAX_INT16 ? (sal_Int16)nHSpace : 0;
                     //completes (5)
                     if( pParaContext->IsFrameMode() )
                         pToBeSavedProperties.reset( new ParagraphProperties(*pParaContext) );


More information about the Libreoffice-commits mailing list