diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-03-08 15:00:56 +0000 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-03-08 15:51:12 +0000 |
commit | 709616cdb1ae8458249384b4c0718bbe5c0cf976 (patch) | |
tree | 4d4afb12b724ca5d83c57229877efa8f30ebf058 | |
parent | 7e7a591c275bda74833fd794ccd66496aa03d6af (diff) |
Resolves: fdo#58630 refEdit button shrink mangles dialog
RefInputStartPreHdl changes widget parents, they
should be changed back in RefInputStartPreHdl not
RefInputDonePreHdl because the widget hiding code
in ScFormulaReferenceHelper::RefInputDone also
tweaks parentage
We also need to change the MinOutputSizePixel
if it was set on a dialog, otherwise we can't shrink
below that value
Change-Id: I9e28674d13979e3ed399be1dba6830450078b114
Reviewed-on: https://gerrit.libreoffice.org/2602
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r-- | sc/source/ui/dbgui/validate.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/inc/anyrefdg.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/validate.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/anyrefdg.cxx | 10 |
4 files changed, 12 insertions, 10 deletions
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index ecce534ebf79..0647f146357b 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -122,9 +122,8 @@ void ScTPValidationValue::RefInputStartPreHdl( formula::RefEdit* pEdi } } -void ScTPValidationValue::RefInputDonePreHdl() +void ScTPValidationValue::RefInputDonePostHdl() { - if( m_pRefEdit && m_pRefEdit->GetParent()!= this ) { if( Window *pPreWnd = m_pRefEdit==&maEdMax?&maFtMax:(m_pRefEdit==&maEdMin?&maFtMin:NULL) ) @@ -139,11 +138,6 @@ void ScTPValidationValue::RefInputDonePreHdl() } if( m_btnRef.GetParent()!=this ) m_btnRef.SetParent( this ); -} - -void ScTPValidationValue::RefInputDonePostHdl() -{ - if( m_pRefEdit && !m_pRefEdit->HasFocus() ) m_pRefEdit->GrabFocus(); @@ -488,7 +482,6 @@ void ScTPValidationValue::SetupRefDlg() pValidationDlg->SetSetRefHdl( (ScRefHandlerHelper::PFUNCSETREFHDLTYPE)( &ScTPValidationValue::SetReferenceHdl ) ); pValidationDlg->SetSetActHdl( (ScRefHandlerHelper::PCOMMONHDLTYPE)( &ScTPValidationValue::SetActiveHdl ) ); pValidationDlg->SetRefInputStartPreHdl( (ScRefHandlerHelper::PINPUTSTARTDLTYPE)( &ScTPValidationValue::RefInputStartPreHdl ) ); - pValidationDlg->SetRefInputDonePreHdl( (ScRefHandlerHelper::PCOMMONHDLTYPE)( &ScTPValidationValue::RefInputDonePreHdl ) ); pValidationDlg->SetRefInputDonePostHdl( (ScRefHandlerHelper::PCOMMONHDLTYPE)( &ScTPValidationValue::RefInputDonePostHdl ) ); if ( maEdMax.IsVisible() ) { m_pRefEdit = &maEdMax; } @@ -510,7 +503,6 @@ void ScTPValidationValue::RemoveRefDlg() pValidationDlg->SetSetRefHdl( NULL ); pValidationDlg->SetSetActHdl( NULL ); pValidationDlg->SetRefInputStartPreHdl( NULL ); - pValidationDlg->SetRefInputDonePreHdl( NULL ); pValidationDlg->SetRefInputDonePostHdl( NULL ); if( m_pRefEdit ) m_pRefEdit->SetRefDialog( NULL ); diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 204076739355..6c4c356b54a2 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -62,6 +62,7 @@ class ScFormulaReferenceHelper Size aOldEditSize; // Original size of the input field Point aOldButtonPos; // Original position of the button Window* mpOldEditParent; // Original parent of the edit field and the button + Size aOldMinDialogSize; // Original value of dialog MinSize bool bEnableColorRef; bool bHighLightRef; diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx index 726681e555b0..947835757e4d 100644 --- a/sc/source/ui/inc/validate.hxx +++ b/sc/source/ui/inc/validate.hxx @@ -225,7 +225,6 @@ private: void SetReferenceHdl( const ScRange& , ScDocument* ); void SetActiveHdl(); void RefInputStartPreHdl( formula::RefEdit* pEdit, formula::RefButton* pButton ); - void RefInputDonePreHdl(); void RefInputDonePostHdl(); ScValidationDlg * GetValidationDlg(); diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index fdffac4dffaf..5e2d9c66dd6d 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -365,6 +365,11 @@ void ScFormulaReferenceHelper::RefInputDone( bool bForced ) // Fenster wieder gross m_pWindow->SetOutputSizePixel(aOldDialogSize); + if (aOldMinDialogSize.Height()) + { + SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(m_pWindow); + pSysWin->SetMinOutputSizePixel(aOldMinDialogSize); + } // pEditCell an alte Position pRefEdit->SetPosSizePixel(aOldEditPos, aOldEditSize); @@ -408,6 +413,9 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: // Alte Daten merken aOldDialogSize = m_pWindow->GetOutputSizePixel(); + SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(m_pWindow); + if (pSysWin) + aOldMinDialogSize = pSysWin->GetMinOutputSizePixel(); aOldEditPos = pRefEdit->GetPosPixel(); aOldEditSize = pRefEdit->GetSizePixel(); if (pRefBtn) @@ -465,6 +473,8 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: } // Fenster verkleinern + if (aOldMinDialogSize.Height() && pSysWin) + pSysWin->SetMinOutputSizePixel(Size()); //unset min size m_pWindow->SetOutputSizePixel(aNewDlgSize); // Fenstertitel anpassen |