Commit Graph
360 Commits
Author SHA1 Message Date
Andrea Gelmini f1c58464ac Fix typos
Change-Id: I38b80f7bbf93192b7e2e00a426b72b77eb33bf1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210568
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-09-10 21:28:54 +02:00
Ben Urban 11ad7d61b4 sc: Implement lambda and related fuctions as FunctionsTest
Like the other functions in Calc

Based on https://gerrit.libreoffice.org/c/core/+/208073

Change-Id: I0e74bff3e29328007345841ffefd6fb18965e5ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209144
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-08-19 11:40:23 +02:00
Xisco Fauli 803794a25e sc: implement arraytotext function tests as FunctionsTest
Like the other functions in calc

Change-Id: Ia1b0b245bca0ded3f1fb060cf0892fd59986567c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208484
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-23 15:47:52 +02:00
Tomaž Vajngerl 21b9909afa sc: add the ARRAYTOTEXT function
ARRAYTOTEXT returns a cell range or array as one text string,
taking the range and an optional format number.

Format 0 (or omitted) joins the values in row order with ", ".
Format 1 gives an array constant: braces around the array, ","
between columns, ";" between rows, and text quoted with any
inner double quote doubled. Any other format returns #VALUE!.

A number keeps its input-line text, a boolean reads TRUE or
FALSE in the current locale, an empty cell adds nothing, and an
error in a range lists as its error text while a reference to a
single error cell returns that error.

The function is wired up with its name tables, wizard entry,
parameter classification, and OOXML and binary filter mappings.

A self-checking OOXML workbook is verified after import and
after an XLSX and an ODS round trip, each with a recalc, and the
exported files are checked for the ARRAYTOTEXT formula. A ucalc
test covers the locale-dependent boolean text for a value and
a range.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I0cdd9737a51f402e39cf9a1346f4c5326680fe8f
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7219
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit f66673d65ee307f17512a4239dd4b52ac189ac20)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208395
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-22 08:05:35 +02:00
Andras Timar 5ecc5c1ad7 sccomp has been removed from engine
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ia6691ce57969507ab5cb2994ceeff8edfedad80e
(cherry picked from commit a88b15ce2e927b7a0d3a01ce915313472e52a237)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208251
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-19 10:51:23 +02:00
Tomaž Vajngerl 9a09794354 Move the Calc solvers from sccomp into the sc module
Relocate the whole solver component out of the standalone sccomp module
and into sc. This moves the SolverComponent base class, the CoinMP and
Swarm solvers, the differential evolution and particle swarm headers, the
UNO service registration, the scc string resource, and the two unit tests.
The now-empty sccomp module is removed.

The solvers are Calc specific. Moving them inside sc is the first step
toward letting them work directly with ScDocument, and eventually clone a
document or its sheets so trial calculations can run in parallel. That
direct access is only possible from inside sc, so the relocation has to
come first.

This is a pure relocation with no behaviour change. The translation domain
stays "scc" and its polocation still points at "sccomp", so the existing
translations keep loading unchanged. Re-homing the scc translation domain
into sc is left as a follow-up.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I5b972daae4c51f04ca394fc9a92f89ac0c4dd599
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3832
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 7f1bea8723761f97c053f2e7e46aab7081b1bb21)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208080
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-19 02:18:56 +02:00
Tomaž Vajngerl bfc9cfdecf Remove the lp_solve solver, which CoinMP makes redundant
The Lpsolve solver and the CoinMP solver are both used for the same
thing: a linear model, with optional integer variables by branch
and bound. CoinMP (CLP plus CBC) is the more capable and better
maintained of the two, so the lp_solve one adds a second bundled
dependency and a parallel copy of the solver code for no capability
the other lacks.

Remove the LpsolveSolver component, the bundled lp_solve external
(and its colamd dependency, which only lp_solve used), and all the
build, configure, packaging and license references to them.

A document may still name com.sun.star.comp.Calc.LpsolveSolver as
its engine. SolverSettings now reads that name as the CoinMP
solver, which solves the same model, so such documents keep
working.

