diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-09-03 14:56:48 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-03 21:55:13 +0200 |
commit | 30a1bb3737b36c4ac13719c003ddc51e9b634000 (patch) | |
tree | 1145bdedd6aa24d72544f91ce070ea3aedafb0ba | |
parent | 875baa884dd64abc9c8e454e82f584b519058e90 (diff) |
tdf#112169: Crash while saving character background color to DOCX
Reviewed-on: https://gerrit.libreoffice.org/41857
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 242688f3b4fc7228637837e0f4fec3da71ac2710)
Change-Id: Iff12b9587b639166caef86f895fb841e83596817
Reviewed-on: https://gerrit.libreoffice.org/41866
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/tdf112169.odt | bin | 0 -> 23366 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf112169.odt b/sw/qa/extras/ooxmlexport/data/tdf112169.odt Binary files differnew file mode 100755 index 000000000000..51bb97f2e1e8 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf112169.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index e2c77dd280d7..f281144d70e2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -631,6 +631,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf105095, "tdf105095.docx") CPPUNIT_ASSERT(xTextRange->getString().endsWith("\tfootnote")); } +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 5047e4f0d0bd..cad3bdb73020 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -5161,8 +5161,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() ) |