tabview.hxx included drawview.hxx for a std::unique_ptr<ScDrawView> member
and an accessor that returns the raw pointer. Neither needs the complete
type, and the destructor of ScTabView is already out of line. The include
dragged svx/fmview.hxx, svx/view3d.hxx, svx/svdview.hxx and the rest of the
svx view class chain into the 200 translation units that include the view
shell headers.
tabvwsh.hxx and tabview.hxx now include the small headers they used through
that chain, and the files that call into the draw view include drawview.hxx
themselves.
clang -ftime-trace says around 2% of the module build time saved here.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I198b19e74f6ad56090b987880a063dc9ee677cda
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12683
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit a7fd69666ea5fb4d26dfad0d286f6c1f3bcd3144)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211884
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
ScTokenArray only uses ScDocument through references, so the header needs
a forward declaration. The rtl::Reference<ScSheetLimits> member with the
defaulted copy constructor still needs the small sheetlimits.hxx. This
removes document.hxx from the 15 translation units that reached it only
through tokenarray.hxx, about one second of compile time each.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie467d7297f7b02ed474114e7840e0ec52f1624aa
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12679
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 3c5d299ff6f767841bd8a781ca3ca200a8f12d2e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211315
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
document.hxx included drwlayer.hxx, and with it svx/fmmodel.hxx,
svx/svdmodel.hxx, svx/svdundo.hxx, svx/xtable.hxx and editeng/outliner.hxx,
in all 700 translation units that use ScDocument. The only place in the
header that needed the complete type was the inline destructor of
sc::DrawUndoGuard, which now lives in documen9.cxx next to
ScDocument::BeginDrawUndo. The ScObjectHandling enumeration, used as a
default argument of SetLayoutRTL, moves to types.hxx so that both headers
can see it.
The files that used the drawing layer or the svx model classes through this
include now include drwlayer.hxx themselves, and a few headers that relied
on the same chain for TranslateId, Idle or SvStream get the header or
forward declaration they need.
clang -ftime-trace suggests this is 6% of the sc build time.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Id723c46ef0c881428ab1d9a2e9a642713a92e79e
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12681
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 3e8fd8cd92ff57aaef5ba9d4b71933700ee3f83b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211316
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This fixes a particuarly annoying habit of a trailing superscript
ordinal suffix getting dragged into the next bullet and causing
the unwary user weird small fonts, and non-aligned bullets.
Nail only the most obvious case, leaving multi-line superscript
in-place, and ignoring other attributes.
Include unit test.
Change-Id: I9ba5009ed17377e5c2f24c9edb74c3a1c1393cd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199203
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 03ed94560aaa20070708b265d3a551c862718bc3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204606
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Fixup various pieces from 3431c1ee1be1bd33638ffe5ff2e340a692bed9dc
prematurely merged to master with fewer adaptations.
Change-Id: Ib4a430d6d7c32f662a4b3e4f056cea1b11b3ca74
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192012
Tested-by: Jenkins
We can start this when we need to in a thread-safe way,
cf. Timer::Start, Task::Start etc.
Saves CPU, and better - saves debug churn and SocketPoll
wakeups in quiescent COOL instances.
Change-Id: Ib0e668702bcdfa9ffb34daf8c2a220af55dcc9d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184415
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Profiles show lots of probe:do_wp_page events from things like
configmgr::Access::getUnmodifiedChild - as when we read we touch
lots of Node reference counts - un-necessarily.
So - reduce un-necessary reference counting thrash here in the
lok case through the environment variable. Quite possibly this
would also be safe and beneficial for the desktop app - needs
measurement.
measuring with coolmap and an empty hello-world.odt before & after:
before:
unshared 3634 (14536kB)
unshared 3631 (14524kB)
unshared 3605 (14420kB)
after:
unshared 3578 (14312kB)
unshared 3613 (14452kB)
unshared 3599 (14396kB)
Not hugely encouraging, perhaps there is another page touch
underneath we'll find when this is addressed.
Change-Id: I8ac74c5fcd17f8699139e914a7076a7848456e2a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175197
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182349
Tested-by: Jenkins
This may make short lived progress bars somewhat more 'blocky' and less
smooth - but inevitably make loading faster, particularly for loaded
machines with ultra-beautiful, slow to render themed progress-bars.
Change-Id: I5a7e43690f5e7eff35c980cae4991376204eb5fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171503
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Perhaps for desktop 40 updates per second can provide a nice smooth
status experience for a full screen-width progress bar in some cases;
but it seems likely that five per second over a remote protocol
might be better.
Change-Id: Ic77b3b76d680771cb766984bdbcd9c8af4af303d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171407
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
It seems this happens rather regularly with online; and yet we
are running the main-loop, seems this was introduced to allow
UNO usage without a main-loop, but this is not really our case.
cf. commit 168a67f4b3
Author: mm <mm@openoffice.org>
Date: Thu Feb 22 17:22:48 2001 +0000
VCL without main
Change-Id: Ibd10a4966157f30557eff88c124e63ffae2e1f61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169821
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
The WakeupThread is an attempt to avoid needing to call gettimeofday
and/or update a visual status bar very regularly, and to have a thread
marking the passing of time to emit progress updates infrequently.
Re-factor this to have a single time-keeping thread, so it will be
easier to shutdown and re-start for LOK; and also to simplify some
of the complexity lurking here.
Change-Id: Ia95890e5d6041a029484aa3f7df13b59a0397086
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167949
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
Otherwise we get huge dumps which can overwhelm our logging and hide
more useful information, and/or the journal can drop them on the ground.
Change-Id: Ie942c70a90a6df60ccd8986444362d622c213e15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167456
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This is vital for lok when used in a jail with no random device,
but with an inherited file-handle to /dev/urandom.
Use 'dup' to avoid changing code that wants to 'close' the handle
after use.
Change-Id: I15f40fb251f180a2394af030f56e47f2bf9651d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166113
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
We should sort out our extensions, if at all, at pre-init time.
This should save ~4% of CPU in a week-long profile of a COOL server.
From Desktop::Main's SynchronizeExtensionRepositories.
Change-Id: I2760de26635723492dfa5a52005ee90623337bee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165622
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Necessary to do this before forking on Unix systems; use a
dynamic_cast interface since this is all for internal use.
Change-Id: I8a911322acd4ec5654eb0d14804c09d513a0bd4b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163335
Tested-by: Jenkins
This occured on doc_setView and was unreasonably expensive - loading and
de-compressing new PNGs as multiple users typed, re-sizing and
re-rendering a toolbar that is not visible -> do nothing here.
cf. cool#6893.
Change-Id: I1980a3a4516fb2aa629da85de9d4628f29de5af7
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156270
We can easily accumulate a large number of in-memory graphic
objects, and swapping these as well as the un-compressed
images can become important.
For now we swap out the container when the image is swapped
out, however it seems unlikely it will ever need to be swapped
in again.
Despite the shared pImpl, we retained the reference counting
on the underling vector to keep this immutable while we hand
out a MemoryStream reference to it.
Change-Id: Ib7ca45afb8499460b1852461f7c11afca3f3cdfa
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151359
Tested-by: Jenkins
Hide the SvMemoryStream implementation detail better - this
could be served from a file in future. Also couple lifecycle
of the SvMemoryStream to the vector backing it.
Change-Id: Ia9b28b57b8df4ce57286effd4d1753bf345fc10e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149917
Tested-by: Jenkins
When layout changes, we don't want to immediately redraw lots of
windows; we should be able to wait for tiles to be rendered
instead. Certainly we don't want to allocate a giant virtual
device.
Unfortunately we also believe that full document invalidations
are cheap - so warn about that.
Change-Id: Ib56320d4860c4b6f4e100b30cc6d3e490a1c7a90
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149601
Tested-by: Jenkins
Best to avoid allocating and freeing 64Mb of RAM, and
burning lots of CPU doing CPU rendering on an invisible
for each document loaded through lok API.
Change-Id: I656b400159b9d6a7a9f2c79d188e3aec9b3dd0e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148258
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Apparently calling AnyInput on Mac and filtering for just input, gives
you window creation / re-sizing events which then trigger idle paint
events which then deadlock if called with the scheduler lock.
Try having a little more inefficiency and a different race for
this case to handle the Mac world.
Change-Id: I9985eaf18f8d0ba4d44e83c03746510a6ba6d664
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Working hypothesis is this happens after a failed spreadsheet
load, or from a race during load.
<crash>
ScModelObj::getPartInfo(int) sc/source/ui/unoobj/docuno.cxx:602
doc_getPartInfo desktop/source/lib/init.cxx:3531
...
KitSocketPoll::kitPoll(int) coolforkit
SvpSalInstance::DoYield(bool, bool) vcl/headless/svpinst.cxx:492
Change-Id: I06870336d4e64ebfc69bce64e280821c25e1b1e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144308
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@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>
this is/was mis-placed and tends to make a mess of large sheets'
tiles close to the bottom at ~2^20 rows.
Change-Id: Iac0977d58428707ff56c0ac30a7740c0ed0b27c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136866
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
More exotic locales like es-419 cannot be parsed by boost, so we
fall-back to the default encoding. This avoids an exception:
invalid_charset_error of the form:
"Invalid or unsupported charset:us-ascii or UTF-8"
for this case.
Change-Id: I6796dd893ec774b221956ea9febbcc19495d47b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130102
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
std::runtime_exception of:
"Invalid or unsupported charset:UTF-8 or UTF-8"
is less useful than it could be when spat out from the boost gettext
impl. Survive for the next (and probably more useful) exception.
Change-Id: Ibeb60b4a34f09f47051844c3e8048f38618d0e05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129566
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
it seems we can get windows disposed before we get to the emission.
<segv>
vcl::Window::IsTracking() const vcl/source/window/window2.cxx:341
(anonymous namespace)::LOKPostAsyncEvent(void*, void*) sfx2/source/view/lokhelper.cxx:725
LokChartHelper::postMouseEvent(int, int, int, int, int, int, double, double) include/rtl/ref.hxx:112
SwXTextDocument::postMouseEvent(int, int, int, int, int, int) sw/source/uibase/uno/unotxdoc.cxx:3561
Change-Id: I93aea931dad1e7f43d3d610568424c53d2b22fbc
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127907
The calc input uses an EditEngine - but it emits events as if it is
part of the document - as well as emitting events as if it is a dialog
window. This causes horrible jumping artifacts to the top of the
document with word auto-completion and typing in cells a few page down.
Also remove obsolete tweak to turn off autocorrect for LOK, since
it was contradicted by: 1f0943e5e9432f96daff9f3b006388d5bc7415b2
Change-Id: I7352cd3b5ca6d18645cfd9e18959b0e44ec969d7
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110422
Tested-by: Jenkins