[Libreoffice-commits] .: oox/inc oox/source writerfilter/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Thu Jun 7 01:58:49 PDT 2012


 oox/inc/oox/vml/vmlshape.hxx                      |    1 +
 oox/source/token/properties.txt                   |    1 +
 oox/source/vml/vmlshape.cxx                       |    3 +++
 oox/source/vml/vmlshapecontext.cxx                |    1 +
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    2 +-
 5 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 9e8957de203bb9abb208516ad32aee9527feb67b
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Jun 7 10:51:45 2012 +0200

    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

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index d8e7209..b9e4908 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 f2442e6..596bf82 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 aa39fcc..44fc631 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 68793c9..290a737 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 88a29d1..08e189b 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 ) );
         }


More information about the Libreoffice-commits mailing list