[Libreoffice-commits] core.git: 2 commits - vbahelper/source

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 2 19:00:53 UTC 2019


 vbahelper/source/vbahelper/vbadocumentbase.cxx |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 958442c89237eece4ff2467a7800bca6b0be9fe7
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Apr 2 14:43:31 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Apr 2 21:59:20 2019 +0300

    Add a few SAL_INFOs
    
    Change-Id: Ibdb013f4eeee8a2b2e29e3adb56943b5fccf9772

diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index 760c256927e9..b5979cc035b1 100644
--- a/vbahelper/source/vbahelper/vbadocumentbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -56,7 +56,10 @@ VbaDocumentBase::VbaDocumentBase( uno::Sequence< uno::Any> const & args,
 OUString
 VbaDocumentBase::getName()
 {
-    return VbaDocumentBase::getNameFromModel( getModel() );
+    OUString sName = VbaDocumentBase::getNameFromModel( getModel() );
+    SAL_INFO("vbahelper", "VbaDocumentBase::getName: '" << sName << "'");
+
+    return sName;
 }
 
 OUString VbaDocumentBase::getNameFromModel( const uno::Reference< frame::XModel >& xModel )
@@ -87,6 +90,8 @@ VbaDocumentBase::getPath()
        sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 );
        ::osl::File::getSystemPathFromFileURL( sURL, sPath );
     }
+    SAL_INFO("vbahelper", "VbaDocumentBase::getPath: '" << sPath << "'");
+
     return sPath;
 }
 
@@ -104,6 +109,7 @@ VbaDocumentBase::getFullName()
 
     OUString sPath = getName();
     //::osl::File::getSystemPathFromFileURL( getModel()->getURL(), sPath );
+    SAL_INFO("vbahelper", "VbaDocumentBase::getFullName: '" << sPath << "'");
     return sPath;
 }
 
commit 951aefb26aacd977296cef3d942b8c9d09c50930
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Apr 2 14:52:45 2019 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Apr 2 21:59:20 2019 +0300

    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

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;


More information about the Libreoffice-commits mailing list