From 9807290ccb87c0901a53f885a81a6aab93181f1d Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Sun, 10 Dec 2017 15:31:02 +0100 Subject: 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 Reviewed-by: Katarina Behrens --- cui/inc/strings.hrc | 9 --------- cui/source/tabpages/page.cxx | 11 ++++++----- include/svx/strings.hrc | 11 ++++++++--- sw/source/ui/frmdlg/frmpage.cxx | 8 ++++++++ sw/source/uibase/inc/frmpage.hxx | 3 ++- 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 #include -#include +#include +#include #include #include #include @@ -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 #include +#include +#include #include #include #include @@ -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 #include +#include namespace sfx2{class FileDialogHelper;} class SwWrtShell; @@ -300,7 +301,7 @@ class SwFrameAddPage : public SfxTabPage VclPtr m_pEditInReadonlyCB; VclPtr m_pPrintFrameCB; VclPtr m_pTextFlowFT; - VclPtr m_pTextFlowLB; + VclPtr 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 @@ - - - - - - - - - - Left-to-right - 0 - - - Right-to-left - 1 - - - Right-to-left (vertical) - 2 - - - Left-to-right (vertical) - 3 - - - Use superordinate object settings - 4 - - - @@ -489,10 +459,9 @@ - + False - True - liststore1 + True 1 -- cgit