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 | |
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')
-rw-r--r-- | svx/inc/spacing.hrc | 62 | ||||
-rw-r--r-- | svx/source/dialog/spacinglistbox.cxx | 30 |
2 files changed, 80 insertions, 12 deletions
diff --git a/svx/inc/spacing.hrc b/svx/inc/spacing.hrc index 2e41d505015f..2f2b219f5242 100644 --- a/svx/inc/spacing.hrc +++ b/svx/inc/spacing.hrc @@ -13,16 +13,60 @@ #define NC_(Context, String) (Context "\004" u8##String) -const std::pair<const char*, int> RID_SVXSTRARY_SPACING[] = +// To translators: this is a listbox labelled by "Spacing:", inch units +const std::pair<const char*, int> RID_SVXSTRARY_SPACING_INCH[] = { - { NC_("RID_SVXSTRARY_SPACING", "None"), 0 }, - { NC_("RID_SVXSTRARY_SPACING", "Extra Small (1/16\")"), 91 }, - { NC_("RID_SVXSTRARY_SPACING", "Small (1/8\")"), 181 }, - { NC_("RID_SVXSTRARY_SPACING", "Small Medium (1/4\")"), 363 }, - { NC_("RID_SVXSTRARY_SPACING", "Medium (3/8\")"), 539 }, - { NC_("RID_SVXSTRARY_SPACING", "Medium Large (1/2\")"), 720 }, - { NC_("RID_SVXSTRARY_SPACING", "Large (3/4\")"), 1077 }, - { NC_("RID_SVXSTRARY_SPACING", "Extra Large (1\")"), 1440 } + { NC_("RID_SVXSTRARY_SPACING_INCH", "None"), 0 }, + { NC_("RID_SVXSTRARY_SPACING_INCH", "Extra Small (1/16\")"), 91 }, + { NC_("RID_SVXSTRARY_SPACING_INCH", "Small (1/8\")"), 181 }, + { NC_("RID_SVXSTRARY_SPACING_INCH", "Small Medium (1/4\")"), 363 }, + { NC_("RID_SVXSTRARY_SPACING_INCH", "Medium (3/8\")"), 539 }, + { NC_("RID_SVXSTRARY_SPACING_INCH", "Medium Large (1/2\")"), 720 }, + { NC_("RID_SVXSTRARY_SPACING_INCH", "Large (3/4\")"), 1077 }, + { NC_("RID_SVXSTRARY_SPACING_INCH", "Extra Large (1\")"), 1440 }, + { nullptr, 0 } +}; + +// To translators: this is a listbox labelled by "Spacing:", cm units +const std::pair<const char*, int> RID_SVXSTRARY_SPACING_CM[] = +{ + { NC_("RID_SVXSTRARY_SPACING_CM", "None"), 0 }, + { NC_("RID_SVXSTRARY_SPACING_CM", "Extra Small (0.16cm)"), 91 }, + { NC_("RID_SVXSTRARY_SPACING_CM", "Small (0.32cm)"), 181 }, + { NC_("RID_SVXSTRARY_SPACING_CM", "Small Medium (0.64cm)"), 363 }, + { NC_("RID_SVXSTRARY_SPACING_CM", "Medium (0.95cm)"), 539 }, + { NC_("RID_SVXSTRARY_SPACING_CM", "Medium Large (1.27cm)"), 720 }, + { NC_("RID_SVXSTRARY_SPACING_CM", "Large (1.9cm)"), 1077 }, + { NC_("RID_SVXSTRARY_SPACING_CM", "Extra Large (2.54cm)"), 1440 }, + { nullptr, 0 } +}; + +// To translators: this is a listbox labelled by "Margins:", inch units +const std::pair<const char*, int> RID_SVXSTRARY_MARGINS_INCH[] = +{ + { NC_("RID_SVXSTRARY_MARGINS_INCH", "None"), 0 }, + { NC_("RID_SVXSTRARY_MARGINS_INCH", "Extra Small (1/16\")"), 91 }, + { NC_("RID_SVXSTRARY_MARGINS_INCH", "Small (1/8\")"), 181 }, + { NC_("RID_SVXSTRARY_MARGINS_INCH", "Small Medium (1/4\")"), 363 }, + { NC_("RID_SVXSTRARY_MARGINS_INCH", "Medium (3/8\")"), 539 }, + { NC_("RID_SVXSTRARY_MARGINS_INCH", "Medium Large (1/2\")"), 720 }, + { NC_("RID_SVXSTRARY_MARGINS_INCH", "Large (3/4\")"), 1077 }, + { NC_("RID_SVXSTRARY_MARGINS_INCH", "Extra Large (1\")"), 1440 }, + { nullptr, 0 } +}; + +// To translators: this is a listbox labelled by "Margins:", cm units +const std::pair<const char*, int> RID_SVXSTRARY_MARGINS_CM[] = +{ + { NC_("RID_SVXSTRARY_MARGINS_CM", "None"), 0 }, + { NC_("RID_SVXSTRARY_MARGINS_CM", "Extra Small (0.16cm)"), 91 }, + { NC_("RID_SVXSTRARY_MARGINS_CM", "Small (0.32cm)"), 181 }, + { NC_("RID_SVXSTRARY_MARGINS_CM", "Small Medium (0.64cm)"), 363 }, + { NC_("RID_SVXSTRARY_MARGINS_CM", "Medium (0.95cm)"), 539 }, + { NC_("RID_SVXSTRARY_MARGINS_CM", "Medium Large (1.27cm)"), 720 }, + { NC_("RID_SVXSTRARY_MARGINS_CM", "Large (1.9cm)"), 1077 }, + { NC_("RID_SVXSTRARY_MARGINS_CM", "Extra Large (2.54cm)"), 1440 }, + { nullptr, 0 } }; #endif 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); } |