Disable the checkbox to save preview image
if the expert config says thumbnails are not allowed to be generated.
Change-Id: I5c2cceffb3f0ac301814b347ce0d3a6eff0cc79f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210639
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Since SfxDocumentInfoItem didn't compare m_bUseThumbnailSave
in operator==, it didn't notice that putting *pInfoItem
was different from the previous value.
It also isn't checking m_bUseUserData,
but that doesn't seem to matter in the current implementation
so I'll just leave that absent for now.
Change-Id: Ibd1e5b161a92f659c72b235885a7f01fdd9e4115
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210634
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Jenkins buildbots occasionally fail with a SIGSEGV during UITest
teardown in test_tdf117039_preview_signed_document. The crash is
triggered by a race condition between an asynchronous Print Preview
view-shell closure on the main thread and xDesktop.terminate()
invoked by the Python test harness.
When XFrameImpl::implts_checkSuicide() has its initial frame close
vetoed (e.g., frame is mid-load), it auto-retries once the lock count
drops. This can cause the framework to invoke SfxBaseController::dispose()
a second time on the same controller.
Because SfxBaseController::dispose() lacked a strict idempotency guard,
it would unconditionally re-run disposeAndClear() on its listener
container. Walking already-freed listeners results in a use-after-free
crash inside BaseReference::iquery.
This patch adds an early return if m_pData->m_bDisposing is already
true. This safely intercepts the double-dispose and adds a SAL_WARN
to track when this teardown race is caught.
Change-Id: Ifa68e2f113cad24a05f8b64c19eabec60cdbd0b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208046
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
When a read-only document is saved to a new file using the SaveAs
command it is supposed to become editable. The commit below added a
check whether the document is currently read-only before proceeding to
remove the read-only status. The patch also makes the read-only method
true if the document has restricted fonts, so presumably the intention
was to avoid removing the read-only status in that case. However it
ended up making the condition so that read-only status is only removed
if the document isn’t read-only, which of course doesn’t make sense.
This patch instead extracts the part from IsReadOnly that checks whether
the document has restricted fonts and only checks for that instead.
commit fdd24dabb6
Author: Mike Kaganski <mike.kaganski@collabora.com>
Date: Mon Aug 11 17:55:27 2025 +0500
tdf#145967: Initial support for docs with restricted embedded fonts
Change-Id: I7e59bf53e759110a636c398dc8f5af56b1e2da8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208746
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
The comphelper::LibreOfficeKit::isActive() case in
SfxNotebookBar was only relevant for Collabora Online,
see e.g.
commit 6bf428d354
Date: Sat Nov 4 12:05:16 2023 +0100
lok: notebookbar: handle multiple sessions
That one isn't using this repo anymore, so drop these
now obsolete checks.
Change-Id: I3d364b17aa77eeb0b416b7de1f8db34bef6e86ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208657
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Since
commit 8754a75d98
Date: Tue Jun 2 14:47:57 2026 +0200
vcl: drop WeldedTabbedNotebookbar
, the if block that this code is in is only entered for the
`!bIsLOK" case`, so there is no need to check that inside
of the block again.
Drop the duplicate check.
Change-Id: If0f769ca4204b5219be3d4434f04651352410f2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208656
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Local variable `sNewFile` already holds the string
concatenated from `rUIFile` and `sFile`, so reuse
that one instead of having `aBuf` as another local
variable with the same value.
Make a few local vars const to make clear that
the values are indeed the same and the vars
can't have changed in the meantime.
Change-Id: I8eae7912eae037c94c095886eded2b0fea65df93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208655
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
With the refactoring from previous commits in place, it's
clear that all callers pass a non-null SfxBindings*
param.
Switch the param to a reference, to make that clear
and prepare for further refactoring.
Change-Id: Id9f1487dba4b84860f9afa52ff9ffb4dd7b1d2c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208387
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
With refactoring from previous commits in place, it's
now clear that all callers pass a non-null
SfxChildWinInfo*. Pass by reference instead to make
that clear, which also allows to drop some null
checks.
Change-Id: I39bfe179c68afecf9b7aa209feb69d33e57e5388
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208371
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Rename accordingly, and also add the usual "m_" naming
prefix for member variables.
Change-Id: I8c7527a2285dae83f44ba43e74230331f9022e74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208354
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Switch the parameter from a pointer to a reference.
The only 2 callers in SfxChildWindow::CreateChildWindow
always pass a non-null param.
Using a reference makes clear that the param is always
non-null and makes clear that those implementations previously
unconditionally dereferencing the pointer were unproblematic.
Change-Id: Ia2b893aac6c94c3b0e1024cc5500da2463bf9996
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208312
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
All callers pass a non-null SfxChildWinInfo*.
Switch the param to ref, which also allows to drop
a null check.
Change-Id: I47d38ddc26800668112619eb4fb512834060f7b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208310
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Previously there were two copies of a function called CutLines which
were used to remove a method from a string containing BASIC source code.
These have both been replaced with a helper method on SbModule that
returns the source without the given method.
Change-Id: I70c4a4ffe40085bd090ee6823c46154c057468e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207062
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Switch the parameter from a pointer to a reference.
The only 2 callers in SfxChildWindow::CreateChildWindow
always pass a non-null param.
Using a reference makes clear that the param is always
non-null, allows dropping some null checks and makes
clear that those implementations previously unconditionally
dereferencing the pointer were unproblematic.
Change-Id: I6734dfe6fe4fa1cb6aa80f4e67eb69603e8d86fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208300
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
vcl::WindowData is used to manage/store various state
information for windows. It can be (de)serialized to/from string.
So far, both the weld::Window API to get/set window state
as well as the SvtViewOptions API were based on the string
representation.
Switch those and various related places to using vcl::WindowData
instead to use a stronger/more specific type than just OUString
in various places across the code base.
Do the string (de)serialization where necessary, but otherwise
prefer to use vcl::WindowData directly.
Calling weld::Window::set_window_state with a WindowData
param that doesn't indicate that anything should be set
(i.e. whose mask is vcl::WindowDataMask::NONE) should
have no effect, so drop extra checks that were previously
checking whether the string representation was empty
and skipping the call to weld::Window::set_window_state in
that case.
No change in user-observable behavior intended or
seen in a quick test.
Change-Id: I5bc4caeb49d0ab2bbc4fa597a5ef19d86d3aac2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208125
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
The SvtViewOptions class is used to store the state
of windows/dialogs.
So far, SvtViewOptions::SetWindowState and
SvtViewOptions::GetWindowState are string-based
and the callers are responsible for (de)serializing
the vcl::WindowData to/from string.
This will be changed to become the responsibility
of SvtViewOptions in an upcoming commit.
Since unotools is below vcl in the module
dependency chain, it cannot make use of vcl,
i.e. vcl::WindowData couldn't be used there.
Therefore, move SvtViewOptions from unotools
to svtools, which is above vcl in the module
dependencies.
(svtools/README.md summarizes the purpose of the
module as "Tools on the Top of VCL", which seems
an appropriate place for helper code to manage
the state/options for dialogs, tab pages,...)
Change-Id: If849224c35c7ac895659ddb7c17e6d17061d61a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208124
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Use the usual "m_" naming prefix for class members,
to distinguish them from local variables.
Change-Id: I4bdf9e274d43a87e93c558dda3c942fe0c7d707f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208120
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Use the usual naming prefix for class members,
to distinguish them from local variables.
Change-Id: I7f2ab60cb32d7166c3e05ad34bb5820363c98066
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208118
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
The only caller passes non-null SfxBindings.
Switch the param from pointer to ref, which
allows to drop some logic handling the null case.
Change-Id: I05fa77dafcbeac804dd0b70d2fd28bb25a83dadf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208117
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
The SfxStatBar_Impl struct only has a single StatusBarId
member. Use StatusBarId directly instead and drop the
struct.
Change-Id: Icc56290e3024baf83ae3e08da82749cec1b7b675
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208115
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>