The Calc solver test that exercised the engine now uses CoinMP. Its
knapsack model has a single optimal total value of 6987, which fills
the weight capacity of 1000 exactly and which CoinMP finds. The
lp_solve run had returned a suboptimal 6981, so the test now expects
the true optimum.

The build setup changes only take effect after re-running autogen.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Ia14d8c491779873da6b0157aa524056275adf8f5
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3810
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit e77738a7ca7d44fd9d1f852e26d46e3a6d60467b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208038
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-14 12:49:42 +02:00
Tomaž Vajngerl 0d303ccfd2 sc: add the dynamic-array XLSX import functions test
DynamicArrayFixture.xlsx is a self-checking workbook. The
test loads it, walks column C of each sheet asserting every
verdict cell reads TRUE, and checks each sheet's master cell.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I9f0ad05c5071eb3a0baea5aa5996ea526565b480
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5791
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 5ccb4ccdd9dc29883c46169b93c642da6e1e4458)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207908
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-07-10 01:09:58 +02:00
Tomaž Vajngerl 6612d4f785 sc: add the # postfix operator for spilled-range references
A1# is the postfix counterpart of the @ prefix. When A1 is
the origin of a dynamic-array formula spilled into A1:A4, A1#
refers to the whole spill range, so SUM(A1#) totals the four
values and ROWS(A1#) returns 4.

The new opcode ocSpill sits in the unary-operator range. The
tokenizer produces it from a bare # after a reference or
value. Otherwise # stays the start of a #REF! or #NAME!
token. The compiler routes it through PostOpLine so it
follows its operand in the RPN.

ScSpilledRange pushes the spill range as an ScMatrixRangeToken
so aggregating functions see the whole range, and ISREF
reports it as a reference. A master yields its matrix. A
plain number, string, or non-master matrix slot yields the
the cell value.

A freshly typed =A1# counts as an array result, so it
promotes to a dynamic-array master and spills again. A cell
that does not promote collapses the range by implicit
intersection to the row-aligned value, or #VALUE! outside the
range, keeping that cell's number format.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Idf2752af3f7575f6bc95b940344aa365415e4a2f
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5785
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit 9b97b0fc91bce4b8726ea210347e8ea84270e148)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207904
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-10 01:08:46 +02:00
Tomaž Vajngerl b3f3a2458b sc: simplify stripRedundantParentheses and add unit tests
The strip walked the array twice with the same parenthesis
depth. Start past the inner open with nDepth = 2 and watch
for depth dropping to 1. If the next token is the outer
close, the inner pair spans the whole argument and is
stripped. Otherwise the parentheses stay.

Expose the helper from formulabuffer.hxx so the new
sc_oox_helpers_test target can drive it directly.
RedundantParenthesesStripperTest covers the strip cases
through the OOXML compiler.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I6ab95382b7776833b343754cdafb746454739d51
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5652
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 41557a39d420e45880070b6d942ebfbe32ef8b49)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207873
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-09 17:09:37 +02:00
Devansh Varshney 13c8228073 tdf#169110 tdf#171441 tdf#171636 sc: add UI test for VBA CutCopyMode after opening Basic IDE
Open the Basic IDE, activate the VBA module window, then run the
document macro and verify it does not fail with
'Property or method not found: CutCopyMode'.

This covers the regression where Basic IDE / Object Browser activity
 disturb VBA member resolution for the active document.

Change-Id: Id54b76cc633ba76377f201e3c4afca06a094ea7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197754
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-22 12:54:06 +02:00
Andras Timar 4e1f2ed7eb sc: only build the opencl CppunitTests when OPENCL is in BUILD_TYPE
opencl-test-1.cxx and opencl-test-2.cxx call
ScModelTestBase::enableOpenCL() and disableOpenCL() unconditionally,
but those helpers in qahelper.cxx are wrapped in
#if HAVE_FEATURE_OPENCL. configure.ac adds OPENCL to BUILD_TYPE and
defines HAVE_FEATURE_OPENCL together, so without OPENCL the link
fails with unresolved externals on test_sc_opencl-1.dll (seen on the
Windows app build).

