This fixes a 26.8 regression from
commit 4fb31ea85f.
Format - AutoFormat Styles and Ctrl-click to de-select the style.
Change-Id: I94961ec11932d76fc945fbb11031f22174111459
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211929
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
This fixes a 26.8 regression from
commit 4fb31ea85f.
It looks like it was a mistake to not include it here in the first place,
but doubly so when a table style is deselected (via Ctrl-click).
In that case, if the user pressed the edit button,
LibreOffice would crash because of an attempted -1 index access.
Change-Id: I98038dad3693fba26d17022bec75bd201340c1cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211923
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
This fixes a regression from
commit 4fb31ea85f
When you de-select a table style in Table - AutoFormat Styles,
then the checkboxes below were left enabled despite a -1 index,
so the rename and renew buttons would crash.
Change-Id: I3c9601476f874116e43387ee40e934932a44b311
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211922
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
This fixes a 26.8 regression from
commit 4fb31ea85f.
When Table - AutoFormat styles has the style de-selected (via a Ctrl-click),
then SelFormatHdl would call UpdateChecks and crash
when GetData tried to access an index of -1.
Change-Id: I2302436d19ef99584cdb7c4e41738894756e9e8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211921
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
SvxBrushItem::GetGraphic wants the name of the document the brush came
from, so take it as an argument and hand in SwDoc::GetLinkReferer
wherever a document is at hand, the Writer style, frame and background
shell paths included.
The dialog and example-window callers pass the name of the active
document shell through a new svx helper getActiveDocumentLinkReferer.
The hand-rolled copies of the GetPersist, HasName, GetMedium GetName
sequence elsewhere in sw now call SwDoc::GetLinkReferer too.
Change-Id: I8693d27869baed79962b2d5bdcb7b7e2c63227bb
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8200
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 18f91ac71710027479dfe9f206ae2207bad8f2b7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209827
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
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>
That makes clear it's non-null and therefore
the unconditional dereferencing done previously
was unproblematic.
Change-Id: I85e5f1a226396865cc6a835bc63170ccfc479162
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208379
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>
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>
This reverts 27.2 commit d63a0b60fb.
Although Page Style existed in Attributes, it never worked AFAICS.
Using the clues from 'Page Break' in tdf#158011
the key is to simply have an 'invalid' RES_PAGEDESC
in the sw ItemSet. Then ANY Page Style matches... Perfect!
'Attributes' is a find-only piece,
so the SfxToSwPageDescAttr in the two bReplace blocks
didn't need to be restored in the revert
(as well as some other miscellaneous bits).
Change-Id: I7578afae4272e56aafd091d5725ac1ff0390a231
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208503
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
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>
Prior to 2013, the Search All button was disabled
when All Sheets was enabled,
so toggling it off meant that the search buttons
need to be re-evaluated - thus the call to ModifyHdl_Impl.
But with patch 09a546ed1f nothing was being disabled,
so there is no longer any reason to call ModifyHdl_Impl AFAICS.
Change-Id: I669e81d61fdbe0e98577155fda32189488d4aa84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208206
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
I triggered this in Calc.
When 'Cell Styles' is enabled, then clicking on 'All Sheets'
was disabling all of the search buttons.
This could happen with anything that called ModifyHdl
(which doesn't seem to be anything except styles and AllSheets).
Not sure why AllSheets needs to call ModifyHdl.
Changed for tdf#39881. Prior to that SearchAll was disabled
when AllSheets was checked.
So then it makes sense to call it (to re-enable the buttons).
But now it no longer makes any sense.
Change-Id: I809a99aaddfad4add5a4017db60715d88944eb70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208205
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Draw and Impress were using the user options
to enable searching as a regular expression
even though the dialog tried to avoid that
by not making the regex checkbox available.
Now, we don't want to affect the user options,
so we can't just set the checkbox to false.
Change-Id: I0c3797368669099ace1fb2080da9f11fb07d7949
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208121
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
It is a misnomer now, so return to the original name.
Also drop the redundant private Font::GetAverageFontSize().
Change-Id: I67495fa675091b459a4e90ac09665489cc61fdd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207991
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
When the dialog is opened, the last searched for string
(from the session, not from stored config) was already restored.
However, no attempt was made to restore the last replace string.
Although it might feel a little dangerous to provide a restore value,
it isn't really dangerous, because the user has to hit the
replace button in order for it to do anything.
The bug report is worried about replacing with 'nothing' by accident,
so I guess the 'danger' goes both ways.
Personally, I would like having both last values restored
in case I accidentally closed the dialog
(or closed it to get it out of the way while I manually made changes
and then restarted it to continue my replace task).
Only Writer replaces the 'search' content with a user's selection.
In this case it seems very wise to clear the replacement string.
Change-Id: Id9f40c01724978a2e51f685a60b9e3e75c21135a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207901
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Switch the weld::Entry and weld::TextView handlers
that are called when the text changes due to user
interaction to pass a weld::TextWidget& param
instead of a weld::Entry& and weld::TextView&
one respectively.
Adjust related methods across the code base accordingly.
This unifies the behavior for both of these
weld::TextWidget subclasses and prepares for
deduplicating the logic and moving it to the
common base class in an upcoming commit.
That will also ensure they stay in sync.
(Change also motivated by the fact that their behavior was
differing before
Change-Id: I03d2a13cd84d53d806eb9e363f49c4b6be28d938
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Jul 9 13:08:58 2026 +0200
tdf#130857 weld: Don't signal about programmatic TextView text change
.)
Change-Id: I5572fc88caf577fae9a23a39f1ec4f2179935a99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207936
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This started in LO 5.2
with commit beeef93480
tdf#98417, tdf#98539: DIALOG: Improvements to the Find & Replace dialog
Reviewed-on: https://gerrit.libreoffice.org/23057
If the replace label had a description,
then both the search and replace labels were shown.
So if you remove the search label first,
then that space would not be recovered,
not even when the replace label was cleared.
[You would need to again set and clear the Attribute label.]
Noticed by a code read, and then confirmed by unexpected results
from my previous patch.
Change-Id: I74bef84dcf006a6bfed85b6236ed1e8179053e13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207899
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
This was introduced in LO 5.2
by commit beeef93480
tdf#98417, tdf#98539: DIALOG: Improvements to the Find & Replace dialog
Reviewed-on: https://gerrit.libreoffice.org/23057
Using sDesc was confusing to me as I was reading through the code.
Just use an empty string if you want to clear a label,
instead of using an uninitialized, named OUString.
Change-Id: Ia5b5ebd6cdc423b6595f83db8b35ee94d657ab3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207898
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
There was a bit of inconsistency when all enabled Attributes
were then removed - leaving an empty description.
Specifically, the 'Paragraph Styles' label was re-enabled
even though TemplateHdl_Impl returns early if m_bFormat is set.
Additionally, the NoFormat button was disabled - preventing the user
from properly clearing the attribute field.
So the best course of action seemed to be to just call the
NoButton handler - which clears, hides, and resizes.
Change-Id: I65f88ed97e692a0ff9e162c2c8b9b85c9971ea58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207897
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Every time the user called a different command (find/findprev/findall)
the 'replace backwards' checkbox was being reset
to some seemingly random state.
That random state was 'whatever the checkbox was
the last time that "Replace" was called'.
Instead, it should retain the last state that the user provided.
[Fortunately, I found a couple of examples to guide me.
since m_pSearchOpt isn't reliable
as the 'Find Previous' button can also SetBackward.]
With this patch, the user's selection is:
-the sole controller of the checkbox
-saved and restored between sessions (wasn't restored earlier)
[ClickHdl_Impl calls SaveToModule_Impl - so immediately saved]
Change-Id: I1364c97f6a853989cb9b2706ec4a03a5e4c0ca13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207696
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
When there is already a user selection,
it is a little bit ambiguous about what will happen
when the replace button is pressed.
At least in Writer, the user is never SHOWN what has happened
for that first 'Replace' attempt.
But there isn't much we can do about that.
(Calc at least highlights the cell,
while Draw/Impress does no replace, but just the next find.)
It is worse when the user requests to replace something
only in the current selection.
At that point the user kind of expects that the next replace
will just continue within his selection,
but the very act of finding changes the selection.
So, simply disable the replace button for 'current selection only'.
The user can either replace-all,
or else Find the first instance they want and then replace-all
(since only one instance will be in the current selection only).
At the end of the replace-all, there is no selection,
and that re-enables the replace button (via a short timer).
I suppose this might be 'bad training' since using replace-all
is generally a very bad idea.
But the alternatives are worse.
Change-Id: I4349a47702be8671f25b67c816956bb0fb6bcf4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207592
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Page Style is not a 'on or off' kind of attribute.
In order to compare a Page Style, you need a name to match,
and the attribute dialog has no ability to specify a name.
Change-Id: Ifd7e85bd7e0cc80e2ee9fbda87520c60045364f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207619
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Rename weld::TreeView::connect_column_clicked
and weld::TreeView::signal_column_clicked to make
clear that they are not about a click anywhere in a
column, but about the column *header* being clicked.
The GTK 4 doc for the corresponding
GtkTreeViewColumn::clicked signal [1] by which the API
was apparently inspired is clear about this:
> Emitted when the column’s header has been clicked.
[1] https://docs.gtk.org/gtk4/signal.TreeViewColumn.clicked.html
Change-Id: I0b4b337b5ca938bb1526d9857ed2b0b244daf23c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207591
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Most callers use weld::ColumnToggleType::Check
and only a few use weld::ColumnToggleType::Radio.
Add a default param of weld::ColumnToggleType::Check
and drop the explicit param for callers passing this.
This prepares for moving setting the toggle button
type to a separate method in an upcoming commit to
clarify what it actually does.
(It doesn't only set the toggle button type of the
special "expander toggle column" enabled by
weld::TreeView::enable_toggle_buttons, but of *all*
toggle buttons used in any of the cells of the
whole table.)
Change-Id: I65edb7cd5f79c59222c1c415f118b8adbdec0271
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207249
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
In Word only the first-page-shared flag is shared between header and
footer, while the existence of header and footer is independent.
Split into core flags `DisableFirstHeader` / `DisableFirstFooter`,
properties `HeaderNoFirst` / `FooterNoFirst` (which allows removing some
special checks as the name prefix checks now cover these).
`SectionPropertyMap::setHeaderFooterProperties()` had some special code
to turn off a header but not a footer, add that to do it consistently.
Also rename the ODF attributes, `is-first-page-header-enabled` better
describes the values than `is-first-page-header-shared`.
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ieee9cb7a8f7b4fb7e66352c95142d8ccb06f9cb5
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4383
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit a443891f1a6480421fa08c311526c1a9d4bdd642)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206703
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
In the past, weld.hxx used to contain the class
definitions for weld::Widget and all subclasses.
By now, weld::Widget and almost all subclasses have
been moved to separate headers, to make it easier
to keep the overview and to avoid having to
recompile ~all UI code when one class changes.
By now, only weld::Button is left in weld.hxx.
Rename the header to Button.hxx.
Drop weld.hxx includes and instead add Button.hxx
includes (or weld::Button forward declarations) where
weld::Button is used.
(Don't simply replace all weld.hxx includes with
Button.hxx ones, since many of them were for the
use of other widgets that have since been moved
to their own headers.)
Add further includes where needed now that the
(direct or transitive) includes of weld.hxx were removed.
Change-Id: I8ea6201446a418d5e38b46337059dcd517ee29d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205937
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
In the past, weld.hxx used to contain the class
definitions for weld::Widget and all subclasses,
as well as a few helpers.
By now, weld::Widget and almost all subclasses have
been moved to separate headers, to make it easier
to keep the overview and to avoid having to
recompile ~all UI code when anything in weld.hxx
changes.
Move the weld::toId and weld::fromId helpers from
weld.hxx to weldutils.hxx, in preparation of getting
rid of weld.hxx altogether in an upcomcing commit.
Change-Id: I408fe20a74ff104cbfe07bde3105317a1922ff61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205936
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This makes it easier to keep an overview and reduces
what needs to be recompiled if the class changes in
the future.
Change-Id: I16f988657fb183c9701cd14fd953fae6026e5bd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205931
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.
Add missing includes/forward declarations in places
previously depending on transitive includes that
are now dropped.
Change-Id: I3215b358e0fa45ffce08756218c386e1a4d7ebc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205928
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.
Change-Id: I34876c5bef75e30e758029b0fe5afeecc92d509d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205903
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Move the class out of weld.hxx into its own header and
source file, in order to make it easier to keep an overview
and to avoid having to recompile ~all UI code when the class
is modified.
Change-Id: I91bae842e5b18a83db45de12150c21f75e537fb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205900
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.
Adjust includes in files that were implicitly depending
on transitive includes that are no longer present because
the more specific include/weld/Container.hxx is included
further down now instead of include/weld/weld.hxx.
Change-Id: I04e6bb72ce446b746dfdf88b45c7df9d0ccda473
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205899
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.
Change-Id: Ide86f35543468a88288a068cc9f89eaf381ac52f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205763
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
/home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/svx/source/dialog/crashreportdlg.hxx:28:27: error: ‘LinkButton’ is not a member of ‘weld’
28 | std::unique_ptr<weld::LinkButton> mxLinkButton;
Change-Id: If364ca8d2208b997902d19557bb12597defdb506
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205629
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>