diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc index 9d09aef45c36..3442f6bc06a6 100644 --- a/chart2/inc/strings.hrc +++ b/chart2/inc/strings.hrc @@ -185,6 +185,8 @@ #define STR_INVALID_TIME_UNIT NC_("STR_INVALID_TIME_UNIT", "The major and minor interval need to be greater or equal to the resolution. Check your input.") #define STR_UNSUPPORTED_CHART_TYPE NC_("STR_UNSUPPORTED_CHART_TYPE", "One or more chart types are unsupported in this version of %PRODUCTNAME") +#define STR_RANGE_FOR_VALUETYPE NC_("tp_DataSource|FT_RANGE", "Ran_ge for %VALUETYPE") + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 2206e89c7f1f..27b9b2f016dd 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -183,7 +183,6 @@ DataSourceTabPage::DataSourceTabPage(weld::Container* pPage, weld::DialogControl m_xLB_ROLE->get_height_rows(5)); m_xFT_CAPTION->set_visible(!bHideDescription); - m_aFixedTextRange = m_xFT_RANGE->get_label(); SetPageTitle(SchResId(STR_OBJECT_DATASERIES_PLURAL)); // set handlers @@ -473,15 +472,9 @@ IMPL_LINK_NOARG(DataSourceTabPage, RoleSelectionChangedHdl, weld::ItemView&, voi OUString aSelectedRoleUI = lcl_GetSelectedRole( *m_xLB_ROLE, true ); OUString aSelectedRange = lcl_GetSelectedRolesRange( *m_xLB_ROLE ); - // replace role in fixed text label - static constexpr OUString aReplacementStr( u"%VALUETYPE"_ustr ); - sal_Int32 nIndex = m_aFixedTextRange.indexOf( aReplacementStr ); - if( nIndex != -1 ) - { - m_xFT_RANGE->set_label( - m_aFixedTextRange.replaceAt( - nIndex, aReplacementStr.getLength(), aSelectedRoleUI )); - } + // add the role in fixed text label + m_xFT_RANGE->set_label( + SchResId(STR_RANGE_FOR_VALUETYPE).replaceFirst(u"%VALUETYPE", aSelectedRoleUI)); m_xEDT_RANGE->set_text(aSelectedRange); isValid(); diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx index 0ecb3dffd2bc..22efd8449d34 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.hxx +++ b/chart2/source/controller/dialogs/tp_DataSource.hxx @@ -121,8 +121,6 @@ private: std::vector> m_aEntries; - OUString m_aFixedTextRange; - ChartTypeTemplateProvider * m_pTemplateProvider; DialogModel & m_rDialogModel; weld::Entry* m_pCurrentRangeChoosingField; diff --git a/chart2/uiconfig/ui/tp_DataSource.ui b/chart2/uiconfig/ui/tp_DataSource.ui index 3794fb73f5a7..31ffe58948dd 100644 --- a/chart2/uiconfig/ui/tp_DataSource.ui +++ b/chart2/uiconfig/ui/tp_DataSource.ui @@ -309,7 +309,7 @@ True False - Ran_ge for %VALUETYPE + Ran_ge True EDT_RANGE 0