1643 Commits

Author SHA1 Message Date
Michael Stahl
a2095b1514 comphelper,vcl: let DeInitVCL() join some AsyncEventNotifier threads
comphelper::AsyncEventNotifier is an amazing class that dispatches
events in separate threads, no doubt implemented during times of
exuberant optimism about the tractability of shared-state
multi-threading.

Unfortunately the authors forgot to think about how all those awesome
threads will be joined, so if they are somehow blocked, then it may well
happen that the events are dispatched when the main thread is already in
DeInitVCL, and the objects required for the dispatching already smell
somewhat funny.

This happens quite reproducibly when changing dbaccess' ModelMethodGuard
to lock the SolarMutex too, then CppunitTest_dbaccess_RowSetClones
crashes in DeInitVCL() because one AsyncEventNotifier thread was blocked
until then by SolarMutexGuard, and this test never Yields once its
document is loaded.

Try to fix this by joining the "DocumentEventNotifier" threads from
DeInitVCL() itself.

Since there's no rtl::WeakReference to go with rtl::Reference, refactor
the AsyncEventNotifier and create a new AsyncEventNotifierAutoJoin
that has to be used with std::shared_ptr and std::weak_ptr.

Change-Id: I50a0749795acb04b0776e543f7125767b697ea35
Reviewed-on: https://gerrit.libreoffice.org/27581
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-07-29 10:05:47 +00:00
Caolán McNamara
5733910b2b change from a 2 min dbgutil failure to a 3 min
to try and align with the crashtesting timeout

Change-Id: Ife3a4a3d63bbb9d9d5b612675e3728900262bf6c
2016-07-27 11:02:28 +01:00
Noel Grandin
508c95f1b6 improve passstuffbyref return analysis
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c
Reviewed-on: https://gerrit.libreoffice.org/27317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-27 06:48:25 +00:00
Caolán McNamara
54d8d7718b fix build
Change-Id: I90d6826e4544fd39120982f80d41e237a5edbab6
2016-07-18 09:01:39 +01:00
Noel Grandin
147d18ad4a -Werror=enum-compare
Change-Id: I6bb2c9bcefd9dbb0efd262b1462625a157d11e6f
2016-07-18 09:53:44 +02:00
Noel Grandin
09b0ade4f8 remove some now unnecessary debug trace
Change-Id: I15fef941c5a9c9d7627ca22029a95c8e6928ee20
2016-07-18 09:21:30 +02:00
Noel Grandin
76ad32bec8 add tagging to ThreadTasks so we don't need more one pool
If more than one place in the code submits tasks to the shared
pool, then waitTillDone() becomes unreliable.
Add a tagging mechanism, so different callsites can wait
on different sets of tasks.

Also try to protect our worker threads against exceptions from
the thread tasks code.

Change-Id: Idde664ab50008d31a2dd73910bb22f50e62ae22f
Reviewed-on: https://gerrit.libreoffice.org/27042
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-18 06:49:09 +00:00
Matúš Kukan
e0192c0908 Implement XServiceInfo for com.sun.star.comp.MemoryStream
Change-Id: Ie5499d2ac4aac67dc73fdc58958443b8060c4139
2016-07-09 12:15:51 +02:00
Yeliz Taneroğlu
5f37f56088 tdf#74608 Constructor function for MemoryStream
Change-Id: I5b0667c4c2808913cde686afa7315ef2319b4d49
2016-07-09 12:15:50 +02:00
Stephan Bergmann
4aa7d9e63a loplugin:redundantcast: redundant static_casts in comphelper
Change-Id: I6112c3cc40383d00ea134bdc650e457f942e0dcf
2016-07-08 16:47:31 +02:00
Stephan Bergmann
a291c8fbaa loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I11d6467a35fb9e32cc0608549bd323b1f6683b9f
2016-07-07 18:59:55 +02:00
Muhammet Kara
41bc79521e Improve readability of OUString concatanation in OStorageHelper
It is more readable and more efficient as a bonus.
See: https://goo.gl/jsVAwy:

