targeted string re-work

Change-Id: Ia2115e70df8f64eb0dade6beb33ee64c358af767
This commit is contained in:
Norbert Thiebaud 2012-06-02 16:59:01 -05:00
parent 13aaac50bc
commit ea489b3570
4 changed files with 28 additions and 33 deletions

View File

@ -70,14 +70,14 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* pImplNa
if (sImplName.equalsAscii(MYLISTENER_IMPLEMENTATIONNAME))
{
css::uno::Sequence< ::rtl::OUString > lNames(1);
lNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MYLISTENER_IMPLEMENTATIONNAME));
lNames[0] = ::rtl::OUString(MYLISTENER_IMPLEMENTATIONNAME);
xFactory = ::cppu::createSingleFactory(xSMGR, sImplName, MyListener::st_createInstance, lNames);
}
else
if (sImplName.equalsAscii(MYPROTOCOLHANDLER_IMPLEMENTATIONNAME))
{
css::uno::Sequence< ::rtl::OUString > lNames(1);
lNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MYPROTOCOLHANDLER_SERVICENAME));
lNames[0] = ::rtl::OUString(MYPROTOCOLHANDLER_SERVICENAME);
xFactory = ::cppu::createSingleFactory(xSMGR, sImplName, MyProtocolHandler_createInstance, lNames);
}

View File

