[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 2 commits - sw/qa sw/source

Tamás Zolnai tamas.zolnai at collabora.com
Tue Sep 12 12:42:44 UTC 2017


 sw/qa/extras/odfexport/data/tdf111891_frameVertStyle.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx                     |    6 ++++++
 sw/qa/extras/ooxmlexport/data/tdf112169.odt              |binary
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx                |    5 +++++
 sw/source/core/unocore/unostyle.cxx                      |    7 ++++++-
 sw/source/filter/ww8/ww8atr.cxx                          |    4 +++-
 6 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit e3312f41fb70f91e31878e2bb9ccbfbf7e917eea
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Sun Sep 3 14:56:48 2017 +0200

    tdf#112169: Crash while saving character background color to DOCX
    
    Reviewed-on: https://gerrit.libreoffice.org/41857
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 242688f3b4fc7228637837e0f4fec3da71ac2710)
    
    Reviewed-on: https://gerrit.libreoffice.org/41867
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 9b3e2486d8e96b6fdd844fbdb5fa59c7782e82ee)
    
    Change-Id: Iff12b9587b639166caef86f895fb841e83596817

diff --git a/sw/qa/extras/ooxmlexport/data/tdf112169.odt b/sw/qa/extras/ooxmlexport/data/tdf112169.odt
new file mode 100755
index 000000000000..51bb97f2e1e8
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf112169.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 629aa01a9cb6..55f6e3ab3481 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -570,6 +570,11 @@ DECLARE_OOXMLEXPORT_TEST(testWatermarkLayer, "watermark-layer.docx")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(1), pObject->GetLayer());
 }
 
+DECLARE_OOXMLEXPORT_TEST(tdf112169, "tdf112169.odt")
+{
+    // LO crashed while export because of chararacter background color handling
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 1e0b84710215..3f01f95fc36d 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -5172,8 +5172,10 @@ void AttributeOutputBase::CharBackgroundBase( const SvxBrushItem& rBrush )
     bool bHasShadingMarker = false;
 
     // Check shading marker
+    const SfxPoolItem* pItem = GetExport().HasItem(RES_CHRATR_GRABBAG);
+    if( pItem )
     {
-        const SfxGrabBagItem& aGrabBag = static_cast< const SfxGrabBagItem& >( GetExport().GetItem( RES_CHRATR_GRABBAG ) );
+        const SfxGrabBagItem aGrabBag = static_cast< const SfxGrabBagItem& >(*pItem);
         const std::map<OUString, css::uno::Any>& rMap = aGrabBag.GetGrabBag();
         auto aIterator = rMap.find("CharShadingMarker");
         if( aIterator != rMap.end() )
commit 267b46d4c6052152f2e7023e26bb21670869743c
Author: Justin Luth <justin_luth at sil.org>
Date:   Thu Aug 24 15:48:29 2017 -0400

    tdf#111891 unostyle: use default handler for non-page style
    
    LO 5.1 commit 664197d95becd516c3dac25a50439078ba61e051
    introduced a handler for RES_TEXT_VERT_ADJUST to handle
    page styles, but that meant that the default handler
    was no longer called for frames (the only other item
    currently using RES_TEXT_VERT_ADJUST).
    
    Change-Id: I33827160fe64dc4cc2107afc26f7ac2e698007e1
    Reviewed-on: https://gerrit.libreoffice.org/41538
    Tested-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    (cherry picked from commit 10dc371d31f003ac3ed9b89ca1db95d36603603f)
    Reviewed-on: https://gerrit.libreoffice.org/41910
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    (cherry picked from commit 461aa995d75f031209711feda9d785d915c42dd2)
    Reviewed-on: https://gerrit.libreoffice.org/42082
    (cherry picked from commit db7a015c86248bd2a3d090240f9360f84b3bec8c)

diff --git a/sw/qa/extras/odfexport/data/tdf111891_frameVertStyle.odt b/sw/qa/extras/odfexport/data/tdf111891_frameVertStyle.odt
new file mode 100644
index 000000000000..8fcf98a6272b
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf111891_frameVertStyle.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index a5f456f4807f..b4c728b3302d 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -758,6 +758,12 @@ DECLARE_ODFEXPORT_TEST(testTextFrameVertAdjust, "textframe-vertadjust.odt")
     CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust"));
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf111891_frameVertStyle, "tdf111891_frameVertStyle.odt")
+{
+    uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(drawing::TextVerticalAdjust_BOTTOM, getProperty<drawing::TextVerticalAdjust>(xFrame, "TextVerticalAdjust"));
+}
+
 DECLARE_ODFEXPORT_TEST(testShapeRelsize, "shape-relsize.odt")
 {
     uno::Reference<drawing::XShape> xShape = getShape(1);
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index ad6dd78b687e..db6fc57152c3 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1803,8 +1803,13 @@ void SwXStyle::SetPropertyValue<RES_PAGEDESC>(const SfxItemPropertySimpleEntry&
     }
 }
 template<>
-void SwXStyle::SetPropertyValue<RES_TEXT_VERT_ADJUST>(const SfxItemPropertySimpleEntry&, const SfxItemPropertySet&, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase)
+void SwXStyle::SetPropertyValue<RES_TEXT_VERT_ADJUST>(const SfxItemPropertySimpleEntry& rEntry, const SfxItemPropertySet& rPropSet, const uno::Any& rValue, SwStyleBase_Impl& o_rStyleBase)
 {
+    if(m_rEntry.m_eFamily != SfxStyleFamily::Page)
+    {
+        SetPropertyValue<HINT_BEGIN>(rEntry, rPropSet, rValue, o_rStyleBase);
+        return;
+    }
     if(!m_pDoc || !rValue.has<drawing::TextVerticalAdjust>() || !o_rStyleBase.GetOldPageDesc())
         return;
     SwPageDesc* pPageDesc = m_pDoc->FindPageDesc(o_rStyleBase.GetOldPageDesc()->GetName());


More information about the Libreoffice-commits mailing list