/source/el/

n value='distro/mimo/mimo-6-1'>distro/mimo/mimo-6-1 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/oovbaapi/ooo
AgeCommit message (Collapse)Author
2024-06-29Fix VBA Table's *Padding properties typeMike Kaganski
In VBA, it is Single, not Double. See VBA documentation: https://learn.microsoft.com/en-us/office/vba/api/word.table.bottompadding https://learn.microsoft.com/en-us/office/vba/api/word.table.leftpadding https://learn.microsoft.com/en-us/office/vba/api/word.table.rightpadding https://learn.microsoft.com/en-us/office/vba/api/word.table.toppadding Change-Id: I9262462424fc11b5c062a61754ab0fab9103f549 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169763 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-05-13tdf#157657 - sc: add option to make data validity case-sensitiveBalazs Varga
Add option to check data validity with case sensitive and case insensitive. The default set would remain the original case insensitive mode for data validity. Change-Id: Ic4fe56e2b31b7fc348b742f3b95fb44cd35bc49d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167280 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2023-03-13tdf#150281: Fix CentimetersToPoints in CalcBaole Fang
Originally, CentimetersToPoints was implemented as a base method for Writer and Calc. They are both using the same implementation, which is correct for Writer, but wrong for Calc. Since their behavior should be different, I remove the base method and implement a correct one for Calc. Change-Id: If957accdd9be86a96ca6fb711502e49a79bf3223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148745 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-02-25word vba: tie "Word" to VBAGlobalsJustin Luth
This allows Word. to prefix global commands. While this is superfluous to use this profix in a DOC/X, the purpose is to allow the spreadsheet to call Word.<whatever> macro calls that execute in a word processor. At this point, it is simply added to SwVbaGlobals to allow macro calls to run without raising an error. make CppunitTest_sw_macros_test Change-Id: Ibeda67d458d4757be809d8669a4e424c4e6c3458 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147682 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-24word vba: add ShowAll to XViewJustin Luth
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>
2023-02-24word vba: Add activeWindow to XDocumentJustin Luth
This allows ActiveDocument.ActiveWindow.* It already works as a global, and as Aplication.ActiveWindow Unit test will follow when some of the * items are added. Change-Id: I7fb18df9f6259ec4b9d60516b2da704098831dfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147665 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-02-14tdf#149786 sc: add VBA function: ExportAsFixedFormatBalazs Varga
Add ExportAsFixedFormat VBA function for calc. Works fine with Workbook/Worksheet/Range objects Optional parameters: - Type: works but only with xlTypePDF. (xlTypeXPS not supperted by LO) - FileName: works but not clear the xlQualityStandard or xlQualityMinimum real value, so just used the lossless export in case of xlQualityStandard and 70% JPEG compression quality for xlQualityMinimum. - IncludeDocProperties: works - IgnorePrintAreas: TODO - From: works - To: works - OpenAfterPublish: works - FixedFormatExtClassPtr: TODO? Change-Id: I128fd880a82a5dd315897496c6f21bb9a7c2270b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146512 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-12-16tdf#151548 vba FormFields: implement RangeJustin Luth
Msgbox (FormFields("text1").Range.Text) Change-Id: Iac195e09bd3f9619890b336a0cb537a1acd00049 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144136 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-25tdf#151548 vba ContentControls: Add word::XContentControlListEntryJustin Luth
make CppunitTest_sw_macros_test CPPUNIT_TEST_NAME=testVba This now allows MS Word's modern content control list boxes (combobox and dropbox) to be controlled by VBA basic. -allows getting and setting the selected list entry -allows adding/deleting/renaming/moving list entries If .DropdownListEntries.Count <> 3 Then GoTo errorhandler: .DropdownListEntries.Item(2).Select .DropdownListEntries.Item(2).Delete If .DropdownListEntries.Item(2).Text <> "infinity" If .DropdownListEntries.Item(2).Value <> "infinity and beyond" 'With .DropdownListEntries.Add("third", "3rd", 2) Dim LE As ContentControlListEntry Set LE = .DropdownListEntries.Add("third", "3rd", 2) With LE If LE.Index <> 2 Then GoTo errorhandler: If LE.Value <> "3rd" Then GoTo errorhandler: .MoveUp .MoveUp .MoveUp If .Index <> 1 Then GoTo errorhandler: .MoveDown .MoveDown If .Index <> 3 Then GoTo errorhandler: End With 'LE If .DropdownListEntries.Item(3).Text <> "third" Then GoTo errorhandler: End With 'Item 1 runOnceDropDown: With ActiveDocument.ContentControls.Item(4) If .Type <> wdContentControlComboBox Then GoTo errorhandler: .DropdownListEntries.Clear End With Change-Id: Iffebb2bd69abec1cbcfaed05b58f940664852eae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143082 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-24tdf#151548 vba ContentControls: Add basic word::XContentControlJustin Luth
This adds basic VBA macro support for accessing the modern content controls used for creating forms. I ran out of time to make it fully functional. TODO -Invalidation: the screen isn't updating the modified results until interaction from the user (mouse click, etc.) -Unlike FormFields, content controls really depend on having Range working. I didn't have time to look into that. -I was hoping to check that my approach could accommodate the other methods that create a filtered ContentControls object: * Document.SelectLinkedControls, * Document.SelectUnlinkedControls * Range.ContentControls. I guess it will be left up to whoever needs these to add the bits that will create an appropriate collection for these limited sets. -setType: changing one type to another - both LO and Word allow limited use of this - depending on the text contents fitting the new type. What works: -getByIndex - which probably is the "normal" way to do it, since the UI doesn't provide a name/ID; just got via msgbox .ID. -full checkbox support (minus the visual invalidation) -VBA accepts almost all properties/methods that are requested. make CppunitTest_sw_macros_test CPPUNIT_TEST_NAME=testVba If Not ActiveDocument.ContentControls(1).Checked If ActiveDocument.ContentControls(2).Checked 'If ActiveDocument.ContentControls(2).Range.Text <> "$" ActiveDocument.SelectContentControlsByTag("checkboxes").Item(1).Checked = ActiveDocument.SelectContentControlsByTag("checkboxes").Item(2).Checked ActiveDocument.SelectContentControlsByTag("checkboxes") .Item(2).SetUncheckedSymbol (8364) '€ With ActiveDocument.SelectContentControlsByTitle("listbox").Item(1) If Not .ShowingPlaceholderText 'If .Range.Text <> "Choose an item." If .Type <> wdContentControlDropdownList End With With ActiveDocument.ContentControls.Item(5) 'If Not .Temporary Then GoTo errorhandler: If .Temporary <> False Then GoTo errorhandler: If .Tag <> "" Then GoTo errorhandler: If .Title <> "" Then GoTo errorhandler: End With With ActiveDocument.ContentControls.Item(6) If .Type <> wdContentControlText If .MultiLine Then GoTo errorhandler: If ActiveDocument.ContentControls.Count <> 7 .Delete 'Doesn't actually Delete in LO yet - unsafe ' If ActiveDocument.ContentControls.Count <> 6 End With ' Change to 6 when delete is working safely With ActiveDocument.ContentControls.Item(7) If .Type <> wdContentControlDate Then GoTo errorhandler: .Color = wdColorBlueGray 'unknown to Word 2010 If .Color <> wdColorBlueGray Then GoTo errorhandler: If .DateDisplayFormat <> "mm/yy/dd" Then GoTo errorhandler: If .DateCalendarType <> wdCalendarWestern Then GoTo errorhandler: If .LockContents <> False Then GoTo errorhandler: End With Change-Id: I1c636f671de81e0283c040a578838a0433ef1f5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143080 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-11-15tdf#151548 vba FormFields: Add basic word::XDropDown supportJustin Luth
make CppunitTest_sw_macros_test CPPUNIT_TEST_NAME=testVba This now allows MS Word Basic legacy list box form fields to be controlled by VBA basic. -allows getting and setting the text string/list entry -allows adding and deleting list entries Change-Id: Ia772c62395c40a6aa0afae2549f15f4ea3304dbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142396 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-14Fix typoAndrea Gelmini
Change-Id: Ib625049e93949b247ca20a83dcca16fecda29216 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142703 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-11-14tdf#151548 vba FormFields: Add basic word::XTextInput supportJustin Luth
make CppunitTest_sw_macros_test CPPUNIT_TEST_NAME=testVba This now allows MS Word Basic legacy text form fields to be controlled by VBA basic. -allows getting and setting the text string Change-Id: Ib4601d4e087233a3db257728374b362bb34d1ecb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142262 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-11-11tdf#151548 vba FormFields: Add basic word::XCheckBox supportJustin Luth
make CppunitTest_sw_macros_test CPPUNIT_TEST_NAME=testVba This now allows MS Word Basic legacy checkbox form fields to be controlled by VBA basic. -allows getting and setting the checkbox value TODO: -wire up entry and exit macros -wire up StarBASIC support (hmm, how would that be different?) -probably completely ignore this. formfields hidden from normal writer - only activeX and content controls shown. -setup tri-state for checkboxes: with a separate default value Change-Id: Ied47a507dd9acc2c8dfd1472e6704e9dd571b480 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142253 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-10Fix typosAndrea Gelmini
Change-Id: Id924e4747d6a3d81b69da28910c8e096565b9b68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142538 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-11-10tdf#151548 vba FormFields: Add basic word::XFormField supportJustin Luth
Unit tests will come in the following commits that represent actual FormFields that have content/results. This lays the foundation for adding Checkboxes, Textinputs, and Dropdowns. Change-Id: If85ae25f881198d5a0699b3350a7eb20b1735c45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142507 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-10-17sw vba: add WordBasic.MsgBoxJustin Luth
The unit test just consists of adding a "WordBasic.MsgBox()" to the vba code in testVBA.docm. make CppunitTest_sw_macros_test or just open the file manually for an easy-to-run experience. Change-Id: I38edfee42649fcc85f0f535a2c9861c45038fa0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141347 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-10-14sw vba: add WordBasic.ScreenUpdatingJustin Luth
Change-Id: I3d074c224b77eff9f4ab1ea6bade6d66828fc88c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141273 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-10-13sw vba: tie WordBasic to VBAGlobalsJustin Luth
This allows WordBasic to also be run directly, instead of only working with Application.WordBasic.*. Change-Id: I60c3beaa1fce9a8bf25786cc0b2ed6ef6deda2f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141200 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-06VBA Add conversion methods to globalHannah Meeks
Change-Id: I920799321f245c015a527c816272c1038cc04544 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137851 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-05VBA Add conversion methods to ApplicationHannah Meeks
Change-Id: Ic0de06699a647565deca7985742965a72614df16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137787 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-08-05VBA Add Padding properties to XTableHannah Meeks
Change-Id: I021ad15b81ce55c4f9e9e9b515be1ddaaca8d07d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137630 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-07-20VBA: Add Select Method to ActiveDocumentHannah Meeks
Change-Id: I0d8d02c555fd113b96661085b339b12d83c6010f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137109 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-14The DefaultPropertyName for range is texHannah Meeks
Change-Id: I0e5f1ae0757a2ad8f58f011df435c30c577d8a79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137006 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-14tdf#149963 - XFind not a property/attribute of XRangeHannah Meeks
Updated XRange to include XFind Change-Id: If9570fbb5de8d14063a72a4c4c55fcfd491dd496 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137004 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-30tdf#99514 - implement Value2 for compatibilityHannah Meeks
Value2 ignores date formatting in a way that Value does not. Extended vba.xls to test this too. Change-Id: Id75a3dafae2166221731847b7c81e93e8ad835fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133645 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-13Drop obsolete preprocessor directives from UNOIDL filesStephan Bergmann
...which were used by ildc, which is gone since a8485d558fab53291e2530fd9a1be581c1628deb "[API CHANGE] Remove deprecated idlc and regmerge from the SDK", and have always been ignored as legacy by its unoidl-write replacement. This change has been carried out (making use of GNU sed extensions) with > for i in $(git ls-files \*.idl); do sed -i -z -E -e 's/\n\n((#[^\n]*\n)+\n)*(#[^\n]*\n)+\n?/\n\n/g' -e 's/\n(#[^\n]*\n)+/\n/g' "$i"; done && git checkout extensions/source/activex/so_activex.idl odk/examples/OLE/activex/so_activex.idl which apparently happened to do the work. (The final two files are not UNOIDL source files.) Change-Id: Ic9369e05d46e8f7e8a304ab01740b171b92335cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135683 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-27vba: add support for Application.WindowState + testTomaž Vajngerl
This just delegates the get/set calls to ActiveWindow.WindowState which is already supported, but calling it directly on Application is also possible. Change-Id: Ibf6f55581a5c66a47ec4dd21cc8d0fe3558330ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129013 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-01-22tdf#118246 add support for Application.GetOpenFilename func.Tomaž Vajngerl
Opens the file dialog and returns the selected filename. Change-Id: I4eccd34a7fbb892c0950b2f7c34977cf2aad6f89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128721 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-09[API-CHANGE] tdf#141543 VBA Range.Formula Range.FormulaR1C1 non-localizedEike Rathke
The VBA compatibility Range.Formula and Range.FormulaR1C1 properties wrongly used localized formula expressions as if they were Range.FormulaLocal and Range.FormulaR1C1Local. That worked in English UI and locales, but not in translated UI or with locale dependent different separators, imported Excel documents using these properties failed there. Instead, use English formula expressions and separators, and additionally implement Range.FormulaLocal and Range.FormulaR1C1Local for localized formula expressions. See https://docs.microsoft.com/en-us/office/vba/api/excel.range.formula https://docs.microsoft.com/en-us/office/vba/api/excel.range.formular1c1 https://docs.microsoft.com/en-us/office/vba/api/excel.range.formulalocal https://docs.microsoft.com/en-us/office/vba/api/excel.range.formular1c1local Unfortunately this change means for macros created in LibreOffice that relied on the erroneous beaviour in a localized environment those macros will cease to work, the remedy in these cases is to replace setting Formula and FormulaR1C1 attributes with FormulaLocal and FormulaR1C1Local instead. Obtaining formulas never worked reliably unless the document's native grammar was very similar to the API grammar (English UI function names, English locale and separators, address convention). For this to work a prerequisite is commit d0b4719ca3d4608bcb7431dbeb097146dd5a5127 CommitDate: Wed Apr 7 02:22:54 2021 +0200 Related: tdf#128334 Make VBA Range getFormula(R1C1) work not only by accident Change-Id: Ifce9ac7557b6a3703d47ee81b57dd8246f3fc3ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113846 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2020-09-01Fix typo in codeAndrea Gelmini
It passed "make check" on Linux Change-Id: Ibaaa3bbce3f2d502073803035aaacdad07bb170c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101810 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>