diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 24 | ||||
-rw-r--r-- | desktop/source/deployment/manager/dp_manager.cxx | 25 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_app.cxx | 10 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 7 |
4 files changed, 27 insertions, 39 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 01abf03b9a6f..303def43540f 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -162,19 +162,17 @@ private: } ++m_index; if (c == '\\') { - if (m_index < m_input.getLength()) { - c = m_input[m_index++]; - switch (c) { - case '0': - c = '\0'; - break; - case ',': - case '\\': - break; - default: - throw CommandLineArgs::Supplier::Exception(); - } - } else { + if (m_index >= m_input.getLength()) + throw CommandLineArgs::Supplier::Exception(); + c = m_input[m_index++]; + switch (c) { + case '0': + c = '\0'; + break; + case ',': + case '\\': + break; + default: throw CommandLineArgs::Supplier::Exception(); } } diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 8244d4f88ee3..b9b849d31b8a 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -1499,26 +1499,23 @@ sal_Int32 PackageManagerImpl::checkPrerequisites( ActivePackages::Data dbData; OUString id = dp_misc::getIdentifier(extension); - if (m_activePackagesDB->get( &dbData, id, OUString())) - { - //If the license was already displayed, then do not show it again - Reference<ucb::XCommandEnvironment> _xCmdEnv = xCmdEnv; - sal_Int32 prereq = dbData.failedPrerequisites.toInt32(); - if ( !(prereq & deployment::Prerequisites::LICENSE)) - _xCmdEnv = new NoLicenseCommandEnv(xCmdEnv->getInteractionHandler()); - - sal_Int32 failedPrereq = extension->checkPrerequisites( - xAbortChannel, _xCmdEnv, false); - dbData.failedPrerequisites = OUString::number(failedPrereq); - insertToActivationLayerDB(id, dbData); - } - else + if (!m_activePackagesDB->get( &dbData, id, OUString())) { throw lang::IllegalArgumentException( "PackageManagerImpl::checkPrerequisites: unknown extension", nullptr, 0); } + //If the license was already displayed, then do not show it again + Reference<ucb::XCommandEnvironment> _xCmdEnv = xCmdEnv; + sal_Int32 prereq = dbData.failedPrerequisites.toInt32(); + if ( !(prereq & deployment::Prerequisites::LICENSE)) + _xCmdEnv = new NoLicenseCommandEnv(xCmdEnv->getInteractionHandler()); + + sal_Int32 failedPrereq = extension->checkPrerequisites( + xAbortChannel, _xCmdEnv, false); + dbData.failedPrerequisites = OUString::number(failedPrereq); + insertToActivationLayerDB(id, dbData); return 0; } catch ( const deployment::DeploymentException& ) { diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index ee1729fb7604..a928a7e3c336 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -475,16 +475,12 @@ extern "C" int unopkg_main() } } - if (extension.is()) - { - allExtensions.push_back(extension); - vecUnaccepted.push_back(bUnacceptedLic); - } - - else + if (!extension.is()) throw lang::IllegalArgumentException( "There is no such extension deployed: " + cmdPackage,nullptr,-1); + allExtensions.push_back(extension); + vecUnaccepted.push_back(bUnacceptedLic); } } diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 774e30fae122..0aafe484a21d 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -198,15 +198,12 @@ OUString makeAbsoluteFileUrl( oslFileError rc = osl_getFileURLFromSystemPath( sys_path.pData, &file_url.pData ); if ( rc != osl_File_E_None) { OUString tempPath; - if ( osl_getSystemPathFromFileURL( sys_path.pData, &tempPath.pData) == osl_File_E_None ) - { - file_url = sys_path; - } - else + if ( osl_getSystemPathFromFileURL( sys_path.pData, &tempPath.pData) != osl_File_E_None ) { throw RuntimeException("cannot get file url from system path: " + sys_path ); } + file_url = sys_path; } OUString abs; |