From ceea1f3c735b4e6d40cc0cfd8c249b6aff6b4e89 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 23 Aug 2019 17:20:39 +0200 Subject: 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 --- sfx2/source/appl/appdde.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'sfx2') 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 #include +#include +#include #include #include #include @@ -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); -- cgit