summaryrefslogtreecommitdiff
path: root/svx/qa
AgeCommit message (Collapse)AuthorFilesLines
2024-07-20CairoSDPR: Support direct RGBA paint of PolyPolygonsArmin Le Grand (Collabora)1-2/+2
Change-Id: Id1480297126bcc422945df7cd47993cc7fe5c22a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170768 Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> Tested-by: Jenkins
2024-07-02BootstrapFixture: get rid of mxComponentContextXisco Fauli1-1/+1
Change-Id: I0318485c3c0159277e47096e0c7e0df8ed109ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169865 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-06-18loplugin:ostr in variousNoel Grandin1-4/+4
Change-Id: I7aa8ed716998a185996482dc561219b398a1c919 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169080 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-06-06tdf#153008 svx: impl crop for stretched bitmap fillAttila Szűcs2-3/+65
The ticket had a pptx with a: <a:blipFill> <a:stretch> <a:fillRect ...> Impress loaded the fillRect as a crop, but never used. Implemented a crop in SdrFillGraphicAttribute::createFillGraphicAttribute because in the case of stretching, it blindly used the whole picture. Cropping data was not available there so it is copied into OffsetPosition, and Size Change-Id: I195cc40a35dc24c708e7c0e3cdbe40d6e47b8ce5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168391 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-16WaE: C6011 Dereferencing NULL pointer warningsCaolán McNamara3-1/+9
Change-Id: If4ca47bc4d8203ed7d20e1bbf1c3ebe2587c403f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167709 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-05-14tdf#84507 move contour text to correct place in rotated...Regina Henschel3-0/+847
...path objects. I first tried to change the UnitPolyPolygon in ViewContactOfSdrPathObj::createViewIndependentPrimitive2DSequence(). But it is needed in that way to draw the geometry of the object. Now the change is made in SdrTextObj::impDecomposeContourTextPrimitive(). The basic idea is to recover the original PolyPolygon and transform it so, that the transformed text is placed into the transformed PolyPolygon. The ObjectMatrix gets a translation then, which moves the transformed text to the correct position in the PolyPolygon. For East Asian writingmode tb-rl, the text start needs to be top-right. Added that, which resolves bug 128433. If the shape has a fat stroke the text reaches into the stroke currently. I have changed the code so that now a reduced area for the text is used. The polypolygon behaves now same as the legacy rectangle. Sometimes not all text is drawn although the rotated PolyPolygon would have enought place for it. Or in other cases the text spills out of the PolyPolygon. But I don't know a solution yet. As the other changes are an improvement, this problem can be solved later. Change-Id: I951024bf0d6d992587ec9cf2ed37665f322b66fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167299 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-05-11loplugin:ostr in svxNoel Grandin13-190/+207
Change-Id: Ia765a03e033acb82e367873380d289587ea87d6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167449 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-04-20Return double from OutputDevice::GetTextArrayMike Kaganski1-12/+6
And introduce GetTextWidth / GetTextHeight variants returning double. It allows to avoid premature rounding. At least in one case - testTdf145111_anchor_in_Fontwork - it allowed to make the test DPI-independent (at least in my testing on Windows, using 125, 150, and 175% UI scaling). Change-Id: I973d2c729ec6bb7114b4f99b9027f1ead7c1d061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166237 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-14Round in XmlWriter::attribute when passing a doubleMike Kaganski2-13/+13
Before, it truncated. Rounding provides a closer value. Change-Id: I213e6ae34ada2f5081cb2c8b2ef431448c712b37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165947 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-31Fix typoAndrea Gelmini1-1/+1
Change-Id: I606c3eb804cba508638ac401b35a8bea4e961807 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165588 Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2024-03-30tdf#160421 flip lights too for flipped extruded shapesRegina Henschel2-0/+42
If an extruded custom shape is mirrored, the lights in the scene are also mirrored. This should not happen. MS Office keeps the light direction in relation to the camera direction for binary files and pptx files with legacy camera. We should do the same, especially since the UI does not allow the user to set the light directions at arbitrary angles. Otherwise the shape receives only ambient light. Change-Id: I091d78c581b3d247f8b0680cd57654e3df330cdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165562 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-02-12make BufferedDecompositionPrimitive2D store a Primitive2DReference..Noel Grandin2-7/+7
.. instead of a Primitive2DContainer. The container very frequently contains only a single item, since the decomposition method often sticks only a single top-level node in there, so it turns out to be a net loss overall, memory consumption-wise. Also, if we return a single Primitive2DReference from a BufferedDecomposition, that maximises the sharing of data between the BufferedDecomposition objects at the bottom of the decomposed tree, and objects higher up. Change-Id: Iaf272e60e2997299cc35a1bd209c51b6b79e9a8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162976 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-12ITEM: ItemPool Rework (I)Armin Le Grand (allotropia)1-6/+0
Driving forward the Item reworks I now take the ItemPool in focus: It now does not hold any items anymore and should be renamed to something like ItemInfoProvider/ItemHelper, since it's main purpose is to provide the Defaults for the Item functionality. There is that SfxItemInfo, only a struct and bundling SlotID and ItemFlags. There are also the DefaultItems, just handled as ptrs in an array. It is/was always error-prone to keep these in sync. Remember that it's also necessary for the order to not only being sorted but being increments of one with no gaps allowed in the WhichIDs to which the Items are bound. I now bundled that to a new class ItemInfo that joins WhichID, SlotID, ItemFlags and the default Item. This is a pure virtual base class, it comes in three derivations: (1) ItemInfoStatic: This is supposed to be global static and hosts the Item in a std::unique_ptr to ensure cleanup. It is designed to be constructed once during runtime and being shared globally. It allows the ItemPtr to be nullptr to mark as non-static (if initial static is not possible for some reason) but still offers the needed data. Most cases (95%+) are of that case. The contained Item is owned by that instance. The flag isStaticDefault() is set at the Item. (2) ItemInfoDynamic: This is supposed to be used for cases where the Item cannot be static: Mainly for SfxSetItem (that needs a Pool itself in the contained SfxItemSet, so lifetime is bound to that Pool), but other cases showed up in the transition. These instances live while the Pool lives and get destructed when the Pool goes down. Also uses std::unique_ptr for the Item instance for as much automated cleanup as possible, the contained Item is owned by that instance, the instance by the Pool. The flag isDynamicDefault() is set at the Item. (3) ItemInfoUser: This is used for UserDefaults that can be set for every ItemInfo entry to 'overshadow' the default from the 'outside'. It uses a regular Item and the central access methods implCreateItemEntry/ implCleanupItemEntry to manage the Item instance, thus works like a SfxPoolItemHolder. The Item instance can be globally shared and re-used even when the Pool goes down. Instances belong to the Pool and are cleaned up when the Pool goes down. This Item does not need any further flag to be set. The ItemInfos are organized using a class called ItemInfoPackage: This bundles groups of ItemInfoStatic to functional instances. There are derivations/ implementations of this e.g. for Writer ItemPool bundling all the needed defaults for Writer, similar for draw/impress, Calc and other usages. These ItemInfoPackage can be 'registered' at an ItemPool using it's method registerItemInfoPackage. This does all the needed stuff to setup that group of ItemInfos at the Pool (It even sets internal vars First/LastWhich, that info can just be derived from the buildup ItemInfo Ptrs). The ItemInfoPackage has methods 'size()' and 'getItemInfo(index) to allow looping over it and deliver the infos the Pool needs. The (forced, pure virtual) overloads of getItemInfo in the specific implementations check for the ItemPtr being nullptr and create a exclusive incarnation of ItemInfoDynamic for the Pool if needed, returning that. The Pool owns the ItemInfoDynamic incarnations and uses the ItemInfoStatic directly. On shutdown it cleans up the ItemInfoDynamic as needed. The ItemInfoUser is used by the Pool when a UserDefault is set/used: for SetUserDefaultItem, GetUserDefaultItem, ResetUserDefaultItem. It is not held in a 2nd list, but directly in the list of ItemInfo'ptrs: To keep track of this an unordered_map is used that helds the original ItemInfo associated with the WhichID. That way no two lookups (as before) are needed to get the current Pool's default for any WhichID. The derivations of ItemInfoPackage are encapsulated and just allow access to an ItemInfoPackage& with a single method as return value. All use a static local instance of a std::array<ItemInfoStatic, FIXED_SIZE> which constructs all ItemInfoStatic and the static Item instances - if already possible. Sometimes it is necessary to overload the constructor to set some static instances for Items later than the lib init. These are also just marked with nullptr as Item instance. Some need to overload getItemInfo to complete instances of ItemInfoStatic, if needed, or create and deliver instances of ItemInfoDynamic. The registerItemInfoPackage also offers a optional lambda callback: there were two cases where local data from the Pool was needed to incarnate the item - just add that to the call to registerItemInfoPackage if needed, see examples in the adapted code. For the re-use of Items this means that now in SfxItemSet/SfxPoolItemHolder *true* static Items can and will be used without RefCount directly and globally. This is also the case for dynamic Items, with the exception of differing Pools for SfxSetItems which cannot be done. Future: That design is already prepared to allow solving that Pool-chaining problem: currently there are master/sub-pools and all accesses have to traverse that structure before even doing anything. For the future the idea is more to 'compose' a Pool by registering ItemInfoPackages, e.g. for Writer pool you may start with SfxItemPool, register the writer-specific ItemInfoPackage, then the one for DrawingLayer (if needed) and the one for EditEngine. It should also be possible to get to smaller granularities of that packages. Ideas for new ones will emerge. We might also think about composing Pools which can e.g. run Writer and Chart, so allowing to use Chart *without* OLE stuff in Writer - just ideas... More changes: - Adapted all stuff, cleaned up old stuff/ definitions - Removed FreezeIdRanges, that can be done once per Pool on-demand (and cannot be forgotten to be called) - Merged XOutdevItemPool with SdrItemPool and offered a ItemInfoPackage which joins both needed sets of Items - All the cleanup hassle with Pools and defaults cleaned up - Adapted all access methods of the pool to use that new stuff. Pool chaining currently stays, but I use a central method 'getTargetPool' instead of recursive calling to get the correct Pool for the action Change-Id: I2b8d3d4c3cc80b1d0d0b3c0f4bd90d7656b4bab7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163157 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2024-02-10tdf#141908: replace usage of sal_Int32 with colorsvarshneydevansh1-2/+2
Change-Id: I71d94239c155f41d4535c023ea3aa8f974fcf2da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163082 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-02-04Move mnTransparenceForShadow down to SdrCellPrimitive2DNoel Grandin4-13/+13
where it belongs. It appears it was only put into BufferedDecompositionPrimitive2D so that it can be accessed by Primitive2DXmlDump, so fix that by creating an extended version of the dumper for use in svx. Change-Id: Idb0b849c4fa538bbede882e48c2d090669c2325a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski2-6/+6
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>
2024-01-23tdf#97361 Make unittests more pythonic: XIndexAccessChenxiong Qi1-2/+1
Change-Id: I05ef274dd0ad5dc35b5455cfc01feabc6c0820a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161276 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-01-03UnoApiTest::loadFromURL -> UnoApiTest::loadFromFileMike Kaganski9-69/+69
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>
2023-12-30tdf#146619 Recheck svx/ with IWYUGabor Kelemen3-9/+0
Change-Id: I99650b50587294c20b1e92270e541140d9ec9cae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161240 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-12-07simplify and modernise ScopedBitmapAccessNoel Grandin1-4/+4
(*) 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-11-29Extended loplugin:ostr: svxStephan Bergmann1-2/+2
Change-Id: Ia3ff6c27bdb4c59fa20c976c4ca4cdee12f1c91c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160100 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-22Fix typo in codeAndrea Gelmini1-1/+1
Change-Id: I2e9ba39aeb838b019464363612505edb5a7c6353 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159832 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-22tdf#148000 impress: improve fontwork text placement.Attila Szűcs4-0/+39
Improved the calculation of positions of text characters for multi-line texts. The previous version only fitted the text to the basic outline (curve), and then scale them to the appropriate text line. This means that the text will be wider or shorter, depending on the shape of the curve, and which line it is on Now it calculates a curve for each paragraph and fits text on it. Text will be approximately the same width on each line. Except if the text is wider as the curve. Because then it shrinks the text to fit on the curve. (this can only happens on inner curves) Reused the same compat flag that was used in bug148000, now it serves as a Powerpoint compatible mode for FontWork, so no need to create new compat flag every time FontWork has improve. That means that the Fontwork in old documents has remains the same Refactored horizontal/vertical alignment, but had to keep the old hacks as well. Note: if there are too many lines of text, and the vertical alignment causes internal curves, then curves can shrink to 0 length (center point of a circle) or even to negative length, These cases are impossible to display normally, so it will be glitchy similar to how it was before this patch. MS PowerPoint avoid these cases by not allowing vertical alignments that would result internal (smaller) curves. Added unittest to check legacy-odb / new-odp / pptx file. It change the display of fontwork, so in some cases it may feel like a regression. Change-Id: Iac2d9bc751bbc2b6f747c33958f969cb3543fae5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159776 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-19Extended loplugin:ostr: svxStephan Bergmann5-105/+106
Change-Id: I290b1c60c8030b5345a1c2fa3816e83e21967cf6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159671 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-07ITEM: Get away from classic 'poolable' Item flagArmin Le Grand (allotropia)1-2/+2
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-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: svxStephan Bergmann1-7/+7
Change-Id: Ib5028b826a3f62303b9e0502af70ad62c578fbb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158240 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann1-5/+5
...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-07loplugin:ostr: automatic rewriteStephan Bergmann1-2/+2
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-05related tdf#123983: don't open test file read/write from src treeThorsten Behrens1-1/+1
Change-Id: I7f09a78076fa67447ead82ac7dc8556d840d5697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157576 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-10-02tdf#157543 Add glue points to binary 5-point starRegina Henschel2-0/+110
The patch adds the glue points defined in 'Microsoft Office Drawing 97-2007 Binary Format Specification' to our corresponding preset 'msoStar'. This star shape is contained on page 1 in odp/shapes-test.odp. It had previously no glue points, but now it has five glue points. Thus I have updated the xml dump. Import from pptx is still broken, tracked in tdf#157216. Change-Id: Ifc9f28118fe23a3d37af0357b72bb23eeef6b894 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157446 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2023-09-06related: tdf#150557: improve test a bitXisco Fauli1-0/+18
Change-Id: Idf596d26a6b9cce29ae690a4975bff70f5f05ea2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156611 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-09-05tdf#150557: svx: don't factor in transparence twice for cell shadowsSarper Akdemir1-8/+6
multiplying child transparence with shadow alpha to get the correct shadow alpha has been incorrect maybe since commits: 7eb4f92ed90e13ce5cbf7286fae623770e71324c, e735ad1c57cddaf17d6ffc0cf15b5e14fa63c4ad In ShadowPrimitive2D::create2DDecomposition the shadow-casting primitive's alpha(mask) itself is already being taken into account. Therefore getting cell shadow alpha by multiplying child transparence with shadow alpha, has the effect of child transparence being applied twice for the table cell. Change-Id: I78f9bbfcb0694a86eabc061330677784e887b5dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156528 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-08-23move theme test from svx to sd - so we can use ThemeColorChangeTomaž Vajngerl2-139/+0
Change-Id: I39cdc3baf81d3cb75d21ec963c05be57b97f30ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155865 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-15ComplexColor various clean-up and (trivial) refactoringsTomaž Vajngerl2-4/+4
Don't allow access to member variables of ComplexColor and makes them private. Needs a lot of changes. Change "scheme" to "theme" to be more consistent. In LO we usually call the "theme color" what is usually refered to as "scheme color" in OOXML, where it is sometimes refered to as "scheme" and other times as theme color. Remove ThemeColor class which was replaced with CmplexColor some time ago. Remove un-needed includes and un-needed components. Use isValidThemeColor in many places where we check that the ComplexColor is of "Theme" type and that ThemeColorType is set to a valid value. Change-Id: I325595fa65b8e56a4707e9d22acc6330aac28961 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155359 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-07-23tdf#156234: Don’t round glyph coordinates when doing subpixel positioningKhaled Hosny1-4/+4
When doing subpixel positioning (i.e. OutputDevice is in map mode), delay the rounding of the glyph coordinates after converting from pixel to logical units to minimize the loss of precision as much as possible. Some test expectations, expectedly, changes due to the improved positioning precision. Change-Id: I2591e3c7d4923ba7886a35bf53db759273354e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154292 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-21tdf#154955 svx: PDF/UA export: tag SdrObjGroup properlyMichael Stahl1-2/+3
ISO 14289-1:2014, 7.3 Graphics Graphics that possess semantic value only in combination with other graphics shall be tagged with a single Figure tag for each group. Also produce the missing alt-text. Change-Id: I78e802d8e17a29c2d19fcf3a7ec9961f8f04e391 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154684 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-21Removed executable bits on xml fileAndrea Gelmini1-0/+0
Change-Id: I594bcf47eedcb2ee6964ea48f3a4bdffdb0734c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154682 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-07-20tdf#150302 Fix FontworkSameLetterHeights button in DrawMatt K2-0/+450
This change fixes the Font Work Bar SameLetterHeights button at the bottom of Draw when opening a file without a FontWorkSameLetterHeights property initialied in the XML of the file. The change now applies a default property value which allows the button to properly work and switch the boolean value of property which can then be saved in the XML of the file. Also added a unit test which checks for the correct property value after toggling the button 2 times. The command to run the new unit test is: make CppunitTest_svx_unit CPPUNIT_TEST_NAME=testTdf150302 Change-Id: Id55eaedb625139f0071cdca5f628a0766afab0fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154402 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-06-26new loplugin:constexprliteralNoel Grandin1-7/+7
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-12use ComplexColor instead of ThemeColor for better OOXML compat.Tomaž Vajngerl2-34/+31
In OOXML a color definition includes more represenations, one of which is scheme color (which is what is implemented in ThemeColor currently), but it supports other representations too (RGB, HSL, System,..). ComplexColor includes all the representations, so to have a better compatibility with OOXML, this changes all uses of ThemeColor to ComplexColor. In many cases the usage of ComplexColor isn't the same as the usage of ThemeColors, but this cases will need to be changed in a later commit. Change-Id: I9cc8acee2ac0a1998fe9b98247bcf4a96273149a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151492 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-05-10Remove duplicated includeAndrea Gelmini1-1/+0
Change-Id: I324844e4ff628c6a72621a2b1511cc5b7f390901 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151588 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2023-05-09merge GalleryStorageLocations with GalleryBinaryStorageLocationsNoel Grandin1-7/+6
Change-Id: Icf9a942047f212132d7b543cd1b1a857f8f95223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151551 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-09move some gallery header files inside svxNoel Grandin1-2/+2
They are not used outside svx. Change-Id: Ib9ef73ec19a12401ea808922aba49e0ce1625378 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151501 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-19tdf#150020: pass transform and scale matrix for the table shadow primitiveSarper Akdemir2-30/+51
Shadow scaling related bits in createEmbeddedShadowPrimitive, requires the ObjectMatrix with scale and translate. Pass these in for table shadow creation too. Change-Id: I28c30fe49d3c90e3ca03fb5294ca97eb5ba22773 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150639 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
2023-04-18tdf#150020 pptx import: handle algn for outerShdwSarper Akdemir2-0/+47
Introduces RectangleAlignmentItem that holds a value of the enum model::RectangleAlignment. Introduces SDRATTR_SHADOWALIGNMENT that holds alignment for a shadow. Implements import of algn for outerShdw. Makes the alignment considered while the shadow is being scaled. Also adds a unit test that covers this. Change-Id: I8f4eaed5f0d9428a7f405c65f19237f9e70ca151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148934 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
2023-04-13-Werror,-Wunused-variableStephan Bergmann1-1/+0
Unused ever since it got introduced in 6de8d3109dffa7d4d0cc06f319cca70134f0a8f3 "tdf#103474 handle edge cases in ARCANGLETO". (Found with an experimental Clang build supporting __attribute__((warn_unused)) on individual ctors rather than just whole class types, and the corresponding css::uno::Reference ctor marked accordingly.) Change-Id: I40342955feedad25435c03f16a31b9585281c1f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150306 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-10pptx import/export: consider TextClipVerticalOverflow for vertOverflowSarper Akdemir2-0/+44
Also adds a unit test that tests TextClipVerticalOverflow on 4 different scenarios. Change-Id: I6232935765641c796046d90fe2207d67ae4b3eb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150107 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-05svx: add test for RotatePointTomaž Vajngerl1-0/+33
Change-Id: I62182fa02843d428d1b745c55ab695450ec4940a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148235 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-03-05svx: SdrRectObj move, rotate testsTomaž Vajngerl1-0/+87
Change-Id: I448f82d87be34c58d0abf4f6a0c1e6192567b807 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148234 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-02-17SfxViewFrame* arg of SfxRequest ctor always dereferencedCaolán McNamara1-1/+1
change it to take a reference Change-Id: Ib9349f4c2660d297d93ee81256e7fa9873728ba3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147163 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>