When a chart shows a data table, it is drawn as a strip at the bottom of
the diagram, so the plot-area-plus-axes rectangle grows to include it. The
vertical axis title was centered on that rectangle and thus ended up shifted
downwards compared to MS Office, which centers it on the plot area alone.
Center the left- and right-aligned axis titles on the plot area rectangle
(which already excludes the data table) instead of on the plot area plus
axes, so the title stays centered on the axis.
Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: If21ba0938cea16abc382e686b9c4e2b84caf2dca
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6978
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 48953636f24d522426d5f5e4ed9f0fc5ec6f30f5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208241
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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>
Add model properties for optional underflow and overflow bins on
histogram chart types, and expose them through the HistogramDiagram
wrapper.
Pass the new settings through the existing histogram pipeline:
HistogramChartType snapshots the properties, HistogramDataSequence keeps
that snapshot, and HistogramCalculator creates optional edge bins around
the normal bin range.
Generated category labels now distinguish special bins from normal ranges,
e.g. "<= 11", "(11-13]", and "> 14".
Add a model-level test that sets fixed bin width together with underflow
and overflow bins, then verifies that the generated bin labels are rebuilt
correctly.
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Change-Id: I65eac9607daa4f4be6320304c9e9682549f479a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207151
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
HistogramDataSequence snapshots the histogram binning
settings when the calculated-y and category sequences
are created. Rebuild those sequences when BinWidth,
BinCount, or FrequencyType changes, so fixed-bin settings
take effect immediately.
For XLSX import, use the regenerated histogram series
categories as the X axis categories. Keeping the existing
axis categories can preserve stale bin labels, e.g. after
reloading a chart exported with cx:binCount.
Extend the histogram roundtrip test to verify that fixed
bin count creates the expected bin labels after ODF
and XLSX reload.
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Change-Id: I718bbfe537d847de6c17ea7742a9c4d231b57b7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207007
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
The ODF chart export (SchXMLExport::exportTable) and import
(SchXMLTableContext) both read/write "DisableDataTableDialog" on the
chart document, but the wrapper only exposed the inverse
"EnableDataTableDialog". Every access fell through to the
"found no inner property set to map to" warning in WrappedPropertySet
and the table-protected state was silently dropped.
Register "DisableDataTableDialog" as a WrappedIgnoreProperty, matching
the existing treatment of EnableDataTableDialog. Behavior is unchanged
(the flag was already being discarded) but the spurious warnings on
chart save are gone.
Change-Id: I93be0d19872ebbe68994dd88a190c4bf85ef5a78
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1449
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 27ccb0ce32081549f14f51166a4459a8828acd47)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207071
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
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: Ie8d0aad9bca3e990f78d4ffc006a04b0a8086fd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205935
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
These are not needed inside weld.hxx itself. Instead
add the required includes/forward-declarations to those
files actually needing them, instead of relying on the
now dropped ones.
Change-Id: I5e4cea030867d14057b2bdcc2a2a4cd98843651d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205906
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.
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 definition and implementation out of weld.hxx
and weldutils.cxx 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: I97768bf75dac492e32e1d387853d123481aa643a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205902
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>
Export histogram charts as chart:bar with coext:class="histogram"
and write histogram properties.
Import the histogram class and configuration again recreate the
HistogramChartType, and trigger the histogram template once chart
import is complete so calculated bins, categories, and frequencies
are rebuilt from the preserved raw values-y data.
Change-Id: I202d5666315d4f26da2bf4b3650b4388a9e4fb50
(cherry picked from commit 5fb2f5f2c2676743b823640dbaa02762308d6a54)
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1880
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
(cherry picked from commit a54fc185d3d73f765bd37cc98df92cac81e01572)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203814
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit introduces the mathematical backend and data interpreter for
the Histogram chart, replacing the temporary raw value rendering.
- Adds HistogramCalculator, utilizing Scott's Rule to calculate optimal
bin widths and frequencies from raw data.
- Introduces HistogramDataSequence that listens to spreadsheet data
changes and automatically regenerates bin categories and frequencies
- Implements HistogramDataInterpreter to intercept raw values-y input,
and output the results into the calculated-y data sequence.
Change-Id: Iaf29ddd0b0824bd3f0808ffc91321cad9d5b877e
(cherry picked from commit 1ef619a998aba626d0ea7a9541109a7c9e145518)
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1879
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit df68284255ccac4bd86583555986d9f7cbdddf9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203747
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit introduces the structural foundation and user interface for
the new Histogram chart type. The rendering engine gracefully falls
back to plotting the raw values-y input data directly. As a result, the
chart currently renders identically to a standard bar/column chart.
- Adds UI entries in the Chart Type dialog.
- Adds HistogramChart to the view layer, inheriting from BarChart and
forcing a 0-gap width.
Change-Id: Ica5b15e9b7428d6c908e1b978259367fe8ff7aab
(cherry picked from commit 14a4a09b62fc283f9b629a2a317156efa6509054)
Signed-off-by: Devansh Varshney <varshney.devansh614@gmail.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1878
Reviewed-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 508c3456e85a88771ac5e264cee9460274685a22)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203741
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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: I0cc1e0f3aa60d3457af0f0f30ec8fe74cb5ce6a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205489
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.
Change-Id: Ia7bc570fcd463d9adcbcdad070250cec5bc3b949
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205488
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.
Change-Id: I2e42a2992c08311922451bb01062683bd81954fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205486
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.
Change-Id: I2eb564b2483b052f01d4af55fd4feb00b5ed6031
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205472
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: If7cb4403f1861c465f44a1cae4065b0bf8dfad48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205323
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
crash on saving forum-mso-en4-640039.xlsx (round-trip)
soffice.bin: engine/tools/source/datetime/ttime.cxx:224:
static void tools::Time::GetClock(...): Assertion `fSeconds < 1.0' failed.
#4 tools::Time::GetClock (fTimeInDays=nan(0x8000000000000), ...)
at engine/tools/source/datetime/ttime.cxx:224
#5 SvNumberformat::ImpGetTimeOutput at engine/svl/source/numbers/zformat.cxx:3161
... SvNumberFormatter::GetOutputString
#9 chart::NumberFormatterWrapper::getFormattedString
at engine/chart2/source/tools/NumberFormatterWrapper.cxx:130
#10 chart::VSeriesPlotter::getLabelTextForValue (fValue=nan)
at engine/chart2/source/view/charttypes/VSeriesPlotter.cxx:371
#11 chart::DataTableView::initializeValues
at engine/chart2/source/view/main/DataTableView.cxx:574
The chart's data series carries a NaN at this point (missing data /
formula error). DataTableView::initializeValues iterates every point
unconditionally and feeds the value to the number formatter, if the
point's number format is a date/time/datetime format then that NaN
triggers an assert in Time::GetClock.
The other getLabelTextForValue callers filter missing data earlier, so
skip non-finite values at the data-table-view source.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I99327e590133f3ba52fc6db9bfc153df620b87dd
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2059
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 2054a2128fff8028951669aad1f743bc6cff1e83)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204951
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Since 51ea035a6f "tdf#151876 speedup editing large
chart", PerXMinMaxCalculator::getTotalRange and PerXMinMaxCalculator::setValue
used std::numeric_limits<double>::min() to initialize maximum accumulators. But
which yields the smallest positive normal value (~2.2e-308), not the most
negative value that is apparently asked for here: When all Y values in a chart
are zero, the accumulated max (0.0) never exceeded that initial sentinel, so the
Y axis maximum stayed at ~2.2e-308. This near-zero range then caused division
to produce infinity in the coordinate transformation matrix
(FIXED_SIZE_FOR_3D_CHART_VOLUME / 2.2e-308), and the subsequent 0 * inf
multiplication produced NaN. Which happened to trigger UBSan
float-cast-overflow now in a recently introduced test, where
sc/qa/unit/data/ods/fdo67682-2.ods contains a chart with all-zero Y values on a
date axis (see the comment at
<https://gerrit.libreoffice.org/c/core/+/202711/2#message-c97f2d62213a38df4ed8a5610ae6a699a902af3b>
"XLSX: merge standalone locale prefix with currency bracket" for details).
Change-Id: I3042f589e7aed08fec17588045572fa7abe4b98e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203038
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit db3a1e9323cd8f81d9296835d2d139232bc3c150)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204961
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Many callers pass the result of Chart2ModelContact::getDocumentModel()
which resolves a WeakReference<ChartModel> and can return null if the
model has been destroyed. Add null checks matching the existing pattern
in ControllerLockHelper::lockControllers/unlockControllers.
The crash was caused by a race condition where the ChartModel weak
reference (held in Chart2ModelContact) had expired by the time the
chart wrapper code tried to lock controllers during a Copy operation.
The fix gracefully handles the null case instead of dereferencing
a null pointer.
Change-Id: I43294de12b84cefb062ada12e8a570ad3b7ea571
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200268
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit e819e77fe79e8eb48bb3e977fadaffa9e99786f2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204885
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Replace index-only loops where we copy from containers into UNO or
diagram structures using an explicit sequence index / output pointer:
- BasicColorConfig: vector of property keys into Sequence OUString.
- ChartColorScheme: palette colors into uno color sequence buffer.
- RangeHighlighter: HighlightedRange list from OUString vectors.
Verified: make -j4 basctl chart2
Change-Id: If4a4a8747fadc772329d3ccc3f03778406b140ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204659
Tested-by: Jenkins
Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
The crash occurs in getCurrentTemplate() when xTemplateManager is null
and xTemplateManager->createTemplate() dereferences it at address 0x40
(the offset of m_xContext within the ChartTypeManager object).
The ChartTypeManager can be null in two scenarios:
1. The ChartModel copy constructor has never initialized
m_xChartTypeManager - even before commit aa06241b9c (2022,
"use more concrete types in chart2, ChartTypeManager"), the old
CreateRefClone returned null because ChartTypeManager does not
implement XCloneable.
2. More importantly for this crash: the ChartModel may have been
disposed (which clears m_xChartTypeManager) while the chart type
wizard dialog is still active. In the LOK/COOL async dialog
environment, rapid InsertObjectChart commands can race, disposing
the first chart's model while its wizard still holds a reference.
Add a null guard on xTemplateManager before dereferencing. The caller
commitToModel() already handles a null return from getCurrentTemplate()
via its if(!xTemplate.is()) return check.
Change-Id: I3f8e8e91a4d77c12a3c05a5e09b12a4a9e028f65
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/942
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1444
Reviewed-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 77f8b95d0af914f54a42206e567a50f09bee0f67)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204806
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
getFirstDiagram() unconditionally dereferences getChartModel()
without checking for null. In a multi-view LOKit scenario, the chart
model can be detached while an async dialog (e.g. InsertRemoveAxes)
is open. When the dialog callback fires, getChartModel() returns null
and the subsequent ->getFirstChartDiagram() dereferences it,
crashing at offset 0x280.
Add a null check for the model before dereferencing.
Change-Id: Iabd7efd1d752c28cdcc9182669797b863a7a5306
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200726
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 5322a8522224ef4432754e9004ed64257794883a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204807
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>