diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-06-12 17:58:44 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-06-30 12:42:13 +0200 |
commit | 66da411e180749078eaf58d095c3d985c0c5895f (patch) | |
tree | 3cdfb8169d47f24c8939c726efff8156df1bb70f /sw/source/ui | |
parent | adf3895e91f2e65be8798d199a75b7306c50d995 (diff) |
Add ExistingBookmark() to WordBasic
Change-Id: I8f433b1ae5cc23aaa08935e87fca7674064ce881
Reviewed-on: https://gerrit.libreoffice.org/55711
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/vba/vbaapplication.cxx | 9 |
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: */ |