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

Mike Kaganski mike.kaganski at collabora.com
Mon Nov 27 21:11:40 UTC 2017


 sc/source/ui/pagedlg/tptable.cxx       |   24 ++++++++------
 sc/uiconfig/scalc/ui/sheetprintpage.ui |   53 +++++++++++++--------------------
 2 files changed, 35 insertions(+), 42 deletions(-)

New commits:
commit 5d74305ab4c6b755232afcdc41ecd9fde431152d
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Mon Nov 27 16:24:40 2017 +0300

    tdf#113455 follow-up: use spin button labels as checkboxes
    
    This streamlines the UI (avoids extra controls on page).
    Labels' ids kept intact to preserve localization context.
    
    Change-Id: Idbeb47d7f4e783107d49cb045125434291331140
    Reviewed-on: https://gerrit.libreoffice.org/45333
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index 6b9585d79c3f..a6c1954aaabe 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -111,9 +111,9 @@ ScTablePage::ScTablePage(vcl::Window* pParent, const SfxItemSet& rCoreAttrs)
     get(m_pEdScaleAll,"spinED_SCALEALL");
     get(m_pGrHeightWidth,"gridWH");
     get(m_pEdScalePageWidth,"spinED_SCALEPAGEWIDTH");
-    get(m_pCbScalePageWidth,"unsetwidth");
+    get(m_pCbScalePageWidth,"labelWP");
     get(m_pEdScalePageHeight,"spinED_SCALEPAGEHEIGHT");
-    get(m_pCbScalePageHeight,"unsetheight");
+    get(m_pCbScalePageHeight,"labelHP");
     get(m_pBxScalePageNum,"boxNP");
     get(m_pEdScalePageNum,"spinED_SCALEPAGENUM");
 
@@ -216,13 +216,17 @@ void ScTablePage::Reset( const SfxItemSet* rCoreSet )
 
         /*  width==0 and height==0 is invalid state, used as "not selected".
             Dialog shows width=height=1 then. */
-        bool bValid = nWidth || nHeight;
-        if (bValid)
+        if (nWidth || nHeight)
             m_pLbScaleMode->SelectEntryPos( SC_TPTABLE_SCALE_TO );
-        m_pEdScalePageWidth->SetValue( bValid ? nWidth : 1 );
-        m_pEdScalePageHeight->SetValue( bValid ? nHeight : 1 );
-        m_pCbScalePageWidth->Check(bValid && !nWidth);
-        m_pCbScalePageHeight->Check(bValid && !nHeight);
+        else
+            nWidth = nHeight = 1;
+
+        m_pEdScalePageWidth->SetValue(nWidth);
+        m_pEdScalePageWidth->Enable(nWidth);
+        m_pEdScalePageHeight->SetValue(nHeight);
+        m_pEdScalePageHeight->Enable(nHeight);
+        m_pCbScalePageWidth->Check(nWidth);
+        m_pCbScalePageHeight->Check(nHeight);
     }
 
     nWhich = GetWhich(SID_SCATTR_PAGE_SCALETOPAGES);
@@ -408,7 +412,7 @@ IMPL_LINK(ScTablePage, ToggleHdl, CheckBox&, rBox, void)
 {
     if (&rBox == m_pCbScalePageWidth)
     {
-        if (rBox.IsChecked())
+        if (!rBox.IsChecked())
         {
             m_pEdScalePageWidth->SetText(OUString());
             m_pEdScalePageWidth->Disable();
@@ -421,7 +425,7 @@ IMPL_LINK(ScTablePage, ToggleHdl, CheckBox&, rBox, void)
     }
     else
     {
-        if (rBox.IsChecked())
+        if (!rBox.IsChecked())
         {
             m_pEdScalePageHeight->SetText(OUString());
             m_pEdScalePageHeight->Disable();
diff --git a/sc/uiconfig/scalc/ui/sheetprintpage.ui b/sc/uiconfig/scalc/ui/sheetprintpage.ui
index 4daeadf15309..adaf37bb818a 100644
--- a/sc/uiconfig/scalc/ui/sheetprintpage.ui
+++ b/sc/uiconfig/scalc/ui/sheetprintpage.ui
@@ -429,13 +429,17 @@
                         <property name="column_spacing">12</property>
                         <property name="row_homogeneous">True</property>
                         <child>
-                          <object class="GtkLabel" id="labelWP">
+                          <object class="GtkCheckButton" id="labelWP">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
+                            <property name="can_focus">True</property>
                             <property name="label" translatable="yes" context="sheetprintpage|labelWP">_Width in pages:</property>
                             <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">spinED_SCALEPAGEWIDTH</property>
+                            <property name="receives_default">False</property>
+                            <property name="draw_indicator">True</property>
                             <property name="xalign">0</property>
+                            <accessibility>
+                              <relation type="label-for" target="spinED_SCALEPAGEWIDTH"/>
+                            </accessibility>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
@@ -443,13 +447,17 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkLabel" id="labelHP">
+                          <object class="GtkCheckButton" id="labelHP">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
+                            <property name="can_focus">True</property>
                             <property name="label" translatable="yes" context="sheetprintpage|labelHP">_Height in pages:</property>
                             <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">spinED_SCALEPAGEHEIGHT</property>
+                            <property name="receives_default">False</property>
+                            <property name="draw_indicator">True</property>
                             <property name="xalign">0</property>
+                            <accessibility>
+                              <relation type="label-for" target="spinED_SCALEPAGEHEIGHT"/>
+                            </accessibility>
                           </object>
                           <packing>
                             <property name="left_attach">0</property>
@@ -463,6 +471,9 @@
                             <property name="invisible_char">•</property>
                             <property name="shadow_type">none</property>
                             <property name="adjustment">adjustmentPage</property>
+                            <accessibility>
+                              <relation type="labelled-by" target="labelWP"/>
+                            </accessibility>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -474,39 +485,17 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="invisible_char">•</property>
+                            <property name="shadow_type">none</property>
                             <property name="adjustment">adjustmentPage</property>
+                            <accessibility>
+                              <relation type="labelled-by" target="labelHP"/>
+                            </accessibility>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
                             <property name="top_attach">1</property>
                           </packing>
                         </child>
-                        <child>
-                          <object class="GtkCheckButton" id="unsetwidth">
-                            <property name="label" translatable="yes" context="sheetprintpage|unsetwidth">Unspecified</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">2</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkCheckButton" id="unsetheight">
-                            <property name="label" translatable="yes" context="sheetprintpage|unsetheight">Unspecified</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">2</property>
-                            <property name="top_attach">1</property>
-                          </packing>
-                        </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>


More information about the Libreoffice-commits mailing list