Kaydet (Commit) 76bdf523 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#73773: Check if the *document* is closing, not the *app*.

Otherwise it would crash if the app has multiple document instances open
and only one of them is being closed.

Change-Id: Ib6e370037ab6097c9c6eff8035249663944b3a6c
üst 5000e64e
......@@ -298,6 +298,11 @@ handle_r1c1:
}
}
void ScInputHandler::SetDocumentDisposing( bool b )
{
mbDocumentDisposing = b;
}
static void lcl_Replace( EditView* pView, const OUString& rNewStr, const ESelection& rOldSel )
{
if ( pView )
......@@ -518,6 +523,7 @@ ScInputHandler::ScInputHandler()
bProtected( false ),
bCellHasPercentFormat( false ),
bLastIsSymbol( false ),
mbDocumentDisposing(false),
nValidation( 0 ),
eAttrAdjust( SVX_HOR_JUSTIFY_STANDARD ),
aScaleX( 1,1 ),
......@@ -541,7 +547,7 @@ ScInputHandler::~ScInputHandler()
// Wenn dies der Applikations-InputHandler ist, wird der dtor erst nach SfxApplication::Main
// gerufen, darf sich also auf keine Sfx-Funktionen mehr verlassen
if ( !SFX_APP()->IsDowning() ) // inplace
if (!mbDocumentDisposing) // inplace
EnterHandler(); // Eingabe noch abschliessen
if (SC_MOD()->GetRefInputHdl()==this)
......
......@@ -100,6 +100,7 @@ private:
bool bProtected:1;
bool bCellHasPercentFormat:1;
bool bLastIsSymbol:1;
bool mbDocumentDisposing:1;
sal_uLong nValidation;
SvxCellHorJustify eAttrAdjust;
......@@ -256,6 +257,8 @@ public:
// actually private, public for SID_INPUT_SUM
void InitRangeFinder(const OUString& rFormula);
void SetDocumentDisposing( bool b );
static void SetAutoComplete(bool bSet) { bAutoComplete = bSet; }
};
......
......@@ -1790,6 +1790,9 @@ ScTabViewShell::~ScTabViewShell()
// alles auf NULL, falls aus dem TabView-dtor noch darauf zugegriffen wird
//! (soll eigentlich nicht !??!?!)
if (pInputHandler)
pInputHandler->SetDocumentDisposing(true);
DELETEZ(pFontworkBarShell);
DELETEZ(pExtrusionBarShell);
DELETEZ(pCellShell);
......
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