Gate the two tests on OPENCL via gb_Helper_optional, matching the
pattern already used for Package_opencl in the same file.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I4fc9572f98c9b4bbbaab81fad7dc28780ef37397
(cherry picked from commit 36e32e6126e761af9fa7689cc9c1e59aa8b9c46e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206655
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-16 01:21:53 +02:00
Neil Roberts fa05a80aae [API CHANGE] tdf#171950 Add API to create 2- and 3- color scales
The existing API allows creating a color scale conditional format but it
has no entries and there is no API to create an instance of
XColorScaleEntry in order to add one. For data bars the existing API
instead creates a conditional format with two existing entries and then
you can use the XDataBarEntry interface to modify them. This patch makes
the color scale API work like the databar one. It adds constants to
ConditionEntryType to create a 2-color or 3-color scale which have the
entries pre-created.

This is an API change because it adds constants to an unpublished
constant group. It also makes it so that the getType method on the
conditional format will now return either COLORSCALE2 or COLORSCALE3
depending on the number of entries. In practice I think this is very
unlikely to break any existing code.

Change-Id: I28faa6c66ac3963220786e8da45a2d550058f095
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205944
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
2026-06-09 13:11:16 +02:00
Tomaž Vajngerl b15e1dcaa8 sc: Add OOXML export of sheet views to named sheet view structure
Writes named sheet views to the OOXML document, including filter
and sort data if a sheet view uses an auto-filter.

Additionally adds OOXML import/export/roundtrip tests for named
sheet views and tests that those are properly added as sheet views
to the document model.

Change-Id: Id7d38e4c95522986daa232e554b544d35c2fc284
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200996
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202033
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 288cfdd1632e77037fcac466afa2c2f12a146f1d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205470
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-21 18:08:00 +02:00
Balazs Varga 55520b9595 Table Styles: clean-up for Calc table style unit tests
Better to move total row test to subsequent_filters_test5.

follow-up: b128cd5fdbd286fe62fe2ed3799e9faa0b987467
(Table Styles: Add unit tests for Calc table styles)

Change-Id: If5038ba9568812d3373b277116688cc6d60a84ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203000
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/175
Reviewed-by: Balázs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 3f1c9743b61f135a3be460f1e55e6a6d20bfc0cc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204566
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-29 15:36:46 +02:00
Balazs Varga e2fcf200b5 Table Styles: Add unit tests for Calc table styles
generation, rendering, and total row

Tests cover: style generation (60 ECMA defaults), fill colors,
border widths/styles, font properties, theme change regeneration,
undo/redo, multiple style categories (Light/Medium/Dark), style
switching, no header/no total row handling, banded columns,
first/last column, tiny table edge cases, and total row toggle
with custom COUNTIF and SUBTOTAL formula preservation.

Also add ooxml export tests for TableStyles and a few test for
custom table styles. (dxf)

Change-Id: I60b78766e35f80f54747e3ef904e8c59c4c1e8ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202926
Reviewed-by: Balazs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/173
Reviewed-by: Balázs Varga <balazs.varga@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit aead0fc8bf5484ea36cfcea0b13f3cca2d1a8408)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204506
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-04-29 12:28:11 +02:00
Paolo Benvenuto 42cdc47554 tdf#92144 Enable relative font sizes in Calc cell styles
Writer paragraph styles already support percentage-based (80%, 115%)
and point-relative (+2pt, -4pt) font sizes for child styles inheriting
from a parent. Calc cell styles lacked this despite using the same
underlying SvxCharNamePage and FontSizeBox widgets.

The root cause was that Calc's ScStyleDlg::PageCreated() did not pass
the SVX_RELATIVE_MODE flag when creating the font tab page, so
FontSizeBox::EnableRelativeMode() and EnablePtRelativeMode() were
never called.

The fix adds a single SfxUInt32Item(SID_FLAG_TYPE, SVX_RELATIVE_MODE)
to the item set passed to the font page, matching what Writer's
SwTemplateDlgController already does.

No changes are needed in the core: SvxFontHeightItem::SetHeight()
already pre-calculates absolute values from relative ones, and
ScPatternAttr works correctly with these pre-calculated values.

Fix found with the help of Claude Sonnet 4.6 extended.

