diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-09 09:40:14 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-09 09:48:12 +0100 |
commit | 1cc1a893763c948f20463b808ea5eabe10eb7fd5 (patch) | |
tree | 7cadbd81805fbcc1026eb7b1676144ad473c4a24 /sw | |
parent | d45bc3429c859392aa9fd7932908e50b0716a39c (diff) |
abi#10201 RTF export: fix crash when handling table::BorderLineStyle::NONE
Change-Id: I811820c0d550ce24ad2180a8917ef0087968c30b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfexport/data/abi10201.rtf | 3 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 9 |
3 files changed, 14 insertions, 3 deletions
diff --git a/sw/qa/extras/rtfexport/data/abi10201.rtf b/sw/qa/extras/rtfexport/data/abi10201.rtf new file mode 100644 index 000000000000..08cbe0cfe743 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/abi10201.rtf @@ -0,0 +1,3 @@ +{\rtf1 +{\*\do\dobxpage\dobypara\dodhgt8192\dptxbx\dptxbxmar0\dpx2914\dpy5119\dpxsize6474\dpysize221\dplinehollow0} +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index b6084cbed641..f04e315cc49b 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -579,6 +579,11 @@ DECLARE_RTFEXPORT_TEST(testFdo66743, "fdo66743.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(0xd8d8d8), getProperty<sal_Int32>(xCell, "BackColor")); } +DECLARE_RTFEXPORT_TEST(testAbi10201, "abi10201.rtf") +{ + // crashtest +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index fd1eca3dece6..d60d5c8a32f5 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3021,9 +3021,12 @@ void RtfAttributeOutput::FormatBox( const SvxBoxItem& rBox ) // We in fact need RGB to BGR, but the transformation is symmetric. m_aFlyProperties.push_back(std::make_pair<OString, OString>("lineColor", OString::number(msfilter::util::BGRToRGB(rColor.GetColor())))); - double const fConverted(editeng::ConvertBorderWidthToWord(pTop->GetBorderLineStyle(), pTop->GetWidth())); - sal_Int32 nWidth = sal_Int32(fConverted * 635); // Twips -> EMUs - m_aFlyProperties.push_back(std::make_pair<OString, OString>("lineWidth", OString::number(nWidth))); + if (pTop->GetBorderLineStyle() != table::BorderLineStyle::NONE) + { + double const fConverted(editeng::ConvertBorderWidthToWord(pTop->GetBorderLineStyle(), pTop->GetWidth())); + sal_Int32 nWidth = sal_Int32(fConverted * 635); // Twips -> EMUs + m_aFlyProperties.push_back(std::make_pair<OString, OString>("lineWidth", OString::number(nWidth))); + } } return; |