summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-06-07 10:51:45 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-06-07 10:59:51 +0200
commit9e8957de203bb9abb208516ad32aee9527feb67b (patch)
treebdfa4da398dff781fe786b1c50a0eb8242d8fa8a
parent2bce4c76d5f05d92ffd987c25b7e492d5a2f309b (diff)
n#757905 fix VML import of mso-wrap-style:none
There were two problems here: 1) SimpleShape::implConvertAndInsert() did not set the anchor type 2) DomainMapper_Impl::PushShapeContext() tried to overwrite it Change-Id: I2c32016c4bb15c891cf287d8208e10817c6291e6
-rw-r--r--oox/inc/oox/vml/vmlshape.hxx1
-rw-r--r--oox/source/token/properties.txt1
-rw-r--r--oox/source/vml/vmlshape.cxx3
-rw-r--r--oox/source/vml/vmlshapecontext.cxx1
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx2
5 files changed, 7 insertions, 1 deletions
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index d8e72094c19c..b9e490871eb3 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -85,6 +85,7 @@ struct ShapeTypeModel
::rtl::OUString maFlip; ///< Flip type of the shape (can be "x" or "y").
sal_Bool mbAutoHeight; ///< If true, the height value is a minimum value (mostly used for textboxes)
sal_Bool mbVisible; /// Visible or Hidden
+ ::rtl::OUString maWrapStyle; /// Wrapping mode for text.
StrokeModel maStrokeModel; ///< Border line formatting.
FillModel maFillModel; ///< Shape fill formatting.
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index f2442e678819..596bf826bba3 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -10,6 +10,7 @@ AdjustmentValues
Address
Align
AnchorPosition
+AnchorType
ApplyFormDesignMode
AreaLinks
ArrangeOrder
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index aa39fcc97491..44fc631b38d9 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -426,6 +426,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
aPropertySet.setAnyProperty(PROP_VertOrientPosition, makeAny( aShapeRect.Y ) );
}
+ if (xShape.is() && maTypeModel.maWrapStyle == "none")
+ PropertySet(xShape).setAnyProperty(PROP_AnchorType, makeAny(text::TextContentAnchorType_AS_CHARACTER));
+
return xShape;
}
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 68793c947aef..290a7371ce98 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -363,6 +363,7 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
else if( aName == "flip" ) mrTypeModel.maFlip = aValue;
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "visibility" ) ) )
mrTypeModel.mbVisible = !aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("hidden") );
+ else if( aName == "mso-wrap-style" ) mrTypeModel.maWrapStyle = aValue;
}
}
}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 88a29d1f613b..08e189b0823f 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1539,7 +1539,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
uno::Reference<text::XTextRange> xTextRange(xTextAppend->createTextCursorByRange(xTextAppend->getEnd()), uno::UNO_QUERY_THROW);
xTextAppend->insertTextContent(xTextRange, xTextContent, sal_False);
}
- else
+ 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 ) );
}