@ -154,8 +154,8 @@ void generateCompHelperDefinition(std::ostream & o,
short nbrackets = generateNamespace(o, implname, true, nm);
o << "::rtl::OUString SAL_CALL _getImplementationName() {\n"
<< " return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\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< "
@ -166,8 +166,7 @@ void generateCompHelperDefinition(std::ostream & o,
while (iter != services.end())
{
o << " s[" << i++ << "] = ::rtl::OUString("
<< "RTL_CONSTASCII_USTRINGPARAM(\n \""
<< (*iter).replace('/','.') << "\"));\n";
<< (*iter).replace('/','.') << "\");\n";
++iter;
}
o << " return s;\n}\n\n";
@ -524,21 +523,20 @@ void generateAddinConstructorAndHelper(std::ostream& o,
o << " css::uno::Reference< css::lang::XMultiServiceFactory > xProvider"
"(\n m_xContext->getServiceManager()->createInstanceWithContext"
"(\n ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\n "
" \"com.sun.star.configuration.ConfigurationProvider\")),"
"(\n ::rtl::OUString(\n "
" \"com.sun.star.configuration.ConfigurationProvider\"),"
"\n m_xContext ), css::uno::UNO_QUERY );\n\n";
o << " ::rtl::OUString sReadOnlyView(\n"
" RTL_CONSTASCII_USTRINGPARAM(\n"
" \"com.sun.star.configuration.ConfigurationAccess\"));\n\n";
" \"com.sun.star.configuration.ConfigurationAccess\");\n\n";
o << " ::rtl::OUStringBuffer sPath(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\n"
" \"/org.openoffice.Office.CalcAddIns/AddInInfo/\")));\n"
o << " ::rtl::OUStringBuffer sPath(::rtl::OUString(\n"
" \"/org.openoffice.Office.CalcAddIns/AddInInfo/\"));\n"
" sPath.appendAscii(sADDIN_SERVICENAME);\n"
" sPath.appendAscii(\"/AddInFunctions\");\n\n"
" // create arguments: nodepath\n"
" css::beans::PropertyValue aArgument;\n"
" aArgument.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\"nodepath\"));\n"
" aArgument.Name = ::rtl::OUString(\"nodepath\");\n"
" aArgument.Value <<= sPath.makeStringAndClear();\n\n"
" css::uno::Sequence< css::uno::Any > aArguments(1);\n"
" aArguments[0] <<= aArgument;\n\n";
@ -553,8 +551,8 @@ void generateAddinConstructorAndHelper(std::ostream& o,
o << " // extend arguments to create a view for all locales to get "
"simple\n // access to the compatibilityname property\n"
" aArgument.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\"locale\"));\n"
" aArgument.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\"*\"));\n"
" aArgument.Name = ::rtl::OUString(\"locale\");\n"
" aArgument.Value <<= ::rtl::OUString(\"*\");\n"
" aArguments.realloc(2);\n"
" aArguments[1] <<= aArgument;\n\n"
" // create view for all locales\n"
@ -578,7 +576,7 @@ void generateAddinConstructorAndHelper(std::ostream& o,
" m_xHAccess->getByHierarchicalName(\n"
" buf.makeStringAndClear()), css::uno::UNO_QUERY);\n"
" xPropSet->getPropertyValue(\n "
"::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(propName))) >>= ret;\n }\n"
"::rtl::OUString(propName)) >>= ret;\n }\n"
" catch ( const css::uno::RuntimeException & e ) {\n throw e;\n }\n"
" catch ( css::uno::Exception & ) {\n }\n return ret;\n";
}

View File

@ -328,11 +328,11 @@ void printSetPropertyMixinBody(std::ostream & o,
o << " v <<= " << buffer2.makeStringAndClear() << ";\n\n";
}
o << " prepareSet(\n rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\""
<< fieldname << "\")),\n css::uno::Any(), v, ";
o << " prepareSet(\n rtl::OUString(\""
<< fieldname << "\"),\n css::uno::Any(), v, ";
} else {
o << " prepareSet(\n rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\""
<< fieldname << "\")),\n css::uno::Any(), css::uno::Any(), ";
o << " prepareSet(\n rtl::OUString(\""
<< fieldname << "\"),\n css::uno::Any(), css::uno::Any(), ";
}
if (bound)
@ -421,8 +421,8 @@ void printMethods(std::ostream & o,
o << "// ::com::sun::star::lang::XServiceName:\n"
"::rtl::OUString SAL_CALL " << classname << "getServiceName() "
"throw (css::uno::RuntimeException)\n{\n "
"return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("
"sADDIN_SERVICENAME));\n}\n";
"return ::rtl::OUString("
"sADDIN_SERVICENAME);\n}\n";
generated.add(type);
return;
} else if (type.equals("com/sun/star/sheet/XAddIn")) {
@ -609,7 +609,7 @@ void printMethods(std::ostream & o,
o << ')';
printExceptionSpecification(o, options, manager, reader, method);
if (body) {
static OUString s(RTL_CONSTASCII_USTRINGPARAM("void"));
static OUString s("void");
if (defaultbody) {
o << "\n{\n";
if (!reader.getMethodReturnTypeName(method).equals(s)) {

View File

@ -402,8 +402,7 @@ OString checkPropertyHelper(
bool checkXComponentSupport(TypeManager const & manager,
typereg::Reader const & reader)
{
static OUString s(RTL_CONSTASCII_USTRINGPARAM(
"com/sun/star/lang/XComponent"));
static OUString s( "com/sun/star/lang/XComponent");
if ( reader.getTypeName().equals(s) )
return true;
@ -456,8 +455,7 @@ sal_uInt16 checkAdditionalPropertyFlags(typereg::Reader const & reader,
sal_uInt16 flags = 0;
bool getterSupportsUnknown = false;
OUString su(RTL_CONSTASCII_USTRINGPARAM(
"com/sun/star/beans/UnknownPropertyException"));
OUString su( "com/sun/star/beans/UnknownPropertyException");
if ( method < reader.getMethodCount()
&& reader.getMethodFlags(method) == RT_MODE_ATTRIBUTE_GET
&& reader.getMethodName(method) == reader.getFieldName(field) )
@ -477,8 +475,7 @@ sal_uInt16 checkAdditionalPropertyFlags(typereg::Reader const & reader,
&& reader.getMethodName(method) == reader.getFieldName(field) )
{
if ( reader.getMethodExceptionCount(method) > 0 ) {
OUString s(RTL_CONSTASCII_USTRINGPARAM(
"com/sun/star/beans/PropertyVetoException"));
OUString s( "com/sun/star/beans/PropertyVetoException");
for ( sal_uInt16 i = 0; i < reader.getMethodExceptionCount(method);
++i )
{
@ -670,9 +667,9 @@ void generateFunctionParamterMap(std::ostream& o,
for ( sal_uInt16 p = 0; p < reader.getMethodParameterCount(m); ++p ) {
if ( options.language == 2 ) {
o << " fpm[" << p
<< "] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\""
<< "] = ::rtl::OUString(\""
<< codemaker::convertString(reader.getMethodParameterName(m, p))
<< "\"));\n";
<< "\");\n";
}
else {
if ( options.java5 )
@ -689,8 +686,8 @@ void generateFunctionParamterMap(std::ostream& o,
}
if ( options.language == 2 ) {
o << " m_functionMap[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(\""
<< sMethod << "\"))] = fpm;\n\n";
o << " m_functionMap[::rtl::OUString(\""
<< sMethod << "\")] = fpm;\n\n";
}
else {
o << " m_functionMap.put(\"" << sMethod << "\", fpm);\n\n";