Somewhat surprisingly, it is very easy for Calc to report a selection
when the selection has actually been negated.
And sadly I didn't even see any examples in the code that checked.
ScViewFunc::SearchAndReplace early on calls
DoneBlockMode(true); // don't delete mark
which actually does delete the mark (if it has been negated).
So very quickly after HasSelection said that it did have a selection
this function cleared that status, so the rest of SearchAndReplace
operated on a no-selection state.
So ensure the correct state in srchdlg's TimeoutHdl_Impl
to prevent the user from requesting 'Current selection only'
when no selection is actually available.
Change-Id: Ifcafe251e68f036a25556cf5533d06337878d606
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208249
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
No Functional Change intended
This function is used very specifically for only UI stuff.
It is very different from any regular stuff.
So help to differentiate it by requiring the bool value.
To make sure I got all of them, I tested by requiring
a bogus OUString variable as well - make sure it compiled.
Change-Id: I4879427a806324d9fb9c033ef6b66ad24ba0bd54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208234
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
If the user has edited a cell, but has not yet pressed enter
and then they start/resume a search,
then the change being made might be applied to a different sheet.
Yeah - so stop editing before doing a search, eh?
I excluded SID_SEARCH_ITEM because that is called every time
the dialog starts/stops, any checkbox is ticked, etc.
So excluded for performance/extreme redundancy reasons.
I can easily imagine wanting to use search when building a formula,
so let us exclude that case as well. (see tdf#137899)
Change-Id: I61b22e668c7080c4f1786e1a720b1c8b4bafa68c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208223
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
Copy the value from the status bar.
According to the checkboxes selected in the submenu.
If “None” is selected, choosing “Copy Value...” saves
an empty string to the clipboard.
This effectively clears the clipboard.
Support for multiple national languages has been added.
Change-Id: I662e8be8feaeac5bf2e4d69f557a8fec2420ff47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207385
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
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>
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>
A cut paste can add a named database range to the destination
document, just as a copy paste can, when the clipboard carries the
range and the destination does not yet own it.
ScViewFunc::PasteFromClip() forced the database-range snapshot for
a copy paste so that the addition could be undone even into an
empty collection, but the cut-paste branch built its ScRefUndoData
without that flag. Undoing a cut paste that added the range
therefore left it orphaned over the now-empty cells.
Compute the force flag once from the clipboard's named ranges and
pass it to ScRefUndoData on both the cut and the copy path.
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Ic942f722c89b9a2e34b4d83345e16f123a775848
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5094
Reviewed-by: Balázs Varga <balazs.varga@collabora.com>
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit ed7fbe013519bf313c7d2bf12166938872b77b75)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207943
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
The method is the handler set for ScTpUserLists::mxEdEntries
via weld::TextView::connect_changed and not called any other
way, so can never be called with a different weld::TextView
for the param.
Change-Id: I020ca2eb2b1bcf7a60a63ee467b605e521b65e70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207924
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Don't modify the input OUString param, but use an input
std::u16string_view param and return the new string instead.
Also switch the ScTpUserLists::AddNewList and
ScTpUserLists::ModifyList OUString params to
std::u16string_view, as mandated by loplugin:stringviewparam.
This simplifies both callers, which only create a string
copy to pass that as the in/out param.
Change-Id: I5bed126cf08e44418e9a5839ee70b64932f08a87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207923
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Drop ScTpUserLists::m_aStrCopyList and only translate
the string when needed: when the dialog using this
string as its title actually gets triggered.
The dialog can be triggered like this:
* start Calc
* insert something into cells A1:B2
* select cells A1:B2
* "Tools" -> "Options..."
* "LibreOfficeDev Calc" -> "Sort Lists"
* press the "Copy" button
Change-Id: Ic373ab375411e3fd85a6733e94179a415ddc21ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207920
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Without this, Qt Creator shows this error/warning
when opening the header:
tpusrlst.hxx:49:27: No member named 'TreeView' in namespace 'weld' (fix available)
(Probably not a problem during the build because of
the header only being included after other includes
that provide weld::TreeView transitively, but that
shouldn't be necessary.)
Change-Id: I4c542fa025dd4fb71e15ea9bab181954a12c853b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207914
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
The mbAutoDynamicArrayEligible bit marks a cell as allowed to
auto-promote to a dynamic-array master on its first interpret.
The copy constructor propagated the bit, so a paste or fill
clone of a still-eligible source inherited the eligibility and
could auto-promote at the destination position.
Clear the bit on copy and move the explicit set onto the cell
after the local-to-document copy in the UI entry path. The
clone starts non-eligible, and only the freshly typed cell
handed to the document keeps the bit. A paste no longer leaks
into auto-promotion.
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I164cdf2411bb4d31148c3a73e1e70440c5f604dc
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5194
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 8b46008b1f709f06cc88040d674659e15ea6f53b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207788
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
The undo object for an EnterMatrix command stored the cell
range and the formula but not the dynamic-array flag. The Redo
path then rebuilt the cell with the default flag value, so a
dynamic-array master entered through the UI came back as a
static Ctrl+Shift+Enter array after a Redo.
Store the flag on the undo object and thread it through the
Redo path. The redone cell keeps the dynamic-array master
status it had before the Undo.
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Iee9881fff3b0acb1a5ab6c71e02222a4a4d7d7a0
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5193
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 4c1bc56498cc7200eb7e72b251a73c7dba9e5bbc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207787
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Otherwise, cutting/copying the entire sheet operates only on the
selected draw object rather than on the entire sheet.
Change-Id: Ie7b1a1c4fb54743c32bd130a9e308f0b6f68fc43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207745
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
When the user types a formula that returns an array (UNIQUE,
TRANSPOSE, a range plus a range, ...) and presses Enter, the
cell now becomes a dynamic-array master. The array result
spills into the empty cells to the right and below the typed
cell. The user no longer has to press Ctrl+Shift+Enter to get
array behaviour.
Formulas loaded from a file and formulas created from a macro
keep their old single-value behaviour, so existing documents
are not affected.
A new per-cell bit, mbAutoDynamicArrayEligible, marks a cell
as allowed to promote. The view code sets it on freshly typed
formulas. The importers and the macro entry path leave it off.
When such a cell first calculates, the formula tokens are
walked in execution order to ask the question: does this
formula produce an array result? If yes, the cell switches to
dynamic-array master mode before the calculation runs, so the
array result is kept and the cells to the right and below get
filled in.
The walk tracks whether the value sitting on the stack at each
step is an array or a scalar:
- Pushing a multi-cell range or an inline matrix puts an
array on the stack.
- An operator like + or * keeps the result an array if any
operand was an array.
- A function known to return an array (UNIQUE, TRANSPOSE,
MMULT, SEQUENCE, ...) puts an array on the stack. Other
functions reduce to a scalar.
- Branching functions like IF, CHOOSE, IFERROR and LET do
not fit this simple model, so the walk gives up and the
cell stays a plain single-cell formula.
A formula that begins with the @ implicit-intersection
operator (=@UNIQUE(...)) opts out of promotion. Cells that
are part of a formula group share a single compiled formula
and stay single-cell so the group is not broken.
Ctrl+Shift+Enter still produces a classic static array master.
The shortcut now routes straight to the matrix-entry code, so
the auto-detect described above does not interfere.
The formula compiler has an optimization that rewrites a
multi-cell range as a single-cell pick when the formula sits
in a single-cell context. For example =A1:A4 typed in row 2
becomes =A2 before evaluation. That is the long-standing
implicit-intersection rule.
For typed input the optimization has to be off, otherwise the
multi-cell range disappears from the formula before the walk
can see it. The optimization stays in place everywhere else,
and the engine still applies implicit intersection at run
time when the cell remains a plain single-cell formula.
XLSX export
XLSX marks a dynamic-array master with cm="1" on the cell.
The exporter used to fall back to "matrix master plus a
dynamic-array function" when the explicit flag was missing.
The fallback is now removed. Every cell that should export as
dynamic carries the flag explicitly, set by the importer or
by the UI entry path.
One trade-off: a Ctrl+Shift+Enter (CSE) array of a dynamic-
array function imported from an XLSX file that has no cm="1"
marker no longer round-trips as dynamic. The cell flag is now
the single source of truth.
Tests
Tests cover the array-intent walk for =MINVERSE(...), ={1;2},
={1;2}+3, ={1;2}+{3;4}, ={1;2}+A1, =ABS({-1;-2}), =A1:A2,
=A2:A5+B2:B5, a long chain of binary additions over the same
range, a range times a scalar, =IF(...) with array branches,
and =SUM(...) over a range as the scalar case.
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Icb4b5e108634cd1529ac829cb34865c56ed8ec02
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4684
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit c3d67d3ec81621c385744fac7fd7a722084a122f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207219
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Completes the deprecation of legacy coordinate subsystem naming by
renaming GetOutOffYPixel() and SetOutOffYPixel() to
GetDeviceOriginY() and SetDeviceOriginY() across OutputDevice,
Window, and CoordinateMapper.
This unifies axis naming conventions following previous X-axis
refactoring passes, clarifying that these fields represent the
physical origin offsets of the device rendering canvas.
This patch also moves view transformation logic inline from outdev/map
to CoordinateMapper, and wraps sprawling multi-line logic formulas
across mapping routines to clean up formatting boundaries.
Key changes:
* include/vcl/outdev.hxx / window.hxx: Updated public declarations
to replace GetOutOffYPixel with GetDeviceOriginY.
* vcl/inc/CoordinateMapper.hxx: Migrated view transformation cache State
members and mapping calculation methods into the mapper object.
* Global adjustments: Patched all related coordinate offset reads
and tracking writes throughout desktop, editeng, sc, svx, and vcl.
Change-Id: I28fec54a7f3312cc41ada2de38b26351c0a65527
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203646
Tested-by: Jenkins
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Rename GetOutOffXPixel() and SetOutOffXPixel() to GetDeviceOriginX()
and SetDeviceOriginX() across OutputDevice, Window, and CoordinateMapper.
The legacy "OutOff" naming convention obscured the difference between
system-level window positioning offsets and internal content scrolling
(SetPixelOffset). The new nomenclature explicitly communicates that
these metrics strictly govern the device coordinate space origin.
This patch focuses strictly on the X-axis coordinate reads and cleans
up duplicated formatting signatures inside the CoordinateMapper header.
Impacted modules:
* include/vcl: Update public declarations in outdev.hxx and window.hxx.
* vcl/inc: Clean up CoordinateMapper.hxx whitespace and scaling hooks.
* Global: Patch dependent pixel coordinate reads across desktop, editeng,
sc, sfx2, svx, and vcl.
Change-Id: I546e1d255887e3b280ff15caca2e27ef10de52d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206509
Reviewed-by: Dan Williams <dcbw@libreoffice.org>
Tested-by: Jenkins
Selecting the search result will jump you to the cell.
It does that by detecting a change in the selection
(from nothing to something).
In the case where there is only one result,
then after selecting it once there is no ability
to re-select it.
So in the edge case of only one entry,
then unselect it after jumping to the indicated cell.
Change-Id: I4e6e2eee57a2cae08318c9ddc52a464c0afecfff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207593
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
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>
Avoid visible gaps for metafile and window output by adjusting
nOneX/nOneY as in ScOutputData::DrawGrid.
Change-Id: I3c76b6eb21853e94491997f7a3d38c3de985872e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207393
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Added support for selecting multiple images in the insert dialog. Fixed an issue with inserting multiple images via DnD.
When inserting a single image into a shape with a background or onto another existing image - they are replaced.
If insert multiple images into a shape or onto an existing image - they are inserted instead of being replaced.
To achieve this, SetMultiInsertState(...) and isMultiInsert() methods have been added for DnD, and the boolean
variable isMultiInsert is passed for insertion via lcl_InsertGraphic(...).
Change-Id: Id299be0112ffe0bdf1aafb534edbfb216859dbf4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200891
Tested-by: Jenkins
Reviewed-by: Roman Kuznetsov <antilibreoffice@gmail.com>
So far, weld::TreeView::enable_toggle_buttons was doing
two things:
* enable a special "toggle button column" to be accessed
with a special column index of -1 in the weld::TreeView
API (as documented)
* switch the type of *all* toggle buttons used in all cells/columns
of the TreeView to the type passed as a parameter
(not only set the type of the toggle buttons for the
special toggle button column at index -1)
Untangle these 2 things by splitting this to two methods:
* weld::TreeView::enable_toggle_buttons now only enables
the special toggle button column at index -1.
* The new weld::TreeView::set_toggle_button_type sets
the type of all toggle buttons used in the table.
This makes the API clearer and will allow using one of the
two without necessarily also using the other, which will
allow further simplification/improvements in upcoming
commits.
It could also make it easier to support only setting
the type of single columns to use radio buttons in the
future (i.e. have one column using radio buttons and
another one using check buttons in the same table), but
that would require further rework in the underlying
toolkit-specific implementations (in particular the vcl one).
One case where mixing the two things together results
in non-optimal behavior is the "Assign Styles" dialog
with the vcl implementation:
While the special toggle column with index -1 isn't
actually used, the SwAddStylesDlg_Impl ctor still
calls weld::TreeView::enable_toggle_buttons, presumably
only to enable the use of radio buttons for the actually
used toggle columns at the end.
As a consequence, the style names in the first column
are indented for no good reason (but only to leave space
for drawing the toggle buttons for the special toggle
button column that was enabled without actually being
needed).
This will be adjusted in an upcoming commit.
Initially, just replace all callers of
weld::TreeView::enable_toggle_buttons passing
weld::ColumnToggleType::Radio for the type with
calls to both methods, to keep the existing behavior
and be able to further look into further improvements
separately.
Change-Id: I098feb474162d61c5452c3496293a420118e2f4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207250
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
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>
* Replaced ScOnlyActiveSheetSavedDlg by QueryDialog
* Pimped the QueryDialog with SetTypeWarn showing a different
image and hiding the No button
Change-Id: Id134c8d4f6e27df5918d1b53141b45bc0439651c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207209
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>