Loading of recovered document happend before via XFilter::filter
is not updating media descriptor of document. But this is
important for password protected documents to store entered password
and used encryption type.
To avoid this problem let's use TypeDetection which during its work
will ask user for password and store all the info in modified media
descriptor before actual recovery attempt.
Change-Id: Ide2ebf0955e0937cdc7c9d7165593b71f904649b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88844
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Jenkins
This patch removes toolbar menu item 'Dock Toolbar' enable state and
shows 'Undock Toolbar' menu item when toolbar is docked and 'Dock
Toolbar' menu item when toolbar is undocked. It also sets the
accelerator key displayed for these items to Shift+Ctrl+F10
Change-Id: I0e4673529438c42452026602785857066ea7874a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85673
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Trying to somehow keep stuff correctly alive, truned out to be
rather futile. Originally I tried the same way Caolan did in the
attached patch to tdf#88985, when he finally settled on adding a
special terminate listener.
But this is not enough to handle in-process scripted extensions,
like Java, Python or even Basic macros themself.
So this separates the module shutdown and SfxApplication cleanup
from the rest of the terminate call.
Change-Id: Ice59816080c922a17511b68afe59348a662600c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88835
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
...now that macOS builds are guaranteed to have std::optional since
358146bbbd "Bump macOS build baseline to
Xcode 11.3 and macOS 10.14.4".
The change is done mostly mechanically with
> for i in $(git grep -Fl optional); do
> sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \
> -e 's/\<o3tl::optional\>/std::optional/g' \
> -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i"
> done
> for i in $(git grep -Flw o3tl::nullopt); do
> sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i"
> done
(though that causes some of the resulting
#include <optional>
to appear at different places relative to other includes than if they had been
added manually), plus a few manual modifications:
* adapt bin/find-unneeded-includes
* adapt desktop/IwyuFilter_desktop.yaml
* remove include/o3tl/optional.hxx
* quote resulting "<"/">" as "<"/">" in officecfg/registry/cppheader.xsl
* and then solenv/clang-format/reformat-formatted-files
Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Files which could become clang-format conformant with
under 5-percent lines of change relative to the total
count of lines in the file are found by using bin/find-clang-format.py,
and fixed with /opt/lo/bin/clang-format -i <path-of-the-file>
There will be follow-up patches to fix all 'under-5-percent' files.
Change-Id: I702c09bcd3a9a113b3d66c30edb6cf3b7e6a6593
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88776
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Per default, a document opened by a user action will always open
in a new frame. For tdf#83722, this behaviour was extended to
documents created from templates.
But this currently also affects the default factory templates, if
these are replaced by a config setting with a real template, which
was not intentional.
So this patch introduces a new MediaDescriptor property, which
allows to mark a document as replaceable and automatically sets
it for factory default documents. If this property is set to true,
a document just acts as a placeholder while it's unmodified. I.e.
the next opened document from its frame will close and replace it.
Change-Id: I45ffa8709f7cdda949fac78f3b363f120f0c4a03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88257
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
As we cannot generally make sure they stay encrypted.
Change-Id: I15ed41fabcc553608e418608ad1166a951daa4b6
(cherry picked from commit aaf91e7c4833689dc11d0b7f3e9f707a9ce206d5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88209
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
With --enable-pch=full there's not much difference between a "public"
header in <module>/inc and a private one in <module>/src/somewhere/inc .
And since the script searches recursively, this apparently helps to
find even more headers for lower pch levels.
Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
found by my new loplugin:unusedvariableplus
Change-Id: Ic3f55f492d43a53d8850a97d44059ff127fd69a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87573
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
"Find explicit casts from signed to unsigned integer in comparison against
unsigned integer, where the cast is presumably used to avoid warnings about
signed vs. unsigned comparisons, and could thus be replaced with
o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx)
o3tl::make_unsigned requires its argument to be non-negative, and there is a
chance that some original code like
static_cast<sal_uInt32>(n) >= c
used the explicit cast to actually force a (potentially negative) value of
sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the
cast to avoid a false "signed vs. unsigned comparison" warning in a case where
n is known to be non-negative. It appears that restricting this plugin to non-
equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=)
is a useful heuristic to avoid such false positives. The only remainging false
positive I found was 0288c8ffec "Rephrase cast
from sal_Int32 to sal_uInt32".
But which of course does not mean that there were no further false positivies
that I missed. So this commit may accidentally introduce some false hits of the
assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan
--enable-dbgutil) `make check && make screenshot`.
It is by design that o3tl::make_unsigned only accepts signed integer parameter
types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses
which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in
include/oox/helper/helper.hxx is used with both signed and unsigned types, so
needs a little oox::detail::make_unsigned helper function for now. (The
ultimate fix being to get rid of the macro in the first place.)
Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
mostly to make the job of my very aggressive unused local vars plugin
easier
Change-Id: Ifc21a920841f8589f8b7e10de39dba6622a5d501
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87399
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
for non EN GUI
Change-Id: I8761560e48f781ed516494984fc5a86c72019ad0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86619
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Roman Kuznetsov <antilibreoffice@gmail.com>
Crash caused by this sequence (tested in Writer):
1. Closing print preview, frame is attached to controller;
2. This calls SfxNotebookBar::StateMethod
3. There notebookbar's listener is added to list of the controller's
context change event listeners
4. Then in SwPagePreview::~SwPagePreview, notebookbar's listener is
added to that list again
5. ContextChangeEventMultiplexer::addContextChangeEventListener
detects second addition, and throws an unhandled exception.
I don't know why starting listening is needed in SwPagePreview dtor;
unfortunately commit d05b7b32d9 doesn't
say much about context and reasons.
ControlListener is renamed to ControlListenerForCurrentController to
emphasize that it operates on the current controller of notebookbar's
frame; and its bListen parameter meaning was reverted: previously its
"true" value awkwardly meant "stop listening". All direct operations
with listener of notebookbar are replaced with calls to notebookbar's
methods.
In ContextChangeEventMultiplexer::addContextChangeEventListener,
uno::UNO_QUERY_THROW was replaced with uno::UNO_QUERY, because not
only chart controller may appear here, and it's not an error: e.g.
SfxBaseController doesn't implement lang::XServiceInfo.
Regression after commit d05b7b32d9.
Change-Id: Ief1aed188d8f02a6cfe3ea25f4d082dfdf449f32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86257
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
...and then remove newly-redundant user-provided dtor completely, similar to
<https://gerrit.libreoffice.org/#/c/85032/> "Remove some redundant user-provided
dtors"
Change-Id: I185d3aa7c16b5d4e6e64345c7fa221b9ed0cde6e
Reviewed-on: https://gerrit.libreoffice.org/85038
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
And /org.openoffice.Office.Recovery/RecoveryEntry/DocumentState is nillable, so
xItem->getPropertyValue(CFG_ENTRY_PROP_DOCUMENTSTATE) >>= tmp;
can presumably fail.
Change-Id: I08c38aec13b2ceda512925b18aefd5981cf85bcd
Reviewed-on: https://gerrit.libreoffice.org/84422
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>