sc/source/ui/dbgui/validate.cxx | 10 +--------- sc/source/ui/inc/anyrefdg.hxx | 1 + sc/source/ui/inc/validate.hxx | 1 - sc/source/ui/miscdlgs/anyrefdg.cxx | 10 ++++++++++ 4 files changed, 12 insertions(+), 10 deletions(-)
New commits: commit 709616cdb1ae8458249384b4c0718bbe5c0cf976 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Mar 8 15:00:56 2013 +0000 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 <fridr...@documentfoundation.org> Tested-by: Fridrich Strba <fridr...@documentfoundation.org> diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index ecce534..0647f14 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 2040767..6c4c356 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 726681e..9478357 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 fdffac4..5e2d9c6 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
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits