loplugin:ostr in various

Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-05-20 09:34:37 +02:00
parent 41c04ceb3b
commit d573e2ae17
37 changed files with 560 additions and 562 deletions

View file

@ -101,7 +101,7 @@ Type SAL_CALL OConnectionPointHelper::getConnectionType()
// Set default return value, if method failed. // Set default return value, if method failed.
if ( !impl_LockContainer() ) if ( !impl_LockContainer() )
{ {
throw RuntimeException("Container does not exist!"); throw RuntimeException(u"Container does not exist!"_ustr);
} }
// If container reference valid, return right type of supported interfaces of THIS connectionpoint. // If container reference valid, return right type of supported interfaces of THIS connectionpoint.
@ -144,7 +144,7 @@ void SAL_CALL OConnectionPointHelper::advise( const Reference< XInterface >& xLi
// Operation is permitted only, if reference to container is valid! // Operation is permitted only, if reference to container is valid!
if ( !impl_LockContainer() ) if ( !impl_LockContainer() )
{ {
throw RuntimeException("Container does not exist!"); throw RuntimeException(u"Container does not exist!"_ustr);
} }
// Forward it to OConnectionPointHelperContainer! // Forward it to OConnectionPointHelperContainer!
m_pContainerImplementation->advise( m_aInterfaceType, xListener ); m_pContainerImplementation->advise( m_aInterfaceType, xListener );
@ -161,7 +161,7 @@ void SAL_CALL OConnectionPointHelper::unadvise( const Reference< XInterface >& x
// Operation is permitted only, if reference to container is valid! // Operation is permitted only, if reference to container is valid!
if ( !impl_LockContainer() ) if ( !impl_LockContainer() )
{ {
throw RuntimeException("Container does not exist!"); throw RuntimeException(u"Container does not exist!"_ustr);
} }
// Forward it to OConnectionPointHelperContainer! // Forward it to OConnectionPointHelperContainer!
@ -179,7 +179,7 @@ Sequence< Reference< XInterface > > SAL_CALL OConnectionPointHelper::getConnecti
// Operation is permitted only, if reference to container is valid! // Operation is permitted only, if reference to container is valid!
if ( !impl_LockContainer() ) if ( !impl_LockContainer() )
{ {
throw RuntimeException("Container does not exist!"); throw RuntimeException(u"Container does not exist!"_ustr);
} }
// Set default return value, if method failed. // Set default return value, if method failed.
Sequence< Reference< XInterface > > seqReturnConnections; Sequence< Reference< XInterface > > seqReturnConnections;

View file

@ -126,12 +126,12 @@ Sequence< Type > SAL_CALL FrameControl::getTypes()
OUString FrameControl::getImplementationName() OUString FrameControl::getImplementationName()
{ {
return "stardiv.UnoControls.FrameControl"; return u"stardiv.UnoControls.FrameControl"_ustr;
} }
css::uno::Sequence<OUString> FrameControl::getSupportedServiceNames() css::uno::Sequence<OUString> FrameControl::getSupportedServiceNames()
{ {
return { "com.sun.star.frame.FrameControl" }; return { u"com.sun.star.frame.FrameControl"_ustr };
} }
// XControl // XControl
@ -323,11 +323,11 @@ IPropertyArrayHelper& FrameControl::getInfoHelper()
// attention: properties need to be sorted by name! // attention: properties need to be sorted by name!
static OPropertyArrayHelper ourPropertyInfo( static OPropertyArrayHelper ourPropertyInfo(
{ {
Property( "ComponentUrl", PropertyHandle::Componenturl, cppu::UnoType<OUString>::get(), Property( u"ComponentUrl"_ustr, PropertyHandle::Componenturl, cppu::UnoType<OUString>::get(),
PropertyAttribute::BOUND | PropertyAttribute::CONSTRAINED ), PropertyAttribute::BOUND | PropertyAttribute::CONSTRAINED ),
Property( "Frame", PropertyHandle::Frame, cppu::UnoType<XFrame>::get(), Property( u"Frame"_ustr, PropertyHandle::Frame, cppu::UnoType<XFrame>::get(),
PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT ), PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT ),
Property( "LoaderArguments", PropertyHandle::Loaderarguments, cppu::UnoType<Sequence<PropertyValue>>::get(), Property( u"LoaderArguments"_ustr, PropertyHandle::Loaderarguments, cppu::UnoType<Sequence<PropertyValue>>::get(),
PropertyAttribute::BOUND | PropertyAttribute::CONSTRAINED ) PropertyAttribute::BOUND | PropertyAttribute::CONSTRAINED )
}, },
true ); true );

View file

@ -65,7 +65,7 @@ StatusIndicator::StatusIndicator( const css::uno::Reference< XComponentContext >
m_xProgressBar->setVisible( true ); m_xProgressBar->setVisible( true );
// Reset to defaults !!! // Reset to defaults !!!
// (progressbar take automatically its own defaults) // (progressbar take automatically its own defaults)
m_xText->setText( "" ); m_xText->setText( u""_ustr );
osl_atomic_decrement(&m_refCount); osl_atomic_decrement(&m_refCount);
} }

View file

@ -112,7 +112,7 @@ void SAL_CALL PropertySetHelper::setPropertyValues( const Sequence< OUString >&
const sal_Int32 nCount = rPropertyNames.getLength(); const sal_Int32 nCount = rPropertyNames.getLength();
if( nCount != rValues.getLength() ) if( nCount != rValues.getLength() )
throw IllegalArgumentException("lengths do not match", static_cast<XPropertySet*>(this), -1); throw IllegalArgumentException(u"lengths do not match"_ustr, static_cast<XPropertySet*>(this), -1);
if( !nCount ) if( !nCount )
return; return;

View file

@ -177,12 +177,12 @@ static Reference< XInterface > loadComponent(
if (aExt == u"dll" || aExt == u"exe" || aExt == u"dylib" || aExt == u"so") if (aExt == u"dll" || aExt == u"exe" || aExt == u"dylib" || aExt == u"so")
{ {
createInstance( createInstance(
xLoader, xContext, "com.sun.star.loader.SharedLibrary" ); xLoader, xContext, u"com.sun.star.loader.SharedLibrary"_ustr );
} }
else if (aExt == u"jar" || aExt == u"class") else if (aExt == u"jar" || aExt == u"class")
{ {
createInstance( createInstance(
xLoader, xContext, "com.sun.star.loader.Java" ); xLoader, xContext, u"com.sun.star.loader.Java"_ustr );
} }
else else
{ {
@ -404,18 +404,18 @@ SAL_IMPLEMENT_MAIN()
} }
if (!(aImplName.isEmpty() || aServiceName.isEmpty())) if (!(aImplName.isEmpty() || aServiceName.isEmpty()))
throw RuntimeException("give component exOR service name!" ); throw RuntimeException(u"give component exOR service name!"_ustr );
if (aImplName.isEmpty() && aServiceName.isEmpty()) if (aImplName.isEmpty() && aServiceName.isEmpty())
{ {
if (! aUnoUrl.endsWithIgnoreAsciiCase( ";uno.ComponentContext" )) if (! aUnoUrl.endsWithIgnoreAsciiCase( ";uno.ComponentContext" ))
throw RuntimeException( throw RuntimeException(
"expected UNO-URL with instance name uno.ComponentContext!" ); u"expected UNO-URL with instance name uno.ComponentContext!"_ustr );
if (bSingleInstance) if (bSingleInstance)
throw RuntimeException( throw RuntimeException(
"unexpected option --singleinstance!" ); u"unexpected option --singleinstance!"_ustr );
} }
if (!aImplName.isEmpty() && aLocation.isEmpty()) if (!aImplName.isEmpty() && aLocation.isEmpty())
throw RuntimeException("give component location!" ); throw RuntimeException(u"give component location!"_ustr );
if (!aServiceName.isEmpty() && !aLocation.isEmpty()) if (!aServiceName.isEmpty() && !aLocation.isEmpty())
out( "\n> warning: service name given, will ignore location!" ); out( "\n> warning: service name given, will ignore location!" );
@ -437,7 +437,7 @@ SAL_IMPLEMENT_MAIN()
{ {
if (aUnoUrl.getLength() < 10 || !aUnoUrl.startsWithIgnoreAsciiCase( "uno:" )) if (aUnoUrl.getLength() < 10 || !aUnoUrl.startsWithIgnoreAsciiCase( "uno:" ))
{ {
throw RuntimeException("illegal uno url given!" ); throw RuntimeException(u"illegal uno url given!"_ustr );
} }
sal_Int32 nIndex = 4; // skip initial "uno:" sal_Int32 nIndex = 4; // skip initial "uno:"
@ -451,7 +451,7 @@ SAL_IMPLEMENT_MAIN()
// Exactly 3 tokens are required // Exactly 3 tokens are required
if (bTooFewTokens || nIndex>0) if (bTooFewTokens || nIndex>0)
{ {
throw RuntimeException("illegal uno url given!" ); throw RuntimeException(u"illegal uno url given!"_ustr );
} }
Reference< XAcceptor > xAcceptor = Acceptor::create(xContext); Reference< XAcceptor > xAcceptor = Acceptor::create(xContext);
@ -482,7 +482,7 @@ SAL_IMPLEMENT_MAIN()
Reference< XBridgeFactory > xBridgeFactory; Reference< XBridgeFactory > xBridgeFactory;
createInstance( createInstance(
xBridgeFactory, xContext, xBridgeFactory, xContext,
"com.sun.star.bridge.BridgeFactory" ); u"com.sun.star.bridge.BridgeFactory"_ustr );
// bridge // bridge
Reference< XBridge > xBridge( xBridgeFactory->createBridge( Reference< XBridge > xBridge( xBridgeFactory->createBridge(
@ -520,7 +520,7 @@ SAL_IMPLEMENT_MAIN()
Reference< XComponent > xComp( xInstance, UNO_QUERY ); Reference< XComponent > xComp( xInstance, UNO_QUERY );
if (xComp.is()) if (xComp.is())
xComp->dispose(); xComp->dispose();
throw RuntimeException( "component does not export interface \"com.sun.star.lang.XMain\"!" ); throw RuntimeException( u"component does not export interface \"com.sun.star.lang.XMain\"!"_ustr );
} }
} }
} }

View file

@ -60,7 +60,7 @@ void Theme::dumpAsXml(xmlTextWriterPtr pWriter) const
void Theme::ToAny(uno::Any& rVal) const void Theme::ToAny(uno::Any& rVal) const
{ {
comphelper::SequenceAsHashMap aMap; comphelper::SequenceAsHashMap aMap;
aMap["Name"] <<= maName; aMap[u"Name"_ustr] <<= maName;
if (mpColorSet) if (mpColorSet)
{ {
@ -74,8 +74,8 @@ void Theme::ToAny(uno::Any& rVal) const
} }
} }
aMap["ColorSchemeName"] <<= mpColorSet->getName(); aMap[u"ColorSchemeName"_ustr] <<= mpColorSet->getName();
aMap["ColorScheme"] <<= comphelper::containerToSequence(aColorScheme); aMap[u"ColorScheme"_ustr] <<= comphelper::containerToSequence(aColorScheme);
} }
rVal <<= aMap.getAsConstPropertyValueList(); rVal <<= aMap.getAsConstPropertyValueList();
@ -87,7 +87,7 @@ std::unique_ptr<Theme> Theme::FromAny(const uno::Any& rVal)
std::unique_ptr<Theme> pTheme; std::unique_ptr<Theme> pTheme;
std::shared_ptr<model::ColorSet> pColorSet; std::shared_ptr<model::ColorSet> pColorSet;
auto it = aMap.find("Name"); auto it = aMap.find(u"Name"_ustr);
if (it != aMap.end()) if (it != aMap.end())
{ {
OUString aName; OUString aName;
@ -95,7 +95,7 @@ std::unique_ptr<Theme> Theme::FromAny(const uno::Any& rVal)
pTheme = std::make_unique<Theme>(aName); pTheme = std::make_unique<Theme>(aName);
} }
it = aMap.find("ColorSchemeName"); it = aMap.find(u"ColorSchemeName"_ustr);
if (it != aMap.end() && pTheme) if (it != aMap.end() && pTheme)
{ {
OUString aName; OUString aName;
@ -104,7 +104,7 @@ std::unique_ptr<Theme> Theme::FromAny(const uno::Any& rVal)
pTheme->setColorSet(pColorSet); pTheme->setColorSet(pColorSet);
} }
it = aMap.find("ColorScheme"); it = aMap.find(u"ColorScheme"_ustr);
if (it != aMap.end() && pColorSet) if (it != aMap.end() && pColorSet)
{ {
uno::Sequence<util::Color> aColors; uno::Sequence<util::Color> aColors;

View file

@ -278,7 +278,7 @@ EventAttacherImpl::EventAttacherImpl( const Reference< XComponentContext >& rxCo
/// @throws Exception /// @throws Exception
OUString SAL_CALL EventAttacherImpl::getImplementationName( ) OUString SAL_CALL EventAttacherImpl::getImplementationName( )
{ {
return "com.sun.star.comp.EventAttacher"; return u"com.sun.star.comp.EventAttacher"_ustr;
} }
sal_Bool SAL_CALL EventAttacherImpl::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL EventAttacherImpl::supportsService( const OUString& ServiceName )
@ -288,7 +288,7 @@ sal_Bool SAL_CALL EventAttacherImpl::supportsService( const OUString& ServiceNam
Sequence<OUString> SAL_CALL EventAttacherImpl::getSupportedServiceNames( ) Sequence<OUString> SAL_CALL EventAttacherImpl::getSupportedServiceNames( )
{ {
return { "com.sun.star.script.EventAttacher" }; return { u"com.sun.star.script.EventAttacher"_ustr };
} }
void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments) void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)

File diff suppressed because it is too large Load diff

View file

@ -224,7 +224,7 @@ void LiblangtagDataRef::setupDataPath()
maDataPath = OString(lo_get_app_data_dir()) + "/share/liblangtag"; maDataPath = OString(lo_get_app_data_dir()) + "/share/liblangtag";
#else #else
// maDataPath is assumed to be empty here. // maDataPath is assumed to be empty here.
OUString aURL("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/liblangtag"); OUString aURL(u"$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/liblangtag"_ustr);
rtl::Bootstrap::expandMacros(aURL); //TODO: detect failure rtl::Bootstrap::expandMacros(aURL); //TODO: detect failure
// Check if data is in our own installation, else assume system // Check if data is in our own installation, else assume system
@ -2210,7 +2210,7 @@ LanguageTag & LanguageTag::makeFallback()
} }
else if (aLanguage == "ca" && aCountry == "XV") else if (aLanguage == "ca" && aCountry == "XV")
{ {
::std::vector< OUString > aRep( LanguageTag( "ca-ES-valencia").getFallbackStrings( true)); ::std::vector< OUString > aRep( LanguageTag( u"ca-ES-valencia"_ustr).getFallbackStrings( true));
aVec.insert( aVec.end(), aRep.begin(), aRep.end()); aVec.insert( aVec.end(), aRep.begin(), aRep.end());
// Already includes 'ca' language fallback. // Already includes 'ca' language fallback.
} }
@ -2398,7 +2398,7 @@ LanguageTag & LanguageTag::makeFallback()
OUString LanguageTag::getBcp47MS() const OUString LanguageTag::getBcp47MS() const
{ {
if (getLanguageType() == LANGUAGE_SPANISH_DATED) if (getLanguageType() == LANGUAGE_SPANISH_DATED)
return "es-ES_tradnl"; return u"es-ES_tradnl"_ustr;
return getBcp47(); return getBcp47();
} }
@ -3153,7 +3153,7 @@ LanguageTag makeLanguageTagFromAppleLanguageId(AppleLanguageId nLanguage)
nLang = LANGUAGE_AZERI_CYRILLIC; nLang = LANGUAGE_AZERI_CYRILLIC;
break; break;
case AppleLanguageId::AZERI_ARABIC: case AppleLanguageId::AZERI_ARABIC:
return LanguageTag("az-Arab"); return LanguageTag(u"az-Arab"_ustr);
case AppleLanguageId::ARMENIAN: case AppleLanguageId::ARMENIAN:
nLang = LANGUAGE_ARMENIAN; nLang = LANGUAGE_ARMENIAN;
break; break;
@ -3275,7 +3275,7 @@ LanguageTag makeLanguageTagFromAppleLanguageId(AppleLanguageId nLanguage)
nLang = LANGUAGE_KINYARWANDA_RWANDA; nLang = LANGUAGE_KINYARWANDA_RWANDA;
break; break;
case AppleLanguageId::RUNDI: case AppleLanguageId::RUNDI:
return LanguageTag("rn"); return LanguageTag(u"rn"_ustr);
case AppleLanguageId::NYANJA: case AppleLanguageId::NYANJA:
nLang = LANGUAGE_USER_NYANJA; nLang = LANGUAGE_USER_NYANJA;
break; break;
@ -3304,7 +3304,7 @@ LanguageTag makeLanguageTagFromAppleLanguageId(AppleLanguageId nLanguage)
nLang = LANGUAGE_GUARANI_PARAGUAY; nLang = LANGUAGE_GUARANI_PARAGUAY;
break; break;
case AppleLanguageId::AYMARA: case AppleLanguageId::AYMARA:
return LanguageTag("ay"); return LanguageTag(u"ay"_ustr);
case AppleLanguageId::TATAR: case AppleLanguageId::TATAR:
nLang = LANGUAGE_TATAR; nLang = LANGUAGE_TATAR;
break; break;
@ -3315,9 +3315,9 @@ LanguageTag makeLanguageTagFromAppleLanguageId(AppleLanguageId nLanguage)
nLang = LANGUAGE_DZONGKHA_BHUTAN; nLang = LANGUAGE_DZONGKHA_BHUTAN;
break; break;
case AppleLanguageId::JAVANESE_LATIN: case AppleLanguageId::JAVANESE_LATIN:
return LanguageTag("jv-Latn"); return LanguageTag(u"jv-Latn"_ustr);
case AppleLanguageId::SUNDANESE_LATIN: case AppleLanguageId::SUNDANESE_LATIN:
return LanguageTag("su-Latn"); return LanguageTag(u"su-Latn"_ustr);
case AppleLanguageId::GALICIAN: case AppleLanguageId::GALICIAN:
nLang = LANGUAGE_GALICIAN; nLang = LANGUAGE_GALICIAN;
break; break;
@ -3337,9 +3337,9 @@ LanguageTag makeLanguageTagFromAppleLanguageId(AppleLanguageId nLanguage)
nLang = LANGUAGE_USER_MANX; nLang = LANGUAGE_USER_MANX;
break; break;
case AppleLanguageId::IRISH_GAELIC_WITH_DOT_ABOVE: case AppleLanguageId::IRISH_GAELIC_WITH_DOT_ABOVE:
return LanguageTag("ga-Latg"); return LanguageTag(u"ga-Latg"_ustr);
case AppleLanguageId::TONGAN: case AppleLanguageId::TONGAN:
return LanguageTag("to"); return LanguageTag(u"to"_ustr);
case AppleLanguageId::GREEK_POLYTONIC: case AppleLanguageId::GREEK_POLYTONIC:
nLang = LANGUAGE_USER_ANCIENT_GREEK; nLang = LANGUAGE_USER_ANCIENT_GREEK;
break; break;

View file

@ -217,7 +217,7 @@ void TestBreakIterator::testLineBreaking()
// An identical result should be generated for solidus. // An identical result should be generated for solidus.
aResult = m_xBreak->getLineBreak( aResult = m_xBreak->getLineBreak(
"C:/Program Files/LibreOffice", strlen("C:/Program Files/Libre"), aLocale, 0, u"C:/Program Files/LibreOffice"_ustr, strlen("C:/Program Files/Libre"), aLocale, 0,
aHyphOptions, aUserOptions); aHyphOptions, aUserOptions);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11), aResult.breakIndex); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11), aResult.breakIndex);
} }
@ -289,7 +289,7 @@ void TestBreakIterator::testLineBreaking()
// From the same bug: "the leading minus must stay with numbers and strings" // From the same bug: "the leading minus must stay with numbers and strings"
i18n::LineBreakResults aResult = m_xBreak->getLineBreak( i18n::LineBreakResults aResult = m_xBreak->getLineBreak(
"range of -100.000 to 100.000", strlen("range of -1"), aLocale, 0, u"range of -100.000 to 100.000"_ustr, strlen("range of -1"), aLocale, 0,
aHyphOptions, aUserOptions); aHyphOptions, aUserOptions);
CPPUNIT_ASSERT_EQUAL(sal_Int32{9}, aResult.breakIndex); CPPUNIT_ASSERT_EQUAL(sal_Int32{9}, aResult.breakIndex);
@ -306,7 +306,7 @@ void TestBreakIterator::testLineBreaking()
// From the same bug: "the leading minus must stay with numbers and strings" // From the same bug: "the leading minus must stay with numbers and strings"
i18n::LineBreakResults aResult = m_xBreak->getLineBreak( i18n::LineBreakResults aResult = m_xBreak->getLineBreak(
"EURO is -10,50", strlen("EURO is -1"), aLocale, 0, aHyphOptions, aUserOptions); u"EURO is -10,50"_ustr, strlen("EURO is -1"), aLocale, 0, aHyphOptions, aUserOptions);
CPPUNIT_ASSERT_EQUAL(sal_Int32{8}, aResult.breakIndex); CPPUNIT_ASSERT_EQUAL(sal_Int32{8}, aResult.breakIndex);
// Also the mathematical minus sign: // Also the mathematical minus sign:
@ -321,7 +321,7 @@ void TestBreakIterator::testLineBreaking()
// From the same bug: "the leading minus must stay with numbers and strings" // From the same bug: "the leading minus must stay with numbers and strings"
i18n::LineBreakResults aResult = m_xBreak->getLineBreak( i18n::LineBreakResults aResult = m_xBreak->getLineBreak(
"und -kosten", strlen("und -ko"), aLocale, 0, u"und -kosten"_ustr, strlen("und -ko"), aLocale, 0,
aHyphOptions, aUserOptions); aHyphOptions, aUserOptions);
CPPUNIT_ASSERT_EQUAL(sal_Int32{4}, aResult.breakIndex); CPPUNIT_ASSERT_EQUAL(sal_Int32{4}, aResult.breakIndex);

