summaryrefslogtreecommitdiff
path: root/libreofficekit
AgeCommit message (Collapse)AuthorFilesLines
2019-11-14New loplugin:consttoboolStephan Bergmann7-49/+49
...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>
2019-11-13Extend loplugin:salbool to loplugin:fakeboolStephan Bergmann3-21/+21
...checking for unnecessary uses of more "fake bool" types. In the past, some of the checks involving the types of variables or data members, or the return types of functions, issued warnings that required surrounding code to be changed too (e.g., when changing the signature of a function whose address was taken). These checks have been tightened now to not warn in such cases (which avoids warnings that require changes to additional code, or changes that might even be impossible to make, at the cost of being less aggressive about removing all unnecessary uses of those "fake bool" types). Change-Id: I70eb75039817cda34ed611387ee27dc5f36a3e2e Reviewed-on: https://gerrit.libreoffice.org/82554 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-13lokdocview: refresh tile buffer on resize to avoid UI breakage.Michael Meeks1-37/+21
Otherwise we get tiles in the wrong locations based on incorrrect widths. Change-Id: I1c76bc6eaabd8af4c283e421bf8901e7d64b4efa Reviewed-on: https://gerrit.libreoffice.org/82574 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-13lokdocview: encapsulate tile buffer properly.Michael Meeks3-7/+27
Change-Id: I59d690fbde67f4985246f13b992e962d11b7b07f Reviewed-on: https://gerrit.libreoffice.org/82573 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-13lok: calc: switch row / column / grouping data to pixels.Michael Meeks1-4/+3
This simplifies lots of logic in the clients, making it trivial to get good row/column header alignment at any zoom. Ultimately TWIPS here are highly misleading print-twips, and in this state are ~impossible to map to pixels accurately unless all data is present back to the origin (which is not the current approach). Change-Id: I6ca30e77865b62e886e23860f7c23350e544c9fc Reviewed-on: https://gerrit.libreoffice.org/82572 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-09lok: tilebench: slightly sloppy pixel comparison & larger area.Michael Meeks2-17/+46
Change-Id: Ief9d4bc5ce0e83a9eb9564cb94f773a3ff6048ba Reviewed-on: https://gerrit.libreoffice.org/82357 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-11-05lok: tilebench: implement zoom tests.Michael Meeks1-16/+65
Change-Id: Ieffc89b8119c2baf56383ac8b5d3cb54dc9d0d2d Reviewed-on: https://gerrit.libreoffice.org/82090 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-30gtktiledviewer: always load with en-US languageAshod Nakashian1-1/+1
This is the default for Online, so makes sense to have the same in the gtktiledviewer as well. Change-Id: I8c4729aa301069e246554b06671ad86bbe50c441 Reviewed-on: https://gerrit.libreoffice.org/81778 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-25lok: improve tilebench and add an unpleasant text rendering test case.Michael Meeks3-16/+25
Change-Id: I9e769cff6db794389bcef821c08ca1cd60173ab9 Reviewed-on: https://gerrit.libreoffice.org/81531 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-22tilebench: output a helpful delta image and highlight the diffs.Michael Meeks1-21/+48
Change-Id: I545b3b262805361851ed2c829110c6a4f852e25e Reviewed-on: https://gerrit.libreoffice.org/81267 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-10-17Silence Clang 10 trunk -Wdeprecated-volatile in GLib for nowStephan Bergmann7-0/+65
See <https://gitlab.gnome.org/GNOME/glib/merge_requests/1170> "Avoid C++20 deprecated assignment to volatile" for a potential fix in GLib (but also see my question at <https://github.com/llvm/llvm-project/commit/ 4a6861a7e5b59be24a09b8b9782255d028e7aade#commitcomment-35540755> "[c++20] P1152R4: warn on any simple-assignment to a volatile lvalue" whether that Clang warning is actually wanted here). With glib2-devel-2.62.1-1.fc31.x86_64, the suppressed warnings looked like > libreofficekit/source/gtk/lokdocview.cxx:327:1: error: use of result of assignment to object of volatile-qualified type 'volatile gsize' (aka 'volatile unsigned long') is deprecated [-Werror,-Wdeprecated-volatile] > G_DEFINE_TYPE_WITH_CODE (LOKDocView, lok_doc_view, GTK_TYPE_DRAWING_AREA, > ^ > /usr/include/glib-2.0/gobject/gtype.h:1617:56: note: expanded from macro 'G_DEFINE_TYPE_WITH_CODE' > #define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_) _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END() > ^ > /usr/include/glib-2.0/gobject/gtype.h:2034:3: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN' > _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \ > ^ > /usr/include/glib-2.0/gobject/gtype.h:2005:7: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER' > g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ > ^ > /usr/include/glib-2.0/glib/gthread.h:257:17: note: expanded from macro 'g_once_init_leave' > (void) (0 ? *(location) = (result) : 0); \ > ^ Change-Id: If67ad04f8fb242f50b43a1d98ad2b28c4bed55a4 Reviewed-on: https://gerrit.libreoffice.org/80937 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-07enable -Wrange-loop-analysis on clangNoel Grandin1-1/+1
Change-Id: I2095308943c94ad16c110d5fac47715398eb5d39 Reviewed-on: https://gerrit.libreoffice.org/80187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-04enable -Wunused-exception-parameter on clangNoel Grandin1-1/+1
which is useful because our MSVC build will warn about this by default Change-Id: Idcc0f08b69b6eda4dd2ab010a5fdb674787bebcf Reviewed-on: https://gerrit.libreoffice.org/80184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-30jsdialogs: add callback LOK_CALLBACK_JSDIALOGSzymon Kłos1-0/+1
Change-Id: Ie79e24ae3a376e0de3d82daff4a1263c7ce3b33a Reviewed-on: https://gerrit.libreoffice.org/79825 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2019-09-29constmethod for accessor-type methodsNoel Grandin1-2/+2
Apply the constmethod plugin, but only to accessor-type methods, e.g. IsFoo(), GetBar(), etc, where we can be sure of that constifying is a reasonable thing to do. Change-Id: Ibc97f5f359a0992dd1ce2d66f0189f8a0a43d98a Reviewed-on: https://gerrit.libreoffice.org/74269 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-27cid#1454003 silence 'Constant' variable guards dead codeCaolán McNamara1-1/+1
Change-Id: I4ba26647f4081f5c13726b78c737b54e8ab1773d Reviewed-on: https://gerrit.libreoffice.org/79675 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-09-26gtktiledviewer: Turn an annoying assert into a compile-time check.Jan Holesovsky1-14/+19
So that people don't forget adding the enum values here... Change-Id: I0342e2ecca4d7d14641e44ca562b1999921182e8 Reviewed-on: https://gerrit.libreoffice.org/79554 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-09-24Add reference marks callbackSzymon Kłos1-0/+45
Change-Id: Ic749e138356392b0c327a30cff28055f06e23e2e Reviewed-on: https://gerrit.libreoffice.org/79464 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-09-19tilebench: initial joining testMichael Meeks1-7/+148
Add sub-tile dumping code, and do compares. Change-Id: I5bc29c07e1075ac40b495f35d01d433e81ba309a Reviewed-on: https://gerrit.libreoffice.org/79195 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-09-07lokdocview: Add missing callback casesAron Budea1-0/+3
To prevent gtktiledviewer from crashing. Change-Id: Ia23504c20eac185f3302e8d694672ebf6d853585 Reviewed-on: https://gerrit.libreoffice.org/78737 Tested-by: Jenkins Reviewed-by: Aron Budea <aron.budea@collabora.com>
2019-08-24loplugin:returnconstval in fpicker..reportdesignNoel Grandin6-7/+7
Change-Id: I59c55a858b2706d1327c837abc158dceca02360e Reviewed-on: https://gerrit.libreoffice.org/78058 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20loplugin:constvars in i18npool..openclNoel Grandin3-8/+8
Change-Id: I82738a18ff116fdc78f07b453c93b1b631632caf Reviewed-on: https://gerrit.libreoffice.org/77775 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-17LOK: move LOK callback-type-to-string helper to headerAshod Nakashian1-103/+2
This is a very common function that is used by clients as well as LO Core, so makes sense to have it implemented once and updated when new callback-types are added, all in one place. Change-Id: Id6a1d6bcf5585d7be440b62a0c3a9c993e46e5e0 Reviewed-on: https://gerrit.libreoffice.org/77587 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2019-08-15tdf#122529 lok - table border position manipulationTomaž Vajngerl1-0/+2
This adds a new LOK callback (LOK_CALLBACK_TABLE_SELECTED) that sends the border positions to the client when the user has the cursor or slelection in a table. In addition this adds a .uno:TableChangeCurrentBorderPosition uno command, which implements changing a specific border in the current table. Border can be either a column or a row border, which is either at the first, middle or last position. Change-Id: Ife7cff14d91ffc84c95c040f0b42319e3d6194b4 Reviewed-on: https://gerrit.libreoffice.org/77365 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-08-07Mark some vars as constStephan Bergmann1-4/+4
...with the benefit of avoiding some Clang 10 -Werror,-Wimplicit-int-float-conversion in places where they are implicitly converted to double Change-Id: I0a8e85b23e3cb19d736e436b793ad83bb5fb99c4 Reviewed-on: https://gerrit.libreoffice.org/77034 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-28lok: send cell selection rectangle and cell area fill rectangleTomaž Vajngerl1-0/+4
Instead of text selection start/end for cell selection we send a cell selection rectangle event. This is needed so we're able to differentiate when to draw cell selection and text selection markers. In addition send cell fill area rectangle, which is the area where we need to hit to trigger area fill functionality in Calc. Change-Id: I54af958932815818a1a4d48364192ba43f1df7de Reviewed-on: https://gerrit.libreoffice.org/76491 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-07-27Fix typosAndrea Gelmini1-1/+1
Change-Id: I380856ca45c835e732fdf080a522caab4534db5b Reviewed-on: https://gerrit.libreoffice.org/76346 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-26gtktiledviewer: provide activation functionAshod Nakashian1-0/+7
This fixes the gtktiledviewer on some distros/gtk versions that require an activation function to be provided. Change-Id: I95fb3ed4e92e27d9c725ca38b4cb5a4f8af51771 Reviewed-on: https://gerrit.libreoffice.org/71588 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/76373 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-20Demote from std::unique_lock to std::scoped_lock where applicableStephan Bergmann1-4/+4
Change-Id: I53a019f05978bab62ad0da3d0eb08f37f8ec1e18 Reviewed-on: https://gerrit.libreoffice.org/74414 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-20Consolidate on C++17 std::scoped_lock instead of std::lock_guardStephan Bergmann1-7/+7
...where scoped_lock was originally meant as a transparent generalization of lock_guard, but eventually had to supersede it under a new name, for backwards- compatibility reasons, see <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0156r2.html> "Variadic lock_guard (Rev. 5)" and <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0488r0.pdf> "WG21 Working Paper, NB Comments, ISO/IEC CD 14882". Change-Id: Ie58909f63beec5939601183d6bcda3bc638d5747 Reviewed-on: https://gerrit.libreoffice.org/74382 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-25gtktiledviewer: Fix crash on copy.Michael Meeks1-0/+1
Change-Id: I1afc6278f6853d5e45a305b4f731cb6af0e00cc1 Reviewed-on: https://gerrit.libreoffice.org/72955 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-22New loplugin:dataStephan Bergmann1-1/+1
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-10unipoll: add a --unipoll parameter to gtktiledviewer.Michael Meeks4-4/+81
Arguably should be the default. Implementation is a bit cute - re-starting the main-loop as a child of a callback from its idle handler. Change-Id: I95e87c8a4ae3de745d7ca1f636859dd1d8deca17 Reviewed-on: https://gerrit.libreoffice.org/72072 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-02lok: We changed the (unstable) ABI, but let's allow the older C++ API.Jan Holesovsky1-1/+1
Helps building the Online before the appropriate patch gets merged. Change-Id: I9983d546bb0cb7fb472806622a0a10e3a4d3ab87 Reviewed-on: https://gerrit.libreoffice.org/71665 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-04-27lok: handle missing callback.Michael Meeks1-0/+2
Change-Id: I13a200c9c9d8b0a8fde6dd15a71fe1a665d04e8d Reviewed-on: https://gerrit.libreoffice.org/71432 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-04-26lok: allow paste content to popup dialogHenry Castro2-2/+2
Change-Id: I1893d52df505bc43428c37a624ca05c569ba1bc0 Reviewed-on: https://gerrit.libreoffice.org/70958 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
2019-04-25Cut down on -pthread/-lpthread proliferationStephan Bergmann3-3/+0
Building against libstdc++ effectively always requires -pthread anyway (as various standard C++ headers require it, see the comment added to solenv/gbuild/platform/unxgcc.mk), so many explicit uses of -pthread/-lpthread can be removed. Doing a (partial) test build on Linux with Clang -stdlib=libc++ suggests that libc++ indeed doesn't need -pthread as libstdc++ does. The remaining uses of -pthread/-lpthread are mostly in configure.ac for the various BSDs (which somebody else might want to clean up now), and related to external projects. I tried to be careful to remove -pthread/-lpthread from makefiles only when C++ object files are involved (so -pthread will now be included on the link command line by default). Change-Id: I936e082839cb9a434bd273ce5a1f187a4245dfa1 Reviewed-on: https://gerrit.libreoffice.org/71291 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-15lok: emit ProfileZone data in messages when requested.Michael Meeks1-0/+2
Change-Id: I42a773e2d5b8e4deeafa8eeb2785913db36a47d7 Reviewed-on: https://gerrit.libreoffice.org/70688 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-04-15improve loplugin simplifyconstructNoel Grandin1-1/+1
to find stuff like OUString s = OUString("xxx") Change-Id: Ie7ed074c1ae012734c67a2a89c564c1900a4ab04 Reviewed-on: https://gerrit.libreoffice.org/70697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-13use more std::make_uniqueNoel Grandin1-2/+2
Change-Id: I7d85cbc9105c5e0c4a8d9a69c4ac9d6dfc07eabd Reviewed-on: https://gerrit.libreoffice.org/70663 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-28simplify reset(nullptr) -> reset()Noel Grandin1-1/+1
Change-Id: Iec5e93d9c59dde44571376e46fb98ea854e16b6c Reviewed-on: https://gerrit.libreoffice.org/69784 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13lok: keystroke attribution issue.Michael Meeks1-0/+56
Change-Id: I7e5ed3c72fef12d31b5500acffff622b5f4129de Reviewed-on: https://gerrit.libreoffice.org/66931 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-01-25lok: calm down CnP issues & simplify.Michael Meeks1-67/+49
Change-Id: I67669b9b3accbcf89bddf3b8dc8435edba89224b Reviewed-on: https://gerrit.libreoffice.org/66925 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann1-1/+1
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-15gtktiledviewer: Handle LOK_CALLBACK_SIGNATURE_STATUS to avoid an assert.Jan Holesovsky1-0/+5
Change-Id: Iae56708d94a229911a5d008d519120ac59069cf3 Reviewed-on: https://gerrit.libreoffice.org/63391 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-11-15gtktiledviewer: Compile-time check instead of an annoying assert.Jan Holesovsky1-1/+9
Change-Id: Iece75f6f40bf7d7dfcde372cf9b4606adb9e34b2 Reviewed-on: https://gerrit.libreoffice.org/63390 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-11-10clang-tidy: (WIP) bugprone-too-small-loop-variable findings 2Tamás Zolnai1-2/+2
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 Grandin1-8/+5
Change-Id: Ia2a0d25c3833dfde0cd28337361f3cbd2aa29662 Reviewed-on: https://gerrit.libreoffice.org/62934 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-01clang-tidy: (WIP) bugprone-too-small-loop-variable findingsTamás Zolnai1-6/+6
Change-Id: Iaa255b39928ac45dec1ed37e368c149d6027f561 Reviewed-on: https://gerrit.libreoffice.org/62701 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-10-23remove all use_action_appearance linesCaolán McNamara1-9/+0
Change-Id: I031676e939f53a28b1a62654ffe0a91b95dea029 Reviewed-on: https://gerrit.libreoffice.org/62234 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>