[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 2 commits - oox/inc oox/source sw/source

2012-08-01 Thread Noel Power
 oox/inc/oox/ole/axcontrol.hxx |3 ++-
 oox/source/ole/axcontrol.cxx  |   13 +
 sw/source/filter/ww8/wrtw8esh.cxx |2 ++
 3 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 2909cf76a701b4860b849fc1aa90fc2046bfbe00
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Jul 31 12:33:41 2012 +0200

fdo#45724 improve WW8 textbox export

If there is no default value, but there is a current one, export that
instead.

Change-Id: I01af5cfa641b061b0aeb959e579bca66340781e9

diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index b8a8f59..1d124ce 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -1718,6 +1718,9 @@ void AxTextBoxModel::convertFromProperties( PropertySet 
rPropSet, const Control
 if ( rPropSet.getProperty( bRes,  PROP_HideInactiveSelection ) )
 setFlag( mnFlags, AX_FLAGS_HIDESELECTION, bRes );
 rPropSet.getProperty( maValue, ( mbAwtModel ? PROP_Text : PROP_DefaultText 
) );
+if (maValue.isEmpty()  !mbAwtModel)
+// No default value? Then try exporting the current one.
+rPropSet.getProperty( maValue, PROP_Text);
 sal_Int16 nTmp(0);
 if ( rPropSet.getProperty( nTmp, PROP_MaxTextLen ) )
 mnMaxLength = nTmp;
commit 88c0f4e9a28db4f2947c1c7469f54b76e88a3052
Author: Miklos Vajna vmik...@suse.cz
Date:   Tue Jul 31 11:18:31 2012 +0200

fdo#45724 fix WW8 export of textbox default background color

regression from 5609c512cd4d2899300b432d88d93cff05a05c87

Change-Id: I5f3ce73943b2805b7de1ae41699e605af9086b15

diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index b204b92..c2324aa 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -228,7 +228,8 @@ public:
 voidconvertToMSColor(
 PropertySet rPropSet,
 sal_Int32 nPropId,
-sal_uInt32 nOleColor ) const;
+sal_uInt32 nOleColor,
+sal_uInt32 nDefault = 0 ) const;
 
 
 /** Converts the passed StdPic picture stream to UNO properties. */
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index eb5a205..b8a8f59 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -282,11 +282,13 @@ void ControlConverter::convertColor( PropertyMap 
rPropMap, sal_Int32 nPropId, s
 rPropMap.setProperty( nPropId, OleHelper::decodeOleColor( mrGraphicHelper, 
nOleColor, mbDefaultColorBgr ) );
 }
 
-void ControlConverter::convertToMSColor( PropertySet rPropSet, sal_Int32 
nPropId, sal_uInt32 nOleColor ) const
+void ControlConverter::convertToMSColor( PropertySet rPropSet, sal_Int32 
nPropId, sal_uInt32 nOleColor, sal_uInt32 nDefault ) const
 {
 sal_uInt32 nRGB = 0;
-rPropSet.getProperty( nRGB, nPropId );
-nOleColor = OleHelper::encodeOleColor( nRGB );
+if (rPropSet.getProperty( nRGB, nPropId ))
+nOleColor = OleHelper::encodeOleColor( nRGB );
+else
+nOleColor = nDefault;
 }
 void ControlConverter::convertPicture( PropertyMap rPropMap, const 
StreamDataSequence rPicData ) const
 {
@@ -1726,7 +1728,7 @@ void AxTextBoxModel::convertFromProperties( PropertySet 
rPropSet, const Control
 if ( rPropSet.getProperty( bRes,  PROP_VScroll ) )
 setFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL, bRes );
 
-rConv.convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
+rConv.convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor, 
0x8005L );
 
 rConv.convertToAxBorder( rPropSet, mnBorderColor, mnBorderStyle, 
mnSpecialEffect );
 AxMorphDataModelBase::convertFromProperties( rPropSet, rConv );
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index b951b32..cfaf64b 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1662,6 +1662,8 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem 
rBrush,
 bool lcl_isInHeader(const SwFrmFmt rFmt)
 {
 const SwFlyFrmFmt* pFlyFrmFmt = dynamic_castconst SwFlyFrmFmt*(rFmt);
+if (!pFlyFrmFmt)
+return false;
 SwFlyFrm* pFlyFrm = const_castSwFlyFrm*(pFlyFrmFmt-GetFrm());
 SwPageFrm* pPageFrm = pFlyFrm-FindPageFrmOfAnchor();
 SwFrm* pHeader = pPageFrm-Lower();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 2 commits - oox/inc oox/source sw/source writerfilter/source

2012-06-08 Thread Miklos Vajna
 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_BoolmbAutoHeight;   /// If true, the height value 
is a minimum value (mostly used for textboxes)
 sal_BoolmbVisible;  /// 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
---