Kaydet (Commit) 2188a7ac authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Reduce the amount of strings in the release builds.

I guess even in the debug builds these strings do not add much info, but...

Change-Id: I5cf765539a821513b5ce77c5484071d181459881
üst 141a87dd
...@@ -3344,6 +3344,17 @@ private: ...@@ -3344,6 +3344,17 @@ private:
rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > entity_; rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > entity_;
}; };
static OUString failsToSupply(const OUString& name_, const OString& baseName)
{
return OUString(
"\n"
"#if OSL_DEBUG_LEVEL > 0\n"
" ::rtl::OUString(\"component context fails to supply service '" + name_ + "' of type '" + OStringToOUString(baseName, RTL_TEXTENCODING_UTF8) + "'\")\n"
"#else\n"
" ::rtl::OUString(\"service not supplied\")\n"
"#endif\n");
}
void ServiceType::dumpHxxFile( void ServiceType::dumpHxxFile(
FileStream & o, codemaker::cppumaker::Includes & includes) FileStream & o, codemaker::cppumaker::Includes & includes)
{ {
...@@ -3480,24 +3491,16 @@ void ServiceType::dumpHxxFile( ...@@ -3480,24 +3491,16 @@ void ServiceType::dumpHxxFile(
<< ("} catch (const ::css::uno::Exception & the_exception) {\n"); << ("} catch (const ::css::uno::Exception & the_exception) {\n");
inc(); inc();
o << indent() o << indent()
<< ("throw ::css::uno::DeploymentException(" << "throw ::css::uno::DeploymentException("
"::rtl::OUString( " << failsToSupply(name_, baseName)
"\"component context fails to supply service \" ) + ") << " + \": \" + the_exception.Message, the_context);\n";
<< "\"" << name_ << "\" + "
<< "\" of type \" + "
<< "\"" << baseName << "\" + "
<< "\": \" + the_exception.Message, the_context);\n";
dec(); dec();
o << indent() << "}\n" << indent() o << indent() << "}\n" << indent()
<< "if (!the_instance.is()) {\n"; << "if (!the_instance.is()) {\n";
inc(); inc();
o << indent() o << indent()
<< ("throw ::css::uno::DeploymentException(" << "throw ::css::uno::DeploymentException("
"::rtl::OUString( " << failsToSupply(name_, baseName)
"\"component context fails to supply service \" ) + ")
<< "\"" << name_ << "\" + "
<< "\" of type \" + "
<< "\"" << baseName << "\""
<< ", the_context);\n"; << ", the_context);\n";
dec(); dec();
o << indent() << "}\n" << indent() << "return the_instance;\n"; o << indent() << "}\n" << indent() << "return the_instance;\n";
...@@ -3649,22 +3652,18 @@ void ServiceType::dumpHxxFile( ...@@ -3649,22 +3652,18 @@ void ServiceType::dumpHxxFile(
" the_exception) {\n"); " the_exception) {\n");
inc(); inc();
o << indent() o << indent()
<< ("throw ::css::uno::DeploymentException(" << "throw ::css::uno::DeploymentException("
"::rtl::OUString( " << failsToSupply(name_, baseName)
"\"component context fails to supply service ") << " + \": \" + the_exception.Message, the_context);\n";
<< name_ << " of type " << baseName
<< ": \" ) + the_exception.Message, the_context);\n";
dec(); dec();
o << indent() << "}\n"; o << indent() << "}\n";
} }
o << indent() << "if (!the_instance.is()) {\n"; o << indent() << "if (!the_instance.is()) {\n";
inc(); inc();
o << indent() o << indent()
<< ("throw ::css::uno::DeploymentException(" << "throw ::css::uno::DeploymentException("
"::rtl::OUString( " << failsToSupply(name_, baseName)
"\"component context fails to supply service ") << ", the_context);\n";
<< name_ << " of type " << baseName
<< "\" ), the_context);\n";
dec(); dec();
o << indent() << "}\n" << indent() << "return the_instance;\n"; o << indent() << "}\n" << indent() << "return the_instance;\n";
dec(); dec();
......
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