Commit Graph

6510 Commits

Author SHA1 Message Date
4cbaa49c0e svl: implement SfxUndoAction::GetViewShellId() interface in SfxListUndoAction
Client code in sw, sd, sc and svx is adapted, the rest is just a
placeholder for now.

With this, e.g. the undo item for Writer's insert comment properly
tracks which window was used for the insertion.

Change-Id: Idad587e6ca07ba69bf59aa7013b251af8bf95bab
Reviewed-on: https://gerrit.libreoffice.org/27781
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-08-01 17:04:45 +00:00
6850f4e845 svl: avoid defaulted parameter in SfxUndoManager::EnterListAction()
It's a virtual function, and defaulted parameters there are problematic.

Change-Id: I3f110c7ac36dfda90811b033620286ad9fce1af1
Reviewed-on: https://gerrit.libreoffice.org/27772
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-08-01 10:32:27 +00:00
d76e3abe13 framework: stop adding silly empty accelerator/current.xml files
... to ODF packages.  Somehow this is even skipped sometimes, but it's
much easier to just turn off the silliness than find out why.

Change-Id: Iff509dfd8325fd517e6434bcb56edbd06a3c27f1
2016-08-01 11:13:34 +02:00
fe46041a6b do not force the Paste command to enabled for Calc, tdf#60021 related
... so it actually gets disabled in menu or removed from context menu if we say
so. Used with disallowing Paste for Ctrl+A selection or protected cells.

Change-Id: I7d5f8bdc7b7adee65d08b93ddee015aef953d95d
2016-07-28 19:04:08 +02: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
8278be9860 Fix typos
Thanks to Carlo Bertoldi for the german translation.

Change-Id: I76f554e757318aed4e28b5a05fae0ba15bd46afb
Reviewed-on: https://gerrit.libreoffice.org/27355
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2016-07-22 21:45:22 +00:00
36313d93ac improve unnecessaryoverride plugin
to ignore ImplicitCastExpr when calling superclass method

Change-Id: I76a3068446acfee85aa1baeb216e57f63c7099c1
Reviewed-on: https://gerrit.libreoffice.org/27279
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-19 05:39:46 +00:00
6e72f0251b new loplugin unnecessary override
Change-Id: I88d3e33823d68745b98625050a8a274f9ef04bcb
Reviewed-on: https://gerrit.libreoffice.org/27135
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-15 14:05:41 +00:00
cba5a9223a no need to create temporary OUString for comparison
Change-Id: I0a321e8ffbe379588a288084ec2e74e1a8c296b2
Reviewed-on: https://gerrit.libreoffice.org/27171
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-13 08:20:40 +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
6f8d047519 loplugin:salbool: Better heuristic to determine code shared between C and C++
Change-Id: I09c9c57d5adeb665cc2508fad9727085a3289bfb
2016-07-11 16:32:28 +02:00
903e60753f Resolves: tdf#100732 hang closing Print Preview with X-icon on menubar
triggered by change...

commit f9bb13419549d621ffd55d9d81e0732a89560e2e
Author: Juergen Funk <juergen.funk_ml@cib.de>
Date:   Fri May 13 10:42:17 2016 +0200

    tdf#99815 use XNotifyingDispatch in sfx2

which allowed the problem introduced by...

commit d0c3c24da2506bff1719a276f2eff34589fa7663
Author: Kohei Yoshida <kohei.yoshida@gmail.com>
Date:   Wed Jun 6 01:28:55 2012 -0400

    Check if the system window has a close handler, and if yes, call it.

    This allows the close event in the preview window to be handled in a
    custom fashion, instead of having it call the normal "close window"
    command.

to show up

Change-Id: I5c46fb7a49ae44fd748b5b7192aeb951c7d65191
2016-07-09 21:29:53 +01:00
9779398983 loplugin:redundantcast: redundant static_casts in framework
Change-Id: I3556fac0bd5100db44f389aeb9f64b635f3e0569
2016-07-08 16:47:31 +02:00
467887d3c9 Related: tdf#100713 fix more recent bug to try and see older bug...
at the moment AddonsOptions::Notify is called with a null this
which crashes during adding an extension

regression from...

commit 3bdc5063f942b9ea3b6e39e707926fbc516c19f9
Date:   Wed Jun 22 02:30:43 2016 +0200

    tdf#89329: use shared_ptr for pImpl in addonsoptions

Change-Id: Ic28951e56bb8beca2a01ef2a1864eadcf3864e5b
2016-07-08 09:22:46 +01:00
91c64aa718 loplugin:passstuffbyref also for {css::uno,rtl}::Reference
Change-Id: I22e493f08f11b10d709dd8b4a223a75d52bb5899
2016-07-07 18:59:55 +02:00
8d2f282abe typo: emtpy → empty
Change-Id: I60cdcdc7fc38c175243c071f34295efa8739b717
2016-07-04 12:20:48 +02:00
cd71034b26 comphelper::OBaseMutex -> cppu::BaseMutex
convert usage of deprecated class, and remove the old class

Change-Id: I19fb9271090d19e5531622b58492e1a848d306e2
Reviewed-on: https://gerrit.libreoffice.org/26843
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-04 06:49:07 +00:00
f4f580f4a4 framework: fix typo in dispatchdisabler
maDisabledURLs is a set, aDisabledURLs is a sequence, the intention is
to copy the set into the sequence, not to copy the (empty) set into
itself.

Change-Id: Ib262e863b1f1aa4c455bd7552df3dc2c3f73a400
Reviewed-on: https://gerrit.libreoffice.org/26765
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-29 15:24:54 +00:00
3bdc5063f9 tdf#89329: use shared_ptr for pImpl in addonsoptions
Change-Id: I159ba04fa70f324d2a7f5b3c592337b92c7f097d
Reviewed-on: https://gerrit.libreoffice.org/26560
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-28 06:28:19 +00: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
aa0d0536a4 tdf#97527 - vcl: reference-count Menu
some places are marked with "dodgy"- need to check those to see
what is going on, because they are leaving dangling pointers behind
in the Menu class

Change-Id: I41d5c7c0fec2f70ce9e3ffdc48cd03d26c0a869b
Reviewed-on: https://gerrit.libreoffice.org/26516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-23 06:28:00 +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
1771e2b275 Try to fix the crashreport with SaveToolbarController::modified
No idea how one managed to trigger this. The only way I see is
to add the save button to one of the custom shapes dropdowns.
The ToolBox there has mpData->mbWillUsePopupMode set to true,
which causes ToolBarManager to call the update method of the
controller twice. update registers additional modify listener
each time, but there is only one "remove listener" call in
dispose.

Change-Id: I2a1d6e02f6d8b6bc847fb7694fffa6e85b1f5604
2016-06-20 00:02:57 +03:00
bb1e59d596 Simplify OPropertyContainerHelper::registerPropertyNoMember's _pInitialValue
Change-Id: Ibfb27b3eded45e2646dada37ce3663f427985ae9
2016-06-17 19:40:58 +02:00
011128aa94 SaveToolbarController: back to using XStorable
See 747a0fdda2a7723c2f8a8a022b468bcf29c700e3
("SaveToolbarController: Better support of readonly docs")
for the background. However this doesn't work, because
the save slot is disabled in other cases too, not just for
r/o docs (e.g. locked UI during file save, or when cond.
formatting window open in Calc).

Until a better solution is found, at least make sure that
the button is disabled, instead of going into the normal
save mode, which doesn't work.

Change-Id: If6e1b91b7c780fffac22cdb25c82bbd0a8520dc4
2016-06-17 14:31:46 +03:00
c44d5589df the __RSC hack is only needed in src files and things included from src files
Change-Id: I50c122426030ba5b508dcd6ac33464ecab154981
2016-06-14 12:26:08 +01:00
d3c96c9f82 Fix typos
Change-Id: Ic3efae53430fbb2c1eb7962c3cf69bf99315e55b
Reviewed-on: https://gerrit.libreoffice.org/26202
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-13 06:04:07 +00:00
7bf2f61ac7 Clean up uses of Any::getValue() in framework
Change-Id: I55982944bf2ee3d9aa6899bcc59e94f9342b4036
2016-06-10 18:55:07 +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
bdd67652b6 Try to get rid of svt::ContextMenuHelper
Change-Id: I7b43e417607b20c300e3c18e7da76a6173a18b7d
Reviewed-on: https://gerrit.libreoffice.org/26098
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-09 12:53:43 +00:00
aed4c42491 remove some manual ref-counting in framework
Change-Id: I469439abfa4e9dcd29f2d1693b03d37b3d61c81e
Reviewed-on: https://gerrit.libreoffice.org/26047
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-08 10:56:27 +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
15436c009e gtk3: move the updating of native menu to right after its activated
try fix that view->toolbars isn't in sync

Change-Id: I095be3003f076193878f2c3ce2a2be5acbe0e33f
2016-06-07 13:31:16 +01:00
f4608bde58 remove unused field
Change-Id: Ic8c9b50f496ee97da3f03af966005f28c37ff7e9
2016-06-06 14:28:42 +02:00
5f42a268c3 remove unused imports in java code
Change-Id: I95041f49dd22ba9a15da3598b04a010eecf761a8
2016-06-06 14:28:41 +02:00
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
643b70006f Teach loplugin:stringconstant about RTL_CONSTASCII_STRINGPARAM
Change-Id: I8ff0e104aad045f3835dc8facc760a8339b1d088
2016-06-03 10:58:26 +02:00
f8f0f834a1 Add initial CppunitTest_framework_dispatch
Fails with commit 08cf2fd01064306eef7fdbb5b62320947c4d1089 (framework:
last dispatchInterceptor gets asked first, 2016-05-20) reverted.

Change-Id: I0e025a5d8996ecafa6b2fef753d6134079936b00
Reviewed-on: https://gerrit.libreoffice.org/25808
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-06-03 07:03:19 +00:00
69a3080ae9 loplugin:refcounting (RequestFilterSelect_Impl derives from XInterface)
Change-Id: Iabf9b94626b599b4fe799523b3523e18df5203c5
2016-06-03 08:58:14 +02:00
25d46298c0 tdf#89329: use unique_ptr for pImpl in interaction
Change-Id: I21ad7278f7978e7eebf6962fdf1fac2d3cb2bddb
Reviewed-on: https://gerrit.libreoffice.org/25637
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-03 06:15:41 +00:00
8e8a88ec1a loplugin:unusedfields
Change-Id: Ieed5f4d9411478d2568b8e5f4bbe0782bd1d309d
Reviewed-on: https://gerrit.libreoffice.org/25724
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-02 06:32:07 +00:00
fa135fd0e0 remove unused SID constants and associated code
found with a python script that looks like:

process = subprocess.Popen(
  "git ls-files *.hrc | xargs grep -hE '#define +SID_' | cut -d ' ' -f 2 | sort -u",
  shell=True, stdout=subprocess.PIPE)
for line in iter(process.stdout.readline, b''):
  line = line.strip()
  if line.startswith("//"): continue
  if line.startswith("sfx"): continue
  if len(line) < 10: continue
  i = subprocess.check_output("git grep -nP \"#define +" + line + " \"",
                              shell=True)
  if i.count("#define") < 2: continue
  print line + "
" + i

Change-Id: I40eac2569c2b5b129d9459cb723a9d6f26d09264
Reviewed-on: https://gerrit.libreoffice.org/25715
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-01 06:48:13 +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
ffa4b78819 lokit: ensure progress value sequential
When it is saving a impress file, the status indicator sometimes receives
lower values, that it is reflected to client side a flash to the progress bar.

Change-Id: Ib3e8499357984843650c8d897c7b1d6baeb65ff6
Reviewed-on: https://gerrit.libreoffice.org/24326
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-05-26 09:02:24 +00:00
1029b6cb06 sw: replace boost::shared_array with std::shared_ptr
Change-Id: I99eec60db7f6d586b3b424661e03a7891422ab2e
2016-05-25 23:47:22 +02:00
07f1a39509 (nearly) nothing uses GetUniqueId anymore, so remove it.
The odd one out is the usage in Formula, which attempts
to restore focus to a particular window identified by
an unique id. In this case restore focus by keeping a VclPtr
to the desired window.

Change-Id: I1dc335325c109d75745c6bba2e12662e6ae50638
2016-05-25 14:24:20 +01:00
0788f65f46 convert ImageType to scoped enum
and drop duplicate definition in framework.

Change-Id: I6cb95241e659ad58429bffeaaf2f95b07ad12df6
Reviewed-on: https://gerrit.libreoffice.org/25400
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25 12:26:09 +00:00
2af018e4dd Fix typos
Change-Id: I860cc4aa04b4e5cd1437b2f24176ee2ccdec3266
Reviewed-on: https://gerrit.libreoffice.org/25420
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25 09:50:55 +00:00