View file

@ -1044,7 +1044,7 @@ OUString unicode::formatPercent(double dNumber,
// http://www.unicode.org/cldr/charts/24/by_type/numbers.number_formatting_patterns.html // http://www.unicode.org/cldr/charts/24/by_type/numbers.number_formatting_patterns.html
// so format using French which has the desired rules // so format using French which has the desired rules
if (aLangTag.getLanguage() == "es" || aLangTag.getLanguage() == "sl") if (aLangTag.getLanguage() == "es" || aLangTag.getLanguage() == "sl")
aLangTag.reset("fr-FR"); aLangTag.reset(u"fr-FR"_ustr);
icu::Locale aLocale = LanguageTagIcu::getIcuLocale(aLangTag); icu::Locale aLocale = LanguageTagIcu::getIcuLocale(aLangTag);

View file

@ -58,7 +58,7 @@ private:
public: public:
FontScheme() FontScheme()
: maName("Office") : maName(u"Office"_ustr)
{ {
} }

View file

@ -37,7 +37,7 @@ static void InitCurl_easy(CURL* const pCURL)
rc = curl_easy_setopt(pCURL, CURLOPT_CAINFO, path); rc = curl_easy_setopt(pCURL, CURLOPT_CAINFO, path);
if (rc != CURLE_OK) // only if OOM? if (rc != CURLE_OK) // only if OOM?
{ {
throw css::uno::RuntimeException("CURLOPT_CAINFO failed"); throw css::uno::RuntimeException(u"CURLOPT_CAINFO failed"_ustr);
} }
#endif #endif

View file

@ -36,7 +36,7 @@ static char const* GetCABundleFile()
} }
} }
throw css::uno::RuntimeException("no OpenSSL CA certificate bundle found"); throw css::uno::RuntimeException(u"no OpenSSL CA certificate bundle found"_ustr);
} }
#endif #endif

