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 +
 sw/source/core/text/porlay.cxx                    |   11 ++++++++++-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    2 +-
 6 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit fa7171f6a98eec8651de0e9f9ea07e9620861242
Author: Miklos Vajna <vmik...@suse.cz>
Date:   Fri Jun 8 12:50:59 2012 +0200

    n#757905 SwLineLayout::CalcLine: improve line height calculation
    
    Word vs. Writer difference: if the only portion in a line is a fly
    (as-character shape) and the height of the fly is smaller than the
    height of the line, then Writer sets the height to the height of the
    fly. Word takes the max of the two values.
    
    We already have IgnoreTabsAndBlanksForLineCalculation for Word compat
    wrt. line height calculation, use that here as well.
    
    Change-Id: Iebe1bc697d6f19a03d15a1e5fd25ab4d5f4898fd
    (cherry picked from commits 563df5d0c3c696912f211e74dd4dbda1aa720ae7 and
    11a54814be785766d797cc83cfdacd2368ea642c)

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 7d8bdee..8589bec 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -351,6 +351,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, 
SwTxtFormatInfo &rInf )
         }
         else
         {
+            KSHORT nLineHeight = Height();
             Init( GetPortion() );
             SwLinePortion *pPos = pPortion;
             SwLinePortion *pLast = this;
@@ -458,7 +459,15 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, 
SwTxtFormatInfo &rInf )
                     else if( !pPos->IsFlyPortion() )
                     {
                         if( Height() < nPosHeight )
-                            Height( nPosHeight );
+                        {
+                            // Height is set to 0 when Init() is called.
+                            if (bIgnoreBlanksAndTabsForLineHeightCalculation 
&& pPos->GetWhichPor() == POR_FLYCNT)
+                                // Compat flag set: take the line height, if 
it's larger.
+                                Height(std::max(nPosHeight, nLineHeight));
+                            else
+                                // Just care about the portion height.
+                                Height(nPosHeight);
+                        }
                         if( pPos->IsFlyCntPortion() || ( pPos->IsMultiPortion()
                             && ((SwMultiPortion*)pPos)->HasFlyInCntnt() ) )
                             rLine.SetFlyInCntBase();
commit d6314796499be812004c35b28a65142bc06aa86e
Author: Miklos Vajna <vmik...@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
    (cherry picked from commit 9e8957de203bb9abb208516ad32aee9527feb67b)

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 ) );
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to