[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source
Alex Ivan
alexnivan at yahoo.com
Fri Jun 28 09:48:44 PDT 2013
sw/inc/swtblfmt.hxx | 1
sw/source/core/doc/swtblfmt.cxx | 58 ++++++++++++++++++++++------------------
2 files changed, 34 insertions(+), 25 deletions(-)
New commits:
commit 2ff314df35dbcc0ae0cfdd76cba53155db9b2764
Author: Alex Ivan <alexnivan at yahoo.com>
Date: Fri Jun 28 19:46:02 2013 +0300
Proper initilization of members in SwTable*Fmt
Modified initilization of members in SwTableFmt and SwTableLineFmt
in order to properly create formats for lines and, respectively, boxes.
Change-Id: I5e7e1a57b6745ac60a8167b3e0968202657fb4ef
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index e3f7e9f..cbbed13 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -22,6 +22,7 @@
#include "hintids.hxx"
#include <charatr.hxx>
#include <cmdid.h>
+#include <doc.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/wghtitem.hxx>
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index b5d387f..d7b5e1c 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -31,15 +31,17 @@ SwTableFmt::SwTableFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
SetRepeatHeading( 0 );
SetShadow( SvxShadowItem( RES_SHADOW ) );
- pFstLineFmt = NULL;
- pLstLineFmt = NULL;
- pOddLineFmt = NULL;
- pEvnLineFmt = NULL;
-
- pFstColFmt = NULL;
- pLstColFmt = NULL;
- pOddColFmt = NULL;
- pEvnColFmt = NULL;
+ SwDoc* pDoc = GetDoc();
+
+ pFstLineFmt = pDoc->MakeTableLineFmt();
+ pLstLineFmt = pDoc->MakeTableLineFmt();
+ pOddLineFmt = pDoc->MakeTableLineFmt();
+ pEvnLineFmt = pDoc->MakeTableLineFmt();
+
+ pFstColFmt = pDoc->MakeTableLineFmt();
+ pLstColFmt = pDoc->MakeTableLineFmt();
+ pOddColFmt = pDoc->MakeTableLineFmt();
+ pEvnColFmt = pDoc->MakeTableLineFmt();
}
SwTableFmt::SwTableFmt( SwAttrPool& rPool, const String &rFmtNm,
@@ -54,15 +56,17 @@ SwTableFmt::SwTableFmt( SwAttrPool& rPool, const String &rFmtNm,
SetRepeatHeading( 0 );
SetShadow( SvxShadowItem( RES_SHADOW ) );
- pFstLineFmt = NULL;
- pLstLineFmt = NULL;
- pOddLineFmt = NULL;
- pEvnLineFmt = NULL;
+ SwDoc* pDoc = GetDoc();
+
+ pFstLineFmt = pDoc->MakeTableLineFmt();
+ pLstLineFmt = pDoc->MakeTableLineFmt();
+ pOddLineFmt = pDoc->MakeTableLineFmt();
+ pEvnLineFmt = pDoc->MakeTableLineFmt();
- pFstColFmt = NULL;
- pLstColFmt = NULL;
- pOddColFmt = NULL;
- pEvnColFmt = NULL;
+ pFstColFmt = pDoc->MakeTableLineFmt();
+ pLstColFmt = pDoc->MakeTableLineFmt();
+ pOddColFmt = pDoc->MakeTableLineFmt();
+ pEvnColFmt = pDoc->MakeTableLineFmt();
}
SwTableFmt& SwTableFmt::operator=( const SwTableFmt& rNew )
@@ -152,20 +156,24 @@ SwTableLineFmt::SwTableLineFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
SwFrmFmt *pDrvdFrm )
: SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
{
- pFstBoxFmt = NULL;
- pLstBoxFmt = NULL;
- pOddBoxFmt = NULL;
- pEvnBoxFmt = NULL;
+ SwDoc* pDoc = GetDoc();
+
+ pFstBoxFmt = pDoc->MakeTableBoxFmt();
+ pLstBoxFmt = pDoc->MakeTableBoxFmt();
+ pOddBoxFmt = pDoc->MakeTableBoxFmt();
+ pEvnBoxFmt = pDoc->MakeTableBoxFmt();
}
SwTableLineFmt::SwTableLineFmt( SwAttrPool& rPool, const String &rFmtNm,
SwFrmFmt *pDrvdFrm )
: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
{
- pFstBoxFmt = NULL;
- pLstBoxFmt = NULL;
- pOddBoxFmt = NULL;
- pEvnBoxFmt = NULL;
+ SwDoc* pDoc = GetDoc();
+
+ pFstBoxFmt = pDoc->MakeTableBoxFmt();
+ pLstBoxFmt = pDoc->MakeTableBoxFmt();
+ pOddBoxFmt = pDoc->MakeTableBoxFmt();
+ pEvnBoxFmt = pDoc->MakeTableBoxFmt();
}
SwTableBoxFmt::SwTableBoxFmt( SwAttrPool& rPool, const sal_Char* pFmtNm,
More information about the Libreoffice-commits
mailing list