diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-07-01 15:45:52 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-07-01 15:45:52 +0200 |
commit | e50ef195bc95f3f410119f623928382cb88b45d2 (patch) | |
tree | 0897c005806c84d7e2add9f4a2d407ff4fe911a5 /unodevtools | |
parent | 363e39d63621b6c7017854ca5bb2f7668bb35846 (diff) |
New loplugin:stringconcat
Change-Id: Id7c517fb37bc28797c45fc0dde83e866f2aa4aac
Diffstat (limited to 'unodevtools')
5 files changed, 53 insertions, 55 deletions
diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx index 31a59ffed7ae..17b46cf41d2b 100644 --- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx @@ -40,7 +40,7 @@ void generateIncludes(std::ostream & o, o << "#include \"sal/config.h\"\n"; if (serviceobject) { o << "#include \"cppuhelper/factory.hxx\"\n" - << "#include \"cppuhelper/implementationentry.hxx\"\n"; + "#include \"cppuhelper/implementationentry.hxx\"\n"; } else { o << "#include \"com/sun/star/uno/XComponentContext.hpp\"\n"; } @@ -147,12 +147,12 @@ void generateCompHelperDefinition(std::ostream & o, short nbrackets = generateNamespace(o, implname, true, nm); o << "::rtl::OUString SAL_CALL _getImplementationName() {\n" - << " return ::rtl::OUString(\n" - << " \"" << implname << "\");\n}\n\n"; + " return ::rtl::OUString(\n" + " \"" << implname << "\");\n}\n\n"; o << "css::uno::Sequence< ::rtl::OUString > SAL_CALL " "_getSupportedServiceNames()\n{\n css::uno::Sequence< " - << "::rtl::OUString >" << " s(" << services.size() << ");\n"; + "::rtl::OUString > s(" << services.size() << ");\n"; std::set< OUString >::const_iterator iter = services.begin(); short i=0; @@ -165,9 +165,9 @@ void generateCompHelperDefinition(std::ostream & o, o << " return s;\n}\n\n"; o << "css::uno::Reference< css::uno::XInterface > SAL_CALL _create(" - << "\n const css::uno::Reference< css::uno::XComponentContext > & " - << "context)\n{\n" - << " return static_cast< ::cppu::OWeakObject * >(new " + "\n const css::uno::Reference< css::uno::XComponentContext > & " + "context)\n{\n" + " return static_cast< ::cppu::OWeakObject * >(new " << classname << "(context));\n}\n\n"; // close namepsace @@ -180,21 +180,21 @@ void generateCompHelperDefinition(std::ostream & o, void generateCompFunctions(std::ostream & o, const OString & nmspace) { o << "static ::cppu::ImplementationEntry const entries[] = {\n" - << " { &" << nmspace << "::_create,\n &" + " { &" << nmspace << "::_create,\n &" << nmspace << "::_getImplementationName,\n &" << nmspace << "::_getSupportedServiceNames,\n" - << " &::cppu::createSingleComponentFactory, 0, 0 },\n" - << " { 0, 0, 0, 0, 0, 0 }\n};\n\n"; + " &::cppu::createSingleComponentFactory, 0, 0 },\n" + " { 0, 0, 0, 0, 0, 0 }\n};\n\n"; o << "extern \"C\" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(\n" - << " const char * implName, void * serviceManager, void * registryKey)\n{\n" - << " return ::cppu::component_getFactoryHelper(\n" - << " implName, serviceManager, registryKey, entries);\n}\n\n"; + " const char * implName, void * serviceManager, void * registryKey)\n{\n" + " return ::cppu::component_getFactoryHelper(\n" + " implName, serviceManager, registryKey, entries);\n}\n\n"; o << "extern \"C\" sal_Bool SAL_CALL component_writeInfo(\n" - << " void * serviceManager, void * registryKey)\n{\n" - << " return ::cppu::component_writeInfoHelper(" - << "serviceManager, registryKey, entries);\n}\n"; + " void * serviceManager, void * registryKey)\n{\n" + " return ::cppu::component_writeInfoHelper(" + "serviceManager, registryKey, entries);\n}\n"; } void generateXPropertySetBodies(std::ostream& o, @@ -508,7 +508,7 @@ void generateAddinConstructorAndHelper(std::ostream& o, { o << classname << "::" << classname << "(css::uno::Reference< css::uno::XComponentContext > const & context) :\n" - << " m_xContext(context), m_locale()\n{\n"; + " m_xContext(context), m_locale()\n{\n"; if (options.backwardcompatible) { o << " try {\n"; @@ -631,7 +631,7 @@ OString generateClassDefinition(std::ostream& o, parentname.append("::cppu::WeakComponentImplHelper"); parentname.append(static_cast<sal_Int32>(interfaces.size())); o << " private ::cppu::BaseMutex,\n" - << " public ::cppu::WeakComponentImplHelper" + " public ::cppu::WeakComponentImplHelper" << interfaces.size() << "<"; } else { parentname.append("::cppu::WeakImplHelper"); @@ -657,8 +657,8 @@ OString generateClassDefinition(std::ostream& o, } o << "\n{\npublic:\n" - << " explicit " << classname << "(" - << "css::uno::Reference< css::uno::XComponentContext > const & context);\n\n"; + " explicit " << classname << "(" + "css::uno::Reference< css::uno::XComponentContext > const & context);\n\n"; // generate component/service helper functions // o << " // component and service helper functions:\n" @@ -706,9 +706,9 @@ OString generateClassDefinition(std::ostream& o, } o << "private:\n " << classname << "(const " << classname << " &); // not defined\n" - << " " << classname << "& operator=(const " << classname << " &); // not defined\n\n" - << " // destructor is private and will be called indirectly by the release call" - << " virtual ~" << classname << "() {}\n\n"; + " " << classname << "& operator=(const " << classname << " &); // not defined\n\n" + " // destructor is private and will be called indirectly by the release call" + " virtual ~" << classname << "() {}\n\n"; if (options.componenttype == 2) { o << " typedef boost::unordered_map< ::sal_Int32, rtl::OUString, " @@ -801,7 +801,7 @@ OString generateClassDefinition(std::ostream& o, if (propertyhelper.getLength() > 1) { o << " ::cppu::PropertySetMixin< " << scopedCppName(u2b(propertyhelper)) << " >(\n" - << " context, static_cast< Implements >(\n "; + " context, static_cast< Implements >(\n "; OStringBuffer buffer(128); if (propinterfaces.find("com/sun/star/beans/XPropertySet") != propinterfaces.end()) { @@ -851,22 +851,22 @@ void generateXServiceInfoBodies(std::ostream& o, OString const & comphelpernamespace) { o << "// com.sun.star.uno.XServiceInfo:\n" - << "::rtl::OUString SAL_CALL " << classname << "getImplementationName() " - << "throw (css::uno::RuntimeException)\n{\n " - << "return " << comphelpernamespace << "::_getImplementationName();\n}\n\n"; + "::rtl::OUString SAL_CALL " << classname << "getImplementationName() " + "throw (css::uno::RuntimeException)\n{\n " + "return " << comphelpernamespace << "::_getImplementationName();\n}\n\n"; o << "sal_Bool SAL_CALL " << classname << "supportsService(::rtl::OUString const & " - << "serviceName) throw (css::uno::RuntimeException)\n{\n " - << "css::uno::Sequence< ::rtl::OUString > serviceNames = " + "serviceName) throw (css::uno::RuntimeException)\n{\n " + "css::uno::Sequence< ::rtl::OUString > serviceNames = " << comphelpernamespace << "::_getSupportedServiceNames();\n " - << "for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {\n " - << " if (serviceNames[i] == serviceName)\n return sal_True;\n" - << " }\n return sal_False;\n}\n\n"; + "for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {\n " + " if (serviceNames[i] == serviceName)\n return sal_True;\n" + " }\n return sal_False;\n}\n\n"; o << "css::uno::Sequence< ::rtl::OUString > SAL_CALL " << classname << "getSupportedServiceNames() throw (css::uno::RuntimeException)\n{\n " - << "return " << comphelpernamespace + "return " << comphelpernamespace << "::_getSupportedServiceNames();\n}\n\n"; } diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx b/unodevtools/source/skeletonmaker/cpptypemaker.cxx index 0a587c359cfe..b36ab800b0bc 100644 --- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx +++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx @@ -386,8 +386,7 @@ void printSetPropertyMixinBody( o << " css::uno::Any v;\n"; if (optional) { - o << " if(" << buffer1.makeStringAndClear() << ")\n {\n" - << " v <<= " << buffer2.makeStringAndClear() << ";\n }\n"; + o << " if(" << buffer1.makeStringAndClear() << ")\n {\n v <<= " << buffer2.makeStringAndClear() << ";\n }\n"; } else { o << " v <<= " << buffer2.makeStringAndClear() << ";\n\n"; } diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx index 1777dab117fd..3c1733acbe83 100644 --- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx @@ -96,17 +96,17 @@ void generateXServiceInfoBodies(std::ostream& o) { o << " // com.sun.star.lang.XServiceInfo:\n"; o << " public String getImplementationName() {\n" - << " return m_implementationName;\n }\n\n"; + " return m_implementationName;\n }\n\n"; o << " public boolean supportsService( String sService ) {\n" - << " int len = m_serviceNames.length;\n\n" - << " for( int i=0; i < len; i++) {\n" - << " if (sService.equals(m_serviceNames[i]))\n" - << " return true;\n" - << " }\n return false;\n }\n\n"; + " int len = m_serviceNames.length;\n\n" + " for( int i=0; i < len; i++) {\n" + " if (sService.equals(m_serviceNames[i]))\n" + " return true;\n" + " }\n return false;\n }\n\n"; o << " public String[] getSupportedServiceNames() {\n" - << " return m_serviceNames;\n }\n\n"; + " return m_serviceNames;\n }\n\n"; } void generateXPropertySetBodies(std::ostream& o) @@ -798,7 +798,7 @@ void generateClassDefinition(std::ostream& o, if (propertyhelper.getLength() > 1) { o << propcomment << " m_prophlp = new PropertySetMixin(m_xContext, this,\n" - << " new Type(" << propertyhelper + " new Type(" << propertyhelper << ".class), null);\n"; } } diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx b/unodevtools/source/skeletonmaker/javatypemaker.cxx index 50244b10eda5..9e1357073c75 100644 --- a/unodevtools/source/skeletonmaker/javatypemaker.cxx +++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx @@ -540,8 +540,7 @@ void printMethods(std::ostream & o, if ( defaultbody ) { o << "\n" << indentation << "{\n"; if (i->returnType != "void") { - o << indentation << " // TODO: Exchange the default return " - << "implementation for \"" << i->name << "\" !!!\n"; + o << indentation << " // TODO: Exchange the default return implementation for \"" << i->name << "\" !!!\n"; o << indentation << " // NOTE: " "Default initialized polymorphic structs can cause problems" "\n" << indentation << " // because of missing default " @@ -664,7 +663,7 @@ void printMapsToJavaType( codemaker::UnoType::Sort sort, OUString const & nucleus, sal_Int32 rank, std::vector< OUString > const & arguments, const char * javaTypeSort) { - o << "maps to Java " << "1.5" << " "; + o << "maps to Java 1.5 "; if (javaTypeSort != 0) { o << javaTypeSort << ' '; } diff --git a/unodevtools/source/skeletonmaker/skeletonmaker.cxx b/unodevtools/source/skeletonmaker/skeletonmaker.cxx index b2d54618e3a0..17f63077c1f8 100644 --- a/unodevtools/source/skeletonmaker/skeletonmaker.cxx +++ b/unodevtools/source/skeletonmaker/skeletonmaker.cxx @@ -104,15 +104,15 @@ void printUsageAndExit(const char* programname, const char* version) { std::cerr << "\n using: " << programname << "\n" - << " dump [<options>] -t <type> ...\n" - << " " << programname << "\n" - << " component [<options>] -n <name> -t <type> ...\n" - << " " << programname << "\n" - << " calc-add-in [<options>] -n <name> -t <add-in_service>\n" - << " " << programname << "\n" - << " add-on [<options>] -n <name> -p <protocol_name:command,...>\n" - << " " << programname << " -V, --version\n" - << " " << programname << " -h, --help\n" + " dump [<options>] -t <type> ...\n" + " " << programname << "\n" + " component [<options>] -n <name> -t <type> ...\n" + " " << programname << "\n" + " calc-add-in [<options>] -n <name> -t <add-in_service>\n" + " " << programname << "\n" + " add-on [<options>] -n <name> -p <protocol_name:command,...>\n" + " " << programname << " -V, --version\n" + " " << programname << " -h, --help\n" << usageText << programname << " Version " << version << "\n\n"; } |