summaryrefslogtreecommitdiff
path: root/reportdesign/source/ui/report/ReportSection.cxx
AgeCommit message (Collapse)AuthorFilesLines
2024-02-12ITEM: ItemPool Rework (I)Armin Le Grand (allotropia)1-2/+1
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-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski1-1/+1
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-31svx: Refactor (sdr) views to access the SdrModel by referenceTomaž Vajngerl1-2/+2
In SdrPaintView (and subclasses) the mpModel variable is always the same as the input (reference) model, so there is no need for that extra variable. Change the strange and confusing var. name mrSdrModelFromSdrView (the input reference to SdrModel) to just mrModel and use that in GetModel(). Change the GetModel() to return a reference instead of a pointer and reactor the code to accomodate the change. This gets rid of many nullptr checks for the pointer that the GetModel() returns and makes the code more simple is some cases. Change-Id: I18351a417fd82f49262a83de036ec1420a65399c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146373 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-14use more VCLXPopupMenu instead of XPopupMenuNoel Grandin1-3/+2
which avoids a bunch of casting and makes the dependency explicit instead of implicit Change-Id: I754da72916fbbc51e7edc3c806155da34d347bd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-29ref-count SdrObjectNoel Grandin1-5/+5
Which means we can get rid of the majestic hack of ScCaptionPtr Previously, SdrObject was manually managed, and the ownership passed around in very complicated fashion. Notes: (*) SvxShape has a strong reference to SdrObject, where previously it had a weak reference. It is now strong since otherwise the SdrObject will go away very eagerly. (*) SdrObject still has a weak reference to SvxShape (*) In the existing places that an SdrObject is being deleted, we now just clear the reference (*) instead of SwVirtFlyDrawObj removing itself from the page that contains inside it's destructor, make the call site do the removing from the page. (*) Needed to take the SolarMutex in UndoManagerHelper_Impl::impl_clear because this can be called from UNO (e.g. sfx2_complex JUnit test) and the SdrObjects need the SolarMutex when destructing. (*) handle a tricky situation with SwDrawVirtObj in the SwDrawModel destructor because the existing code wants mpDrawObj in SwAnchoredObject to be sometimes owning, sometimes not, which results in a cycle with the new code. Change-Id: I4d79df1660e386388e5d51030653755bca02a163 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann1-1/+1
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-11tools: rename getHeight/Width() to GetOpenHeight/Width()Chris Sherlock1-9/+9
By default Rectangle uses closed interval, if we really want to use half open intervals then we should specifically say as such in the name. Change-Id: Id7a91120ba1a1a4bc330014216b73a692dbf03a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136575 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-24clang-tidy modernize-pass-by-value in reportdesignNoel Grandin1-2/+3
Change-Id: I2c005a2f66139237cb1ebf09812f31fb08f53c90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136397 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in reportdesignStephan Bergmann1-3/+3
Change-Id: If8b6f8f7facf36f740b2e1773e923e28d8c85552 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133792 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-30Recheck modules [o-r]* with IWYUGabor Kelemen1-1/+1
See tdf#42949 for motivation Change-Id: I6b4b05a5e59b256653c4caf5297fffd601b45083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128845 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-07remove E3D_INVENTOR_FLAG and convert SdrObjKind to scoped enumNoel Grandin1-2/+2
We don't need E3D_INVENTOR_FLAG, we can just check if the SdrObjKind is in the right range. Which exposes some dodgy code in DrawViewShell::GetMenuStateSel SfxItemState::DEFAULT == rSet.GetItemState( OBJ_TITLETEXT ) || SfxItemState::DEFAULT == rSet.GetItemState( OBJ_OUTLINETEXT ) || which has been there ever since commit f47a9d9db3d06927380bb79b04bb6d4721a92d2b Date: Mon Sep 18 16:07:07 2000 +0000 initial import just remove that. In SwFEShell::ImpEndCreate() move some logic around to avoid using an out-of-range SdrObjKind value Change-Id: I4620bfe61aca8f7415503debe3c84bfe5f4368a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127763 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-30Prepare for removal of non-const operator[] from Sequence in reportdesignMike Kaganski1-7/+8
Change-Id: I7631aeb90bf224ba7a00025df6e3fa444b216a42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124380 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski1-1/+1
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-08use more SfxItemSetFixedNoel Grandin1-4/+3
Change-Id: I18784bac5f7ad1d109f8a81e96084cd6e9548231 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123240 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-19Move svl::Items to include/svl/whichranges.hxx, and unify its usageMike Kaganski1-1/+1
... in WhichRangesContainer and SfxItemSet ctors. Now it's not needed to explicitly use 'value' in WhichRangesContainer's ctor, or create an instance for use in SfxItemSet ctor (svl::Items is already defined as a template value of corresponding type). Instead of WhichRangesContainer Foo(svl::Items<1, 2>::value); SfxItemSet Bar(rItemPool, svl::Items<1, 2>{}); now use: WhichRangesContainer Foo(svl::Items<1, 2>); SfxItemSet Bar(rItemPool, svl::Items<1, 2>); Change-Id: I4681d952b6442732025e5a26768098878907a238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119157 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-05-17split OutputDevice from WindowNoel Grandin1-1/+1
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-09Recheck include/ with IWYUGabor Kelemen1-0/+1
See tdf#42949 for motivation Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-23construct XPopupMenu without directly creating a VCLXPopupMenuCaolán McNamara1-2/+8
Change-Id: If890828855a61cb315939424499949300549a968 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111382 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-23use XPopupMenu::execute to run the menuCaolán McNamara1-2/+5
instead of cheating and pulling the vcl::Menu out of it Change-Id: I09292eaf8b3f5e32fc1e27e0020b84606cdf67cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111381 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-16loplugin:referencecasting in reportdesignNoel1-2/+2
Also, I needed to add castToXInterface() to the upcasting Reference::Reference constructor, to resolve ambiguity in casting to XInterface. Change-Id: Ica60190bc842444c37de56407b586aa267f08372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-04use more getSdrObjectFromXShapeNoel1-4/+2
Change-Id: Ia237643ab040425f231f781c86e7e060f0b53717 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110400 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-16make the Color constructors explicitly specify transparencyNoel1-2/+2
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-02introduce Degree100 strong_int typeNoel1-1/+1
Change-Id: I78f837a1340be0ca5c49097f543a481b7b43a632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108367 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-23add utility NbcRotate methodNoel Grandin1-4/+1
Change-Id: I66d016a22158f9f9ef68a80842e95e45516f0b4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108228 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-15don't need to include vcl/menu.hxx hereCaolán McNamara1-0/+1
Change-Id: I16c4c2fd84ea8af6b7601e49c38630bbbfdb2cb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107746 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-01OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTIONNoel1-3/+3
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10new loplugin:simplifypointertoboolNoel Grandin1-1/+1
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-05tdf#42949 Fix IWYU warnings in reportdesign/*/*cxxGabor Kelemen1-10/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ica1a10a8f8fff7c3780adcc30b2c8d0e385b1326 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93307 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-07loplugin:unusedvariableplus in reportdesignNoel Grandin1-1/+1
Change-Id: Ie8568f524a1f804e07890ee7828a81f1752fcfd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91793 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-02loplugin:flatten in reportdesignNoel Grandin1-158/+158
Change-Id: I6d8b2730cede4453e7afd581cc24ed101ca6c81b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91557 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-26iAvoid explicit casts to smaller sal_uInt32 from larger longStephan Bergmann1-2/+2
...in what might be attempts to avoid warnings about signed vs. unsigned comparisons. Change-Id: I0e689d8b730170f35107cbdf46c3d8cd9a593367 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87456 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-09loplugin:redundantpointeropsStephan Bergmann1-1/+1
(All related to uses of std::shared_ptr, which builds against libstdc++ apparently missed (fix forthcoming) and which I only now found with my macOS build against libc++.) Change-Id: If581e689f0e5ff62d9ce35513c9ff87b00328766 Reviewed-on: https://gerrit.libreoffice.org/80548 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-17Simplify Sequence iterations in postprocess..saxArkadiy Illarionov1-11/+6
Use range-based loops, STL and comphelper functions Change-Id: If738d8f4e792c4686870183b0c0fdfbb61fd3351 Reviewed-on: https://gerrit.libreoffice.org/77245 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-07-23dispose() methods should clear their smart pointersNoel Grandin1-0/+2
especiall the ref-counted ones Change-Id: Ib3bb029043b1b923010ef4a47bfc377e1f569da7 Reviewed-on: https://gerrit.libreoffice.org/76102 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-17Add comphelper::getUnoTunnelImplementation templateArkadiy Illarionov1-2/+2
Use it instead of classname::getImplementation from UNO3_GETIMPLEMENTATION_* Change-Id: Ifcc8cfcd6369c576250008c76ce31ba79ea3a596 Reviewed-on: https://gerrit.libreoffice.org/74107 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-17Use hasElements to check Sequence emptiness in [l-r]*Arkadiy Illarionov1-1/+1
Similar to clang-tidy readability-container-size-empty Change-Id: Idd67f332b04857a39df26bad1733aae21236f105 Reviewed-on: https://gerrit.libreoffice.org/71764 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-10tdf#62699 Drop pass-through header file include/svx/svdattr.hxxGabor Kelemen1-0/+1
Change-Id: I04289589196ac69b31f75989d9252c79d03c890f Reviewed-on: https://gerrit.libreoffice.org/71633 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-27tdf#120703 PVS: V581 ifs with identical conditionsMike Kaganski1-4/+1
V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Change-Id: I79c655a072faff0bdb2af031ed1328e684b83aac Reviewed-on: https://gerrit.libreoffice.org/71430 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-13loplugin:sequentialassign in oox..reportdesignNoel Grandin1-2/+1
Change-Id: I59ef0a6da411b8af8bdf8d8efb1d733db7475d9c Reviewed-on: https://gerrit.libreoffice.org/70707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-12Simplify containers iterations in reportdesign, sal, saxArkadiy Illarionov1-35/+32
Use range-based loop or replace with STL functions Change-Id: If6b734dab12a7298fce16003d3d175305fbe798d Reviewed-on: https://gerrit.libreoffice.org/67701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21tdf#42949 Fix IWYU warnings in include/vcl/[B-E]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Iabe571aa8f00492902c499094bea8365a3e17fca Reviewed-on: https://gerrit.libreoffice.org/63623 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-10-30Revert tdf#120782, tdf#120728, tdf#120152, tdf#120151Julien Nabet1-1/+0
The first fixes were wrong and only brought some regression Change-Id: I5e47393b454ca9dc73d87ac4277fa48a3d8bf38d Reviewed-on: https://gerrit.libreoffice.org/62530 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin1-1/+1
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-07tdf#120151: fix crash in edit reportJulien Nabet1-0/+1
Change-Id: I5ac7960233b615a3dd163cf1ab8355753948240e Reviewed-on: https://gerrit.libreoffice.org/61152 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-09-17New loplugin:externalStephan Bergmann1-1/+1
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-10loplugin:simplifyconstruct in reportdesign..saxNoel Grandin1-2/+0
Change-Id: I7d2a754cdc5576b5a5b35db2fbffd19ea17c16ff Reviewed-on: https://gerrit.libreoffice.org/60224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-25SOSAW080: Derive SdrObjGroup from SdrObjListArmin Le Grand1-4/+1
Also simplify parent/child relationships, get rid of double data (SdrPage/Parent infos in SdrObjects, also in SdrObjList). This is all not needed - when a SdrObject is inserted to a SdrPage, get SdrPage by traveling over parents (no double info, member as soon as inserted, ...). More cleanups/reworks included, will need some more cleanups, too. Stabilizing: SetRectsDirty/DefaultStyleSheet Had to correct the SetRectsDirty stuff for 3D due to going down the hierarchy while the 2D implementation goes the other direction -> endless loops. Added special handling for 3D stuff for now (will be chnaged again when SnapRect is no longer needed at SdrObject level). Also had to adapt how the DefaultStyleSheet is set at incarnated SdrObjects - better: their properties. Since we now always have a SdrModel, it is possible to correctly initialize with the correct default StyleSheet from that SdrModel. This needs to be done after ForceDefaultAttributes and in a way that again deletes Items that are set in the StyleSheet. This leads to an error in CppunitTest_sd_import_tests where I checked tdf100491 - it is okay and thus I change the control instance of the imported, XML-dumped file. The less hard attributes, the better for Styles in general. Cleanup of comments for last two commits Corrected SvxShape::getParent() Needed to get the direct parent, so test for SdrObject first (to get SdrObjGroup/E3DScene), for SdrPage second Fixed CppunitTest_sc_subsequent_export_test Several problems arose. The used SdrCaptionObj was Cloned, but the clone not inserted to a SdrPage. This leads to not being able to access a UNO API imlementation of the SdrPage (SvxPage) on lower levels. It worked before due to SdrObject having a SdrPage* additionally to being added to a SdrPage - this is exactly the main cleanup this change does. Looked for why it is cloned, could see no reasons. The SdrCaptionObj exists during all im/export, not difference to other SdrObjects (that do not get cloned). It is not changed in any way. It *might* be to suppress a crash that happened due to UNO API Service emfio/emfio not being available in the UnitTest scenario. Interestingly it did not crash with the cloned SdrCaptionObj, but the Graphic exported was probably wrong. Fixed by no longer Cloning the SdrCaptionObj and adding emfio/emfio UNO API Service. d139f821a5b39535a3e7b9c6261df7e18f8ae8ac 910e7f4bc628a715fda7545dffaf3369d5e76ea0 ca1de01b723051e09ac37d7ec7bba978beea41c5 3a76da1471dfe75e69847f64a6a3519ad21c8c9c Change-Id: I986586e326b563acebf00d931a7084c6eb09e5f8 Reviewed-on: https://gerrit.libreoffice.org/54689 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-05-08tdf#116977 secured ::Clone methodsArmin Le Grand1-2/+2
Renamed SdrPage::Clone -> SdrPage::CloneSdrPage Renamed SdrObject::Clone -> SdrObject::CloneSdrObject Giving SdrModel is no longer an option, but a must (as reference). This makes future changes more safe by force usage to think about it. Also equals the constructors which already require a target SdrModel. Done the same for ::CloneSdrPage. Change-Id: I06f0129e15140bd8693db27a445037d7e2f7f652 Reviewed-on: https://gerrit.libreoffice.org/53933 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-04-19tdf#42949 Remove unnecessary localization headers from reportdesignGabor Kelemen1-1/+0
Found by searching for the header names and the localization function: git grep -l -e \<core_resource.hxx\> -e \<strings.hrc\> reportdesign/ | xargs grep -c RptResId | grep :0$ | grep -v /pch A few false positives were omitted from the commit. Change-Id: I93a17a3edb2c9ab89a913c92541eafb250086201 Reviewed-on: https://gerrit.libreoffice.org/52910 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-07SOSAW080: Added first bunch of basic changes to helpersArmin Le Grand1-4/+7
SOSAW080: Make SdrModel& prerequisite to SdrObjects Added need for SdrModel& in constructors of SdrModel, SdrPage, SdrView and SdrObjList. Builds, not finished. SOSAW080: removed and replaced old SdrModel Removed and replaced GetModel()/SetModel() in all using classes (SdrObject, SdrPage, SdrView), added accessors to new referenced SdrModel, adapted all accessing places. Refactored/Extended ::Clone and ::operator== for these classes to allow cloning objects to a target SdrModel. Adapted places where this is done AFAP. Added quite some comments (tagged with 'TTTT') where possible further work is needed. Builds completely, thus checking in. This does not mean that this change is done yet. SOSAW080: Adapted SdrPage/SdrModel relationship Also needed to work on copy-construction of SdrPage and hierarchy, quite some stuff removed, no copy-constructor anymore, no MigrateItemPool stuff. Builds well, test stuck, will need some cleanup/finetunung SOSAW080: Smaller corrections/includes adapted SOSAW080: Smaller corrections/includes adapted SOSAW080: Debugging/Stabilizing/MakeUnitTestWork SOSAW080: Stabilized for UnitTests, cleanups SOSAW080: Adapted GetObjGraphic to just take a const SdrObject& SOSAW080: Removed ChangeModel from classes Classes SvxTextEditSource and SvxDrawPage (including TextEditSource stuff) do not need change of SdrModel anymore. SOSAW080: Adapted some comments to make more readable SOSAW080: Corrected constructor SOSAW080: getSdrModelFromUnoModel added override marks SOSAW080: Added missing includes SOSAW080: Corrected SdrPage constructor SOSAW080: Corrected some SdrObject::Clone scenarios Especially when cloning to another SdrModel and taking the sdr::properties into account. SOSAW080: Added include for Mac-Build SOSAW080: Added Scale to DefaultProperties If a SdrModel change happens in DefaultProperties copy constructor (used from Clone()), potentially a Scale for the SfxItems has to be done. SOSAW080: Added missing include for MacBuild SOSAW080: Corrected CppunitTest_sc_anchor_test An adaption of a SdrPathObj instantiation was missing, added that. Seems as if that test is no tpart of the usual 'make' scenario, but used/executed in gerrit builds SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Free SdrObjects when SdrModel goes down In an UNO API test problem is that SvxShapes reference SdrShapes, but these are not added to a SdrPage and not 'owned' by the SvxShape. Thus these do not get deleted at all (same in master, memory leak). I extended SvxShape::Notify the case for ModelCleared to also Free the SdrObject when not owner and it's not added to a SdrPage (in that case it gets deleted with deleting the SdrModel) SOSAW080: Solve UNO API calls that move SvxShapes to other Model Due to UNO API tests I got a call to insert an xShape to a xDrawPage which was constructed in another Model, this has now to be done by Cloning the SdrObject to the new SdrModel, getting rid of the old one and getting all the UNO implementation stuff right (referemces SdrObject <-> xShape). 1cb7d573d323e98a89761fe662c10c4a654fdec0 24617494a0ef79f6e33dfcb02782a833a81c6434 763f39094b6a48b529a6952d01468f8776c97679 242b9e228a9a042c3a5bdd38b1ea6600144276d5 242b9e228a9a042c3a5bdd38b1ea6600144276d5 33a6f3f306b70c223171aef796dd5ee041ad14df 6878b33f8b05738a44c0910e40a60a0f0d1d58ed 0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2 8c4626274a5cc531dad27f27c0c45d4c528fb2fb 446685a49a6d67aedd01cfbbd5e87b07f97a4d7b c1b5ed3c99bc7219a0061e4ece24ea42afd2889a 22de9a1c8af7c25be5c108671ddc548ba323ed47 4caf6b6fbbe6e8130741d793dffb560fd01d4ed5 488b9601735ec1822433f82f633990063951fe08 c366d60299f239e3df856ddffedb19e743e4be0c c5137ba8c597c7b5f90318df50e87b93a39a28dc f9e646242cf89f6fde1315046952252a2c429779 f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410 1694b54903df784385abaa8452e1201e12344238 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 7b5c241faec7488924e5935ae8b19f785846b5e4 bf097ee7467895823fbd158a2a9543da3b5a5078 Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c Reviewed-on: https://gerrit.libreoffice.org/52526 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>