From 12a9b47ec2a892a9c5606a16396992fb6553d7eb Mon Sep 17 00:00:00 2001 From: Jian Hong Cheng Date: Tue, 4 Sep 2012 08:39:06 +0000 Subject: Resolves: #i120133# Doc file saved by Office, section size changed * sw/inc/fmtclds.hxx * sw/source/core/layout/atrfrm.cxx * sw/source/filter/ww8/wrtw8sty.cxx * sw/source/filter/ww8/ww8atr.cxx MS Word Binary compatibility Patch by: Chen Peng, Found by: Yan Ji, Review by: Jian Hong Cheng, (cherry picked from commit e8c93cc8f28debdcb271030f9466de806e863824) Conflicts: sw/inc/fmtclds.hxx sw/source/core/layout/atrfrm.cxx Change-Id: Ifbda61cc37933778e3fdad79fb6ee88f9b3cf916 --- sw/inc/fmtclds.hxx | 6 +++++- sw/source/core/layout/atrfrm.cxx | 7 ++++++- sw/source/filter/ww8/wrtw8sty.cxx | 12 +++++++++++- sw/source/filter/ww8/ww8atr.cxx | 3 +++ 4 files changed, 25 insertions(+), 3 deletions(-) (limited to 'sw') diff --git a/sw/inc/fmtclds.hxx b/sw/inc/fmtclds.hxx index e8c0b512da88..71f039ac059d 100644 --- a/sw/inc/fmtclds.hxx +++ b/sw/inc/fmtclds.hxx @@ -79,7 +79,8 @@ class SW_DLLPUBLIC SwFmtCol : public SfxPoolItem SwColLineAdj eAdj; ///< Line will be adjusted top, centered or bottom. SwColumns aColumns; ///< Information concerning the columns. - sal_uInt16 nWidth; ///< Total desired width of all columns. + sal_uInt16 nWidth; ///< Total desired width of all columns. + sal_Int16 aWidthAdjustValue; sal_Bool bOrtho; /**< Only if this flag is set, the setting of GutterWidth will be accompanied by a "visual rearrangement". @@ -93,6 +94,9 @@ public: SwFmtCol(); SwFmtCol( const SwFmtCol& ); ~SwFmtCol(); + //#i120133# + sal_Int16 GetAdjustValue() const { return aWidthAdjustValue; } + void SetAdjustValue( const sal_Int16& n ) { aWidthAdjustValue = n; } SwFmtCol& operator=( const SwFmtCol& ); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index cd72779070d9..25288062d823 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -751,6 +751,7 @@ SwFmtCol::SwFmtCol( const SwFmtCol& rCpy ) eAdj( rCpy.GetLineAdj() ), aColumns( (sal_Int8)rCpy.GetNumCols() ), nWidth( rCpy.GetWishWidth() ), + aWidthAdjustValue( rCpy.aWidthAdjustValue ), bOrtho( rCpy.IsOrtho() ) { for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i ) @@ -770,6 +771,7 @@ SwFmtCol& SwFmtCol::operator=( const SwFmtCol& rCpy ) nLineHeight = rCpy.GetLineHeight(); eAdj = rCpy.GetLineAdj(); nWidth = rCpy.GetWishWidth(); + aWidthAdjustValue = rCpy.aWidthAdjustValue; bOrtho = rCpy.IsOrtho(); if ( !aColumns.empty() ) @@ -790,6 +792,7 @@ SwFmtCol::SwFmtCol() nLineHeight( 100 ), eAdj( COLADJ_NONE ), nWidth( USHRT_MAX ), + aWidthAdjustValue( 0 ), bOrtho( sal_True ) { } @@ -805,7 +808,9 @@ int SwFmtCol::operator==( const SfxPoolItem& rAttr ) const eAdj == rCmp.GetLineAdj() && nWidth == rCmp.GetWishWidth() && bOrtho == rCmp.IsOrtho() && - aColumns.size() == rCmp.GetNumCols()) ) + aColumns.size() == rCmp.GetNumCols() && + aWidthAdjustValue == rCmp.GetAdjustValue() + ) ) return 0; for ( sal_uInt16 i = 0; i < aColumns.size(); ++i ) diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 3af5046e02af..5afe2d88bd9f 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1581,7 +1581,6 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt // am Nachkommen NUR die Spaltigkeit gemaess Sect-Attr. // umsetzen - aSet.Put( rSepInfo.pSectionFmt->GetFmtAttr( RES_COL ) ); const SvxLRSpaceItem &rSectionLR = ItemGet( *(rSepInfo.pSectionFmt), RES_LR_SPACE ); @@ -1591,6 +1590,17 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt SvxLRSpaceItem aResultLR( rPageLR.GetLeft() + rSectionLR.GetLeft(), rPageLR.GetRight() + rSectionLR.GetRight(), 0, 0, RES_LR_SPACE ); + //i120133: The Section width should consider section indent value. + if (rSectionLR.GetLeft()+rSectionLR.GetRight()!=0) + { + const SwFmtCol& rCol = dynamic_cast(rSepInfo.pSectionFmt->GetFmtAttr(RES_COL)); + SwFmtCol aCol(rCol); + aCol.SetAdjustValue(rSectionLR.GetLeft()+rSectionLR.GetRight()); + aSet.Put(aCol); + } + else + aSet.Put(rSepInfo.pSectionFmt->GetFmtAttr(RES_COL)); + aSet.Put( aResultLR ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index f79155dbad88..f1daac939d32 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4450,6 +4450,9 @@ void AttributeOutputBase::FormatColumns( const SwFmtCol& rCol ) const SvxLRSpaceItem &rLR = pFmt->GetLRSpace(); nPageSize = pFmt->GetFrmSize().GetWidth(); nPageSize -= rLR.GetLeft() + rLR.GetRight(); + //i120133: The Section width should consider page indent value. + nPageSize -= rCol.GetAdjustValue(); + } // Nachsehen, ob alle Spalten gleich sind -- cgit