Kaydet (Commit) 4de30fa7 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#74499 crash on writing .docx

Change-Id: If2d46e26ec6ffead1e283479c516131a2b66f50d
üst a98a4f13
...@@ -812,13 +812,16 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId) ...@@ -812,13 +812,16 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId)
FSEND); FSEND);
uno::Any aRotation ; uno::Any aRotation ;
uno::Reference< drawing::XShape > xShape;
const SdrObject* pSdrObj = rFrmFmt.FindRealSdrObject(); 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::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; sal_Int32 nRotation = 0;
if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag"))
if (xPropSetInfo->hasPropertyByName("FrameInteropGrabBag"))
{ {
uno::Sequence< beans::PropertyValue > propList; uno::Sequence< beans::PropertyValue > propList;
xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList; xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList;
...@@ -858,7 +861,7 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId) ...@@ -858,7 +861,7 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId)
FSEND); FSEND);
pFS->endElementNS(XML_a, XML_xfrm); pFS->endElementNS(XML_a, XML_xfrm);
OUString shapeType = "rect"; OUString shapeType = "rect";
if (xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag"))
{ {
uno::Sequence< beans::PropertyValue > propList; uno::Sequence< beans::PropertyValue > propList;
xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList; xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= propList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment