diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-04-02 14:52:45 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-09-20 13:51:25 +0200 |
commit | c07466b645dc967e7b86f0ca0a626018bcf6e44c (patch) | |
tree | c9535f016589b90a34d39dfb3bb96a1fca17f9b0 /vbahelper | |
parent | 77b75c521dbeebe711bb0fe629a003106df0ac74 (diff) |
Implement the FullName property correctly in the Automation case
Return a complete pathname.
For or internal Basic, keep the existing semantics, that for some
reason returns just the filename.
Change-Id: I897cc797ca2158ca7c798f3e8adcdfa57a41ee3b
(cherry picked from commit 7c934cf3cdda7684588bf0be550af159c7ede3b4)
Reviewed-on: https://gerrit.libreoffice.org/79203
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/vbahelper/vbadocumentbase.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx index a65377a8f5fd..fb23c5264c2a 100644 --- a/vbahelper/source/vbahelper/vbadocumentbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <ooo/vba/XApplicationBase.hpp> +#include <comphelper/automationinvokedzone.hxx> #include <cppuhelper/exc_hlp.hxx> #include <tools/urlobj.hxx> #include <osl/file.hxx> @@ -97,6 +98,15 @@ VbaDocumentBase::getPath() OUString VbaDocumentBase::getFullName() { + // In the Automation case, follow the specs. + if (comphelper::Automation::AutomationInvokedZone::isActive()) + { + // We know that Automation is relevant only on Windows, so hardcode "\\". + OUString sPath = getPath() + "\\" + getName(); + SAL_INFO("vbahelper", "VbaDocumentBase::getFullName: '" << sPath << "'"); + return sPath; + } + OUString sPath = getName(); //::osl::File::getSystemPathFromFileURL( getModel()->getURL(), sPath ); SAL_INFO("vbahelper", "VbaDocumentBase::getFullName: '" << sPath << "'"); |