sw/qa/extras/rtfexport/data/abi10076.odt    |binary
 sw/qa/extras/rtfexport/rtfexport.cxx        |    5 +++++
 sw/source/filter/ww8/rtfattributeoutput.cxx |    7 +++----
 3 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 2f33111510c87ca310fde346e223bd6e750b2248
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Tue Sep 9 17:15:56 2014 +0200

    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

diff --git a/sw/qa/extras/rtfexport/data/abi10076.odt 
b/sw/qa/extras/rtfexport/data/abi10076.odt
new file mode 100644
index 0000000..4ac6aa5
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/abi10076.odt differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index f11f0bb..bdcb26b 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 570af9b..653c5ad 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)
         {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to