[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

Alex Ivan alexnivan at yahoo.com
Fri Jun 28 03:48:24 PDT 2013


 sw/inc/swtblfmt.hxx             |   30 +++++++++++++++++++++---------
 sw/source/core/doc/swtblfmt.cxx |   31 ++++++++++++++++++++++++-------
 2 files changed, 45 insertions(+), 16 deletions(-)

New commits:
commit d418934c49ca39638898503895762fca69ba64c1
Author: Alex Ivan <alexnivan at yahoo.com>
Date:   Fri Jun 28 13:44:54 2013 +0300

    Store RowSplit and RepeatHeading in item pool
    
    Removed m_aRepeatHeading and m_bRowSplit members from SwTableFmt.
    Now stored in SfxItemPool.
    
    Change-Id: I83f46ee38ce01db5dfae02e821d8e0a902a9cfc0

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index ef66a10..7783f7ba 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -19,11 +19,28 @@
 #ifndef _SWTBLFMT_HXX
 #define _SWTBLFMT_HXX
 
+#include <cmdid.h>
+#include <editeng/fontitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/udlnitem.hxx>
+#include <editeng/crossedoutitem.hxx>
+#include <editeng/contouritem.hxx>
+#include <editeng/shdditem.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/boxitem.hxx>
+#include <editeng/brushitem.hxx>
+#include <editeng/adjustitem.hxx>
+#include <editeng/justifyitem.hxx>
 #include <editeng/formatbreakitem.hxx>
 #include <editeng/keepitem.hxx>
+#include <editeng/lineitem.hxx>
+#include <editeng/frmdiritem.hxx>
 #include <editeng/shaditem.hxx>
 #include <fmtpdsc.hxx>
 #include <fmtlsplt.hxx>
+#include <fmtrowsplt.hxx>
 #include <frmatr.hxx>
 #include <frmfmt.hxx>
 
@@ -52,9 +69,6 @@ protected:
     SwTableLineFmt* pOddColFmt;
     SwTableLineFmt* pEvnColFmt;
 
-    sal_uInt16 m_aRepeatHeading;
-    sal_Bool m_bRowSplit;
-
 public:
     SwTableFmt& operator=( const SwTableFmt& rNew );
 
@@ -78,22 +92,20 @@ public:
     SwTableLineFmt* GetOddColFmt() { return pOddColFmt; }
     SwTableLineFmt* GetEvenColFmt() { return pEvnColFmt; }
 
-    void SetRepeatHeading( const sal_uInt16& rNew ) { m_aRepeatHeading = rNew; }
-    void SetRowSplit( const sal_Bool& rNew ) { m_bRowSplit = rNew; }
-
-    const sal_uInt16& GetRepeatHeading() const { return m_aRepeatHeading; }
-    const sal_Bool& GetRowSplit() const { return m_bRowSplit; }
-
     void SetBreak( const SvxFmtBreakItem& rNew );
     void SetPageDesc( const SwFmtPageDesc& rNew );
     void SetKeepWithNextPara( const SvxFmtKeepItem& rNew );
     void SetLayoutSplit( const sal_Bool& rNew );
     void SetCollapsingBorders( const sal_Bool& rNew );
+    void SetRowSplit( const sal_Bool& rNew );
+    void SetRepeatHeading( const sal_uInt16& rNew );
     void SetShadow( const SvxShadowItem& rNew );
 
     const SvxFmtKeepItem& GetKeepWithNextPara() const;
     sal_Bool GetLayoutSplit() const;
     sal_Bool GetCollapsingBorders() const;
+    sal_Bool GetRowSplit() const;
+    sal_uInt16 GetRepeatHeading() const;
 
     TYPEINFO();     // Already in base class Content.
 
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 3421db4..a14b961 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -22,13 +22,13 @@
 SwTableFmt::SwTableFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
                     SwFrmFmt *pDrvdFrm )
     : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-    , m_aRepeatHeading( 0 )
-    , m_bRowSplit( sal_True )
     {
         SetBreak( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
         SetKeepWithNextPara( SvxFmtKeepItem( sal_False, RES_KEEP ) );
         SetLayoutSplit( sal_True );
         SetCollapsingBorders( sal_True );
+        SetRowSplit( sal_True );
+        SetRepeatHeading( 0 );
         SetShadow( SvxShadowItem( RES_SHADOW ) );
 
         pFstLineFmt = NULL;
@@ -45,13 +45,13 @@ SwTableFmt::SwTableFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
 SwTableFmt::SwTableFmt( SwAttrPool& rPool, const String &rFmtNm,
                     SwFrmFmt *pDrvdFrm )
     : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-    , m_aRepeatHeading( 0 )
-    , m_bRowSplit( sal_True )
     {
         SetBreak( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
         SetKeepWithNextPara( SvxFmtKeepItem( sal_False, RES_KEEP ) );
         SetLayoutSplit( sal_True );
         SetCollapsingBorders( sal_True );
+        SetRowSplit( sal_True );
+        SetRepeatHeading( 0 );
         SetShadow( SvxShadowItem( RES_SHADOW ) );
 
         pFstLineFmt = NULL;
@@ -70,9 +70,6 @@ SwTableFmt& SwTableFmt::operator=( const SwTableFmt& rNew )
         if (&rNew == this)
             return *this;
 
-        m_aRepeatHeading = rNew.m_aRepeatHeading;
-        m_bRowSplit = rNew.m_bRowSplit;
-
         pFstLineFmt = rNew.pFstLineFmt;
         pLstLineFmt = rNew.pLstLineFmt;
         pOddLineFmt = rNew.pOddLineFmt;
@@ -111,6 +108,16 @@ void SwTableFmt::SetCollapsingBorders( const sal_Bool& rNew )
     SetFmtAttr( SfxBoolItem( RES_COLLAPSING_BORDERS, rNew ) );
 }
 
+void SwTableFmt::SetRowSplit( const sal_Bool& rNew )
+{
+    SetFmtAttr( SwFmtRowSplit( rNew ) );
+}
+
+void SwTableFmt::SetRepeatHeading( const sal_uInt16& rNew )
+{
+    SetFmtAttr( SfxUInt16Item( FN_PARAM_TABLE_HEADLINE, rNew ) );
+}
+
 void SwTableFmt::SetShadow( const SvxShadowItem& rNew )
 {
     SetFmtAttr( rNew );
@@ -131,6 +138,16 @@ sal_Bool SwTableFmt::GetCollapsingBorders() const
     return (static_cast<const SfxBoolItem&>( GetFmtAttr( RES_COLLAPSING_BORDERS ) )).GetValue();
 }
 
+sal_Bool SwTableFmt::GetRowSplit() const
+{
+    return SwFmt::GetRowSplit().GetValue();
+}
+
+sal_uInt16 SwTableFmt::GetRepeatHeading() const
+{
+    return (static_cast<const SfxUInt16Item&>( GetFmtAttr( FN_PARAM_TABLE_HEADLINE ) )).GetValue();
+}
+
 SwTableLineFmt::SwTableLineFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
                     SwFrmFmt *pDrvdFrm )
     : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )


More information about the Libreoffice-commits mailing list