The formatting of the pivot table output was spread across
ScDPOutput: cell styles and frames were applied inline while the
table content was written, and ScDPOutputImpl drew the block
frames.
Add sc::pivot::StyleOutput, which handles all the drawing. ScDPOutput
now only records the sections of the table (layout geometry, field
cells, member spans, subtotal and grand total rows and columns,
indents and expand or collapse buttons). The cell styles are applied
while the sections are recorded, at the same points where they were
applied before, so they always come before any direct formatting
(number formats, pivot table format attributes) reaches the cells.
The block frames, the indents and the expander buttons are then drawn
by apply() in one pass over the collected sections. The drawn output
stays the same as before, and a different look, like the OOXML pivot
table styles, can later be drawn from the same sections.
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Ia628de6badf511d299f36bf474194ecad17a9c56
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8253
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 9f5a36c822b170835c55143716be9eca28ac3e91)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209430
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
* 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>
Calc's .uno:InsertThreadedComment slot mutated the note model directly
(GetOrCreateNote, SetText, SetThreadedCommentData, KitCommentNotify) and
never set the document-modified flag, so SFX did not broadcast
.uno:ModifiedStatus. The handler also did not register undo, so the
insert could not be rolled back. The same handler dropped the
SvtUserOptions fallback when the Author arg was passed but empty (the
ternary checked has-arg, not non-empty-value), letting the author land
as "Unknown Author" instead of the per-view WOPI UserFriendlyName.
Mirror ScDocFunc::ReplaceNote: a new InsertThreadedCommentOperation
runs inside ScDocShellModificator, releases any existing note (rescuing
its ScNoteData and a clone of its threaded payload), creates the new
note, builds the threaded payload plus the person-list entry, registers
ScUndoReplaceNote, and does the necessary finalizing calls. The author
resolution now uses the default-then-fallback chain so an empty Author
arg still routes through SvtUserOptions before the catch-all.
Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I42304b9467e8b290316b0fa8ba3c80c8fc0d9c35
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4142
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit d0935091c608f7184d00669b85f98e5b4b5fe1b4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207111
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Replace the error message dialog with the same #SPILL! mechanism
used for array formulas when the pivot table output is blocked.
The pivot table configuration is still applied, but the output
cell shows #SPILL! error until the blocking cells are cleared.
Also includes:
- Auto resolve spilled pivot tables after delete, cut, move, paste
- Add sc::UndoSpillPivotTable, so when undoing we can recover back
to the spill error and delete the pivot table output (if present)
- Skip spill check during import to preserve cached output
Change-Id: Icf7d89c088b9d8a9d255945aa6235c91f602d4a9
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1750
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 94299df72efeddb3d5af31396f5008300d66a90d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205683
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
DataPilotUpdateOperation was delegating when certain conditions
were met to other pivot table operations and when the conditions
didn't apply, it used a unique kind of replace pivot table
operation. This isn't ideal (especially the delegation part), so
this change creates a new operation ReplacePivotTableOperation,
which has the replace logic. Then the DataPilotUpdateOperation is
completely removed. The delegation logic is now moved back into
ScDBDocFunc::DataPilotUpdate method. This is a much leaner solution
than it was before.
This should be pure refactoring only.
Change-Id: I102bc93e1ade0e315cd918499d83733bb475e1e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201698
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202118
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 8f4d3dd386f2d9b5129c69497543aa0fdaa247ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205607
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This one is a bit special. We need to use the ScDPObject from the
default view to perform the update. So we first search for that
object, then copy over the save data as that has probably changed.
The rest goes as usualy with a sync at the end.
Sync also needs a bit of modification as we were missing that in
OverwriteContent we should delete all the pivot tables on the
target sheet as we need to clean all content first, before we
copy content over.
Introduced a common PivotTableOperation superclass that is used
by pivot table operations and stores shared pivot table methods.
Added operator<< for ScDPSaveData to make CPPUNIT_ASSERT_EQUAL
functional in tests.
A minor change is also that we renamed the lazy named variables
like rDPObj to rDPObject.
Change-Id: I4c29b49dfcc88a5e38414393c0482c14f2aa05fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201696
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202116
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 8c8ab35715a770b1c2f7f0414e56cba96437cc8e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205552
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Remove the tab redirection inside ViewData, which changes how sheet
views work. Sheet views are now used as normal sheets for both the
UI and data, instead of relying on redirection. Sheet view handling
is done in the UI itself. This simplifies the approach and likely
avoids bugs that would arise from redirection.
For this to work, all functions that deal with sheet views need to
be changed. A new InsertSheetViewOperation was added for inserting
sheet views, along with the sc::UndoInsertSheetView undo class.
Tests were adjusted, especially the asserts for tab names and tab
numbers of sheet views.
Change-Id: I08044afcff2bb64be73c05c1bda0262c73197e90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200712
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202021
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit be1a7e5207088704628f4572ddc9d63506c4e9cf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205411
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
An Operation abstract class is an interface for writing operations
whcih are an atomic coarse change to the document model. The
Operation is needed so we can make it easier to handle and extend
various operations we have, and to separate various task that are
typically run in an operation. This should also reduce duplication
of variosu tasks. It also makes dealing with operations easier as
each operation is now confined in it's own class / file.
Currently the Operation doesn't include a lot yet, but this will
be added on demand when more and more operations are converted
to use Oepration derived classes.
This change also includes the first DeleteContentOperation which
uses the code from ScDocFunc::DeleteContents.
Change-Id: I023b4544041ba4b19fdba00d5c8b3559375653a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198730
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201952
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 572a9463230d145436a870c4cbbb6e5d4d391a4e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205334
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
The 60 ECMA-376 default table styles were previously generated in the
OOXML filter layer (sc/source/filter/oox/). This moves the generation
to core (sc/source/core/data/) so table styles are available for any
document with a theme, not only during OOXML import.
The constexpr data from defaulttablestyles.inc and the theme ColorSet
are used to generate ScTableStyle objects with resolved colors, borders,
and fonts. On theme change, default styles are fully regenerated while
custom (file-imported) styles have their theme-referenced colors updated
in-place.
Also removes unused Fill::nBgColorId (all ECMA preset fills are solid,
bgColor has no effect) and updates the Python generator accordingly.
Change-Id: Ic6aee371a29c8983deb70bce9c4085a47cfa1a66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202780
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/172
Reviewed-by: Balázs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 92d78c3fa385f794b63cf6b328b41222f9e4c8b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204505
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
New dialog (Insert > Calculated Field) to add, modify, and delete
calculated fields. Accessible from the menu bar, pivot table context
menu. Insert, modify, delete a calculated field properly.
TODO: maybe more warnings during formula entry edit
Change-Id: Ifdf50de96ff6f7b736b6307e9bea3ae56108679f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200314
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
- replace its last config key use with officecfg call
- other keys MS_Excel/ColScale and MS_Excel/RowScale seem to be unused,
related code was removed in 2017:
commit 98c4cd372b
loplugin:unusedfields improve write-only analysis
and 2015:
commit 96d44c9b07
loplugin:unusedmethods sc
Change-Id: I36c8c6e2a99599ad15d722b096fa90718bdc9abc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198440
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
menubar Insert and Data. With that command a new Table Style area (context) can be
added to the sheet with a defalt table style name (Table1, Table2 etc.).
If the default ooxml table styles are available the "TableStyleMedium2"
style will be automatically applied (same as in Mso), which can be modified
to any other available style after that.
Also add new command for delete a table context. It is also available
from Insert and Data menubar.
For simplifying the dbrange behaviour, it will not possible to change DbRange
properties of those DbRanges which has Table context. (same as in MSO)
from the older DbRange dialog
Includes cleanup for unused-but-set variables (-Werror).
Change-Id: I98067e895d9595ba07206759deff6848dc299216
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194408
Tested-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Code-Style: Balazs Varga <balazs.varga@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196768
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197994
Tested-by: Jenkins
The current row and column items export implementation was quite
naive, where it added jsut one level of items and not understood
why t="grand" needs to be added. This fixes the implementation
so it now gathers the row / column items correctly.
There are many scenarios we need to take into account, like
grant totals, subtotals, filters and sorts. Those are covered
by tests using different pivot tables.
If the row / column items are not correctly set, the pivot table
in MSOffice is not shown correctly in the sheet until you actually
refresh the pivot table, so the data refreshes. In recent MSOffice
version it also marks the pivot table as corrupt and removes the
pivot table from the document. With this fix it now accepts the
pivot table and show it correctly.
Change-Id: I1fbe05b4b5a2051ec9d527f5243c84c2e8818b72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194940
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins
This is now unused after the last use was ported
to using weld::TreeView instead in previous commit
Change-Id: I05c1e5f8f3689af02b4337c65b4aaba481c67e86
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Fri Nov 28 14:12:04 2025 +0100
tdf#168120 sc: Switch to weld::TreeView in CellLineStyleControl
Change-Id: I00ce95cfa9ca7dd9c9d3ea9edec586d63cfca42e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194777
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>