sc: fix VBA Copy-Paste using same and separate document

Desktop / LibreOffice - Tomaž Vajngerl [collabora.co.uk] - 21 January 2022 09:42 UTC

This fixes 2 issues with VBA copy-paste:- VBA command Range(..).Copy issue where the range wasn't selected when copying and the copied cells were from the previous selection. The Copy command now does the same selection as the Cut command.

- VBA PasteSpecial issue where the wrong view was used to get the clip document.

- VBA Workbooks.Add issue where the new workbook wasn't activated after it was created, which causes an issue when running tests, but not when running in LO application. The Add command does now the same as the Workbooks.Open command.

All the issues are supported by new test cases.

Change-Id: I36ec45c01f18f7f76e4f95a25a28402a6ee0e2e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128720

0c6ee963e1f0 sc: fix VBA Copy-Paste using same and separate document
sc/CppunitTest_sc_macros_test.mk | 1 +
.../testdocuments/MultiDocumentCopyPaste.xlsm | Bin 0 -> 18647 bytes
sc/qa/extras/testdocuments/SimpleCopyPaste.xlsm | Bin 0 -> 16139 bytes
sc/qa/extras/vba-macro-test.cxx | 148 +++++++++++++++++++++
sc/source/ui/vba/excelvbahelper.cxx | 25 ++--
sc/source/ui/vba/vbarange.cxx | 7 +-
sc/source/ui/vba/vbaworkbooks.cxx | 11 +-
7 files changed, 176 insertions(+), 16 deletions(-)

Upstream: cgit.freedesktop.org


  • Share