diff options
author | Gabor Kelemen <kelemeng@ubuntu.com> | 2017-12-10 15:31:02 +0100 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-12-12 14:44:57 +0100 |
commit | 9807290ccb87c0901a53f885a81a6aab93181f1d (patch) | |
tree | 697e76e9652cdda51eeaa3f3788bdb784f1afc22 | |
parent | 4fe154d6e068aa9accdb64e8ebd4d1491b6c94f9 (diff) |
tdf#113959 Use svxlo-FrameDirectionListBox instead of ListBox
Final part. Here frmaddpage.ui is migrated, but to reuse the 2
other strings we need to shake up their original place in page.cxx
Now all the stings are moved to svx and occur only once in the code base.
Change-Id: I8b3942f96d43bf8d6f054c8410c3781bcefc3ccc
Reviewed-on: https://gerrit.libreoffice.org/46189
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r-- | cui/inc/strings.hrc | 9 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 11 | ||||
-rw-r--r-- | include/svx/strings.hrc | 11 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/inc/frmpage.hxx | 3 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/frmaddpage.ui | 35 |
6 files changed, 26 insertions, 51 deletions
diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index af4fbb388b57..330931871a47 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -315,15 +315,6 @@ #define RID_SVXSTR_OPT_PROXYPORTS NC_("RID_SVXSTR_OPT_PROXYPORTS", "Invalid value!\n\nThe maximum value for a port number is 65535.") -#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") -// page direction -#define RID_SVXSTR_PAGEDIR_LTR_HORI NC_("RID_SVXSTR_PAGEDIR_LTR_HORI", "Left-to-right (horizontal)") -#define RID_SVXSTR_PAGEDIR_RTL_HORI NC_("RID_SVXSTR_PAGEDIR_RTL_HORI", "Right-to-left (horizontal)") -#define RID_SVXSTR_PAGEDIR_RTL_VERT NC_("RID_SVXSTR_PAGEDIR_RTL_VERT", "Right-to-left (vertical)") -#define RID_SVXSTR_PAGEDIR_LTR_VERT NC_("RID_SVXSTR_PAGEDIR_LTR_VERT", "Left-to-right (vertical)") - #define RID_SVXSTR_DESC_GRADIENT NC_("RID_SVXSTR_DESC_GRADIENT", "Please enter a name for the gradient:") #define RID_SVXSTR_DESC_NEW_BITMAP NC_("RID_SVXSTR_DESC_NEW_BITMAP", "Please enter a name for the bitmap:") #define RID_SVXSTR_DESC_EXT_BITMAP NC_("RID_SVXSTR_DESC_EXT_BITMAP", "Please enter a name for the external bitmap:") diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index f1de9a5e2185..4f2303c28a40 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -30,7 +30,8 @@ #include <sfx2/htmlmode.hxx> #include <sal/macros.h> -#include <strings.hrc> +#include <svx/strings.hrc> +#include <svx/dialmgr.hxx> #include <helpids.h> #include <page.hxx> #include <svx/pageitem.hxx> @@ -216,11 +217,11 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr // fill text flow listbox with valid entries - m_pTextFlowBox->InsertEntryValue( CuiResId( RID_SVXSTR_PAGEDIR_LTR_HORI ), SvxFrameDirection::Horizontal_LR_TB ); + m_pTextFlowBox->InsertEntryValue( SvxResId( RID_SVXSTR_PAGEDIR_LTR_HORI ), SvxFrameDirection::Horizontal_LR_TB ); if( bCTL ) - m_pTextFlowBox->InsertEntryValue( CuiResId( RID_SVXSTR_PAGEDIR_RTL_HORI ), SvxFrameDirection::Horizontal_RL_TB ); + m_pTextFlowBox->InsertEntryValue( SvxResId( RID_SVXSTR_PAGEDIR_RTL_HORI ), SvxFrameDirection::Horizontal_RL_TB ); // #109989# do not show vertical directions in Writer/Web @@ -228,8 +229,8 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr { if( bCJK ) { - m_pTextFlowBox->InsertEntryValue( CuiResId( RID_SVXSTR_PAGEDIR_RTL_VERT ), SvxFrameDirection::Vertical_RL_TB ); - m_pTextFlowBox->InsertEntryValue( CuiResId( RID_SVXSTR_PAGEDIR_LTR_VERT ), SvxFrameDirection::Vertical_LR_TB ); + m_pTextFlowBox->InsertEntryValue( SvxResId( RID_SVXSTR_PAGEDIR_RTL_VERT ), SvxFrameDirection::Vertical_RL_TB ); + m_pTextFlowBox->InsertEntryValue( SvxResId( RID_SVXSTR_PAGEDIR_LTR_VERT ), SvxFrameDirection::Vertical_LR_TB ); } } diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index cd670874e1e6..1fbcfc2066b2 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1628,9 +1628,14 @@ #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") +#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") +// page direction +#define RID_SVXSTR_PAGEDIR_LTR_HORI NC_("RID_SVXSTR_PAGEDIR_LTR_HORI", "Left-to-right (horizontal)") +#define RID_SVXSTR_PAGEDIR_RTL_HORI NC_("RID_SVXSTR_PAGEDIR_RTL_HORI", "Right-to-left (horizontal)") +#define RID_SVXSTR_PAGEDIR_RTL_VERT NC_("RID_SVXSTR_PAGEDIR_RTL_VERT", "Right-to-left (vertical)") +#define RID_SVXSTR_PAGEDIR_LTR_VERT NC_("RID_SVXSTR_PAGEDIR_LTR_VERT", "Left-to-right (vertical)") #endif diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index abe24490f64b..8574f8ce7e90 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -62,6 +62,8 @@ #include <sal/macros.h> #include <strings.hrc> +#include <svx/strings.hrc> +#include <svx/dialmgr.hxx> #include <sfx2/filedlghelper.hxx> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/XFilePicker3.hpp> @@ -2924,6 +2926,12 @@ SwFrameAddPage::SwFrameAddPage(vcl::Window *pParent, const SfxItemSet &rSet) get(m_pTextFlowFT,"textflow_label"); get(m_pTextFlowLB,"textflow"); + m_pTextFlowLB->InsertEntryValue( SvxResId( RID_SVXSTR_FRAMEDIR_LTR ), SvxFrameDirection::Horizontal_LR_TB ); + m_pTextFlowLB->InsertEntryValue( SvxResId( RID_SVXSTR_FRAMEDIR_RTL ), SvxFrameDirection::Horizontal_RL_TB ); + m_pTextFlowLB->InsertEntryValue( SvxResId( RID_SVXSTR_PAGEDIR_RTL_VERT ), SvxFrameDirection::Vertical_RL_TB ); + m_pTextFlowLB->InsertEntryValue( SvxResId( RID_SVXSTR_PAGEDIR_LTR_VERT ), SvxFrameDirection::Vertical_LR_TB ); + m_pTextFlowLB->InsertEntryValue( SvxResId( RID_SVXSTR_FRAMEDIR_SUPER ), SvxFrameDirection::Environment ); + m_pDescriptionED->set_height_request(m_pDescriptionED->get_preferred_size().Height()); } diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx index ddd3261fc82f..50ed7200295d 100644 --- a/sw/source/uibase/inc/frmpage.hxx +++ b/sw/source/uibase/inc/frmpage.hxx @@ -32,6 +32,7 @@ #include "prcntfld.hxx" #include <globals.hrc> #include <svx/dialcontrol.hxx> +#include <svx/frmdirlbox.hxx> namespace sfx2{class FileDialogHelper;} class SwWrtShell; @@ -300,7 +301,7 @@ class SwFrameAddPage : public SfxTabPage VclPtr<CheckBox> m_pEditInReadonlyCB; VclPtr<CheckBox> m_pPrintFrameCB; VclPtr<FixedText> m_pTextFlowFT; - VclPtr<ListBox> m_pTextFlowLB; + VclPtr<svx::FrameDirectionListBox> m_pTextFlowLB; SwWrtShell* m_pWrtSh; diff --git a/sw/uiconfig/swriter/ui/frmaddpage.ui b/sw/uiconfig/swriter/ui/frmaddpage.ui index caa443dd8549..135a0823f777 100644 --- a/sw/uiconfig/swriter/ui/frmaddpage.ui +++ b/sw/uiconfig/swriter/ui/frmaddpage.ui @@ -24,36 +24,6 @@ </row> </data> </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="frmaddpage|liststore1">Left-to-right</col> - <col id="1">0</col> - </row> - <row> - <col id="0" translatable="yes" context="frmaddpage|liststore1">Right-to-left</col> - <col id="1">1</col> - </row> - <row> - <col id="0" translatable="yes" context="frmaddpage|liststore1">Right-to-left (vertical)</col> - <col id="1">2</col> - </row> - <row> - <col id="0" translatable="yes" context="frmaddpage|liststore1">Left-to-right (vertical)</col> - <col id="1">3</col> - </row> - <row> - <col id="0" translatable="yes" context="frmaddpage|liststore1">Use superordinate object settings</col> - <col id="1">4</col> - </row> - </data> - </object> <object class="GtkTextBuffer" id="textbuffer1"> <property name="text"> @@ -489,10 +459,9 @@ </packing> </child> <child> - <object class="GtkComboBox" id="textflow"> + <object class="svxlo-FrameDirectionListBox" id="textflow"> <property name="can_focus">False</property> - <property name="no_show_all">True</property> - <property name="model">liststore1</property> + <property name="visible">True</property> </object> <packing> <property name="left_attach">1</property> |