summaryrefslogtreecommitdiff
path: root/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx
AgeCommit message (Collapse)Author
2022-06-01sw content controls, date: add LOK APIMiklos Vajna
- send a LOK_CALLBACK_CONTENT_CONTROL with date=true when entering a date content control - extend lok::Document::sendContentControlEvent() to be able to set the date of a date content control (after the client's date picker is closed) - update gtktiledviewer to work with these (cherry picked from commit 9cb1a07dc2760a30d7f321aa7fa4ce2a460dfa6c) Change-Id: I0abf21eb1d4ba233050f0aa2607b68740c048262 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135223 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-16sw content controls, dropdown: add LOK APIMiklos Vajna
- expose the available list items in a new "items" key of the LOK_CALLBACK_CONTENT_CONTROL callback - add a new lok::Document::sendContentControlEvent() function to be able to select a list item from the current drop-down - add a new listbox to the gtktiledviewer toolbar to select a content control list item when the cursor is inside a dropdown - add tests for the array API of tools::JsonWriter (cherry picked from commit c7d80d229a5660a0ee702477bfbd2ca137992a7d) Change-Id: I47f1333a7815d67952f7c20a9cba1b248886f6dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134385 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-10Avoid -Werror=maybe-uninitializedStephan Bergmann
...with recent GCC 12 trunk, > libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx:194:31: error: ‘unoParam’ may be used uninitialized [-Werror=maybe-uninitialized] > 194 | gchar* pPath = g_strconcat(unoParam[1], "/", "type", nullptr); > | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Ia7ac20ac63b995e8f4a8b4c79447799972639588 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124961 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-03-21cid#1474277 Resource leakCaolán McNamara
and... cid#1474319 Resource leak cid#1473965 Resource leak cid#1474109 Resource leak cid#1474179 Resource leak Change-Id: I7daba2a0173a7fe7a912c0febf7957667f0fae83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112822 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-11loplugin:flattenNoel Grandin
Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100447 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-06tdf#42949 Fix IWYU warnings in libreofficekit/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ic57b1259e612cc38ad22f123edbaca690cd506ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89937 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-21Drop o3tl::optional wrapperStephan Bergmann
...now that macOS builds are guaranteed to have std::optional since 358146bbbd1b9775c12770fb5e497b6ec5adfc51 "Bump macOS build baseline to Xcode 11.3 and macOS 10.14.4". The change is done mostly mechanically with > for i in $(git grep -Fl optional); do > sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \ > -e 's/\<o3tl::optional\>/std::optional/g' \ > -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i" > done > for i in $(git grep -Flw o3tl::nullopt); do > sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i" > done (though that causes some of the resulting #include <optional> to appear at different places relative to other includes than if they had been added manually), plus a few manual modifications: * adapt bin/find-unneeded-includes * adapt desktop/IwyuFilter_desktop.yaml * remove include/o3tl/optional.hxx * quote resulting "<"/">" as "&lt;"/"&gt;" in officecfg/registry/cppheader.xsl * and then solenv/clang-format/reformat-formatted-files Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann
...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to <https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that configure.ac check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: https://gerrit.libreoffice.org/84128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-14New loplugin:consttoboolStephan Bergmann
...to: "Find implicit conversions from non-'bool' constants (e.g., 'sal_False') to 'bool'". Due to how FALSE is defined as just #define FALSE (0) (i.e., a literal of type 'int') but TRUE is defined as #define TRUE (!FALSE) (i.e., an implicit conversion from 'int' to 'bool') in GLib (see the comment in ConstToBool::VisitImplicitCastExpr), we get more warnings about uses of 'TRUE' than of 'FALSE'. For example, in libreofficekit/source/gtk/lokdocview.cxx there is a warning about the 'TRUE' in g_main_context_iteration(nullptr, TRUE); but not about the 'FALSE' in g_main_context_iteration(nullptr, FALSE); (where the parameter of 'g_main_context_iteration' is of type 'gboolean'). Lets live with that asymmetry for now... (Besides the issues addressed directly in this commit, it also found the two bogus asserts at 7e09d08807b5ba2fd8b9831557752a415bdad562 "Fix useless assert(true) (which would never fire)" and 122a0be8ae480473bd1d7f35e197a2529f4621e3 "Fix useless assert(true) (which would never fire)", plus 5f0d6df7f57ae281fe161e61c7f25d67453fddd2 "Use two-argument form of static_assert".) Change-Id: Id77322de9f94b85a7b65608a03e0e9865d14467b Reviewed-on: https://gerrit.libreoffice.org/82667 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-10clang-tidy: (WIP) bugprone-too-small-loop-variable findings 2Tamás Zolnai
Change-Id: I1ddf3fe0e5fad265ae14712a23469b684253079d Reviewed-on: https://gerrit.libreoffice.org/63241 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-11-06loplugin:collapseif in dbaccess..lotuswordproNoel Grandin
Change-Id: Ia2a0d25c3833dfde0cd28337361f3cbd2aa29662 Reviewed-on: https://gerrit.libreoffice.org/62934 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-08Replace find_if with proper quantifier algorithmsArkadiy Illarionov
Missed in 085269d25a705b656436feac47149296b4b4b35d Change-Id: I3cfab57232908b48d090658e0fbc948d62b3fc6f Reviewed-on: https://gerrit.libreoffice.org/60180 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-04gtv: Remember recently executed UNO commandsPranav Kant
Saves the recently executed UNO commands in a temp file and make it accessible to user in a combo box. Useful when debugging. Change-Id: Ic66961a388cc59dee3f65cb8d4de3c29a8a75eaa Reviewed-on: https://gerrit.libreoffice.org/45540 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
2017-12-02require at least gtk3 3.10.0 to build gtk vclplugCaolán McNamara
Change-Id: I4ca34184237d05b999c92648494c306a1f1371cd Reviewed-on: https://gerrit.libreoffice.org/45668 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-29lokdialog: Create dialog when callback is receivedPranav Kant
With this, we do away with initial approach of rendering the dialog on a large surface. We now create the cairo surface with dimensions of the dialog. Change-Id: Icb034693c7f1c656b7daae7f5c711b5bd4d8e880
2017-11-29lokdialog: gtv: Add width and height props to Dialog GObjectPranav Kant
Change-Id: I488a94d9c6cefd37624f755c6308f0b75595df84
2017-10-23loplugin:includeform: libreofficekitStephan Bergmann
Change-Id: I58a78a6339a0c8ef1b509604e8b79a339497cf8f
2017-10-02Fix typosAndrea Gelmini
Change-Id: I325141f90104496c62af8704d75568df3418952a Reviewed-on: https://gerrit.libreoffice.org/43050 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-02lokdialog: Emit dialog close callback upon dialog closePranav Kant
Change-Id: I4ccef76cc3b2926dd8916f825671bb732e101027
2017-10-02lokdialog: Queue a redraw on invalidation in gtktiledviewerPranav Kant
Change-Id: I081508674a71c3beb89175e4f8ac3256e6bc6c6a
2017-10-02gtktiledviewer: Implement modeless dialog renderingPranav Kant
Hardcode modeless dialogs available in writer (very few) as of now in the combobox. Change-Id: I82d1442fbc71776dd64640ad048a0375ca041a67
2017-08-17implementing callback for ruler invalidationAditya Dewan
adding commands to fetch and changee ruler state '.uno:RulerState' and '.uno:RulerStateChange' Change-Id: I66107039a7ae5893691feb45c8ab2e4aa476ea76 Reviewed-on: https://gerrit.libreoffice.org/40727 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
2017-07-14Modernize gtktiledviewer; use GApplicationPranav Kant
Put all the UI content in UI XML file. Unfortunately, lots of boilerplate code because G_DECLARE_* macros are available only since glib 2.44 Change-Id: Idc74ba8565d482c28abd00b6f6f75646ab3d40b9 Reviewed-on: https://gerrit.libreoffice.org/39913 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>