Change-Id: I3d759c028564a4722f96b325499ea0bfe8e4ba07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200885
Tested-by: Jakub Trzebiatowski <ubap.dev@gmail.com>
Tested-by: Jenkins
Reviewed-by: Jakub Trzebiatowski <ubap.dev@gmail.com>
2026-04-23 18:12:35 +02:00
Xisco Fauli 2b71e0f27b CppunitTest_sc_subsequent_export_test4: split in two
It already has 105 tests

Change-Id: I1f59dad34e5dbf24cc9054b15eac2e8648ca4982
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199650
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-02-19 08:48:56 +01:00
Dan Williams 92c6a725b8 tdf#139467 correctly handle DatabaseLocation for Calc cell ranges
svx::ODataAccessDescriptor contains properties for both a database
name and a local file database location. It parses a given name
via setDataSource() and puts the value into the correct property
depending on whether it starts with "file://" or not.

But this means that code which directly checks properties of
the ODataAccessDescriptor cannot just look for "DataSource"
but must also handle the "DatabaseLocation" property.

Net effect was that saving a Calc sheet with a cell range
backed by a database query from a local file database that was
NOT registered with LibreOffice would not save the database URL
to the .ods file, and on reload would lose the reference to the
database. This caused failures when trying to refresh the database
query.

On the UNO side creating import descriptors for a cell range
from a file with a database location would also fail to read
in the location. Fix that.

Change-Id: I7340f2d9f2f0552f436682f2b96249f39413c1fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195173
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Hossein <hossein@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2026-02-18 22:20:45 +01:00
Karthik a8cfe77dd7 Calc: Adapt 'SvxAutoFormat'
Adapt 'SvxAutoFormat' and retire Calc specific 'AutoFormat' dialog and
preview

Change-Id: I7d1146ba3612c2bd528a4f0daa5485a9c0296dea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190026
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2026-02-04 14:02:17 +01:00
Tomaž Vajngerl c9fcb3b7d0 sc: add tests for sheet view - check auto filter sorting
Check sorting the auto-filter in a sheet view doesn't influence
the sorting in the other views.

Change-Id: Id7b4be75b2071709b67c7cb27ed7b4303029efcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188148
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2025-09-03 16:37:11 +02:00
Tomaž Vajngerl 4ad007de60 sc: make ScAddress constexpr and clean-up
- remove the inlines which are implicit anyway
- make compile type tests of the class
- move inline methods into body

Change-Id: If2656c1b750a300bc0ed589bc7ea6aec27b3237a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190255
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2025-08-27 16:52:01 +02:00
Xisco Fauli aea7c4ecb8 tdf#167134: implement test as sc_functions_test
No need to reinvent the wheel

Change-Id: Iefffe2df9163fb8703eb74563b4031517c6aebba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187399
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-07-04 17:11:18 +02:00
Regina Henschel 5c09611298 tdf#167134 Allow different directions in LOOKUP
... for search vector and result vector when such vectors are given as
inline array.

AOO, Excel, Gnumeric and older LO versions allow it. Different
directions are also possible if the vector is given by a cell range.

The unintended change slipped in with commit
5079e1fb66.

Besides the unit test for tdf#167134, I have added a second unit test
about other situations that have inline arrays as parameter of LOOKUP.
LO does currently not fail for them, but this test might prevent
unintended behavior changes in the future. Such tests do not yet exist.

Change-Id: I21dd6b75d54aa938dcffbd2375acc51d3168b904
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187289
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Tested-by: Jenkins
2025-07-03 11:50:02 +02:00
Xisco Fauli 9431764377 CppunitTest_sc_cond_format: group all conditional format tests
Change-Id: Ieb76ad3710d1ca17212e60bea124f27f634fb8d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187121
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-06-28 13:25:02 +02:00
Xisco Fauli 2559f6329d sc: move these to slowcheck
so Jenkins will tests them on all platforms

Change-Id: Idb17dc34b4b1f26067ed160037c7d81b800ed8f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178801
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-12-22 22:41:19 +01:00
Sakura286 6a7dd6fcd9 tdf#152943: Add NaN payload check at the start of sc_ucalc test sequence
Some archs does not support NaN payload(e.g. riscv64).
  It would be meaningless to continue building a test related
  to NaN payload if the builder doesn't support this feature.

