summaryrefslogtreecommitdiff
path: root/unodevtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-05-20 09:34:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-20 22:09:56 +0200
commitd573e2ae17d2ff589ec7adc0dddf6a78db4cc93a (patch)
treecefd09b6f39b3116f26193dc043bda1f49713ae9 /unodevtools
parent41c04ceb3b1b14c3c99ede86524df8f3de4f5daa (diff)
loplugin:ostr in various
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unodevtools')
-rw-r--r--unodevtools/source/skeletonmaker/cppcompskeleton.cxx26
-rw-r--r--unodevtools/source/skeletonmaker/javacompskeleton.cxx12
-rw-r--r--unodevtools/source/skeletonmaker/skeletoncommon.cxx24
3 files changed, 30 insertions, 32 deletions
diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
index 0942d7cde694..7555ba7f43a6 100644
--- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
@@ -781,18 +781,18 @@ static OString generateClassDefinition(std::ostream& o,
<< scopedCppName(u2b(propertyhelper)) << " >(\n"
" context, static_cast< Implements >(\n ";
OStringBuffer buffer(128);
- if (propinterfaces.find("com/sun/star/beans/XPropertySet")
+ if (propinterfaces.find(u"com/sun/star/beans/XPropertySet"_ustr)
!= propinterfaces.end()) {
buffer.append("IMPLEMENTS_PROPERTY_SET");
}
- if (propinterfaces.find("com/sun/star/beans/XFastPropertySet")
+ if (propinterfaces.find(u"com/sun/star/beans/XFastPropertySet"_ustr)
!= propinterfaces.end()) {
if (!buffer.isEmpty())
buffer.append(" | IMPLEMENTS_FAST_PROPERTY_SET");
else
buffer.append("IMPLEMENTS_FAST_PROPERTY_SET");
}
- if (propinterfaces.find("com/sun/star/beans/XPropertyAccess")
+ if (propinterfaces.find(u"com/sun/star/beans/XPropertyAccess"_ustr)
!= propinterfaces.end()) {
if (!buffer.isEmpty())
buffer.append(" | IMPLEMENTS_PROPERTY_ACCESS");
@@ -945,9 +945,9 @@ void generateSkeleton(ProgramOptions const & options,
// so it is defaulted. The XDispatchProvider provides Dispatch objects for
// certain functions and the generated impl object implements XDispatch
// directly for simplicity reasons.
- checkType(manager, "com.sun.star.frame.ProtocolHandler",
+ checkType(manager, u"com.sun.star.frame.ProtocolHandler"_ustr,
interfaces, services, properties);
- checkType(manager, "com.sun.star.frame.XDispatch",
+ checkType(manager, u"com.sun.star.frame.XDispatch"_ustr,
interfaces, services, properties);
}
@@ -962,8 +962,8 @@ void generateSkeleton(ProgramOptions const & options,
if (interfaces.size() > 12)
throw CannotDumpException(
- "the skeletonmaker supports components with 12 interfaces "
- "only (limitation of the UNO implementation helpers)!");
+ u"the skeletonmaker supports components with 12 interfaces "
+ "only (limitation of the UNO implementation helpers)!"_ustr);
supportxcomponent = checkXComponentSupport(manager, interfaces);
@@ -1075,8 +1075,8 @@ void generateCalcAddin(ProgramOptions const & options,
OUString sAddinService;
if (services.size() != 1) {
throw CannotDumpException(
- "for calc add-in components one and only one service type is necessary!"
- " Please reference a valid type with the '-t' option.");
+ u"for calc add-in components one and only one service type is necessary!"
+ " Please reference a valid type with the '-t' option."_ustr);
}
@@ -1093,13 +1093,13 @@ void generateCalcAddin(ProgramOptions const & options,
// taken from the configuration from Calc directly, this simplifies the
// add-in code
if (options.backwardcompatible) {
- checkType(manager, "com.sun.star.sheet.AddIn",
+ checkType(manager, u"com.sun.star.sheet.AddIn"_ustr,
interfaces, services, properties);
} else {
// special case for the optional XLocalization interface. It should be
// implemented always. But it is parent of the XAddIn and we need it only
// if backwardcompatible is false.
- interfaces.insert("com.sun.star.lang.XLocalizable");
+ interfaces.insert(u"com.sun.star.lang.XLocalizable"_ustr);
}
OUString propertyhelper = checkPropertyHelper(
@@ -1113,8 +1113,8 @@ void generateCalcAddin(ProgramOptions const & options,
if (interfaces.size() > 12) {
throw CannotDumpException(
- "the skeletonmaker supports components with 12 interfaces "
- "only (limitation of the UNO implementation helpers)!");
+ u"the skeletonmaker supports components with 12 interfaces "
+ "only (limitation of the UNO implementation helpers)!"_ustr);
}
// check if service object or simple UNO object
diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
index 1de92fac0bc2..916c96a2c196 100644
--- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
@@ -820,17 +820,17 @@ void generateSkeleton(ProgramOptions const & options,
// so it is defaulted. The XDispatchProvider provides Dispatch objects for
// certain functions and the generated impl object implements XDispatch
// directly for simplicity reasons.
- checkType(manager, "com.sun.star.frame.ProtocolHandler",
+ checkType(manager, u"com.sun.star.frame.ProtocolHandler"_ustr,
interfaces, services, properties);
- checkType(manager, "com.sun.star.frame.XDispatch",
+ checkType(manager, u"com.sun.star.frame.XDispatch"_ustr,
interfaces, services, properties);
}
if (options.componenttype == 2) {
if (services.size() != 1) {
throw CannotDumpException(
- "for calc add-in components one and only one service type is "
- "necessary! Please reference a valid type with the '-t' option.");
+ u"for calc add-in components one and only one service type is "
+ "necessary! Please reference a valid type with the '-t' option."_ustr);
}
// if backwardcompatible==true the AddIn service needs to be added to the
@@ -839,13 +839,13 @@ void generateSkeleton(ProgramOptions const & options,
// taken from the configuration from Calc directly, this simplifies the
// add-in code
if (options.backwardcompatible) {
- checkType(manager, "com.sun.star.sheet.AddIn",
+ checkType(manager, u"com.sun.star.sheet.AddIn"_ustr,
interfaces, services, properties);
} else {
// special case for the optional XLocalization interface. It should be
// implemented always. But it is parent of the XAddIn and we need it only
// if backwardcompatible is false.
- interfaces.insert("com.sun.star.lang.XLocalizable");
+ interfaces.insert(u"com.sun.star.lang.XLocalizable"_ustr);
}
}
diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.cxx b/unodevtools/source/skeletonmaker/skeletoncommon.cxx
index 664bc90888aa..a2623b652e4e 100644
--- a/unodevtools/source/skeletonmaker/skeletoncommon.cxx
+++ b/unodevtools/source/skeletonmaker/skeletoncommon.cxx
@@ -188,7 +188,7 @@ void checkType(rtl::Reference< TypeManager > const & manager,
(ent2->getConstructors().size() == 1 &&
!ent2->getConstructors()[0].defaultConstructor))
{
- interfaceTypes.insert(OUString("com.sun.star.lang.XInitialization"));
+ interfaceTypes.insert(u"com.sun.star.lang.XInitialization"_ustr);
}
}
}
@@ -228,15 +228,15 @@ void checkDefaultInterfaces(
std::u16string_view propertyhelper)
{
if ( services.empty() ) {
- interfaces.erase("com.sun.star.lang.XServiceInfo");
+ interfaces.erase(u"com.sun.star.lang.XServiceInfo"_ustr);
} else {
- interfaces.insert("com.sun.star.lang.XServiceInfo");
+ interfaces.insert(u"com.sun.star.lang.XServiceInfo"_ustr);
}
if ( propertyhelper == u"_" ) {
- interfaces.erase("com.sun.star.beans.XPropertySet");
- interfaces.erase("com.sun.star.beans.XFastPropertySet");
- interfaces.erase("com.sun.star.beans.XPropertyAccess");
+ interfaces.erase(u"com.sun.star.beans.XPropertySet"_ustr);
+ interfaces.erase(u"com.sun.star.beans.XFastPropertySet"_ustr);
+ interfaces.erase(u"com.sun.star.beans.XPropertyAccess"_ustr);
}
}
@@ -314,7 +314,7 @@ OUString checkPropertyHelper(
++iter;
}
- return oldStyleWithProperties ? OUString("_") : OUString();
+ return oldStyleWithProperties ? u"_"_ustr : OUString();
}
static bool checkXComponentSupport(
@@ -349,7 +349,7 @@ bool checkXComponentSupport(rtl::Reference< TypeManager > const & manager,
for ( const auto& rIface : interfaces ) {
if ( rIface == "com.sun.star.lang.XComponent" ) {
- interfaces.erase("com.sun.star.lang.XComponent");
+ interfaces.erase(u"com.sun.star.lang.XComponent"_ustr);
return true;
}
if ( checkXComponentSupport(manager, rIface) )
@@ -467,13 +467,11 @@ static void checkAddInTypes(
+ " parameter of the calc add-in function '" + name
+ ":" + rMethod.name + "' is invalid."
+ (bLastAny
- ? OUString(
- " The type 'sequence<any>' is allowed as last"
- " parameter only.")
+ ? u" The type 'sequence<any>' is allowed as last"
+ " parameter only."_ustr
: OUString())
+ (bHasXPropertySet
- ? OUString(
- " The type 'XPropertySet' is allowed only once.")
+ ? u" The type 'XPropertySet' is allowed only once."_ustr
: OUString())
+ " Please check your IDL definition.");
}