summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-05-26 10:58:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-05-28 19:44:08 +0200
commitef513fd4b049b214a03fbe6e62a5ea43680a7a9b (patch)
tree82f2ce93bc8e5fde6dce8685b633c3d643c9f069 /desktop
parent826f1bca40a01f0a249d5b6cbb7c39c11638a060 (diff)
remove unnecessary use of OString::getStr
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/dp_log.cxx6
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx5
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx9
-rw-r--r--desktop/source/deployment/registry/dp_registry.cxx17
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx17
-rw-r--r--desktop/source/lib/init.cxx2
-rw-r--r--desktop/source/migration/migration.cxx24
-rw-r--r--desktop/source/migration/services/basicmigration.cxx7
-rw-r--r--desktop/source/migration/services/wordbookmigration.cxx7
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx3
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx3
12 files changed, 34 insertions, 68 deletions
diff --git a/desktop/source/deployment/dp_log.cxx b/desktop/source/deployment/dp_log.cxx
index ee814f312b7b..f84aac3c53ae 100644
--- a/desktop/source/deployment/dp_log.cxx
+++ b/desktop/source/deployment/dp_log.cxx
@@ -79,8 +79,7 @@ void ProgressLogImpl::disposing()
}
catch (const Exception & exc) {
(void) exc;
- OSL_FAIL( OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
}
}
@@ -139,8 +138,7 @@ void ProgressLogImpl::log_write( OString const & text )
}
catch (const io::IOException & exc) {
(void) exc;
- OSL_FAIL( OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 8acde7cc8172..fa286493fec9 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -740,8 +740,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker()
xFilePicker->appendFilter( iPos->first, iPos->second );
}
catch (const lang::IllegalArgumentException & exc) {
- OSL_FAIL( OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
(void) exc;
}
}
@@ -1389,7 +1388,7 @@ bool UpdateRequiredDialog::isEnabled( const uno::Reference< deployment::XPackage
catch ( const uno::RuntimeException & ) { throw; }
catch (const uno::Exception & exc) {
(void) exc;
- OSL_FAIL( OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
bRegistered = false;
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index f4d2f1fd3ab6..28863f9bc59b 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -345,7 +345,7 @@ PackageState TheExtensionManager::getPackageState( const uno::Reference< deploym
}
catch (const uno::Exception & exc) {
(void) exc;
- OSL_FAIL( OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
return NOT_AVAILABLE;
}
}
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index df1431c449a2..2dd0abd3a945 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -583,8 +583,7 @@ OUString PackageManagerImpl::detectMediaType(
if (throw_exc)
throw;
(void) exc;
- OSL_FAIL( OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
}
}
return mediaType;
@@ -1028,14 +1027,12 @@ PackageManagerImpl::getDeployedPackages_(
catch (const lang::IllegalArgumentException & exc) {
// ignore
(void) exc; // avoid warnings
- OSL_FAIL( OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
}
catch (const deployment::DeploymentException& exc) {
// ignore
(void) exc; // avoid warnings
- OSL_FAIL( OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
}
}
return comphelper::containerToSequence(packages);
diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx
index d0b4211691ee..da6c96195158 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.cxx
@@ -257,17 +257,12 @@ void PackageRegistryImpl::insertBackend(
#if OSL_DEBUG_LEVEL > 0
else
{
- OUStringBuffer buf;
- buf.append( "more than one PackageRegistryBackend for media-type=\"" );
- buf.append( mediaType );
- buf.append( "\" => " );
- buf.append( Reference<lang::XServiceInfo>(
- xBackend, UNO_QUERY_THROW )->
- getImplementationName() );
- buf.append( "\"!" );
- OSL_FAIL( OUStringToOString(
- buf.makeStringAndClear(),
- RTL_TEXTENCODING_UTF8).getStr() );
+ SAL_WARN( "desktop", "more than one PackageRegistryBackend for media-type=\""
+ << mediaType
+ << "\" => "
+ << Reference<lang::XServiceInfo>(
+ xBackend, UNO_QUERY_THROW )->getImplementationName()
+ << "\"!" );
}
#endif
}
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index cda1f56de4c4..93a8060231b1 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -843,10 +843,8 @@ void BackendImpl::PackageImpl::processPackage_(
}
catch (const Exception &)
{
- OSL_FAIL( OUStringToOString(
- ::comphelper::anyToString(
- ::cppu::getCaughtException() ),
- RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", ::comphelper::anyToString(
+ ::cppu::getCaughtException() ) );
// ignore any errors of rollback
}
}
@@ -934,7 +932,7 @@ OUString BackendImpl::PackageImpl::getDescription()
}
catch ( const css::deployment::DeploymentException& )
{
- OSL_FAIL( OUStringToOString( ::comphelper::anyToString( ::cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", ::comphelper::anyToString( ::cppu::getCaughtException() ) );
}
}
@@ -1058,15 +1056,12 @@ void BackendImpl::PackageImpl::exportTo(
}
// xxx todo: think about exception specs:
catch (const deployment::DeploymentException &) {
- OSL_FAIL( OUStringToOString(
- ::comphelper::anyToString(
- ::cppu::getCaughtException() ),
- RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", ::comphelper::anyToString(
+ ::cppu::getCaughtException() ) );
}
catch (const lang::IllegalArgumentException & exc) {
(void) exc;
- OSL_FAIL( OUStringToOString(
- exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
}
std::vector< Sequence<beans::PropertyValue> > manifest;
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 572bdd0eaef4..3c88929d4683 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -353,7 +353,7 @@ struct RectangleAndPart
OString toString() const
{
std::stringstream ss;
- ss << m_aRectangle.toString().getStr();
+ ss << m_aRectangle.toString();
if (m_nPart >= -1)
ss << ", " << m_nPart;
return ss.str().c_str();
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index be141b68210c..bc4df65f6cfa 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -207,9 +207,7 @@ void Migration::migrateSettingsIfNecessary()
try {
bResult = aImpl.doMigration();
} catch (const Exception& e) {
- OString aMsg = "doMigration() exception: "
- + OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
- OSL_FAIL(aMsg.getStr());
+ SAL_WARN( "desktop", "doMigration() exception: " << e.Message);
}
OSL_ENSURE(bResult, "Migration has not been successful");
(void)bResult;
@@ -844,11 +842,7 @@ void MigrationImpl::copyFiles()
_checkAndCreateDirectory(aURL);
FileBase::RC copyResult = File::copy(*i_file, destName);
if (copyResult != FileBase::E_None) {
- OString msg = "Cannot copy "
- + OUStringToOString(*i_file, RTL_TEXTENCODING_UTF8)
- + " to "
- + OUStringToOString(destName, RTL_TEXTENCODING_UTF8);
- OSL_FAIL(msg.getStr());
+ SAL_WARN( "desktop", "Cannot copy " << *i_file << " to " << destName);
}
++i_file;
}
@@ -894,16 +888,12 @@ void MigrationImpl::runServices()
} catch (const Exception& e) {
- OString aMsg = "Execution of migration service failed (Exception caught).\nService: "
- + OUStringToOString(i_mig->service, RTL_TEXTENCODING_ASCII_US)
- + "\nMessage: "
- + OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
- OSL_FAIL(aMsg.getStr());
+ SAL_WARN( "desktop", "Execution of migration service failed (Exception caught).\nService: "
+ << i_mig->service
+ << "\nMessage: " << e.Message);
} catch (...) {
- OString aMsg = "Execution of migration service failed (Exception caught).\nService: "
- + OUStringToOString(i_mig->service, RTL_TEXTENCODING_ASCII_US)
- + "\nNo message available";
- OSL_FAIL(aMsg.getStr());
+ SAL_WARN( "desktop", "Execution of migration service failed (Exception caught).\nService: "
+ << i_mig->service << "\nNo message available");
}
}
diff --git a/desktop/source/migration/services/basicmigration.cxx b/desktop/source/migration/services/basicmigration.cxx
index bfe2e84df1d6..5bd36c836b2e 100644
--- a/desktop/source/migration/services/basicmigration.cxx
+++ b/desktop/source/migration/services/basicmigration.cxx
@@ -132,11 +132,8 @@ namespace migration
::osl::FileBase::RC aResult = ::osl::File::copy( *aI, sTargetName );
if ( aResult != ::osl::FileBase::E_None )
{
- OString aMsg = "BasicMigration::copyFiles: cannot copy "
- + OUStringToOString( *aI, RTL_TEXTENCODING_UTF8 )
- + " to "
- + OUStringToOString( sTargetName, RTL_TEXTENCODING_UTF8 );
- OSL_FAIL( aMsg.getStr() );
+ SAL_WARN( "desktop", "BasicMigration::copyFiles: cannot copy "
+ << *aI << " to " << sTargetName );
}
++aI;
}
diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx
index 3b0ebe9b9024..5b19b59a0472 100644
--- a/desktop/source/migration/services/wordbookmigration.cxx
+++ b/desktop/source/migration/services/wordbookmigration.cxx
@@ -165,11 +165,8 @@ bool IsUserWordbook( const OUString& rFile )
::osl::FileBase::RC aResult = ::osl::File::copy( *aI, sTargetName );
if ( aResult != ::osl::FileBase::E_None )
{
- OString aMsg = "WordbookMigration::copyFiles: cannot copy "
- + OUStringToOString( *aI, RTL_TEXTENCODING_UTF8 )
- + " to "
- + OUStringToOString( sTargetName, RTL_TEXTENCODING_UTF8 );
- OSL_FAIL( aMsg.getStr() );
+ SAL_WARN( "desktop", "WordbookMigration::copyFiles: cannot copy "
+ << *aI << " to " << sTargetName);
}
}
++aI;
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 0eb7feff44e4..d31baf996b59 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -127,8 +127,7 @@ CommandEnvironmentImpl::~CommandEnvironmentImpl()
}
catch (const RuntimeException & exc) {
(void) exc;
- OSL_FAIL( OUStringToOString(
- exc.Message, osl_getThreadTextEncoding() ).getStr() );
+ SAL_WARN( "desktop", exc.Message );
}
}
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index c74d9e0d98aa..8e692cdf2fc8 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -84,8 +84,7 @@ OptionInfo const * getOptionInfo(
}
}
}
- OSL_FAIL( OUStringToOString(
- opt, osl_getThreadTextEncoding() ).getStr() );
+ SAL_WARN( "desktop", opt );
return nullptr;
}