[Libreoffice-commits] core.git: sfx2/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 26 06:16:24 UTC 2019


 sfx2/source/appl/appdde.cxx |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit ceea1f3c735b4e6d40cc0cfd8c249b6aff6b4e89
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Aug 23 17:20:39 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Aug 26 08:15:06 2019 +0200

    Replace use of INetURLObject::GetNewAbsURL with rtl::Uri::convertRelToAbs
    
    Change-Id: I45bc72b30ec51cce9e07371365879e7fe89eb54c
    Reviewed-on: https://gerrit.libreoffice.org/78023
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index a998b77b823c..683bbc24fb18 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -19,6 +19,8 @@
 
 #include <config_features.h>
 #include <rtl/character.hxx>
+#include <rtl/malformeduriexception.hxx>
+#include <rtl/uri.hxx>
 #include <sal/log.hxx>
 #include <sot/exchange.hxx>
 #include <vcl/wrkwin.hxx>
@@ -131,13 +133,18 @@ bool ImplDdeService::MakeTopic( const OUString& rNm )
 
     if( !bRet )
     {
-        INetURLObject aWorkPath( SvtPathOptions().GetWorkPath() );
-        INetURLObject aFile;
-        if ( aWorkPath.GetNewAbsURL( rNm, &aFile ) &&
-             lcl_IsDocument( aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) )
+        bool abs;
+        OUString url;
+        try {
+            url = rtl::Uri::convertRelToAbs(SvtPathOptions().GetWorkPath(), rNm);
+            abs = true;
+        } catch (rtl::MalformedUriException &) {
+            abs = false;
+        }
+        if ( abs && lcl_IsDocument( url ) )
         {
             // File exists? then try to load it:
-            SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
+            SfxStringItem aName( SID_FILE_NAME, url );
             SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, true);
 
             SfxBoolItem aSilent(SID_SILENT, true);


More information about the Libreoffice-commits mailing list