Kaydet (Commit) 102ae9f1 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

unodevtools: Use appropriate OUString functions on string constants

Change-Id: I70a86543c0269cbaeefc9cbe1da30c2ad7e48333
üst a11c6817
......@@ -51,7 +51,7 @@ void generateIncludes(std::ostream & o,
}
if (propertyhelper.getLength() > 1) {
if (propertyhelper.equals("_"))
if (propertyhelper == "_")
o << "#include \"cppuhelper/rpopshlp.hxx\"\n";
else
o << "#include \"cppuhelper/propertysetmixin.hxx\"\n";
......@@ -882,7 +882,7 @@ void generateMethodBodies(std::ostream& o,
std::set< OUString >::const_iterator iter = interfaces.begin();
codemaker::GeneratedTypeSet generated;
while (iter != interfaces.end()) {
if ( (*iter).equals("com.sun.star.lang.XServiceInfo") ) {
if ( *iter == "com.sun.star.lang.XServiceInfo" ) {
generateXServiceInfoBodies(o, name, comphelpernamespace);
generated.add(u2b(*iter));
} else {
......@@ -930,7 +930,7 @@ void generateQueryInterface(std::ostream& o,
} else {
o << "::queryInterface(type));\n";
o << " return a.hasValue() ? a\n : (";
if (propertyhelper.equals("_")) {
if (propertyhelper == "_") {
o << "::cppu::OPropertySetHelper::queryInterface(type));\n";
} else {
o << "::cppu::PropertySetMixin<\n ";
......@@ -1109,7 +1109,7 @@ void generateCalcAddin(ProgramOptions const & options,
// get the one and only add-in service for later use
std::set< OUString >::const_iterator iter2 = services.begin();
sAddinService = *iter2;
if (sAddinService.equals("com.sun.star.sheet.AddIn")) {
if (sAddinService == "com.sun.star.sheet.AddIn") {
sAddinService = *(++iter2);
}
......
......@@ -52,14 +52,14 @@ void generateImports(std::ostream & o, ProgramOptions const & options,
o << "import com.sun.star.registry.XRegistryKey;\n";
}
if (!propertyhelper.equals("_")) {
if (propertyhelper != "_") {
if (supportxcomponent)
o << "import com.sun.star.lib.uno.helper.ComponentBase;\n";
else
o << "import com.sun.star.lib.uno.helper.WeakBase;\n";
}
if (!propertyhelper.isEmpty()) {
if (propertyhelper.equals("_")) {
if (propertyhelper == "_") {
o << "import com.sun.star.lib.uno.helper.PropertySet;\n";
o << "import com.sun.star.beans.PropertyAttribute;\n";
} else {
......@@ -503,18 +503,18 @@ void generateMethodBodies(std::ostream& o,
while (iter != interfaces.end()) {
OUString type(*iter);
++iter;
if (type.equals("com.sun.star.lang.XServiceInfo")) {
if (type == "com.sun.star.lang.XServiceInfo") {
generateXServiceInfoBodies(o);
generated.add(u2b(type));
} else {
if (options.componenttype == 2) {
if (type.equals("com.sun.star.lang.XServiceName")) {
if (type == "com.sun.star.lang.XServiceName") {
o << " // com.sun.star.lang.XServiceName:\n"
" public String getServiceName() {\n"
" return sADDIN_SERVICENAME;\n }\n";
generated.add(u2b(type));
continue;
} else if (type.equals("com.sun.star.sheet.XAddIn")) {
} else if (type == "com.sun.star.sheet.XAddIn") {
generateXAddInBodies(o, options);
generated.add(u2b(type));
......@@ -524,26 +524,26 @@ void generateMethodBodies(std::ostream& o,
generated.add("com.sun.star.lang.XLocalizable");
}
continue;
} else if (type.equals("com.sun.star.lang.XLocalizable")) {
} else if (type == "com.sun.star.lang.XLocalizable") {
generateXLocalizableBodies(o);
generated.add(u2b(type));
continue;
} else if (type.equals("com.sun.star.sheet.XCompatibilityNames")) {
} else if (type == "com.sun.star.sheet.XCompatibilityNames") {
generateXCompatibilityNamesBodies(o);
generated.add(u2b(type));
continue;
}
}
if (options.componenttype == 3) {
if (type.equals("com.sun.star.lang.XInitialization")) {
if (type == "com.sun.star.lang.XInitialization") {
generateXInitializationBodies(o);
generated.add(u2b(type));
continue;
} else if (type.equals("com.sun.star.frame.XDispatch")) {
} else if (type == "com.sun.star.frame.XDispatch") {
generateXDispatchBodies(o, options);
generated.add(u2b(type));
continue;
} else if (type.equals("com.sun.star.frame.XDispatchProvider")) {
} else if (type == "com.sun.star.frame.XDispatchProvider") {
generateXDispatchProviderBodies(o, options);
generated.add(u2b(type));
continue;
......@@ -712,7 +712,7 @@ void generateClassDefinition(std::ostream& o,
o << "\n\npublic final class " << classname << " extends ";
if (!interfaces.empty()) {
if (propertyhelper.equals("_")) {
if (propertyhelper == "_") {
o << "PropertySet\n";
} else {
if (supportxcomponent)
......@@ -791,7 +791,7 @@ void generateClassDefinition(std::ostream& o,
} else {
o << "\n public " << classname << "( XComponentContext context )\n"
" {\n m_xContext = context;\n";
if (propertyhelper.equals("_")) {
if (propertyhelper == "_") {
registerProperties(o, properties, " ");
} else {
if (propertyhelper.getLength() > 1) {
......
......@@ -279,7 +279,7 @@ void checkDefaultInterfaces(
interfaces.insert("com.sun.star.lang.XServiceInfo");
}
if ( propertyhelper.equals("_") ) {
if ( propertyhelper == "_" ) {
interfaces.erase("com.sun.star.beans.XPropertySet");
interfaces.erase("com.sun.star.beans.XFastPropertySet");
interfaces.erase("com.sun.star.beans.XPropertyAccess");
......@@ -406,7 +406,7 @@ bool checkXComponentSupport(rtl::Reference< TypeManager > const & manager,
std::set< OUString >::const_iterator iter = interfaces.begin();
while ( iter != interfaces.end() ) {
if ( (*iter).equals("com.sun.star.lang.XComponent") ) {
if ( *iter == "com.sun.star.lang.XComponent" ) {
interfaces.erase("com.sun.star.lang.XComponent");
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment