crash on converting forums/ods/forum-en-39357.ods to xls, and on
recalculating INDIRECT cells in 14 other documents, a debug build
asserts:
soffice.bin: svl/source/notify/lstner.cxx:83: void SfxListener::StartListening(SfxBroadcaster&, DuplicateHandling): Assertion `!(bListeningAlready && eDuplicateHanding == DuplicateHandling::Unexpected) && "duplicate listener, try building with DBG_UTIL to find the other insert site."' failed.
#21 SfxListener::StartListening(SfxBroadcaster&, DuplicateHandling) at svl/source/notify/lstner.cxx:83
#22 SfxBasicManagerHolder::reset(BasicManager*) at sfx2/source/appl/appbaslib.cxx:70
#23 SfxObjectShell::InitBasicManager_Impl() at sfx2/source/doc/objxtor.cxx:845
#24 lcl_getBasicManagerForDocument(SfxObjectShell const&) at sfx2/source/doc/objxtor.cxx:656
#25 SfxObjectShell::GetBasicManager() const at sfx2/source/doc/objxtor.cxx:690
#26 SfxObjectShell::GetBasic() const at sfx2/source/doc/objxtor.cxx:799
#27 ScCompiler::ParseMacro(rtl::OUString const&, bool) at sc/source/core/tool/compiler.cxx:3830
#28 ScCompiler::NextNewToken(bool) at sc/source/core/tool/compiler.cxx:5137
#29 ScCompiler::CompileString(rtl::OUString const&) at sc/source/core/tool/compiler.cxx:5293
#30 XclExpChSourceLink::ConvertDataSequence(...) at sc/source/filter/excel/xechart.cxx:901
and the first StartListening of the pair was:
SfxBasicManagerHolder::reset(BasicManager*) at sfx2/source/appl/appbaslib.cxx:71
SfxObjectShell::InitBasicManager_Impl() at sfx2/source/doc/objxtor.cxx:845
lcl_getBasicManagerForDocument(SfxObjectShell const&) at sfx2/source/doc/objxtor.cxx:657
SfxObjectShell::GetBasicManager() const at sfx2/source/doc/objxtor.cxx:690
ScServiceProvider::MakeInstance(ScServiceProvider::Type, ScDocShell*) at sc/source/ui/unoobj/servuno.cxx:590
ScModelObj::createInstance(rtl::OUString const&) at sc/source/ui/unoobj/docuno.cxx:4085
basic::SfxScriptLibraryContainer::importLibraryElement(...)
Creating the BasicManager of a VBA mode document loads its VBA
document modules, and they create the VBA globals, which asks for
the document's BasicManager again. That nested InitBasicManager_Impl
gets the BasicManager under construction from the repository and
passes it to the holder, then the outer one passes the same one
again, so the holder starts listening to it twice.
That recursion is old, but crashtesting only reaches it since:
commit c8da2d3a99b3a318545f1947f57c929ac9b9a82d
Date: Sat Sep 26 20:23:11 2026 +0000
load the Basic project of a VBA mode Calc document after import
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13614
Previously the import loaded the Basic project at once and the first
request for the BasicManager came from inside that load. Now with
macros not allowed the project stays unloaded, so the first request
comes later, from a formula, and the load runs inside it.
so make SfxBasicManagerHolder::reset do nothing when it is given the
BasicManager it already holds
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5db2184ae0124879e47310d90b5371e1e2fb0235
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/14516
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit a095496e0d649882531fd8e211ec4179333adee0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211941
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Previously, when setting HELP_DEBUG=1, the tooltips lacked the label
(description) for the commands in extended tip mode.
The problem was that, if the extended help content was empty, then the
ToolBox::RequestHelp() function added appropriate description. But, with
the help debug mode on, the tooltip was no longer empty. It containted
seperator "-------------" and the UNO command.
This patch adds the description when the extra help content is empty and
solves the issue. The result contains mnemonic characters like ~ which
can be suitable for debugging. These characters are removed with the
call to MnemonicGenerator::EraseAllMnemonicChars in ToolBox::RequestHelp
in a normal LibreOffice session without setting HELP_DEBUG.
Keyboard shortcuts are displayed in normal mode, but not in the extended
tips mode. This issue can be later fixed by adding the keyboard shortcut
to the tooltips when HELP_DEBUG=1 is set.
Change-Id: Iead828ece855fa3e712919ef62353dbca9db1d52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211577
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Add the constants needed for the translation
Update mediawiki.ott:
- add title in meta.xml for translation
- remove German language tags to make the template language independant
- simplify Settings.xml
- update Thumbnail.png
- replace fonts with Noto's family fonts
Build mediawiki.ott from XML files like other templates. See
/extras/CustomTarget_templates.mk
Change-Id: I575843003796cb04099f1061f816ba52c658d41d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211247
Tested-by: Jenkins
Reviewed-by: Laurent Balland <laurent.balland@mailo.fr>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Switch the SSfxViewShell param for the SfxPrinterController
from pointer to reference to make clear it's always non-null.
This allows to drop now superfluous null-checks.
Change-Id: I49862b6eeffbf7db388520e801a50557205631a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211074
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
This constant is explicitly mentioned in the
SfxObjectShell::GetTitle doc, so use it instead
of a hard-coded 1.
Change-Id: Ifba43b860732c2879086d216a9b166d4dbb3f32d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211072
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Instead of returning a reference to the abstract
XModel3 interface, return the more concrete
SfxBaseModel.
Drop some now unnecessary casting/UNO querying in callers.
More simplification to avoid UNO querying elsewhere
will follow in upcoming commits.
Change-Id: I05ad3a4bccfb080ccbee3af956451def3bcc94fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211053
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Use the XModel3 interface instead of only the very
basic XInterface base interface for the document
as the object that is passed is known to implement
this more specific interface.
The DevelopmentToolDockingWindow ctor passes the
result of calling SfxObjectShell::GetBaseModel
(which returns XModel3) for the param.
This also prepares for switching the return type
of SfxObjectShell::GetBaseModel to a reference of
the concrete SfxBaseModel in an upcoming commit (without
introducing ambiguity due to multi-inheritance from
XInterface in places using only an XInterface
reference).
Change-Id: I61f531caea266286fe51b5231c13f56e5b9d82b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211050
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Instead of assigning a different value to `nMaxLength`,
simply treat those 2 values for which that was done the
same as SFX_TITLE_FULLNAME right away.
This is equivalent because the value of `nMaxLength`
isn't used any more for anything else afterwards.
Change-Id: I3913c03ee3a14e0f685d7b3a5f898067229a2297
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211040
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Avoid the duplicate check for INetProtocol::File
by moving the check into the existing block in
which the protocol is known to be something else.
Further simplification will follow.
Change-Id: I7c06e475b3518a6d422df41b2fce5f165166a247
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211039
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
The
nMaxLength = 32;
path is only reached when `aURL.GetProtocol() == INetProtocol::File`
and the previous value of `nMaxLength` is SFX_TITLE_PICKLIST or
SFX_TITLE_HISTORY.
However, in that case, assigning 32 to that local variable has no
effect, because the following block only compares `nMaxLength`
to specific values which `nMaxLength` is known to not have even
without reassigning a new value:
if ( aURL.GetProtocol() == INetProtocol::File )
{
if ( nMaxLength == SFX_TITLE_FULLNAME )
return aURL.HasMark() ? INetURLObject( aURL.GetURLNoMark() ).PathToFileName() : aURL.PathToFileName();
if ( nMaxLength == SFX_TITLE_FILENAME )
return aURL.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset);
if ( pImpl->aTitle.isEmpty() )
pImpl->aTitle = aURL.getBase( INetURLObject::LAST_SEGMENT,
true, INetURLObject::DecodeMechanism::WithCharset );
}
Therefore, drop the superfluous reassignment altogether.
Furthe simplification will be done in a separate commit.
Change-Id: I468a9c4ce6e885f8a562c68fa6fbce7eff395a87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211038
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
The map is only used for the SFX_TITLE_PICKLIST
and SFX_TITLE_HISTORY cases.
That means that the first entry is irrelevant/unused
and for the other two, the same values are assigned.
Simplify that by dropping `aTitleMap_Impl` altogether
and just assigning the relevant values directly.
Change-Id: Ia3039c6337b4f8c8a3d93c67dc9c68ba981ad041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211037
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
From include/sfx2/objsh.hxx:
#define SFX_TITLE_CAPTION 5
#define SFX_TITLE_PICKLIST 6
#define SFX_TITLE_HISTORY 7
That means that
if ( nMaxLength > SFX_TITLE_CAPTION && nMaxLength <= SFX_TITLE_HISTORY )
is met exactly when nMaxLength is one of
SFX_TITLE_PICKLIST or SFX_TITLE_HISTORY.
Explicitly check for that, to make the code
more readable/straight-forward.
This also prepares for further simplification.
Change-Id: Iade2f499597e6a7f97dd84395a2e697460dee47c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211036
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
The caller of Application::CreateMessageDialog owns the
returned message dialog.
So far, it was returned by a plain weld::MessageDialog*.
Return a unique_ptr instead, to make clear the ownership
semantics. (Also adjust SalInstance::CreateMessageDialog
accordingly, which is called by Application::CreateMessageDialog
and implements the actual logic to create a message dialog.)
Adjust callers where needed.
Most callers were already using a smart pointer for the
returned message dialog anyway.
Change-Id: I7c06bb24b611bd67f5af89800adb13bf22dcc6fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211013
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
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>