summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-01-31 20:11:28 +0100
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2011-01-31 20:11:28 +0100
commit7501edf4a53688cbaad55eaca307aa2603b84ad6 (patch)
tree4f5db504b9355b9ca78ccdb784c7a0b8c3aa03b6 /sc/source/ui
parent3240d4a82c4a3100a5c2c01efed33eb8cab83b8c (diff)
dr79: crash when using push buttons in pivot table layout dialog
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index e5ca0ab71c41..dc5c7adce8c8 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -616,17 +616,24 @@ IMPL_LINK( ScPivotLayoutDlg, ClickHdl, PushButton *, pBtn )
{
if( mpFocusWindow )
{
+ /* Raising sub dialogs (from the NotifyDoubleClick function) triggers
+ VCL child window focus events from this sub dialog which may
+ invalidate the member mpFocusWindow pointing to the target field
+ window. This would cause a crash with the following call to the
+ GrabFieldFocus function. */
+ ScPivotFieldWindow& rTargetWindow = *mpFocusWindow;
+
if( pBtn == &maBtnRemove )
{
mpFocusWindow->RemoveSelectedField();
// focus back to field window
- GrabFieldFocus( *mpFocusWindow );
+ GrabFieldFocus( rTargetWindow );
}
else if( pBtn == &maBtnOptions )
{
- NotifyDoubleClick( *mpFocusWindow );
+ NotifyDoubleClick( rTargetWindow );
// focus back to field window
- GrabFieldFocus( *mpFocusWindow );
+ GrabFieldFocus( rTargetWindow );
}
}
return 0;