Commit Graph

1032 Commits

Author SHA1 Message Date
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
1271eadfac tdf#97966 Drop 'static' keywords
Including no keywords from extern "C" blocks

Change-Id: Id9dd5a53d6ea5134ebb473bd0463f8f42965a211
Reviewed-on: https://gerrit.libreoffice.org/23674
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-01 06:45:46 +00:00
dde79dd504 Rename OfficeIPCThread to RequestHandler
Change-Id: I2076d903e83a0b8eb3aa0ce2413630e2c5415b15
2016-03-29 14:54:20 +02:00
017a864caf handle failure to expand ~ in path elements.
This can occur in some online corner-cases.

Change-Id: Id8b419179d775a21110d682ba76d8a02f45eb828
Reviewed-on: https://gerrit.libreoffice.org/23577
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-03-29 10:04:52 +00:00
2f804099b7 loplugin:constantparam in framework
Change-Id: I7b7914365ef5d5c6f120f34c93f359c156aa6a02
2016-03-23 10:19:43 +02:00
a0d5f0896e loplugin:salbool
Change-Id: I4d76392263cce45eb34cbc2f35afff0416b08c4a
2016-03-15 08:51:55 +02:00
afbdde44b8 tdf#91794 remove OSL_DEBUG_LEVLEL > 1 conditionals
I replaced OSL_DEBUG_LEVEL > 1 with OSL_DEBUG_LEVEL > 0 and made sure
that the build doesn't break.

Change-Id: I9a07da5b0f19d695339705e00112956a56589327
Reviewed-on: https://gerrit.libreoffice.org/23230
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2016-03-15 00:14:07 +00:00
21b92f386c MenuDispatcher::m_pMenuManager is always nullptr
... as shown by 7da15debe39b50255cc08b3fef7ae38185a9174f.
Which means that MenuManager is unused, and MenuDispatcher
does nothing useful.

Change-Id: Ic85619531054a573d971d38b52609e1cbcaf780c
Reviewed-on: https://gerrit.libreoffice.org/23117
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-03-10 15:23:31 +00:00
3915ffc46f loplugin:constantparam in tools
Change-Id: Ibd093ba4e8140ed3fda87ef340280433302f82a5
2016-03-10 10:09:59 +02:00
16fb0d3d0f tdf#98407 PathSubstitution: Add substitution for $(username)
This allows to use the username as a placeholder in the config paths (Autotext, Gallery, etc)

Change-Id: I76434e980cd8ec8785a5587d0bc5fdd67dc42de2
Reviewed-on: https://gerrit.libreoffice.org/22901
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-08 15:35:54 +00:00
0839f90394 convert EConfigurationModes to scoped enum
Change-Id: I1e81c8d637e738f536f7efad8b67d0c9183e6483
2016-02-24 11:48:38 +02:00
db8067145f loplugin:write only fields
Change-Id: I44f249a17d0a510ec63a488b656d57a1a392f821
2016-02-22 14:34:21 +02:00
534b2a4b58 Fix typos
Change-Id: Ice72f8d9971e15dd6ef365e64cd567b8581a92d3
Reviewed-on: https://gerrit.libreoffice.org/21797
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-05 06:48:38 +00:00
36c3229a2e tdf#88205 Delete 'css::uno::Sequence' in framework
Change-Id: I66857f640e2e4c397b4f9baf7903356a0510c0b7
Reviewed-on: https://gerrit.libreoffice.org/22035
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-03 08:26:13 +00:00
752cd07d08 InterfaceContainer2 with vector instead of Sequence
create an InterfaceContainer2 class to replace InterfaceContainer.
It uses a std::vector instead of a Sequence for the mutable listener
list, which provides far better performance.

Switch all our internal use-sites to the new class.

Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
2016-01-25 08:52:03 +02:00
facfb35417 -Werror=attributes (GCC 6)
Change-Id: I4450caf9411fcfbe979a41a67a38e7238ece0be6
2016-01-13 17:24:26 +01:00
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
bea8a7ad63 cppcheck: noExplicitConstructor
Change-Id: Ib43e53d5b6c9c130adb765ac9b769f58060ac640
2015-12-29 19:46:23 +00:00
278f58c68b loplugin:unusedfields in framework
Change-Id: Ic6cfbe9f0c7589804b7ffddac0350c188d974c3d
2015-12-23 08:13:53 +02:00
df997d92e0 Simplify Desktop::getInfoHelper
Change-Id: I13058816e8b2b1c821f0123f110671706bf90449
2015-12-16 14:21:27 +01:00
4ac13fb72a No need for TransactionGuard::stop
Change-Id: If1c0b7285817bb10338077460b77de4a27d35753
2015-12-16 14:21:26 +01:00