summaryrefslogtreecommitdiff
path: root/libreofficekit
AgeCommit message (Collapse)AuthorFilesLines
2017-01-06gtktiledviewer: Override alignment buttons uno commands for calcPranav Kant1-0/+19
Use .uno:HorizontalAlignment instead of .uno:XXXPara for calc Change-Id: I5af4fe62dc3075af4ba779499d062e6d91f21ecf Reviewed-on: https://gerrit.libreoffice.org/32773 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
2017-01-06gtktiledviewer: Support for posting arguments to uno commandsPranav Kant1-9/+12
Change-Id: I5db217b525d0f976ef6a7840e370f8f6a21d60cb Reviewed-on: https://gerrit.libreoffice.org/32772 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
2017-01-06lokdocview: Handle insert keyPranav Kant1-0/+3
Change-Id: Idb5ad17a3a94b9a6fba1113a759207c59acfb7bd
2017-01-02Fix inefficient usage of string::find() in condition (CWE597)Muhammet Kara1-1/+1
string::compare() will be faster when string::find's result is compared with 0, because it will not scan the whole string. Change-Id: I78596a6d796fe9779f88b7c7b91da09aa27b7035 Reviewed-on: https://gerrit.libreoffice.org/32430 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2016-11-10re-apply "use material style selection handles""Christian Lohmaier1-1/+1
and account for the libreofficekit changes This reverts commit 50e9065cbbb2c62fa925cf5b561a85c715a0eb1e. that did in turn revert 4ae8c3c20bd4a10ba141a32f01e23ac63636f9c3. Change-Id: Ie02d8743b3608120ed63bfe2a014fa4139577b01
2016-10-24revert string::find changesNoel Grandin1-1/+1
this reverts commit 610f59651563205564a0f4818b5c1d347ca02132 fix "cppcheck:stlIfStrFind" and commit 5c1bb338ef0d781648d5b33ffc9d64c2be6d9926 cppcheck:stlIfStrFind which are deficient in one way or another, the original logic, while inefficient, is still most accurate Change-Id: I4907d2569c9c2976533f8ac9f4b8b45eb1807b72
2016-10-24fix "cppcheck:stlIfStrFind"Noel Grandin1-1/+1
in commit 5c1bb338ef0d781648d5b33ffc9d64c2be6d9926, compare does not do a startswith Change-Id: If518b3f6880848a5b5463c09fb73974d972010fd
2016-10-24cppcheck:stlIfStrFindJulien Nabet1-1/+1
Change-Id: Ic3c1b37b0c2cf9995e0bd1017cdbaed427fb296c Reviewed-on: https://gerrit.libreoffice.org/30185 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-14LOK: handle "EMPTY" invalid tile msg with part number in payloadMarco Cecchetti1-1/+1
What's new: 1) RectangleAndPart handles "EMPTY" payloads 2) LOK_CALLBACK_INVALIDATE_TILES msg type with "EMPTY" payload are handled in CallbackFlushHandler::queue 3) gtktiledviewer handles "EMPTY" LOK_CALLBACK_INVALIDATE_TILES msg even if the part number is included in the payload Change-Id: I21f4a71ec875d24f4bbd100e4aacf8437d745ae4
2016-10-10Handle loplugin:fpcomparison false positives by whitelistStephan Bergmann1-3/+1
Change-Id: I58e2beb0695a27922856bd8f8988d9e4508aceb6
2016-10-01let approxEqual() not scale too early for large representable integer valuesEike Rathke1-1/+21
And since this is now too much code for inline move implementation to math.cxx Which again made it necessary to give libreofficekit lokdocview.cxx its own implementation that doesn't even claim to build against sal ... Change-Id: I0f80be9d9172ee20693b9babde715206f2c3d8c1 Reviewed-on: https://gerrit.libreoffice.org/29428 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-09-29LOK: conditionally include part number in invalidation payloadMiklos Vajna1-1/+4
Since desktop/ code queues, compresses and only emits callbacks on idle, it's possible that two invalidations are in the queue, and there was a setPart() call between them. In this case it's impossible to tell what part the invalidation was sent for. Fix this by conditionally including the part number in the invalidation payload. It's off by default, a new feature flag is added to request this behavior. gtktiledviewer enables this feature flag by default, though just to show the part number in the debug output. Android doesn't enable it. Change-Id: I73e6def848c0eb61d64e71026002c7a0e750aab4
2016-09-23gtktiledviewer: Wrap dialogs in a GtkScrolledWindowPranav Kant1-2/+8
Change-Id: I33be18779ea680f7a9c20814ca3c3d94d206900b
2016-09-21lok::Document::getCommandValues: expose sw redline author colorsMiklos Vajna1-22/+69
These colors are used in the tiles, so it's a good idea if the client can use matching colors for cursors and selections. But to be able to do that, we need an API to expose these colors. Change-Id: Ia688c07e6c300fecdf8dc428d5a3f000d1857387
2016-09-20lokdocview: guard against int overflowMiklos Vajna1-2/+10
If a too large rectangle is parsed, the width or the height may be larger than std::numeric_limits<int>::max(), in that case just set width/height to that max value, instead of allowing an overflow. Change-Id: Ic01319b01a3f9286501c346ea765868be57466a1
2016-09-19sw: emit LOK_CALLBACK_STATE_CHANGED when cursor enters/leaves a redlineMiklos Vajna1-2/+16
For now only care about the start of the cursor, which can be only at a single redline. Add matching testcase + expose it in the gtktiledviewer status bar for interactive manual testing. Change-Id: Ib61757412d6b54bef64361d4a8563795ca0bab6c
2016-09-16lok::Document: rename getViews() to getViewsCount()Miklos Vajna1-1/+1
As this only returns the number of views, not the actual views. Since it's a rename, it's just an API (but not an ABI) change. Change-Id: Ib4f0ea56a90e5ae9c80ee1781aa2f29aff4259e7
2016-09-15sw: allow select of redline by indexMiklos Vajna1-2/+7
Previously .uno:NextTrackedChange 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. Change-Id: I7dbe8044feca8fcc48635482a22317b024f40ffa
2016-09-12gtktiledviewer - Calc fix: selection handlers were not removedMarco Cecchetti1-0/+3
Change-Id: I2b4ad4dbf281458d0994eff176a2f62e20fb603b
2016-08-31lokdocview: handle empty LOK_CALLBACK_DOCUMENT_SIZE_CHANGED payloadMiklos Vajna1-1/+5
Calc omits the document size in the payload in several cases, and online.git handles that, so handle it in lokdocview as well for now, instead of fixing up all the sc code to always emit the doc size in the payload. Change-Id: Ib2cca1770d2a160e32540e3a3158eb00bf13207b
2016-08-30gtktiledviewer: don't crash on unimplemented tracked change listMiklos Vajna1-0/+3
As it's currently implemented only for Writer. Change-Id: I8c281b2294564472f2c2c5b7de5dd3f86a11a94a
2016-08-29sw: use SwModule::GetRedlineAuthor() in SwTextShell::ExecField()Miklos Vajna1-17/+2
This avoids some code duplication, and also means that the redline author set by SwDocShell::SetView() affects the inserted Writer comments as well, while those were 'Unknown Author' in the LOK case. Change-Id: Ib51183302ee6904fdf69fb16f27ecfe6df39e6cb
2016-08-29Emit notification to a LibreOfficeKit client also when a redline is modifiedTor Lillqvist1-0/+6
Work in progress, not all modifications to a redline record cause notifications yet. Change-Id: I01614cd6ede9576e9cc329889fef86342567325f
2016-08-28coverity#1354270 Uninitialized scalar fieldCaolán McNamara1-0/+1
Change-Id: I770e02a6f7ef09c50cf93982dd88dfdb1a163bea
2016-08-19sw redlines: expose description as part of the UNO/LOK APIMiklos Vajna1-3/+4
A redline can have a manual comment and also an autogenerated description, like "Insert 'abc'". Expose this later property as well, as it provides useful additional information, especially when the comment property is empty. Change-Id: Id0f0ff62aef58d96b9b6071706c6f5b4a0d74800
2016-08-19sw lok: add callbacks for redline table insertion / removalMiklos Vajna1-0/+6
An alternative would be to follow the Manage Changes dialog approach and subscribe to the SFX_HINT_DOCCHANGED notification in SwDocShell, cache the old redline table and find out the differences to the current one, but that way sound much more complex without benefits. Change-Id: I20a45285b88255ccea9d6646c0b5288ac1c91879
2016-08-19tdf#101592 sw: track changes state is doc-specific, not view-specificMiklos Vajna1-0/+12
So update the bindings of all views after changing it. Change-Id: I5355f40ba27be521dcdf343b08305f3736979bbb Reviewed-on: https://gerrit.libreoffice.org/28233 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-18coverity#1371131 Dereference after null checkCaolán McNamara1-1/+1
Change-Id: I292ac0b59af2ed8897367d56ddb01bf4606a7693
2016-08-18gtktiledviewer: specify author name when calling initializeForRendering()Miklos Vajna2-6/+33
Open two views, and type into both of them when a Writer doc with redlining enabled is open: the manage changes dialog now shows how the correct author is used when creating the redline items. Change-Id: I48fb90301bfcc04b06d5be5544324ca76fe7b3d7
2016-08-17sw: allow accept/reject of redline by indexMiklos Vajna1-4/+37
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 Vajna1-1/+67
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 Vajna1-0/+5
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 Vajna1-16/+31
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 Vajna2-2/+108
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 Vajna1-1/+16
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 Vajna1-13/+13
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 Vajna1-0/+59
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 Vajna1-1/+11
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 Vajna1-4/+10
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 Vajna1-23/+68
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 Vajna1-0/+9
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 Vajna2-7/+23
By calling it when we're not the last window. Change-Id: I6fd4763243fc088ccfe015b6c03b6b3f25146fac
2016-07-13lokdocview: This can be fired even without documentPranav Kant1-0/+5
... so handle it and avoid the assert Change-Id: Ib244746fabeaf41b5ca927d94fc4c3bda19bef26
2016-07-13lokdocview: Add missing callbacksPranav Kant1-0/+4
Change-Id: I2fd32bb210f1b5f0a090c29af707cb6ca6e8dd77
2016-07-12lokdocview: log the view id of the callback messagesMiklos Vajna1-1/+4
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 Vajna1-0/+21
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 Bergmann1-1/+1
Change-Id: Ia645dd9c5301d93abea90646ad32e94b8cb8ce17
2016-07-04Fix some spelling errors in comments and stringsOtto Kekäläinen1-1/+1
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 Vajna1-4/+39
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 Vajna2-28/+7
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>