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 /sw/source/uibase/sidebar | |
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 'sw/source/uibase/sidebar')
-rw-r--r-- | sw/source/uibase/sidebar/PageFooterPanel.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageFormatPanel.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/PageHeaderPanel.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/WrapPropertyPanel.cxx | 4 |
4 files changed, 28 insertions, 0 deletions
diff --git a/sw/source/uibase/sidebar/PageFooterPanel.cxx b/sw/source/uibase/sidebar/PageFooterPanel.cxx index e600a80b0ef5..c3b6f751bfb7 100644 --- a/sw/source/uibase/sidebar/PageFooterPanel.cxx +++ b/sw/source/uibase/sidebar/PageFooterPanel.cxx @@ -25,12 +25,14 @@ #include <svx/svxids.hrc> #include <svx/dlgutil.hxx> #include <svx/rulritem.hxx> +#include <svx/svdtrans.hxx> #include "PageFooterPanel.hxx" #include <sfx2/sidebar/ControlFactory.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/bindings.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/objsh.hxx> +#include <uitool.hxx> #include <cmdid.h> namespace sw { namespace sidebar{ @@ -66,8 +68,11 @@ PageFooterPanel::PageFooterPanel( { get(mpFooterToggle, "footertoggle"); get(mpFooterSpacingLB, "spacingpreset"); + FieldUnit eMetric = ::GetDfltMetric(false); + mpFooterSpacingLB->Init(IsInch(eMetric) ? SpacingType::SPACING_INCH : SpacingType::SPACING_CM); get(mpFooterLayoutLB, "samecontentLB"); get(mpFooterMarginPresetLB, "footermarginpreset"); + mpFooterMarginPresetLB->Init(IsInch(GetModuleFieldUnit()) ? SpacingType::MARGINS_INCH : SpacingType::MARGINS_CM); get(mpCustomEntry, "customlabel"); Initialize(); diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx b/sw/source/uibase/sidebar/PageFormatPanel.cxx index bda95ea0dd34..a256e0be0e1d 100644 --- a/sw/source/uibase/sidebar/PageFormatPanel.cxx +++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx @@ -25,6 +25,7 @@ #include <svx/svxids.hrc> #include <svx/dlgutil.hxx> #include <svx/rulritem.hxx> +#include <svx/svdtrans.hxx> #include "PageFormatPanel.hxx" #include "PageMarginUtils.hxx" #include <sfx2/sidebar/ControlFactory.hxx> @@ -32,7 +33,9 @@ #include <sfx2/bindings.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/objsh.hxx> +#include <pageformatpanel.hrc> #include <cmdid.h> +#include <uitool.hxx> #include <svtools/unitconv.hxx> #include <svtools/optionsdrawinglayer.hxx> @@ -75,6 +78,17 @@ PageFormatPanel::PageFormatPanel( get(mpPaperHeight, "paperheight"); get(mpPaperOrientation, "paperorientation"); get(mpMarginSelectBox, "marginLB"); + FieldUnit eMetric = ::GetDfltMetric(false); + if (IsInch(eMetric)) + { + for (size_t i = 0; i < SAL_N_ELEMENTS(RID_PAGEFORMATPANEL_MARGINS_INCH); ++i) + mpMarginSelectBox->InsertEntry(SwResId(RID_PAGEFORMATPANEL_MARGINS_INCH[i])); + } + else + { + for (size_t i = 0; i < SAL_N_ELEMENTS(RID_PAGEFORMATPANEL_MARGINS_CM); ++i) + mpMarginSelectBox->InsertEntry(SwResId(RID_PAGEFORMATPANEL_MARGINS_CM[i])); + } get(mpCustomEntry, "customlabel"); Initialize(); } diff --git a/sw/source/uibase/sidebar/PageHeaderPanel.cxx b/sw/source/uibase/sidebar/PageHeaderPanel.cxx index b5206aeec426..7bd73b01cdd1 100644 --- a/sw/source/uibase/sidebar/PageHeaderPanel.cxx +++ b/sw/source/uibase/sidebar/PageHeaderPanel.cxx @@ -25,12 +25,14 @@ #include <svx/svxids.hrc> #include <svx/dlgutil.hxx> #include <svx/rulritem.hxx> +#include <svx/svdtrans.hxx> #include "PageHeaderPanel.hxx" #include <sfx2/sidebar/ControlFactory.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/bindings.hxx> #include <sfx2/viewsh.hxx> #include <sfx2/objsh.hxx> +#include <uitool.hxx> #include <cmdid.h> namespace sw { namespace sidebar{ @@ -69,8 +71,11 @@ PageHeaderPanel::PageHeaderPanel( { get(mpHeaderToggle, "headertoggle"); get(mpHeaderSpacingLB, "spacingpreset"); + FieldUnit eMetric = ::GetDfltMetric(false); + mpHeaderSpacingLB->Init(IsInch(eMetric) ? SpacingType::SPACING_INCH : SpacingType::SPACING_CM); get(mpHeaderLayoutLB, "samecontentLB"); get(mpHeaderMarginPresetLB, "headermarginpreset"); + mpHeaderMarginPresetLB->Init(IsInch(eMetric) ? SpacingType::MARGINS_INCH : SpacingType::MARGINS_CM); get(mpCustomEntry, "customlabel"); Initialize(); diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx index 0d6e2623748c..c51d4f7844a1 100644 --- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx +++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx @@ -22,6 +22,7 @@ #include <cmdid.h> #include <swtypes.hxx> #include <svx/svxids.hrc> +#include <svx/svdtrans.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/sidebar/ControlFactory.hxx> @@ -33,6 +34,7 @@ #include <editeng/lrspitem.hxx> #include <editeng/ulspitem.hxx> #include <hintids.hxx> +#include <uitool.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> const char UNO_WRAPOFF[] = ".uno:WrapOff"; @@ -96,6 +98,8 @@ WrapPropertyPanel::WrapPropertyPanel( get(mpEnableContour, "enablecontour"); get(mpEditContour, "editcontour"); get(mpSpacingLB, "spacingLB"); + FieldUnit eMetric = ::GetDfltMetric(false); + mpSpacingLB->Init(IsInch(eMetric) ? SpacingType::SPACING_INCH : SpacingType::SPACING_CM); get(mpCustomEntry, "customlabel"); Initialize(); |