[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
Caolán McNamara
caolanm at redhat.com
Mon Jul 21 07:31:56 PDT 2014
sc/source/ui/dbgui/validate.cxx | 27 ++++++++++++++++++++++-----
sc/source/ui/inc/validate.hxx | 2 ++
2 files changed, 24 insertions(+), 5 deletions(-)
New commits:
commit c5b71635e523e3675a72acc4960a1cac6e16e3fd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jul 21 13:14:19 2014 +0100
Resolves: rhbz#1121341 crash on closing shrunk validity window
Change-Id: I5fc1d6b909b3281ec3799b60bc3fd7b5f1163a75
Reviewed-on: https://gerrit.libreoffice.org/10439
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index f40981c..49e0bce 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -151,12 +151,14 @@ void ScTPValidationValue::RefInputDonePostHdl()
}
-
sal_Bool ScValidationDlg::Close()
{
- if( m_bOwnRefHdlr )
- if( SfxTabPage* pPage = GetTabPage( TP_VALIDATION_VALUES ) )
- static_cast<ScTPValidationValue*>(pPage)->RemoveRefDlg();
+ SfxTabPage* pPage = GetTabPage(TP_VALIDATION_VALUES);
+ if (pPage)
+ static_cast<ScTPValidationValue*>(pPage)->ParkRefs();
+
+ if (m_bOwnRefHdlr && pPage)
+ static_cast<ScTPValidationValue*>(pPage)->RemoveRefDlg();
return ScValidationDlgBase::Close();
}
@@ -168,7 +170,6 @@ ScValidationDlg::~ScValidationDlg()
delete mpHBox;
}
-
// ============================================================================
namespace {
@@ -338,6 +339,22 @@ ScTPValidationValue::ScTPValidationValue( Window* pParent, const SfxItemSet& rAr
m_btnRef.Hide(); // cell range picker
}
+void ScTPValidationValue::ParkRefs()
+{
+ //if there are children of the mpHBox, i.e.
+ //in shrunk mode, this will crash
+ //after the mpHBox is deleted
+ if( m_pRefEdit && m_pRefEdit->GetParent()!= this )
+ {
+ m_pRefEdit->SetParent( this );
+ }
+
+ if( m_btnRef.GetParent()!=this )
+ {
+ m_btnRef.SetParent( this );
+ }
+}
+
ScTPValidationValue::~ScTPValidationValue()
{
}
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 5cac401..12d1cec 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -182,6 +182,8 @@ public:
virtual sal_Bool FillItemSet( SfxItemSet& rArgSet );
virtual void Reset( const SfxItemSet& rArgSet );
+ void ParkRefs();
+
private:
void Init();
More information about the Libreoffice-commits
mailing list