Commit Graph

1052 Commits

Author SHA1 Message Date
78b4a1fb01 update vclwidget loplugin to find ref-dropping assigment
Look for places where we are accidentally assigning a returned-by-value
VclPtr<T> to a T*, which generally ends up in a use-after-free.

Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9
Reviewed-on: https://gerrit.libreoffice.org/30749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-11 06:55:41 +00:00
423936ffac loplugin:expandablemethodds in formula..framework
Change-Id: I6c8b1bb3b664faa92b2dc05955c30bfd35f6dfaa
Reviewed-on: https://gerrit.libreoffice.org/30015
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-19 07:57:11 +00:00
1b4165b0f3 Formatting: Make this readable without a 30" screen
Change-Id: I34ebbb009f682d55a5e1232b28eef56aa39a1b17
Reviewed-on: https://gerrit.libreoffice.org/29812
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2016-10-14 12:26:16 +00:00
dd5e0814cd tdf#88205 Adapt uses of css::uno::Sequence to use initialize_list ctor
Change-Id: Idb456f6cf0b4f3dda4b92d341ae6de59cb9879e2
Reviewed-on: https://gerrit.libreoffice.org/29797
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-14 06:31:00 +00:00
6d9f07d53e tdf#102288 TerminationVetoException should only prevent termination
When using a TerminationVetoException, all windows should be closed,
but the process should be kept running.

Change-Id: I71b0b57b6035a36f0325c8dea3cd38309408f176
Reviewed-on: https://gerrit.libreoffice.org/29031
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2016-10-10 10:36:02 +00:00
106ea87205 Remove _TYPED suffix from tools/link.hxx macros
...which was introduced with 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed "Gradually
typed Link" to distinguish the new, typed versions from the old, untyped ones,
but is no longer necessary since 382eb1a23c390154619c385414bdbe6f6e461173
"remove untyped Link<>" removed the old versions.

Change-Id: I494025df486a16a45861fcd8192dfe0275b1103c
2016-10-05 07:56:12 +02:00
c7114b66bd Fix typos
Change-Id: I7000efdb7276053c16de992fa8f9a4e614ecb3e2
Reviewed-on: https://gerrit.libreoffice.org/29434
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-03 08:59:34 +00:00
e44961c95d cleanup includes
related tdf#102630 Useless /org.openoffice.Office/Substitution feature

Change-Id: Ifa260c962efcaacd7477fb03a3d4d07e43743e6f
Reviewed-on: https://gerrit.libreoffice.org/29359
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2016-09-28 16:55:36 +00:00
47f7e30f35 tdf#102630: [API CHANGE] Remove SharePoints support from PathSubstitution
...apparently unused and broken (see issue)

Change-Id: Ic20d287b59d3317fecdba03a3edf8f51611c91ba
2016-09-27 18:12:11 +02:00
120d8fc75c Use FixedVariable::bAbsPath to check for special path vars
Change-Id: I526c45ecf3c7e21b87c16eef5047707f74da7668
2016-09-27 15:47:57 +02:00
02f114096d Remove redundant FixedVariable::nEnumValue
Change-Id: I39a2a65e06cdf421786fbbfedecad604fcb3abd2
2016-09-27 15:47:57 +02:00
02c079fc4f Remove unnecessary typedefs
Change-Id: I0c65720a3db88242bdf36338864f6961478f547f
2016-09-27 15:47:57 +02:00
da2e1ea7d4 Use range-based for
Change-Id: If112967db4828f8570692af5dbbbd9e3c2a837aa
2016-09-27 15:47:57 +02:00
2c5934b1a1 Reduce var scope
Change-Id: I5b5ea9968c7648e38a5cacda5e1f6ba8bea78749
2016-09-27 15:47:57 +02:00
bae1e2aa63 Add note
Change-Id: I68af0bcfd6700ee40f2d0879e57de9d66c62c983
2016-09-27 09:52:59 +02:00
653e0ccc4e tdf#101898: Only re-substitute whole segments with $(username)
...otherwise, if $(username) happens to be "user", it will endlessly re-
substitute inside a (already partly re-substituted) URL of the form

  $(user)/...

Regression introduced with 16fb0d3d0f68708c183c53bd18660a23970b77fe "tdf#98407
PathSubstitution: Add substitution for $(username)".

Change-Id: I1c8b64f383fdfd97fa5edc192e9ca4b46944d6f1
2016-09-27 09:18:11 +02:00
437377bbda tdf#101771 framework: avoid deadlock in AutoRecovery
AutoRecovery::implts_updateModifiedState() should call external
functions like isModified() before acquiring its own mutex.

(regression from 403eefe81b8a0afe888c60452c17d6b2c5d8343f)

Change-Id: Iae56eec2b6f392b7a7f65a5f54c73efa746263d0
2016-09-15 15:47:10 +02:00
91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
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
2016-09-13 13:19:22 +02:00
c158c00489 loplugin:constantparam in framework..vbahelper
Change-Id: I592f73012ae8a4df8488ef04dc0956d9400625bc
2016-09-07 10:04:44 +02:00
2b8b8740f2 default assignment operator is fine
Change-Id: I0b63abbfe7d29c35cf7c7dd047527b20ad46c538
2016-08-30 19:26:41 +01:00
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
52b91f3454 new loplugin fragiledestructor
fix up a small number of places that it finds

Change-Id: Iedc91e141edfb28f727454f698cd2155a7fd5bf4
Reviewed-on: https://gerrit.libreoffice.org/26566
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-12 08:45:14 +00:00
91c64aa718 loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I22e493f08f11b10d709dd8b4a223a75d52bb5899
2016-07-07 18:59:55 +02:00
f2f8835bfb loplugin:singlevalfields in framework
Change-Id: I5f5efe2180905343654bdbe4d765e7fd311a2d8a
Reviewed-on: https://gerrit.libreoffice.org/26636
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-24 12:18:42 +00:00
9e28b2f9ac tdf#96607 'Save as' doesn't update global auto-recovery state
The auto-recovery service maintains a list of structures (one for each open
document) containing information needed to carry out the auto-save
functionality. One such piece of information is the location of the backup
file, stored in a struct member named 'OldTempURL'.  At every auto-save
interval, this list is iterated through and a function (implts_saveOneDoc)
is called during each iteration to save the current state of the associated
document.

The algorithm works as follows:
 1. A new backup file URL is chosen so as not to conflict with any already
    existing backup files in the backup directory.  This URL is based on the
    file name and incorporates a number (starting at 0) that is incremented
    until a name is chosen that doesn't conflict.

 2. The document is saved to this new backup file URL

 3. The previous backup file (indicated by its structure's 'OldTempURL') is
    deleted

 4. The new backup file URL is stored (in its structure's 'OldTempURL') for the
    next time the file needs to be saved.

Assuming you start with a new Writer doc and then make some changes, when it is
time to auto-save, the backup file name 'untitled_0.odt' (excluding path) will
be selected, the latest state of the open file will be written to that backup
file, and the full URL for the backup file will be saved into the struct
'OldTempURL' member.

The next time changes are made and an auto-save occurs, this algorithm will
result in the name 'untitled_1.odt' being selected, the file contents saved
into this new file, 'untitled_0.odt' being deleted, and the full URL for the
new backup file being saved in 'OldTempURL'.

The third time through results in 'untitled_0.odt' being selected (since this
file doesn't exist on disk), and subsequent iterations of auto-saving cause
the backup file name to alternate between the two aforementioned.

The problem occurs during a 'Save as' operation. When this happens, the backup
file is deleted (which is fine - it was just saved, and the next auto-save will
back it up) but 'OldTempURL' is not properly reset (see below for more info.)
During the next auto-save, 'untitled_0.odt' will be selected for the new backup
file name (since no file exists by this name), and one of two things will
happen (based on how many auto-saves have occurred):

 1. 'OldTempURL' points to 'untitled_1.odt', and the algorithm above continues
    to work correctly (at least in that it continues to backup file contents.)

 2. 'OldTempURL' points to 'untitled_0.odt', the name chosen for the new backup
    file.  In this case, the document contents will be saved to this file
    (step 2) but then the file will be deleted (step 3).  'OldTempURL' will
    maintain this URL from then on out, causing this case to be hit for all
    future auto-save intervals.

So, 50% of the time (30 minutes out of every hour) auto-save will stop backing
up file contents on a 'Save as'.

The function that handles the 'Save as' case (implts_markDocumentAsSaved)
clears 'OldTempURL' and sets other relavent struct members for a local variable
copy of the global struct, but doesn't copy them back. :(  These changes are
effectively lost when the function returns.

There are several other cases where this appears to be happening as well, but
more work is needed to determine whether this is actually the case:
 - implts_prepareSessionShutdown
 - implts_saveDocs, handling the 'dangerousDocs' and in a few other places
 - implts_openDocs
 - implts_resetHandleStates

Also, there is some JUnitTest code for auto-save, but it is currently disabled
(and fails to run successfully.) It'd be great to get these working again, or
to just write python equivalents. Implementing this would like take me a while,
though, so for now I just tested manually to ensure that this fixes the issue.

When I have some more time I'd like to work more on this, but I wanted to send
this patch in for now to address bug #96607.

This may also address bug #99890, since some of the struct members that don't
make it into the global state relate to the file name.  I haven't explicitly
tested this case, though.

Change-Id: Ic702d6f78e60c7cf828a1564ccca118dd45d152b
Reviewed-on: https://gerrit.libreoffice.org/25948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-23 10:10:55 +00:00
68cf256f50 Resolves: tdf#88985 block app from exiting during macro execution
but stop basic execution on the exit attempt, and then resend exit at a safe
place when basic execution has stopped

Change-Id: I77c43acffa0b82e8125dcb3b10ad9bf0d6dd26c3
2016-06-22 11:33:58 +01:00
033517b4e6 Remove unused includes
Change-Id: I25bb67449c8c572075d354e62b1c731e95655b4f
2016-06-20 18:18:45 +02:00
6a5cb3dae1 tdf#99815 fixups after XNotifyingDispatch
- remove unused variable
- check of given parameter over constructor

Change-Id: If506ef9065c67da35f672466e1e49f82e2a5a678
Reviewed-on: https://gerrit.libreoffice.org/26093
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2016-06-09 13:28:42 +00:00
f9bb134195 tdf#99815 use XNotifyingDispatch in sfx2
- move DispatchHelper somewhere public
- use it from generic dispatcher call sites in sfx2
- return result of dispatcher calls (conveyed via
  XDispatchResultListener) to calling code, instead of faking it

Change-Id: Ie8041133e99dd99e45819f98798829b96532b9e6
Reviewed-on: https://gerrit.libreoffice.org/24953
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2016-06-08 02:16:54 +00:00
12aafb69fa Convert DialogCancelMode to scoped enum
Change-Id: I7aca03334c6609a8729bbc88ada6ecce4309c21d
Reviewed-on: https://gerrit.libreoffice.org/25607
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-30 06:40:58 +00:00
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
ed467869d8 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Idf27ee5370f1fa24adf22908d9e801c7d40db935
2016-04-20 17:25:42 +02:00
789055bc2a clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at
identifying leftover intermediate variables from previous
refactorings.

Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657
Reviewed-on: https://gerrit.libreoffice.org/24026
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:37:31 +00:00
5183dad60e Lock member access in Frame::disposing
What a mess.  Ideally, Frame would use its own rBHelper.rMutex, not SolarMutex.
But much of the framework code it calls into uses SolarMutex, too, making it
difficult to change that without running into the risk of deadlock.  And then,
some member variables are cleared early in Frame::disposing, while others are
only cleared en bloc at the end.  Be conservative and keep it that way (as other
Frame functions recursively called from within Frame::disposing could observe
the difference and rely on the current behavior), even if that means creating
lots of small, independent locked regions within Frame::disposing (which can be
detrimental to both performance and correctness).

Change-Id: I28f9a379ce03ed661e96c7deb8eb73cb58fb2cf7
2016-04-11 16:58:48 +02:00
cd43b8cf32 Turn disableLayoutManager into a member function
Change-Id: I489859a53f98a1e70f8a79c3a974dd0d8954ccd1
2016-04-11 16:58:47 +02:00
819175e1f0 Remove leftover comments
Change-Id: Iabecc0d240c499ef81d8b85c8d0b37383813b06a
2016-04-11 16:58:47 +02:00
14b26b7347 Combine successive private blocks
Change-Id: Id0da294261d9f42e4ba31864827e38e29bf44ea0
2016-04-11 16:58:46 +02:00
9258fc222d protected -> private
Change-Id: Ic021240bbc2069d6d47b51c0b8e0d81739a72151
2016-04-11 16:58:45 +02:00
eda008c4fa Fold impl_initializePropInfo into initListeners
Change-Id: I14d6461d442a8e0ff1efd719e7e2233ffbc523a5
2016-04-11 16:58:44 +02:00
69741ccf3d No need to lock SolarMutex here
Change-Id: Id626dc7c5c75b885b3665e06596b7a58d225cd4c
2016-04-11 16:58:43 +02:00
b9d091e7d4 No need to clear component context during dispose
...which simplifies access to m_xContext member.

Change-Id: Ia028b5ae26d94527b6668365ab1197103afb8c22
2016-04-11 11:31:59 +02:00
d84ef731d8 tdf#94306 replace boost::noncopyable ...
... in modules editeng to oox.
Replace with C++11 delete copy-constructur and
copy-assignment.
Remove boost/noncopyable.hpp includes and
one unused boost/checked_delete.hpp include in linguistic.

Change-Id: I5a38d8e5ac1b4286bdeb3858d56490a53d13fe80
Reviewed-on: https://gerrit.libreoffice.org/23928
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-11 07:22:50 +00:00
fbb96dcf54 Base Frame on WeakComponentImplHelper instead of TransactionManager
...to get the deadlock under control the fix for which had to be reverted with
22fbbfe984f5da2592674f9260f5e4988b1341fe "Revert 'Avoid deadlock when two
threads call into Frame::close'".

Generally, replaced instances of TransactionGuard(E_HARDEXCEPTIONS) with
checkDisposed() and instances of TransactionGuard(E_SOFTEXCEPTIONS) with
nothing.  A TransactionGuard would not establish a locked section per se (only
would it engage in locking when TransactionManager::setWorkingMode is called,
see the deadlock mentioned above), so the potential for introducing new races
should be manageable.

While at it, get rid of those implcp_* "debug methods" used to SAL_WARN about
bad arguments to some UNO interface method implementations.

Change-Id: I5ea9c1c8b20fd38457c558dbcb3a853a51a09b6e
2016-04-08 14:03:53 +02:00
4be81de0d6 Resolve OUStringList typedef
Change-Id: Ifb5dc5128b5619abb83eea427c7fb1115fd825f3
2016-04-07 21:44:02 +02:00
f57c9921de Get rid of BaseHash wrapper (to unbreak Windows build)
Change-Id: Ieae7d6af7a4753958ebf2aeae9d2ae6fafe5efe9
2016-04-07 18:14:53 +02:00
e2ef269916 Fold PropertySetHelper into its only use, Frame
Change-Id: I148e15c2c91a985cd110f5589adbf26c102b1cfb
2016-04-07 17:33:26 +02:00
d6d86237b1 [API CHANGE] Remove undocumented TabContainerWindow service
It originally got introduced with b1da5a57d93e8e9b43b9bba9fabc3b7e61289edc
"CWS-TOOLING: integrate CWS alf01" but appears to have never been used.

Curiously, there were two commits to its code
(f565a4b3d9b47ca3336df4f8d8d56d4e2dcceec5 "#i107087# TabWindowService must set
member pointer to zero on VCLEVENT_OBJECT_DYING. The window life time is
controlled by the docking window! Adding missing RemoveEventListener call" and
84c0ebe7d3e7dbc3796967d52f9535fecc9e6947 "#i107087# Remove event listener from
tab window on TabWindowService dtor") that mention
<https://bz.apache.org/ooo/show_bug.cgi?id=107087> "button merged in standard
toolbar + own UI caused office crash", but the description of which ("when i
merge a toolbar button in a standard toolbar and provide own UI (via the
toolkit) the office crashed sometimes") doesn't give a hint how this service
would have been used.  (Maybe it was intended to be used by extensions, but
never got documented neither in offapi's UNOIDL nor in
<https://wiki.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide>.)

Change-Id: I86746f73ee99ebe7f5afbc902204a9353e5ccb7b
2016-04-07 15:22:42 +02:00
062d0b1e36 m_dbg_bMakeItFaster is always false
Change-Id: I7ee117fcc5538ab9bc92cd30fd0f61e52a5a93bd
2016-04-05 16:49:11 +02:00
c20cc7e79b tdf#97499 Fixed containers parameters clearing #4
Change-Id: I7c96181399f4d7e62d4aceca404b22d68f903513
Reviewed-on: https://gerrit.libreoffice.org/23754
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-04 05:49:06 +00:00
3f7f497192 sequence->vector in framework
Change-Id: I457c3da4f4a31f58d688dcd96a2ccfc36518490d
Reviewed-on: https://gerrit.libreoffice.org/23692
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-01 07:33:45 +00:00