Commit Graph
7954 Commits
Author SHA1 Message Date
Noel Grandin 5ec7c4eecf fix comparison of UIObject's inside UITests
using == to compare them doesnt work, because we return
a new one with every call to getTopFocusWindow and similar.
So add a equals() method to the UNO interface to do the comparison.

Change-Id: Ie909fe9b4e84fe07f4ca87bbebf65b56d3da8f78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165436
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28 17:17:32 +01:00
Noel Grandin afd6bd25ec convert UncachedDataSequence to comphelper::WeakComponentImplHelper
Change-Id: Ib7facb9050bc71d15e23cb54c3ef22199c446da5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165361
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-27 10:51:18 +01:00
Noel Grandin ebe0f745e8 convert CachedDataSequence to comphelper::WeakComponentImplHelper
Change-Id: Ia95efee23b7cf76636d5d85c722cf5ce5989bb79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165360
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-27 10:09:33 +01:00
Rafał Dobrakowski 102622a07d tdf#146619 Remove unused #includes from C/C++ files
'chart2' module was cleaned.

Change-Id: Ib4cdb3c8a21d0ed47f4970894d416327df5e68a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164864
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-27 09:20:54 +01:00
Armin Le Grand (allotropia) d053413402 ITEM: Remove InvalidateAllItems()
I checked if this is used, but it can be replaced
using Clear() -> all. This prevents that the whole
array of Items in an ItemSet gets set to
INVALID_POOL_ITEM.

I also checked if INVALID_POOL_ITEM/IsInvalidItem
is needed at all representing SfxItemState::DONTCARE
but it is and still will need to be set for individual
Items.

At last checked if SfxItemState::UNKNOWN and
::DISABLED really need to be separate states, but
indeed there are some rare cases that need that.

To make things more consistent I also renamed
SfxItemState::DONTCARE to SfxItemState::INVALID
to better match Set/IsInvalid calls at ItemSet.

The build showed a missing UT and led to a problem
due to the hand-made ItemSet-like SearchAttrItemList.
The state 'invalid' seems to be used as 'unused'
marker. It should be changed to use SfxPoolItemHolder
and not need that. For now, set by using an own loop
to set to that state.

Change-Id: Ifc51aad60570569a1e37d3084a5e307eed47d06c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165035
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-03-21 21:39:57 +01:00
Kurt Nordback 9ae8e74fb3 tdf#50934: Add a pie-with-remainder-as-another-pie chart type
Implement ODF import/export for bar-of-pie and pie-of-pie types,
and add simple tests for this capability. The associated ODF tags
are implemented in the loext namespace. This also required changing
the schema.

Change-Id: Ib55ae1c5818ad810f7b962d807a9163a3d02ba17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164436
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-18 07:07:24 +01:00
Julien Nabet 9661b094e1 tdf#160225, related tdf#92768: hide axis title not taken into account when...
duplicating sheet or when saving a file and reopen it.

When creating a title for an axis, "createTitle" is called.
Before tdf#92768 "support hiding title objects", when unchecking "axis title" in sidebar,
the title was removed (via "removeTitle")
But since tdf#92768, "hideTitle" is called instead.

The pb is "Visible" attribute wasn't registered in StaticTitleWrapperPropertyArray.
So when duplicating sheet after having created a title and hidden it,
when duplicating sheet, the new sheet had the title visible.
In the same way if, after having created a title and hidden it,
you save the file and reopen it, the title is displayed.

Change-Id: I980505ec02906e673dd60a60e4d9837928bf8876
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164938
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-03-17 11:14:23 +01:00
Kurt Nordback 46e96625e9 tdf#96944: Stacked column chart does not show connection lines
Change-Id: I14727e8a55231b6695c5a59dd495cd03b15d69f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161626
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-03-11 14:56:28 +01:00
Sujatro Bhadra ddd5017410 tdf#158237 Use C++20 contains() instead of find() and end()
Change-Id: I93e873bd2396c1b95f120ee11478c0cd3a309c5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164580
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
2024-03-09 12:27:57 +01:00
Caolán McNamara 218e4641c4 cid#1592990 COPY_INSTEAD_OF_MOVE
and

cid#1592991 COPY_INSTEAD_OF_MOVE

