summaryrefslogtreecommitdiff
path: root/chart2
AgeCommit message (Collapse)AuthorFilesLines
2024-01-03UnoApiTest::loadFromURL -> UnoApiTest::loadFromFileMike Kaganski11-344/+344
The old name was misleading (it doesn't take an URL, but a filename); also, now it's easier to grep for it - doesn't get mixed with vcl::graphic::loadFromURL. Change-Id: Ib88d2194200a6a54d2326971e0306ba39f0c7025 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161578 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-01Replace "size() == 0 with empty()" (chart2)Julien Nabet1-1/+1
Change-Id: Ia1e082d6cf6db2a3df2b5dd5fc8f13caee529fdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161465 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-01-01tdf#158237 chart2: use c++20 contains() instead of find() and end()Luv Sharma1-1/+1
Change-Id: I065f672de257e8a16a4cb9d41ff6334e5fea1823 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161492 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-12-22cid#1546500 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+1
and cid#1546492 COPY_INSTEAD_OF_MOVE cid#1546468 COPY_INSTEAD_OF_MOVE cid#1546431 COPY_INSTEAD_OF_MOVE cid#1546382 COPY_INSTEAD_OF_MOVE cid#1546350 COPY_INSTEAD_OF_MOVE cid#1546336 COPY_INSTEAD_OF_MOVE cid#1546314 COPY_INSTEAD_OF_MOVE cid#1546152 COPY_INSTEAD_OF_MOVE cid#1546094 COPY_INSTEAD_OF_MOVE cid#1546077 COPY_INSTEAD_OF_MOVE cid#1546047 COPY_INSTEAD_OF_MOVE cid#1545213 COPY_INSTEAD_OF_MOVE Change-Id: Ia51df9f9cbde755db4d2685e34f22676ed5eceff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161141 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-21crash when one user deletes a chart another has a property dialog open forCaolán McNamara1-9/+11
Insert a chart, user #1 select it, user #2 select it. User #1 double click it, double click again the legend to get dialog to edit it. User #2 delete chart, User #1 'ok' #0 0x00007f5365797d59 in osl::Mutex::acquire (this=<optimized out>) at include/osl/mutex.hxx:63 #1 osl::ClearableGuard<osl::Mutex>::ClearableGuard (t=..., this=0x7ffc7ffcccf0) at include/osl/mutex.hxx:182 #2 apphelper::LifeTimeGuard::LifeTimeGuard (rManager=..., this=0x7ffc7ffcccf0) at chart2/source/inc/LifeTime.hxx:175 #3 chart::ChartModel::lockControllers (this=0x0) at chart2/source/model/main/ChartModel.cxx:415 #4 0x00007f53658375ab in chart::ControllerLockGuardUNO::ControllerLockGuardUNO (this=this@entry=0x7ffc7ffcce80, xModel=...) at chart2/source/tools/ControllerLockGuard.cxx:34 #5 0x00007f5364df5f34 in chart::ChartController::executeDlg_ObjectProperties_withoutUndoGuard (this=<optimized out>, rObjectCID=..., bSuccessOnUnchanged=<optimized out>) at chart2/source/controller/main/ChartController_Properties.cxx:797 #6 0x00007f5364df7a5e in chart::ChartController::executeDlg_ObjectProperties (this=0x7f535401f310, rSelectedObjectCID=...) at chart2/source/controller/main/ChartController_Properties.cxx:707 #7 0x00007f5364e0f497 in chart::ChartController::execute_MouseButtonUp (this=<optimized out>, rMEvt=...) at chart2/source/controller/main/ChartController_Window.cxx:924 #8 0x00007f53760d61dc in (anonymous namespace)::LOKPostAsyncEvent (pEv=0x55e2f1b93db0) at sfx2/source/view/lokhelper.cxx:893 #9 0x00007f53760d0977 in LokChartHelper::postMouseEvent (this=<optimized out>, nType=1, nX=<optimized out>, nY=<optimized out>, nCount=2, nButtons=1, nModifier=0, fScaleX=0.083333333333333329, fScaleY=0.083333333333333329) at sfx2/source/view/lokcharthelper.cxx:294 just hold a reference to the chart the dialog operates on Change-Id: I3b05d1fc12e4df899c1a996f1029f9d3d62e87ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-17unique_ptr to optional in chart2Noel Grandin17-51/+55
Change-Id: I642f6f1fb7df9f0a7525155b22a99344a02d9cf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160839 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-17unique_ptr to optional in chart2Noel Grandin13-80/+72
Change-Id: I0cbf2e32030e5db772a9429997b7a078a4bfa2d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-16cid#1545970 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+1
and cid#1545957 COPY_INSTEAD_OF_MOVE cid#1545944 COPY_INSTEAD_OF_MOVE cid#1545939 COPY_INSTEAD_OF_MOVE cid#1545931 COPY_INSTEAD_OF_MOVE cid#1545926 COPY_INSTEAD_OF_MOVE cid#1545909 COPY_INSTEAD_OF_MOVE cid#1545899 COPY_INSTEAD_OF_MOVE cid#1545896 COPY_INSTEAD_OF_MOVE cid#1545894 COPY_INSTEAD_OF_MOVE cid#1545858 COPY_INSTEAD_OF_MOVE cid#1545823 COPY_INSTEAD_OF_MOVE cid#1545820 COPY_INSTEAD_OF_MOVE cid#1545819 COPY_INSTEAD_OF_MOVE cid#1545772 COPY_INSTEAD_OF_MOVE cid#1545749 COPY_INSTEAD_OF_MOVE cid#1545743 COPY_INSTEAD_OF_MOVE cid#1545739 COPY_INSTEAD_OF_MOVE cid#1545635 COPY_INSTEAD_OF_MOVE cid#1545603 COPY_INSTEAD_OF_MOVE cid#1545602 COPY_INSTEAD_OF_MOVE cid#1545592 COPY_INSTEAD_OF_MOVE cid#1545544 COPY_INSTEAD_OF_MOVE cid#1545532 COPY_INSTEAD_OF_MOVE cid#1545520 COPY_INSTEAD_OF_MOVE cid#1545512 COPY_INSTEAD_OF_MOVE cid#1545490 COPY_INSTEAD_OF_MOVE cid#1545483 COPY_INSTEAD_OF_MOVE cid#1545467 COPY_INSTEAD_OF_MOVE cid#1545461 COPY_INSTEAD_OF_MOVE cid#1545458 COPY_INSTEAD_OF_MOVE cid#1545428 COPY_INSTEAD_OF_MOVE cid#1545394 COPY_INSTEAD_OF_MOVE cid#1545385 COPY_INSTEAD_OF_MOVE cid#1545383 COPY_INSTEAD_OF_MOVE cid#1545366 COPY_INSTEAD_OF_MOVE cid#1545357 COPY_INSTEAD_OF_MOVE Change-Id: I76224326977b4067b94ca3176cad1ca6de17930a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160847 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-16no need to allocate these on the heapNoel Grandin1-6/+7
Change-Id: I02ec48ba369e91afc67246f9cdf18f88b24af49f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-16unique_ptr to optional in chart2Noel Grandin2-10/+10
Change-Id: Ia61bbedc8a96ac7525eb24997f99546ed26e377c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-16no need to allocate this on the heapNoel Grandin2-14/+10
Change-Id: I9a63c534a12ec2cf11d8820a5bbba8bca9a7c0e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160841 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-16no need to allocate this on the heapNoel Grandin6-22/+17
Change-Id: I89d4e680e6c8aabcc543605a0e496b3086dd2d3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160838 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-16no need to allocate this on the heapNoel Grandin1-6/+6
Change-Id: I99a41076db39b76f6dbbd5974039ee271c29eee5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-15use more getFastProperty in chart2Noel Grandin3-7/+9
Change-Id: Ia6511f7de33023e1e1e9e8a31ba262c7b989350c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160832 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-14cid#1545211 COPY_INSTEAD_OF_MOVECaolán McNamara1-10/+5
and cid#1545218 COPY_INSTEAD_OF_MOVE cid#1545232 COPY_INSTEAD_OF_MOVE cid#1545243 COPY_INSTEAD_OF_MOVE cid#1545246 COPY_INSTEAD_OF_MOVE cid#1545251 COPY_INSTEAD_OF_MOVE cid#1545260 COPY_INSTEAD_OF_MOVE cid#1545261 COPY_INSTEAD_OF_MOVE cid#1545276 COPY_INSTEAD_OF_MOVE cid#1545295 COPY_INSTEAD_OF_MOVE cid#1545297 COPY_INSTEAD_OF_MOVE cid#1545301 COPY_INSTEAD_OF_MOVE cid#1545302 COPY_INSTEAD_OF_MOVE Change-Id: I97ba935a4a2b8715b55ebbf6e853a66260b2eb90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160686 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-14tdf#158684: CHART XY Scatter Chart: line type "stepped" ignores parametersJulien Nabet1-1/+1
Regression from 65752e649872edfd98915035b61aca510ae8f271 Date: Fri Mar 24 10:52:13 2023 +0100 jsdialog: enable and make async chart line prop dialog Change-Id: I1532c45ae72d2c45ace72bcc099fcc8baa265b99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160715 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-12-11tdf#158421 use correct awt:Gradient2 in Chart listsArmin Le Grand (allotropia)2-4/+20
Change-Id: I5fa02c2660d59981f540cde8bd6eaaaaddb30e65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160463 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-10cid#1545912 std::swap COPY_INSTEAD_OF_MOVECaolán McNamara1-3/+1
Change-Id: Ib3468b43015821225d0236fca5550392f69e1154 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160523 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10cid#1546281 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+1
and cid#1546278 COPY_INSTEAD_OF_MOVE cid#1546276 COPY_INSTEAD_OF_MOVE cid#1546247 COPY_INSTEAD_OF_MOVE cid#1546244 COPY_INSTEAD_OF_MOVE cid#1546243 COPY_INSTEAD_OF_MOVE cid#1546220 COPY_INSTEAD_OF_MOVE cid#1546209 COPY_INSTEAD_OF_MOVE cid#1546207 COPY_INSTEAD_OF_MOVE cid#1546206 COPY_INSTEAD_OF_MOVE cid#1546205 COPY_INSTEAD_OF_MOVE cid#1546197 COPY_INSTEAD_OF_MOVE cid#1546180 COPY_INSTEAD_OF_MOVE cid#1546172 COPY_INSTEAD_OF_MOVE cid#1546165 COPY_INSTEAD_OF_MOVE cid#1546164 COPY_INSTEAD_OF_MOVE cid#1546158 COPY_INSTEAD_OF_MOVE cid#1546151 COPY_INSTEAD_OF_MOVE cid#1546135 COPY_INSTEAD_OF_MOVE cid#1546132 COPY_INSTEAD_OF_MOVE cid#1546129 COPY_INSTEAD_OF_MOVE cid#1546128 COPY_INSTEAD_OF_MOVE cid#1546122 COPY_INSTEAD_OF_MOVE cid#1546117 COPY_INSTEAD_OF_MOVE cid#1546113 COPY_INSTEAD_OF_MOVE cid#1546106 COPY_INSTEAD_OF_MOVE cid#1546099 COPY_INSTEAD_OF_MOVE cid#1546091 COPY_INSTEAD_OF_MOVE cid#1546085 COPY_INSTEAD_OF_MOVE cid#1546069 COPY_INSTEAD_OF_MOVE cid#1546063 COPY_INSTEAD_OF_MOVE cid#1546062 COPY_INSTEAD_OF_MOVE cid#1546058 COPY_INSTEAD_OF_MOVE cid#1546056 COPY_INSTEAD_OF_MOVE cid#1546051 COPY_INSTEAD_OF_MOVE cid#1546040 COPY_INSTEAD_OF_MOVE cid#1546030 COPY_INSTEAD_OF_MOVE cid#1546028 COPY_INSTEAD_OF_MOVE cid#1546015 COPY_INSTEAD_OF_MOVE cid#1546001 COPY_INSTEAD_OF_MOVE Change-Id: Ib954c92a300fc323b29f27880fdf8bc46ed98862 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160520 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-08cid#1545617 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+1
and cid#1545748 COPY_INSTEAD_OF_MOVE cid#1545741 COPY_INSTEAD_OF_MOVE cid#1545698 COPY_INSTEAD_OF_MOVE cid#1545594 COPY_INSTEAD_OF_MOVE cid#1545588 COPY_INSTEAD_OF_MOVE cid#1545558 COPY_INSTEAD_OF_MOVE cid#1545545 COPY_INSTEAD_OF_MOVE Change-Id: I5dfec77a68959b9384fc71a2fc0908c5d1b42869 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160448 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-08cid#1546501 COPY_INSTEAD_OF_MOVECaolán McNamara14-14/+14
and cid#1546486 COPY_INSTEAD_OF_MOVE cid#1546485 COPY_INSTEAD_OF_MOVE cid#1546484 COPY_INSTEAD_OF_MOVE cid#1546482 COPY_INSTEAD_OF_MOVE Change-Id: I53cc622f16afc0f57ffd72e3e0a6f18e390fbb83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160443 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-07tdf#158223: chart2_uichart: Add unittestXisco Fauli2-0/+48
Change-Id: I11e20682155c524fcc119701111f5bc91f6beed8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160404 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-12-07simplify and modernise ScopedBitmapAccessNoel Grandin1-1/+0
(*) Make all of it use a "Scoped" paradigm (*) pass by value, no need to allocate on heap (*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods. (*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places. Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-06tdf#126084 import svg image from ooxml document that use svgBlip elem.Tomaž Vajngerl1-59/+1
In an OOXML document the svg image is defined in an svgBlip, which is an OOXML extension. This change checks for the svgBlip element and imports that instead the normal "blip" element that is still provided as a fallback (PNG image). Add roundtrip SVG image test for ODF and OOXML, Impress and Writer. testGraphicBlipXLSX test failed after this change, because some component was missing. Changed to enable use_rdb for all chart2 export tests, so issues like this won't happen anymore. Change-Id: Idf0e754775254d7dcfd0321dfca2ed6d00c42c09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157238 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-12-04cid#1546422 COPY_INSTEAD_OF_MOVECaolán McNamara2-5/+2
and cid#1546416 COPY_INSTEAD_OF_MOVE cid#1546415 COPY_INSTEAD_OF_MOVE cid#1546391 COPY_INSTEAD_OF_MOVE cid#1546390 COPY_INSTEAD_OF_MOVE cid#1546317 COPY_INSTEAD_OF_MOVE cid#1546252 COPY_INSTEAD_OF_MOVE cid#1546251 COPY_INSTEAD_OF_MOVE cid#1546249 COPY_INSTEAD_OF_MOVE cid#1546243 COPY_INSTEAD_OF_MOVE cid#1546195 COPY_INSTEAD_OF_MOVE cid#1546193 COPY_INSTEAD_OF_MOVE cid#1546137 COPY_INSTEAD_OF_MOVE cid#1545738 COPY_INSTEAD_OF_MOVE cid#1545782 COPY_INSTEAD_OF_MOVE Change-Id: I10d5091aa72b682371764b8a18cc5062e272c031 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160285 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-21chart2: Match chart background color with DOCCOLOR in Calcofftkp1-1/+9
Chart background color would be hardcoded to white which meant newly inserted charts would have a different background color in Calc (in other components, the background color is later set to transparent) Change-Id: I6ea55389f195155a96c4c8dcc94a902b2a862178 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159751 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
2023-11-20Extended loplugin:ostr: chart2Stephan Bergmann5-470/+494
Change-Id: I544f7286ff28cd105fa9dc7bff2712aebb3d5a45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159725 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-13Fix warning for emscripten buildJulien Nabet1-2/+4
TB lo_daily_tb_linux_wasm shows: /home/tdf/jenkins/workspace/lo_gerrit/tb/src_wasm/chart2/source/controller/main/ChartController.cxx:1557:71: warning: unused parameter 'rAccChartView' [-Wunused-parameter] void ChartController::impl_initializeAccessible( AccessibleChartView& rAccChartView ) ^ 1 warning generated. Change-Id: If584e6944c1d9105a7a8b7170dc1022911b57bf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159373 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2023-11-07ITEM: Get away from classic 'poolable' Item flagArmin Le Grand (allotropia)1-1/+3
To understand this, some look back in history will be needed to see why it is as it is today. In some (reworked) comments 'poolable' is described as flag to hold Items in the ItemPool, also always having only one incarnation of each possible Item. This is not the original intention, but a side-effect. The reason is what the binary format in the office did: To save a document, the Objects & the Pool were saved, *not* individual Items *together* with the objects. The Pool was completely (binary) saved (and loaded) in one run. Temporary IDs were used to represent at the objects in file which Items were referenced. This *required* to have only one incarnation per item to have a minimal binary file size, thus this high effort was put into this. At doc load, the pool was loaded, all Items were set to RefCount 5000, the references from the objects were restored and then for each Item the RefCount was lowered by 5000 again and - if being zero - deleted. Items for UI were marked 'non-poolable' to *not* safe them with the document, so poolable was a flag to decide if that Info/Item was to be saved with the document - or more direct: if it is Model Data. Items are small, so if we prefer runtime it is okay to no longer being strict with this, anyways does not happen often and has only marginal memory effects - compared to runtime effects/savings. Other problems which this caused: One example is that objects in the UNDO stack were still in the pool, so e.g. deleted pictures were saved with the document despite no longer being used (!). That is the reason we have an UndoItemPool and a method MigrateItemPool to move stuff to that Pool when objects go to the UNDO stack - all of this is also no longer needed. Cleaning this up means to ideally have all items in the SfxItemSet, no longer at the Pool. The Pool should be reduced to a 'Default-Item- Holder' and a 'Slot-to-whichId-mapper'. This needs thorough cleanups/removals, but will be worth it because that massive simplification(s) will increase safety an runtime and make migrating to the goal of completely type-based ItemSet stuff easier for the future. Hopefully only view code in the office working with items will have to be changed for this. In this 1st step I already found that some 'compromizes' will be needed: - There are still Items that have to be at the pool to make the Surrogate-stuff working. This gives back all Items in a Pool of a type and is used in ca. 80 cases. Each one looks at these Items *without* context (e.g. a SfxItemSet at an Object would be a context), so if e.g. a dialog is open that temporarily uses Items of that type you would also get these - without knowing about it... To make that work there is still a mechanism to have Items at the Pool, but now just *registering* (and un-reg) them without any sort/search/ remove needs. Also only for Items that need that, so I evaluated the GetItemSurrogates calls and added some asserts when GetItemSurrogates tries to access an unregistered item type which needs to be added. - Another caveat is that there are about 250 places that directly put Items to the Pool (not all remove these, that is done at pool deletion, so some kind of silent 'garbage-collection' is in place). To have an overview I renamed the accessing methods to separate them from the same functionality at the SfxItemSet, which had the same names. An implementation does still add these directly to the pool, there is no way to cleanup those usages for now. In principle all these should be changed to hold the data at an SfxItemSet. I am still hunting problems. But you can build the office, all apps work (including chart) and you can do speed comparisons already. There are test throwing errors, so I hunt these now. It is hard to give an estimation about how much more changes/corrections will be needed. Completed adaptions to new registered Items at Pool, that reduces the failing tests. Still many that I need to hunt. Added stuff to work around that 'compromize' in ScDocumentPool: It overloads ::PutImpl of the pool to implement special handling for a single Item in SC, the ScPatternAttr. In former code that method was used from SfxItemSet and ::PutImpl at the pool directly, so it was only used in one place. I am not sure if it was used from the SfxItemSet functionality, but better offer it for now. To not waste too much runtime the callbacks depend on the boolean 'NewItemCallback' at the SfxPoolItem, it gets set for that single Item in SC and only then the callbacks trigger. I hope to get rid of those again, e.g. newItem_UseDirect is only needed since we have no 'real' StaticPoolDefaults currently - another thing that needs to be cleaned up in a next step. Since usages of impl(Create|Cleanup)ItemEntry and Direct(Put|Remove)ItemInPoolImpl got more and more similar I decided to unify that: move impl(Create|Cleanup)ItemEntry to tooling, make it globally available in svl and use it also directly for Direct(Put|Remove)ItemInPoolImpl. This slightly increases the failing tests again, but only since in Direct(Put|Remove)ItemInPoolImpl that fallback (e.g. tryToGetEqualItem) was used before, thus this is the same class of errors (SfxPoolItem ptr-compare) as the others which I will need to find anyways. Also fixed some missing stuff. Have now idenified and redirected all SfxPoolItem ptr-compares to be able to debug these - one cause for the remaining errors is probably that before with bPoolable those often were sufficient, but are no longer. Used the [loplugin:itemcompare] and a local clang build to do so, see https://gerrit.libreoffice.org/c/core/+/157172 Stabilized Direct(Put|Remove)ItemInPoolImpl forwards, added parameter to implCreateItemEntry to signal that it gets called from DirectPool stuff - currently needed. Hopefully when getting rid of that DirectPool stuff we can remove that again Added two more debug functionalities: - Added a SerialNumber to allow targeted debugging for deterministic cases - Added registering & listing of still-allocated SfxPoolItems at office shutdown Found PtrComp error in thints.cxx - POC, thanks to areSfxPoolItemPtrsEqual. Will hopefully help more with other tests Found some wrong asserts/warnings where I was too careful and not finding something/succeeding is OK, fixes some UnitTests for SC For SC I now just tried to replace all areSfxPoolItemPtrsEqual with the full-ptr-content compare SfxPoolItem::areSame. I also needed to experiment/adapt the newItem_Callback solution but got it working. Did that replacement now for SW too, found some places where the direct ptr compare is OK. Continued for the rest of occurrences, now all 160 places evaluated. Also done some cleanups. Massive cleanups of stuff no longer needed with this paradigm change. Also decided to keep tryToGetEqualItem/ITEM_CLASSIC_MODE for now. It is used for *one* Item (ScPatternAttr/ATTR_PATTERN) in SC that already needs many exceptions. Also useful for testing if errors come up on this change to test if it is related to this. Added forwarding of target Pool for ::Clone in SvxSetItem and SvxSetItem, simplified SfxStateCache::SetState_Impl and returned to simple ptr compares in SfxPoolItem::areSame to not do the test in areSfxPoolItemPtrsEqual. Debugged through UITest_calc_tests9 and found that in tdf133629 where BoxStyle is applied to fully selected empty calc the Item- reuse fallback has to be used not only for ATTR_PATTERN, see comment @implCreateItemEntry. Maybe more... Problem with test_tdf156611_insert_hyperlink_like_excel. Found that in ScEditShell::GetFirstURLFieldFromCell the correct SvxURLField is found and returned as ptr, but it's usage crashes. That is due to the SfxItemSet aEditSet used there gets destroyed at function return what again deletes the SvxFieldItem that is holding the SvxURLField that gets returned. This shows a more general problem: There is no 'SfxPoolItemHolder' that safely holds a single SfxPoolItem - like a SfxItemSet for a single Item (if Items would be shared_ptrs, that would be a safe return value). That will be needed in the future, but for now use another solution: Since I see no reason why EE_FEATURE_FIELD should not be shareable I wil change this for ow in the SfxItemInfo for EditCharAttribField. That way the Item returned will be shared (RefCnt > 1) and thus not be deleted. I changed the return value for GetURLField() and GetFirstURLFieldFromCell() in ScEditShell: At least for GetFirstURLFieldFromCell the return type/value was not safe: The SvxFieldItem accessed there and held in the local temporary SfxItemSet may be deleted with it, so return value can be corrupted/deleted. To avoid that, return a Clone of SvxFieldData as a unique_ptr. With all that UnitTest debugging and hunting and to get the paradigm change working to no longer rely on shared/pooled items I lost a little bit focus on speed, so I made an optimization round for the two central methods implCreateItemEntry/implCleanupItemEntry to get back to the speed improvements that I detected when starting this change. It was mainly lost due to that 'strange' chained pool stuff we have, so I added to detect the target pool (the one at which the WhichID is registered) directly and only once. Next thing to cleanup will/should be the pool and it's concept, all this is not needed and really costs runtime. Since implCreateItemEntry/implCleanupItemEntry are executed millions of times, each cycle counts here. Had an error in the last changes: pool::*_Impl methods use index instead of WhichID - most of them. Another bad trap, I really need to cleanup pool stuff next. Change-Id: I6295f332325b33268ec396ed46f8d0a1026e2d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157559 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-11-02'new Double' is deprecated in JavaNoel Grandin1-4/+4
replace with Double.valueOf Change-Id: If5be8e500e31ebf9d5fb20ea7dd474677d7c74ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158785 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-02'new Float' is deprecated in JavaNoel Grandin1-5/+5
replace with Float.valueOf Change-Id: Ib6408b24dac2953789d0ec67e73b8be8aefca252 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158784 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-26Replace use of "Calibri" and "Calibri Light" with "Noto Sans"Stephan Bergmann10-354/+354
...in CppunitTest_chart2_xshape, which had caused <https://buildbot.flathub.org/#/builders/6/builds/75165> to fail with > diff.cxx:324:Assertion > Test name: Chart2XShapeTest::testTdf149204 > assertion failed > - Expression: valInTolerance > - 3511; Found Value: 3485; Tolerance: 1; Relative: 0 > > diff.cxx:265:Assertion > Test name: Chart2XShapeTest::testPieChartLabels1 > double equality assertion failed > - Expected: 8383 > - Actual : 8399 > - Delta : 1e-08 > - Reference: /run/build/libreoffice/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml > - Node: /XShapes/XShape[2]/XShapes/XShape[3]/XShapes/XShape[2] > - Attr: positionX > > diff.cxx:324:Assertion > Test name: Chart2XShapeTest::testPieChartLabels2 > assertion failed > - Expression: valInTolerance > - 3124; Found Value: 2966; Tolerance: 1; Relative: 0 > > diff.cxx:324:Assertion > Test name: Chart2XShapeTest::testPieChartLabels3 > assertion failed > - Expression: valInTolerance > - 3124; Found Value: 2966; Tolerance: 1; Relative: 0 > > diff.cxx:324:Assertion > Test name: Chart2XShapeTest::testPieChartLabels4 > assertion failed > - Expression: valInTolerance > - 2768; Found Value: 2531; Tolerance: 1; Relative: 0 Change-Id: I518d37bedf7d8738396e05011223bd970786a45a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158377 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-24tdf#155040 sw floattable, RTF: fix table is overlapped by subsequent inline oneMiklos Vajna3-46/+4
The document had overlapping text on load since commit 05425f73bfa41d3f7591461e2ad0beb4fafc39b4 (sw floatable: teach the RTF import about SwFormatFlySplit, 2023-04-21). Interestingly the DOCX equivalent was fine, there the inline table is shifted down, below the floating table, so the overlap doesn't happen. Fix the problem by moving the AddVerticalFrameOffsets=true code from the DOCX filter to the shared dmapper, because RTF needs the same. See commit 50223ea6e212b60b7d33839c2753c5601fb50f95 (tdf#98987 sw: add AddVerticalFrameOffsets compat mode, 2016-03-31) for more details about this compat flag. It was already enabled for DOC, too. Change-Id: I948b179c9ec5fa24377014b0e86826568c417b6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158372 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann12-201/+201
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: chart2Stephan Bergmann26-65/+65
Change-Id: Ifcb57548a594cbbaf70df8d9da17cf94a96667db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158146 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19use more SdrObjList::begin/end in variousNoel Grandin1-9/+5
Change-Id: If054626a10d3cbd3b168dd4e66ec7f08344d2c2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158131 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-16tdf#141892: Set chart view to dirty state after loadingMike Kaganski4-5/+38
Previously, ChartViewHelper::setViewToDirtyState was only called in ChartModel::impl_notifyModifiedListeners during the load process of inline charts; after commit 574eec9036c5f185b3572ba1e0ca9d111eb361dc, the chart doesn't set its modified state when loading, and thus the view did not get notified about the necessary updates. This change introduces a hidden property in ChartDocumentWrapper, named 'ODFImport_UpdateView', which is set in SchXMLImport dtor to force the notification after the loading. Change-Id: Id9d82f16d233d2172cd6808a8498822e13b21b21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158051 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-16tdf#157776: Do not set chart and its parent modified when paintingMike Kaganski2-5/+35
When the chart is painted for the first time, its update may create the initial set of objects, which used to set modified state after loading documents. Change-Id: Ie50ef34875440058020486192fe649b492e4baf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158015 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-16tdf#157776: Do not send delayed update notifications for setModified(false)Mike Kaganski1-1/+2
Change-Id: I4948cc217079d2ed535b95e3892e619736237cc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158014 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann1-1/+1
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-12Make NC_ constexpr-friendlyStephan Bergmann2-2/+2
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr paths into a new TranslateId::getId. And demonstrate constexpr'ability by making the aCategories var in OApplicationIconControl::Fill (dbaccess/source/ui/app/AppIconControl.cxx) constexpr. (And there might be more such cases that could now be made constexpr.) Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann2-2/+2
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann2-16/+16
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-06SdrModel::getUnoModel can use XModel instead of XInterfaceNoel Grandin2-6/+4
Change-Id: Ica10c62066881ba86099d2057ff6fe20e0084a85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157632 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-05crashtesting: crash seen on exit of chartCaolán McNamara1-1/+4
with soffice --headless --convert-to ods forum-mso-en4-569016.xlsx and other similar Change-Id: I908fa834c1072a9854055cad1ee6261800d76aea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157573 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-24Drop some newly obsolete __GNUC__ version checksStephan Bergmann2-4/+0
...after 6ef2d358ac053ce0f6de9cf0f8f25e8bae66d441 "Adapt Clang and GCC minimum version checks" Change-Id: I5f3bcda2ce8e0e093af3bdd9d2cca741a5b95306 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157202 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-23Use less epoxy external headers dependencyGabor Kelemen1-1/+0
Change-Id: If5d4e5a65a0fcea6bd67cdba48742f6aaec0811d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156556 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
2023-09-18fix emscripten buildSarper Akdemir1-0/+6
Change-Id: I15df992e410f741a22d1f140b85e57a97195a5f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157020 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-09-11remove dead m_bCancelOperation flag from XMLFilterNoel Grandin2-15/+1
has always been ignored Change-Id: I272ca7026ddf25fbc679e7933ea23986466ad70b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156822 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-11jsdialog: fix layout of chart type dialogSzymon Kłos2-2/+14
directly set content area container to avoid buttons on top of the dialog in lok case Change-Id: I8353102f679a8f19c3041c7b4ec0b1200ed7d515 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156254 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Pranam Lashkari <lpranam@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156813 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>