Kaydet (Commit) 84662e90 authored tarafından Mike Kaganski's avatar Mike Kaganski

Get rid of b2u/u2b helpers; use OUString's toUtf8/fromUtf8 instead

These helpers are used in code generator code; so any invalid UTF-8
or UTF-16 in the conversion is programmer's error which needs fixing.
Thus, the behavior of toUtf8/fromUtf8 which asserts the validity is
fine here.

Change-Id: I3004e233c9de59f8e348455f1f04d23e8c51ed3d
Reviewed-on: https://gerrit.libreoffice.org/70249
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 3c6c56b1
......@@ -55,12 +55,10 @@ void ExceptionTree::add(
}
list.push_back(n);
rtl::Reference< unoidl::Entity > ent;
codemaker::UnoType::Sort s = manager->getSort(b2u(n), &ent);
codemaker::UnoType::Sort s = manager->getSort(OUString::fromUtf8(n), &ent);
(void) s; // WaE: unused variable
assert(s == codemaker::UnoType::Sort::Exception);
n = u2b(
static_cast< unoidl::ExceptionTypeEntity * >(ent.get())->
getDirectBase());
n = static_cast<unoidl::ExceptionTypeEntity*>(ent.get())->getDirectBase().toUtf8();
assert(!n.isEmpty());
}
if (!bRuntimeException) {
......
......@@ -164,7 +164,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
{
sal_Int32 k;
std::vector< OString > args;
OUString n = b2u(codemaker::UnoType::decompose(u2b(name), &k, &args));
OUString n = OUString::fromUtf8(codemaker::UnoType::decompose(name.toUtf8(), &k, &args));
for (;;) {
rtl::Reference< unoidl::Entity > ent;
codemaker::UnoType::Sort s = getSort(n, &ent);
......@@ -238,7 +238,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
arguments->clear();
for (const OString& rArg : args)
{
arguments->push_back(b2u(rArg));
arguments->push_back(OUString::fromUtf8(rArg));
}
}
if (entity != nullptr) {
......
......@@ -79,8 +79,7 @@ OString translateUnoToCppType(
{
buf.append("::css::uno::XInterface");
} else {
//TODO: check that nucleus is a valid (UTF-8) identifier
buf.append(u2b(nucleus));
buf.append(nucleus.toUtf8()); // nucleus must be a valid UTF-16
}
}
return buf.makeStringAndClear();
......
......@@ -54,7 +54,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
}
codemaker::GeneratedTypeSet generated;
if (options.isValid("-T")) {
OUString names(b2u(options.getOption("-T")));
OUString names(OUString::fromUtf8(options.getOption("-T")));
for (sal_Int32 i = 0; i != -1;) {
OUString name(names.getToken(0, ';', i));
if (!name.isEmpty()) {
......
......@@ -215,7 +215,7 @@ Dependencies::~Dependencies() {}
void Dependencies::insert(OUString const & name, Kind kind) {
sal_Int32 k;
std::vector< OString > args;
OUString n(b2u(UnoType::decompose(u2b(name), &k, &args)));
OUString n(OUString::fromUtf8(UnoType::decompose(name.toUtf8(), &k, &args)));
if (k != 0) {
m_sequenceDependency = true;
}
......@@ -266,7 +266,7 @@ void Dependencies::insert(OUString const & name, Kind kind) {
case UnoType::Sort::PolymorphicStructTemplate:
for (const OString& arg : args)
{
insert(b2u(arg), KIND_NORMAL);
insert(OUString::fromUtf8(arg), KIND_NORMAL);
}
[[fallthrough]];
case UnoType::Sort::Sequence:
......
......@@ -71,7 +71,7 @@ Includes::~Includes()
void Includes::add(OString const & entityName) {
sal_Int32 k;
std::vector< OString > args;
OUString n(b2u(codemaker::UnoType::decompose(entityName, &k, &args)));
OUString n(OUString::fromUtf8(codemaker::UnoType::decompose(entityName, &k, &args)));
if (k != 0) {
m_includeSequence = true;
}
......@@ -115,7 +115,7 @@ void Includes::add(OString const & entityName) {
break;
default:
throw CannotDumpException(
"unexpected type \"" + b2u(entityName)
"unexpected type \"" + OUString::fromUtf8(entityName)
+ "\" in call to codemaker::cppumaker::Includes::add");
}
}
......@@ -139,7 +139,7 @@ void Includes::dump(
if (!m_includeReference) {
for (const auto& pair : m_map)
{
if (isInterfaceType(u2b(pair.first))) {
if (isInterfaceType(pair.first.toUtf8())) {
m_includeReference = true;
break;
}
......@@ -151,7 +151,7 @@ void Includes::dump(
}
if (companionHdl) {
out << "\n";
dumpInclude(out, u2b(*companionHdl), false);
dumpInclude(out, companionHdl->toUtf8(), false);
}
bool first = true;
for (const auto& pair : m_map)
......@@ -159,11 +159,11 @@ void Includes::dump(
if (exceptions || pair.second != Dependencies::KIND_EXCEPTION) {
dumpEmptyLineBeforeFirst(out, &first);
if (m_hpp || pair.second == Dependencies::KIND_BASE
|| !isInterfaceType(u2b(pair.first)))
|| !isInterfaceType(pair.first.toUtf8()))
{
// If we know our name, then avoid including ourselves.
if (!companionHdl || *companionHdl != pair.first) {
dumpInclude(out, u2b(pair.first), m_hpp);
dumpInclude(out, pair.first.toUtf8(), m_hpp);
}
} else {
bool ns = dumpNamespaceOpen(out, pair.first, false);
......@@ -264,7 +264,7 @@ void Includes::dumpInclude(
}
bool Includes::isInterfaceType(OString const & entityName) const {
return m_manager->getSort(b2u(entityName)) == UnoType::Sort::Interface;
return m_manager->getSort(OUString::fromUtf8(entityName)) == UnoType::Sort::Interface;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -54,7 +54,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
}
codemaker::GeneratedTypeSet generated;
if (options.isValid("-T")) {
OUString names(b2u(options.getOption("-T")));
OUString names(OUString::fromUtf8(options.getOption("-T")));
for (sal_Int32 i = 0; i != -1;) {
OUString name(names.getToken(0, ';', i));
if (!name.isEmpty()) {
......
......@@ -613,7 +613,7 @@ void writeClassFile(
tempfile.createTempFile(getTempDir(filename));
if (!tempfile.isValid()) {
throw CannotDumpException(
"Cannot create temporary file for " + b2u(filename));
"Cannot create temporary file for " + OUString::fromUtf8(filename));
}
OString tempname(tempfile.getName());
try {
......@@ -630,8 +630,8 @@ void writeClassFile(
tempfile.close();
if (!makeValidTypeFile(filename, tempname, bCheck)) {
throw CannotDumpException(
"Cannot create " + b2u(filename) + " from temporary file "
+ b2u(tempname));
"Cannot create " + OUString::fromUtf8(filename) + " from temporary file "
+ OUString::fromUtf8(tempname));
}
}
......@@ -2442,10 +2442,10 @@ void produce(
OUString const & name, rtl::Reference< TypeManager > const & manager,
codemaker::GeneratedTypeSet & generated, JavaOptions const & options)
{
if (generated.contains(u2b(name))) {
if (generated.contains(name.toUtf8())) {
return;
}
generated.add(u2b(name));
generated.add(name.toUtf8());
if (!manager->foundAtPrimaryProvider(name)) {
return;
}
......
......@@ -62,15 +62,6 @@ private:
std::vector< rtl::Reference< unoidl::Provider > > primaryProviders_;
};
inline OString u2b(OUString const & s) {
return OUStringToOString(s, RTL_TEXTENCODING_UTF8);
}
inline OUString b2u(OString const & s) {
return OStringToOUString(s, RTL_TEXTENCODING_UTF8);
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -625,7 +625,7 @@ static OString generateClassDefinition(std::ostream& o,
std::set< OUString >::const_iterator iter = interfaces.begin();
while (iter != interfaces.end())
{
o << "\n " << scopedCppName(u2b(*iter));
o << "\n " << scopedCppName(iter->toUtf8());
++iter;
if (iter != interfaces.end())
o << ",";
......@@ -636,7 +636,7 @@ static OString generateClassDefinition(std::ostream& o,
if (propertyhelper.getLength() > 1) {
o << ",\n public ::cppu::PropertySetMixin< "
<< scopedCppName(u2b(propertyhelper)) << " >";
<< scopedCppName(propertyhelper.toUtf8()) << " >";
}
o << "\n{\npublic:\n"
......@@ -665,7 +665,7 @@ static OString generateClassDefinition(std::ostream& o,
std::set< OUString >::const_iterator iter = interfaces.begin();
while (iter != interfaces.end())
{
buffer.append(scopedCppName(u2b(*iter)));
buffer.append(scopedCppName(iter->toUtf8()));
++iter;
if (iter != interfaces.end())
buffer.append(", ");
......@@ -771,7 +771,7 @@ static OString generateClassDefinition(std::ostream& o,
o << " ::cppu::WeakComponentImplHelper" << interfaces.size() << "<";
std::set< OUString >::const_iterator iter = interfaces.begin();
while (iter != interfaces.end()) {
o << "\n " << scopedCppName(u2b(*iter));
o << "\n " << scopedCppName(iter->toUtf8());
++iter;
if (iter != interfaces.end())
o << ",";
......@@ -781,7 +781,7 @@ static OString generateClassDefinition(std::ostream& o,
}
if (propertyhelper.getLength() > 1) {
o << " ::cppu::PropertySetMixin< "
<< scopedCppName(u2b(propertyhelper)) << " >(\n"
<< scopedCppName(propertyhelper.toUtf8()) << " >(\n"
" context, static_cast< Implements >(\n ";
OStringBuffer buffer(128);
if (propinterfaces.find("com/sun/star/beans/XPropertySet")
......@@ -865,7 +865,7 @@ static void generateMethodBodies(std::ostream& o,
for (const auto& rIface : interfaces) {
if ( rIface == "com.sun.star.lang.XServiceInfo" ) {
generateXServiceInfoBodies(o, name, comphelpernamespace);
generated.add(u2b(rIface));
generated.add(rIface.toUtf8());
} else {
printMethods(o, options, manager, rIface, generated, "_",
name, "", true, propertyhelper);
......@@ -897,7 +897,7 @@ static void generateQueryInterface(std::ostream& o,
std::set< OUString >::const_iterator iter = interfaces.begin();
while (iter != interfaces.end())
{
o << "\n " << scopedCppName(u2b(*iter));
o << "\n " << scopedCppName(iter->toUtf8());
++iter;
if (iter != interfaces.end())
o << ",";
......@@ -940,7 +940,7 @@ void generateSkeleton(ProgramOptions const & options,
bool supportxcomponent = false;
for (const auto& rType : types) {
checkType(manager, b2u(rType), interfaces, services, properties);
checkType(manager, OUString::fromUtf8(rType), interfaces, services, properties);
}
if (options.componenttype == 3) {
......@@ -1071,7 +1071,7 @@ void generateCalcAddin(ProgramOptions const & options,
for (const auto& rType : types) {
checkType(manager, b2u(rType), interfaces, services, properties);
checkType(manager, OUString::fromUtf8(rType), interfaces, services, properties);
}
OUString sAddinService;
......
......@@ -168,7 +168,7 @@ static bool printConstructorParameters(
printType(o, options, manager, rMember.type, 4);
o << ' '
<< codemaker::cpp::translateUnoToCppIdentifier(
u2b(rMember.name), "param");
rMember.name.toUtf8(), "param");
}
break;
}
......@@ -191,7 +191,7 @@ static bool printConstructorParameters(
}
o << ' '
<< codemaker::cpp::translateUnoToCppIdentifier(
u2b(rMember.name), "param");
rMember.name.toUtf8(), "param");
}
break;
}
......@@ -218,7 +218,7 @@ static bool printConstructorParameters(
}
o << ' '
<< codemaker::cpp::translateUnoToCppIdentifier(
u2b(rMember.name), "param");
rMember.name.toUtf8(), "param");
}
break;
}
......@@ -244,7 +244,7 @@ static bool printConstructorParameters(
printType(o, options, manager, rMember.type, 4);
o << ' '
<< codemaker::cpp::translateUnoToCppIdentifier(
u2b(rMember.name), "param");
rMember.name.toUtf8(), "param");
}
break;
}
......@@ -295,7 +295,7 @@ static void printMethodParameters(
printType(o, options, manager, i->type, referenceType);
o << ' ';
}
o << codemaker::cpp::translateUnoToCppIdentifier(u2b(i->name), "param");
o << codemaker::cpp::translateUnoToCppIdentifier(i->name.toUtf8(), "param");
}
}
......@@ -405,7 +405,7 @@ void printMethods(std::ostream & o,
OString const & indentation, bool defaultvalue,
OUString const & propertyhelper)
{
if (generated.contains(u2b(name)) || name == "com.sun.star.uno.XInterface" ||
if (generated.contains(name.toUtf8()) || name == "com.sun.star.uno.XInterface" ||
(defaultvalue &&
( name == "com.sun.star.lang.XComponent" ||
name == "com.sun.star.lang.XTypeProvider" ||
......@@ -420,19 +420,19 @@ void printMethods(std::ostream & o,
if (body && propertyhelper.getLength() > 1) {
if (name == "com.sun.star.beans.XPropertySet") {
generated.add(u2b(name));
generated.add(name.toUtf8());
generateXPropertySetBodies(
o, classname, scopedCppName(u2b(propertyhelper)));
o, classname, scopedCppName(propertyhelper.toUtf8()));
return;
} else if (name == "com.sun.star.beans.XFastPropertySet") {
generated.add(u2b(name));
generated.add(name.toUtf8());
generateXFastPropertySetBodies(
o, classname, scopedCppName(u2b(propertyhelper)));
o, classname, scopedCppName(propertyhelper.toUtf8()));
return;
} else if (name == "com.sun.star.beans.XPropertyAccess") {
generated.add(u2b(name));
generated.add(name.toUtf8());
generateXPropertyAccessBodies(
o, classname, scopedCppName(u2b(propertyhelper)));
o, classname, scopedCppName(propertyhelper.toUtf8()));
return;
}
}
......@@ -444,11 +444,11 @@ void printMethods(std::ostream & o,
"throw (css::uno::RuntimeException)\n{\n "
"return OUString("
"sADDIN_SERVICENAME);\n}\n";
generated.add(u2b(name));
generated.add(name.toUtf8());
return;
} else if (name == "com.sun.star.sheet.XAddIn") {
generateXAddInBodies(o, classname);
generated.add(u2b(name));
generated.add(name.toUtf8());
// special handling of XLocalizable -> parent of XAddIn
if (!generated.contains("com.sun.star.lang.XLocalizable")) {
......@@ -458,11 +458,11 @@ void printMethods(std::ostream & o,
return;
} else if (name == "com.sun.star.lang.XLocalizable") {
generateXLocalizable(o, classname);
generated.add(u2b(name));
generated.add(name.toUtf8());
return;
} else if (name == "com.sun.star.sheet.XCompatibilityNames") {
generateXCompatibilityNamesBodies(o, classname);
generated.add(u2b(name));
generated.add(name.toUtf8());
return;
}
}
......@@ -470,20 +470,20 @@ void printMethods(std::ostream & o,
if (body && options.componenttype == 3) {
if (name == "com.sun.star.lang.XInitialization") {
generateXInitialization(o, classname);
generated.add(u2b(name));
generated.add(name.toUtf8());
return;
} else if (name == "com.sun.star.frame.XDispatch") {
generateXDispatch(o, classname, options.protocolCmdMap);
generated.add(u2b(name));
generated.add(name.toUtf8());
return;
} else if (name == "com.sun.star.frame.XDispatchProvider") {
generateXDispatchProvider(o, classname, options.protocolCmdMap);
generated.add(u2b(name));
generated.add(name.toUtf8());
return;
}
}
generated.add(u2b(name));
generated.add(name.toUtf8());
rtl::Reference< unoidl::Entity > ent;
if (manager->getSort(name, &ent) != codemaker::UnoType::Sort::Interface)
{
......@@ -657,7 +657,7 @@ static void printConstructors(
o << "create";
} else {
o << codemaker::cpp::translateUnoToCppIdentifier(
u2b(rConstructor.name), "method");
rConstructor.name.toUtf8(), "method");
}
o << ((options.shortnames) ? "(css::uno::Reference< css" :
"(::com::sun::star::uno::Reference< ::com::sun::star")
......@@ -668,7 +668,7 @@ static void printConstructors(
printType(o, options, manager, rParam.type, 4);
o << ' '
<< codemaker::cpp::translateUnoToCppIdentifier(
u2b(rParam.name), "param");
rParam.name.toUtf8(), "param");
}
o << ')';
printExceptionSpecification(o, options, manager, rConstructor.exceptions);
......@@ -687,13 +687,13 @@ static void printServiceMembers(
for (const auto& rService : entity->getDirectMandatoryBaseServices())
{
o << "\n// exported service " << rService.name << "\n";
generateDocumentation(o, options, manager, u2b(rService.name), delegate);
generateDocumentation(o, options, manager, rService.name.toUtf8(), delegate);
o << "\n// end of exported service " << rService.name << "\n";
}
for (const auto& rIface : entity->getDirectMandatoryBaseInterfaces())
{
o << "\n// supported interface " << rIface.name << "\n";
generateDocumentation(o, options, manager, u2b(rIface.name), delegate);
generateDocumentation(o, options, manager, rIface.name.toUtf8(), delegate);
}
if (delegate.isEmpty()) {
o << "\n// properties of service \""<< name << "\"\n";
......@@ -703,7 +703,7 @@ static void printServiceMembers(
printType(o, options, manager, rProp.type, 1);
o << " "
<< codemaker::cpp::translateUnoToCppIdentifier(
u2b(rProp.name), "property")
rProp.name.toUtf8(), "property")
<< ";\n";
}
}
......@@ -738,7 +738,7 @@ void generateDocumentation(std::ostream & o,
OUString nucleus;
sal_Int32 rank;
codemaker::UnoType::Sort sort = manager->decompose(
b2u(type), false, &nucleus, &rank, nullptr, nullptr);
OUString::fromUtf8(type), false, &nucleus, &rank, nullptr, nullptr);
bool comment = true;
if (!delegate.isEmpty()) {
......@@ -821,7 +821,7 @@ void generateDocumentation(std::ostream & o,
std::vector< OUString > arguments;
rtl::Reference< unoidl::Entity > entity;
sort = manager->decompose(
b2u(type), true, &nucleus, &rank, &arguments, &entity);
OUString::fromUtf8(type), true, &nucleus, &rank, &arguments, &entity);
if (rank != 0) {
if (comment) {
printMapsToCppType(
......@@ -930,8 +930,8 @@ void generateDocumentation(std::ostream & o,
assert(dynamic_cast<unoidl::SingleInterfaceBasedServiceEntity*>(entity.get()));
generateDocumentation(
o, options, manager,
u2b(static_cast<unoidl::SingleInterfaceBasedServiceEntity*>(
entity.get())->getBase()),
static_cast<unoidl::SingleInterfaceBasedServiceEntity*>(
entity.get())->getBase().toUtf8(),
delegate);
break;
......
......@@ -495,18 +495,18 @@ static void generateMethodBodies(std::ostream& o,
for (const OUString& type : interfaces) {
if (type == "com.sun.star.lang.XServiceInfo") {
generateXServiceInfoBodies(o);
generated.add(u2b(type));
generated.add(type.toUtf8());
} else {
if (options.componenttype == 2) {
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));
generated.add(type.toUtf8());
continue;
} else if (type == "com.sun.star.sheet.XAddIn") {
generateXAddInBodies(o);
generated.add(u2b(type));
generated.add(type.toUtf8());
// special handling of XLocalizable -> parent of XAddIn
if (!generated.contains("com.sun.star.lang.XLocalizable")) {
......@@ -516,26 +516,26 @@ static void generateMethodBodies(std::ostream& o,
continue;
} else if (type == "com.sun.star.lang.XLocalizable") {
generateXLocalizableBodies(o);
generated.add(u2b(type));
generated.add(type.toUtf8());
continue;
} else if (type == "com.sun.star.sheet.XCompatibilityNames") {
generateXCompatibilityNamesBodies(o);
generated.add(u2b(type));
generated.add(type.toUtf8());
continue;
}
}
if (options.componenttype == 3) {
if (type == "com.sun.star.lang.XInitialization") {
generateXInitializationBodies(o);
generated.add(u2b(type));
generated.add(type.toUtf8());
continue;
} else if (type == "com.sun.star.frame.XDispatch") {
generateXDispatchBodies(o, options);
generated.add(u2b(type));
generated.add(type.toUtf8());
continue;
} else if (type == "com.sun.star.frame.XDispatchProvider") {
generateXDispatchProviderBodies(o, options);
generated.add(u2b(type));
generated.add(type.toUtf8());
continue;
}
}
......@@ -812,7 +812,7 @@ void generateSkeleton(ProgramOptions const & options,
bool supportxcomponent = false;
for (const auto& rType : types) {
checkType(manager, b2u(rType), interfaces, services, properties);
checkType(manager, OUString::fromUtf8(rType), interfaces, services, properties);
}
if (options.componenttype == 3) {
......
......@@ -77,7 +77,7 @@ static void printType(
OString sType(
codemaker::java::translateUnoToJavaType(
sort, u2b(nucleus), referenceType && rank == 0));
sort, nucleus.toUtf8(), referenceType && rank == 0));
if (sType.startsWith("java.lang.")) {
sType = sType.copy(std::strlen("java.lang."));
}
......@@ -155,7 +155,7 @@ static bool printConstructorParameters(
printType(o, options, manager, rMember.type, false);
o << ' '
<< codemaker::java::translateUnoToJavaIdentifier(
u2b(rMember.name), "param");
rMember.name.toUtf8(), "param");
}
break;
}
......@@ -178,7 +178,7 @@ static bool printConstructorParameters(
}
o << ' '
<< codemaker::java::translateUnoToJavaIdentifier(
u2b(rMember.name), "param");
rMember.name.toUtf8(), "param");
}
break;
}
......@@ -205,7 +205,7 @@ static bool printConstructorParameters(
}
o << ' '
<< codemaker::java::translateUnoToJavaIdentifier(
u2b(rMember.name), "param");
rMember.name.toUtf8(), "param");
}
break;
}
......@@ -231,7 +231,7 @@ static bool printConstructorParameters(
printType(o, options, manager, rMember.type, false);
o << ' '
<< codemaker::java::translateUnoToJavaIdentifier(
u2b(rMember.name), "param");
rMember.name.toUtf8(), "param");
}
break;
}
......@@ -280,7 +280,7 @@ static void printMethodParameters(
o << ' ';
}
o << codemaker::java::translateUnoToJavaIdentifier(
u2b(i->name), "param");
i->name.toUtf8(), "param");
}
}
......@@ -397,7 +397,7 @@ void printMethods(std::ostream & o,
OString const & delegate, OString const & indentation,
bool defaultvalue, bool usepropertymixin)
{
if ( generated.contains(u2b(name)) || name == "com.sun.star.uno.XInterface" ||
if ( generated.contains(name.toUtf8()) || name == "com.sun.star.uno.XInterface" ||
( defaultvalue &&
( name == "com.sun.star.lang.XComponent" ||
name == "com.sun.star.lang.XTypeProvider" ||
......@@ -407,15 +407,15 @@ void printMethods(std::ostream & o,
if ( usepropertymixin ) {
if (name == "com.sun.star.beans.XPropertySet") {
generated.add(u2b(name));
generated.add(name.toUtf8());
generateXPropertySetBodies(o);
return;
} else if (name == "com.sun.star.beans.XFastPropertySet") {
generated.add(u2b(name));
generated.add(name.toUtf8());
generateXFastPropertySetBodies(o);
return;
} else if (name == "com.sun.star.beans.XPropertyAccess") {
generated.add(u2b(name));
generated.add(name.toUtf8());
generateXPropertyAccessBodies(o);
return;
}
......@@ -425,7 +425,7 @@ void printMethods(std::ostream & o,
bool body = !delegate.isEmpty();
bool defaultbody = delegate == sd;
generated.add(u2b(name));
generated.add(name.toUtf8());
rtl::Reference< unoidl::Entity > ent;
if (manager->getSort(name, &ent) != codemaker::UnoType::Sort::Interface)
{
......@@ -570,7 +570,7 @@ static void printConstructors(
o << "create";
} else {
o << codemaker::java::translateUnoToJavaIdentifier(
u2b(rConstructor.name), "method");
rConstructor.name.toUtf8(), "method");
}
o << "(com.sun.star.uno.XComponentContext the_context";
for (const auto& rParam : rConstructor.parameters)
......@@ -582,7 +582,7 @@ static void printConstructors(
}
o << ' '
<< codemaker::java::translateUnoToJavaIdentifier(
u2b(rParam.name), "param");
rParam.name.toUtf8(), "param");
}
o << ')';
printExceptionSpecification(o, options, manager, rConstructor.exceptions);
......@@ -601,12 +601,12 @@ static void printServiceMembers(
for (const auto& rService : entity->getDirectMandatoryBaseServices())
{
o << "\n// exported service " << rService.name << "\n";
generateDocumentation(o, options, manager, u2b(rService.name), delegate);
generateDocumentation(o, options, manager, rService.name.toUtf8(), delegate);
}
for (const auto& rIface : entity->getDirectMandatoryBaseInterfaces())
{
o << "\n// supported interface " << rIface.name << "\n";
generateDocumentation(o, options, manager, u2b(rIface.name), delegate);
generateDocumentation(o, options, manager, rIface.name.toUtf8(), delegate);
}
o << "\n// properties of service \""<< name << "\"\n";
for (const auto& rProp : entity->getDirectProperties())
......@@ -615,7 +615,7 @@ static void printServiceMembers(
printType(o, options, manager, rProp.type, false);
o << " "
<< codemaker::java::translateUnoToJavaIdentifier(
u2b(rProp.name), "property")
rProp.name.toUtf8(), "property")
<< ";\n";
}
}
......@@ -647,7 +647,7 @@ void generateDocumentation(std::ostream & o,
OUString nucleus;
sal_Int32 rank;
codemaker::UnoType::Sort sort = manager->decompose(
b2u(type), false, &nucleus, &rank, nullptr, nullptr);
OUString::fromUtf8(type), false, &nucleus, &rank, nullptr, nullptr);
bool comment = true;
if (!delegate.isEmpty()) {
......@@ -730,7 +730,7 @@ void generateDocumentation(std::ostream & o,
std::vector< OUString > arguments;
rtl::Reference< unoidl::Entity > entity;
sort = manager->decompose(
b2u(type), true, &nucleus, &rank, &arguments, &entity);
OUString::fromUtf8(type), true, &nucleus, &rank, &arguments, &entity);
if (rank != 0) {
printMapsToJavaType(