Change-Id: I5cc22276fc385a381d64e00f20d6d2b302ea587f
Reviewed-on: https://gerrit.libreoffice.org/26720
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-28 06:29:07 +00:00
Noel Grandin
c144288abe loplugin:singlevalfields in comphelper
Change-Id: I22711d226a266dc00c32beff54398a55c4c9691a
Reviewed-on: https://gerrit.libreoffice.org/26599
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-06-24 08:41:01 +00:00
Noel Grandin
29bea29ec1 loplugin:singlevalfields in ucbhelper
Change-Id: I738bda6e6e161fb5ea96bd496a21ccf72680cd7f
Reviewed-on: https://gerrit.libreoffice.org/26604
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-24 08:12:53 +00:00
Stephan Bergmann
50a0473e82 Clean up uses of Any::getValue() in comphelper
Change-Id: I433cca20fb29c6b6ede934edcb2e200f15b060f2
2016-06-20 11:43:37 +02:00
Stephan Bergmann
82da3d95c1 loplugin:salbool: Implicit conversions from non-Boolean fundamental types
Change-Id: I67eac95686678e6f5a2d60798535b2c65a9ba5d7
2016-06-19 21:29:43 +02:00
Ashod Nakashian
c337011d20 LOK: tile rendering regression fix
Calc fast rendering requires us to offset
the are being rendered and shift all
bitmaps accordingly. This however is
breaking Impress rendering since the
offseting logic is common (in svx and vcl).

This adds new API to enable or disable
this local rendering (as opposed to
rendering a full document as was previously
done.

The new flag is then set by Calc to
enable the offseting logic in isolation
without affecting other applications.

In one case isolation was achieved by
checking the MapModeUnit.

Change-Id: Ia0aadfc3f6df7c1a891b97dc731f5897414c9420
Reviewed-on: https://gerrit.libreoffice.org/26367
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 60fdcda65bad242f99895cb453182578250fbdea)
Reviewed-on: https://gerrit.libreoffice.org/26378
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-19 16:30:59 +00:00
Markus Mohrhard
0d4dcf3800 add comphelper::string::split
Change-Id: Iccc989a786e8e7b8dca1996b635248d7bf7fc5d8
2016-06-18 17:02:08 +02:00
Markus Mohrhard
b6d51e4f0a uitest: this is obviously wrong
Change-Id: I48be9d1daeff83913909f57bf972ca171367a2b0
2016-06-18 17:01:30 +02:00
Stephan Bergmann
bb1e59d596 Simplify OPropertyContainerHelper::registerPropertyNoMember's _pInitialValue
Change-Id: Ibfb27b3eded45e2646dada37ce3663f427985ae9
2016-06-17 19:40:58 +02:00
Miklos Vajna
5b5706f41f comphelper lok: remove the g_bViewCallback global
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-17 12:47:46 +00:00
Miklos Vajna
5bf3ae663a comphelper: enable LibreOfficeKit::isViewCallback() by default
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-16 16:19:10 +00:00
Ashod Nakashian
60e75fb276 tdf#98955 hardware_concurrency not ideal for thread pools
A new static member getPreferredConcurrency added to
comphelper::ThreadPool to return a configurable max
number of threads.

By default the new function returns the hardware_concurrency
value provided by std::thread. When MAX_CONCURRENCY envar is
defined, the return value is limited to whatever is set there.

Three call-sites that used std:🧵:hardware_concurrency
have been replaced with getPreferredConcurrency.

Unittests added to cover the functionality of the new member.

Unittests are capped to 4 threads.

Change-Id: I3332e393a88a5ed436316fa712ed920a4b37f4af
Reviewed-on: https://gerrit.libreoffice.org/26254
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-06-15 21:28:47 +00:00
Noel Grandin
0323253a7c remove some manual ref-counting
triggered when I noticed a class doing acquire() in the
constructor and then release() in the destructor.

found mostly by
    git grep -n -B5 -e '->release()'

