diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-09 17:15:56 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-09-09 17:34:58 +0200 |
commit | 2f33111510c87ca310fde346e223bd6e750b2248 (patch) | |
tree | be2924fb8d7a44e34d8e27138f074692b34d4a96 /sw | |
parent | 2e01b87378e78945791b09318135b36b16edf0aa (diff) |
abi#10076 RTF export: handle frames without a valid anchor point
Ideally all frames have an anchor point in the maFrames vector, as
provided by MSWordExportBase. If that's not the case, then we have no
idea what would be a valid anchor point: just export those as inline, as
we did before.
Change-Id: I81134d9fb8dc4ca166084964d277ac02ceccde7b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfexport/data/abi10076.odt | bin | 0 -> 98498 bytes | |||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 7 |
3 files changed, 8 insertions, 4 deletions
diff --git a/sw/qa/extras/rtfexport/data/abi10076.odt b/sw/qa/extras/rtfexport/data/abi10076.odt Binary files differnew file mode 100644 index 000000000000..4ac6aa559c8a --- /dev/null +++ b/sw/qa/extras/rtfexport/data/abi10076.odt diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index f11f0bbd2d5a..bdcb26b56867 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -686,6 +686,11 @@ DECLARE_RTFEXPORT_TEST(testAbi10039, "abi10039.odt") CPPUNIT_ASSERT(text::TextContentAnchorType_AS_CHARACTER != getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); } +DECLARE_RTFEXPORT_TEST(testAbi10076, "abi10076.odt") +{ + // Just make sure that we don't crash after exporting a fully calculated layout. +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 570af9bbaba6..653c5adf5167 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3703,7 +3703,6 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw break; } } - assert(pFrame); /* If the graphic is not of type WMF then we will have to store two @@ -3712,7 +3711,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw a wmf already then we don't need any such wrapping */ bool bIsWMF = pBLIPType && std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0; - if (pFrame->IsInline()) + if (!pFrame || pFrame->IsInline()) { if (!bIsWMF) m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); @@ -3766,7 +3765,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SP "{" OOO_STRING_SVTOOLS_RTF_SN " pib" "}{" OOO_STRING_SVTOOLS_RTF_SV " "); } - bool bWritePicProp = pFrame->IsInline(); + bool bWritePicProp = !pFrame || pFrame->IsInline(); if (pBLIPType) ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm(), bWritePicProp); else @@ -3781,7 +3780,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm(), bWritePicProp); } - if (pFrame->IsInline()) + if (!pFrame || pFrame->IsInline()) { if (!bIsWMF) { |