View file

@ -263,16 +263,16 @@ public:
CPPUNIT_ASSERT(!aVec.insert(std::make_unique<OUString>("b")).second); CPPUNIT_ASSERT(!aVec.insert(std::make_unique<OUString>("b")).second);
aVec.insert(std::make_unique<OUString>("a")); aVec.insert(std::make_unique<OUString>("a"));
CPPUNIT_ASSERT_EQUAL( static_cast<size_t>(3), aVec.size() ); CPPUNIT_ASSERT_EQUAL( static_cast<size_t>(3), aVec.size() );
CPPUNIT_ASSERT_EQUAL( OUString("a"), *aVec[0] ); CPPUNIT_ASSERT_EQUAL( u"a"_ustr, *aVec[0] );
CPPUNIT_ASSERT_EQUAL( OUString("b"), *aVec[1] ); CPPUNIT_ASSERT_EQUAL( u"b"_ustr, *aVec[1] );
CPPUNIT_ASSERT_EQUAL( OUString("c"), *aVec[2] ); CPPUNIT_ASSERT_EQUAL( u"c"_ustr, *aVec[2] );
CPPUNIT_ASSERT( aVec.find(str_c) != aVec.end() ); CPPUNIT_ASSERT( aVec.find(str_c) != aVec.end() );
CPPUNIT_ASSERT( aVec.find(str_b1) != aVec.end() ); CPPUNIT_ASSERT( aVec.find(str_b1) != aVec.end() );
OUString tmp("b"); OUString tmp(u"b"_ustr);
CPPUNIT_ASSERT( aVec.find(&tmp) != aVec.end() ); CPPUNIT_ASSERT( aVec.find(&tmp) != aVec.end() );
OUString tmp2("z"); OUString tmp2(u"z"_ustr);
CPPUNIT_ASSERT( bool(aVec.find(&tmp2) == aVec.end()) ); CPPUNIT_ASSERT( bool(aVec.find(&tmp2) == aVec.end()) );
} }
@ -286,16 +286,16 @@ public:
auto str_b2 = aVec.insert(std::make_unique<OUString>("b")).first->get(); auto str_b2 = aVec.insert(std::make_unique<OUString>("b")).first->get();
aVec.insert(std::make_unique<OUString>("a")); aVec.insert(std::make_unique<OUString>("a"));
CPPUNIT_ASSERT_EQUAL( static_cast<size_t>(4), aVec.size() ); CPPUNIT_ASSERT_EQUAL( static_cast<size_t>(4), aVec.size() );
CPPUNIT_ASSERT_EQUAL( OUString("a"), *aVec[0] ); CPPUNIT_ASSERT_EQUAL( u"a"_ustr, *aVec[0] );
CPPUNIT_ASSERT_EQUAL( OUString("b"), *aVec[1] ); CPPUNIT_ASSERT_EQUAL( u"b"_ustr, *aVec[1] );
CPPUNIT_ASSERT_EQUAL( OUString("b"), *aVec[2] ); CPPUNIT_ASSERT_EQUAL( u"b"_ustr, *aVec[2] );
CPPUNIT_ASSERT_EQUAL( OUString("c"), *aVec[3] ); CPPUNIT_ASSERT_EQUAL( u"c"_ustr, *aVec[3] );
CPPUNIT_ASSERT( aVec.find(str_c) != aVec.end() ); CPPUNIT_ASSERT( aVec.find(str_c) != aVec.end() );
CPPUNIT_ASSERT( aVec.find(str_b1) != aVec.end() ); CPPUNIT_ASSERT( aVec.find(str_b1) != aVec.end() );
CPPUNIT_ASSERT( aVec.find(str_b2) != aVec.end() ); CPPUNIT_ASSERT( aVec.find(str_b2) != aVec.end() );
OUString tmp2("z"); OUString tmp2(u"z"_ustr);
CPPUNIT_ASSERT( bool(aVec.find(&tmp2) == aVec.end()) ); CPPUNIT_ASSERT( bool(aVec.find(&tmp2) == aVec.end()) );
} }

View file

