summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-12-19 13:41:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-12-19 22:08:44 +0100
commit0a2b871ccdc5a76f793982bae45cb251c71e4b94 (patch)
treec15d296cc39974394a56f2ccfb4e6a904fe2a1a4 /svx/source
parentcbca3beb990df9e75218e27ff0f1b563cf3a67da (diff)
weld PageFooterPanel
Change-Id: Ice9e7c5ab9c1085021ebb3561cfb2bd0a6727066 Reviewed-on: https://gerrit.libreoffice.org/85526 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/samecontentlistbox.cxx13
-rw-r--r--svx/source/dialog/spacinglistbox.cxx46
2 files changed, 59 insertions, 0 deletions
diff --git a/svx/source/dialog/samecontentlistbox.cxx b/svx/source/dialog/samecontentlistbox.cxx
index 29e72df42e73..e1bd38c05669 100644
--- a/svx/source/dialog/samecontentlistbox.cxx
+++ b/svx/source/dialog/samecontentlistbox.cxx
@@ -36,6 +36,19 @@ SameContentListBox::SameContentListBox(vcl::Window* pParent)
SelectEntryPos(0);
}
+void SameContentListBox::Fill(weld::ComboBox& rComboBox)
+{
+ rComboBox.clear();
+ for (size_t i = 0; i < SAL_N_ELEMENTS(RID_SVXSTRARY_SAMECONTENT); ++i)
+ {
+ OUString aStr = SvxResId(RID_SVXSTRARY_SAMECONTENT[i].first);
+ sal_uInt32 nData = RID_SVXSTRARY_SAMECONTENT[i].second;
+ rComboBox.append(OUString::number(nData), aStr);
+ }
+ rComboBox.set_active(0);
+ rComboBox.set_size_request(150, -1);
+}
+
VCL_BUILDER_FACTORY(SameContentListBox);
Size SameContentListBox::GetOptimalSize() const
diff --git a/svx/source/dialog/spacinglistbox.cxx b/svx/source/dialog/spacinglistbox.cxx
index 90654618f994..ac31393b3a2f 100644
--- a/svx/source/dialog/spacinglistbox.cxx
+++ b/svx/source/dialog/spacinglistbox.cxx
@@ -78,6 +78,52 @@ void SpacingListBox::Init(SpacingType eType)
SelectEntryPos(nSelected);
}
+void SpacingListBox::Fill(SpacingType eType, weld::ComboBox& rComboBox)
+{
+ auto nSelected = rComboBox.get_active();
+ if (nSelected == -1)
+ nSelected = 0;
+ rComboBox.clear();
+
+ const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetLocaleDataWrapper();
+ OUString sSuffix;
+
+ const measurement* pResources;
+ switch (eType)
+ {
+ case SpacingType::SPACING_INCH:
+ pResources = RID_SVXSTRARY_SPACING_INCH;
+ sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
+ break;
+ case SpacingType::MARGINS_INCH:
+ pResources = RID_SVXSTRARY_MARGINS_INCH;
+ sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::INCH);
+ break;
+ case SpacingType::SPACING_CM:
+ pResources = RID_SVXSTRARY_SPACING_CM;
+ sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
+ break;
+ default:
+ case SpacingType::MARGINS_CM:
+ sSuffix = " " + weld::MetricSpinButton::MetricToString(FieldUnit::CM);
+ pResources = RID_SVXSTRARY_MARGINS_CM;
+ break;
+ }
+
+ while (pResources->key)
+ {
+ OUString sMeasurement = rLocaleData.getNum(pResources->human, 2, true, false) + sSuffix;
+ OUString aStr = SvxResId(pResources->key).replaceFirst("%1", sMeasurement);
+ sal_uInt32 nData = pResources->twips;
+ rComboBox.append(OUString::number(nData), aStr);
+ ++pResources;
+ }
+
+ rComboBox.set_active(nSelected);
+
+ rComboBox.set_size_request(150, -1);
+}
+
VCL_BUILDER_FACTORY(SpacingListBox);
Size SpacingListBox::GetOptimalSize() const