Extended loplugin:ostr: unodevtools

Change-Id: If72d80bd748186b974b37d58aa1469af1ffdb34d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159667
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2023-11-19 13:24:45 +01:00
parent db9104a366
commit a0d6538341
4 changed files with 17 additions and 17 deletions

View File

@@ -679,7 +679,7 @@ static OString generateClassDefinition(std::ostream& o,
codemaker::GeneratedTypeSet generated; codemaker::GeneratedTypeSet generated;
for (const auto& rIface : interfaces) for (const auto& rIface : interfaces)
{ {
printMethods(o, options, manager, rIface, generated, "", "", " ", printMethods(o, options, manager, rIface, generated, ""_ostr, ""_ostr, " "_ostr,
true, propertyhelper); true, propertyhelper);
} }
@@ -864,8 +864,8 @@ static void generateMethodBodies(std::ostream& o,
generateXServiceInfoBodies(o, name, comphelpernamespace); generateXServiceInfoBodies(o, name, comphelpernamespace);
generated.add(u2b(rIface)); generated.add(u2b(rIface));
} else { } else {
printMethods(o, options, manager, rIface, generated, "_", printMethods(o, options, manager, rIface, generated, "_"_ostr,
name, "", true, propertyhelper); name, ""_ostr, true, propertyhelper);
} }
} }
} }
@@ -971,7 +971,7 @@ void generateSkeleton(ProgramOptions const & options,
OString compFileName; OString compFileName;
OString tmpFileName; OString tmpFileName;
std::ostream* pofs = nullptr; std::ostream* pofs = nullptr;
bool standardout = getOutputStream(options, ".cxx", bool standardout = getOutputStream(options, ".cxx"_ostr,
&pofs, compFileName, tmpFileName); &pofs, compFileName, tmpFileName);
try { try {
@@ -1129,7 +1129,7 @@ void generateCalcAddin(ProgramOptions const & options,
OString compFileName; OString compFileName;
OString tmpFileName; OString tmpFileName;
std::ostream* pofs = nullptr; std::ostream* pofs = nullptr;
bool standardout = getOutputStream(options, ".cxx", bool standardout = getOutputStream(options, ".cxx"_ostr,
&pofs, compFileName, tmpFileName); &pofs, compFileName, tmpFileName);
try { try {

View File

@@ -415,7 +415,7 @@ void printMethods(std::ostream & o,
return; return;
} }
static OString sd("_"); static OString sd("_"_ostr);
bool body = !delegate.isEmpty(); bool body = !delegate.isEmpty();
bool defaultbody = delegate == sd; bool defaultbody = delegate == sd;
@@ -452,9 +452,9 @@ void printMethods(std::ostream & o,
generated.add(u2b(name)); generated.add(u2b(name));
// special handling of XLocalizable -> parent of XAddIn // special handling of XLocalizable -> parent of XAddIn
if (!generated.contains("com.sun.star.lang.XLocalizable")) { if (!generated.contains("com.sun.star.lang.XLocalizable"_ostr)) {
generateXLocalizable(o, classname); generateXLocalizable(o, classname);
generated.add("com.sun.star.lang.XLocalizable"); generated.add("com.sun.star.lang.XLocalizable"_ostr);
} }
return; return;
} else if (name == "com.sun.star.lang.XLocalizable") { } else if (name == "com.sun.star.lang.XLocalizable") {
@@ -853,7 +853,7 @@ void generateDocumentation(std::ostream & o,
codemaker::GeneratedTypeSet generated; codemaker::GeneratedTypeSet generated;
printMethods( printMethods(
o, options, manager, nucleus, generated, delegate, o, options, manager, nucleus, generated, delegate,
options.implname, ""); options.implname, ""_ostr);
} }
break; break;

View File

@@ -509,9 +509,9 @@ static void generateMethodBodies(std::ostream& o,
generated.add(u2b(type)); generated.add(u2b(type));
// special handling of XLocalizable -> parent of XAddIn // special handling of XLocalizable -> parent of XAddIn
if (!generated.contains("com.sun.star.lang.XLocalizable")) { if (!generated.contains("com.sun.star.lang.XLocalizable"_ostr)) {
generateXLocalizableBodies(o); generateXLocalizableBodies(o);
generated.add("com.sun.star.lang.XLocalizable"); generated.add("com.sun.star.lang.XLocalizable"_ostr);
} }
continue; continue;
} else if (type == "com.sun.star.lang.XLocalizable") { } else if (type == "com.sun.star.lang.XLocalizable") {
@@ -539,7 +539,7 @@ static void generateMethodBodies(std::ostream& o,
continue; continue;
} }
} }
printMethods(o, options, manager, type, generated, "_", printMethods(o, options, manager, type, generated, "_"_ostr,
indentation, true, usepropertymixin); indentation, true, usepropertymixin);
} }
} }
@@ -776,7 +776,7 @@ static void generateClassDefinition(std::ostream& o,
o << "\n public " << classname << "( XComponentContext context )\n" o << "\n public " << classname << "( XComponentContext context )\n"
" {\n m_xContext = context;\n"; " {\n m_xContext = context;\n";
if (propertyhelper == "_") { if (propertyhelper == "_") {
registerProperties(o, properties, " "); registerProperties(o, properties, " "_ostr);
} else { } else {
if (propertyhelper.getLength() > 1) { if (propertyhelper.getLength() > 1) {
o << propcomment o << propcomment
@@ -793,7 +793,7 @@ static void generateClassDefinition(std::ostream& o,
generateCompFunctions(o, classname); generateCompFunctions(o, classname);
generateMethodBodies(o, options, manager, interfaces, generateMethodBodies(o, options, manager, interfaces,
" ", propertyhelper.getLength() > 1); " "_ostr, propertyhelper.getLength() > 1);
// end of class definition // end of class definition
o << "}\n"; o << "}\n";
@@ -869,7 +869,7 @@ void generateSkeleton(ProgramOptions const & options,
OString compFileName; OString compFileName;
OString tmpFileName; OString tmpFileName;
std::ostream* pofs = nullptr; std::ostream* pofs = nullptr;
bool standardout = getOutputStream(options, ".java", bool standardout = getOutputStream(options, ".java"_ostr,
&pofs, compFileName, tmpFileName); &pofs, compFileName, tmpFileName);
try { try {

View File

@@ -422,7 +422,7 @@ void printMethods(std::ostream & o,
} }
} }
static OString sd("_"); static OString sd("_"_ostr);
bool body = !delegate.isEmpty(); bool body = !delegate.isEmpty();
bool defaultbody = delegate == sd; bool defaultbody = delegate == sd;
@@ -752,7 +752,7 @@ void generateDocumentation(std::ostream & o,
o << "; " << (options.all ? "all" : "direct") << " methods:\n"; o << "; " << (options.all ? "all" : "direct") << " methods:\n";
codemaker::GeneratedTypeSet generated; codemaker::GeneratedTypeSet generated;
printMethods( printMethods(
o, options, manager, nucleus, generated, delegate, ""); o, options, manager, nucleus, generated, delegate, ""_ostr);
} }
break; break;