summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-31 15:14:47 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-01 14:37:43 +0100
commit6d9a2557a0f0366fff169f3c3581414b3cec80bd (patch)
tree6a1ead1edccb8857b888b235684d8781ca4f8194 /sw
parentbeaba5f1abbb9a1461286fc831ea6a30131bb3b5 (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')
-rw-r--r--sw/inc/pageformatpanel.hrc43
-rw-r--r--sw/source/uibase/sidebar/PageFooterPanel.cxx5
-rw-r--r--sw/source/uibase/sidebar/PageFormatPanel.cxx14
-rw-r--r--sw/source/uibase/sidebar/PageHeaderPanel.cxx5
-rw-r--r--sw/source/uibase/sidebar/WrapPropertyPanel.cxx4
-rw-r--r--sw/uiconfig/swriter/ui/pageformatpanel.ui10
6 files changed, 71 insertions, 10 deletions
diff --git a/sw/inc/pageformatpanel.hrc b/sw/inc/pageformatpanel.hrc
new file mode 100644
index 000000000000..e35bd64c4997
--- /dev/null
+++ b/sw/inc/pageformatpanel.hrc
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SW_INC_PAGEFORMATPANEL_HRC
+#define INCLUDED_SW_INC_PAGEFORMATPANEL_HRC
+
+#define NC_(Context, String) (Context "\004" u8##String)
+
+// To translators: this is a listbox labelled by "Margins:", inch units
+const char* RID_PAGEFORMATPANEL_MARGINS_INCH[] =
+{
+ NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "None"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "Narrow"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "Moderate"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "Normal (0.75\")"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "Normal (1\")"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "Normal (1.25\")"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "Wide"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "Mirrored")
+};
+
+// To translators: this is a listbox labelled by "Margins:", cm units
+const char* RID_PAGEFORMATPANEL_MARGINS_CM[] =
+{
+ NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "None"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "Narrow"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "Moderate"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "Normal (1.9cm)"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "Normal (2.54cm)"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "Normal (3.18cm)"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "Wide"),
+ NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "Mirrored")
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
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();
diff --git a/sw/uiconfig/swriter/ui/pageformatpanel.ui b/sw/uiconfig/swriter/ui/pageformatpanel.ui
index 579db0800223..5dc85d0b78e5 100644
--- a/sw/uiconfig/swriter/ui/pageformatpanel.ui
+++ b/sw/uiconfig/swriter/ui/pageformatpanel.ui
@@ -139,16 +139,6 @@
<object class="GtkComboBoxText" id="marginLB">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <items>
- <item translatable="yes" context="pageformatpanel|marginLB">None</item>
- <item translatable="yes" context="pageformatpanel|marginLB">Narrow</item>
- <item translatable="yes" context="pageformatpanel|marginLB">Moderate</item>
- <item translatable="yes" context="pageformatpanel|marginLB">Normal 0.75"</item>
- <item translatable="yes" context="pageformatpanel|marginLB">Normal 1"</item>
- <item translatable="yes" context="pageformatpanel|marginLB">Normal 1.25"</item>
- <item translatable="yes" context="pageformatpanel|marginLB">Wide</item>
- <item translatable="yes" context="pageformatpanel|marginLB">Mirrored</item>
- </items>
</object>
<packing>
<property name="left_attach">1</property>