summaryrefslogtreecommitdiff
path: root/chart2/source
AgeCommit message (Collapse)Author
2024-03-01Make Chart Object Properties Dialogs Asynccodewithvk
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>
2024-02-16Chart: Make Data Range Dialog Asynccodewithvk
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>
2024-02-07Fix: Convert 'runAsync' class-based calls to static method calls for chart ↵codewithvk
properties Signed-off-by: codewithvk <vivek.javiya@collabora.com> Change-Id: Ib368c2bbb5657a2dbf1b7f340bc9fb0b6f436713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162975 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-02-01Set chart outliner background to the page bg to resolve 'auto' colorCaolán McNamara
Change-Id: I2498a7d49dbbd7bde017489722c3b655b6d75136 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162649 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 8fa1493facfe1f088fc99c762b5a8a0773fc1b9c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162854 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-02-01use ViewShell DOCCOLOR when available for chartsCaolán McNamara
Change-Id: I200538bd94d60867d84b7dc37811094b65dd9aa5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162853 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-01-31Async Dialogs for Few Chart Propertiescodewithvk
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>
2024-01-29When chart is active pass uno:ChangeTheme through to its parent frameCaolán McNamara
so theme changes can happen when chart has control of the UI Change-Id: Id7fd17d697d5ff8c03f1f46d80894e4f69cb9b9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162619 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-01-16chart2: Make automatic area coloring for charts work for tiled renderingofftkp
Charts now get a temporary colored applied to the area property set if their color was set to automatic, which is done by default in tiled rendering mode. Change-Id: Ic6bd19b97d2a0ffa2a1ad516cfa202e2f4921db7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162174 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-01-10tdf#158684: CHART XY Scatter Chart: line type "stepped" ignores parametersJulien Nabet
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> (cherry picked from commit 4eb875d95622fb4346d3f8b24327a1b84230eca1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161675 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2024-01-05Make format condition, chart delete and pivot table error asynccodewithvk
todo: Make executeDlg_ObjectProperties_withoutUndoGuard dialogs to async. Signed-off-by: codewithvk <vivek.javiya@collabora.com> Change-Id: I9927c1008d34370b9394aaf653afb575f69f2d45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160557 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> 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 McNamara
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/+/161122 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-11-21chart2: Match chart background color with DOCCOLOR in Calcofftkp
Change-Id: I6ea55389f195155a96c4c8dcc94a902b2a862178 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159744 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2023-10-26tdf#155040 sw floattable, RTF: fix table is overlapped by subsequent inline oneMiklos Vajna
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. (cherry picked from commit 612629f4a81acd7b851b7eccc97aba9a5915d13c) [ The backport also contains a subset of commit 56e17186ffcda7e93530bef3a06120584bb7d579 ([API CHANGE] Merge sfx2::XmlDump into css::qa::XDumper, 2022-12-10), otherwise it's hard to verify the layout from writerfilter/. ] Conflicts: chart2/source/model/main/ChartModel.cxx chart2/source/view/main/ChartView.cxx include/comphelper/dumpxmltostring.hxx sw/source/uibase/inc/unotxvw.hxx Change-Id: I948b179c9ec5fa24377014b0e86826568c417b6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158481 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-01jsdialog: fix layout of chart type dialogSzymon Kłos
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>
2023-08-24tdf#155526 Remove Insert R2 in all casesLaurent Balland
When opening a file containing a Moving average trend line, addRegressionCurve is not used, then MayHaveCorrelationCoefficient property is not correctly set. This change modify this property in all cases. Update property in firePropertyChangeEvent() as it is not possible in constructor: JunitTest_chart2_unoapi fails in MeanValue as SolarMutex is not owned Add QA test Change-Id: I13bdb81239a7362431edcf28bfc38ac4820a7776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153859 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 6fc12ad600a1ee10253c269a5988907a2894be76) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155174 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-08tdf#155526 Moving average: remove Insert R2Laurent Balland
Moving average trend line does not R² value. This change remove "Insert R²" from context menu when the trend is of type "Moving average" Change-Id: I729a6421df34859e7176c798a2b68a6f13cfb544 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153294 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit aa86e7e8c22527eb5da0b8a05dbd4bd749f7a2b8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153838
2023-07-08tdf#155526 Restore status bar for moving averageLaurent Balland
Previous commit dc03f59374d4fc74dd44ddedc903bb9c00a74bb7 broke text in status bar when a moving average trend line is selected Change-Id: I259fb9aee1eccf9fac93038c6dd2755490769f88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153677 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 125b0f6609332523d30bef600979b698c2d216f8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153706 (cherry picked from commit 2e04c00f21cf2566c3de34d9dd828cc1615329fd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153839
2023-07-08tdf#155526 Add Period to trend line equationLaurent Balland
Insert Period value earlier to have it ready for representation Allow Moving average equation in dialog UI Change-Id: I1d20572c39462e60b60ab7eec1f174a3cf934d4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153094 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit dc03f59374d4fc74dd44ddedc903bb9c00a74bb7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153755 Reviewed-by: Laurent Balland <laurent.balland@mailo.fr>
2023-06-14tdf#91265 Use same plot area distance as used in MSOGülşah Köse
Changes the postion calculation for pie charts, where the margin min distance is now constant for pie charts, but unchanged for other chart types. This changes the positions of various pie charts used in tests, which have been changed to the new value after the cases have been checked. Added a new test with all 3 use cases (chart area width equals height, width is greater than height, width is less than height). Change-Id: I51f98f336a7c64a3e6762144fc7dc8d9df80f696 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143179 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 959fbfc000d2e3167b2b57b6d11bea231993b4f0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153017 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Aron Budea <aron.budea@collabora.com>
2023-06-09check for empty model like ObjectIdentifier::getObjectPropertySetcp-23.05.0-4Caolán McNamara
a speculative fix for: https://crashreport.libreoffice.org/stats/crash_details/5b3c8597-9ffa-49b8-8cc2-132e69456249 Change-Id: I4f45cf4c7ed51c814d4cb01b8f55709586d7a981 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152756 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-01svx: combine svx::NamedThemedColor into NamedColorTomaž Vajngerl
Change-Id: I9a9656ddce9c12564411cfcb3e8e8714ae74a418 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152236 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 9a4b768b0a22bd3ae627c7355bbd223b9cf65015) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152265 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2023-06-01svx: change NamedColor be a struct instead of std::pairTomaž Vajngerl
Change-Id: Ice1625e8cae8da859ea8a940b3f8e40f6f9d7037 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152235 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 8e87f1f2ff4df763e29bdc097786230c6293744b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152264 Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-28tdf#138279 Revert "On double click on chart select the chart backgroud"Justin Luth
This reverts 7.1 commit 6a915073f8400fd34274cf311994bbc9bf498ab6. The change was simply wrong. There is NOTHING about this context that indicates that a double-click is happening. So whatever this patch was trying to do, it simply was made in a completely wrong way. So best to just revert, and put the onus back on the interested parties to redesign a fix for their double-click issue. Change-Id: Ia209c0552839d6cce1b348432789f0f861ac5703 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152023 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins (cherry picked from commit 73a82b425b4dc02ef4ad3946b71c067a6411045c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152217 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-05-21MCGR: consolidations/cleanups for changes so farArmin Le Grand (allotropia)
Change-Id: I85cf40e4803b0485bb40349d8e81adc8123666c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151706 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-21tdf#155231 CRASH: with embedded OLE chartNoel Grandin
regressions from commits like commit 70595c0291e4cc137158c77f6136025b10ce6728 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Mar 16 09:20:17 2023 +0200 move setDimension/getDimension inside chart2::Diagram Change-Id: I535d8e74d621821bde7d31894fe7f0350e91c941 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151664 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151735
2023-05-15MCGR: Model data changes for ColorStepsArmin Le Grand (allotropia)
Added tooling replaceStart/EndColor to allow simple transition for code that does not immediately adapt to multi color gradients. Also added createColorStepsFromStartEndColor for the same purpose. Adapted XGradient to no longer have Start/EndColor at all, but only use ColorSteps. Adapted all usages of XGradient to no longer use Get/Set/Start/EndColor, but access the ColorSteps instead. Replaced quite some XGradient constructors that used XGradient() as Start/EndColor since this is already the default. Adapted ColorBlending to black AKA Start/EndIntens in XGradient to work now on all ColorSteps in the required linearly-scaled manner. UNO API changes: Added com::sun::star::awt::ColorStep as basic data element that holds a pair of Offset and Color. Added com::sun::star::awt::ColorStepSequence to handle an array of sorted entries. Added com::sun::star::awt::Gradient2 derived from com::sun::star::awt::Gradient, extended by the needed com::sun::star::awt::ColorStepSequence. Added MID_GRADIENT_COLORSTEPSEQUENCE to UNO API to provide access to ColorSteps directly. Adapted XFillGradientItem::QueryValue/PutValue to make use of new UNO API data structures. To do so, added tooling methods for data transition: - fillColorStepSequenceFromColorSteps - fillGradient2FromXGradient - fillColorStepsFromAny - fillXGradientFromAny and adapted - case '0' (all data) - MID_FILLGRADIENT - MID_GRADIENT_COLORSTEPSEQUENCE - MID_GRADIENT_START/ENDCOLOR to make use of these. Tested usage of these in the office. Renamed from GradientStep to GradientStop after discussions with members on the list to make this closer related to other norms/definitions. Also renamed classes and class members to better reflect to GradientStop, so grepping/finding will be easier (e.g. 'Color' just exists pretty often, but 'StopColor' is more precise). Changed the used UNO API class for reprsenting the Color to better reflect to ranges [0.0 .. 1.0] and usage of RGB. Change-Id: I1eeb3e97e81d6785967615d1ff256551fc3b882d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148849 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-13tdf#155210 FILESAVE ODT Default chart row labels disappear from Writer chartNoel Grandin
revert commit 6500106dff0f0cd86f509ffd01542aab77c21596 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue Apr 19 13:48:55 2022 +0200 tdf#148635 no need to init ChartDataWrapper more than once Change-Id: I28f078731bd8bfedbde63d0bb2e5fe40f0a4ff46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151583 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 40f5a5be9fd228a5d33a3b1218864a38cb70dc1f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151524 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-05-13Resolves: tdf#146068 don't crash when MA(central) lacks dataCaolán McNamara
Change-Id: I2c9b78f4d1a963bb71abb21068e61e6983ade777 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150500 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-05-13fix bug in WrappedRegressionCurvesProperty::setValueToSeriesNoel Grandin
ever since commit 1cd3e2038010cb37bda82d38dd058b793b7eec26 Author: Tomaž Vajngerl <quikee@gmail.com> Date: Sat Jun 29 18:43:16 2013 +0200 Multiple trendline removing and changing type support. Change-Id: Ibd24d0831932f25e60c05a00450d611e15875102 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149691 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 2714b18cbaefb13131ae63396297cd57b564a3af) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149698 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-04-03jsdialog: enable and make async chart line prop dialogSzymon Kłos
Change-Id: I21817b21fe6d2ce0a6f6bd784c0e24fe35b17fec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149502 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-03-12tdf#153859 sw: crash fix for setting chart with deleted data tableLászló Németh
Opening Data Ranges dialog window of a chart with deleted data table crashed Writer immediately. Follow-up to commit 5b9855acc7fa6d1e4a5f53ff0bc47e1dd4729827 "tdf#132714 sw: fix crash at table row deletion associated to a chart". Change-Id: I96e901db75d40ae234f58827a957204bca13aa92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147893 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit e706698353a7187f46ddbf0faf1f6f7772753df6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147904 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-12tdf#153858 sw: crash fix for chart with deleted data tableLászló Németh
Using mouse, e.g. simply moving the mouse pointer during editing a chart with a deleted data table crashed Writer immediately. Follow-up to commit 5b9855acc7fa6d1e4a5f53ff0bc47e1dd4729827 "tdf#132714 sw: fix crash at table row deletion associated to a chart". Change-Id: I6d89eabc84565c548e2d9ded922789d623367ce4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147882 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 4f2dcc4bc70c3602e2612dab611b610410637920) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147898 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-03-07jsdialog: enable chart wizardSzymon Kłos
Change-Id: I7d6f4b4e6022507a57224ad40785f5f4f4537ea8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148133 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-02-25blind fix for crashes in RegressionCurveCalculatorNoel Grandin
if mPeriod is < 0, then we could crash in calculateValuesCentral Change-Id: I554b46ed7bf5b5b0a32fcf69829aa1c2c75833f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147508 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 37751d878b87765a4d2cfb50d0a39280c585ece1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147453
2023-02-25tdf#153640 Fix changing chart background color back to NoneSamuel Mehrbrodt
Change-Id: I653028d6016ca0caa72cb2a877cd23592c322a18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147351 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> (cherry picked from commit a2732de4bd080e3ed8894ba3618f48bc4c6d9abe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147445 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-06Move cppu::BaseMutex up to the base class OPropertySetNoel Grandin
Change-Id: I0e51987714e32ece19609c7a6d500995e6fc3601 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143674 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-06tdf#151847 Some chart UNO objects were not advertising their types propertyNoel Grandin
which means that accessin them from python and trying to use the XPropertySet and related interfaces doesn't work nicely Change-Id: I873f6a6fcb048e7f8244313cd737c04b003259a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143675 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-01tdf#145599 Charts gets corrupted when you draw a line inside themNoel Grandin
This reverts commit 2ed8c34bca56c1a30d727b21d9096cb77e88197a use a single global item pool for chart2 draw model Change-Id: I640a981a2cbbed1cb9e6c0b0c239c78bb481e12e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-29New loplugin:crosscastStephan Bergmann
...inspired by 2fa426da15a12e2a63554247e3c1c3f8c0ec5c24 "Fix dynamic_cast after splitting OutputDevice and vcl::Window class hierarchies": "Find uses of dynamic_cast that cast between unrelated classes, which is suspicious and might indicate a bug. The heuristic used to consider two classes unrelated is that neither derives from the other (directly or indirectly) and they do not both virtually derive (directly or indirectly) from a common third class. Additionally, class definitions can be attributed with SAL_LOPLUGIN_ANNOTATE("crosscast") (from sal/types.h) to suppress false warnings about known-good cases casting from or to such a class." (quoting compilerplugins/clang/crosscast.cxx) This found two additional errors, 7a82ea5c79adee70eddf74ac53347544766a91b0 "Fix presumed typo" and fc6aa9e49973c845915754caf765ff57e5b0cd59 "fix assert", and one still-open case that looks like an error, see the TODO comment in sw/source/core/unocore/unodraw.cxx. In addition to that it flagged another 102 uses of dynamic_cast as suspicious, which have all been addressed, at least for now, by marking certain classes as SAL_LOPLUGIN_ANNOTATE("crosscast"), see below. (Where this commit also adds that generic SAL_LOPLUGIN_ANNOTATE mechanism to include/sal/types.h.) However, some of those annotations might benefit from further inspection and clean up similar to recent 8858962ec09478c203d43feb58f550bb36af37bb "Introduce ParagraphProeprtiesPropertyMap", 8467aa93e2038b3030e1add94e0ca6cc4ad44032 "Replace a dynamic_cast with UNO_QUERY", a534361141d69096d896e6e0552d19f3138eeeb3 "Fold OldBasicPassword into basic::SfxScriptLibraryContainer", and 589e03fb4c3b05bf3742c0cb8b366322ffdf1fa9 "[PATCH] Replace some dynamic_cast with UNO_QUERY". * canvas/source/cairo/cairo_repainttarget.hxx RepaintTarget: > canvas/source/cairo/cairo_cachedbitmap.cxx:62:34: error: suspicious dynamic cross cast from 'com::sun::star::rendering::XCanvas *' to 'RepaintTarget *' [loplugin:crosscast] > RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get()); * canvas/source/cairo/cairo_surfaceprovider.hxx SurfaceProvider: > canvas/source/cairo/cairo_canvashelper.cxx:301:45: error: suspicious dynamic cross cast from 'com::sun::star::rendering::XBitmap *' to 'SurfaceProvider *' [loplugin:crosscast] > SurfaceProvider* pSurfaceProvider = dynamic_cast<SurfaceProvider*>( xBitmap.get() ); * canvas/source/vcl/repainttarget.hxx RepaintTarget: > canvas/source/vcl/cachedbitmap.cxx:73:34: error: suspicious dynamic cross cast from 'com::sun::star::rendering::XCanvas *' to 'RepaintTarget *' [loplugin:crosscast] > RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get()); * chart2/inc/ChartModel.hxx ChartModel: > chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx:82:31: error: suspicious dynamic cross cast from 'com::sun::star::awt::XWindow *' to 'ChartModel *' [loplugin:crosscast] > ChartModel* pChartModel = dynamic_cast<ChartModel*>(rParent.get()); * chart2/source/controller/inc/TabPageNotifiable.hxx TabPageNotifiable: > chart2/source/controller/dialogs/tp_RangeChooser.cxx:70:28: error: suspicious dynamic cross cast from 'weld::DialogController *' to 'TabPageNotifiable *' [loplugin:crosscast] > , m_pTabPageNotifiable(dynamic_cast<TabPageNotifiable*>(pController)) > chart2/source/controller/dialogs/tp_DataSource.cxx:171:28: error: suspicious dynamic cross cast from 'weld::DialogController *' to 'TabPageNotifiable *' [loplugin:crosscast] > , m_pTabPageNotifiable(dynamic_cast<TabPageNotifiable*>(pController)) * include/drawinglayer/primitive2d/svggradientprimitive2d.hxx SvgGradientHelper: > drawinglayer/source/primitive2d/svggradientprimitive2d.cxx:582:59: error: suspicious dynamic cross cast from 'const BasePrimitive2D *' to 'const SvgGradientHelper *' [loplugin:crosscast] > const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive); > drawinglayer/source/primitive2d/svggradientprimitive2d.cxx:819:59: error: suspicious dynamic cross cast from 'const BasePrimitive2D *' to 'const SvgGradientHelper *' [loplugin:crosscast] > const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive); * include/editeng/unotext.hxx SvxUnoTextRangeBase: > writerfilter/source/dmapper/DomainMapper_Impl.cxx:7645:62: error: suspicious dynamic cross cast from 'com::sun::star::text::XTextCursor *' to 'SvxUnoTextRangeBase *' [loplugin:crosscast] > SvxUnoTextRangeBase* pDrawText = dynamic_cast<SvxUnoTextRangeBase*>(xCrsr.get()); * include/embeddedobj/embeddedupdate.hxx EmbeddedUpdate: > svtools/source/misc/embedhlp.cxx:932:35: error: suspicious dynamic cross cast from 'com::sun::star::embed::XEmbeddedObject *' to 'embed::EmbeddedUpdate *' [loplugin:crosscast] > embed::EmbeddedUpdate* pObj = dynamic_cast<embed::EmbeddedUpdate*> (GetObject().get()); * include/oox/core/contexthandler2.hxx ContextHandler2Helper: > oox/source/core/contexthandler2.cxx:183:21: error: suspicious dynamic cross cast from 'const ContextHandler2Helper' to 'const ContextHandler &' [loplugin:crosscast] > ContextHandler( dynamic_cast< ContextHandler const & >( rParent ) ), * include/oox/mathml/export.hxx FormulaExportBase: > oox/source/export/shapes.cxx:2475:42: error: suspicious dynamic cross cast from 'com::sun::star::frame::XModel *' to 'oox::FormulaExportBase *' [loplugin:crosscast] > oox::FormulaExportBase *const pMagic(dynamic_cast<oox::FormulaExportBase*>(xMathModel.get())); * include/oox/mathml/import.hxx FormulaImportBase: > oox/source/drawingml/shape.cxx:1298:25: error: suspicious dynamic cross cast from 'com::sun::star::uno::XInterface *' to 'oox::FormulaImportBase *' [loplugin:crosscast] > dynamic_cast<oox::FormulaImportBase*>(xMathModel.get())); > writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:2287:38: error: suspicious dynamic cross cast from 'SfxBaseModel' to 'oox::FormulaImportBase &' [loplugin:crosscast] > oox::FormulaImportBase& import = dynamic_cast<oox::FormulaImportBase&>(dynamic_cast<SfxBaseModel&>(*component)); > writerfilter/source/rtftok/rtfdocumentimpl.cxx:2973:33: error: suspicious dynamic cross cast from 'SfxBaseModel' to 'oox::FormulaImportBase &' [loplugin:crosscast] > auto& rImport = dynamic_cast<oox::FormulaImportBase&>( > writerfilter/source/dmapper/DomainMapper_Impl.cxx:3000:53: error: suspicious dynamic cross cast from 'com::sun::star::uno::XInterface *' to 'oox::FormulaImportBase *' [loplugin:crosscast] > if( oox::FormulaImportBase* formulaimport = dynamic_cast< oox::FormulaImportBase* >( xInterface.get())) * include/sfx2/Metadatable.hxx Metadatable: > sw/source/core/doc/docbm.cxx:1837:17: error: suspicious dynamic cross cast from 'const IBookmark *const' to 'const ::sfx2::Metadatable *' [loplugin:crosscast] > dynamic_cast< ::sfx2::Metadatable const* >(pBookmark)); > sw/source/core/doc/docbm.cxx:1924:13: error: suspicious dynamic cross cast from '::sw::mark::IBookmark *const' to '::sfx2::Metadatable *' [loplugin:crosscast] > dynamic_cast< ::sfx2::Metadatable* >(pBookmark)); > sw/source/core/doc/DocumentContentOperationsManager.cxx:342:21: error: suspicious dynamic cross cast from 'const sw::mark::IMark *const' to 'const ::sfx2::Metadatable *' [loplugin:crosscast] > dynamic_cast< ::sfx2::Metadatable const* >(pMark)); > sw/source/core/doc/DocumentContentOperationsManager.cxx:344:21: error: suspicious dynamic cross cast from '::sw::mark::IMark *const' to '::sfx2::Metadatable *' [loplugin:crosscast] > dynamic_cast< ::sfx2::Metadatable * >(pNewMark)); > sw/source/core/unocore/unobkm.cxx:381:12: error: suspicious dynamic cross cast from '::sw::mark::IMark *' to '::sfx2::Metadatable *' [loplugin:crosscast] > return dynamic_cast< ::sfx2::Metadatable* >(m_pImpl->m_pRegisteredBookmark); > sw/source/core/undo/rolbck.cxx:635:13: error: suspicious dynamic cross cast from 'const ::sw::mark::IBookmark *const' to 'const ::sfx2::Metadatable *' [loplugin:crosscast] > dynamic_cast< ::sfx2::Metadatable const* >(pBookmark)); > sw/source/core/undo/rolbck.cxx:713:13: error: suspicious dynamic cross cast from '::sw::mark::IBookmark *const' to '::sfx2::Metadatable *' [loplugin:crosscast] > dynamic_cast< ::sfx2::Metadatable* >(pBookmark)); * include/sfx2/digitalsignatures.hxx DigitalSignatures: > sfx2/source/doc/docfile.cxx:3999:25: error: suspicious dynamic cross cast from 'com::sun::star::security::XDocumentDigitalSignatures *' to 'sfx2::DigitalSignatures *' [loplugin:crosscast] > auto xModelSigner = dynamic_cast<sfx2::DigitalSignatures*>(xSigner.get()); * include/sfx2/sidebar/IContextChangeReceiver.hxx IContextChangeReceiver: > sfx2/source/sidebar/SidebarPanelBase.cxx:105:11: error: suspicious dynamic cross cast from 'pointer' (aka 'PanelLayout *') to 'IContextChangeReceiver *' [loplugin:crosscast] > = dynamic_cast<IContextChangeReceiver*>(mxControl.get()); * include/sfx2/sidebar/ILayoutableWindow.hxx ILayoutableWindow: > sfx2/source/sidebar/SidebarPanelBase.cxx:164:44: error: suspicious dynamic cross cast from 'pointer' (aka 'PanelLayout *') to 'ILayoutableWindow *' [loplugin:crosscast] > ILayoutableWindow* pLayoutableWindow = dynamic_cast<ILayoutableWindow*>(mxControl.get()); * include/sfx2/sidebar/SidebarModelUpdate.hxx SidebarModelUpdate: > sfx2/source/sidebar/SidebarPanelBase.cxx:189:40: error: suspicious dynamic cross cast from 'pointer' (aka 'PanelLayout *') to 'SidebarModelUpdate *' [loplugin:crosscast] > SidebarModelUpdate* pModelUpdate = dynamic_cast<SidebarModelUpdate*>(mxControl.get()); * include/sfx2/xmldump.hxx XmlDump: > svtools/source/misc/embedhlp.cxx:290:27: error: suspicious dynamic cross cast from 'com::sun::star::util::XCloseable *' to 'sfx2::XmlDump *' [loplugin:crosscast] > auto pComponent = dynamic_cast<sfx2::XmlDump*>(mxObj->getComponent().get()); * include/svl/stylesheetuser.hxx StyleSheetUser: > sd/source/core/stlsheet.cxx:294:48: error: suspicious dynamic cross cast from 'SfxListener *' to 'svl::StyleSheetUser *' [loplugin:crosscast] > const svl::StyleSheetUser* const pUser(dynamic_cast<svl::StyleSheetUser*>(pListener)); * include/svl/undo.hxx SfxRepeatTarget: > starmath/source/action.cxx:45:5: error: suspicious dynamic cross cast from 'SfxRepeatTarget' to 'SmDocShell &' [loplugin:crosscast] > dynamic_cast< SmDocShell & >(rDocSh).SetFormat(aNewFormat); * include/svx/ipolypolygoneditorcontroller.hxx IPolyPolygonEditorController: > sd/source/ui/view/drbezob.cxx:127:22: error: suspicious dynamic cross cast from 'sd::SmartTag *' to 'IPolyPolygonEditorController *' [loplugin:crosscast] > pIPPEC = dynamic_cast< IPolyPolygonEditorController* >( mpView->getSmartTags().getSelected().get() ); > sd/source/ui/view/drbezob.cxx:216:26: error: suspicious dynamic cross cast from 'sd::SmartTag *' to 'IPolyPolygonEditorController *' [loplugin:crosscast] > pIPPEC = dynamic_cast< IPolyPolygonEditorController* >( mpView->getSmartTags().getSelected().get() ); * include/vcl/IContext.hxx IContext: > vcl/source/window/builder.cxx:3650:54: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IContext *' [loplugin:crosscast] > vcl::IContext* pContextControl = dynamic_cast<vcl::IContext*>(pCurrentChild.get()); * include/vcl/ITiledRenderable.hxx ITiledRenderable: > In file included from test/source/a11y/swaccessibletestbase.cxx:10: > In file included from include/test/a11y/swaccessibletestbase.hxx:22: > include/test/a11y/accessibletestbase.hxx:54:15: error: suspicious dynamic cross cast from 'com::sun::star::lang::XComponent *' to 'vcl::ITiledRenderable *' [loplugin:crosscast] > = dynamic_cast<vcl::ITiledRenderable*>(mxDocument.get()); * include/vcl/NotebookbarContextControl.hxx NotebookbarContextControl: > vcl/source/control/notebookbar.cxx:113:33: error: suspicious dynamic cross cast from 'vcl::Window *' to 'NotebookbarContextControl *' [loplugin:crosscast] > pContextContainer = dynamic_cast<NotebookbarContextControl*>(m_pUIBuilder->get<Window>(OUStringToOString(aName, RTL_TEXTENCODING_UTF8))); * include/vcl/gdimetafiletools.hxx MetafileAccessor: > vcl/source/gdi/impgraph.cxx:716:61: error: suspicious dynamic cross cast from 'drawinglayer::primitive2d::BasePrimitive2D *' to 'const MetafileAccessor *' [loplugin:crosscast] > const MetafileAccessor* pMetafileAccessor = dynamic_cast< const MetafileAccessor* >(pUnoPrimitive->getBasePrimitive2D().get()); * include/vcl/syswin.hxx VclBuilderContainer: > vcl/source/app/salvtables.cxx:7465:11: error: suspicious dynamic cross cast from 'vcl::Window *' to 'VclBuilderContainer *' [loplugin:crosscast] > = dynamic_cast<VclBuilderContainer*>(m_aOwnedToplevel.get())) * include/vcl/toolkit/field.hxx NumericFormatter: > vcl/source/window/builder.cxx:583:37: error: suspicious dynamic cross cast from 'vcl::Window *' to 'NumericFormatter *' [loplugin:crosscast] > NumericFormatter *pTarget = dynamic_cast<NumericFormatter*>(get(elem.m_sID)); * include/vcl/transfer.hxx DragSourceHelper: > svx/source/sdr/contact/sdrmediawindow.cxx:163:47: error: suspicious dynamic cross cast from 'vcl::Window *' to 'DragSourceHelper *' [loplugin:crosscast] > DragSourceHelper* pDragSourceHelper = dynamic_cast< DragSourceHelper* >( pWindow ); * include/vcl/transfer.hxx DropTargetHelper: > svx/source/sdr/contact/sdrmediawindow.cxx:126:47: error: suspicious dynamic cross cast from 'vcl::Window *' to 'DropTargetHelper *' [loplugin:crosscast] > DropTargetHelper* pDropTargetHelper = dynamic_cast< DropTargetHelper* >( pWindow ); > svx/source/sdr/contact/sdrmediawindow.cxx:145:47: error: suspicious dynamic cross cast from 'vcl::Window *' to 'DropTargetHelper *' [loplugin:crosscast] > DropTargetHelper* pDropTargetHelper = dynamic_cast< DropTargetHelper* >( pWindow ); * include/vcl/wizardmachine.hxx IWizardPageController: > vcl/source/control/wizardmachine.cxx:1274:46: error: suspicious dynamic cross cast from 'BuilderPage *' to 'IWizardPageController *' [loplugin:crosscast] > IWizardPageController* pController = dynamic_cast<IWizardPageController*>(pCurrentPage); * include/xmloff/settingsstore.hxx DocumentSettingsSerializer: > xmloff/source/draw/sdxmlimp.cxx:540:15: error: suspicious dynamic cross cast from 'com::sun::star::beans::XPropertySet *' to 'DocumentSettingsSerializer *' [loplugin:crosscast] > pFilter = dynamic_cast<DocumentSettingsSerializer *>(xProps.get()); > xmloff/source/draw/sdxmlexp.cxx:2474:41: error: suspicious dynamic cross cast from 'com::sun::star::beans::XPropertySet *' to 'DocumentSettingsSerializer *' [loplugin:crosscast] > DocumentSettingsSerializer *pFilter(dynamic_cast<DocumentSettingsSerializer *>(xProps.get())); * include/xmloff/xmlimp.hxx SvXMLImport: > sdext/source/pdfimport/sax/emitcontext.cxx:45:37: error: suspicious dynamic cross cast from 'com::sun::star::xml::sax::XDocumentHandler *' to 'SvXMLImport *' [loplugin:crosscast] > if (SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>(m_xDocHdl.get())) > writerperfect/source/common/DocumentHandler.cxx:118:37: error: suspicious dynamic cross cast from 'com::sun::star::xml::sax::XDocumentHandler *' to 'SvXMLImport *' [loplugin:crosscast] > if (SvXMLImport* pFastHandler = dynamic_cast<SvXMLImport*>(mxHandler.get())) * reportdesign/inc/RptObject.hxx OObjectBase: > reportdesign/source/ui/report/ViewsWindow.cxx:843:53: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObjBase = dynamic_cast<OObjectBase*>(pObj); > reportdesign/source/core/sdr/ReportUndoFactory.cxx:30:25: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObj = dynamic_cast<OObjectBase*>(&rObject); > reportdesign/source/core/sdr/RptPage.cxx:62:29: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObj = dynamic_cast<OObjectBase*>(GetObj(i)); > reportdesign/source/core/sdr/RptPage.cxx:77:30: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pBase = dynamic_cast<OObjectBase*>(GetObj(nPos)); > reportdesign/source/core/sdr/RptPage.cxx:116:28: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObject = dynamic_cast< OObjectBase* >(SdrObject::getSdrObjectFromXShape( _xObject )); > reportdesign/source/core/sdr/RptPage.cxx:184:32: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObjectBase = dynamic_cast< OObjectBase* >( pObj ); > reportdesign/source/core/sdr/ReportDrawPage.cxx:60:29: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pBaseObj = dynamic_cast<OObjectBase*>(pObj); > reportdesign/source/ui/report/dlgedfunc.cxx:455:25: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObj = dynamic_cast<OObjectBase*>(_pOverlappedObj); > reportdesign/source/ui/report/SectionView.cxx:177:37: error: suspicious dynamic cross cast from 'SdrObject' to 'OObjectBase &' [loplugin:crosscast] > OObjectBase& rBaseObj = dynamic_cast<OObjectBase&>(*pObj); > reportdesign/source/ui/report/ReportSection.cxx:338:29: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObj = dynamic_cast<OObjectBase*>(pSdrObject); > reportdesign/source/ui/report/ReportSection.cxx:513:38: error: suspicious dynamic cross cast from 'SdrObject' to 'OObjectBase &' [loplugin:crosscast] > OObjectBase& rBase = dynamic_cast<OObjectBase&>(*pObject); > reportdesign/source/ui/report/ReportSection.cxx:644:33: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObj = dynamic_cast<OObjectBase*>(pDlgEdObj); > reportdesign/source/ui/report/ReportSection.cxx:663:35: error: suspicious dynamic cross cast from 'const SdrObject *' to 'const OObjectBase *' [loplugin:crosscast] > const OObjectBase* pObj = dynamic_cast<const OObjectBase*>(pDlgEdObj); > reportdesign/source/ui/report/propbrw.cxx:286:33: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObj = dynamic_cast<OObjectBase*>(pCurrent); > reportdesign/source/ui/report/ViewsWindow.cxx:843:53: error: suspicious dynamic cross cast from 'SdrObject *' to 'OObjectBase *' [loplugin:crosscast] > OObjectBase* pObjBase = dynamic_cast<OObjectBase*>(pObj); * sc/source/ui/inc/IAnyRefDialog.hxx IAnyRefDialog: > sc/source/ui/app/scmod.cxx:1607:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get()); > sc/source/ui/app/scmod.cxx:1646:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get()); > sc/source/ui/app/scmod.cxx:1697:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get()); > sc/source/ui/app/scmod.cxx:1766:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get()); > sc/source/ui/app/scmod.cxx:1813:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get()); > sc/source/ui/app/scmod.cxx:1853:38: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get()); > sc/source/ui/view/tabview3.cxx:470:30: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(xDlgController.get()); > sc/source/ui/view/tabview3.cxx:2053:42: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get()); > sc/source/ui/view/tabvwsh4.cxx:210:46: error: suspicious dynamic cross cast from 'element_type *' (aka 'SfxDialogController *') to 'IAnyRefDialog *' [loplugin:crosscast] > IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pController.get()); * sd/source/filter/eppt/epptbase.hxx PPTExBulletProvider: > sd/source/filter/eppt/pptx-epptbase.cxx:497:74: error: suspicious dynamic cross cast from 'PPTWriterBase *' to 'PPTExBulletProvider *' [loplugin:crosscast] > maStyleSheetList.emplace_back( new PPTExStyleSheet( nDefaultTab, dynamic_cast<PPTExBulletProvider*>(this) ) ); * sdext/source/presenter/PresenterViewFactory.hxx CachablePresenterView: > sdext/source/presenter/PresenterViewFactory.cxx:218:36: error: suspicious dynamic cross cast from 'com::sun::star::drawing::framework::XResource *' to 'CachablePresenterView *' [loplugin:crosscast] > CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(rxView.get()); > sdext/source/presenter/PresenterViewFactory.cxx:274:23: error: suspicious dynamic cross cast from 'com::sun::star::drawing::framework::XView *' to 'CachablePresenterView *' [loplugin:crosscast] > = dynamic_cast<CachablePresenterView*>(iView->second.first.get()); > sdext/source/presenter/PresenterViewFactory.cxx:325:40: error: suspicious dynamic cross cast from 'com::sun::star::drawing::framework::XView *' to 'CachablePresenterView *' [loplugin:crosscast] > CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(xView.get()); * slideshow/source/inc/cursormanager.hxx CursorManager: > slideshow/source/engine/slide/userpaintoverlay.cxx:449:49: error: suspicious dynamic cross cast from 'CursorManager' to 'Slide &' [loplugin:crosscast] > dynamic_cast<Slide&>(rContext.mrCursorManager), * svx/source/inc/celltypes.hxx TableDesignUser: > svx/source/table/tabledesign.cxx:267:38: error: suspicious dynamic cross cast from 'com::sun::star::util::XModifyListener *' to 'TableDesignUser *' [loplugin:crosscast] > TableDesignUser* pUser = dynamic_cast< TableDesignUser* >( it.next().get() ); * svx/source/inc/tablemodel.hxx ICellRange: > svx/source/table/tablemodel.cxx:285:26: error: suspicious dynamic cross cast from 'com::sun::star::table::XCellRange *' to 'ICellRange *' [loplugin:crosscast] > ICellRange* pRange = dynamic_cast< ICellRange* >( rRange.get() ); * sw/inc/IDocumentUndoRedo.hxx IDocumentUndoRedo: > sw/source/uibase/shells/drwtxtsh.cxx:585:38: error: suspicious dynamic cross cast from 'SfxUndoManager *' to 'IDocumentUndoRedo *' [loplugin:crosscast] > auto* pUndoManager = dynamic_cast<IDocumentUndoRedo*>(GetUndoManager()); * sw/inc/IMark.hxx IFieldmark: > sw/source/core/doc/docbm.cxx:1415:15: error: suspicious dynamic cross cast from 'sw::mark::MarkBase *const' to 'IFieldmark *' [loplugin:crosscast] > : dynamic_cast<IFieldmark*>(*pFieldmark); > sw/source/core/doc/docbm.cxx:1437:16: error: suspicious dynamic cross cast from 'sw::mark::MarkBase *' to 'IFieldmark *' [loplugin:crosscast] > return dynamic_cast<IFieldmark*>(pFieldmark); > sw/source/core/doc/docbm.cxx:1570:37: error: suspicious dynamic cross cast from 'sw::mark::MarkBase *' to 'IFieldmark *' [loplugin:crosscast] > IFieldmark *pMark = dynamic_cast<IFieldmark*>(*aIter); * sw/inc/calbck.hxx BroadcastingModify: > sw/source/core/attr/swatrset.cxx:228:29: error: suspicious dynamic cross cast from 'const sw::BroadcastingModify *' to 'const sw::FormatDropDefiner *' [loplugin:crosscast] > auto pDropDefiner = dynamic_cast<const sw::FormatDropDefiner*>(pModify); > sw/source/core/txtnode/OnlineAccessibilityCheck.cxx:38:28: error: suspicious dynamic cross cast from 'SwNode *' to 'sw::BroadcastingModify *' [loplugin:crosscast] > auto* pBroadcast = dynamic_cast<sw::BroadcastingModify*>(m_pNode); * sw/inc/contentindex.hxx SwContentIndexReg: > sw/source/core/doc/DocumentRedlineManager.cxx:56:20: error: suspicious dynamic cross cast from 'SwNode *' to 'SwContentIndexReg *' [loplugin:crosscast] > assert(dynamic_cast<SwContentIndexReg*>(&pPos->GetNode()) * sw/source/core/inc/flowfrm.hxx SwFlowFrame: > sw/source/core/layout/frmtool.cxx:3044:35: error: suspicious dynamic cross cast from 'SwFrame *' to 'SwFlowFrame *' [loplugin:crosscast] > SwFlowFrame *pFlowFrame = dynamic_cast<SwFlowFrame*>(pSibling); * sw/source/uibase/inc/FrameControl.hxx ISwFrameControl: > sw/source/uibase/docvw/FrameControlsManager.cxx:283:15: error: suspicious dynamic cross cast from 'vcl::Window *' to 'ISwFrameControl *' [loplugin:crosscast] > mpIFace = dynamic_cast<ISwFrameControl *>( pWindow.get() ); * vcl/inc/IPrioritable.hxx IPrioritable: > vcl/source/control/NotebookbarPopup.cxx:40:37: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast] > vcl::IPrioritable* pChild = dynamic_cast<vcl::IPrioritable*>(GetChild(0)); > vcl/source/control/PriorityHBox.cxx:89:43: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast] > vcl::IPrioritable* pPrioritable = dynamic_cast<vcl::IPrioritable*>(pChild); > vcl/source/control/PriorityHBox.cxx:127:32: error: suspicious dynamic cross cast from 'vcl::IPrioritable *' to 'vcl::Window *' [loplugin:crosscast] > vcl::Window* pWindow = dynamic_cast<vcl::Window*>(pPrioritable); > vcl/source/control/PriorityHBox.cxx:142:32: error: suspicious dynamic cross cast from 'vcl::IPrioritable *' to 'vcl::Window *' [loplugin:crosscast] > vcl::Window* pWindow = dynamic_cast<vcl::Window*>(*pChildR); > vcl/source/control/PriorityHBox.cxx:186:43: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast] > vcl::IPrioritable* pPrioritable = dynamic_cast<vcl::IPrioritable*>(pChild); > vcl/source/window/NotebookBarAddonsMerger.cxx:128:19: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast] > = dynamic_cast<vcl::IPrioritable*>(pOptionalParent.get()); > ovcl/source/window/builder.cxx:3643:55: error: suspicious dynamic cross cast from 'vcl::Window *' to 'vcl::IPrioritable *' [loplugin:crosscast] > vcl::IPrioritable* pPrioritable = dynamic_cast<vcl::IPrioritable*>(pCurrentChild.get()); * vcl/inc/jsdialog/jsdialogbuilder.hxx BaseJSWidget: > vcl/jsdialog/executor.cxx:41:26: error: suspicious dynamic cross cast from 'weld::Widget *' to 'BaseJSWidget *' [loplugin:crosscast] > if (auto pJSWidget = dynamic_cast<BaseJSWidget*>(pWidget)) > vcl/jsdialog/executor.cxx:49:26: error: suspicious dynamic cross cast from 'weld::Widget *' to 'BaseJSWidget *' [loplugin:crosscast] > if (auto pJSWidget = dynamic_cast<BaseJSWidget*>(pWidget)) > vcl/jsdialog/executor.cxx:155:49: error: suspicious dynamic cross cast from 'weld::MenuButton *' to 'BaseJSWidget *' [loplugin:crosscast] > BaseJSWidget* pMenuButton = dynamic_cast<BaseJSWidget*>(pButton); * vcl/inc/unx/x11/x11gdiimpl.h X11GraphicsImpl: > vcl/unx/generic/gdi/salgdi.cxx:387:36: error: suspicious dynamic cross cast from 'pointer' (aka 'SalGraphicsImpl *') to 'X11GraphicsImpl *' [loplugin:crosscast] > if( X11GraphicsImpl* x11Impl = dynamic_cast< X11GraphicsImpl* >( mxImpl.get())) * xmlsecurity/inc/certificate.hxx Certificate: > xmlsecurity/source/helper/documentsignaturemanager.cxx:334:33: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast] > if (auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCert.get())) > xmlsecurity/source/helper/documentsignaturemanager.cxx:381:33: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast] > if (auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCert.get())) > xmlsecurity/source/component/documentdigitalsignatures.cxx:688:28: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast] > auto pAuthor = dynamic_cast<xmlsecurity::Certificate*>(xAuthor.get()); > xmlsecurity/source/component/documentdigitalsignatures.cxx:689:26: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast] > auto pCert = dynamic_cast<xmlsecurity::Certificate*>(xCert.get()); > xmlsecurity/qa/unit/signing/signing.cxx:130:29: error: suspicious dynamic cross cast from 'com::sun::star::security::XCertificate *' to 'xmlsecurity::Certificate *' [loplugin:crosscast] > auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCertificate.get()); Change-Id: If4f9efd8c012d0f650fe670450cf7ac0c8978036 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143458 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-23loplugin:unusedfields make some fields privateNoel Grandin
this is one of the secondary analyses this plugin performs Change-Id: Iaa4424c2396470c6f1df85b0290fbffdda35fa08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-22loplugin:unusedfieldsNoel Grandin
Change-Id: I63f4ffc1645821af78fa32d59e19799e890d4cd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143089 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-19tdf#151846 Restore XChartTypeTemplateNoel Grandin
Which I removed in commit 58766f997d59e4684f2887fd8cdeb12d2f8a9366. Turns out it does have some usefulness for extensions. So restore most of it. The exception is the getDataInterpreter method, for which I have added a placeholder, so that the restored class has the same vtable layout as the original. Change-Id: Ief9b48ef2c408580bc24b5a8a0e11131edb3b943 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142908 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-17Resolves: tdf#152087 strip any newlines from the entryCaolán McNamara
Change-Id: I965ecd89c7edaf1a02d3f94df23f09c9e9490d54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142896 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-11Drop a counterproductive top-level constStephan Bergmann
...that was apparently left by accident by 11c4ec15f13bbcc1b7a85e966519d75e64f62c4a "use more concrete types in chart2, Axis", thwarting the use of std::move here. (I came across this code with an upcoming loplugin:constmove that flags suspicious uses of std::move involving const-qualified types.) Change-Id: I75ebadf96044ceb247f232ad9f2d27fe643a7af6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142558 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-02tdf#54857 elide more dynamic_castNoel Grandin
Change-Id: I42bef355eeef15e3733a5ee57b0569887cfa5e84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-02tdf#54857 elide more dynamic_castNoel Grandin
Change-Id: I0cbdb2ee46600559d9a37f09b574d484e72a0e0d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-11-01tdf#54857 elide more dynamic_castNoel Grandin
add a helper, following the same style as the ones in sw/ Change-Id: I13c673bba5ff47df6beef9d90c200e5801030cf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142119 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-10-28It's Frame-Controller-Model, not Model-View-ControllerMike Kaganski
Change-Id: I23a867623f77502baed6639ad3e255c06673d67f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-28Implement css::frame::XController2 in ChartControllerMike Kaganski
... and use utl::ConnectModelViewController in ChartFrameLoader::load Change-Id: I9f0dae1b530c05aefdbeeb6a3b3f28d85b0eb14c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141947 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-25tdf#145759 Use symbolic constants instead of magic numerical constantsOmkarAcharekar
Change-Id: I68f9dd0bbe5a98de35253220dc33382139b4950e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141657 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>