[Libreoffice-commits] core.git: sw/inc sw/source

Jian Hong Cheng chengjh at apache.org
Tue Aug 13 08:33:04 PDT 2013


 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(-)

New commits:
commit 12a9b47ec2a892a9c5606a16396992fb6553d7eb
Author: Jian Hong Cheng <chengjh at apache.org>
Date:   Tue Sep 4 08:39:06 2012 +0000

    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,<chenpeng2006 at gmail.com>
    Found by: Yan Ji,<yanji.yj at gmail.com>
    Review by: Jian Hong Cheng,<chengjh at apache.org>
    (cherry picked from commit e8c93cc8f28debdcb271030f9466de806e863824)
    
    Conflicts:
    	sw/inc/fmtclds.hxx
    	sw/source/core/layout/atrfrm.cxx
    
    Change-Id: Ifbda61cc37933778e3fdad79fb6ee88f9b3cf916

diff --git a/sw/inc/fmtclds.hxx b/sw/inc/fmtclds.hxx
index e8c0b51..71f039a 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 cd72779..2528806 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 3af5046..5afe2d8 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<SvxLRSpaceItem>( *(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<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 f79155d..f1daac9 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


More information about the Libreoffice-commits mailing list