From ff02109b65052a1d17d18f1f66a43480c8792691 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 18 Feb 2014 18:34:01 +0100 Subject: Clean up DomainMapper_Impl::PushShapeContext() It doesn't make sense to set anchor type here: either the VML import already set it, or it should be set when the anchor/inline token arrives. Additionally, this basically ensured that non-inline pictures are either inline or at-page anchored, and both of those values are incorrect. Change-Id: Ic71aeca9da333665a2749bb0aabbb9b63cee0c00 --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'writerfilter') diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 2cbc7374425c..b60c2a80a0f4 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1732,18 +1732,8 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape #ifdef DEBUG_DOMAINMAPPER dmapper_logger->unoPropertySet(xProps); #endif - bool bIsGraphic = xSInfo->supportsService( "com.sun.star.drawing.GraphicObjectShape" ); - - // If there are position properties, the shape should not be inserted "as character". - sal_Int32 nHoriPosition = 0, nVertPosition = 0; - xProps->getPropertyValue(rPropNameSupplier.GetName(PROP_HORI_ORIENT_POSITION)) >>= nHoriPosition; - xProps->getPropertyValue(rPropNameSupplier.GetName(PROP_VERT_ORIENT_POSITION)) >>= nVertPosition; - if (nHoriPosition != 0 || nVertPosition != 0) - bIsGraphic = false; text::TextContentAnchorType nAnchorType(text::TextContentAnchorType_AT_PARAGRAPH); xProps->getPropertyValue(rPropNameSupplier.GetName( PROP_ANCHOR_TYPE )) >>= nAnchorType; - if (nAnchorType == text::TextContentAnchorType_AT_PAGE) - bIsGraphic = false; if (!m_bInHeaderFooterImport) xProps->setPropertyValue( @@ -1772,11 +1762,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape // we need to re-set this value to xTextContent, then only values are preserved. xPropertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aGrabBag)); } - else if (nAnchorType != text::TextContentAnchorType_AS_CHARACTER) - { - xProps->setPropertyValue( rPropNameSupplier.GetName( PROP_ANCHOR_TYPE ), bIsGraphic ? uno::makeAny( text::TextContentAnchorType_AS_CHARACTER ) : uno::makeAny( text::TextContentAnchorType_AT_PARAGRAPH ) ); - } - else + else if (nAnchorType == text::TextContentAnchorType_AS_CHARACTER) { // Fix spacing for as-character objects. If the paragraph has CT_Spacing_after set, // it needs to be set on the object too, as that's what object placement code uses. -- cgit