summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJian Hong Cheng <chengjh@apache.org>2012-09-04 08:39:06 +0000
committerJian Hong Cheng <chengjh@apache.org>2012-09-04 08:39:06 +0000
commite8c93cc8f28debdcb271030f9466de806e863824 (patch)
treec76dde6d76cda3083ea6eb90f3c1eee4ce3697f1 /sw
parent11fda1bd134b07c5bcaca6186d63107ec9f47b98 (diff)
Fix issue #i120133: Doc file saved by AOO, 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,<chenpeng2006@gmail.com> Found by: Yan Ji,<yanji.yj@gmail.com> Review by: Jian Hong Cheng,<chengjh@apache.org>
Notes
Notes: merged as: 12a9b47ec2a892a9c5606a16396992fb6553d7eb
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/fmtclds.hxx4
-rw-r--r--sw/source/core/layout/atrfrm.cxx11
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx12
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx3
4 files changed, 26 insertions, 4 deletions
diff --git a/sw/inc/fmtclds.hxx b/sw/inc/fmtclds.hxx
index 9cdeaeed8a8c..0f539bb07079 100644
--- a/sw/inc/fmtclds.hxx
+++ b/sw/inc/fmtclds.hxx
@@ -83,6 +83,7 @@ class SW_DLLPUBLIC SwFmtCol : public SfxPoolItem
SwColumns aColumns; //Informationen fuer die einzelnen Spalten.
sal_uInt16 nWidth; //Gesamtwunschbreite aller Spalten.
+ sal_Int16 aWidthAdjustValue;
sal_Bool bOrtho; //Nur wenn dieses Flag gesetzt ist wird beim setzen
//der GutterWidth eine 'optische Verteilung'
@@ -99,6 +100,9 @@ public:
SwFmtCol();
SwFmtCol( const SwFmtCol& );
~SwFmtCol();
+ //i120133
+ const 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 59de4f309deb..014787be54b4 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -823,7 +823,8 @@ SwFmtCol::SwFmtCol( const SwFmtCol& rCpy )
eAdj( rCpy.GetLineAdj() ),
aColumns( (sal_Int8)rCpy.GetNumCols(), 1 ),
nWidth( rCpy.GetWishWidth() ),
- bOrtho( rCpy.IsOrtho() )
+ bOrtho( rCpy.IsOrtho() ),
+ aWidthAdjustValue( rCpy.aWidthAdjustValue )
{
for ( sal_uInt16 i = 0; i < rCpy.GetNumCols(); ++i )
{
@@ -842,6 +843,7 @@ SwFmtCol& SwFmtCol::operator=( const SwFmtCol& rCpy )
eAdj = rCpy.GetLineAdj();
nWidth = rCpy.GetWishWidth();
bOrtho = rCpy.IsOrtho();
+ aWidthAdjustValue = rCpy.aWidthAdjustValue;
if ( aColumns.Count() )
aColumns.DeleteAndDestroy( 0, aColumns.Count() );
@@ -859,7 +861,8 @@ SwFmtCol::SwFmtCol()
nLineHeight( 100 ),
eAdj( COLADJ_NONE ),
nWidth( USHRT_MAX ),
- bOrtho( sal_True )
+ bOrtho( sal_True ),
+ aWidthAdjustValue( 0 )
{
}
@@ -873,7 +876,9 @@ int SwFmtCol::operator==( const SfxPoolItem& rAttr ) const
eAdj == rCmp.GetLineAdj() &&
nWidth == rCmp.GetWishWidth() &&
bOrtho == rCmp.IsOrtho() &&
- aColumns.Count() == rCmp.GetNumCols()) )
+ aColumns.Count() == rCmp.GetNumCols() &&
+ aWidthAdjustValue == rCmp.GetAdjustValue()
+ ) )
return 0;
for ( sal_uInt16 i = 0; i < aColumns.Count(); ++i )
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index e66798fa0c71..0b57e8b6420f 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1550,7 +1550,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<SvxLRSpaceItem>( *(rSepInfo.pSectionFmt), RES_LR_SPACE );
@@ -1560,6 +1559,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<const SwFmtCol&>(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 de8cfe2398ba..66ef5ba57a21 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4504,6 +4504,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