summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/dbgui/validate.cxx11
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx4
2 files changed, 10 insertions, 5 deletions
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index d04e361d9972..33f3ff737ff3 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -110,19 +110,20 @@ void ScTPValidationValue::RefInputStartPreHdl( formula::RefEdit* pEdi
if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
{
Window *pNewParent = pValidationDlg->get_refinput_shrink_parent();
- if( pEdit == m_pRefEdit )
+ if( pEdit == m_pRefEdit && m_pRefEdit->GetParent() != pNewParent )
{
maRefEditPos = m_pRefEdit->GetPosPixel();
maRefEditSize = m_pRefEdit->GetSizePixel();
m_pRefEdit->SetParent(pNewParent);
}
- if( pButton == &m_btnRef )
+ if( pButton == &m_btnRef && m_btnRef.GetParent() != pNewParent )
{
maBtnRefPos = m_btnRef.GetPosPixel();
maBtnRefSize = m_btnRef.GetSizePixel();
m_btnRef.SetParent(pNewParent);
}
+
pNewParent->Show();
}
}
@@ -135,10 +136,14 @@ void ScTPValidationValue::RefInputDonePostHdl()
m_pRefEdit->SetPosSizePixel( maRefEditPos, maRefEditSize );
m_btnRef.SetParent( m_pRefEdit ); //if Edit SetParent but button not, the tab order will be incorrect, need button to setparent to anthor window and restore parent later in order to restore the tab order
+ }
+
+ if( m_btnRef.GetParent()!=this )
+ {
+ m_btnRef.SetParent( this );
m_btnRef.SetPosSizePixel( maBtnRefPos, maBtnRefSize );
}
- if( m_btnRef.GetParent()!=this ) m_btnRef.SetParent( this );
if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
pValidationDlg->get_refinput_shrink_parent()->Hide();
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index e6d9aec151fd..4db0490d43e0 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -520,7 +520,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
pResizeDialog = pRefEdit->GetParentDialog();
Window *pContentArea = pResizeDialog->get_content_area();
for (Window *pCandidate = pRefEdit;
- pCandidate != pContentArea && pCandidate->IsVisible();
+ pCandidate && (pCandidate != pContentArea && pCandidate->IsVisible());
pCandidate = pCandidate->GetWindow(WINDOW_REALPARENT))
{
m_aVisibleWidgets.insert(pCandidate);
@@ -528,7 +528,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
//same again with pRefBtn, except stop if there's a
//shared parent in the existing widgets
for (Window *pCandidate = pRefBtn;
- pCandidate != pContentArea && pCandidate->IsVisible();
+ pCandidate && (pCandidate != pContentArea && pCandidate->IsVisible());
pCandidate = pCandidate->GetWindow(WINDOW_REALPARENT))
{
if (m_aVisibleWidgets.insert(pCandidate).second)