diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-31 15:14:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-01 14:37:43 +0100 |
commit | 6d9a2557a0f0366fff169f3c3581414b3cec80bd (patch) | |
tree | 6a1ead1edccb8857b888b235684d8781ca4f8194 /svx/source/dialog | |
parent | beaba5f1abbb9a1461286fc831ea6a30131bb3b5 (diff) |
Resolves: tdf#105081 and tdf#113420
separate translations for Spacing: vs Margins:
separate translations for Inch vs cm
Change-Id: I9a2d8fe3ad0edde5afefe00258f1309f898130e8
Reviewed-on: https://gerrit.libreoffice.org/62699
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/dialog')
-rw-r--r-- | svx/source/dialog/spacinglistbox.cxx | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/svx/source/dialog/spacinglistbox.cxx b/svx/source/dialog/spacinglistbox.cxx index db238a415178..e0a508e9830a 100644 --- a/svx/source/dialog/spacinglistbox.cxx +++ b/svx/source/dialog/spacinglistbox.cxx @@ -25,13 +25,37 @@ SpacingListBox::SpacingListBox(vcl::Window* pParent) : ListBox( pParent, WB_BORDER | WB_DROPDOWN) { - for (size_t i = 0; i < SAL_N_ELEMENTS(RID_SVXSTRARY_SPACING); ++i) +} + +void SpacingListBox::Init(SpacingType eType) +{ + const std::pair<const char*, int>* pResources; + switch (eType) { - OUString aStr = SvxResId(RID_SVXSTRARY_SPACING[i].first); - sal_uInt16 nData = RID_SVXSTRARY_SPACING[i].second; + case SpacingType::SPACING_INCH: + pResources = RID_SVXSTRARY_SPACING_INCH; + break; + case SpacingType::MARGINS_INCH: + pResources = RID_SVXSTRARY_MARGINS_INCH; + break; + case SpacingType::SPACING_CM: + pResources = RID_SVXSTRARY_SPACING_CM; + break; + default: + case SpacingType::MARGINS_CM: + pResources = RID_SVXSTRARY_MARGINS_CM; + break; + } + + while (pResources->first) + { + OUString aStr = SvxResId(pResources->first); + sal_uInt16 nData = pResources->second; sal_Int32 nPos = InsertEntry( aStr ); SetEntryData( nPos, reinterpret_cast<void*>(static_cast<sal_uLong>(nData)) ); + ++pResources; } + SetDropDownLineCount(8); SelectEntryPos(0); } |