Change-Id: Ia1de5f671947ad79614a727aa70408431843b90e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164564
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-08 14:50:12 +01:00
Andrea Gelmini 0d9621aa03 Fix typo
Change-Id: Ib13d78cc78f1e5cee0542ea2cc81135723240b9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164567
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-03-08 11:45:04 +01:00
Balazs Varga 40a19e61ef tdf#159456 - chart view: fix wrongly shifted value Y axis
We only have to shift the category axis only, and not the
value axis, if we have a chart data table.

Change-Id: Ie77ea829e8f8987702dce7d17cb3e20054f3d8cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164539
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-03-08 09:42:42 +01:00
Balazs Varga f4ba83e82a tdf#159422 - chart view: fix symbols position of data table legend
Calculate the correct/optimal row height after calculating and set
correct width of a table cell. Then we will have the correct row height
for the symbol positions.

Change-Id: I65bc0f0579ea100906b0b32449c2200a54c2a353
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164512
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-03-08 09:41:15 +01:00
Balazs Varga f856733ed1 tdf#159443 - chart view: fix Data table is not rendered below chart
If we have 1 dataseries we will have no tickmarks, in that case the
distance between two tickmarks is the width of the chart.

Change-Id: Ifea11329f1dcb80e8e390c1408306d1df7d49ded
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164471
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-03-08 09:40:14 +01:00
Mike Kaganski 0c35808288 tdf#153706: do not add categories, when source data doesn't have them
lcl_AllOperator is used in XChartDocument::attachData implementation.
When a data without existing categories is passed there, like an XY
scatter, lcl_AllOperator used to force creation of the categories in
the target, by returning 'true' unconditionally from setsCategories.
This meant, that a new sequence of numbers starting from 1 was used
as X values, and the old X data was interpreted as an extra Y series.

This changes lcl_AllOperator::setsCategories to try to check if its
data actually contains categories. Thus, XChartDocument::attachData
will use categories either when the chart already uses categories,
and ChartDataWrapper::applyData detects that using a call to
DataSourceHelper::detectRangeSegmentation; or when the new data has
it; but not when neither had it. When it's not possible to detect if
there were categories in the new data (e.g., with user data), old
behavior is used, setting categories.

It could be an alternative to detect the chart type using
xOldDoc->getDiagram()->getDiagramType() == "com.sun.star.chart.XYDiagram"
in XChartDocument::attachData; and then decide to force the creation
or not. But it seems hackish, and not really universal: other chart
types must be tested (bubble?), no idea how to handle hypothetical
cases when applied data contains categories in case of XY chart, etc.

Change-Id: I86b34f6799c30b103f7fc6b2faf6ec255a9d137b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164298
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-03 17:22:08 +01:00
codewithvk 8c3fa629f4 Make Chart Object Properties Dialogs Async
How to reproduce it:
When double-clicking on a chart, it will now open the Chart Object Properties dialog box.

Previously synchronous, this commit updates it to be asynchronous.

Signed-off-by: codewithvk <vivek.javiya@collabora.com>
Change-Id: I54c24e0cd30d6ec8b2bfa93567e830405d2fd30c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162576
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 748a5a01165d40e9bcaa7bfc75b0e6f74fc5a07d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164125
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-03 14:52:38 +01:00
Caolán McNamara 217d918491 Resolves: tdf#159879 Crash when closing "3D View" dialog
Change-Id: I9c116007afe9cea97b597933ad8483dce25c3707
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164295
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-03 14:49:35 +01:00
Caolán McNamara 4edcd840ae set default if no ViewShell yet
Change-Id: Ib6381ec963a9dc641d880eef1f9a3e556100a98e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164142
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-01 10:39:06 +01:00
Caolán McNamara 0956dda717 cid#1169880 Uninitialized scalar field
Change-Id: I0ac1cc740f8d559cf8fa7b69947b6f152eae807a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164138
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-29 15:07:18 +01:00
Caolán McNamara edc45294fd cid#1592375 COPY_INSTEAD_OF_MOVE
Change-Id: I9d110911504832d7a8a6725ca3f9040a4fd0c4c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164010
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-27 12:56:19 +01:00
Caolán McNamara 4052ce767a crashtesting: isNaN as fUnitCircleWidthAngleDegree
presumably since recent tdf#50934 work

affect files are:

forums/xlsx/forum-mso-en4-295952.xlsx
forums/xlsx/forum-mso-en4-523214.xlsx
forums/xlsx/forum-mso-en4-656086.xlsx
forums/xlsx/forum-mso-en4-702681.xlsx

Change-Id: Ifc436d382f9cda13d2ae4459d436a72c5e40d8aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163784
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-23 10:36:45 +01:00
AkshayWarrier 8cd4cd31e9 tdf#157882 svx: Remove cap/corner styles and move arrowhead control to new row
Change-Id: Ifa38ec7ba9969627ff26abe22c58d06ec373ecb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162403
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2024-02-20 20:54:17 +01:00
Kurt Nordback 96e9c3a7fd tdf#50934: Fix compiler complaints and activate OOXML I/O tests
Add tests for input and output of very basic pie-of-pie and bar-of-pie
charts in OOXML.

Change-Id: I6441d99941ea2aca9bf58ede40dbe8f3d38a3291
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160742
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-19 20:34:18 +01:00
Armin Le Grand (allotropia) 9bd2012df7 ITEM: Speedup SlotIDToWhichID translations
With ItemInfoPackages we now can have a buffered, static
global translation table from SlotIDs to WhichIDs since
the ItemInfoStatic used already contains all the needed
information.
Register that in registerItemInfoPackage at the Pool and
use it for lookup. That speeds up the lookup from O(n)
to O(1). Since that lookup is used in UI and UNO API
implementations this has positive effect on load/safe,
but also all interactive stuff in the whole office.

NOTE: I tried to use a merged version of that translation
table in the parent pool, but this shows double SlotIDs,
what is no wonder since that's what those are used for:
To get different WhichIDs for a SlotID in Item handling.
This *might* prevent getting rid of the chanined Pools
at all - sadly. The returned WhichID directly depends
on which Pool the function(s) GetWhichIDFromSlotID and
GetTrueWhichIDFromSlotID are called.

NOTE: Very strange is that the parameter 'bDeep' in that
functions is *not* passed down to the call to the
secondary Pool - probably an error, but risky to fix,
that may change already the behaviour :-(

Change-Id: Iea77ffad0f6a5401ab74fea0bbfc2589c66680ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163597
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-02-19 20:04:34 +01:00
Kurt Nordback cf2715782d tdf#50934: Fix color of composite wedge for imported of-pie charts
Change-Id: I5236ed53e418e31a470a66bdbe21eceaa5f6fc04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160739
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-19 12:19:33 +01:00
Kurt Nordback 67e58d16f2 tdf#50934: Fix left of-pie ordering for imported charts
Change-Id: I490d6719f5190b0e889bd274ffa9c1b196e656d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160738
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-19 09:19:21 +01:00
Kurt Nordback dfacc5a522 tdf#50934: Try to fix wedge ordering for imported of-pie charts
Change-Id: I6e9a0d5426fb213c99ee99092596f68d688b928c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160736
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-19 07:57:44 +01:00
Kurt Nordback 1cda27cf69 tdf#50934: OfPie inport from OOXML, plus initial work for export
Change-Id: Ie17b583af28d274b3e7817c646dd4f5873e03fef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160733
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-19 01:29:36 +01:00
Kurt Nordback 1036994301 tdf#50934: Add a comment
Change-Id: I3986242fa584310acccba4830d8872043381cef6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160732
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-18 10:10:39 +01:00
Kurt Nordback e1573deaf1 tdf#50934: Implement connector lines for pie-of-pie
Change-Id: Ifca083aa07b28d5c604382decaefedfe653ff8ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160731
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-18 07:33:18 +01:00
Kurt Nordback 5d0093e8c3 tdf#50934: Improvements to fill color for of-pie composite wedge
Change-Id: Ib9f7e3b135bb86e1817edf97b963e3620af7fdf2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160730
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-17 18:00:49 +01:00
Kurt Nordback 4df39957bd tdf#50934: Ensure of-pie connector lines are black
Change-Id: I0548b395455eb17ec06f85ffce63affa15075391
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160729
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-17 07:08:20 +01:00
Kurt Nordback 756f8c850a tdf#50934: Initial implementation of connector lines for bar-of-pie
Change-Id: I586dd5ae784f5e86ad1e0d863765b058873eac68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160728
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-17 07:07:39 +01:00
Kurt Nordback 853736f0d5 tdf#50934: Fix of-pie subchart colors
Change-Id: I43e0118786853b0258741e5181f7e622c6f747ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160727
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-17 07:06:56 +01:00
codewithvk 4965b055b5 Chart: Make Data Range Dialog Async
To reproduce the step, double-click on the chart and right-click to open the context menu, where you can see the option for data ranges.

Signed-off-by: codewithvk <vivek.javiya@collabora.com>
Change-Id: I0697d5918d35d132aa7c17f86204742017f7ff17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163358
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit afbb4e44478e520b866032df8f0a0a344568233e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163402
Tested-by: Jenkins
2024-02-16 12:08:55 +01:00
Kevin Suo 90d22daf99 tdf#142467: restore "final" in CandleStickChartType class
The "final" was removed in commit
e06f2bb00137655dbf6f0a8c8c2fc555720f4d3f (tdf#142467 crash on calling
'getInfoHelper' in final class, 2021-05-26)
and commit
6cb1745c24 (tdf#142467: Update comments
with GCC bug ID, 2021-05-31)
due to a bug in gcc <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100797>.

Now it has been amost 3 years past and that gcc bug has long been fixed,
so it is time to restore the "final".

Change-Id: I7db9fe59209cfbae4c04bb3a91cd764db9a38d98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163447
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-16 10:11:29 +01:00
Kurt Nordback e9658eaa17 tdf#50934: Implementation of bar-of-pie, plus minor of-pie fixes
Change-Id: Ib343953ee30124524884859c8fe9e88d2dc7d822
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160726
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-16 09:18:35 +01:00
Kurt Nordback 63562694be tdf#50934: Implement PieDataSrc and related structure
Change-Id: I6affb326600d77ddf756d9bc223e7dcc29f87d23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160725
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-16 08:07:12 +01:00
Kurt Nordback 8da681e5ef tdf#50934: Some rejiggering of of-pie code, plus implementing subpie chart
Change-Id: I91fca31db0eb0bfb673e77f1369abe110fe405b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160724
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-15 20:26:24 +01:00
Kurt Nordback d81c98623b tdf#50934: Restructuring for of-pie charts
Change-Id: I9682c314efb888d57e94f82f084cc6d0825a4408
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160723
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-14 07:58:41 +01:00
Noel Grandin 033aaeec9e use more UNLESS_MERGELIBS
Change-Id: I351a9127fb26369d8f598b6d6519d7e490fa476b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163190
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-12 20:25:54 +01:00
Armin Le Grand (allotropia) ca3c6d468f ITEM: ItemPool Rework (I)
Driving forward the Item reworks I now take the
ItemPool in focus: It now does not hold any items
anymore and should be renamed to something like
ItemInfoProvider/ItemHelper, since it's main purpose
is to provide the Defaults for the Item functionality.

There is that SfxItemInfo, only a struct and bundling
SlotID and ItemFlags. There are also the DefaultItems,
just handled as ptrs in an array. It is/was always
error-prone to keep these in sync. Remember that it's
also necessary for the order to not only being sorted
but being increments of one with no gaps allowed in
the WhichIDs to which the Items are bound.

I now bundled that to a new class ItemInfo that joins
WhichID, SlotID, ItemFlags and the default Item. This
is a pure virtual base class, it comes in three
derivations:

(1) ItemInfoStatic:
This is supposed to be global static and hosts the
Item in a std::unique_ptr to ensure cleanup. It is
designed to be constructed once during runtime and
being shared globally. It allows the ItemPtr to be
nullptr to mark as non-static (if initial static is
not possible for some reason) but still offers the
needed data. Most cases (95%+) are of that case.
The contained Item is owned by that instance. The
flag isStaticDefault() is set at the Item.

(2) ItemInfoDynamic:
This is supposed to be used for cases where the Item
cannot be static: Mainly for SfxSetItem (that needs
a Pool itself in the contained SfxItemSet, so lifetime
is bound to that Pool), but other cases showed up in
the transition. These instances live while the Pool
lives and get destructed when the Pool goes down.
Also uses std::unique_ptr for the Item instance for
as much automated cleanup as possible, the contained
Item is owned by that instance, the instance by the
Pool. The flag isDynamicDefault() is set at the Item.

(3) ItemInfoUser:
This is used for UserDefaults that can be set for
every ItemInfo entry to 'overshadow' the default
from the 'outside'. It uses a regular Item and
the central access methods implCreateItemEntry/
implCleanupItemEntry to manage the Item instance,
thus works like a SfxPoolItemHolder. The Item
instance can be globally shared and re-used even
when the Pool goes down. Instances belong to the
Pool and are cleaned up when the Pool goes down.
This Item does not need any further flag to be
set.

The ItemInfos are organized using a class
called ItemInfoPackage:

This bundles groups of ItemInfoStatic to
functional instances. There are derivations/
implementations of this e.g. for Writer ItemPool
bundling all the needed defaults for Writer,
similar for draw/impress, Calc and other usages.

These ItemInfoPackage can be 'registered' at an
ItemPool using it's method registerItemInfoPackage.
This does all the needed stuff to setup that
group of ItemInfos at the Pool (It even sets
internal vars First/LastWhich, that info can just
be derived from the buildup ItemInfo Ptrs).

The ItemInfoPackage has methods 'size()' and
'getItemInfo(index) to allow looping over it
and deliver the infos the Pool needs. The
(forced, pure virtual) overloads of getItemInfo
in the specific implementations check for the
ItemPtr being nullptr and create a exclusive
incarnation of ItemInfoDynamic for the Pool if
needed, returning that. The Pool owns the
ItemInfoDynamic incarnations and uses the
ItemInfoStatic directly. On shutdown it cleans
up the ItemInfoDynamic as needed.

The ItemInfoUser is used by the Pool when a
UserDefault is set/used: for SetUserDefaultItem,
GetUserDefaultItem, ResetUserDefaultItem. It
is not held in a 2nd list, but directly in the
list of ItemInfo'ptrs: To keep track of this
an unordered_map is used that helds the original
ItemInfo associated with the WhichID. That way
no two lookups (as before) are needed to get the
current Pool's default for any WhichID.

The derivations of ItemInfoPackage are
encapsulated and just allow access to an
ItemInfoPackage& with a single method as
return value. All use a static local instance
of a std::array<ItemInfoStatic, FIXED_SIZE>
which constructs all ItemInfoStatic and the
static Item instances - if already possible.
Sometimes it is necessary to overload the
constructor to set some static instances
for Items later than the lib init. These are
also just marked with nullptr as Item instance.
Some need to overload getItemInfo to complete
instances of ItemInfoStatic, if needed, or
create and deliver instances of ItemInfoDynamic.

The registerItemInfoPackage also offers a
optional lambda callback: there were two cases
where local data from the Pool was needed to
incarnate the item - just add that to the
call to registerItemInfoPackage if needed,
see examples in the adapted code.

For the re-use of Items this means that now
in SfxItemSet/SfxPoolItemHolder *true* static
Items can and will be used without RefCount
directly and globally. This is also the case
for dynamic Items, with the exception of
differing Pools for SfxSetItems which cannot
be done.

Future:
That design is already prepared to allow
solving that Pool-chaining problem: currently
there are master/sub-pools and all accesses
have to traverse that structure before even
doing anything.
For the future the idea is more to 'compose'
a Pool by registering ItemInfoPackages, e.g.
for Writer pool you may start with SfxItemPool,
register the writer-specific ItemInfoPackage,
then the one for DrawingLayer (if needed) and
the one for EditEngine.
It should also be possible to get to smaller
granularities of that packages. Ideas for
new ones will emerge. We might also think
about composing Pools which can e.g. run Writer
and Chart, so allowing to use Chart *without*
OLE stuff in Writer - just ideas...

More changes:
- Adapted all stuff, cleaned up old stuff/
  definitions
- Removed FreezeIdRanges, that can be done
  once per Pool on-demand (and cannot be
  forgotten to be called)
- Merged XOutdevItemPool with SdrItemPool
  and offered a ItemInfoPackage which joins
  both needed sets of Items
- All the cleanup hassle with Pools and
  defaults cleaned up
- Adapted all access methods of the pool
  to use that new stuff. Pool chaining
  currently stays, but I use a central
  method 'getTargetPool' instead of
  recursive calling to get the correct
  Pool for the action

Change-Id: I2b8d3d4c3cc80b1d0d0b3c0f4bd90d7656b4bab7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163157
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-02-12 10:35:33 +01:00
Caolán McNamara 108edd58e8 cid#1591760 COPY_INSTEAD_OF_MOVE
and

cid#1591761 COPY_INSTEAD_OF_MOVE
cid#1591763 COPY_INSTEAD_OF_MOVE
cid#1591768 COPY_INSTEAD_OF_MOVE
cid#1591769 COPY_INSTEAD_OF_MOVE

Change-Id: Ia1c829f96148dc79cea02a69b3442c18d51e1288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163162
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-09 14:54:36 +01:00
Kurt Nordback 800b767f13 tdf#50934: Ensure BarOfPie has ScaleData::ShiftedCategoryPosition == false
Change-Id: I86c7ba4df89a1350f544345938a29c210903c06d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160722
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-09 11:03:22 +01:00
Stephan Bergmann 648878703d double operator < is not a strict weak ordering due to NaN
...so recent LLVM 19 trunk libc++ in debug mode complained during
CppunitTest_chart2_export3 about

> ~/llvm/inst/bin/../include/c++/v1/__debug_utils/strict_weak_ordering_check.h:59: assertion __comp(*(__first + __a), *(__first + __b)) failed: Your comparator is not a valid strict-weak ordering

at

> 5   libsystem_c.dylib                   0x0000000183279a40 abort + 180
> 6   libc++.1.0.dylib                    0x0000000101045d98 _ZNSt3__123__cxx_atomic_notify_oneEPVKv + 0
> 7   libchartcorelo.dylib                0x00000002f9e05990 _ZNSt3__135__check_strict_weak_ordering_sortedB8de190000IPdNS_6__lessIvvEEEEvT_S4_RT0_ + 732
> 8   libchartcorelo.dylib                0x00000002f9e055ac _ZNSt3__111__sort_implB8de190000INS_17_ClassicAlgPolicyENS_11__wrap_iterIPdEENS_6__lessIvvEEEEvT0_S7_RT1_ + 172
> 9   libchartcorelo.dylib                0x00000002f9e054d4 _ZNSt3__14sortB8de190000INS_11__wrap_iterIPdEENS_6__lessIvvEEEEvT_S6_T0_ + 68
> 10  libchartcorelo.dylib                0x00000002f9e04f94 _ZNSt3__14sortB8de190000INS_11__wrap_iterIPdEEEEvT_S4_ + 64
> 11  libchartcorelo.dylib                0x00000002f9dfea10 _ZN5chartL22lcl_fillDateCategoriesERKN3com3sun4star3uno9ReferenceINS2_6chart24data13XDataSequenceEEERNSt3__16vectorIdNSB_9allocatorIdEEEEbRNS_10ChartModelE + 1404
> 12  libchartcorelo.dylib                0x00000002f9dfe28c _ZN5chart26ExplicitCategoriesProvider4initEv + 280
> 13  libchartcorelo.dylib                0x00000002f9dff0b8 _ZN5chart26ExplicitCategoriesProvider10isDateAxisEv + 28
> 14  libchartcorelo.dylib                0x00000002f9bcb738 _ZN5chart14VSeriesPlotter9addSeriesENSt3__110unique_ptrINS_11VDataSeriesENS1_14default_deleteIS3_EEEEiii + 200
> 15  libchartcorelo.dylib                0x00000002f9b951e4 _ZN5chart8BarChart9addSeriesENSt3__110unique_ptrINS_11VDataSeriesENS1_14default_deleteIS3_EEEEiii + 280

Change-Id: Ie0711ca60130759f3daaf8332ab326fa29cb5cba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163074
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-07 21:03:54 +01:00
Stephan Bergmann 56e6d683db double operator < is not a strict weak ordering due to NaN
...so recent LLVM 19 trunk libc++ in debug mode complained during
CppunitTest_chart2_export2 about

> ~/llvm/inst/bin/../include/c++/v1/__debug_utils/strict_weak_ordering_check.h:59: assertion __comp(*(__first + __a), *(__first + __b)) failed: Your comparator is not a valid strict-weak ordering

at

> 5   libsystem_c.dylib                   0x0000000183279a40 abort + 180
> 6   libc++.1.0.dylib                    0x00000001030f9d98 _ZNSt3__123__cxx_atomic_notify_oneEPVKv + 0
> 7   libchartcorelo.dylib                0x00000002f817f0ec _ZNSt3__135__check_strict_weak_ordering_sortedB8de190000INS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT_SB_RT0_ + 960
> 8   libchartcorelo.dylib                0x00000002f817e6cc _ZNSt3__118__stable_sort_implB8de190000INS_17_ClassicAlgPolicyENS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT0_SC_RT1_ + 268
> 9   libchartcorelo.dylib                0x00000002f8172a90 _ZNSt3__111stable_sortB8de190000INS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT_SB_T0_ + 68
> 10  libchartcorelo.dylib                0x00000002f8172820 _ZN5chart11VDataSeries15doSortByXValuesEv + 508
> 11  libchartcorelo.dylib                0x00000002f8064c44 _ZN5chart9AreaChart12createShapesEv + 1528
> 12  libchartcorelo.dylib                0x00000002f80f2ae0 _ZN5chart9ChartView28impl_createDiagramAndContentERKNS_18CreateShapeParam2DERKN3com3sun4star3awt4SizeE + 4440
> 13  libchartcorelo.dylib                0x00000002f80f77ac _ZN5chart9ChartView14createShapes2DERKN3com3sun4star3awt4SizeE + 2728
> 14  libchartcorelo.dylib                0x00000002f80f58ec _ZN5chart9ChartView12createShapesEv + 692
> 15  libchartcorelo.dylib                0x00000002f80f4598 _ZN5chart9ChartView15impl_updateViewEb + 288

But the introduced use of `std::strong_order(first[0], second[0]) < 0` then
triggered a false

> lo/core/chart2/source/view/main/VDataSeries.cxx:105:61: error: NullToMemberPointer ValueDependentIsNotNull ZeroLiteral -> nullptr [loplugin:nullptr]
>   105 |             return std::strong_order(first[0], second[0]) < 0;
>       |                                                             ^

so needed some hack in loplugin:nullptr.

And old versions of libc++, still used at least on Android, do not have any
implementations of std::strong_order.  So detect those cases in configure.ac
(checking for std::strong_order for double, which is what is actually being used
in the code) and fall back to operator <=> for now, even if that will not
provide a strict weak ordering and will thus continue to violate the
requirements of std::sort.

And then our venerable clang-format 5.0.0 would have broken the token `<=>` into
`<= >`, so exclude include/o3tl/compare.hxx from its mis-treatment.

Change-Id: I7a64a630eb5f560dce59f3ff9d51ca3d1adc70be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163075
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-07 21:03:46 +01:00
codewithvk b9a46c1ec2 Async Dialogs for Few Chart Properties
Updated the chart properties dialogs to work asynchronously. The changes affect the following dialogs:

Chart Type: Accessible by double-clicking on a chart to select it, then right-clicking to open the context menu. Selecting 'Chart type...' opens the dialog for modifying chart types.

Insert Axes: Triggered by double-clicking on a chart to select it, then right-clicking and choosing 'Insert/Delete Axes' from the context menu. This dialog allows users to add or remove chart axes.

Insert Titles: Opens when you double-click on a chart, right-click, and select 'Insert Titles...' from the context menu. It's used for adding titles to the chart and its axes.

Insert Trendline: For column charts, you can double-click on a column, right-click, and choose 'Insert trendline..' to open this dialog.

Insert Error Bars: In a column chart, after selecting a column, right-clicking and choosing 'Insert X Error Bars..' or 'Insert Y Error Bars..' opens the dialog for adding error bars to the chart.

Signed-off-by: codewithvk <vivek.javiya@collabora.com>
Change-Id: Id7bb8682150f2e3115420d9259c6afd41682641e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162655
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 71a3cfb71dddba8098d74d7bb1dd414e4696914b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162824
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-06 16:43:43 +01:00
Kurt Nordback 15633d637e tdf#50934: Add a version comment, and more structure for of-pie
Change-Id: I9d7c25e47a3f4a78360f9b2deffe8650e378866d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156305
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-06 15:16:31 +01:00
Caolán McNamara 32b814355b use ViewShell DOCCOLOR when available for charts
Change-Id: I200538bd94d60867d84b7dc37811094b65dd9aa5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162850
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-04 10:30:42 +01:00
Kurt Nordback 6c45285e86 tdf#50934: Initial plumbing and infrastructure
Change-Id: I355bdc8e6d67e7cdd47e4d6eccecedc4b53ac11b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155851
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-02 06:03:23 +01:00