[Libreoffice-commits] core.git: sc/source sc/uiconfig

Caolán McNamara caolanm at redhat.com
Fri May 31 06:40:06 PDT 2013


 sc/source/ui/inc/tpdefaults.hxx        |    2 --
 sc/source/ui/optdlg/tpdefaults.cxx     |   20 --------------------
 sc/uiconfig/scalc/ui/optdefaultpage.ui |   10 +++++++++-
 3 files changed, 9 insertions(+), 23 deletions(-)

New commits:
commit a7feb6f570f75c63c3fd0be4d0e9808a6b52292f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 31 14:19:39 2013 +0100

    post .ui conversion old mad manual placement code can go
    
    with pleasing knock on effects of then unused class
    members
    
    also add an adjustment to keep the original 1-1024
    range for number of worksheets
    
    Change-Id: I9cfdff60a763b81cb0632ea5d4ccf382334da24c

diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx
index 850ecda..dce6fc1 100644
--- a/sc/source/ui/inc/tpdefaults.hxx
+++ b/sc/source/ui/inc/tpdefaults.hxx
@@ -38,9 +38,7 @@ private:
     DECL_LINK( PrefixEditOnFocusHdl, Edit* );
 
 private:
-    FixedText*    m_pFtNSheets;
     NumericField* m_pEdNSheets;
-    FixedText*    m_pFtSheetPrefix;
     Edit*         m_pEdSheetPrefix;
 
     // Stores old Sheet Prefix
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index 06a75cd..1d91d5c 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -22,29 +22,9 @@ ScTpDefaultsOptions::ScTpDefaultsOptions(Window *pParent, const SfxItemSet &rCor
     SfxTabPage(pParent, "OptDefaultPage", "modules/scalc/ui/optdefaultpage.ui", rCoreSet)
 
 {
-    get( m_pFtNSheets, "textsheetsnumber");
     get( m_pEdNSheets, "sheetsnumber");
-    get( m_pFtSheetPrefix, "textsheetprefix");
     get( m_pEdSheetPrefix, "sheetprefix");
 
-    // the following computation must be modified accordingly if a third line is added to this dialog
-    long nTxtW1  = m_pFtNSheets->GetCtrlTextWidth( m_pFtNSheets->GetText() );
-    long nCtrlW1 = m_pFtNSheets->GetSizePixel().Width();
-    long nTxtW2  = m_pFtSheetPrefix->GetCtrlTextWidth(m_pFtSheetPrefix->GetText() );
-    long nCtrlW2 = m_pFtSheetPrefix->GetSizePixel().Width();
-    if ( nTxtW1 >= nCtrlW1 || nTxtW2 >= nCtrlW2)
-    {
-        long nTxtW = std::max(nTxtW1,nTxtW2);
-        Size aNewSize = m_pFtNSheets->GetSizePixel();
-        aNewSize.Width() = nTxtW;
-        m_pFtNSheets->SetSizePixel( aNewSize );
-        m_pFtSheetPrefix->SetSizePixel( aNewSize );
-        Point aNewPoint = m_pEdNSheets->GetPosPixel();
-        aNewPoint.X() += (nTxtW - nCtrlW1);
-        m_pEdNSheets->SetPosPixel( aNewPoint );
-        aNewPoint.Y() = m_pEdSheetPrefix->GetPosPixel().Y();
-        m_pEdSheetPrefix->SetPosPixel( aNewPoint );
-    }
     m_pEdNSheets->SetModifyHdl( LINK(this, ScTpDefaultsOptions, NumModifiedHdl) );
     m_pEdSheetPrefix->SetModifyHdl( LINK(this, ScTpDefaultsOptions, PrefixModifiedHdl) );
     m_pEdSheetPrefix->SetGetFocusHdl( LINK(this, ScTpDefaultsOptions, PrefixEditOnFocusHdl) );
diff --git a/sc/uiconfig/scalc/ui/optdefaultpage.ui b/sc/uiconfig/scalc/ui/optdefaultpage.ui
index ac0b8ad..3441605 100644
--- a/sc/uiconfig/scalc/ui/optdefaultpage.ui
+++ b/sc/uiconfig/scalc/ui/optdefaultpage.ui
@@ -1,12 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="lower">1</property>
+    <property name="upper">32000</property>
+    <property name="value">1</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <object class="GtkBox" id="OptDefaultPage">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="border_width">6</property>
     <property name="orientation">vertical</property>
-    <property name="spacing">12</property>
     <child>
       <object class="GtkFrame" id="frame1">
         <property name="visible">True</property>
@@ -74,8 +80,10 @@
                   <object class="GtkSpinButton" id="sheetsnumber">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
+                    <property name="halign">start</property>
                     <property name="invisible_char">●</property>
                     <property name="invisible_char_set">True</property>
+                    <property name="adjustment">adjustment1</property>
                     <property name="climb_rate">1</property>
                     <property name="update_policy">if-valid</property>
                   </object>


More information about the Libreoffice-commits mailing list