summaryrefslogtreecommitdiff
path: root/odk/examples
AgeCommit message (Collapse)Author
2024-07-27odk, oox, pyuno: fix issues found by Ruff linterIlmari Lauhakangas
Change-Id: I79d56453877a10502768b522ca93da3990891c0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171098 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-07-27comphelper, msicreator, odk: fix issues found by Ruff linterIlmari Lauhakangas
Change-Id: I5ef65baeb0100b9d70b5c59c1d5f6f43ab951a22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171092 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-07-19Fix typoAndrea Gelmini
Change-Id: I4eb00c710a940371b2916ae52127f1ff7f808427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170501 Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net> Tested-by: Jenkins
2024-07-17tdf#158803 related: remove unnecessary commentsIlmari Lauhakangas
Change-Id: I25093100db0473bb907036b4f80e1bbc440cfb8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170639 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-07-16Add lokconvert odk exampleHossein
This exmaple converts a file to PDF using LibreOfficeKit library. Change-Id: Idc4afafc9541986617f0cc4d46cd89e25ae12051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169998 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-07-15Added pyuno demo for key and mouse handlers and listeners.Moritz Duge
Change-Id: I5b2f70061c5eee7a1068ec110d34ddadc5200bff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169584 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Tested-by: Jenkins
2024-06-05Fix typoAndrea Gelmini
Change-Id: I4706e1f5a2de6f1a0e48bd5e297eb904ac66f581 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168458 Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp> Tested-by: Jenkins
2024-06-05Fix typoAndrea Gelmini
Change-Id: Ice2853eb7a14bd614b9bb53ce13667602c6e07eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168457 Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp> Tested-by: Jenkins
2024-06-05tdf#143123 Port Java clipboard examples to PythonRMZeroFour
This commit ports the Clipboard example from odk/examples/DevelopersGuide/OfficeDev/ to Python. The original Java example code was moved to a java/ subdirectory, and the new Python code was added to the python/ subdirectory. Necessary changes were made in the corresponding Makefiles. Along with the sample code in Clipboard.java, the ClipboardListener, ClipboardOwner and TextTransferable classes were ported. Change-Id: Ic3a48023cfc78b770ae64adb2aee2b4d0bcefaff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165225 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-06-04tdf#143123 Port Java PathSubstitution example to PythonRMZeroFour
This commit ports the PathSubstitution example in odk/examples/DevelopersGuide/OfficeDev/ to Python. The original Java example code was moved to a java/ subdirectory, and the new Python code was added to the python/ subdirectory. Necessary changes were made in the corresponding Makefiles. The example can be run with: ./instdir/program/python \ ./odk/examples/DevelopersGuide/OfficeDev/PathSubstitution/\ python/path_substitution_test.py Change-Id: I6c7a8af86cee2dc9cb5384e42bd9644847f28767 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166264 Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2024-05-26Remove remaining dynamic exception specifications in odk/examplesIlmari Lauhakangas
as begun in commit ddcc98fa50dd9d86a60dada4daa00f4d95ffe005 Author: Stephan Bergmann <sbergman@redhat.com> Date: Wed Jul 22 13:41:12 2020 +0200 Remove obsolete dynamic exception specifications from SDK example C++ code Change-Id: I70a799655f7633e255d80e829f12a88a27a3c2f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167289 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-05-21tdf#158803 pyflakes F821: undefined name 'com' and remove bare except clausesLeonard Sasse
Change-Id: Id116753a19a4fa5a29ad9a4f61f5ba3bf1ce95d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165451 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-05-16Fix odk examples build on 32 bit systemsHossein
It is required to cast integer literals to sal_Int32 when passing them to Any(). Change-Id: I377f88fc3441d8e4bc7afdb2411c1fd140853134 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167739 Tested-by: Jenkins Reviewed-by: René Engelhard <rene@debian.org> Tested-by: René Engelhard <rene@debian.org>
2024-05-13odk: classes in java.lang package do not need to be fully qualifiedIlmari Lauhakangas
Change-Id: Idcc8af34095496aa6e7f516d9b2b975f7e58799f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167555 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-10odk/examples: grammar and comment fixesIlmari Lauhakangas
Change-Id: I86174573d9f59135865496a4f3ee5efb86141ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167410 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins
2024-05-07odk/examples: grammar fixesIlmari Lauhakangas
Also remove outdated comment related to RTL_CONSTASCII_STRINGPARAM (only the first line was removed in the past) Change-Id: Iebef1bf83ab049a96c846e714cb700df4dacd878 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167233 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-04-30tdf#143122 Port Java TerminationTest example to C++RMZeroFour
This patch ports odk/examples/DevelopersGuide/OfficeDev/TerminationTest example to C++. The original Java example code was moved to a java/ subdirectory, and the new C++ code was added to the cxx/ subdirectory. Necessary changes were made in the corresponding Makefiles. Along with the code in TerminationTest.java, the TerminateListener class was also ported and used in the same C++ file. Change-Id: I889b8893740bc8f80cdd9aa9925e83cadcea9592 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165916 Tested-by: Jenkins Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2024-04-19tdf#143123 Port ChartInDraw / ChartInWriter examples to Pythonzeph
Ported two more SDK examples ChartInDraw and ChartInWriter from Java to Python. ChartInCalc and helper classes which contain additional helper methods were ported in a previous patch. Change-Id: Idffa0c07282dfc2c0f09ec5a9959f1db34a1d9a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165088 Tested-by: Jenkins Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2024-04-09Fix typo in HelloTextTableShape makefileRMZeroFour
The HelloTextTableShape example, which was recently ported to C++, has a small typo in line #64 of the Makefile. It gives the user the command to run the example, but it was missing an 'e' at the end. Change-Id: I29af45f21ff78dbda42e5bd9e25e44f06536f7c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165915 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-04-04loplugin:unusedenumconstantsNoel Grandin
Change-Id: I889b4f63e098fecf22ffd4fb98937d62dbdd70b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-13tdf#160180: bump copyright year to 2024Julien Nabet
Change-Id: I466b8f86e8a53a238ed2ce2d2b053dc519ff8eed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164794 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-03-13Use UNO_QUERY_THROW instead of UNO_QUERYHossein
Previously, in SDK examples, de-referencing was done unconditionally after obtaining a reference using UNO_QUERY. Now, we use UNO_QUERY_THROW instead, to make sure cases where exceptions may occure can be handled correctly. Change-Id: Ic73ba3cfcad914dabb7ae3736ad1ae2bd6cc15bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164682 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2024-03-11tdf#143122 Port HelloTextTableShape example to C++Hossein
Port DevelopersGuide/FirstSteps/HelloTextTableShape Java SDK example to C++ and add a GNU Makefile for the build. Change-Id: I8798406c24ec6c566fb6494f7202f6a2a984a25c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164635 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-03-11Enable commented part in HelloTextTableShape.javaHossein
Commented code in the HelloTextTableShape.java example demonstrates the use of bookmarks. This part is now enabled. Change-Id: Iace525be0d53b01bed8b5a6a123384a678d1d761 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164636 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-03-06Fix typoAndrea Gelmini
Change-Id: I1bfc868d2b00871887ea105cf968a676000bf67c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164472 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-03-06remove deprecated IsGermanPreReform propertyNoel Grandin
deprecated in 2008 (and seemingly never even implemented) Replace the use of this property in sample code and in Java unit tests with another property (I arbitrarily selected "IsIgnoreControlCharacters") Change-Id: I2cb474f895ac221952b59e98bfdbc01012095519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164355 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-04finish removing IsSpellCapitalisation propertyNoel Grandin
which was partially removed in commit 9bb9ba6ae02692e65498bae4598e3b63bb65c02e Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Date: Mon Oct 2 12:33:34 2023 +0200 [API CHANGE] Remove deprecated IsSpellCapitalization Change-Id: I861c8c484b77a041d91cb25ddeecb7027a2fd96c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164183 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-27Add python code for ChartInCalczeph
Change-Id: Ia7f4cbd539919e88f735c13bdd1dae3533b1163a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163037 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-02-22SDK - 1st Steps example code enhancementAlain Romedenne
Python example extended in order to be equally callable from LibO client Change-Id: Ib2d733809e960971b98c30cbd6368ebc755dd7ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159767 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-01-16Add a minimal Python extensionHossein
This is a minimal Python extension. It is possible to run main.py from: 1. Inside a LibreOffice extension 2. Inside LibreOffice, and also via APSO 3. Outside LibreOffice, as an external process, and also in a Python IDE The provided Python script is very useful for debugging extensions as an example. That is because it is possible to debug it in an IDE before packaging it as a LibreOffice extension. Python file is checked with: $ flake8 --ignore E501 main.py Change-Id: I24d9aefdfda29264bf6b5f9403a40fae35e610f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159938 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-12-29tdf#158803 Remove unused imports from odkBogdan B
Used pyflakes to find unused imports from odk module. Then, removed those unused imports. Change-Id: If1a160fa99f0c3581687faecb0c7051625c478c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158821 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-12-21tdf#143123 Port SDraw Java SDK example to PythonRicardo Donino
Change-Id: I12e19b4a0d76affa178618cfbaf761692f29152a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160360 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-11-21Cleanup make files for Java/C++ SDK examplesHossein
This fixes some minor issues with the make files for Java/C++ SDK examples in DevelopersGuide/FirstSteps. For Java examples, an exatra "-f Example_Java.mk" was a leftover from a previous change. For C++ examples, 'make clean' was not working correctly, because of a leftover from a previous change. Both should be fixed now. Change-Id: Id936824675a9bfd43674ca526bc97a998ed9daf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159777 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-11-21tdf#143122 Port FirstLoadComponent example to C++Hossein
Port DevelopersGuide/FirstSteps/FirstLoadComponent Java SDK example to C++ and add a GNU Makefile for the build. Change-Id: I24da0422014e42f844cae21863d54301dd902f0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159740 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-11-20Separate folders for DevelopersGuide/FirstStepsHossein
This patch creates separate folders for 3 different SDK examples in DevelopersGuide/FirstSteps: 1. FirstUnoContact 2. FirstLoadComponent 3. HelloTextTableShape Each one of these are ported to 4 languages: Java, C++, BASIC, Python. The Java Makefile in the top folder is now separated into 3 different Makefiles for Java programs. Change-Id: Ifb2003be2aafb4caec4810eb21fbb4708b9a0628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159591 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2023-11-04Fix typoAndrea Gelmini
Change-Id: I064aa3c54650904671a312eadbe8e77b26ae141a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158913 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2023-11-03Fix typoAndrea Gelmini
Change-Id: Ida31b30c64c8ba2be61e6f4a408e1346df48d1b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158875 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2023-11-02'new Double' is deprecated in JavaNoel Grandin
replace with Double.valueOf Change-Id: If5be8e500e31ebf9d5fb20ea7dd474677d7c74ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158785 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-02'new Float' is deprecated in JavaNoel Grandin
replace with Float.valueOf Change-Id: Ib6408b24dac2953789d0ec67e73b8be8aefca252 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158784 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-27Explicitly build the ODK examples against C++03Stephan Bergmann
...similarly to how CppunitTest_odk_checkapi already builds with C++03 to detect inadvertent uses of newer features in code that is meant to be still compatible with C++03. And fix any uses of newer features that had already crept in. Change-Id: I9fb4013099c1dff2c1ad5fba8fc93d9aa4efbde8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158523 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-25tdf#146150 Use dispatch cmd for the corresponding SIDapurvapriyadarshi
Change-Id: I0d987a8b10f2c69192d080b534a1d6aa71a6cf4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157105 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-09-16tdf#157273 Port DevelopersGuide/FirstSteps examples to BASICHossein
These 3 examples from the chapter 1 of the DevGuide are ported to BASIC: 1) FirstUnoContact 2) FirstLoadComponent 3) HelloTextTableShape More details can be found in the LibreOffice DevGuide: LibreOffice Developer's Guide: Chapter 1 - First Steps https://wiki.documentfoundation.org/Documentation/DevGuide/First_Steps Change-Id: I577ad81d76cec06102f00b2646b004caa5f7b401 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156976 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-09-09Rename .cpp examples to .cxxHossein
The files are renamed, and the associated lines in Makefiles and elsewhere are also changed. Change-Id: Ieec38055690e03afd8982320ee0836904a3f41eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156670 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-09-08tdf#143123 Port DevelopersGuide/FirstSteps/FirstLoadComponent to PythonHossein
Porting FirstSteps/FirstLoadComponent.java to Python is done. More information on this example can be found on LibreOffice DevGuide: LibreOffice Developer's Guide: Chapter 1 - First Steps - First Contact https://wiki.documentfoundation.org/Documentation/DevGuide/First_Steps This is the last of the 3 examples in the first chapter which are ported to Python. Change-Id: Iac0682943d4286168bbdadf792423670f41bdee6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156686 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2023-09-07Simplify condition in a loop over a single elementHossein
The loop was over an array which has only one element, so the condition should also work directly with its only element. Change-Id: I5b87cf03d90e9da67ac3ff72b593be0ff5fa322c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129677 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-25Add script to find unused using declarationsGabor Kelemen
As a complementer to clang-tidy-12 --checks="-*,misc-unused-using-decls" Pros: - simple, fast! - finds some more unused declarations, somehow - works on non-linux specific parts of the code - clang-tidy (for me) trips on files with external headers, this does not Change-Id: If2db989114ac5c2841ed2e89ff7bd7a9e419f567 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150612 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-04-18tdf#143123 Port DevelopersGuide/FirstSteps/HelloTextTableShape to PythonChenxiong Qi
Signed-off-by: Chenxiong Qi <qcxhome@gmail.com> Change-Id: Ifb5639369c4af1db27ccb5a93dfad093ce7403b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146819 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-02-17Remove remaining STL_INCLUDESStephan Bergmann
...that 1628005298923ad15cc78dbad63669b701f5fd04 "Trying to remove the stlport mention from the code" didn't catch Change-Id: I271d7760d2b2dd25c0fa27489a8ddf455963d970 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147213 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-19tdf#143123 Port some Spreadsheet Java examples to PythonChenxiong Qi
Some examples inside odk/examples/java/Spreadsheet are ported to Python: ChartTypeChange.java -> ChartTypeChange.py EuroAdaption.java -> EuroAdaption.py SCalc.java -> SCalc.py Code format is checked with 'pycodestyle': pycodestyle --ignore=E501,E722 odk/examples/python/Spreadsheet/*.py Signed-off-by: Chenxiong Qi <qcxhome@gmail.com> Change-Id: If0631b5970faab6499cfea3eef559e003fad24d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143810 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-01-18Fix typoAndrea Gelmini
Change-Id: Ifc9748fc33c72ad6e0cb334ca22ebb8b488164c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145710 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>