diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-05 11:36:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-05 11:40:08 +0100 |
commit | 21d6c1022aa528836d20ae1b8be9ea1b84bd61aa (patch) | |
tree | b0763a207009a675c0d5313ba6eca4bec42dcf54 /sc/source/ui | |
parent | ff8a2a5ef08623fdf534f805dfeedd673f64974e (diff) |
Related: fdo#61948 data->validity crashes calc
There are two scenarios with the cell range thing here,
data->validity->allow->cell range
scenario a), click the shrink icon, dialog shrinks, click the expand icon,
dialog expands again
scenario b), click inside the edit box, now you can select cells in
the spreadsheet, and the dialog autoshrinks, and autoexpands on mouse release
in scenario a there is an expand button in the shrunked dialog, in
scenario b the shrink/expand button is hidden
Change-Id: I8efe76536feeae10ac70fb7b7e95c70c69b057b5
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/dbgui/validate.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/anyrefdg.cxx | 4 |
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) |