summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-28 21:26:09 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-07-08 04:40:43 +0000
commit521175906ba9516242968390b71d43edd447d480 (patch)
tree12e61c392a7f51d2e9ccbb8558234a7fc08fb920 /svx
parent3c05d82be43b643339fb9087937f88358d8ae832 (diff)
Resolves: tdf#100574 Crash when selecting and applying border style...
when a first torn off instance was opened just before the second one and then the second one sends focus back to the first when its popped down. The second one listens to losing the focus and disposes itself which leads to dereferencing deleted stuff. So add a reference count to the places these tear offs call popdown so its still gets disposed but not deleted during the popdown and then protect against members being disposed with a enough checks to get back to safely Change-Id: Id5f8eb4771df36305e308a2a9a5035018948f121 (cherry picked from commit 886637d355e77cd61d85279f145c06b07385fecd) Reviewed-on: https://gerrit.libreoffice.org/26751 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx23
1 files changed, 19 insertions, 4 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 49da834f9227..17a4f3ff0b8a 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1382,6 +1382,8 @@ void SvxColorWindow_Impl::KeyInput( const KeyEvent& rKEvt )
IMPL_LINK_TYPED(SvxColorWindow_Impl, SelectHdl, ValueSet*, pColorSet, void)
{
+ VclPtr<SvxColorWindow_Impl> xThis(this);
+
Color aColor = pColorSet->GetItemColor( pColorSet->GetSelectItemId() );
/* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() calls.
This instance may be deleted in the meantime (i.e. when a dialog is opened
@@ -1413,6 +1415,8 @@ IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, SelectPaletteHdl, ListBox&, void)
IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, AutoColorClickHdl, Button*, void)
{
+ VclPtr<SvxColorWindow_Impl> xThis(this);
+
Color aColor;
switch ( theSlotId )
{
@@ -1444,6 +1448,8 @@ IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, AutoColorClickHdl, Button*, void)
IMPL_LINK_NOARG_TYPED(SvxColorWindow_Impl, OpenPickerClickHdl, Button*, void)
{
+ VclPtr<SvxColorWindow_Impl> xThis(this);
+
if ( IsInPopupMode() )
EndPopupMode();
mrPaletteManager.PopupColorPicker(maCommand);
@@ -1691,6 +1697,8 @@ void SvxFrameWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
IMPL_LINK_NOARG_TYPED(SvxFrameWindow_Impl, SelectHdl, ValueSet*, void)
{
+ VclPtr<SvxFrameWindow_Impl> xThis(this);
+
SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
SvxBoxInfoItem aBorderInner( SID_ATTR_BORDER_INNER );
SvxBorderLine theDefLine;
@@ -1790,10 +1798,13 @@ IMPL_LINK_NOARG_TYPED(SvxFrameWindow_Impl, SelectHdl, ValueSet*, void)
aBorderInner.QueryValue( a );
aArgs[1].Value = a;
- /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call.
- This instance may be deleted in the meantime (i.e. when a dialog is opened
- while in Dispatch()), accessing members will crash in this case. */
- aFrameSet->SetNoSelection();
+ if (aFrameSet)
+ {
+ /* #i33380# Moved the following line above the Dispatch() call.
+ This instance may be deleted in the meantime (i.e. when a dialog is opened
+ while in Dispatch()), accessing members will crash in this case. */
+ aFrameSet->SetNoSelection();
+ }
SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ),
".uno:SetBorderStyle",
@@ -1984,6 +1995,8 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame
IMPL_LINK_NOARG_TYPED(SvxCurrencyList_Impl, SelectHdl, ListBox&, void)
{
+ VclPtr<SvxCurrencyList_Impl> xThis(this);
+
if ( IsInPopupMode() )
EndPopupMode();
@@ -1998,6 +2011,8 @@ IMPL_LINK_NOARG_TYPED(SvxCurrencyList_Impl, SelectHdl, ListBox&, void)
IMPL_LINK_NOARG_TYPED(SvxLineWindow_Impl, SelectHdl, ListBox&, void)
{
+ VclPtr<SvxLineWindow_Impl> xThis(this);
+
SvxLineItem aLineItem( SID_FRAME_LINESTYLE );
SvxBorderStyle nStyle = SvxBorderStyle( m_aLineStyleLb->GetSelectEntryStyle() );