Change-Id: I96e43a3d30ffd9ae9a34275f24cd914d8f7b026f
Reviewed-on: https://gerrit.libreoffice.org/25806
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-06 07:01:34 +00:00
Xisco Fauli
2d2971090b tdf#89329: use unique_ptr for pImpl in accimplaccess
Change-Id: Ib10088b5669695dd5e288fe043ad72056a34b1e4
Reviewed-on: https://gerrit.libreoffice.org/25745
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 06:49:46 +00:00
Xisco Fauli
e88107c055 tdf#89329: use unique_ptr for pImpl in embeddedobjectcontainer
Change-Id: I679555e2eb51e2b9660bb035a08d8da8b1687cab
Reviewed-on: https://gerrit.libreoffice.org/25747
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 06:16:52 +00:00
Xisco Fauli
7693c22829 tdf#89329: use unique_ptr for pImpl in propertysetinfo
Change-Id: I8df0ed4d7c7df27f570ad09936f17941c30aae91
Reviewed-on: https://gerrit.libreoffice.org/25749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-02 06:40:34 +00:00
Xisco Fauli
c37ce6c3c5 tdf#89329: use unique_ptr for pImpl in propertysethelper
Change-Id: I5891fe7c298b4b3409ac6579ed167a4e0183c89a
Reviewed-on: https://gerrit.libreoffice.org/25748
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-02 06:36:30 +00:00
Xisco Fauli
e0f60043cc tdf#89329: use unique_ptr for pImpl in componentmodule
Change-Id: Ida8e271b1dd755289371e457a7c83657b8a84f99
Reviewed-on: https://gerrit.libreoffice.org/25746
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-02 06:33:14 +00:00
Xisco Fauli
619a41940f tdf#89329: use unique_ptr for pImpl in accessiblecontexthelper
Change-Id: Ib78ee2f1faa4f9430e08bfbd0cfb0863da7d6dcb
Reviewed-on: https://gerrit.libreoffice.org/25744
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-01 09:58:17 +00:00
Noel Grandin
0b23eec200 teach refcounting clang plugin about uno::Reference
uno::Reference is only allowed to used with classes that have a
::static_type member.
So convert all those places to rtl::Reference.

Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and
uno::Reference to make this a little smoother?

Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3
Reviewed-on: https://gerrit.libreoffice.org/25516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-31 06:25:45 +00:00
Steven Guo
85f404151e tdf#74608 Constructor functions for OPropertyBag
Added constructor function for OPropertyBag in /comphelper/source/property/.

Change-Id: I28d6aa5c6fa2aa4324cf4ac61c5f2e3ab0a5e14a
Reviewed-on: https://gerrit.libreoffice.org/23541
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-26 20:52:43 +00:00
Noel Grandin
74713b34a3 loplugin:unusedmethods
Change-Id: Ib36bc0e87d00abb638cbfec511cd13b6179eabda
Reviewed-on: https://gerrit.libreoffice.org/25431
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-26 07:50:33 +00:00
Noel Grandin
95d20a3799 Revert "remove some manual ref-counting"
until I have a better understanding of the UNO reference
counting.

This reverts commit 111de438ea3e512a541281dc0716cc728ea8d152.
2016-05-24 11:02:42 +02:00
Noel Grandin
111de438ea remove some manual ref-counting
triggered when I noticed a class doing acquire() in the constructor and
then release() in the destructor.

found mostly by
   git grep -n -B5 -e '->release()'

Change-Id: Ie1abeaed75c1f861df185e3bde680272dbadc97f
Reviewed-on: https://gerrit.libreoffice.org/25363
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-24 06:54:06 +00:00
Noel Grandin
2383d557e5 clang-tidy misc-unused-alias-decls
Change-Id: Iabde7a84b9c2758e0d2b2ffe0fb99fcfa51ff124
Reviewed-on: https://gerrit.libreoffice.org/25075
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-19 13:07:28 +00:00
Noel Grandin
2c8fe2e737 update unusedmethods plugin to deal with constructors
and fix the operator< implementations in some of the other
plugins too.

Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035
Reviewed-on: https://gerrit.libreoffice.org/25057
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 10:03:44 +00:00
Noel Grandin
d96c114171 clang-tidy modernize-make-shared
Change-Id: I3fa866bfb3093fc876474a9d9db29fe05dc2af3a
Reviewed-on: https://gerrit.libreoffice.org/25056
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 06:58:44 +00:00
Noel Grandin
1b6ad8e649 conver CHAR to scoped enum
Change-Id: Ie7f22c6986a0973e6d50bbd1fe9c10f6b478a2db
Reviewed-on: https://gerrit.libreoffice.org/24984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-16 06:42:17 +00:00
Noel Grandin
58a32075ca use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
2016-05-04 12:39:40 +02:00
Seraphime Kirkovski
7739bd5f54 Iteration must not start at the end
Change-Id: I2aebcc909aa9222fc1881e57bbc844025a154e84
Reviewed-on: https://gerrit.libreoffice.org/24497
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-04-29 18:42:16 +00:00
Stephan Bergmann
d3f80583ee -Werror,-Wvarargs
"passing an object that undergoes default argument promotion to 'va_start' has
undefined behavior [-Werror,-Wvarargs]"

just replace the variadic function with one taking an initializer list

Change-Id: Ied3dfe835dcebef48cf35374ec4d8835f98e6779
2016-04-27 13:47:30 +02:00
Stephan Bergmann
f3c120ec22 loplugin:simplifybool
Change-Id: Ie3662271f57df724329cb5fa52881479890277f9
2016-04-26 15:36:38 +02:00
Noel Grandin
e8fd5a07ec update loplugin stylepolice to check local pointers vars
are actually pointer vars.

Also convert from regex to normal code, so we can enable this
plugin all the time.

Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1
Reviewed-on: https://gerrit.libreoffice.org/24391
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-26 10:55:58 +00:00
Aron Budea
f91674bd4b tdf#60418: improve perf of opening/closing odts with form tags
Opening/closing times using "Without Frame tags" attached file from
bug report changed as follows on my system (debug build):

open: 2:06 -> 1:32
close (doc unchanged): 1:52 -> 0:18

The performance fixes in the different CXX files are independent,
eventattachermgr.cxx is related to doc close, the others to doc open.

Change-Id: I24fc4558f79b9123494a3939c0a313fcd47a067f
Reviewed-on: https://gerrit.libreoffice.org/24359
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-26 09:40:56 +00:00
Stephan Bergmann
4b9faadd86 Some more sal_Bool -> bool
Change-Id: Ie29e3610ae7fc7a489b367fd6797db7547d47c49
2016-04-25 16:40:18 +02:00
Giuseppe Castagno
bbe51f039d Add an interaction handler wrapper for simple file access.
This wrapper is to be used when you want to avoid the error
messages displayed when accessing a file (the messages activated
by ucphelper::cancelCommandExecution), especially when accessing a
Web/DAV connection to enable https certificate validation and
optionally enabling the authentication dialog that may be needed
in these operations.

Change-Id: I19f3072b91b6c4f453a54b56a3d9883b3383dfa5
Reviewed-on: https://gerrit.libreoffice.org/24274
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-22 07:11:31 +00:00
Noel Grandin
e1af7f0c43 clang-tidy modernize-loop-convert in c*
Change-Id: I77d2548f8be97792660761e6156cd24734a95aaf
2016-04-21 11:03:55 +02:00
Stephan Bergmann
f555ab4e96 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Idb7e5ff0c73bbc2c462b92cd96444eb5d2d4194b
2016-04-20 17:25:37 +02:00
Jochen Nitschke
150ac9cf05 clean-up: unused using declarations and includes
Searched source for using declarations.
Checked if those symbols reappear in the source file,
even in comments or dead code but not in #include statements.
If they don't reappear, remove the declaration.
Remove includes whose symbol got removed.

Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0
Reviewed-on: https://gerrit.libreoffice.org/24148
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:25:24 +00:00