From 5d74305ab4c6b755232afcdc41ecd9fde431152d Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 27 Nov 2017 16:24:40 +0300 Subject: tdf#113455 follow-up: use spin button labels as checkboxes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/source/ui/pagedlg/tptable.cxx | 24 ++++++++------- sc/uiconfig/scalc/ui/sheetprintpage.ui | 53 ++++++++++++++-------------------- 2 files changed, 35 insertions(+), 42 deletions(-) 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 @@ 12 True - + True - False + True _Width in pages: True - spinED_SCALEPAGEWIDTH + False + True 0 + + + 0 @@ -443,13 +447,17 @@ - + True - False + True _Height in pages: True - spinED_SCALEPAGEHEIGHT + False + True 0 + + + 0 @@ -463,6 +471,9 @@ none adjustmentPage + + + 1 @@ -474,39 +485,17 @@ True True + none adjustmentPage + + + 1 1 - - - Unspecified - True - True - False - True - - - 2 - 0 - - - - - Unspecified - True - True - False - True - - - 2 - 1 - - False -- cgit v1.2.3