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:
Mike Kaganski
2025-11-16 15:47:39 +01:00
parent fd7aba091c
commit efd69fbd84
+3 -2
View File
@@ -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: