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

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 29 18:49:38 UTC 2019


 sw/qa/extras/ooxmlexport/data/calendar4.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx    |    9 +++++++++
 writerfilter/source/dmapper/DomainMapper.cxx |   23 ++++++-----------------
 3 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit a070fb8e87e0712de5336a9683208b6b277ce9b9
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Fri Nov 29 12:22:15 2019 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Fri Nov 29 19:48:32 2019 +0100

    tdf#118947 writerfilter: remove obsolete tablestyle fontsize hack
    
    LO 6.5 commit 6bced3c6a1bf8d4652dd6ba75e41b128ce1bfc5c
    obsoletes this old hack. The default paragraph style has
    (almost) nothing to do with table styles.
    *Any* specified (non-inherited) paragraph style property
    should override a table style, including the default paratyle.
    
    One exception is the default occurance of the
    not-yet-supported word/settings.xml compat option
    overrideTableStyleFontSizeAndJustification = false.
    The default case should cause the table-style font to override
    a size 11 or 12 default-paragraph-style font. So that is actually
    double-reason to remove this old hack which threw out
    the table-style size altogether.
    
    Change-Id: Id1687f32b8431b6fa8770b01c344e75e0ffb344f
    Reviewed-on: https://gerrit.libreoffice.org/84044
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ooxmlexport/data/calendar4.docx b/sw/qa/extras/ooxmlexport/data/calendar4.docx
new file mode 100644
index 000000000000..ecf71d8a340a
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/calendar4.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index c78ecb5aff38..b11f3f0d45e5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -320,6 +320,15 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar3, "calendar3.docx")
     CPPUNIT_ASSERT_EQUAL(16.f, getProperty<float>(getRun(xCell,1), "CharHeight"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testCalendar4, "calendar4.docx")
+{
+    // TableStyle:fontsize - overrides DocDefaults, but not Style.
+    // In this case the style does not define anything (but does copy-inherit the DocDefaults size 36)
+    uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A3"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(14.f, getProperty<float>(getRun(xCell,1), "CharHeight"));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTcBorders, "testTcBorders.docx")
 {
     //fdo#76635 : Table borders are not getting preserved.
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 4f7648f0967f..0744c5673b68 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1684,7 +1684,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
             }
             else
             {
-                bool bIgnore = false;
                 const   RubyInfo    &aInfo = m_pImpl->GetRubyInfo();
                 if (aInfo.nSprmId == NS_ooxml::LN_CT_Ruby_rt && aInfo.nHps > 0 )
                 {
@@ -1696,23 +1695,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
                     fVal = double(aInfo.nHpsBaseText) / 2.;
                     aVal <<= fVal;
                 }
-                else if (m_pImpl->m_bInTableStyleRunProps)
-                {
-                    // If the default para style contains PROP_CHAR_HEIGHT, that should have priority over the table style.
-                    StyleSheetEntryPtr pTable = m_pImpl->GetStyleSheetTable()->FindDefaultParaStyle();
-                    if (pTable && pTable->pProperties->isSet(PROP_CHAR_HEIGHT) )
-                        bIgnore = true;
-                }
-                if (!bIgnore)
-                {
-                    //Asian get the same value as Western
-                    rContext->Insert( PROP_CHAR_HEIGHT, aVal );
-                    rContext->Insert( PROP_CHAR_HEIGHT_ASIAN, aVal );
+                //Asian get the same value as Western
+                rContext->Insert( PROP_CHAR_HEIGHT, aVal );
+                rContext->Insert( PROP_CHAR_HEIGHT_ASIAN, aVal );
 
-                    uno::Reference<beans::XPropertySet> xCharStyle(m_pImpl->GetCurrentNumberingCharStyle());
-                    if (xCharStyle.is())
-                        xCharStyle->setPropertyValue(getPropertyName(PROP_CHAR_HEIGHT), aVal);
-                }
+                uno::Reference<beans::XPropertySet> xCharStyle(m_pImpl->GetCurrentNumberingCharStyle());
+                if (xCharStyle.is())
+                    xCharStyle->setPropertyValue(getPropertyName(PROP_CHAR_HEIGHT), aVal);
             }
             m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, (nSprmId == NS_ooxml::LN_EG_RPrBase_sz ? OUString("sz") : OUString("szCs")), OUString::number(nIntValue));
         }


More information about the Libreoffice-commits mailing list