diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-09-23 12:10:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-09-23 17:16:20 +0200 |
commit | a00449bebdcfc491539867862da41133312fcd88 (patch) | |
tree | b0874646e05c5993d225392dbc62c56c434acb42 | |
parent | 08e7b7e5786e6daa2ccf3353050e7acac3415418 (diff) |
replace LogicToPixel uses in SfxTabPages
Change-Id: Ic2ea87bd5bcb8ccee58818b638e70a561fc8f95b
Reviewed-on: https://gerrit.libreoffice.org/79410
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/source/customize/acccfg.cxx | 12 | ||||
-rw-r--r-- | cui/source/options/dbregister.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddb.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddinf.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/flddok.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldfunc.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldpage.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldref.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldvar.cxx | 2 |
9 files changed, 18 insertions, 16 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 1c738d700e12..e1d8b198572e 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -839,13 +839,17 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage(TabPageParent pParent, const , m_xSaveButton(m_xBuilder->weld_button("save")) , m_xResetButton(m_xBuilder->weld_button("reset")) { - Size aSize(LogicToPixel(Size(174, 100), MapMode(MapUnit::MapAppFont))); + Size aSize(m_xEntriesBox->get_approximate_digit_width() * 40, + m_xEntriesBox->get_height_rows(12)); m_xEntriesBox->set_size_request(aSize.Width(), aSize.Height()); - aSize = LogicToPixel(Size(78 , 91), MapMode(MapUnit::MapAppFont)); + aSize = Size(m_xEntriesBox->get_approximate_digit_width() * 19, + m_xEntriesBox->get_height_rows(10)); m_xGroupLBox->set_size_request(aSize.Width(), aSize.Height()); - aSize = LogicToPixel(Size(88, 91), MapMode(MapUnit::MapAppFont)); + aSize = Size(m_xEntriesBox->get_approximate_digit_width() * 21, + m_xEntriesBox->get_height_rows(10)); m_xFunctionBox->set_size_request(aSize.Width(), aSize.Height()); - aSize = LogicToPixel(Size(80, 91), MapMode(MapUnit::MapAppFont)); + aSize = Size(m_xEntriesBox->get_approximate_digit_width() * 20, + m_xEntriesBox->get_height_rows(10)); m_xKeyBox->set_size_request(aSize.Width(), aSize.Height()); // install handler functions diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index 782541622bbd..d02b0b118bc2 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -32,8 +32,6 @@ #include "dbregisterednamesconfig.hxx" #include <svx/databaseregistrationui.hxx> -#define TAB_WIDTH1 80 - #define COL_TYPE 0 namespace svx @@ -92,12 +90,12 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage(TabPageParent pParent, cons , m_xPathBox(m_xBuilder->weld_tree_view("pathctrl")) , m_xIter(m_xPathBox->make_iterator()) { - Size aControlSize(248, 147); - aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); + Size aControlSize(m_xPathBox->get_approximate_digit_width() * 60, + m_xPathBox->get_height_rows(35)); m_xPathBox->set_size_request(aControlSize.Width(), aControlSize.Height()); std::vector<int> aWidths; - aWidths.push_back(LogicToPixel(Size(TAB_WIDTH1, 0), MapMode(MapUnit::MapAppFont)).Width()); + aWidths.push_back(m_xPathBox->get_approximate_digit_width() * 20); m_xPathBox->set_column_fixed_widths(aWidths); m_xNew->connect_clicked( LINK( this, DbRegistrationOptionsPage, NewHdl ) ); diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index b8a1cff07158..37fc878eddc8 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -55,7 +55,7 @@ SwFieldDBPage::SwFieldDBPage(TabPageParent pParent, const SfxItemSet *const pCor m_xTypeLB->make_sorted(); m_xFormatLB->make_sorted(); - auto nWidth = LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width(); + auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH; auto nHeight = m_xTypeLB->get_height_rows(14); m_xTypeLB->set_size_request(nWidth, nHeight); m_xDatabaseTLB->set_size_request(nWidth*2, nHeight); diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 1e4a70f9c5cb..bcdbbbfec664 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -65,7 +65,7 @@ SwFieldDokInfPage::SwFieldDokInfPage(TabPageParent pParent, const SfxItemSet *co m_xTypeTLB->make_sorted(); FillFieldSelect(*m_xSelectionLB); - auto nWidth = LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width(); + auto nWidth = m_xTypeTLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH; auto nHeight = m_xTypeTLB->get_height_rows(20); m_xTypeTLB->set_size_request(nWidth, nHeight); m_xFormatLB->get_widget().set_size_request(nWidth, nHeight); diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index 1744b6d19f67..6d6b9ff7e98c 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -55,7 +55,7 @@ SwFieldDokPage::SwFieldDokPage(TabPageParent pParent, const SfxItemSet *const pC m_xTypeLB->make_sorted(); m_xFormatLB->make_sorted(); - auto nWidth = LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width(); + auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH; auto nHeight = m_xTypeLB->get_height_rows(20); m_xTypeLB->set_size_request(nWidth, nHeight); diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 2517ba7e684a..01612125b427 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -73,7 +73,7 @@ SwFieldFuncPage::SwFieldFuncPage(TabPageParent pParent, const SfxItemSet *const m_xListItemsLB->set_size_request(m_xListItemED->get_preferred_size().Width(), m_xListItemsLB->get_height_rows(5)); - auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH / 8; + auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH; auto nHeight = m_xTypeLB->get_height_rows(20); m_xTypeLB->set_size_request(nWidth, nHeight); m_xFormatLB->set_size_request(nWidth, nHeight); diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx index 4cb0115f3d35..5fd94297244a 100644 --- a/sw/source/ui/fldui/fldpage.hxx +++ b/sw/source/ui/fldui/fldpage.hxx @@ -22,7 +22,7 @@ #include <sfx2/tabdlg.hxx> #include <fldmgr.hxx> -#define FIELD_COLUMN_WIDTH 76 +#define FIELD_COLUMN_WIDTH 19 const int coLBCount = 3; diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index ca2ed6d5cb1e..dc5d36977044 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -84,7 +84,7 @@ SwFieldRefPage::SwFieldRefPage(TabPageParent pParent, const SfxItemSet *const pC sNumItemText = m_xTypeLB->get_text(4); auto nHeight = m_xTypeLB->get_height_rows(8); - auto nWidth = LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width(); + auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH; m_xTypeLB->set_size_request(nWidth, nHeight); m_xFormatLB->set_size_request(nWidth, nHeight); m_xSelection->set_size_request(nWidth * 2, nHeight); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index c22517e3cf4d..e2431cff384c 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -65,7 +65,7 @@ SwFieldVarPage::SwFieldVarPage(TabPageParent pParent, const SfxItemSet *const pC m_xSelectionLB->make_sorted(); FillFieldSelect(*m_xFormatLB); - auto nWidth = LogicToPixel(Size(FIELD_COLUMN_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width(); + auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH; auto nHeight = m_xTypeLB->get_height_rows(20); m_xTypeLB->set_size_request(nWidth, nHeight); m_xSelectionLB->set_size_request(nWidth, nHeight); |