[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - oovbaapi/ooo sw/source

Tor Lillqvist tml at collabora.com
Sat Jun 30 10:42:34 UTC 2018


 oovbaapi/ooo/vba/word/XWordBasic.idl |    1 +
 sw/source/ui/vba/vbaapplication.cxx  |    9 +++++++++
 2 files changed, 10 insertions(+)

New commits:
commit 66da411e180749078eaf58d095c3d985c0c5895f
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Jun 12 17:58:44 2018 +0300

    Add ExistingBookmark() to WordBasic
    
    Change-Id: I8f433b1ae5cc23aaa08935e87fca7674064ce881
    Reviewed-on: https://gerrit.libreoffice.org/55711
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/oovbaapi/ooo/vba/word/XWordBasic.idl b/oovbaapi/ooo/vba/word/XWordBasic.idl
index 94b810869061..31484c98d445 100644
--- a/oovbaapi/ooo/vba/word/XWordBasic.idl
+++ b/oovbaapi/ooo/vba/word/XWordBasic.idl
@@ -16,6 +16,7 @@ interface XWordBasic
 {
     void FileOpen( [in] string Name, [in] any ConfirmConversions, [in] any ReadOnly, [in] any AddToMru, [in] any PasswordDoc, [in] any PasswordDot, [in] any Revert, [in] any WritePasswordDoc, [in] any WritePasswordDot );
     string WindowName();
+    boolean ExistingBookmark( [in] string Name );
 };
 
 }; }; };
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 5110118577ce..441f1b6841af 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -35,6 +35,7 @@
 #include <ooo/vba/word/WdEnableCancelKey.hpp>
 #include <ooo/vba/word/WdWindowState.hpp>
 #include <ooo/vba/word/XApplicationOutgoing.hpp>
+#include <ooo/vba/word/XBookmarks.hpp>
 #include <basic/sbuno.hxx>
 #include <editeng/acorrcfg.hxx>
 #include "wordvbahelper.hxx"
@@ -71,6 +72,7 @@ public:
     // XWordBasic
     virtual void SAL_CALL FileOpen( const OUString& Name, const uno::Any& ConfirmConversions, const uno::Any& ReadOnly, const uno::Any& AddToMru, const uno::Any& PasswordDoc, const uno::Any& PasswordDot, const uno::Any& Revert, const uno::Any& WritePasswordDoc, const uno::Any& WritePasswordDot ) override;
     virtual OUString SAL_CALL WindowName() override;
+    virtual sal_Bool SAL_CALL ExistingBookmark( const OUString& Name ) override;
 };
 
 SwVbaApplication::SwVbaApplication( uno::Reference<uno::XComponentContext >& xContext ):
@@ -466,4 +468,11 @@ SwWordBasic::WindowName()
     return mpApp->getActiveSwVbaWindow()->getCaption();
 }
 
+sal_Bool SAL_CALL
+SwWordBasic::ExistingBookmark( const OUString& Name )
+{
+    uno::Reference< word::XBookmarks > xBookmarks( mpApp->getActiveDocument()->Bookmarks( uno::Any() ), uno::UNO_QUERY );
+    return xBookmarks.is() && xBookmarks->Exists( Name );
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list