summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)Author
2023-11-18c++20: use std::erase(_if) instead of std::remove(_if)+erase (part 4)Julien Nabet
Change-Id: I6af5501e3fde07024dcc74f00c8fd69bd369d8d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159613 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-18tdf#157716 - Rename "Language settings" to "Languages and Locales"t-aswath
Change-Id: Idd31b18c87998b03d884e7aa17197c459241abf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159315 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2023-11-15tdf#158031 editeng: rename GetFieldAtCursorJustin Luth
because it doesn't really get the field at the cursor, and certainly is not similar to SelectFieldAtCursor. It first gets the field under the mouse. Then, if there is a selection, it gets the selected field, else it looks for the field on either side. There were LOTS of places where it probably had not been used properly. Most of those are gone now, so it is easier to rename the function. Change-Id: I1a64af24092582cf865509d2a474080258edd76c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159022 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-11-15tdf#158031 editeng SID_REMOVE_HYPERLINK: use AlsoCheckBeforeCursorJustin Luth
This patch depends on prior patches for this bug report. This is mostly just a clean-up patch to make it function like the others. It was a lot like EDIT_HYPERLINK - because it selects the hyperlink first, so it didn't need any fixing up. However, there was one instance where KEYBOARD selection of Remove Hyperlink in Draw could have been cancelled/slot-invalidated if the mouse had been moved away from the field. Change-Id: Id1b911f2548b8e2751ae34a2158ee4984dfc9a59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159018 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-11-15tdf#158031 editeng SID_COPY_HYPERLINK: use AlsoCheckBeforeCursorJustin Luth
This patch depends on prior patches for this bug report. This fixes nothing being copied if the mouse was right-clicked over that second half of the hyperlink (since a "smart" positioning set the cursor after the field instead of before it). Change-Id: I6c933224cd8d36f48f4e1f0aafaa1f45555e46d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159015 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-11-15tdf#158031 editeng SID_*_HYPERLINK: use AlsoCheckBeforeCursorJustin Luth
This fixes the GTK3 problem where only the first half of the link successfully ran SID_EDIT_HYPERLINK against an editeng hyperlink. Fixed for Writer and Calc editeng hyperlinks (i.e. in textboxes). TODO: fix SID_COPY_HYPERLINK (which doesn't SelectFieldAtCursor) The problem showed up when the menu option was added because the mouse was over an unselected field, but when the mouse moved to select the menu option, the slot was not considered valid anymore if the cursor had moved behind the field. (The right-click to open the context menu puts the cursor before or after the field.) Now, by checking for a field-before-the-cursor during validation, the field is found and the command is not prevented from running. Once this is all in place, some older commits from Caolan should be able to be reverted. (Strangely, SID_OPEN_HYPERLINK and SID_REMOVE_HYPERLINK seem to run before the slot is invalidated. No idea why they are different. For GEN, the popup usually either kept the pre-menu mouse position, or else it always runs the command before the slot invalidates.) Change-Id: If992b3fdc94d89162b60447458cabced2d5e3f19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158856 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-11-15related tdf#158031 editeng: GetFieldAtSel...(+look before cursor)Justin Luth
Nearly a No-Functional-Change, but not quite. For practical and intentional purposes, it can be considered NFC. Although I didn't find an actual case where it happened, a code read says SelectFieldAtCursor COULD select a non-field. It assumed that previous code had already identified that there must be a field here. Well, I want to extend GetFieldAtSelection to check backwards to solve bug 158031 anyway, so I might as well "fix" this assumption to only select a valid field. This function REALLY depends on GetFieldAtSelection working properly. So, I put some asserts in to ensure that stays true. Change-Id: Ie22945a418497511501b04df5e17071d977cbd5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158855 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-11-11use more concrete type in ImpEditEngine::SetUndoManagerNoel Grandin
instead of dynamic_cast'ing to the type we want, and __ignoring__ the parameter if it is not, just adjust the type that we want, which luckily everything is already sending Change-Id: If083e11c9818cdcae199afc1261efbdb652e1c76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159295 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10loplugin:fieldcast in accessibility::AccessibleContextBaseNoel Grandin
Change-Id: Ibd71c2e809731114d4415754c8fd94110bd5736b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10tdf#157363 add HTML format when pasting into draw textOliver Specht
adds HTML to paste(special) in draw text in impress/draw/calc/writer Change-Id: Iaede82e1b3d48be362b70bd631e7f912b02b9822 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158659 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-11-07ITEM: Get away from classic 'poolable' Item flagArmin Le Grand (allotropia)
To understand this, some look back in history will be needed to see why it is as it is today. In some (reworked) comments 'poolable' is described as flag to hold Items in the ItemPool, also always having only one incarnation of each possible Item. This is not the original intention, but a side-effect. The reason is what the binary format in the office did: To save a document, the Objects & the Pool were saved, *not* individual Items *together* with the objects. The Pool was completely (binary) saved (and loaded) in one run. Temporary IDs were used to represent at the objects in file which Items were referenced. This *required* to have only one incarnation per item to have a minimal binary file size, thus this high effort was put into this. At doc load, the pool was loaded, all Items were set to RefCount 5000, the references from the objects were restored and then for each Item the RefCount was lowered by 5000 again and - if being zero - deleted. Items for UI were marked 'non-poolable' to *not* safe them with the document, so poolable was a flag to decide if that Info/Item was to be saved with the document - or more direct: if it is Model Data. Items are small, so if we prefer runtime it is okay to no longer being strict with this, anyways does not happen often and has only marginal memory effects - compared to runtime effects/savings. Other problems which this caused: One example is that objects in the UNDO stack were still in the pool, so e.g. deleted pictures were saved with the document despite no longer being used (!). That is the reason we have an UndoItemPool and a method MigrateItemPool to move stuff to that Pool when objects go to the UNDO stack - all of this is also no longer needed. Cleaning this up means to ideally have all items in the SfxItemSet, no longer at the Pool. The Pool should be reduced to a 'Default-Item- Holder' and a 'Slot-to-whichId-mapper'. This needs thorough cleanups/removals, but will be worth it because that massive simplification(s) will increase safety an runtime and make migrating to the goal of completely type-based ItemSet stuff easier for the future. Hopefully only view code in the office working with items will have to be changed for this. In this 1st step I already found that some 'compromizes' will be needed: - There are still Items that have to be at the pool to make the Surrogate-stuff working. This gives back all Items in a Pool of a type and is used in ca. 80 cases. Each one looks at these Items *without* context (e.g. a SfxItemSet at an Object would be a context), so if e.g. a dialog is open that temporarily uses Items of that type you would also get these - without knowing about it... To make that work there is still a mechanism to have Items at the Pool, but now just *registering* (and un-reg) them without any sort/search/ remove needs. Also only for Items that need that, so I evaluated the GetItemSurrogates calls and added some asserts when GetItemSurrogates tries to access an unregistered item type which needs to be added. - Another caveat is that there are about 250 places that directly put Items to the Pool (not all remove these, that is done at pool deletion, so some kind of silent 'garbage-collection' is in place). To have an overview I renamed the accessing methods to separate them from the same functionality at the SfxItemSet, which had the same names. An implementation does still add these directly to the pool, there is no way to cleanup those usages for now. In principle all these should be changed to hold the data at an SfxItemSet. I am still hunting problems. But you can build the office, all apps work (including chart) and you can do speed comparisons already. There are test throwing errors, so I hunt these now. It is hard to give an estimation about how much more changes/corrections will be needed. Completed adaptions to new registered Items at Pool, that reduces the failing tests. Still many that I need to hunt. Added stuff to work around that 'compromize' in ScDocumentPool: It overloads ::PutImpl of the pool to implement special handling for a single Item in SC, the ScPatternAttr. In former code that method was used from SfxItemSet and ::PutImpl at the pool directly, so it was only used in one place. I am not sure if it was used from the SfxItemSet functionality, but better offer it for now. To not waste too much runtime the callbacks depend on the boolean 'NewItemCallback' at the SfxPoolItem, it gets set for that single Item in SC and only then the callbacks trigger. I hope to get rid of those again, e.g. newItem_UseDirect is only needed since we have no 'real' StaticPoolDefaults currently - another thing that needs to be cleaned up in a next step. Since usages of impl(Create|Cleanup)ItemEntry and Direct(Put|Remove)ItemInPoolImpl got more and more similar I decided to unify that: move impl(Create|Cleanup)ItemEntry to tooling, make it globally available in svl and use it also directly for Direct(Put|Remove)ItemInPoolImpl. This slightly increases the failing tests again, but only since in Direct(Put|Remove)ItemInPoolImpl that fallback (e.g. tryToGetEqualItem) was used before, thus this is the same class of errors (SfxPoolItem ptr-compare) as the others which I will need to find anyways. Also fixed some missing stuff. Have now idenified and redirected all SfxPoolItem ptr-compares to be able to debug these - one cause for the remaining errors is probably that before with bPoolable those often were sufficient, but are no longer. Used the [loplugin:itemcompare] and a local clang build to do so, see https://gerrit.libreoffice.org/c/core/+/157172 Stabilized Direct(Put|Remove)ItemInPoolImpl forwards, added parameter to implCreateItemEntry to signal that it gets called from DirectPool stuff - currently needed. Hopefully when getting rid of that DirectPool stuff we can remove that again Added two more debug functionalities: - Added a SerialNumber to allow targeted debugging for deterministic cases - Added registering & listing of still-allocated SfxPoolItems at office shutdown Found PtrComp error in thints.cxx - POC, thanks to areSfxPoolItemPtrsEqual. Will hopefully help more with other tests Found some wrong asserts/warnings where I was too careful and not finding something/succeeding is OK, fixes some UnitTests for SC For SC I now just tried to replace all areSfxPoolItemPtrsEqual with the full-ptr-content compare SfxPoolItem::areSame. I also needed to experiment/adapt the newItem_Callback solution but got it working. Did that replacement now for SW too, found some places where the direct ptr compare is OK. Continued for the rest of occurrences, now all 160 places evaluated. Also done some cleanups. Massive cleanups of stuff no longer needed with this paradigm change. Also decided to keep tryToGetEqualItem/ITEM_CLASSIC_MODE for now. It is used for *one* Item (ScPatternAttr/ATTR_PATTERN) in SC that already needs many exceptions. Also useful for testing if errors come up on this change to test if it is related to this. Added forwarding of target Pool for ::Clone in SvxSetItem and SvxSetItem, simplified SfxStateCache::SetState_Impl and returned to simple ptr compares in SfxPoolItem::areSame to not do the test in areSfxPoolItemPtrsEqual. Debugged through UITest_calc_tests9 and found that in tdf133629 where BoxStyle is applied to fully selected empty calc the Item- reuse fallback has to be used not only for ATTR_PATTERN, see comment @implCreateItemEntry. Maybe more... Problem with test_tdf156611_insert_hyperlink_like_excel. Found that in ScEditShell::GetFirstURLFieldFromCell the correct SvxURLField is found and returned as ptr, but it's usage crashes. That is due to the SfxItemSet aEditSet used there gets destroyed at function return what again deletes the SvxFieldItem that is holding the SvxURLField that gets returned. This shows a more general problem: There is no 'SfxPoolItemHolder' that safely holds a single SfxPoolItem - like a SfxItemSet for a single Item (if Items would be shared_ptrs, that would be a safe return value). That will be needed in the future, but for now use another solution: Since I see no reason why EE_FEATURE_FIELD should not be shareable I wil change this for ow in the SfxItemInfo for EditCharAttribField. That way the Item returned will be shared (RefCnt > 1) and thus not be deleted. I changed the return value for GetURLField() and GetFirstURLFieldFromCell() in ScEditShell: At least for GetFirstURLFieldFromCell the return type/value was not safe: The SvxFieldItem accessed there and held in the local temporary SfxItemSet may be deleted with it, so return value can be corrupted/deleted. To avoid that, return a Clone of SvxFieldData as a unique_ptr. With all that UnitTest debugging and hunting and to get the paradigm change working to no longer rely on shared/pooled items I lost a little bit focus on speed, so I made an optimization round for the two central methods implCreateItemEntry/implCleanupItemEntry to get back to the speed improvements that I detected when starting this change. It was mainly lost due to that 'strange' chained pool stuff we have, so I added to detect the target pool (the one at which the WhichID is registered) directly and only once. Next thing to cleanup will/should be the pool and it's concept, all this is not needed and really costs runtime. Since implCreateItemEntry/implCleanupItemEntry are executed millions of times, each cycle counts here. Had an error in the last changes: pool::*_Impl methods use index instead of WhichID - most of them. Another bad trap, I really need to cleanup pool stuff next. Change-Id: I6295f332325b33268ec396ed46f8d0a1026e2d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157559 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-11-07tdf#158083: RTF: drop export for \pgdsctblVasily Melenchuk
This table is not standard extension to RTF format. It is not described in RTF specification and even is not used by Writer on import these days. Change-Id: I52f27dfd30877d461ad535b7847f40dd4c6f4ea5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158986 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-03NFC related tdf#158031 editeng: flatten and simplify the codeJustin Luth
No Functional Change intended. Just some slight optimizing that leads to some nice flattening. Change-Id: I46d20a56821f218973c728f51575b104e6020500 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158854 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-11-02this should never be null, so we can use a referenceCaolán McNamara
Change-Id: I682e30cfb4fd63a4f906bfb875cafdf77ae9cfe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158805 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-02crash seen in EditView::GetTransferable in calcCaolán McNamara
if (pColor->getComplexColor().getType() == model::ColorType::Unused) (gdb) print pColor $10 = <optimized out> but: (gdb) print *pSet $12 = {_vptr.SfxItemSet = 0x7f7cd56f3198 <vtable for SfxItemSet+16>, m_pPool = 0x31e7d880, m_pParent = 0x0, m_ppItems = 0x33ecece0, m_pWhichRanges = { m_pairs = 0x7f7cd47b2480 <svl::Items_t<(unsigned short)4008, (unsigned short)4064>::value>, m_size = 1, m_bOwnRanges = false}, m_nCount = 1, m_bItemsFixed = false} (gdb) print *(pSet->m_ppItems) $11 = (const SfxPoolItem *) 0x0 so, apparent null deref of pColor #0 SvxUnoTextRangeBase::_getOnePropertyStates (pSet=0x7ffe47b3ded0, pMap=0x7f7cd5a50600 <ImplGetSvxTextPortionPropertyMap()::aSvxTextPortionPropertyMap+384>, rState=@0x38ae2d4c: com::sun::star::beans::PropertyState::PropertyState_DIRECT_VALUE) at editeng/source/uno/unotext.cxx:1179 #1 0x00007f7cd1e6f5be in SvxUnoTextRangeBase::_getPropertyStates (this=0x3543bc00, PropertyName=..., nPara=nPara@entry=-1) at editeng/source/uno/unotext.cxx:1057 #2 0x00007f7cd1e6fa12 in SvxUnoTextRangeBase::getPropertyStates (this=<optimized out>, aPropertyName=...) at editeng/source/uno/unotext.cxx:1031 #3 0x00007f7cd41e723b in (anonymous namespace)::FilterPropertiesInfo_Impl::FillPropertyStateArray (this=this@entry=0x32e94820, rPropStates=std::vector of length 0, capacity 0, rPropSet=..., rPropMapper=..., bDefault=bDefault@entry=false, pOnlyTheseProps=pOnlyTheseProps@entry=0x0) at xmloff/source/style/xmlexppr.cxx:327 #4 0x00007f7cd41e9230 in SvXMLExportPropertyMapper::Filter_ (this=this@entry=0x34dc72a0, rExport=..., xPropSet=..., bDefault=bDefault@entry=false, bEnableFoFontFamily=bEnableFoFontFamily@entry=false, pOnlyTheseProps=0x0) at xmloff/source/style/xmlexppr.cxx:651 #5 0x00007f7cd41ea026 in SvXMLExportPropertyMapper::Filter (this=this@entry=0x34dc72a0, rExport=..., rPropSet=..., bEnableFoFontFamily=bEnableFoFontFamily@entry=false, pOnlyTheseProps=pOnlyTheseProps@entry=0x0) at xmloff/source/style/xmlexppr.cxx:526 #6 0x00007f7cd42dbbcd in XMLTextParagraphExport::Add (this=this@entry=0x37110830, nFamily=nFamily@entry=XmlStyleFamily::TEXT_TEXT, rPropSet=..., aAddStates=..., bDontSeek=bDontSeek@entry=false) at xmloff/source/text/txtparae.cxx:685 #7 0x00007f7cd42dd09f in XMLTextParagraphExport::exportTextRange (this=this@entry=0x37110830, rTextRange=..., bAutoStyles=bAutoStyles@entry=true, rPrevCharIsSpace=@0x7ffe47b3eef0: true, openFieldMark=@0x7ffe47b3ec34: XMLTextParagraphExport::NONE) at xmloff/source/text/txtparae.cxx:3731 #8 0x00007f7cd42e57df in XMLTextParagraphExport::exportTextRangeEnumeration (this=this@entry=0x37110830, rTextEnum=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, rPrevCharIsSpace=@0x7ffe47b3eef0: true) at xmloff/source/text/txtparae.cxx:2438 #9 0x00007f7cd42ea746 in XMLTextParagraphExport::exportParagraph (this=this@entry=0x37110830, rTextContent=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, rPropSetHelper=..., eExtensionNS=<optimized out>) at xmloff/source/text/txtparae.cxx:2378 #10 0x00007f7cd42e0634 in XMLTextParagraphExport::exportTextContentEnumeration (this=this@entry=0x37110830, rContEnum=..., bAutoStyles=bAutoStyles@entry=true, rBaseSection=..., bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, pRangePropSet=<optimized out>, eExtensionNS=<optimized out>) at xmloff/source/text/txtparae.cxx:2008 #11 0x00007f7cd42e113a in XMLTextParagraphExport::exportText (this=this@entry=0x37110830, rText=..., bAutoStyles=bAutoStyles@entry=true, bIsProgress=bIsProgress@entry=false, bExportParagraph=bExportParagraph@entry=true, eExtensionNS=eExtensionNS@entry=TextPNS::ODF) at xmloff/source/text/txtparae.cxx:1762 #12 0x00007f7cd1e78669 in XMLTextParagraphExport::collectTextAutoStyles (bExportParagraph=true, bIsProgress=false, rText=..., this=<optimized out>) at include/xmloff/txtparae.hxx:459 #13 (anonymous namespace)::SvxXMLTextExportComponent::ExportAutoStyles_ (this=0x7f7cb4522930) at editeng/source/xml/xmltxtexp.cxx:341 #14 0x00007f7cd406121c in SvXMLExport::ImplExportAutoStyles (this=this@entry=0x7f7cb4522930) at xmloff/source/core/xmlexp.cxx:1127 #15 0x00007f7cd40645f5 in SvXMLExport::exportDoc (this=0x7f7cb4522930, eClass=<optimized out>) at xmloff/source/core/xmlexp.cxx:1380 #16 0x00007f7cd1e78d64 in SvxWriteXML (rEditEngine=..., rStream=..., rSel=...) at editeng/source/xml/xmltxtexp.cxx:321 #17 0x00007f7cd1da1d0c in ImpEditEngine::WriteXML (this=this@entry=0x34f87990, rOutput=..., rSel=...) at editeng/source/editeng/impedit4.cxx:270 #18 0x00007f7cd1d88881 in ImpEditEngine::CreateTransferable (this=0x34f87990, rSelection=...) at editeng/source/editeng/impedit2.cxx:3843 #19 0x00007f7cd1d4c091 in EditEngine::CreateTransferable (this=<optimized out>, rSelection=...) at editeng/source/editeng/editeng.cxx:816 #20 0x00007f7cd1d5c91a in EditView::GetTransferable (this=0x33eb8190) at editeng/source/editeng/editview.cxx:662 #21 0x00007f7cc2c03eac in ScModelObj::getSelection (this=<optimized out>) at sc/source/ui/unoobj/docuno.cxx:904 Change-Id: Idb8cbbebe02188678f9c1b17e80cf89feffa9de8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158803 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-21ofz#63406 Timeouts with huge fontsCaolán McNamara
reduce limit further when fuzzing Change-Id: I66345f78a5375a6415f0b25ba736c41fd27ce8d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158308 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-19Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: editengStephan Bergmann
Change-Id: I9ea2bdf3b939f260184bf793e2b91cd37e9d80c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158190 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-19tdf#147021 Use std::size() in editengWillian Pessoa
Change-Id: Id6496b34a3601fb021af2894fbf7f876b444145f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157895 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-12Make NC_ constexpr-friendlyStephan Bergmann
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr paths into a new TranslateId::getId. And demonstrate constexpr'ability by making the aCategories var in OApplicationIconControl::Fill (dbaccess/source/ui/app/AppIconControl.cxx) constexpr. (And there might be more such cases that could now be made constexpr.) Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-12editeng: move the methods into Test class definitionTomaž Vajngerl
This makes makes all the Test class methods contined in the class definition body, so more readable and less noise for the actual test definitions. Change-Id: I3ea177f27aa868a396e537b1682ce91d93c1208e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157837 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-10-12prefix some members of ImpEditEngineTomaž Vajngerl
Change-Id: I9975bed2af853374a10b87c468840ff22b230157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157833 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-09cid#1547102 Uninitialized pointer fieldCaolán McNamara
Change-Id: Id713220c13df8b557b637d305da158abc5d5421f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157694 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-08ofz#62236 avoid TimeoutCaolán McNamara
Change-Id: Ic7207ece03a30d8ffefadbf072d4da5fa66dfc12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157688 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-07tdf#157568 After deleting the content of a cell by pressing the delete..Noel Grandin
.. key, Orca still speaks the content. this reverts commit f22cb3dfab413a2917cd810b8e1b8f644a016327 Author: Noel Grandin <noelgrandin@gmail.com> Date: Mon Jun 12 20:02:19 2023 +0200 tdf#155376 weakly cache ScAccessibleCell which was a nice idea, but means that we would need to have some way of updating the ScAccessibleCell when the associated cell data changes. Which is likely to be complicated. So return to creating new ScAccessibleCell objects all the time, but fix them to not leak. Change-Id: Ie17ee5c950c9809d4c7281f93761584f75256121 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157673 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-03replace ErrorInfo with simpler mechanismNoel Grandin
Instead of returning ErrCode class everywhere, return a new class ErrrCodeMsg, which combines an ErrCode with the other parameters that are used to control the error reporting. I do not change everything that uses ErrCode here, I started from SfxBaseController/SfxMedium and worked outwards. This change serves two purposes (1) Replace the extremely whacky ErrorInfo mechanism we were using to smuggle information into the error handler reporting mechanism with a very straightforward approach of just combining it into the error class. (2) Allow us to capture the source location that produced the error, which makes debugging the source of a problem soooo much easier. Change-Id: I978b8f00c9851b41a216c7ebdef2ef94251d5519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157440 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-13loplugin:unodispose in editeng..extensionsNoel Grandin
Change-Id: I6545cf93b0a101d3a3eea0abe9c1732fcf3dc2d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156850 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-11SvxSimpleUnoModel does not need to implement XAggreggationNoel Grandin
Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } Change-Id: I54b6d8224bd9d996781cfac6cf9846721a8c5d3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156818 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-07SvxUnoNumberingRulesCompare does not need to implement XAggreggationNoel Grandin
Checked on jenkins using 'make check' and + void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } + Change-Id: I3e08b565974cf1532ba8af36b4399b2f4b28bfb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156653 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-09-07Autocorrect: Add option for autoformat bulleted lists after spaceDarshan-upadhyay1110
Enable option in Autocoorect => bulleted lists after pressing space Example: press * or - and space will change into bullets Change-Id: I9741ad4c3eb4123074f06b762b58fe7ffdb44613 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156616 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-09-01SAL_WARN->SAL_INF in SvxUnoTextFieldNoel Grandin
these are not indicative of any kind of problem Change-Id: Iad8b265fa7b397a4551b3037572a534d64952ef1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156408 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-29tdf#103706: tdf#142857: sd: context aware paste for clone formatSarper Akdemir
Introduces selection aware pasting for Impress/Draw's Clone Format where paragraph properties are applied when the selection contains a whole paragraph or there's no selection at all (i.e. clone format applied with just a left click - without drag). Change-Id: I37e7197580c2b8da333ada1a60408f40f85d7ef5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155108 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-08-26editeng: fix crash in EditDoc::FindAttribsXisco Fauli
check pNode before calling EditDoc::FindAttribs. This is the only place where EditDoc::FindAttribs is called from See https://crashreport.libreoffice.org/stats/signature/EditDoc::FindAttribs(ContentNode%20*,long,long,SfxItemSet%20&) Change-Id: I3ed0724b1113965c09c66413987bb85777ec9a16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156097 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-22smallcaps: support dxarray in SvxDoDrawCapitalCaolán McNamara
Change-Id: I1924fce8323fb14f75f49cb67320f21a3ca62cc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155943 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-22smallcaps: we only use width, so drop the heightCaolán McNamara
Change-Id: I860e5ff246cb21749a73deb83cdd2e26c0ad4b3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155936 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-22tdf#98367 implement rendering of draw/impress small capitalsCaolán McNamara
arising out of Þe old tdf#91932 Change-Id: I953aabc280bc31ef1297dc79d483eb3d28a542f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155846 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-22Related: tdf#98367 export editeng EE_CHAR_CASEMAP the same as writer doesCaolán McNamara
so can cut and paste from impress/draw to writer, import already works Change-Id: Ifc35687b1f77f6519d14a71820bb635ff25a159f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155906 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-21character preview is drawing two overlines for Small CapsCaolán McNamara
we already handle the underline and strikethrough case, so add the overline case here too Change-Id: I9ca0a5623a559e0cde07437439aa372e3c517159 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155894 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-18ITEM: preparations for more/easier changesArmin Le Grand (allotropia)
This change is not about speed improvements but diverse preparations to make changes/reading/understanding easier. It does not change speed AFAIK. Added a global static debug-only counter to allow getting an overview over number of all allocated SfxPoolItem's and the still alloated ones at office shutdown. The values are used in Application::~Application to make a short info statement. It allows to be able to quickly detect if an error in future changes may lead to memory losses - these would show in dramaitically higher numbers then (hopefully) immediately. Moved SfxVoidItem to own source/header. Added container library interface support to SfxItemSet, adapted already some methods to use it - not all possible, I will commit & get status from gerrit 1st if all still works and then continue. Changed INVALID_POOL_ITEM from -1 to use a global unique incarnation of an isolated derivation from SfxPoolItem. It allows to avoid the (-1) pointer hack. Since still just pointers are compared it's not worse. NOTE: That way, more 'special' SfxPoolItem's may be used for more States - a candidate is e.g. SfxVoidItem(0) which represents ::DISABLED state -- unfortunately not only, it is also used (mainly for UI stuff) with 'real' WhichIDs - hard to sort out, will have to stay that way for now AFAIK. Changed INVALID_POOL_ITEM stuff to use a static extern incarnated item in combination with a inline method to return it, called GetGlobalStaticInvalidItemInstance(). Isolated create/cleanup of a SfxPoolItem entry in SfxItemSet to further modularize/simplify that. It is currently from constructor & destructor but already shows that PoolDefaults are handled differently - probably an error. Still, for now, do no change in behaviour (yet). Got regular 'killed by the Kill-Wrapper' messages from gerrit, seems to have to do with UITest_sw_findReplace. That python/c++ scripting stuff is hard to debug, but finally I identified the problem has to do with the INVALID_POOL_ITEM change. It was in SfxItemSet::InvalidateAllItems() where still a (-1) was used -> chaos in detecting invalid items. Change-Id: I595e1f25ab660c35c4f2d19c233d1dfadfe25214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155675 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-08-15ComplexColor various clean-up and (trivial) refactoringsTomaž Vajngerl
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-08-15fix crash in LOKNoel Grandin
ImpEditView::lokSelectionCallback(std::optional<tools::PolyPolygon> const&, bool, bool) editeng/source/editeng/impedit.cxx:446 ImpEditView::DrawSelectionXOR(EditSelection, vcl::Region*, OutputDevice*) editeng/source/editeng/impedit.cxx:642 ImpEditEngine::Paint(ImpEditView*, tools::Rectangle const&, OutputDevice*) editeng/source/editeng/impedit3.cxx:4164 ScGridWindow::DrawContent(OutputDevice&, ScTableInfo const&, ScOutputData&, bool) sc/source/ui/view/gridwin4.cxx:1226 (discriminator 1) ScGridWindow::PaintTile(VirtualDevice&, int, int, int, int, long, long, short, int) sc/source/ui/view/gridwin4.cxx:1700 ScModelObj::paintTile(VirtualDevice&, int, int, int, int, long, long) Change-Id: Ib142e6bd52bf0271d8e0e97af7701454144ead9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155607 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-31tdf#156470 add SAL_INFO calls for debuggingPatrick Luby
In the verious LibreOffice samples attached to tdf#156470, it appears that LibreOffice spends a lot of time the GetTextArray() calls in SvxFont::QuickGetTextSize(). So add logging to determine if any of the GetTextArray() calls are returning unusual sizes. Change-Id: Ie6f0fcc85396b47342b6a93180d4bc9873420931 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155072 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-07-31Fix surrogate pairs handling when tweaking script infoKhaled Hosny
Followup to: commit 3af30bafbedb8eb481024efb35cb7876c63d26dc Author: Khaled Hosny <khaled@libreoffice.org> Date: Thu Jul 27 19:03:28 2023 +0300 sw: Handle surrogate pairs when tweaking script info and: commit d6efe8c302b81886706e18640148c51cf7883bbf Author: Khaled Hosny <khaled@libreoffice.org> Date: Thu Jul 27 20:39:22 2023 +0300 tdf#112594: Group NNBSP with the Mongolian characters after it Change-Id: Ie273c457e4f3ed31a3372bc8eb0eb0055c1b97b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155053 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-29tdf#156165: Fix replace custom styles while typingBaole Fang
Originally, Replace Custom Styles changes styles to text body by entering BuiltText. Since styles change to text body is removed from BuiltTest, it is converted independently. Now, conversion is applied even during typing because m_aFlags.bChgUserColl is true (its default value) during typing. Therefore, its default value is changed to false. Change-Id: I8ce067b311922b5e1bdcd84036229c369b50a977 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154144 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-27tdf#112594: Group NNBSP with the Mongolian characters after itKhaled Hosny
Narrow No Break Space has special uses in Mongolian, so we want to make sure it is in the same portion as the Mongolian text, even when it comes after text from another script group. We limit this to Mongolian to minimize potential side effects. Change-Id: Idb4c64cec8581e56acfe9bbb8adf4ddc213aaf19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155000 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-27tdf#156482: fix order in SvxBaseAutoCorrCfg::ImplCommitMike Kaganski
Change-Id: I0c7315357a7a9ec446b06cf33420c20a58a8ec42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154958 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-25editeng: Call unicode::getUnicodeType() on UTF-32 code unitsKhaled Hosny
By using OUString::iterateCodePoints() instead of accessing individual UTF-16 code units that might be surrogate pairs. Change-Id: I5e3e513a788f0c939f96b0521fed16fe4848a053 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154875 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-23editeng: Don’t unintentionally set KernArray.mnSubUnitFactorKhaled Hosny
The first (and only) argument to KernArray constructor is nSubUnitFactor not array length as the code here seems to imply. Change-Id: Ie89c41d07f1aa13be595ead604df82ad775df433 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154799 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>