Age | Commit message (Collapse) | Author |
|
Specifically in sd/source/core/annotations/Annotation.cxx
We seem to end up fixing leaks here often.
The current tools::JsonWriter API is just very hard to use correctly.
So rather return an OString, which is cheap to copy,
and push that down into the LOK code.
AFAIK that seems to end up requiring less code and less adhoc copying
of data (specifically the queueing code in init.cxx was creating
copies when converting to std::string).
Ideally, we could have some special API to avoid the new strdup()
calls in init.cxx, but not sure how to prevent other people
from accidentally using that.
Change-Id: Ia33437c1bfd9cc2d54dfb99914d1b72db20335f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149963
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I3905fc9e6376ca1cef3e438e7a5f229d3720b1f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138961
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142501
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
|
|
Use the OutputDevice::StartTrackingFontMappingUse() and
OutputDevice::FinishTrackingFontMappingUse() functionality that was
added last year.
Add a new LibreOfficeKit document callback:
LOK_CALLBACK_FONTS_MISSING.
"Font" here means just the family name. We dont really know what style
from the family is missing.
Change-Id: Iec4349b5827e7d1dbdde7f8a9f8da92efde429e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138802
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
|
|
SwViewShellImp::AddPendingLOKInvalidation() collects invalidations,
but this was relying on something eventually calling
flushPendingLOKInvalidateTiles(), which wasn't guaranteed.
If e.g. a spellchecker caused an invalidation from in idle callback
and nothing else changed, then the LOK callback handling code
didn't know there was something pending. So add an explicit
call to ensure to notify about these pending invalidations.
Change-Id: I0a9cb0d5aba2fdbbac126cd8a4a3412bef1cab25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136531
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
Always suspicious that some un-expected dialog / state can cause
strange behavior in a client. An initial cut at an API to make it
easier to unwind such problems by exposing the toolkit state.
Change-Id: If8f17943fa4837df4f9ca659a111dcdce5c23244
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137504
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Callbacks may be invoked while calling getLOKPayload(), which
would try to lock the mutex again. I actually originally expected
this possibility, as the comment and moving the data to
temporaries in CallbackFlushHandler::enqueueUpdatedTypes()
shows, I just didn't realize the used mutex wasn't recursive
and so would deadlock.
Change-Id: I2b5c4b6b4c1a3933a32ae4641830877e085f2b6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135499
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: Ie9c1cd41c5944b901f4ec6c1e4ffd8608c063ffa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135317
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
273a25c796fca9afa0dfadac57dc3f336831221c changed the handling of LOK
messages to only set up an "updated" flag for types and then
when flushing the value is fetched. This means that queue() is not
called for such updates, and so the timeout to flush the messages
wasn't started.
Change-Id: I3a7324c86a55697f509f80b6c54cb949fb1daa72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130526
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
We tend to get many of these per keystroke, with the same state.
Change-Id: I9d759f54aee8d6dabcef094997e8f352dd608ec3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128539
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
3db1ce30ab235ad22aed71c22e4f6f52b7b88829 added some range checking
on the rectangles, such as making sure (x,y) is not less than (0,0),
and it added it to converting string messages back to rectangles.
But then 3b729db05553c1a6d461fb41c89a05702f407448 avoided
the conversions from string messages back to rectangles, and thus
it avoided also these checks.
Change-Id: I73a08e418dc2e48ef5e89fe1aee0272851f7d363
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126865
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
The LOK_CALLBACK_INVALIDATE_TILES documentation says that
invalidate-all message should say "EMPTY", which wasn't converted
properly from the MaxTwips rectangle representation. Doing that
now needs also changing the testTileInvalidationCompression() test,
but that should be a fix of the test, and conceptually it should
be the same.
Change-Id: I58fcc56ee56d9f6fcdb9298938e8aa7e3609d6db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126651
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
Change-Id: If18268a26118ea587f474c21b7ca0f1fa4622744
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126469
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
Change-Id: Iebeb531fad5cc819b536788925cf8508737198b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124599
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
setUpdatedTypePerViewId() gets called so often that even unordered_map
lookup and allocations show up in profiling. It seems that flat_map
can do better.
Change-Id: Id2e4f0c40d6973b51e557f84a08bf12feb58b3ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124210
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
Some LOK messages may get called very often, such as updates about
cursor position. And since only the last one matters, they get
generated every time, which costs some time, and then later except
for one they get all discard again from CallbackFlushHandler queue,
which again costs time.
Change the model to instead only set an 'updated' flag, and
CallbackFlushHandler will request the actual message payload only
before flushing.
This commit changes LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR and
LOK_CALLBACK_INVALIDATE_VIEW_CURSOR to work this way.
Change-Id: I376be63176c0b4b5cb492fbf529c21ed01b35481
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124083
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
It's better to add to the name what the overload does rather than
just have a "mysterious" extra int.
Change-Id: Iff89679c4a978a4596ac662ef74e934cdefefc9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124001
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
Due the to way views are updated on any document change, invalidations
are at least O(n^2), and since LOK may use a number of views and
for each view the entire document is considered to be the view area,
this can lead to a huge number of invalidations that are mostly
the same repeated rectangles.
Change-Id: I63682958d2fc388344641dcd19fa1d2b39054b51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123617
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
CallbackFlushHandler post-processes LOK messages, but for things
like dropping useless invalidations it needs to know the rectangle
or the view id, and since the only data it gets are string messages,
it needs to convert those back to binary form. Which is slow
with large numbers of messages.
Add internal LOK callback variant that allows also passing
specific data in the original binary form. And then use directly
the binary data in CallbackFlushHandler.
Change-Id: I8dd30d2ff9c09feadebc31a44d8e6a8ccc306504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123589
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
Change-Id: Ifd3a1ccef68ebc4cd4e7785357e6a476f6669eb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123456
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
The normal idle has TaskPriority::POST_PAINT, which means that
if we get too busy, the idle won't be called for a long time,
meaning the queue will get longer and longer, making its processing
slower, and client interactivity will be very poor, with updates
possibly coming only when everything becomes idle.
The second timeout will flush the queue after a reasonable timeout.
I don't think there's an optimal value, so let's choose 100ms for now.
Change-Id: Ia1312a690aefd2c8628c82e0f42b2993802d8b1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122728
Tested-by: Luboš Luňák <l.lunak@collabora.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
All the lambdas check for event type, so it makes sense to first
separately check the type and only then possibly call the lambda.
Especially since 3b3e4ee97af23f21 separated the types for better
searching.
Change-Id: I144c88f5319ac2141336e1aa3c4ffd7b38265af9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122673
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
|
|
we frequently scan the queue to caolesce events.
Most of the time we are scanning based on the event type.
So split the queue data into a compact queue that only contains the
type, and another queue for the rest of the data.
That makes the scanning __much__ more cache-friendly.
Change-Id: I92d0b95611cd139cac8532f9297eaabda71d5fe9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119996
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit acf9cf33d53e4bf598ddbdab102bfbd6bb14f8a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121558
Tested-by: Jenkins
|
|
(*) tweak buffer in SfxLokHelper::notifyInvalidation to be a bit larger,
so we avoid the cost of a resize©
(*) use our optimised OString concatentation instead of going via
std::stringstream
(*) pass down a pointer to rectangle, instead of a string. later we will
use this to avoid doing the stringify until later
Change-Id: Ia3e3042bc919d9b9cb80e47a93704eb236438605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119994
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120072
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Instead of using the current view to set
the DocId, we instead make sure that the ShellView
object has the DocId set at construction time.
This turned out to be necessary in at least one
case (which has a unit-test that failed), which
is when events fired during the creation of a
new view. The cursor position is notified
before we have a chance to set the DocId and
because of that we miss the notifications (or
worse, we end up sending them to all other
documents' views in an effort to fix this bug).
This approach is clean and always guarantees that
all views have the correct DocId set as soon as
possible and that all notifications are sent
as expected.
A unit-test is added to exercise mult-document
usage, which exposed a number of bugs and issues
that have been addressed in this patch.
Change-Id: Icf5145fb1dabd0d029368310c2b9bf73ae927ccc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99975
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Ashod Nakashian <ash@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106252
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
|
|
This commit was carried out by a Python script, source of which
is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97.
Change-Id: I26f01467d2a572a51c7ace76628d4a8f96f249a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102553
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
The LibreOfficeKit-specific code typically has assumed that all the
"views" (SfxViewShell instances) are for the same document, because
all LibreOfficeKit-based application processes (including the "kit"
processes in Online and the iOS app) so far have only had one document
open at a time.
It is now possible to pass several document file names on the command
line to gtktiledviewer and that is an easy way to demonstrate how
badly it still works even with this patch.
Introduce a unique numeric document id that is increased in the
LibLODocument_Impl constructor. Add APIs to access that. When
iterating over views, try to skip views that are not of the document
visible in the "current" view, if we know what the "current" view is.
Also add a couple of FIXMEs at places where it is a bit unclear (to
me) whether it is correct to iterate over all views, or whether only
views for the "current" document are what we would want.
Change-Id: Id5ebb92a115723cdeb23907163d5b5f282016252
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95353
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
|
|
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.
Change-Id: If72377cb352be71050a5b0a471bbe3b02d9c0f74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87117
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
Change-Id: I1b0df1a6cb5b8db9db09cb1d55d932459ab16d81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86741
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I28c8d60543d85ea878698a3e3661bbd5891ad9c7
Reviewed-on: https://gerrit.libreoffice.org/85075
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
When changing the view, some components are disabled
and re-enabled. This triggers a flood of invalidations
that then result in rendering requests. For each rendering
the view is set, which triggers more invalidations.
The Sidebar suffers from this, and it causes cpu pegging.
This fix prevents this issue by disabling all callbacks
during setView.
Change-Id: If6b93b2ab31f568a0761f15d945a43de1bc2d4d0
Reviewed-on: https://gerrit.libreoffice.org/84184
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/84226
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
|
|
This makes it more readable and reduces indentations.
No functional change intended.
(cherry picked from commit 570a3c5361d58635e4d0ac8baf6df787bd2290ad)
Change-Id: I129ecff9083c459d633c0965eab6e06ba3dcf499
Reviewed-on: https://gerrit.libreoffice.org/76320
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I8ca457387715fcd085bcbf3107839d2629580f7b
Reviewed-on: https://gerrit.libreoffice.org/76296
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I5e29ec2863e06d3dfcbad95c55e355805f12e259
Reviewed-on: https://gerrit.libreoffice.org/67895
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
Change-Id: I090ceb7d214d0809e86b023a8806b6655627918a
Reviewed-on: https://gerrit.libreoffice.org/67894
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
And with DBG_UTIL validate and dump LOK queue state.
Change-Id: I211ddf89dbcecf17c4f1401e5d96919c4bc966ea
Reviewed-on: https://gerrit.libreoffice.org/67893
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
Change-Id: I81f74027363d4b2959c053057851cf01fc94af8b
Reviewed-on: https://gerrit.libreoffice.org/67892
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
Change-Id: I3a2d98426729ad1b4e43a8f657b512679be82c26
Reviewed-on: https://gerrit.libreoffice.org/67891
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
Change-Id: I48e8de8709e017f2667c0bf2c850004128c840d1
Reviewed-on: https://gerrit.libreoffice.org/67890
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
This is in preparation to cache them.
Change-Id: Ic511caf5a8798750288e9271f6898ab38fe2055f
Reviewed-on: https://gerrit.libreoffice.org/67889
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
Change-Id: I3e0623cc68838c650edbd03cc89bf3fcb8098ff8
Reviewed-on: https://gerrit.libreoffice.org/56149
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
|
|
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65
Reviewed-on: https://gerrit.libreoffice.org/38633
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I379c3f8ca971e6180744fb7270dde9164ebcec1a
Reviewed-on: https://gerrit.libreoffice.org/35814
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
|
|
Change-Id: Ibef75de246fb31884153437fe8c05e299fe5962f
Reviewed-on: https://gerrit.libreoffice.org/35782
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
|
|
Change-Id: I9dbb62950e639376c26122ceb9fcec2982b3ca82
|
|
This was for the moment removed from the online.git, so let's disable the API
bits too before it shows this is really necessary. Reverts also:
Revert "Lok: unittest batch API"
Change-Id: I7bf3fe62d1e73b6f233992d51f587868a78f4bec
|
|
Mouse and keyboard operations typically
come in batches, and often each results in
tile invalidations and/or layout modifications.
Processing each input event on its own, then processing
the resulting output event is very costly and unecessary
when we know there is more of the same.
The new API adds support for batching such related
input events by disabling the output events generated
by Core until the batch is done. The client can
then process the resulting events, which will
be compressed and deduplicated.
Change-Id: Id381dab807186d010021a8778ee440074a739920
Reviewed-on: https://gerrit.libreoffice.org/33402
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
Change-Id: I6087a3eff46926646ac1637615a0af30b38956a4
Reviewed-on: https://gerrit.libreoffice.org/30712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.
(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to
OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager();
in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)
Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
|
|
Now view callbacks have their own collection of last states where the
key is made up by both the view id and the callback type.
Callback dropping based on the last state is no more handled on
queueing but on flushing, since what really matters is the last
performed callback (for each callback type).
Anyway in order to not modify the order of callbacks, that could be
changed when an already queued callback is superseeded, dropping still
occurs on queuing too, just by looking for the last queued callback of
the same type.
The result is a substantial reduction of redundant callbacks and fix
the following problem in loleaflet: when there are more views for a
speadsheet and cell cursors for two view are placed on the same cell,
a continuos swapping between the two cell cursors can occur. That was
due to a sequence of "EMPTY" and coordinates messages or cell cursor
and cell view cursor messages which were sent in an alternating way.
Change-Id: I79e14d11d4e8590aff715181e3410ad88c4e6175
Reviewed-on: https://gerrit.libreoffice.org/28783
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
|