Kaydet (Commit) 9d94148b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

desktop: Use appropriate OUString functions on string constants

Change-Id: I5791c212a103fe9c2a5376545944a70454b28bdd
üst bca00da6
...@@ -234,7 +234,7 @@ void Desktop::destroyAcceptor(const OUString& aAcceptString) ...@@ -234,7 +234,7 @@ void Desktop::destroyAcceptor(const OUString& aAcceptString)
{ {
// special case stop all acceptors // special case stop all acceptors
AcceptorMap &rMap = acceptorMap::get(); AcceptorMap &rMap = acceptorMap::get();
if (aAcceptString.equalsAscii("all")) { if (aAcceptString == "all") {
rMap.clear(); rMap.clear();
} else { } else {
...@@ -283,9 +283,8 @@ void Desktop::CreateTemporaryDirectory() ...@@ -283,9 +283,8 @@ void Desktop::CreateTemporaryDirectory()
} }
// set temp base directory // set temp base directory
sal_Int32 nLength = aTempBaseURL.getLength(); if ( aTempBaseURL.endsWith( "/" ) )
if ( aTempBaseURL.matchAsciiL( "/", 1, nLength-1 ) ) aTempBaseURL = aTempBaseURL.copy( 0, aTempBaseURL.getLength() - 1 );
aTempBaseURL = aTempBaseURL.copy( 0, nLength - 1 );
OUString aRet; OUString aRet;
OUString aTempPath( aTempBaseURL ); OUString aTempPath( aTempBaseURL );
...@@ -298,9 +297,8 @@ void Desktop::CreateTemporaryDirectory() ...@@ -298,9 +297,8 @@ void Desktop::CreateTemporaryDirectory()
{ {
::osl::File::getTempDirURL( aTempBaseURL ); ::osl::File::getTempDirURL( aTempBaseURL );
nLength = aTempBaseURL.getLength(); if ( aTempBaseURL.endsWith( "/" ) )
if ( aTempBaseURL.matchAsciiL( "/", 1, nLength-1 ) ) aTempBaseURL = aTempBaseURL.copy( 0, aTempBaseURL.getLength() - 1 );
aTempBaseURL = aTempBaseURL.copy( 0, nLength - 1 );
aTempPath = aTempBaseURL; aTempPath = aTempBaseURL;
::osl::FileBase::getFileURLFromSystemPath( aRet, aTempPath ); ::osl::FileBase::getFileURLFromSystemPath( aRet, aTempPath );
......
...@@ -139,11 +139,11 @@ namespace desktop ...@@ -139,11 +139,11 @@ namespace desktop
{ {
// if you put variables in other chunks don't forget to call the replace routines // if you put variables in other chunks don't forget to call the replace routines
// for those chunks... // for those chunks...
OUString aHelpMessage_version = OUString::createFromAscii(aCmdLineHelp_version); OUString aHelpMessage_version(aCmdLineHelp_version);
OUString aHelpMessage_head = OUString::createFromAscii(aCmdLineHelp_head); OUString aHelpMessage_head(aCmdLineHelp_head);
OUString aHelpMessage_left = OUString::createFromAscii(aCmdLineHelp_left); OUString aHelpMessage_left(aCmdLineHelp_left);
OUString aHelpMessage_right = OUString::createFromAscii(aCmdLineHelp_right); OUString aHelpMessage_right(aCmdLineHelp_right);
OUString aHelpMessage_bottom = OUString::createFromAscii(aCmdLineHelp_bottom); OUString aHelpMessage_bottom(aCmdLineHelp_bottom);
aHelpMessage_version = ReplaceStringHookProc(aHelpMessage_version); aHelpMessage_version = ReplaceStringHookProc(aHelpMessage_version);
aHelpMessage_head = aHelpMessage_head.replaceFirst( "%CMDNAME", "soffice" ); aHelpMessage_head = aHelpMessage_head.replaceFirst( "%CMDNAME", "soffice" );
if (!unknown.isEmpty()) if (!unknown.isEmpty())
......
...@@ -45,8 +45,7 @@ struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle ...@@ -45,8 +45,7 @@ struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle
} }
static OUString getTitle( ::ucbhelper::Content &rContent ) static OUString getTitle( ::ucbhelper::Content &rContent )
{ {
return OUString( rContent.getPropertyValue( return rContent.getPropertyValue("Title").get<OUString>();
OUString::createFromAscii( "Title" ) ).get<OUString>() );
} }
// just return titles - the ucbhelper should have a simpler API for this [!] // just return titles - the ucbhelper should have a simpler API for this [!]
static css::uno::Reference< css::sdbc::XResultSet > static css::uno::Reference< css::sdbc::XResultSet >
......
...@@ -192,16 +192,11 @@ void PackageManagerImpl::initActivationLayer( ...@@ -192,16 +192,11 @@ void PackageManagerImpl::initActivationLayer(
Reference<sdbc::XRow>( Reference<sdbc::XRow>(
xResultSet, UNO_QUERY_THROW )->getString( xResultSet, UNO_QUERY_THROW )->getString(
1 /* Title */ ) ); 1 /* Title */ ) );
if (title.endsWith("removed", &title))
const char extensionRemoved[] = "removed";
if (title.endsWith( extensionRemoved ))
{ {
//save the file name withouth the "removed" part //save the file name withouth the "removed" part
sal_Int32 index = title.lastIndexOfAsciiL(
extensionRemoved, sizeof(extensionRemoved) - 1);
OUString remFile = title.copy(0, index);
removedEntries.push_back(::rtl::Uri::encode( removedEntries.push_back(::rtl::Uri::encode(
remFile, rtl_UriCharClassPchar, title, rtl_UriCharClassPchar,
rtl_UriEncodeIgnoreEscapes, rtl_UriEncodeIgnoreEscapes,
RTL_TEXTENCODING_UTF8 ) ); RTL_TEXTENCODING_UTF8 ) );
} }
......
...@@ -232,15 +232,15 @@ Reference<XInterface> AccInstanceProvider::getInstance (const OUString& aName ) ...@@ -232,15 +232,15 @@ Reference<XInterface> AccInstanceProvider::getInstance (const OUString& aName )
Reference<XInterface> rInstance; Reference<XInterface> rInstance;
if ( aName.equalsAscii( "StarOffice.ServiceManager" ) ) if ( aName == "StarOffice.ServiceManager" )
{ {
rInstance = Reference< XInterface >( m_rContext->getServiceManager() ); rInstance = Reference< XInterface >( m_rContext->getServiceManager() );
} }
else if(aName.equalsAscii( "StarOffice.ComponentContext" ) ) else if ( aName == "StarOffice.ComponentContext" )
{ {
rInstance = m_rContext; rInstance = m_rContext;
} }
else if ( aName.equalsAscii("StarOffice.NamingService" ) ) else if ( aName == "StarOffice.NamingService" )
{ {
Reference< XNamingService > rNamingService( Reference< XNamingService > rNamingService(
m_rContext->getServiceManager()->createInstanceWithContext("com.sun.star.uno.NamingService", m_rContext), m_rContext->getServiceManager()->createInstanceWithContext("com.sun.star.uno.NamingService", m_rContext),
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx> #include <rtl/math.hxx>
#define PIPE_ARG "--splash-pipe="
namespace desktop namespace desktop
{ {
UnxSplashScreen::UnxSplashScreen( const Reference< uno::XComponentContext >& xCtx ) UnxSplashScreen::UnxSplashScreen( const Reference< uno::XComponentContext >& xCtx )
...@@ -104,9 +102,9 @@ UnxSplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun:: ...@@ -104,9 +102,9 @@ UnxSplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::
{ {
OUString aArg; OUString aArg;
osl_getCommandArg( i, &aArg.pData ); osl_getCommandArg( i, &aArg.pData );
if ( aArg.matchIgnoreAsciiCaseAsciiL( PIPE_ARG, sizeof( PIPE_ARG ) - 1, 0 ) ) OUString aNum;
if ( aArg.startsWithIgnoreAsciiCase("--splash-pipe=", &aNum) )
{ {
OUString aNum = aArg.copy( sizeof( PIPE_ARG ) - 1 );
int fd = aNum.toInt32(); int fd = aNum.toInt32();
m_pOutFd = fdopen( fd, "w" ); m_pOutFd = fdopen( fd, "w" );
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment