diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-04-02 14:52:45 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-04-02 18:24:28 +0300 |
commit | 7c934cf3cdda7684588bf0be550af159c7ede3b4 (patch) | |
tree | f6cad3b1ccf04717d421b5f76a6b7822307bdc61 /vbahelper | |
parent | 9efe10f50951bdf8e0fb3051d37ea6856c5e1dd9 (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
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 cb73e32d9cbb..d6cf72a264fb 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 <comphelper/unwrapargs.hxx> #include <tools/urlobj.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 << "'"); |