diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-06 09:40:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-06 09:46:41 +0000 |
commit | 4de30fa7fd6abb5c2ea2b63a0e306954f7acc1b1 (patch) | |
tree | 7d11656d2d1dfbab4e598c62b51990dc3ca06a6f /sw/source | |
parent | a98a4f13e1c94c876613a4b9a95e38aed6ab2eaf (diff) |
Resolves: fdo#74499 crash on writing .docx
Change-Id: If2d46e26ec6ffead1e283479c516131a2b66f50d
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index b3400835ab80..d0deeb5ce615 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -812,13 +812,16 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId) FSEND); uno::Any aRotation ; + uno::Reference< drawing::XShape > xShape; const SdrObject* pSdrObj = rFrmFmt.FindRealSdrObject(); - uno::Reference< drawing::XShape > xShape(((SdrObject*)pSdrObj)->getUnoShape(), uno::UNO_QUERY); + if (pSdrObj) + xShape = uno::Reference< drawing::XShape >(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xPropertySet(xShape, uno::UNO_QUERY); - uno::Reference< beans::XPropertySetInfo > xPropSetInfo = xPropertySet->getPropertySetInfo(); + uno::Reference< beans::XPropertySetInfo > xPropSetInfo; + if (xPropertySet.is()) + xPropSetInfo = xPropertySet->getPropertySetInfo(); sal_Int32 nRotation = 0; - - if (xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) + if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) { uno::Sequence< beans::PropertyValue > propList; xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList; @@ -858,7 +861,7 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId) FSEND); pFS->endElementNS(XML_a, XML_xfrm); OUString shapeType = "rect"; - if (xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) + if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) { uno::Sequence< beans::PropertyValue > propList; xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList; |