Change-Id: I895a8647bf7ff68f645faa7428d30b1c741669f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175293
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-10-23 15:22:52 +02:00
Xisco Fauli c0e792cc6e sc: Add simple unittest for ScriptForge
Change-Id: Ief1808219862273643a3bfae212b1d0e454b3e86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174763
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-10 23:29:40 +02:00
Rafael Lima 911a57c4d6 tdf#160062 Uno API to set solver settings at the sheet level
This patch creates the API necessary to create solver models via macros, so that the model is visible in the Solver dialog, and the model is saved to the file.

This patch also includes a comprehensive unit test in scsolverobj.cxx.

Visit the bug ticket for a file with some examples of such macros.

Change-Id: Ib9cfbbdaab8243cd6b901a2bcd99e46c27be97e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171769
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-09-27 11:06:57 +02:00
Regina Henschel 35c5d49664 tdf#162963 export property TotalsRow to ODF
DatabaseRange has got the property TotalsRow with UI and UNO. But this
property was not written to ODF. The patch adds this as attribute
calcext:contains-footer to <table:database-range> element.
Related is issue OFFICE-4169 at OASIS.

Change-Id: I99a51198585b9b7dfb840217bdf1312f2462c9bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173612
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-09-19 08:54:44 +02:00
Xisco Fauli f1872f6e47 tdf#161511: sc_goal_seek: Add unittest
Change-Id: Icc05195a4870d5bb4f8c5ffc9b3bcae89367a89d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168866
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-06-14 19:49:43 +02:00
Tomaž Vajngerl c379168711 pivot: PivotTableFormatOutput to resolve and set PT cell format
This adds the PivotTableFormatOutput, which main responsibility
is to resolve the reference for which the pivot table format is
set to. It first prepares the format data into such a structure
that it is easier to match with the pivot table fields and data.
Then the pivot table data is filled during the output, where we
remember the cell positions of the pivot table output. The last
step is to resolve the pivot table format references with the
filled data, where the cell formats are applied to the output.

PivotTableFormatsImportExport was added to test the correctnes of
the functionality.

Change-Id: Ie67ea15b3aa74739f15937800d03d256b8f68277
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165992
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-04-12 08:21:19 +02:00
Caolán McNamara 18d0b7ac86 Resolves: tdf#160368 crash on save after deleting sheet
to reproduce the underlying problem: data, calc, recalculate hard:

which asserts that cell I367 is dirty during parallel calc

checking the dependencies for a parallel calc is supposed to find what
cells it depends on and either: ensure they are not dirty or detect its
not possible to do the parallel calc

checking starts in J9 where::

J9:  =SUM(H$8:H9)-SUM(I9:I$9)
J10  =SUM(H$8:H10)-SUM(I10:I$9)

for the first sum it detects that the input range is H9:H367 and checks
that for dirty results, but for the second sum it detects a range of
just I9 and the dirty I367 is not detected and the problem arises on
calculation

The code to detect the range is:

// The first row that will be referenced through the doubleref.
SCROW nFirstRefRow = bIsRef1RowRel ? aAbs.aStart.Row() + mnStartOffset : aAbs.aStart.Row();
// The last row that will be referenced through the doubleref.
SCROW nLastRefRow =  bIsRef2RowRel ? aAbs.aEnd.Row() + mnEndOffset : aAbs.aEnd.Row();

where for the I9 case has nFirstRefRow true and nLastRefRow false so we
just get a range of I9:I9 instead of I9:I367.

Trying to create a doc from scratch to reproduce this case proves
tricky, so trim down the original document to the sheet and subset
of columns that can trigger it.

Change-Id: I44bfd1f6d3a3ee13db9024c5b2efa2588cc30521
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165510
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-29 20:35:00 +01:00
Miklos Vajna e6e5660b72 tdf#159483 sc HTML import: handle data-sheets-value attribute for the text case
The A2 cell in the bugdoc has 01 in it, which was auto-converted to 1
(float) value on import, even if it was text originally.

This is hard to solve for HTML in general, which is not typed, but this
input is coming from google sheets, which has an additional
data-sheets-value attribute on <td> that does tell us about the type of
the cell.

Fix the problem by handling that attribute, and in case it explicitly
says it's text, then apply the matching number format.

