diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 62 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 1 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 2 |
3 files changed, 39 insertions, 26 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 4ead52631169..86065cbda2e7 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1917,6 +1917,41 @@ void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND ); } +void DocxAttributeOutput::GetSdtEndBefore(const SdrObject* pSdrObj) +{ + if (pSdrObj) + { + uno::Reference<drawing::XShape> xShape(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY_THROW); + if( xShape.is() ) + { + uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); + uno::Reference< beans::XPropertySetInfo > xPropSetInfo; + if( xPropSet.is() ) + { + xPropSetInfo = xPropSet->getPropertySetInfo(); + uno::Sequence< beans::PropertyValue > aGrabBag; + if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) + { + xPropSet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + } + else if(xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("InteropGrabBag")) + { + xPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + } + + for (sal_Int32 nProp=0; nProp < aGrabBag.getLength(); ++nProp) + { + if ("SdtEndBefore" == aGrabBag[nProp].Name && m_bStartedCharSdt && !m_bEndCharSdt) + { + aGrabBag[nProp].Value >>= m_bEndCharSdt; + break; + } + } + } + } + } +} + void DocxAttributeOutput::WritePostponedGraphic() { for( std::list< PostponedGraphic >::const_iterator it = m_postponedGraphic->begin(); @@ -4011,32 +4046,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size { OSL_TRACE( "TODO DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrmFmt* pOLEFrmFmt, SwOLENode* pOLENode, const SdrObject* pSdrObj ) - some stuff still missing" ); - if (pSdrObj) - { - uno::Reference<drawing::XShape> xShape(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY_THROW); - if( xShape.is() ) - { - uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); - uno::Reference< beans::XPropertySetInfo > xPropSetInfo; - if( xPropSet.is() ) - { - xPropSetInfo = xPropSet->getPropertySetInfo(); - if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) - { - uno::Sequence< beans::PropertyValue > aGrabBag; - xPropSet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; - for (sal_Int32 nProp=0; nProp < aGrabBag.getLength(); ++nProp) - { - if ("SdtEndBefore" == aGrabBag[nProp].Name && m_bStartedCharSdt && !m_bEndCharSdt) - { - aGrabBag[nProp].Value >>= m_bEndCharSdt; - break; - } - } - } - } - } - } + GetSdtEndBefore(pSdrObj); // detect mis-use of the API assert(pGrfNode || (pOLEFrmFmt && pOLENode)); diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 90a31d87a70f..343afaf09213 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -959,6 +959,7 @@ public: bool GetWritingHeaderFooter( ) { return m_bWritingHeaderFooter; } void SetAlternateContentChoiceOpen( bool bAltContentChoiceOpen ) { m_bAlternateContentChoiceOpen = bAltContentChoiceOpen; } bool IsAlternateContentChoiceOpen( ) { return m_bAlternateContentChoiceOpen; } + void GetSdtEndBefore(const SdrObject* pSdrObj); }; #endif // INCLUDED_SW_SOURCE_FILTER_WW8_DOCXATTRIBUTEOUTPUT_HXX diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 0a88a41d3483..bd34f04596b7 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -810,6 +810,8 @@ void DocxSdrExport::writeDMLDrawing(const SdrObject* pSdrObject, const SwFrmFmt* if (!m_pImpl->isSupportedDMLShape(xShape)) return; + m_pImpl->m_rExport.DocxAttrOutput().GetSdtEndBefore(pSdrObject); + sax_fastparser::FSHelperPtr pFS = m_pImpl->m_pSerializer; Size aSize(pSdrObject->GetLogicRect().GetWidth(), pSdrObject->GetLogicRect().GetHeight()); startDMLAnchorInline(pFrmFmt, aSize); |