summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2019-04-02 14:52:45 +0300
committerTor Lillqvist <tml@collabora.com>2019-04-02 21:59:20 +0300
commit951aefb26aacd977296cef3d942b8c9d09c50930 (patch)
treeedd3d7a4b15d23181427d4c23c0838426ec7cfc7 /vbahelper
parent54badeeebf6ec6af2f62c5ad97227c905835cf33 (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.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index 39b3443b2cea..760c256927e9 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>
@@ -92,6 +93,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 );
return sPath;