Other types are not yet handled.

Change-Id: I2986ef864e97d9c46d191aba25ca5740a1151a71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162869
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2024-02-01 15:36:39 +01:00
Miklos Vajna a2763fe7b6 CppunitTest_sc_tiledrendering2: extract one test from the old, large suite
Not a split, to avoid too many conflicts while cherry-picking, but at
least create a new suite where next tests can be added without too much
build time after source code edits.

Change-Id: I494df6e23941845a433aab6ec5ecef040feab30e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162473
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-01-25 08:16:26 +01:00
Thorsten Behrens 580b2ecf88 Only run solver uitest if either lpsolve or coinbase is in
Change-Id: Ic03a6df33344b92dccc9bc393d718b4011aa1613
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162034
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-01-14 16:22:41 +01:00
Tomaž Vajngerl 25aa310b92 sc: theme color export for cell fill color + test
Change-Id: Ibaad410f094f86d9f7197090db702ae45340c239
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151859
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-22 05:24:09 +02:00
Tomaž Vajngerl 60cc7b1fbe sc: enable document themes in Calc
Create and check that the SdrPage, that is associated with the
current sheet, has a model::Theme available on creation.

Change-Id: I1814d4a86452b1a15ef01e0b2349d435405f4b7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150263
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-09 12:41:58 +02:00
Rafael Lima 5d86cc81fe tdf#38948 Save solver settings to file
This patch implements the mechanism to save solver settings in LO Calc as well as export/import them from XLSX files.

In MS Excel solver settings are saved as hidden named ranges, so in this patch I used the same strategy to save solver settings in Calc, i.e. by creating named ranges to store the solver settings using the same terminology used in Excel.

With this we gain the ability to save solver settings by tab, as well as export/import since we already have "named ranges/expressions" import/export implemented in LO.

Change-Id: Id41bca261dc3cd8e6888643f0ed6a97b26097876
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148112
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-25 08:06:13 +00:00
Xisco Fauli 07fa6e041f CppunitTest_sc_uicalc: split in two
It already has 99 tests

Change-Id: I672de980ce170b83ba84252170878731e1ce02f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149462
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-23 20:12:44 +00:00
Xisco Fauli b7be39c5f4 CppunitTest_sc_ucalc_formula: split in two
it already has 118 tests

Change-Id: I13d6fe65aca2fa01cf115c5873b9ca853cf5e77b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148891
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-15 08:09:05 +00:00
Xisco Fauli 846302d212 CppunitTest_sc_subsequent_export_test2: split in two
it already has 123 tests

Change-Id: If9630e89b17cb68b23a0567b5a6cca33f4f32f92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148135
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-02 18:11:46 +00:00
Xisco Fauli bccd3f299f sc: move import tests where they belong
and remove CppunitTest_sc_bugfix_test, which is no longer needed

Change-Id: Idb1cff6580c621e325ce0b836695190d25467a0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148035
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-01 16:21:23 +00:00
Xisco Fauli 79434c3215 CppunitTest_sc_subsequent_filters_test: split in two
it already has 109 tests

Change-Id: I2261fbf036862c8005db5a8bc15a1fd55a819319
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148034
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-01 12:26:05 +00:00
Xisco Fauli 36cd611e6f CppunitTest_sc_subsequent_export_test: split in two
it already has 101 tests

Change-Id: I2fb88e41313049fec649e3592d811a36e10440fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148013
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-01 07:47:22 +00:00
Xisco Fauli 78eeb30220 CppunitTest_sc_subsequent_filters_test2: split into two
it already has 115 tests

Change-Id: I043d000b8782bae66bdd958c0273f8c5ea622a60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148009
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-28 20:43:33 +00:00
Stephan Bergmann 98f9b51d58 Split long-running CppunitTest_sc_opencl_test in two
At least the unrelated
<https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/132372/> was killed
after 20 minutes of no stdout/-err activity, with CppunitTest_sc_opencl_test
still running.  From its captured state, it looks like it was indeed still
making progress rather than being stuck:  During
ScOpenCLTest::testLogicalFormulaXor, the main thread was waiting at
ScFormulaCell::InterpretFormulaGroupThreading ->
comphelper::ThreadPool::waitUntilDone, while four
comphelper::ThreadPool::ThreadWorker threads were each at

