diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-09-03 14:56:48 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-09-08 13:26:08 +0200 |
commit | 9b3e2486d8e96b6fdd844fbdb5fa59c7782e82ee (patch) | |
tree | d7cdaad0278a35ddb3862b1f82c9b9cf0096e5f1 | |
parent | db7a015c86248bd2a3d090240f9360f84b3bec8c (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/41867
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@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 1925600de5e9..0fb8fb5cee88 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -274,6 +274,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107684, "tdf107684.odt") assertXPath(pXmlDoc, "//w:style[@w:styleId='Heading1']/w:pPr/w:outlineLvl", 1); } +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() ) |