summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/lingucfg.cxx40
1 files changed, 12 insertions, 28 deletions
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index cd504ec4b4d2..9194c838a79e 100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -27,7 +27,6 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
-#include <rtl/uri.hxx>
#include <rtl/instance.hxx>
#include <osl/mutex.hxx>
#include <i18nlangtag/mslangid.hxx>
@@ -43,8 +42,6 @@
using namespace com::sun::star;
-using ::rtl::Uri;
-
#define FILE_PROTOCOL "file:///"
namespace
@@ -927,33 +924,20 @@ static bool lcl_GetFileUrlFromOrigin(
OUString /*out*/ &rFileUrl,
const OUString &rOrigin )
{
- bool bSuccess = false;
- if (!rOrigin.isEmpty())
+ OUString aURL(
+ comphelper::getExpandedUri(
+ comphelper::getProcessComponentContext(), rOrigin));
+ if (aURL.startsWith( FILE_PROTOCOL ))
{
- OUString aURL( rOrigin );
- if ( aURL.startsWith( "vnd.sun.star.expand:" ) )
- {
- aURL = comphelper::getExpandedUri(
- comphelper::getProcessComponentContext(), aURL);
- bool bIsFileUrl = aURL.startsWith( FILE_PROTOCOL );
- if (bIsFileUrl)
- {
- rFileUrl = aURL;
- bSuccess = true;
- }
- else
- {
- SAL_WARN(
- "unotools.config", "not a file URL, <" << aURL << ">" );
- }
- }
- else
- {
- SAL_WARN(
- "unotools.config", "failed to get file URL, <" << aURL << ">" );
- }
+ rFileUrl = aURL;
+ return true;
+ }
+ else
+ {
+ SAL_WARN(
+ "unotools.config", "not a file URL, <" << aURL << ">" );
+ return false;
}
- return bSuccess;
}
bool SvtLinguConfig::GetDictionaryEntry(