summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-23 13:17:39 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-23 13:55:06 +0000
commit162c72d64077d9e0dae820d881ce2b56a5b2040c (patch)
treeac7f79590ae6aa346f5911c35e50c8a5c105bb76
parent102b259754060005a11a82b4fcb2c65e7b0617ce (diff)
Related: fdo#78599 ensure RegisterFormat is called before SetModified
TextToTable is called which calls lcl_SetTableBoxWidths2 which calls SwDoc::MakeTableBoxFmt which calls SetModified. there happens to be a listener on modified which tries to get an updated preview for embedded objects which draws the page to a metafile, but this SwTableNode in SwTableNode::MakeFrm doesn't have a FrmFmt set on it yet, so falls over and dies. Move the RegisterFormat into SwNodes::TextToTable before the tablebox widths are set to avoid this Change-Id: I3e5141c9901ff0f473e2eaab3e5cd9be61f810bd
-rw-r--r--sw/source/core/docnode/ndtbl.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 1c1c30bab681..9636edff6933 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -459,7 +459,6 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
}
SwTable& rNdTbl = pTblNd->GetTable();
- rNdTbl.RegisterToFormat( *pTableFmt );
rNdTbl.SetRowsToRepeat( nRowsToRepeat );
rNdTbl.SetTableModel( bNewModel );
@@ -744,7 +743,6 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
// Set Orientation in the Table's Fmt
pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
- rNdTbl.RegisterToFormat(*pTableFmt);
if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) )
{
@@ -1107,6 +1105,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
lcl_BalanceTable(rTable, nMaxBoxes, *pTblNd, *pBoxFmt, *pTxtColl,
pUndo, &aPosArr);
+ rTable.RegisterToFormat(*pTblFmt);
lcl_SetTableBoxWidths(rTable, nMaxBoxes, *pBoxFmt, *pDoc, &aPosArr);
return pTblNd;
@@ -1402,6 +1401,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
nMaxBoxes = nBoxes;
}
+ rTable.RegisterToFormat(*pTblFmt);
lcl_SetTableBoxWidths2(rTable, nMaxBoxes, *pBoxFmt, *pDoc);
return pTblNd;