Kaydet (Commit) 0811de12 authored tarafından Michael Stahl's avatar Michael Stahl

i#95974: sw: avoid layout crash on ooo95974-1.odt

There's a SwTxtFrame inside a table, and OptCalc() is called on it which
calls pUpper->Calc(), which reformats rows the table and ends up calling
SwTxtFrm::_AdjustFollow() on some SwTxtFrame that has the first one as
follow.  Use the new ForbidDelete() hack to prevent immediate disaster.

Change-Id: I091704ce6cde15e322986b8f2ecefb5a518f0d8c
üst 63c5de04
...@@ -346,7 +346,9 @@ void SwFrm::OptPrepareMake() ...@@ -346,7 +346,9 @@ void SwFrm::OptPrepareMake()
if ( GetUpper() && !GetUpper()->IsFooterFrm() && if ( GetUpper() && !GetUpper()->IsFooterFrm() &&
!GetUpper()->IsFlyFrm() ) !GetUpper()->IsFlyFrm() )
{ {
ForbidDelete();
GetUpper()->Calc(); GetUpper()->Calc();
AllowDelete();
OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." ); OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." );
if ( !GetUpper() ) if ( !GetUpper() )
return; return;
...@@ -1045,6 +1047,7 @@ void SwCntntFrm::MakeAll() ...@@ -1045,6 +1047,7 @@ void SwCntntFrm::MakeAll()
return; return;
} }
bool const bDeleteForbidden(IsDeleteForbidden());
ForbidDelete(); ForbidDelete();
LockJoin(); LockJoin();
long nFormatCount = 0; long nFormatCount = 0;
...@@ -1675,7 +1678,8 @@ void SwCntntFrm::MakeAll() ...@@ -1675,7 +1678,8 @@ void SwCntntFrm::MakeAll()
delete pSaveFtn; delete pSaveFtn;
UnlockJoin(); UnlockJoin();
AllowDelete(); if (!bDeleteForbidden)
AllowDelete();
if ( bMovedFwd || bMovedBwd ) if ( bMovedFwd || bMovedBwd )
pNotify->SetInvaKeep(); pNotify->SetInvaKeep();
// OD 2004-02-26 #i25029# // OD 2004-02-26 #i25029#
......
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