[PATCH libreoffice-4-0] Resolves: fdo#58630 refEdit button shrink mangles dialog

Caolán McNamara (via_Code_Review) gerrit at gerrit.libreoffice.org
Fri Mar 8 07:05:15 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2602

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/02/2602/1

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
---
M sc/source/ui/dbgui/validate.cxx
M sc/source/ui/inc/anyrefdg.hxx
M sc/source/ui/inc/validate.hxx
M sc/source/ui/miscdlgs/anyrefdg.cxx
4 files changed, 12 insertions(+), 10 deletions(-)



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::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 @@
     }
 
     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 @@
             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 @@
             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 @@
     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 @@
     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 @@
 
         // 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 @@
 
         // 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 @@
         }
 
         // Fenster verkleinern
+        if (aOldMinDialogSize.Height() && pSysWin)
+            pSysWin->SetMinOutputSizePixel(Size()); //unset min size
         m_pWindow->SetOutputSizePixel(aNewDlgSize);
 
         // Fenstertitel anpassen

-- 
To view, visit https://gerrit.libreoffice.org/2602
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e28674d13979e3ed399be1dba6830450078b114
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Caolán McNamara <caolanm at redhat.com>



More information about the LibreOffice mailing list