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:
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(
FileStream & o, codemaker::cppumaker::Includes & includes)
{
......@@ -3480,24 +3491,16 @@ void ServiceType::dumpHxxFile(
<< ("} catch (const ::css::uno::Exception & the_exception) {\n");
inc();
o << indent()
<< ("throw ::css::uno::DeploymentException("
"::rtl::OUString( "
"\"component context fails to supply service \" ) + ")
<< "\"" << name_ << "\" + "
<< "\" of type \" + "
<< "\"" << baseName << "\" + "
<< "\": \" + the_exception.Message, the_context);\n";
<< "throw ::css::uno::DeploymentException("
<< failsToSupply(name_, baseName)
<< " + \": \" + the_exception.Message, the_context);\n";
dec();
o << indent() << "}\n" << indent()
<< "if (!the_instance.is()) {\n";
inc();
o << indent()
<< ("throw ::css::uno::DeploymentException("
"::rtl::OUString( "
"\"component context fails to supply service \" ) + ")
<< "\"" << name_ << "\" + "
<< "\" of type \" + "
<< "\"" << baseName << "\""
<< "throw ::css::uno::DeploymentException("
<< failsToSupply(name_, baseName)
<< ", the_context);\n";
dec();
o << indent() << "}\n" << indent() << "return the_instance;\n";
......@@ -3649,22 +3652,18 @@ void ServiceType::dumpHxxFile(
" the_exception) {\n");
inc();
o << indent()
<< ("throw ::css::uno::DeploymentException("
"::rtl::OUString( "
"\"component context fails to supply service ")
<< name_ << " of type " << baseName
<< ": \" ) + the_exception.Message, the_context);\n";
<< "throw ::css::uno::DeploymentException("
<< failsToSupply(name_, baseName)
<< " + \": \" + the_exception.Message, the_context);\n";
dec();
o << indent() << "}\n";
}
o << indent() << "if (!the_instance.is()) {\n";
inc();
o << indent()
<< ("throw ::css::uno::DeploymentException("
"::rtl::OUString( "
"\"component context fails to supply service ")
<< name_ << " of type " << baseName
<< "\" ), the_context);\n";
<< "throw ::css::uno::DeploymentException("
<< failsToSupply(name_, baseName)
<< ", the_context);\n";
dec();
o << indent() << "}\n" << indent() << "return the_instance;\n";
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