summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-19 13:18:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-05 09:39:11 +0200
commit14cfff500e93f0d6cbf8412065feea85c01ea81d (patch)
tree76e3fb8fbf2b0d8a12c8406d8cf994ea6a37aaff /filter
parentd924ce30e0ca260682bd2aed192b8b1b2ca3e7c0 (diff)
Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and joining of strings like this. Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/inc/strings.hrc2
-rw-r--r--filter/source/pdf/impdialog.cxx2
-rw-r--r--filter/source/t602/t602filter.cxx2
-rw-r--r--filter/source/t602/t602filter.hxx3
-rw-r--r--filter/source/xsltdialog/xmlfiltercommon.hxx3
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx2
-rw-r--r--filter/source/xsltdialog/xmlfiltertabdialog.cxx7
7 files changed, 12 insertions, 9 deletions
diff --git a/filter/inc/strings.hrc b/filter/inc/strings.hrc
index b1bea27dec47..eecfdb33e2d0 100644
--- a/filter/inc/strings.hrc
+++ b/filter/inc/strings.hrc
@@ -19,7 +19,7 @@
#pragma once
-#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String)
+#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
#define STR_UNKNOWN_APPLICATION NC_("STR_UNKNOWN_APPLICATION", "Unknown")
#define STR_IMPORT_ONLY NC_("STR_IMPORT_ONLY", "import filter")
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index a1a8978e04ff..0e5a4441907e 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -42,7 +42,7 @@
#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-static OUString PDFFilterResId(std::string_view aId)
+static OUString PDFFilterResId(TranslateId aId)
{
return Translate::get(aId, Translate::Create("flt"));
}
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index 8fd52e72fed5..a8df18768b3a 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -1078,7 +1078,7 @@ sal_Int16 SAL_CALL T602ImportFilterDialog::execute()
return css::ui::dialogs::ExecutableDialogResults::CANCEL;
}
-OUString T602ImportFilterDialog::getResStr(const char* resid)
+OUString T602ImportFilterDialog::getResStr(TranslateId resid)
{
return Translate::get(resid, maResLocale);
}
diff --git a/filter/source/t602/t602filter.hxx b/filter/source/t602/t602filter.hxx
index e9ec3a58e4e3..04376a1f3c26 100644
--- a/filter/source/t602/t602filter.hxx
+++ b/filter/source/t602/t602filter.hxx
@@ -34,6 +34,7 @@
#include <xmloff/attrlist.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <rtl/ref.hxx>
+#include <unotools/resmgr.hxx>
namespace T602ImportFilter {
@@ -85,7 +86,7 @@ class T602ImportFilterDialog : public cppu::WeakImplHelper <
LanguageTag maLocale;
std::locale maResLocale;
bool OptionsDlg();
- OUString getResStr(const char* resid);
+ OUString getResStr(TranslateId resid);
virtual ~T602ImportFilterDialog() override;
diff --git a/filter/source/xsltdialog/xmlfiltercommon.hxx b/filter/source/xsltdialog/xmlfiltercommon.hxx
index c8b8ea7bfa67..0d340fa12e0f 100644
--- a/filter/source/xsltdialog/xmlfiltercommon.hxx
+++ b/filter/source/xsltdialog/xmlfiltercommon.hxx
@@ -20,6 +20,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
+#include <unotools/resmgr.hxx>
#include <string_view>
#include <vector>
@@ -77,6 +78,6 @@ struct application_info_impl
extern std::vector< application_info_impl > const & getApplicationInfos();
extern OUString getApplicationUIName( std::u16string_view rServiceName );
extern const application_info_impl* getApplicationInfo( std::u16string_view rServiceName );
-OUString XsltResId(std::string_view pId);
+OUString XsltResId(TranslateId pId);
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index a31eba952173..66e35f186c5d 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -58,7 +58,7 @@ using namespace com::sun::star::util;
using ::rtl::Uri;
-OUString XsltResId(std::string_view aId)
+OUString XsltResId(TranslateId aId)
{
return Translate::get(aId, Translate::Create("flt"));
}
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
index 306cf0abf23f..ea73c486ae1f 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
@@ -25,6 +25,7 @@
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <osl/file.hxx>
+#include <unotools/resmgr.hxx>
#include <strings.hrc>
#include "xmlfiltertabdialog.hxx"
@@ -69,7 +70,7 @@ bool XMLFilterTabDialog::onOk()
mpBasicPage->FillInfo( mpNewInfo.get() );
OString sErrorPage;
- const char* pErrorId = nullptr;
+ TranslateId pErrorId;
weld::Widget* pFocusWindow = nullptr;
OUString aReplace1;
OUString aReplace2;
@@ -128,7 +129,7 @@ bool XMLFilterTabDialog::onOk()
sal_Int32 nFilter;
Sequence< PropertyValue > aValues;
- for( nFilter = 0; (nFilter < nCount) && (pErrorId == nullptr); nFilter++, pFilterName++ )
+ for( nFilter = 0; (nFilter < nCount) && !pErrorId; nFilter++, pFilterName++ )
{
Any aAny( xFilterContainer->getByName( *pFilterName ) );
if( !(aAny >>= aValues) )
@@ -138,7 +139,7 @@ bool XMLFilterTabDialog::onOk()
PropertyValue* pValues = aValues.getArray();
sal_Int32 nValue;
- for( nValue = 0; (nValue < nValueCount) && (pErrorId == nullptr); nValue++, pValues++ )
+ for( nValue = 0; (nValue < nValueCount) && !pErrorId; nValue++, pValues++ )
{
if ( pValues->Name == "UIName" )
{