@ -37,12 +37,12 @@ OString ostringFood() { return "food"_ostr; } // avoid loplugin:stringview
OString ostringOof() { return "oof"_ostr; } // avoid loplugin:stringview OString ostringOof() { return "oof"_ostr; } // avoid loplugin:stringview
OString ostringSraboof() { return "sraboof"_ostr; } // avoid loplugin:stringview OString ostringSraboof() { return "sraboof"_ostr; } // avoid loplugin:stringview
OUString oustringEmpty() { return {}; } // avoid loplugin:stringview OUString oustringEmpty() { return {}; } // avoid loplugin:stringview
OUString oustringDoof() { return "doof"; } // avoid loplugin:stringview OUString oustringDoof() { return u"doof"_ustr; } // avoid loplugin:stringview
OUString oustringFoo() { return "foo"; } // avoid loplugin:stringview OUString oustringFoo() { return u"foo"_ustr; } // avoid loplugin:stringview
OUString oustringFoobars() { return "foobars"; } // avoid loplugin:stringview OUString oustringFoobars() { return u"foobars"_ustr; } // avoid loplugin:stringview
OUString oustringFood() { return "food"; } // avoid loplugin:stringview OUString oustringFood() { return u"food"_ustr; } // avoid loplugin:stringview
OUString oustringOof() { return "oof"; } // avoid loplugin:stringview OUString oustringOof() { return u"oof"_ustr; } // avoid loplugin:stringview
OUString oustringSraboof() { return "sraboof"; } // avoid loplugin:stringview OUString oustringSraboof() { return u"sraboof"_ustr; } // avoid loplugin:stringview
class Test : public CppUnit::TestFixture class Test : public CppUnit::TestFixture
{ {
@ -597,7 +597,7 @@ private:
{ {
// Explicit initialization of suTokenStr to avoid an unhelpful loplugin:stringviewvar; // Explicit initialization of suTokenStr to avoid an unhelpful loplugin:stringviewvar;
// it is the o3tl::getToken overload taking OUString that we want to test here: // it is the o3tl::getToken overload taking OUString that we want to test here:
OUString suTokenStr(""); OUString suTokenStr(u""_ustr);
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
do do
{ {
@ -606,7 +606,7 @@ private:
// should not GPF // should not GPF
} }
{ {
OUString suTokenStr("a;b"); OUString suTokenStr(u"a;b"_ustr);
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;

View file

@ -27,14 +27,14 @@ OpenCLConfig::OpenCLConfig() :
// This entry we have had for some time (when denylisting was // This entry we have had for some time (when denylisting was
// done elsewhere in the code), so presumably there is a known // done elsewhere in the code), so presumably there is a known
// good reason for it. // good reason for it.
maDenyList.insert(ImplMatcher("Windows", "", "Intel\\(R\\) Corporation", "", "9\\.17\\.10\\.2884")); maDenyList.insert(ImplMatcher(u"Windows"_ustr, u""_ustr, u"Intel\\(R\\) Corporation"_ustr, u""_ustr, u"9\\.17\\.10\\.2884"_ustr));
// This was reported to produce bogus values in unit tests // This was reported to produce bogus values in unit tests
maDenyList.insert(ImplMatcher("Windows", "", "Intel\\(R\\) Corporation", "", "27\\.20\\.100\\.8681")); maDenyList.insert(ImplMatcher(u"Windows"_ustr, u""_ustr, u"Intel\\(R\\) Corporation"_ustr, u""_ustr, u"27\\.20\\.100\\.8681"_ustr));
// For now, assume that AMD, Intel and NVIDIA drivers are good // For now, assume that AMD, Intel and NVIDIA drivers are good
maAllowList.insert(ImplMatcher("", "", "Advanced Micro Devices, Inc\\.", "", "")); maAllowList.insert(ImplMatcher(u""_ustr, u""_ustr, u"Advanced Micro Devices, Inc\\."_ustr, u""_ustr, u""_ustr));
maAllowList.insert(ImplMatcher("", "", "Intel\\(R\\) Corporation", "", "")); maAllowList.insert(ImplMatcher(u""_ustr, u""_ustr, u"Intel\\(R\\) Corporation"_ustr, u""_ustr, u""_ustr));
maAllowList.insert(ImplMatcher("", "", "NVIDIA Corporation", "", "")); maAllowList.insert(ImplMatcher(u""_ustr, u""_ustr, u"NVIDIA Corporation"_ustr, u""_ustr, u""_ustr));
} }
bool OpenCLConfig::operator== (const OpenCLConfig& r) const bool OpenCLConfig::operator== (const OpenCLConfig& r) const

View file

@ -90,7 +90,7 @@ OString const & getCacheFolder()
{ {
static OString const aCacheFolder = []() static OString const aCacheFolder = []()
{ {
OUString url("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/"); OUString url(u"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/cache/"_ustr);
rtl::Bootstrap::expandMacros(url); rtl::Bootstrap::expandMacros(url);
osl::Directory::create(url); osl::Directory::create(url);

View file

@ -149,7 +149,7 @@ void Test::test() {
m_xContext->getServiceManager(), css::uno::UNO_QUERY_THROW); m_xContext->getServiceManager(), css::uno::UNO_QUERY_THROW);
css::uno::Reference<css::container::XHierarchicalNameAccess> typeMgr( css::uno::Reference<css::container::XHierarchicalNameAccess> typeMgr(
m_xContext->getValueByName( m_xContext->getValueByName(
"/singletons/com.sun.star.reflection.theTypeDescriptionManager"), u"/singletons/com.sun.star.reflection.theTypeDescriptionManager"_ustr),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
const css::uno::Sequence<OUString> serviceNames( const css::uno::Sequence<OUString> serviceNames(
m_xContext->getServiceManager()->getAvailableServiceNames()); m_xContext->getServiceManager()->getAvailableServiceNames());
@ -346,7 +346,7 @@ void Test::createInstance(
// Instantiating a ConfigurationProvider with no or empty args must // Instantiating a ConfigurationProvider with no or empty args must
// return theDefaultProvider: // return theDefaultProvider:
expImpl = "com.sun.star.comp.configuration.DefaultProvider"; expImpl = "com.sun.star.comp.configuration.DefaultProvider";
expServs = {"com.sun.star.configuration.DefaultProvider"}; expServs = {u"com.sun.star.configuration.DefaultProvider"_ustr};
} else if (name == "com.sun.star.datatransfer.clipboard.SystemClipboard") { } else if (name == "com.sun.star.datatransfer.clipboard.SystemClipboard") {
// SystemClipboard is a wrapper returning either a platform-specific or // SystemClipboard is a wrapper returning either a platform-specific or
// the generic VCLGenericClipboard: // the generic VCLGenericClipboard:
@ -356,19 +356,19 @@ void Test::createInstance(
|| name == "com.sun.star.datatransfer.dnd.XdndSupport") || name == "com.sun.star.datatransfer.dnd.XdndSupport")
{ {
expImpl = "com.sun.star.datatransfer.dnd.VclGenericDragSource"; expImpl = "com.sun.star.datatransfer.dnd.VclGenericDragSource";
expServs = {"com.sun.star.datatransfer.dnd.GenericDragSource"}; expServs = {u"com.sun.star.datatransfer.dnd.GenericDragSource"_ustr};
} else if (name == "com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1" } else if (name == "com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1"
|| name == "com.sun.star.datatransfer.dnd.XdndDropTarget") || name == "com.sun.star.datatransfer.dnd.XdndDropTarget")
{ {
expImpl = "com.sun.star.datatransfer.dnd.VclGenericDropTarget"; expImpl = "com.sun.star.datatransfer.dnd.VclGenericDropTarget";
expServs = {"com.sun.star.datatransfer.dnd.GenericDropTarget"}; expServs = {u"com.sun.star.datatransfer.dnd.GenericDropTarget"_ustr};
#endif #endif
} else if (name == "com.sun.star.ui.dialogs.FolderPicker") { } else if (name == "com.sun.star.ui.dialogs.FolderPicker") {
// FolderPicker is a wrapper returning either a platform-specific or the // FolderPicker is a wrapper returning either a platform-specific or the
// generic OfficeFolderPicker. In headless mode it is always the // generic OfficeFolderPicker. In headless mode it is always the
// generic one. // generic one.
expImpl = "com.sun.star.svtools.OfficeFolderPicker"; expImpl = "com.sun.star.svtools.OfficeFolderPicker";
expServs = {"com.sun.star.ui.dialogs.OfficeFolderPicker"}; expServs = {u"com.sun.star.ui.dialogs.OfficeFolderPicker"_ustr};
} else if (expImpl == "com.sun.star.comp.Calc.SpreadsheetDocument") { } else if (expImpl == "com.sun.star.comp.Calc.SpreadsheetDocument") {
expImpl = "ScModelObj"; expImpl = "ScModelObj";
} else if (expImpl == "com.sun.star.comp.Draw.DrawingDocument" } else if (expImpl == "com.sun.star.comp.Draw.DrawingDocument"

View file

@ -174,7 +174,7 @@ RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey,
if (pKey->isReadOnly()) if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY; return RegError::REGISTRY_READONLY;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;
@ -213,7 +213,7 @@ RegError REGISTRY_CALLTYPE setLongListValue(RegKeyHandle hKey,
if (pKey->isReadOnly()) if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY; return RegError::REGISTRY_READONLY;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;
@ -252,7 +252,7 @@ RegError REGISTRY_CALLTYPE setStringListValue(RegKeyHandle hKey,
if (pKey->isReadOnly()) if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY; return RegError::REGISTRY_READONLY;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;
@ -291,7 +291,7 @@ RegError REGISTRY_CALLTYPE setUnicodeListValue(RegKeyHandle hKey,
if (pKey->isReadOnly()) if (pKey->isReadOnly())
return RegError::REGISTRY_READONLY; return RegError::REGISTRY_READONLY;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;
@ -333,7 +333,7 @@ RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey,
RegValueType valueType; RegValueType valueType;
sal_uInt32 valueSize; sal_uInt32 valueSize;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;
@ -376,7 +376,7 @@ RegError REGISTRY_CALLTYPE getValue(RegKeyHandle hKey,
if (pKey->isDeleted()) if (pKey->isDeleted())
return RegError::INVALID_KEY; return RegError::INVALID_KEY;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;
@ -413,7 +413,7 @@ RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey,
if (pKey->isDeleted()) if (pKey->isDeleted())
return RegError::INVALID_KEY; return RegError::INVALID_KEY;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;
@ -450,7 +450,7 @@ RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey,
if (pKey->isDeleted()) if (pKey->isDeleted())
return RegError::INVALID_KEY; return RegError::INVALID_KEY;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;
@ -487,7 +487,7 @@ RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey,
if (pKey->isDeleted()) if (pKey->isDeleted())
return RegError::INVALID_KEY; return RegError::INVALID_KEY;
OUString valueName("value"); OUString valueName(u"value"_ustr);
if (keyName->length) if (keyName->length)
{ {
ORegKey* pSubKey = nullptr; ORegKey* pSubKey = nullptr;

View file

@ -67,7 +67,7 @@ ResolverImpl::ResolverImpl( const Reference< XComponentContext > & xCtx )
// XServiceInfo // XServiceInfo
OUString ResolverImpl::getImplementationName() OUString ResolverImpl::getImplementationName()
{ {
return "com.sun.star.comp.bridge.UnoUrlResolver"; return u"com.sun.star.comp.bridge.UnoUrlResolver"_ustr;
} }
sal_Bool ResolverImpl::supportsService( const OUString & rServiceName ) sal_Bool ResolverImpl::supportsService( const OUString & rServiceName )
@ -77,7 +77,7 @@ sal_Bool ResolverImpl::supportsService( const OUString & rServiceName )
Sequence< OUString > ResolverImpl::getSupportedServiceNames() Sequence< OUString > ResolverImpl::getSupportedServiceNames()
{ {
return { "com.sun.star.bridge.UnoUrlResolver" }; return { u"com.sun.star.bridge.UnoUrlResolver"_ustr };
} }
// XUnoUrlResolver // XUnoUrlResolver
@ -99,7 +99,7 @@ Reference< XInterface > ResolverImpl::resolve( const OUString & rUnoUrl )
} }
Reference< XConnector > xConnector( Reference< XConnector > xConnector(
_xSMgr->createInstanceWithContext( "com.sun.star.connection.Connector", _xCtx ), _xSMgr->createInstanceWithContext( u"com.sun.star.connection.Connector"_ustr, _xCtx ),
UNO_QUERY_THROW ); UNO_QUERY_THROW );
Reference< XConnection > xConnection( xConnector->connect( aConnectDescr ) ); Reference< XConnection > xConnection( xConnector->connect( aConnectDescr ) );

View file

@ -522,7 +522,7 @@ double SAL_CALL AnalysisAddIn::getSeriessum( double fX, double fN, double fM, co
// #i32269# 0^0 is undefined, Excel returns #NUM! error // #i32269# 0^0 is undefined, Excel returns #NUM! error
if( fX == 0.0 && fN == 0 ) if( fX == 0.0 && fN == 0 )
throw uno::RuntimeException("undefined expression: 0^0"); throw uno::RuntimeException(u"undefined expression: 0^0"_ustr);
if( fX != 0.0 ) if( fX != 0.0 )
{ {

View file

@ -262,7 +262,7 @@ sal_Int32 GetNullDate( const uno::Reference< beans::XPropertySet >& xOpt )
{ {
try try
{ {
uno::Any aAny = xOpt->getPropertyValue( "NullDate" ); uno::Any aAny = xOpt->getPropertyValue( u"NullDate"_ustr );
util::Date aDate; util::Date aDate;
if( aAny >>= aDate ) if( aAny >>= aDate )
return DateToDays( aDate.Day, aDate.Month, aDate.Year ); return DateToDays( aDate.Day, aDate.Month, aDate.Year );

View file

@ -422,7 +422,7 @@ sal_Int32 GetNullDate( const uno::Reference< beans::XPropertySet >& xOptions )
{ {
try try
{ {
uno::Any aAny = xOptions->getPropertyValue( "NullDate" ); uno::Any aAny = xOptions->getPropertyValue( u"NullDate"_ustr );
util::Date aDate; util::Date aDate;
if ( aAny >>= aDate ) if ( aAny >>= aDate )
return DateToDays( aDate.Day, aDate.Month, aDate.Year ); return DateToDays( aDate.Day, aDate.Month, aDate.Year );

View file

@ -141,11 +141,11 @@ void Test::test() {
test::getTestArgument( test::getTestArgument(
u"smoketest.doc", &doc)); u"smoketest.doc", &doc));
css::uno::Sequence< css::beans::PropertyValue > args{ css::uno::Sequence< css::beans::PropertyValue > args{
{ /* Name */ "MacroExecutionMode", { /* Name */ u"MacroExecutionMode"_ustr,
/* Handle */ -1, /* Handle */ -1,
/* Value */ css::uno::Any(css::document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN), /* Value */ css::uno::Any(css::document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN),
/* State */ css::beans::PropertyState_DIRECT_VALUE }, /* State */ css::beans::PropertyState_DIRECT_VALUE },
{ /* Name */ "ReadOnly", { /* Name */ u"ReadOnly"_ustr,
/* Handle */ -1, /* Handle */ -1,
/* Value */ css::uno::Any(true), /* Value */ css::uno::Any(true),
/* State */ css::beans::PropertyState_DIRECT_VALUE } /* State */ css::beans::PropertyState_DIRECT_VALUE }
@ -162,12 +162,12 @@ void Test::test() {
css::uno::Reference< css::frame::XModel >( css::uno::Reference< css::frame::XModel >(
xDesktop->loadComponentFromURL( xDesktop->loadComponentFromURL(
test::toAbsoluteFileUrl(doc), test::toAbsoluteFileUrl(doc),
"_default", u"_default"_ustr,
0, args), 0, args),
css::uno::UNO_QUERY_THROW)->getCurrentController(), css::uno::UNO_QUERY_THROW)->getCurrentController(),
css::uno::UNO_SET_THROW)->getFrame(), css::uno::UNO_SET_THROW)->getFrame(),
css::uno::UNO_QUERY_THROW)->queryDispatch( css::uno::UNO_QUERY_THROW)->queryDispatch(
url, "_self", 0), url, u"_self"_ustr, 0),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
Result result; Result result;
// Shifted to main thread to work around potential deadlocks (i112867): // Shifted to main thread to work around potential deadlocks (i112867):

View file

@ -43,8 +43,8 @@ void StoreTest::createStream()
CPPUNIT_ASSERT_EQUAL(store_E_None, aFile.createInMemory()); CPPUNIT_ASSERT_EQUAL(store_E_None, aFile.createInMemory());
store::OStoreStream aStream; store::OStoreStream aStream;
CPPUNIT_ASSERT_EQUAL(store_E_None, CPPUNIT_ASSERT_EQUAL(store_E_None, aStream.create(aFile, u"testnode"_ustr, u"testname"_ustr,
aStream.create(aFile, "testnode", "testname", storeAccessMode::Create)); storeAccessMode::Create));
aFile.close(); aFile.close();
} }
@ -55,8 +55,8 @@ void StoreTest::writeAndReadByte()
CPPUNIT_ASSERT_EQUAL(store_E_None, aFile.createInMemory()); CPPUNIT_ASSERT_EQUAL(store_E_None, aFile.createInMemory());
store::OStoreStream aStream; store::OStoreStream aStream;
CPPUNIT_ASSERT_EQUAL(store_E_None, CPPUNIT_ASSERT_EQUAL(store_E_None, aStream.create(aFile, u"testnode"_ustr, u"testname"_ustr,
aStream.create(aFile, "testnode", "testname", storeAccessMode::Create)); storeAccessMode::Create));
{ {
std::unique_ptr<sal_uInt8[]> pWriteBuffer(new sal_uInt8[1]); std::unique_ptr<sal_uInt8[]> pWriteBuffer(new sal_uInt8[1]);

View file

@ -646,7 +646,7 @@ static bool performTest(
TestPolyStruct< sal_Int64 > tps1(12345); TestPolyStruct< sal_Int64 > tps1(12345);
xLBT->transportPolyHyper(tps1); xLBT->transportPolyHyper(tps1);
bRet &= check(tps1.member == 12345, "transportPolyHyper"); bRet &= check(tps1.member == 12345, "transportPolyHyper");
Sequence< Any > seq{ Any(static_cast< sal_uInt32 >(33)), Any(OUString("ABC")) }; Sequence< Any > seq{ Any(static_cast< sal_uInt32 >(33)), Any(u"ABC"_ustr) };
TestPolyStruct< Sequence< Any > > tps2(seq); TestPolyStruct< Sequence< Any > > tps2(seq);
TestPolyStruct< Sequence< Any > > tps3; TestPolyStruct< Sequence< Any > > tps3;
xLBT->transportPolySequence(tps2, tps3); xLBT->transportPolySequence(tps2, tps3);
@ -762,8 +762,8 @@ static bool performTest(
Sequence<float> arFloat({1.1f, 2.2f, 3.3f}); Sequence<float> arFloat({1.1f, 2.2f, 3.3f});
Sequence<double> arDouble({1.11, 2.22, 3.33}); Sequence<double> arDouble({1.11, 2.22, 3.33});
Sequence<OUString> arString({ Sequence<OUString> arString({
OUString("String 1"), OUString("String 2"), u"String 1"_ustr, u"String 2"_ustr,
OUString("String 3")}); u"String 3"_ustr});
Sequence<Any> arAny(_arAny, 3); Sequence<Any> arAny(_arAny, 3);
Sequence<Reference<XInterface> > arObject(_arObj, 3); Sequence<Reference<XInterface> > arObject(_arObj, 3);
Sequence<TestEnum> arEnum({ Sequence<TestEnum> arEnum({
@ -1157,7 +1157,7 @@ static bool makeSurrogate(
OUString aCppEnvTypeName( OUString aCppEnvTypeName(
CPPU_CURRENT_LANGUAGE_BINDING_NAME ); CPPU_CURRENT_LANGUAGE_BINDING_NAME );
OUString aUnoEnvTypeName( OUString aUnoEnvTypeName(
UNO_LB_UNO ); u"" UNO_LB_UNO ""_ustr );
// official: // official:
uno_getEnvironment( uno_getEnvironment(
reinterpret_cast< uno_Environment ** >( &aCppEnv_official ), reinterpret_cast< uno_Environment ** >( &aCppEnv_official ),
@ -1175,7 +1175,7 @@ static bool makeSurrogate(
Mapping uno2cpp( aUnoEnv_ano.get(), aCppEnv_ano.get() ); Mapping uno2cpp( aUnoEnv_ano.get(), aCppEnv_ano.get() );
if (!cpp2uno.is() || !uno2cpp.is()) if (!cpp2uno.is() || !uno2cpp.is())
{ {
throw RuntimeException("cannot get C++-UNO mappings!" ); throw RuntimeException(u"cannot get C++-UNO mappings!"_ustr );
} }
cpp2uno.mapInterface( cpp2uno.mapInterface(
reinterpret_cast< void ** >( &unoI.m_pUnoI ), reinterpret_cast< void ** >( &unoI.m_pUnoI ),
@ -1183,7 +1183,7 @@ static bool makeSurrogate(
if (! unoI.is()) if (! unoI.is())
{ {
throw RuntimeException( throw RuntimeException(
"mapping C++ to binary UNO failed!" ); u"mapping C++ to binary UNO failed!"_ustr );
} }
uno2cpp.mapInterface( uno2cpp.mapInterface(
reinterpret_cast< void ** >( &rOut ), reinterpret_cast< void ** >( &rOut ),
@ -1191,7 +1191,7 @@ static bool makeSurrogate(
if (! rOut.is()) if (! rOut.is())
{ {
throw RuntimeException( throw RuntimeException(
"mapping binary UNO to C++ failed!" ); u"mapping binary UNO to C++ failed!"_ustr );
} }
return rOut.is(); return rOut.is();
@ -1205,8 +1205,8 @@ sal_Int32 TestBridgeImpl::run( const Sequence< OUString > & rArgs )
{ {
if (! rArgs.hasElements()) if (! rArgs.hasElements())
{ {
throw RuntimeException( "no test object specified!\n" throw RuntimeException( u"no test object specified!\n"
"usage : ServiceName of test object | -u unourl of test object" ); "usage : ServiceName of test object | -u unourl of test object"_ustr );
} }
Reference< XInterface > xOriginal; Reference< XInterface > xOriginal;
@ -1251,7 +1251,7 @@ sal_Int32 TestBridgeImpl::run( const Sequence< OUString > & rArgs )
if (! xOriginal.is()) if (! xOriginal.is())
{ {
throw RuntimeException( "cannot get test object!" ); throw RuntimeException( u"cannot get test object!"_ustr );
} }
Reference< XBridgeTest > xTest( xOriginal, UNO_QUERY_THROW ); Reference< XBridgeTest > xTest( xOriginal, UNO_QUERY_THROW );
@ -1269,7 +1269,7 @@ sal_Int32 TestBridgeImpl::run( const Sequence< OUString > & rArgs )
bRet = (dynamic_cast<TestBridgeImpl *>(xOriginal.get()) == nullptr) && bRet; bRet = (dynamic_cast<TestBridgeImpl *>(xOriginal.get()) == nullptr) && bRet;
if (! bRet) if (! bRet)
{ {
throw RuntimeException( "error: test failed!" ); throw RuntimeException( u"error: test failed!"_ustr );
} }
} }
catch (const Exception & exc) catch (const Exception & exc)

View file

@ -412,11 +412,11 @@ css::uno::Reference< css::uno::XInterface > create(
OUString getImplementationName() { OUString getImplementationName() {
return return
"comp.test.testtools.bridgetest.Constructors"; u"comp.test.testtools.bridgetest.Constructors"_ustr;
} }
css::uno::Sequence< OUString > getSupportedServiceNames() { css::uno::Sequence< OUString > getSupportedServiceNames() {
return { "test.testtools.bridgetest.Constructors" }; return { u"test.testtools.bridgetest.Constructors"_ustr };
} }
css::uno::Reference< css::uno::XInterface > create2( css::uno::Reference< css::uno::XInterface > create2(
@ -427,11 +427,11 @@ css::uno::Reference< css::uno::XInterface > create2(
} }
OUString getImplementationName2() { OUString getImplementationName2() {
return "comp.test.testtools.bridgetest.Constructors2"; return u"comp.test.testtools.bridgetest.Constructors2"_ustr;
} }
css::uno::Sequence< OUString > getSupportedServiceNames2() { css::uno::Sequence< OUString > getSupportedServiceNames2() {
return { "test.testtools.bridgetest.Constructors2" }; return { u"test.testtools.bridgetest.Constructors2"_ustr };
} }
::cppu::ImplementationEntry const entries[] = { ::cppu::ImplementationEntry const entries[] = {

View file

@ -961,7 +961,7 @@ void Test_Impl::testConstructorsService(
Sequence< float > arg22{ 0.123f }; Sequence< float > arg22{ 0.123f };
Sequence< double > arg23{ 0.456 }; Sequence< double > arg23{ 0.456 };
Sequence< sal_Unicode > arg24{ 'X' }; Sequence< sal_Unicode > arg24{ 'X' };
Sequence< OUString > arg25 { "test" }; Sequence< OUString > arg25 { u"test"_ustr };
Sequence< Type > arg26{ UnoType< Any >::get() }; Sequence< Type > arg26{ UnoType< Any >::get() };
Sequence< Any > arg27{ Any(true) }; Sequence< Any > arg27{ Any(true) };
Sequence< Sequence< sal_Bool > > arg28{ { true } }; Sequence< Sequence< sal_Bool > > arg28{ { true } };
@ -983,7 +983,7 @@ void Test_Impl::testConstructorsService(
0.123f, 0.123f,
0.456, 0.456,
'X', 'X',
"test", u"test"_ustr,
UnoType< Any >::get(), UnoType< Any >::get(),
Any(true), Any(true),
arg14, arg14,
@ -1024,7 +1024,7 @@ void Test_Impl::testConstructorsService(
Any(0.123f), Any(0.123f),
Any(0.456), Any(0.456),
Any(u'X'), Any(u'X'),
Any(OUString("test")), Any(u"test"_ustr),
Any(UnoType< Any >::get()), Any(UnoType< Any >::get()),
Any(true), Any(true),
Any(arg14), Any(arg14),
@ -1074,10 +1074,10 @@ void Test_Impl::testConstructorsService(
Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > > argSeq8 Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > > argSeq8
{ TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > ( { TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>( TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), OUString("test"))) }; TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), u"test"_ustr)) };
Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > argSeq9 Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > argSeq9
{ TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >( { TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
OUString("test"), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >( u"test"_ustr, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
'X', TestPolyStruct<Any>(Any(true)))) }; 'X', TestPolyStruct<Any>(Any(true)))) };
Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> > > argSeq10 Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> > > argSeq10
{ TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >( { TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
@ -1090,10 +1090,10 @@ void Test_Impl::testConstructorsService(
Sequence<Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> > > > argSeq13 Sequence<Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> > > > argSeq13
{ {TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> >( { {TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> >(
TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString>( TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString>(
TestPolyStruct2<sal_Unicode,Any>('X', Any(true)), OUString("test")))} }; TestPolyStruct2<sal_Unicode,Any>('X', Any(true)), u"test"_ustr))} };
Sequence<Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > > argSeq14 Sequence<Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > > argSeq14
{ { TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >( { { TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
OUString("test"), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >( u"test"_ustr, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
'X', TestPolyStruct<Any>(Any(true)))) } }; 'X', TestPolyStruct<Any>(Any(true)))) } };
Sequence<Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> > > > argSeq15 Sequence<Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> > > > argSeq15
{ { TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> >( { { TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> >(
@ -1109,7 +1109,7 @@ void Test_Impl::testConstructorsService(
TestPolyStruct<sal_Int32>(SAL_MIN_INT32), TestPolyStruct<sal_Int32>(SAL_MIN_INT32),
TestPolyStruct<sal_Int64>(SAL_MIN_INT64), TestPolyStruct<sal_Int64>(SAL_MIN_INT64),
TestPolyStruct<sal_Unicode>('X'), TestPolyStruct<sal_Unicode>('X'),
TestPolyStruct<OUString>(OUString("test")), TestPolyStruct<OUString>(u"test"_ustr),
TestPolyStruct<float>(0.123f), TestPolyStruct<float>(0.123f),
TestPolyStruct<double>(0.456), TestPolyStruct<double>(0.456),
TestPolyStruct<Reference<XInterface> >(static_cast<XBridgeTest2*>(this)), TestPolyStruct<Reference<XInterface> >(static_cast<XBridgeTest2*>(this)),
@ -1119,9 +1119,9 @@ void Test_Impl::testConstructorsService(
TestPolyStruct2<sal_Unicode, Any>('X', Any(true))), TestPolyStruct2<sal_Unicode, Any>('X', Any(true))),
TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > ( TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>( TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), OUString("test"))), TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), u"test"_ustr)),
TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode,TestPolyStruct<Any> > >( TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode,TestPolyStruct<Any> > >(
OUString("test"), u"test"_ustr,
TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >('X', TestPolyStruct<Any>(Any(true)))), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >('X', TestPolyStruct<Any>(Any(true)))),
TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >( TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), TestPolyStruct2<sal_Unicode, Any>('X', Any(true)),

View file

@ -118,30 +118,30 @@ OUString testMulti( css::uno::Reference< test::testtools::bridgetest::XMulti >
css::uno::Reference< test::testtools::bridgetest::XMultiBase5 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase5 >(
multi, css::uno::UNO_QUERY_THROW)->fn11(5)); multi, css::uno::UNO_QUERY_THROW)->fn11(5));
checkEqual( checkEqual(
OUString("12" "abc"), u"12" "abc"_ustr,
css::uno::Reference< test::testtools::bridgetest::XMultiBase1 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase1 >(
multi, css::uno::UNO_QUERY_THROW)->fn12( multi, css::uno::UNO_QUERY_THROW)->fn12(
"abc")); u"abc"_ustr));
checkEqual( checkEqual(
OUString("12" "abc-2"), u"12" "abc-2"_ustr,
static_cast< test::testtools::bridgetest::XMultiBase2 * >( static_cast< test::testtools::bridgetest::XMultiBase2 * >(
multi.get())->fn12("abc-2")); multi.get())->fn12(u"abc-2"_ustr));
checkEqual( checkEqual(
OUString("12" "abc-2"), u"12" "abc-2"_ustr,
css::uno::Reference< test::testtools::bridgetest::XMultiBase2 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase2 >(
multi, css::uno::UNO_QUERY_THROW)->fn12("abc-2")); multi, css::uno::UNO_QUERY_THROW)->fn12(u"abc-2"_ustr));
checkEqual( checkEqual(
OUString("12" "abc-5"), u"12" "abc-5"_ustr,
static_cast< test::testtools::bridgetest::XMultiBase5 * >( static_cast< test::testtools::bridgetest::XMultiBase5 * >(
multi.get())->fn12("abc-5")); multi.get())->fn12(u"abc-5"_ustr));
checkEqual( checkEqual(
OUString("12" "abc-5"), u"12" "abc-5"_ustr,
css::uno::Reference< test::testtools::bridgetest::XMultiBase5 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase5 >(
multi, css::uno::UNO_QUERY_THROW)->fn12("abc-5")); multi, css::uno::UNO_QUERY_THROW)->fn12(u"abc-5"_ustr));
checkEqual< sal_Int32 >(21 * 2, multi->fn21(2)); checkEqual< sal_Int32 >(21 * 2, multi->fn21(2));
checkEqual( checkEqual(
OUString("22" "de"), u"22" "de"_ustr,
multi->fn22("de")); multi->fn22(u"de"_ustr));
checkEqual< sal_Int32 >( checkEqual< sal_Int32 >(
31 * 3, 31 * 3,
css::uno::Reference< test::testtools::bridgetest::XMultiBase3 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase3 >(
@ -181,17 +181,17 @@ OUString testMulti( css::uno::Reference< test::testtools::bridgetest::XMulti >
css::uno::Reference< test::testtools::bridgetest::XMultiBase5 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase5 >(
multi, css::uno::UNO_QUERY_THROW)->getatt3()); multi, css::uno::UNO_QUERY_THROW)->getatt3());
checkEqual( checkEqual(
OUString("32" "f"), u"32" "f"_ustr,
css::uno::Reference< test::testtools::bridgetest::XMultiBase3 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase3 >(
multi, css::uno::UNO_QUERY_THROW)->fn32("f")); multi, css::uno::UNO_QUERY_THROW)->fn32(u"f"_ustr));
checkEqual( checkEqual(
OUString("32" "f-5"), u"32" "f-5"_ustr,
static_cast< test::testtools::bridgetest::XMultiBase5 * >( static_cast< test::testtools::bridgetest::XMultiBase5 * >(
multi.get())->fn32("f-5")); multi.get())->fn32(u"f-5"_ustr));
checkEqual( checkEqual(
OUString("32" "f-5"), u"32" "f-5"_ustr,
css::uno::Reference< test::testtools::bridgetest::XMultiBase5 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase5 >(
multi, css::uno::UNO_QUERY_THROW)->fn32("f-5")); multi, css::uno::UNO_QUERY_THROW)->fn32(u"f-5"_ustr));
checkEqual< sal_Int32 >( checkEqual< sal_Int32 >(
33, 33,
css::uno::Reference< test::testtools::bridgetest::XMultiBase3 >( css::uno::Reference< test::testtools::bridgetest::XMultiBase3 >(
@ -207,12 +207,12 @@ OUString testMulti( css::uno::Reference< test::testtools::bridgetest::XMulti >
checkEqual< sal_Int32 >(41 * 4, multi->fn41(4)); checkEqual< sal_Int32 >(41 * 4, multi->fn41(4));
checkEqual< sal_Int32 >(61 * 6, multi->fn61(6)); checkEqual< sal_Int32 >(61 * 6, multi->fn61(6));
checkEqual( checkEqual(
OUString("62" ""), u"62" ""_ustr,
multi->fn62(OUString())); multi->fn62(OUString()));
checkEqual< sal_Int32 >(71 * 7, multi->fn71(7)); checkEqual< sal_Int32 >(71 * 7, multi->fn71(7));
checkEqual( checkEqual(
OUString("72" "g"), u"72" "g"_ustr,
multi->fn72("g")); multi->fn72(u"g"_ustr));
checkEqual< sal_Int32 >(73, multi->fn73()); checkEqual< sal_Int32 >(73, multi->fn73());
} catch (CheckFailed const & f) { } catch (CheckFailed const & f) {
return f.message; return f.message;

View file

@ -781,18 +781,18 @@ static OString generateClassDefinition(std::ostream& o,
<< scopedCppName(u2b(propertyhelper)) << " >(\n" << scopedCppName(u2b(propertyhelper)) << " >(\n"
" context, static_cast< Implements >(\n "; " context, static_cast< Implements >(\n ";
OStringBuffer buffer(128); OStringBuffer buffer(128);
if (propinterfaces.find("com/sun/star/beans/XPropertySet") if (propinterfaces.find(u"com/sun/star/beans/XPropertySet"_ustr)
!= propinterfaces.end()) { != propinterfaces.end()) {
buffer.append("IMPLEMENTS_PROPERTY_SET"); buffer.append("IMPLEMENTS_PROPERTY_SET");
} }
if (propinterfaces.find("com/sun/star/beans/XFastPropertySet") if (propinterfaces.find(u"com/sun/star/beans/XFastPropertySet"_ustr)
!= propinterfaces.end()) { != propinterfaces.end()) {
if (!buffer.isEmpty()) if (!buffer.isEmpty())
buffer.append(" | IMPLEMENTS_FAST_PROPERTY_SET"); buffer.append(" | IMPLEMENTS_FAST_PROPERTY_SET");
else else
buffer.append("IMPLEMENTS_FAST_PROPERTY_SET"); buffer.append("IMPLEMENTS_FAST_PROPERTY_SET");
} }
if (propinterfaces.find("com/sun/star/beans/XPropertyAccess") if (propinterfaces.find(u"com/sun/star/beans/XPropertyAccess"_ustr)
!= propinterfaces.end()) { != propinterfaces.end()) {
if (!buffer.isEmpty()) if (!buffer.isEmpty())
buffer.append(" | IMPLEMENTS_PROPERTY_ACCESS"); buffer.append(" | IMPLEMENTS_PROPERTY_ACCESS");
@ -945,9 +945,9 @@ void generateSkeleton(ProgramOptions const & options,
// so it is defaulted. The XDispatchProvider provides Dispatch objects for // so it is defaulted. The XDispatchProvider provides Dispatch objects for
// certain functions and the generated impl object implements XDispatch // certain functions and the generated impl object implements XDispatch
// directly for simplicity reasons. // directly for simplicity reasons.
checkType(manager, "com.sun.star.frame.ProtocolHandler", checkType(manager, u"com.sun.star.frame.ProtocolHandler"_ustr,
interfaces, services, properties); interfaces, services, properties);
checkType(manager, "com.sun.star.frame.XDispatch", checkType(manager, u"com.sun.star.frame.XDispatch"_ustr,
interfaces, services, properties); interfaces, services, properties);
} }
@ -962,8 +962,8 @@ void generateSkeleton(ProgramOptions const & options,
if (interfaces.size() > 12) if (interfaces.size() > 12)
throw CannotDumpException( throw CannotDumpException(
"the skeletonmaker supports components with 12 interfaces " u"the skeletonmaker supports components with 12 interfaces "
"only (limitation of the UNO implementation helpers)!"); "only (limitation of the UNO implementation helpers)!"_ustr);
supportxcomponent = checkXComponentSupport(manager, interfaces); supportxcomponent = checkXComponentSupport(manager, interfaces);
@ -1075,8 +1075,8 @@ void generateCalcAddin(ProgramOptions const & options,
OUString sAddinService; OUString sAddinService;
if (services.size() != 1) { if (services.size() != 1) {
throw CannotDumpException( throw CannotDumpException(
"for calc add-in components one and only one service type is necessary!" u"for calc add-in components one and only one service type is necessary!"
" Please reference a valid type with the '-t' option."); " Please reference a valid type with the '-t' option."_ustr);
} }
@ -1093,13 +1093,13 @@ void generateCalcAddin(ProgramOptions const & options,
// taken from the configuration from Calc directly, this simplifies the // taken from the configuration from Calc directly, this simplifies the
// add-in code // add-in code
if (options.backwardcompatible) { if (options.backwardcompatible) {
checkType(manager, "com.sun.star.sheet.AddIn", checkType(manager, u"com.sun.star.sheet.AddIn"_ustr,
interfaces, services, properties); interfaces, services, properties);
} else { } else {
// special case for the optional XLocalization interface. It should be // special case for the optional XLocalization interface. It should be
// implemented always. But it is parent of the XAddIn and we need it only // implemented always. But it is parent of the XAddIn and we need it only
// if backwardcompatible is false. // if backwardcompatible is false.
interfaces.insert("com.sun.star.lang.XLocalizable"); interfaces.insert(u"com.sun.star.lang.XLocalizable"_ustr);
} }
OUString propertyhelper = checkPropertyHelper( OUString propertyhelper = checkPropertyHelper(
@ -1113,8 +1113,8 @@ void generateCalcAddin(ProgramOptions const & options,
if (interfaces.size() > 12) { if (interfaces.size() > 12) {
throw CannotDumpException( throw CannotDumpException(
"the skeletonmaker supports components with 12 interfaces " u"the skeletonmaker supports components with 12 interfaces "
"only (limitation of the UNO implementation helpers)!"); "only (limitation of the UNO implementation helpers)!"_ustr);
} }
// check if service object or simple UNO object // check if service object or simple UNO object

View file

@ -820,17 +820,17 @@ void generateSkeleton(ProgramOptions const & options,
// so it is defaulted. The XDispatchProvider provides Dispatch objects for // so it is defaulted. The XDispatchProvider provides Dispatch objects for
// certain functions and the generated impl object implements XDispatch // certain functions and the generated impl object implements XDispatch
// directly for simplicity reasons. // directly for simplicity reasons.
checkType(manager, "com.sun.star.frame.ProtocolHandler", checkType(manager, u"com.sun.star.frame.ProtocolHandler"_ustr,
interfaces, services, properties); interfaces, services, properties);
checkType(manager, "com.sun.star.frame.XDispatch", checkType(manager, u"com.sun.star.frame.XDispatch"_ustr,
interfaces, services, properties); interfaces, services, properties);
} }
if (options.componenttype == 2) { if (options.componenttype == 2) {
if (services.size() != 1) { if (services.size() != 1) {
throw CannotDumpException( throw CannotDumpException(
"for calc add-in components one and only one service type is " u"for calc add-in components one and only one service type is "
"necessary! Please reference a valid type with the '-t' option."); "necessary! Please reference a valid type with the '-t' option."_ustr);
} }
// if backwardcompatible==true the AddIn service needs to be added to the // if backwardcompatible==true the AddIn service needs to be added to the
@ -839,13 +839,13 @@ void generateSkeleton(ProgramOptions const & options,
// taken from the configuration from Calc directly, this simplifies the // taken from the configuration from Calc directly, this simplifies the
// add-in code // add-in code
if (options.backwardcompatible) { if (options.backwardcompatible) {
checkType(manager, "com.sun.star.sheet.AddIn", checkType(manager, u"com.sun.star.sheet.AddIn"_ustr,
interfaces, services, properties); interfaces, services, properties);
} else { } else {
// special case for the optional XLocalization interface. It should be // special case for the optional XLocalization interface. It should be
// implemented always. But it is parent of the XAddIn and we need it only // implemented always. But it is parent of the XAddIn and we need it only
// if backwardcompatible is false. // if backwardcompatible is false.
interfaces.insert("com.sun.star.lang.XLocalizable"); interfaces.insert(u"com.sun.star.lang.XLocalizable"_ustr);
} }
} }

View file

@ -188,7 +188,7 @@ void checkType(rtl::Reference< TypeManager > const & manager,
(ent2->getConstructors().size() == 1 && (ent2->getConstructors().size() == 1 &&
!ent2->getConstructors()[0].defaultConstructor)) !ent2->getConstructors()[0].defaultConstructor))
{ {
interfaceTypes.insert(OUString("com.sun.star.lang.XInitialization")); interfaceTypes.insert(u"com.sun.star.lang.XInitialization"_ustr);
} }
} }
} }
@ -228,15 +228,15 @@ void checkDefaultInterfaces(
std::u16string_view propertyhelper) std::u16string_view propertyhelper)
{ {
if ( services.empty() ) { if ( services.empty() ) {
interfaces.erase("com.sun.star.lang.XServiceInfo"); interfaces.erase(u"com.sun.star.lang.XServiceInfo"_ustr);
} else { } else {
interfaces.insert("com.sun.star.lang.XServiceInfo"); interfaces.insert(u"com.sun.star.lang.XServiceInfo"_ustr);
} }
if ( propertyhelper == u"_" ) { if ( propertyhelper == u"_" ) {
interfaces.erase("com.sun.star.beans.XPropertySet"); interfaces.erase(u"com.sun.star.beans.XPropertySet"_ustr);
interfaces.erase("com.sun.star.beans.XFastPropertySet"); interfaces.erase(u"com.sun.star.beans.XFastPropertySet"_ustr);
interfaces.erase("com.sun.star.beans.XPropertyAccess"); interfaces.erase(u"com.sun.star.beans.XPropertyAccess"_ustr);
} }
} }
@ -314,7 +314,7 @@ OUString checkPropertyHelper(
++iter; ++iter;
} }
return oldStyleWithProperties ? OUString("_") : OUString(); return oldStyleWithProperties ? u"_"_ustr : OUString();
} }
static bool checkXComponentSupport( static bool checkXComponentSupport(
@ -349,7 +349,7 @@ bool checkXComponentSupport(rtl::Reference< TypeManager > const & manager,
for ( const auto& rIface : interfaces ) { for ( const auto& rIface : interfaces ) {
if ( rIface == "com.sun.star.lang.XComponent" ) { if ( rIface == "com.sun.star.lang.XComponent" ) {
interfaces.erase("com.sun.star.lang.XComponent"); interfaces.erase(u"com.sun.star.lang.XComponent"_ustr);
return true; return true;
} }
if ( checkXComponentSupport(manager, rIface) ) if ( checkXComponentSupport(manager, rIface) )
@ -467,13 +467,11 @@ static void checkAddInTypes(
+ " parameter of the calc add-in function '" + name + " parameter of the calc add-in function '" + name
+ ":" + rMethod.name + "' is invalid." + ":" + rMethod.name + "' is invalid."
+ (bLastAny + (bLastAny
? OUString( ? u" The type 'sequence<any>' is allowed as last"
" The type 'sequence<any>' is allowed as last" " parameter only."_ustr
" parameter only.")
: OUString()) : OUString())
+ (bHasXPropertySet + (bHasXPropertySet
? OUString( ? u" The type 'XPropertySet' is allowed only once."_ustr
" The type 'XPropertySet' is allowed only once.")
: OUString()) : OUString())
+ " Please check your IDL definition."); + " Please check your IDL definition.");
} }

View file

@ -69,7 +69,7 @@ MacrosTest::loadFromDesktop(const OUString& rURL, const OUString& rDocService,
args.insert(args.end(), rExtraArgs.begin(), rExtraArgs.end()); args.insert(args.end(), rExtraArgs.begin(), rExtraArgs.end());
uno::Reference<lang::XComponent> xComponent = mxDesktop->loadComponentFromURL( uno::Reference<lang::XComponent> xComponent = mxDesktop->loadComponentFromURL(
rURL, "_default", 0, comphelper::containerToSequence(args)); rURL, u"_default"_ustr, 0, comphelper::containerToSequence(args));
OUString sMessage = "loading failed: " + rURL; OUString sMessage = "loading failed: " + rURL;
CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sMessage, RTL_TEXTENCODING_UTF8).getStr(), CPPUNIT_ASSERT_MESSAGE(OUStringToOString(sMessage, RTL_TEXTENCODING_UTF8).getStr(),
xComponent.is()); xComponent.is());
@ -139,7 +139,7 @@ void MacrosTest::setUpX509(const test::Directories& rDirectories, const OUString
osl::File::copy(aSourceDir + "key4.db", aTargetDir + "/key4.db"); osl::File::copy(aSourceDir + "key4.db", aTargetDir + "/key4.db");
osl::File::copy(aSourceDir + "pkcs11.txt", aTargetDir + "/pkcs11.txt"); osl::File::copy(aSourceDir + "pkcs11.txt", aTargetDir + "/pkcs11.txt");
OUString mozCertVar("MOZILLA_CERTIFICATE_FOLDER"); OUString mozCertVar(u"MOZILLA_CERTIFICATE_FOLDER"_ustr);
// explicit prefix with "sql:" needed for CentOS7 system NSS 3.67 // explicit prefix with "sql:" needed for CentOS7 system NSS 3.67
osl_setEnvironment(mozCertVar.pData, OUString("sql:" + aTargetPath).pData); osl_setEnvironment(mozCertVar.pData, OUString("sql:" + aTargetPath).pData);
#endif #endif
@ -160,7 +160,7 @@ void MacrosTest::setUpGpg(const test::Directories& rDirectories, const OUString&
osl::File::copy(aSourceDir + "secring.gpg", aTargetDir + "/secring.gpg"); osl::File::copy(aSourceDir + "secring.gpg", aTargetDir + "/secring.gpg");
osl::File::copy(aSourceDir + "trustdb.gpg", aTargetDir + "/trustdb.gpg"); osl::File::copy(aSourceDir + "trustdb.gpg", aTargetDir + "/trustdb.gpg");
OUString gpgHomeVar("GNUPGHOME"); OUString gpgHomeVar(u"GNUPGHOME"_ustr);
osl_setEnvironment(gpgHomeVar.pData, aTargetPath.pData); osl_setEnvironment(gpgHomeVar.pData, aTargetPath.pData);
#if HAVE_GPGCONF_SOCKETDIR #if HAVE_GPGCONF_SOCKETDIR

View file

@ -50,20 +50,20 @@ void OfficeConnection::setUp() {
u"soffice", u"soffice",
&argSoffice)); &argSoffice));
if (argSoffice.match("path:")) { if (argSoffice.match("path:")) {
desc = "pipe,name=" + osl::test::uniquePipeName("oootest"); desc = "pipe,name=" + osl::test::uniquePipeName(u"oootest"_ustr);
OUString noquickArg("--quickstart=no"); OUString noquickArg(u"--quickstart=no"_ustr);
OUString norestoreArg("--norestore"); OUString norestoreArg(u"--norestore"_ustr);
OUString nologoArg("--nologo"); OUString nologoArg(u"--nologo"_ustr);
// disable use of the unix standalone splash screen app for the // disable use of the unix standalone splash screen app for the
// tests (probably not needed in combination with --headless?) // tests (probably not needed in combination with --headless?)
OUString headlessArg("--headless"); OUString headlessArg(u"--headless"_ustr);
OUString acceptArg("--accept=" + desc + ";urp"); OUString acceptArg("--accept=" + desc + ";urp");
OUString argUser; OUString argUser;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
getArgument(u"user", &argUser)); getArgument(u"user", &argUser));
OUString userArg("-env:UserInstallation=" + toAbsoluteFileUrl(argUser)); OUString userArg("-env:UserInstallation=" + toAbsoluteFileUrl(argUser));
OUString jreArg( OUString jreArg(
"-env:UNO_JAVA_JFW_ENV_JREHOME=true"); u"-env:UNO_JAVA_JFW_ENV_JREHOME=true"_ustr);
rtl_uString * args[] = { rtl_uString * args[] = {
noquickArg.pData, norestoreArg.pData, noquickArg.pData, norestoreArg.pData,
nologoArg.pData, headlessArg.pData, acceptArg.pData, userArg.pData, nologoArg.pData, headlessArg.pData, acceptArg.pData, userArg.pData,

View file

@ -207,7 +207,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools
public: public:
SvmTest() SvmTest()
: BootstrapFixture(true, false) : BootstrapFixture(true, false)
, maDataUrl("/vcl/qa/cppunit/svm/data/") , maDataUrl(u"/vcl/qa/cppunit/svm/data/"_ustr)
{} {}
CPPUNIT_TEST_SUITE(SvmTest); CPPUNIT_TEST_SUITE(SvmTest);
@ -363,22 +363,22 @@ xmlDocUniquePtr SvmTest::dumpMeta(const GDIMetaFile& rMetaFile)
void SvmTest::checkVirtualDevice(const xmlDocUniquePtr& pDoc) void SvmTest::checkVirtualDevice(const xmlDocUniquePtr& pDoc)
{ {
assertXPath(pDoc, "/metafile/linecolor[1]"_ostr, "color"_ostr, "#000000"); assertXPath(pDoc, "/metafile/linecolor[1]"_ostr, "color"_ostr, u"#000000"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[1]"_ostr, "color"_ostr, "#ffffff"); assertXPath(pDoc, "/metafile/fillcolor[1]"_ostr, "color"_ostr, u"#ffffff"_ustr);
assertXPathAttrs(pDoc, "/metafile/rect[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/rect[1]"_ostr, {
{"left", "0"}, {"top", "0"}, {"left", "0"}, {"top", "0"},
{"right", "9"}, {"bottom", "9"} {"right", "9"}, {"bottom", "9"}
}); });
assertXPath(pDoc, "/metafile/linecolor[2]"_ostr, "color"_ostr, "#000000"); assertXPath(pDoc, "/metafile/linecolor[2]"_ostr, "color"_ostr, u"#000000"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[2]"_ostr, "color"_ostr, "#ffffff"); assertXPath(pDoc, "/metafile/fillcolor[2]"_ostr, "color"_ostr, u"#ffffff"_ustr);
} }
void SvmTest::checkErase(const xmlDocUniquePtr& pDoc) void SvmTest::checkErase(const xmlDocUniquePtr& pDoc)
{ {
assertXPath(pDoc, "/metafile/linecolor[3]"_ostr, "color"_ostr, "#000000"); assertXPath(pDoc, "/metafile/linecolor[3]"_ostr, "color"_ostr, u"#000000"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[3]"_ostr, "color"_ostr, "#ff0000"); assertXPath(pDoc, "/metafile/fillcolor[3]"_ostr, "color"_ostr, u"#ff0000"_ustr);
assertXPathAttrs(pDoc, "/metafile/rect[2]"_ostr, { assertXPathAttrs(pDoc, "/metafile/rect[2]"_ostr, {
{"left", "0"}, {"top", "0"}, {"left", "0"}, {"top", "0"},
@ -490,8 +490,8 @@ void SvmTest::checkRect(const GDIMetaFile& rMetaFile)
xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); xmlDocUniquePtr pDoc = dumpMeta(rMetaFile);
assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, "#123456"); assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, u"#123456"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, "#654321"); assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, u"#654321"_ustr);
assertXPathAttrs(pDoc, "/metafile/rect[3]"_ostr, { assertXPathAttrs(pDoc, "/metafile/rect[3]"_ostr, {
{"left", "1"}, {"top", "2"}, {"left", "1"}, {"top", "2"},
@ -518,8 +518,8 @@ void SvmTest::checkRoundRect(const GDIMetaFile& rMetaFile)
{ {
xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); xmlDocUniquePtr pDoc = dumpMeta(rMetaFile);
assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, "#123456"); assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, u"#123456"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, "#654321"); assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, u"#654321"_ustr);
assertXPathAttrs(pDoc, "/metafile/roundrect[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/roundrect[1]"_ostr, {
{"left", "1"}, {"top", "2"}, {"left", "1"}, {"top", "2"},
@ -547,8 +547,8 @@ void SvmTest::checkEllipse(const GDIMetaFile& rMetaFile)
{ {
xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); xmlDocUniquePtr pDoc = dumpMeta(rMetaFile);
assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, "#123456"); assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, u"#123456"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, "#654321"); assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, u"#654321"_ustr);
assertXPathAttrs(pDoc, "/metafile/ellipse[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/ellipse[1]"_ostr, {
{"left", "1"}, {"top", "2"}, {"left", "1"}, {"top", "2"},
@ -575,8 +575,8 @@ void SvmTest::checkArc(const GDIMetaFile& rMetaFile)
{ {
xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); xmlDocUniquePtr pDoc = dumpMeta(rMetaFile);
assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, "#123456"); assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, u"#123456"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, "#654321"); assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, u"#654321"_ustr);
assertXPathAttrs(pDoc, "/metafile/arc[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/arc[1]"_ostr, {
{"left", "1"}, {"top", "2"}, {"left", "1"}, {"top", "2"},
@ -606,8 +606,8 @@ void SvmTest::checkPie(const GDIMetaFile& rMetaFile)
{ {
xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); xmlDocUniquePtr pDoc = dumpMeta(rMetaFile);
assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, "#123456"); assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, u"#123456"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, "#654321"); assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, u"#654321"_ustr);
assertXPathAttrs(pDoc, "/metafile/pie[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/pie[1]"_ostr, {
{"left", "11"}, {"top", "12"}, {"left", "11"}, {"top", "12"},
@ -637,8 +637,8 @@ void SvmTest::checkChord(const GDIMetaFile& rMetaFile)
{ {
xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); xmlDocUniquePtr pDoc = dumpMeta(rMetaFile);
assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, "#123456"); assertXPath(pDoc, "/metafile/linecolor[5]"_ostr, "color"_ostr, u"#123456"_ustr);
assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, "#654321"); assertXPath(pDoc, "/metafile/fillcolor[5]"_ostr, "color"_ostr, u"#654321"_ustr);
assertXPathAttrs(pDoc, "/metafile/chord[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/chord[1]"_ostr, {
{"left", "21"}, {"top", "22"}, {"left", "21"}, {"top", "22"},
@ -830,7 +830,7 @@ void SvmTest::checkText(const GDIMetaFile& rMetaFile)
{"x", "4"}, {"y", "6"}, {"index", "1"}, {"length", "2"}, {"x", "4"}, {"y", "6"}, {"index", "1"}, {"length", "2"},
}); });
assertXPathContent(pDoc, "/metafile/text[1]/textcontent"_ostr, "xABC"); assertXPathContent(pDoc, "/metafile/text[1]/textcontent"_ostr, u"xABC"_ustr);
} }
void SvmTest::testText() void SvmTest::testText()
@ -839,7 +839,7 @@ void SvmTest::testText()
ScopedVclPtrInstance<VirtualDevice> pVirtualDev; ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
pVirtualDev->DrawText(Point(4,6), "xABC", 1, 2); pVirtualDev->DrawText(Point(4,6), u"xABC"_ustr, 1, 2);
checkText(writeAndReadStream(aGDIMetaFile)); checkText(writeAndReadStream(aGDIMetaFile));
checkText(readFile(u"text.svm")); checkText(readFile(u"text.svm"));
@ -852,8 +852,8 @@ void SvmTest::checkTextArray(const GDIMetaFile& rMetaFile)
assertXPathAttrs(pDoc, "/metafile/textarray[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/textarray[1]"_ostr, {
{"x", "4"}, {"y", "6"}, {"index", "1"}, {"length", "4"}, {"x", "4"}, {"y", "6"}, {"index", "1"}, {"length", "4"},
}); });
assertXPathContent(pDoc, "/metafile/textarray[1]/dxarray"_ostr, "15 20 25 "); assertXPathContent(pDoc, "/metafile/textarray[1]/dxarray"_ostr, u"15 20 25 "_ustr);
assertXPathContent(pDoc, "/metafile/textarray[1]/text"_ostr, "123456"); assertXPathContent(pDoc, "/metafile/textarray[1]/text"_ostr, u"123456"_ustr);
} }
void SvmTest::testTextArray() void SvmTest::testTextArray()
@ -862,7 +862,7 @@ void SvmTest::testTextArray()
ScopedVclPtrInstance<VirtualDevice> pVirtualDev; ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
sal_Int32 const aDX[] = { 10, 15, 20, 25, 30, 35 }; sal_Int32 const aDX[] = { 10, 15, 20, 25, 30, 35 };
pVirtualDev->DrawTextArray(Point(4,6), "123456", KernArraySpan(aDX), {}, 1, 4); pVirtualDev->DrawTextArray(Point(4,6), u"123456"_ustr, KernArraySpan(aDX), {}, 1, 4);
checkTextArray(writeAndReadStream(aGDIMetaFile)); checkTextArray(writeAndReadStream(aGDIMetaFile));
checkTextArray(readFile(u"textarray.svm")); checkTextArray(readFile(u"textarray.svm"));
@ -876,7 +876,7 @@ void SvmTest::checkstretchText(const GDIMetaFile& rMetaFile)
{"x", "4"}, {"y", "6"}, {"index", "1"}, {"length", "4"}, {"width", "10"} {"x", "4"}, {"y", "6"}, {"index", "1"}, {"length", "4"}, {"width", "10"}
}); });
assertXPathContent(pDoc, "/metafile/stretchtext[1]/textcontent"_ostr, "123456"); assertXPathContent(pDoc, "/metafile/stretchtext[1]/textcontent"_ostr, u"123456"_ustr);
} }
void SvmTest::teststretchText() void SvmTest::teststretchText()
@ -884,7 +884,7 @@ void SvmTest::teststretchText()
GDIMetaFile aGDIMetaFile; GDIMetaFile aGDIMetaFile;
ScopedVclPtrInstance<VirtualDevice> pVirtualDev; ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
pVirtualDev->DrawStretchText(Point(4,6), 10, "123456", 1, 4); pVirtualDev->DrawStretchText(Point(4,6), 10, u"123456"_ustr, 1, 4);
checkstretchText(writeAndReadStream(aGDIMetaFile)); checkstretchText(writeAndReadStream(aGDIMetaFile));
checkstretchText(readFile(u"strecthtext.svm")); checkstretchText(readFile(u"strecthtext.svm"));
@ -897,8 +897,8 @@ void SvmTest::checkTextRect(const GDIMetaFile& rMetaFile)
assertXPathAttrs(pDoc, "/metafile/textrect[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/textrect[1]"_ostr, {
{"left", "0"}, {"top", "0"}, {"right", "4"}, {"bottom", "4"} {"left", "0"}, {"top", "0"}, {"right", "4"}, {"bottom", "4"}
}); });
assertXPathContent(pDoc, "/metafile/textrect[1]/textcontent"_ostr, "123456"); assertXPathContent(pDoc, "/metafile/textrect[1]/textcontent"_ostr, u"123456"_ustr);
assertXPathContent(pDoc, "/metafile/textrect[1]/style"_ostr, "Center"); assertXPathContent(pDoc, "/metafile/textrect[1]/style"_ostr, u"Center"_ustr);
} }
void SvmTest::testTextRect() void SvmTest::testTextRect()
@ -906,7 +906,7 @@ void SvmTest::testTextRect()
GDIMetaFile aGDIMetaFile; GDIMetaFile aGDIMetaFile;
ScopedVclPtrInstance<VirtualDevice> pVirtualDev; ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
pVirtualDev->DrawText(tools::Rectangle(Point(0,0), Size(5,5)), "123456", DrawTextFlags::Center); pVirtualDev->DrawText(tools::Rectangle(Point(0,0), Size(5,5)), u"123456"_ustr, DrawTextFlags::Center);
checkTextRect(writeAndReadStream(aGDIMetaFile)); checkTextRect(writeAndReadStream(aGDIMetaFile));
checkTextRect(readFile(u"textrectangle.svm")); checkTextRect(readFile(u"textrectangle.svm"));
@ -1028,34 +1028,34 @@ void SvmTest::checkBitmapExs(const GDIMetaFile& rMetaFile, bool bIsSvmFile)
"742c3e35", "742c3e35",
#else #else
#if !ENABLE_CAIRO_RGBA #if !ENABLE_CAIRO_RGBA
"ac936607", // typical BGRA little-endian config u"ac936607"_ustr, // typical BGRA little-endian config
#else #else
"ecd75a28", // atypical RGBA little-endian config "ecd75a28", // atypical RGBA little-endian config
#endif #endif
"4937e32d", u"4937e32d"_ustr,
#if !ENABLE_CAIRO_RGBA #if !ENABLE_CAIRO_RGBA
"3789377b", // typical BGRA little-endian config u"3789377b"_ustr, // typical BGRA little-endian config
#else #else
"469f0820", // atypical RGBA little-endian config "469f0820", // atypical RGBA little-endian config
#endif #endif
"839e8cce", u"839e8cce"_ustr,
"236aaf55", // 1-bit u"236aaf55"_ustr, // 1-bit
"2949ccc7", // 4-bit color bitmap - same as 8-bit color bitmap u"2949ccc7"_ustr, // 4-bit color bitmap - same as 8-bit color bitmap
"2949ccc7", u"2949ccc7"_ustr,
"e5df8aad", u"e5df8aad"_ustr,
#endif #endif
}; };
static const std::array<OUString, 8> aExpectedContentChecksum static const std::array<OUString, 8> aExpectedContentChecksum
{ {
"26bdebd04e5b18d685cea04982179e273ee3b659", u"26bdebd04e5b18d685cea04982179e273ee3b659"_ustr,
"f4f52df6ef965a2f0fbccbe6aca35ba3457cf9d5", u"f4f52df6ef965a2f0fbccbe6aca35ba3457cf9d5"_ustr,
"7c953a06d34bbd38897f950d595df2880dbb0f75", u"7c953a06d34bbd38897f950d595df2880dbb0f75"_ustr,
"ca3e5cdde1c395e1ee76d339a5bf6e46fbac3249", u"ca3e5cdde1c395e1ee76d339a5bf6e46fbac3249"_ustr,
"8a1ebc46f890eb0879464c6e293bffd4ce7fadc0", // 1-bit u"8a1ebc46f890eb0879464c6e293bffd4ce7fadc0"_ustr, // 1-bit
"23611fc9f484c23e45bbd457730adb8ab5355509", // 4-bit color bitmap - same as 8-bit color bitmap u"23611fc9f484c23e45bbd457730adb8ab5355509"_ustr, // 4-bit color bitmap - same as 8-bit color bitmap
"23611fc9f484c23e45bbd457730adb8ab5355509", u"23611fc9f484c23e45bbd457730adb8ab5355509"_ustr,
"97e499b74104debf12f99a774a2c4edc914d8900", u"97e499b74104debf12f99a774a2c4edc914d8900"_ustr,
}; };
assertXPathAttrs(pDoc, "/metafile/bmpex[1]"_ostr, { assertXPathAttrs(pDoc, "/metafile/bmpex[1]"_ostr, {
@ -1991,8 +1991,8 @@ void SvmTest::testFont()
setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
vcl::Font aFont(FontFamily::FAMILY_SCRIPT, Size(15, 15)); vcl::Font aFont(FontFamily::FAMILY_SCRIPT, Size(15, 15));
aFont.SetWeight(FontWeight::WEIGHT_THIN); aFont.SetWeight(FontWeight::WEIGHT_THIN);
aFont.SetFamilyName("Liberation Sans"); aFont.SetFamilyName(u"Liberation Sans"_ustr);
aFont.SetStyleName("Regular"); aFont.SetStyleName(u"Regular"_ustr);
aFont.SetFontHeight(12); aFont.SetFontHeight(12);
aFont.SetAverageFontWidth(12); aFont.SetAverageFontWidth(12);
aFont.SetVertical(true); aFont.SetVertical(true);
@ -2273,7 +2273,7 @@ void SvmTest::checkComment(const GDIMetaFile& rMetafile)
{"value", "0"} {"value", "0"}
}); });
assertXPathContent(pDoc, "/metafile/comment[1]/comment[1]"_ostr, "Test comment"); assertXPathContent(pDoc, "/metafile/comment[1]/comment[1]"_ostr, u"Test comment"_ustr);
assertXPathAttrs(pDoc, "/metafile/comment[2]"_ostr, { assertXPathAttrs(pDoc, "/metafile/comment[2]"_ostr, {
{"datasize", "48"} {"datasize", "48"}
@ -2287,7 +2287,7 @@ void SvmTest::checkComment(const GDIMetaFile& rMetafile)
{"value", "4"} {"value", "4"}
}); });
assertXPathContent(pDoc, "/metafile/comment[2]/comment[1]"_ostr, "This is a test comment"); assertXPathContent(pDoc, "/metafile/comment[2]/comment[1]"_ostr, u"This is a test comment"_ustr);
} }
void SvmTest::testComment() void SvmTest::testComment()

View file

@ -41,7 +41,7 @@ OUString Span::convertFromUtf8() const {
RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
{ {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
"cannot convert from UTF-8"); u"cannot convert from UTF-8"_ustr);
} }
return OUString(s, SAL_NO_ACQUIRE); return OUString(s, SAL_NO_ACQUIRE);
} }