> #4  0x00007f70652f9234 in __gnu_debug::_Safe_iterator_base::_M_detach() () at /lib64/libstdc++.so.6
> #5  0x00007f7048d3e8e5 in __gnu_debug::_Safe_iterator_base::~_Safe_iterator_base() (this=0x7f703daa9f20) at /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/debug/safe_base.h:100
> #6  0x00007f7048d5d709 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<mdds::mtv::base_element_block* const*, std::__cxx1998::vector<mdds::mtv::base_element_block*, std::allocator<mdds::mtv::base_element_block*> > >, std::__debug::vector<mdds::mtv::base_element_block*, std::allocator<mdds::mtv::base_element_block*> > >::~_Safe_iterator() (this=0x7f703daa9f18) at /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/debug/safe_iterator.h:86
> #7  0x00007f7048d5d6cd in mdds::mtv::soa::detail::iterator_updater<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::const_iterator_trait>::grouped_iterator_type::~grouped_iterator_type() (this=0x7f703daa9ec8) at workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/./iterator.hpp:74
> #8  0x00007f7048d5d69d in mdds::mtv::soa::detail::iterator_updater<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::const_iterator_trait>::~iterator_updater() (this=0x7f703daa9e98) at workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/./iterator.hpp:55
> #9  0x00007f7048d5d665 in mdds::mtv::soa::detail::const_iterator_base<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::const_iterator_trait, mdds::mtv::soa::detail::iterator_base<mdds::mtv::soa::multi_type_vector<sc::CellStoreTraits>::iterator_trait> >::~const_iterator_base() (this=0x7f703daa9e98) at workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/./iterator.hpp:309
> #10 0x00007f704900b9bd in ScValueIterator::GetThis(double&, FormulaError&) (this=0x7f703daaa078, rValue=@0x7f703daaa1f8: -18.819375178914722, rErr=@0x7f703daaa1f6: NONE) at sc/source/core/data/dociter.cxx:141
> #11 0x00007f704900c652 in ScValueIterator::GetNext(double&, FormulaError&) (this=0x7f703daaa078, rValue=@0x7f703daaa1f8: -18.819375178914722, rErr=@0x7f703daaa1f6: NONE) at sc/source/core/data/dociter.cxx:297
> #12 0x00007f70496c3619 in ScInterpreter::ScXor() (this=0x48b93a0) at sc/source/core/tool/interpr1.cxx:1525

with three of them apparently waiting in pthread_mutex_lock but one in
pthread_mutex_unlock (and thus presumably making progress).  It looks like with
a debug-mode libstdc++ these worker threads can easily compete for these
listdc++-internal debug-mode mutices.  And execution of --enable-dbgutil
CppunitTest_sc_opencl_test on my Linux laptop under load easily took 35 minutes,
so it looks plausible that that unit test was just too big.

While splitting it in two (arbitrarily taking the first and second half of the
CPPUNIT_TEST list), use the opportunity to drop the redundant "_test" from the
two new target names CppunitTest_sc_opencl-1 and CppunitTest_sc_opencl-2.

Change-Id: I9b8f148db667ff9bbf1aacdcaf150e5cb9b8ae87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146252
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-01-27 14:28:34 +00:00
Xisco Fauli d8138eaa39 tdf#95306: move UItest to CppUnittest
Change-Id: Ic999c9d10d9a3ae16de0df70b435a5d822035193
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145471
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-01-13 15:37:01 +00:00
Xisco Fauli 077931c77e sc: split CppunitTest_sc_sparkline_test into two
rename SparklineTest.cxx to ucalc_sparkline.cxx
for a follow-up refactoring

Change-Id: I2a8aeec5ffbd994c27102461a71cf0c0ec13dfed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142911
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-18 18:51:48 +01:00
Xisco Fauli 5cc9ab736a sc: rename these tests to ucalc_*
All inherit from the same class, just to be consistent.
this is part of a follow-up refactoring

Change-Id: I9f69ae16c9363996a95a684183d6c0e981594405
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142907
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-18 18:51:33 +01:00