Kaydet (Commit) 162c72d6 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst 102b2597
...@@ -459,7 +459,6 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, ...@@ -459,7 +459,6 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
} }
SwTable& rNdTbl = pTblNd->GetTable(); SwTable& rNdTbl = pTblNd->GetTable();
rNdTbl.RegisterToFormat( *pTableFmt );
rNdTbl.SetRowsToRepeat( nRowsToRepeat ); rNdTbl.SetRowsToRepeat( nRowsToRepeat );
rNdTbl.SetTableModel( bNewModel ); rNdTbl.SetTableModel( bNewModel );
...@@ -744,7 +743,6 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, ...@@ -744,7 +743,6 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts,
// Set Orientation in the Table's Fmt // Set Orientation in the Table's Fmt
pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) ); pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
rNdTbl.RegisterToFormat(*pTableFmt);
if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) ) if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) )
{ {
...@@ -1107,6 +1105,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, ...@@ -1107,6 +1105,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
lcl_BalanceTable(rTable, nMaxBoxes, *pTblNd, *pBoxFmt, *pTxtColl, lcl_BalanceTable(rTable, nMaxBoxes, *pTblNd, *pBoxFmt, *pTxtColl,
pUndo, &aPosArr); pUndo, &aPosArr);
rTable.RegisterToFormat(*pTblFmt);
lcl_SetTableBoxWidths(rTable, nMaxBoxes, *pBoxFmt, *pDoc, &aPosArr); lcl_SetTableBoxWidths(rTable, nMaxBoxes, *pBoxFmt, *pDoc, &aPosArr);
return pTblNd; return pTblNd;
...@@ -1402,6 +1401,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, ...@@ -1402,6 +1401,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
nMaxBoxes = nBoxes; nMaxBoxes = nBoxes;
} }
rTable.RegisterToFormat(*pTblFmt);
lcl_SetTableBoxWidths2(rTable, nMaxBoxes, *pBoxFmt, *pDoc); lcl_SetTableBoxWidths2(rTable, nMaxBoxes, *pBoxFmt, *pDoc);
return pTblNd; return pTblNd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment