summaryrefslogtreecommitdiff
path: root/libreofficekit
AgeCommit message (Collapse)Author
2016-08-17sw: allow accept/reject of redline by indexMiklos Vajna
Previously .uno:AcceptTrackedChange / .uno:RejectTrackedChange always worked by cursor position, but redlines are stored in the redline table, so they have a unique index. Allow specifying that index when invoking the command, and in that case ignore the cursor position. The index is not stable after an insertion / deletion. Change-Id: I493a22e84800ded224fb6b9c61261744dc0fb64f Reviewed-on: https://gerrit.libreoffice.org/28192 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-17lok::Document::getCommandValues: expose redline infoMiklos Vajna
Index is added as a property for each item, so that later changes can be identified by the index when they are accepted/rejected. Change-Id: I9362d208fdbed1f46d64558d44498d2b19150c81
2016-08-10sw undo: add a Repair argument to the .uno:Undo/Redo commandsMiklos Vajna
Undo/redo is limited to undo actions created by the same view in the LOK case, this argument removes this limit. This can be used by a client for "document repair" purposes, where undo/redo of others' changes is intentional. The sfx command dispatch has support for FASTCALL slots (a state function is not called, the command is always enabled) and also has support for state functions, but those functions only get the ID of the slots, not its parameters. What is needed here is a command that's disabled by default, but in case a Repair argument is used, then it's unconditionally enabled. So handle that case in the sfx dispatcher directly for now. Change-Id: I96c1130bf51abcdd722684b1fa4a8277f92fd555
2016-08-09gtktiledviewer: fix incorrect undo/redo stateMiklos Vajna
Edit state = false disabled undo, then edit state = true enabled the undo button, even the last LOK callback was '.uno:Undo=disabled'. Fix this by storing the LOK state in a map, and using it when edit is enabled. With this, clicking on the Edit button right after loading a document results disabled undo/redo buttons as expected. Change-Id: Id6023f976f135555a43486f71603c823e59d8d60 Reviewed-on: https://gerrit.libreoffice.org/28003 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-05gtktiledviewer: expose undo/redo info in a repair document dialogMiklos Vajna
This shows the full undo and redo stack, with all the metadata available via the LOK API. Also fix SfxUndoManager::GetRedoActionsInfo(), so it's easy to show the undo/redo stack in linear time; and fix a use-after-free in lokdocview. Change-Id: I66625ed453efa61b5738d99d7d1ad8f468908240 Reviewed-on: https://gerrit.libreoffice.org/27913 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-28gtktiledviewer: quit after the last view is destroyedMiklos Vajna
To allow debugging crash-on-exit problems. Change-Id: Ie54a8391e721c3ba8034b4618dd30733bac97a27 Reviewed-on: https://gerrit.libreoffice.org/27605 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-25lokdocview: draw a lock inside the lock indicatorMiklos Vajna
Hopefully less confusing, the crossed out rectangle is also used inside the tiles for deleted comments, and the two are independent. Change-Id: Id06fbf6ec1b21dfbab1c126c3c432f91cf51430c Reviewed-on: https://gerrit.libreoffice.org/27503 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-22sw: add new LOK_CALLBACK_VIEW_LOCK callbackMiklos Vajna
When we're after SdrBeginTextEdit(), but before SdrEndTextEdit(), and have multiple views, then only the active view paints the edited text, the other views look like the shape has no text at all. Add a new callback that exposes the position and size of the rectangle where the shape text will be painted after text edit ended, so clients can draw some kind of locking indicator there. This way the rendered result can differ in the "shape has no text" and the "shape text is edited in an other view" cases. Change-Id: I6096479a8a05c2547d15222e6d997b848af02945 Reviewed-on: https://gerrit.libreoffice.org/27441 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-22gtktiledviewer: align to top/left for CalcMiklos Vajna
Otherwise when zooming out enough that not all available space is used, the default horizontal/vertical centering happens, and the row/column headers and the tiles become out of sync. Also revert to the previous default window size, I'm not sure why that was necessary. Currently checking the mentioned situation (empty Writer document with comments only) does not require this larger size, and testing two views is easier with the smaller size. Change-Id: Ia92a591387f62655a671e2d09f5053827fde5045 Reviewed-on: https://gerrit.libreoffice.org/27427 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-19lokdocview: still allow view selections/cursors from other Writer viewsMiklos Vajna
Writer pages are exposed as parts, but it still makes sense showing selections/cursors from other parts in that case. Change-Id: Ic76d93291bde2d959c149cf2ef5eba7ed33a45e8 Reviewed-on: https://gerrit.libreoffice.org/27321 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-19lokdocview: handle part number in view selections/cursorsMiklos Vajna
This way we show view selections/cursors from other views only in case the part number matches. Anything else looks buggy in Calc/Impress. Change-Id: If3ecbfc4b05350606730319b1a570afc15fd9d0a Reviewed-on: https://gerrit.libreoffice.org/27315 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-15lokdocview: ignore notifications on view shutdownMiklos Vajna
Callbacks are processed on idle on the main thread, so by the time we parse them, possibly the widget is already gone, avoid that problem. Change-Id: Ie8e16423d1ffe087e0dd21425026f7a5d644c27b
2016-07-15gtktiledviewer: allow testing of destroyView()Miklos Vajna
By calling it when we're not the last window. Change-Id: I6fd4763243fc088ccfe015b6c03b6b3f25146fac
2016-07-13lokdocview: This can be fired even without documentPranav Kant
... so handle it and avoid the assert Change-Id: Ib244746fabeaf41b5ca927d94fc4c3bda19bef26
2016-07-13lokdocview: Add missing callbacksPranav Kant
Change-Id: I2fd32bb210f1b5f0a090c29af707cb6ca6e8dd77
2016-07-12lokdocview: log the view id of the callback messagesMiklos Vajna
So that e.g. it's possible to see which invalidation affects which view. Change-Id: I6b6db2fa07eaecd1315ce8160c3b3b86e9e5a348 Reviewed-on: https://gerrit.libreoffice.org/27138 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-08sw lok: add LOK_CALLBACK_VIEW_CURSOR_VISIBLEMiklos Vajna
With this, in case a text cursor is turned into a graphic selection in view#0, then view#1 can also hide the text cursor of view#0. Change-Id: I7de89b8537ef8b0985336793b719d93733604bff Reviewed-on: https://gerrit.libreoffice.org/27044 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-06clang-tidy performance-faster-string-findStephan Bergmann
Change-Id: Ia645dd9c5301d93abea90646ad32e94b8cb8ce17
2016-07-04Fix some spelling errors in comments and stringsOtto Kekäläinen
Change-Id: Iecd6b5e13d6be14651f77d8e37f01117ba15a11e Reviewed-on: https://gerrit.libreoffice.org/26883 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-07-01svx lok: add LOK_CALLBACK_GRAPHIC_VIEW_SELECTIONMiklos Vajna
So a view can be aware where the graphic selections of other views are. Change-Id: I0cc420cfe4bf3824fbfa1a58da889cac5e9a7b60 Reviewed-on: https://gerrit.libreoffice.org/26863 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-01lokdocview: replace handle_graphic.png with manual drawingMiklos Vajna
If we draw a black graphic handle manually, then it's possible to color it later, this isn't easy if a bitmap is painted. Change-Id: Ib4456fd5155862d52e3ffa79ee49c7bfd16fb742 Reviewed-on: https://gerrit.libreoffice.org/26860 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-07-01sc lok: add LOK_CALLBACK_CELL_VIEW_CURSORMiklos Vajna
So a view can be aware where the cell cursors of other views are. Change-Id: Ifcf06c0019c6af8b859e2e92222e4f3fd18da74f Reviewed-on: https://gerrit.libreoffice.org/26844 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-30lokdocview: avoid pointless setView() before getView()Miklos Vajna
This fixes the following use-case: 1) Start gtktiledviewer, click New View 2) Click Edit in the first view 3) Click somewhere in the document in the first view -> nothing happens Change-Id: I79d63538607f03b78851a639adf158d918745276 Reviewed-on: https://gerrit.libreoffice.org/26789 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-30LOK: change back type of view ids to intMiklos Vajna
Commit 45c2410041c48c22bd860efb42d4daadad7869b0 (LOK: change type of view ids to uintptr_t, 2016-06-17) fixed the problem of view IDs being reused for the price of random IDs, which makes debugging harder. Implement a simple shellToView() function that makes sure view IDs are not reused, and stop exposing view shell pointer addresses, which allows reverting the LOK API change. Change-Id: I63089e6de08ee7e1c7706757d43a11f6cf4d6e06 Reviewed-on: https://gerrit.libreoffice.org/26773 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-22lokdocview: ensure setView() + doSomethingElse is atomicMiklos Vajna
Otherwise it's possible that a keystroke is sent in for a different view, when that other view reacts to an invalidation (invoking paintTile()) caused by a previous keystroke. I.e. open two views, place the cursor at different positions, type fast, and some of the characters appeared at the incorrect view. Change-Id: Ie5e471f1b9c2d69adaa87111fba74d4abe184ef8 Reviewed-on: https://gerrit.libreoffice.org/26562 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-21sw: add LOK_CALLBACK_TEXT_VIEW_SELECTION testcaseMiklos Vajna
Fails with 9f66db9c474f71f43d7a3667230241fd4fa4183f (sw lok: add LOK_CALLBACK_TEXT_VIEW_SELECTION, 2016-06-21) reverted. Change-Id: Ide21167ce2dc4287b1860b5f03a6975dc9edd4c6 Reviewed-on: https://gerrit.libreoffice.org/26550 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-21lokdocview: handle LOK_CALLBACK_TEXT_VIEW_SELECTIONMiklos Vajna
It's similar to the normal selection, but it's colored and has no handles. Change-Id: Ibd9594b4834ff4f9b1cfd85912ed5cee3c8b8c71 Reviewed-on: https://gerrit.libreoffice.org/26543 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-21sw lok: add LOK_CALLBACK_TEXT_VIEW_SELECTIONMiklos Vajna
So a view can be aware where selections of other views are. Change-Id: I5026b1ff2b99a4eedfd0bde32a05ceb8e2f424bc Reviewed-on: https://gerrit.libreoffice.org/26542 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-21lok: Expose LO version informationPranav Kant
Change-Id: Ided924e928c04385457c7a2e231fdf57e7e38970
2016-06-20lokdocview: handle LOK_CALLBACK_INVALIDATE_VIEW_CURSORMiklos Vajna
It's similar to the normal cursor, but it's colored and does not blink. Change-Id: I6a869a98f46979946f320905426e016fe011cbc6 Reviewed-on: https://gerrit.libreoffice.org/26522 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-20sw lok: add LOK_CALLBACK_INVALIDATE_VIEW_CURSORMiklos Vajna
So a view can be aware where cursors of other views are. Change-Id: I6133fb55aa2869843c0284b7d76264bab3b3d5da Reviewed-on: https://gerrit.libreoffice.org/26513 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-17LOK: change type of view ids to uintptr_tMiklos Vajna
This fixes the following problem: - createView() = 1 - createView() = 2 - destroyView(1) and then view #2 was renumbered to 1. Instead expose the pointer address of the SfxViewShell as the ID, which is not changing in such a situation. Note that the SfxViewShell <-> ID mapping is an implementation detail of SfxLokHelper, and only pointers are converted to IDs, user-supplied IDs are never converted back to pointers. Change-Id: If79ef8b99ba391011b5d82b219ad13447d44cd5a Reviewed-on: https://gerrit.libreoffice.org/26423 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-17comphelper lok: remove the g_bViewCallback globalMiklos Vajna
Its purpose was to allow incrementally migrate all callers of SdrModel::libreOfficeKitCallback() to use SfxViewShell::libreOfficeKitViewCallback() (which allows notifying only the currently active or all views) instead. That is done by now, so it can go. Change-Id: I521bbbe5c638dfd844ebf025153459a37362d3c3 Reviewed-on: https://gerrit.libreoffice.org/26413 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-16comphelper: enable LibreOfficeKit::isViewCallback() by defaultMiklos Vajna
This requires porting the sw/sd/sc_tiledrendering test code to the new internal API, as only the public LOK API is unchanged. Change-Id: Ic6a2f96421da4a16bdee7d0cbb3f6e35bc6ddff9 Reviewed-on: https://gerrit.libreoffice.org/26379 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-15gtktiledviewer: add a UNO command debuggerPranav Kant
... to fire desired UNO commands from a dialog. Helpful when you need to check some arbitrary UNO commands not supported via UI yet. Change-Id: I55df75ef235f5eb6922c50619610caf1c88241fb
2016-06-15gtktiledviewer: Fix runtime gtk warningsPranav Kant
Not all buttons are toggle buttons. Change-Id: I6cddc619f3f760e447ea3ffea07f776e03cdaab9
2016-06-14lok_doc_view_reset_view: don't touch the view idMiklos Vajna
Otherwise the following can happen: - view #0 is created - view #1 is created - view #1 changes part, so lok_doc_view_reset_view() gets called - view #1 calls postMouseEvent(), but claims it happened on view #0 Also log all setView() calls in the widget. Change-Id: Iefcf82d9396b2af75586e79dde59998320f41d60 Reviewed-on: https://gerrit.libreoffice.org/26245 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-13gtktiledviewer: fix the per-view part selectorMiklos Vajna
Need to populate it & register handlers for the non-first windows as well. Change-Id: I27231027c3f33fb081768c51ecc291b9f2a7e99b Reviewed-on: https://gerrit.libreoffice.org/26225 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-10gtktiledviewer: fix runtime warnings caused by .uno:InsertAnnotation buttonMiklos Vajna
It's a GtkToolButton, but not a GtkToggleToolButton, so don't cast command buttons down unconditionally. Change-Id: Ie7c9bdf6fa8725363e40c1544f4e1e835a559f3a Reviewed-on: https://gerrit.libreoffice.org/26171 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-05-11lokdocview: Add debug info; paintTile rendering timePranav Kant
Change-Id: Icdb14e9a5fedb3dcfbad502e323b333c3dbcc534
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-04-27lokdocview: log postMouseEvent() argumentsMiklos Vajna
Change-Id: Idd4db9259448d3dcf4e0820b8845a1ab395f0bff Reviewed-on: https://gerrit.libreoffice.org/24427 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-26lokdocview: log setGraphicSelection() argumentsMiklos Vajna
Change-Id: I36af712274e1a3f9dacd5d62ab42032ca9e9acdd Reviewed-on: https://gerrit.libreoffice.org/24390 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-19In lok_init_2, allow vnd.sun.star.pathname user_profile_urlStephan Bergmann
...which takes a raw filesystem pathname that is internally converted to a file URL (similarly to what is supported for the INIFILENAME and URE_BOOTSTRAP bootstrap variables in rtl::Bootstrap). That way, the gtktiledviewer executable doesn't need to try convert a pathname into a URL. Also adapted various parameter names to make it obvious that URLs get passed, not pathnames. Change-Id: I33ab31fe142d94ee47885033ef48278ef5ff55a2 Reviewed-on: https://gerrit.libreoffice.org/24241 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-04-19tdf#99314 lokdocview: add new userprofileurl propertyMiklos Vajna
So that users of the widget can use a custom user profile, allowing running widgets users and LibreOffice in parallel. Change-Id: I1bd0a8e53aa3216adc721052cf30f0dd174327bd Reviewed-on: https://gerrit.libreoffice.org/24237 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-08lok context menu: Expose context menuPranav Kant
Change-Id: I0968689630e10f838c075e86357eb36a9a220d0d
2016-03-08New LOK_LOADLIB_GLOBAL to let clients control dlopen(RTLD_GLOBAL)Stephan Bergmann
...in LibreOfficeKintInit.h's lok_loadlib, now that RTLD_GLOBAL isn't only needed for UBSan (62b124b2704adf11a63681164d05a8eb49dfb105 "Ensure RTTI symbol visibility for Linux Clang -fsanitize=function,vptr") but also for -stdlib=libc++ on Linux (see <https://whatofhow.wordpress.com/2016/03/01/libclibcabi-on-linux/>). Change-Id: I24ed6612c3d922eba695423d46af5635c77f7077
2016-03-01gtktiledviewer: log .uno:ViewRowColumnHeaders command resultMiklos Vajna
Change-Id: I6d71071371ef54f70613246162c893daa56b7bb9
2016-02-25cid#1354270 fix uninitialized membersMiklos Vajna
Change-Id: I35fda96885375996a1b0b05ecc04a0ac35104b88
2016-02-21tdf#97235: Protect reset_view when called with no tile buffer initializedPranav Kant
This can happen when no document has been loaded yet. Change-Id: Ib9c18e22b6c344528d05eb781bf9b3052060089a