diff options
author | Gabor Kelemen <kelemeng@ubuntu.com> | 2017-12-04 20:19:28 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-12-09 09:45:22 +0100 |
commit | 686e55d9e87b8dd7a3cfe22f9a6df9c77de3ce09 (patch) | |
tree | a50b8e17ce887e94aae4c1d1343a4f7033789f14 | |
parent | ccc4a306ef8b7db1d2bc8a48cfdec896084b8839 (diff) |
tdf#113959 Use svxlo-FrameDirectionListBox instead of ListBox
To reduce the number of translatable stings
Change-Id: I1aeea6767d3389dd24a5bf8b074817ef601502a7
Reviewed-on: https://gerrit.libreoffice.org/45823
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r-- | cui/source/tabpages/align.cxx | 9 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 9 | ||||
-rw-r--r-- | include/svx/strings.hrc | 4 | ||||
-rw-r--r-- | sw/source/ui/table/tabledlg.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/table/tablepg.hxx | 3 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/formattablepage.ui | 34 |
6 files changed, 26 insertions, 39 deletions
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index 5f4a2fee3f46..327201ca8f85 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -21,7 +21,7 @@ #include <editeng/svxenum.hxx> #include <svx/dialogs.hrc> -#include <strings.hrc> +#include <svx/strings.hrc> #include <bitmaps.hlst> #include <svx/rotmodit.hxx> @@ -212,9 +212,10 @@ AlignmentTabPage::AlignmentTabPage( vcl::Window* pParent, const SfxItemSet& rCor // Asian vertical mode m_pCbAsianMode->Show( SvtCJKOptions().IsVerticalTextEnabled() ); - m_pLbFrameDir->InsertEntryValue( CuiResId( RID_SVXSTR_FRAMEDIR_LTR ), SvxFrameDirection::Horizontal_LR_TB ); - m_pLbFrameDir->InsertEntryValue( CuiResId( RID_SVXSTR_FRAMEDIR_RTL ), SvxFrameDirection::Horizontal_RL_TB ); - m_pLbFrameDir->InsertEntryValue( CuiResId( RID_SVXSTR_FRAMEDIR_SUPER ), SvxFrameDirection::Environment ); + std::locale loc(Translate::Create("svx")); + m_pLbFrameDir->InsertEntryValue( Translate::get( RID_SVXSTR_FRAMEDIR_LTR, loc ), SvxFrameDirection::Horizontal_LR_TB ); + m_pLbFrameDir->InsertEntryValue( Translate::get( RID_SVXSTR_FRAMEDIR_RTL, loc ), SvxFrameDirection::Horizontal_RL_TB ); + m_pLbFrameDir->InsertEntryValue( Translate::get( RID_SVXSTR_FRAMEDIR_SUPER, loc ), SvxFrameDirection::Environment ); // This page needs ExchangeSupport. SetExchangeSupport(); diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index ed900bf18f16..a16097152592 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -29,7 +29,7 @@ #include <svl/languageoptions.hxx> #include <svl/cjkoptions.hxx> #include <editeng/pgrditem.hxx> -#include <strings.hrc> +#include <svx/strings.hrc> #include <paragrph.hxx> #include <editeng/frmdiritem.hxx> #include <editeng/lspcitem.hxx> @@ -1034,9 +1034,10 @@ SvxParaAlignTabPage::SvxParaAlignTabPage( vcl::Window* pParent, const SfxItemSet m_pLastLineLB->SetSelectHdl( LINK( this, SvxParaAlignTabPage, LastLineHdl_Impl ) ); m_pTextDirectionLB->SetSelectHdl( LINK( this, SvxParaAlignTabPage, TextDirectionHdl_Impl ) ); - m_pTextDirectionLB->InsertEntryValue( CuiResId( RID_SVXSTR_FRAMEDIR_SUPER ), SvxFrameDirection::Environment ); - m_pTextDirectionLB->InsertEntryValue( CuiResId( RID_SVXSTR_FRAMEDIR_LTR ), SvxFrameDirection::Horizontal_LR_TB ); - m_pTextDirectionLB->InsertEntryValue( CuiResId( RID_SVXSTR_FRAMEDIR_RTL ), SvxFrameDirection::Horizontal_RL_TB ); + std::locale loc(Translate::Create("svx")); + m_pTextDirectionLB->InsertEntryValue( Translate::get( RID_SVXSTR_FRAMEDIR_SUPER, loc ), SvxFrameDirection::Environment ); + m_pTextDirectionLB->InsertEntryValue( Translate::get( RID_SVXSTR_FRAMEDIR_LTR, loc ), SvxFrameDirection::Horizontal_LR_TB ); + m_pTextDirectionLB->InsertEntryValue( Translate::get( RID_SVXSTR_FRAMEDIR_RTL, loc ), SvxFrameDirection::Horizontal_RL_TB ); setPreviewsToSamePlace(pParent, this); } diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index 1143bb74bd37..cd670874e1e6 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1628,6 +1628,10 @@ #define RID_SUBSETSTR_SYRIAC_SUPPLEMENT NC_("RID_SUBSETMAP", "Syriac Supplement") #define RID_SUBSETSTR_ZANABAZAR_SQUARE NC_("RID_SUBSETMAP", "Zanabazar Square") +#define RID_SVXSTR_FRAMEDIR_LTR NC_("RID_SVXSTR_FRAMEDIR_LTR", "Left-to-right (LTR)") +#define RID_SVXSTR_FRAMEDIR_RTL NC_("RID_SVXSTR_FRAMEDIR_RTL", "Right-to-left (RTL)") +#define RID_SVXSTR_FRAMEDIR_SUPER NC_("RID_SVXSTR_FRAMEDIR_SUPER", "Use superordinate object settings") + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 1dd146377a8a..366e42f01fed 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -38,6 +38,8 @@ #include <sfx2/htmlmode.hxx> #include <strings.hrc> +#include <svx/strings.hrc> +#include <svx/dialmgr.hxx> #include <docsh.hxx> #include <wrtsh.hxx> @@ -91,6 +93,10 @@ SwFormatTablePage::SwFormatTablePage(vcl::Window* pParent, const SfxItemSet& rSe get(m_pBottomMF, "belowmf"); get(m_pTextDirectionLB, "textdirection"); + m_pTextDirectionLB->InsertEntryValue( SvxResId( RID_SVXSTR_FRAMEDIR_LTR ), SvxFrameDirection::Horizontal_LR_TB ); + m_pTextDirectionLB->InsertEntryValue( SvxResId( RID_SVXSTR_FRAMEDIR_RTL ), SvxFrameDirection::Horizontal_RL_TB ); + m_pTextDirectionLB->InsertEntryValue( SvxResId( RID_SVXSTR_FRAMEDIR_SUPER ), SvxFrameDirection::Environment ); + SetExchangeSupport(); const SfxPoolItem* pItem; diff --git a/sw/source/uibase/table/tablepg.hxx b/sw/source/uibase/table/tablepg.hxx index 3ba5eba9a900..23fc72dca155 100644 --- a/sw/source/uibase/table/tablepg.hxx +++ b/sw/source/uibase/table/tablepg.hxx @@ -25,6 +25,7 @@ #include <actctrl.hxx> #include <prcntfld.hxx> #include <swtypes.hxx> +#include <svx/frmdirlbox.hxx> class SwWrtShell; class SwTableRep; @@ -58,7 +59,7 @@ class SwFormatTablePage : public SfxTabPage VclPtr<FixedText> m_pBottomFT; VclPtr<MetricField> m_pBottomMF; - VclPtr<ListBox> m_pTextDirectionLB; + VclPtr<svx::FrameDirectionListBox> m_pTextDirectionLB; SwTableRep* pTableData; SwTwips nSaveWidth; diff --git a/sw/uiconfig/swriter/ui/formattablepage.ui b/sw/uiconfig/swriter/ui/formattablepage.ui index cd20025f9545..cf9499b25a96 100644 --- a/sw/uiconfig/swriter/ui/formattablepage.ui +++ b/sw/uiconfig/swriter/ui/formattablepage.ui @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> <interface domain="sw"> - <!-- interface-requires gtk+ 3.0 --> + <requires lib="gtk+" version="3.0"/> + <!-- interface-requires LibreOffice 1.0 --> <object class="GtkAdjustment" id="adjustment1"> <property name="upper">99.989999999999995</property> <property name="step_increment">0.050000000000000003</property> @@ -125,7 +127,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">•</property> - <property name="invisible_char_set">True</property> <property name="adjustment">adjustment1</property> <property name="digits">2</property> </object> @@ -258,7 +259,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">•</property> - <property name="invisible_char_set">True</property> <property name="adjustment">adjustment2</property> <property name="digits">2</property> </object> @@ -274,7 +274,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">•</property> - <property name="invisible_char_set">True</property> <property name="adjustment">adjustment2</property> <property name="digits">2</property> </object> @@ -290,7 +289,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">•</property> - <property name="invisible_char_set">True</property> <property name="adjustment">adjustment1</property> <property name="digits">2</property> </object> @@ -306,7 +304,6 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">•</property> - <property name="invisible_char_set">True</property> <property name="adjustment">adjustment1</property> <property name="digits">2</property> </object> @@ -539,10 +536,9 @@ </packing> </child> <child> - <object class="GtkComboBox" id="textdirection"> + <object class="svxlo-FrameDirectionListBox" id="textdirection"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="model">liststore1</property> </object> <packing> <property name="left_attach">1</property> @@ -574,28 +570,6 @@ </packing> </child> </object> - <object class="GtkListStore" id="liststore1"> - <columns> - <!-- column-name gchararray1 --> - <column type="gchararray"/> - <!-- column-name gint1 --> - <column type="gint"/> - </columns> - <data> - <row> - <col id="0" translatable="yes" context="formattablepage|liststore1">Left-to-right</col> - <col id="1">0</col> - </row> - <row> - <col id="0" translatable="yes" context="formattablepage|liststore1">Right-to-left</col> - <col id="1">1</col> - </row> - <row> - <col id="0" translatable="yes" context="formattablepage|liststore1">Use superordinate object settings</col> - <col id="1">4</col> - </row> - </data> - </object> <object class="GtkSizeGroup" id="sizegroup1"> <property name="ignore_hidden">True</property> <widgets> |