summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-06-12 17:58:44 +0300
committerTor Lillqvist <tml@collabora.com>2018-06-12 19:02:31 +0200
commit1f6e884617ee20739216764144fe485ac7cfe6c6 (patch)
tree57d80a0f3192eeab95b442c60f4ecb3a05c1ffa7 /sw/source/ui
parent721c4fc126481f43be86442a73c1bfda8e06cdea (diff)
Add ExistingBookmark() to WordBasic
Change-Id: I8f433b1ae5cc23aaa08935e87fca7674064ce881 Reviewed-on: https://gerrit.libreoffice.org/55706 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx9
1 files changed, 9 insertions, 0 deletions
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: */