diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-02-24 14:00:00 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-02-24 22:45:40 +0000 |
commit | ffa403e539bea44ce46fe7d976e7a00b319808f5 (patch) | |
tree | d48acf7fd5edfead27fb7aa76286e4c18c580760 | |
parent | 0d1d6ca553992fa53e98f749c325d8de39847f17 (diff) |
word vba: add ShowAll to XView
This allows ActiveDocument.ActiveWindow.View.ShowAll = true
ShowAll affects "View -> Formatting Marks"
make CppunitTest_sw_macros_test
Change-Id: I735eb42b0d53c34a4c4770c148f6ab7ac597fd84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147667
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r-- | oovbaapi/ooo/vba/word/XView.idl | 3 | ||||
-rw-r--r-- | sw/qa/core/data/docm/testVBA.docm | bin | 32380 -> 34380 bytes | |||
-rw-r--r-- | sw/source/ui/vba/vbaview.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaview.hxx | 2 |
4 files changed, 17 insertions, 0 deletions
diff --git a/oovbaapi/ooo/vba/word/XView.idl b/oovbaapi/ooo/vba/word/XView.idl index 985e5611fbf4..780d65fd3a79 100644 --- a/oovbaapi/ooo/vba/word/XView.idl +++ b/oovbaapi/ooo/vba/word/XView.idl @@ -28,6 +28,9 @@ interface XView set raises ( com::sun::star::script::BasicErrorException ); }; + //Show all nonprinting characters (such as hidden text, spaces, carriage returns, etc.). + [attribute] boolean ShowAll; + [attribute] long SplitSpecial; [attribute] boolean TableGridLines; [attribute] long Type; diff --git a/sw/qa/core/data/docm/testVBA.docm b/sw/qa/core/data/docm/testVBA.docm Binary files differindex 44e59f03a753..9b97fbd9dccd 100644 --- a/sw/qa/core/data/docm/testVBA.docm +++ b/sw/qa/core/data/docm/testVBA.docm diff --git a/sw/source/ui/vba/vbaview.cxx b/sw/source/ui/vba/vbaview.cxx index 1e620cc5c56a..822c4f93e501 100644 --- a/sw/source/ui/vba/vbaview.cxx +++ b/sw/source/ui/vba/vbaview.cxx @@ -61,6 +61,18 @@ SwVbaView::~SwVbaView() { } +sal_Bool SwVbaView::getShowAll() +{ + bool bShowFormattingMarks = false; + mxViewSettings->getPropertyValue("ShowNonprintingCharacters") >>= bShowFormattingMarks; + return bShowFormattingMarks; +} + +void SwVbaView::setShowAll(sal_Bool bSet) +{ + mxViewSettings->setPropertyValue("ShowNonprintingCharacters", uno::Any(bSet)); +} + ::sal_Int32 SAL_CALL SwVbaView::getSeekView() { diff --git a/sw/source/ui/vba/vbaview.hxx b/sw/source/ui/vba/vbaview.hxx index 66d59e61b739..66cd0db612ef 100644 --- a/sw/source/ui/vba/vbaview.hxx +++ b/sw/source/ui/vba/vbaview.hxx @@ -44,6 +44,8 @@ public: virtual ~SwVbaView() override; // XView + sal_Bool SAL_CALL getShowAll() override; + void SAL_CALL setShowAll(sal_Bool bSet) override; virtual ::sal_Int32 SAL_CALL getSeekView() override; virtual void SAL_CALL setSeekView( ::sal_Int32 _seekview ) override; virtual ::sal_Int32 SAL_CALL getSplitSpecial() override; |