summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ivan <alexnivan@yahoo.com>2013-07-23 17:00:46 +0300
committerAlex Ivan <alexnivan@yahoo.com>2013-07-23 17:00:46 +0300
commit338f4d74444f21180a997fdd045669fb0c09f2e3 (patch)
tree0fefc0007586128009349581f6d22d28eb51cb74
parent74fe564c6772707be3b978d12473ff69ae66843e (diff)
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
-rw-r--r--sw/source/core/docnode/ndtbl.cxx21
1 files changed, 7 insertions, 14 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index eaa15acd8b8d..cefcef2cb027 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 )
{