[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/source
Alex Ivan
alexnivan at yahoo.com
Tue Jul 23 07:09:28 PDT 2013
sw/source/core/docnode/ndtbl.cxx | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
New commits:
commit 338f4d74444f21180a997fdd045669fb0c09f2e3
Author: Alex Ivan <alexnivan at yahoo.com>
Date: Tue Jul 23 17:00:46 2013 +0300
Fix hard format/table style separation issue
Fixed the failed unit test brought by the previous
patch which attempted to correctly separate the hard
format from the table style in table insertion and
text to table methods.
Change-Id: I5eb7ddf074c8c8aaf2b2ec58aa7a94db8792a309
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index eaa15ac..cefcef2 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -329,8 +329,8 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
// Create the Box/Line/Table construct
SwTableLineFmt* pLineFmt = MakeTableLineFmt();
- SwTableFmt* pTableFmt = pTAFmt ? pTAFmt->GetTableStyle()
- : MakeTblFrmFmt( aTblName, GetDfltFrmFmt() );
+ SwTableFmt* pTableStyle = pTAFmt ? pTAFmt->GetTableStyle() : NULL;
+ SwTableFmt* pTableFmt = MakeTblFrmFmt( aTblName, pTableStyle );
/* If the node to insert the table at is a context node and has a
non-default FRAMEDIR propagate it to the table. */
@@ -350,10 +350,6 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
// All lines use the left-to-right Fill-Order!
pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
- pTableFmt->GetFirstLineFmt()->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
- pTableFmt->GetOddLineFmt()->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
- pTableFmt->GetEvenLineFmt()->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
- pTableFmt->GetLastLineFmt()->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
// Set USHRT_MAX as the Table's default SSize
SwTwips nWidth = USHRT_MAX;
@@ -404,7 +400,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
::lcl_SetDfltBorders( pTableFmt );
SwTable * pNdTbl = &pTblNd->GetTable();
- pNdTbl->GetTableFmt()->RegisterToFormat( *pTableFmt );
+ pNdTbl->RegisterToFormat( *pTableFmt );
pNdTbl->SetRowsToRepeat( nRowsToRepeat );
pNdTbl->SetTableModel( bNewModel );
@@ -603,15 +599,11 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
// Create the Box/Line/Table construct
SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt();
SwTableLineFmt* pLineFmt = MakeTableLineFmt();
- SwTableFmt* pTableFmt = pTAFmt ? pTAFmt->GetTableStyle()
- : MakeTblFrmFmt( GetUniqueTblName(), GetDfltFrmFmt() );
+ SwTableFmt* pTableStyle = pTAFmt ? pTAFmt->GetTableStyle() : NULL;
+ SwTableFmt* pTableFmt = MakeTblFrmFmt( GetUniqueTblName(), pTableStyle );
// All Lines have a left-to-right Fill Order
pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
- pTableFmt->GetFirstLineFmt()->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
- pTableFmt->GetOddLineFmt()->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
- pTableFmt->GetEvenLineFmt()->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
- pTableFmt->GetLastLineFmt()->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
// The Table's SSize is USHRT_MAX
pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX ));
if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) )
@@ -658,7 +650,8 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
// Set Orientation in the Table's Fmt
pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
- pNdTbl->GetTableFmt()->RegisterToFormat( *pTableFmt );
+
+ pNdTbl->RegisterToFormat( *pTableFmt );
if( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER )
{
More information about the Libreoffice-commits
mailing list