Use XVndSunStarExpandUrl::expand directly, instead of re-implementing it
Make it similar to comphelper::getExpandedUri. Change-Id: I8674a3ad86b94dc76dbce81b043fa4b70543fbb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194069 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
This commit is contained in:
@@ -21,7 +21,6 @@ import unohelper
|
||||
import sys
|
||||
import types
|
||||
import os
|
||||
from urllib.parse import unquote
|
||||
from com.sun.star.uno import Exception, RuntimeException
|
||||
from com.sun.star.loader import XImplementationLoader
|
||||
from com.sun.star.lang import XServiceInfo
|
||||
@@ -75,7 +74,9 @@ class Loader(XImplementationLoader, XServiceInfo, unohelper.Base):
|
||||
protocol, dependent = splitUrl(url)
|
||||
if "vnd.sun.star.expand" == protocol:
|
||||
exp = self.ctx.getValueByName("/singletons/com.sun.star.util.theMacroExpander")
|
||||
url = exp.expandMacros(unquote(dependent))
|
||||
fac = self.ctx.ServiceManager.createInstanceWithContext("com.sun.star.uri.UriReferenceFactory", self.ctx)
|
||||
ref = fac.parse(url)
|
||||
url = ref.expand(exp)
|
||||
protocol, dependent = splitUrl(url)
|
||||
|
||||
if DEBUG:
|
||||
|
||||
Reference in New Issue
Block a user