summaryrefslogtreecommitdiff
path: root/sw
AgeCommit message (Collapse)Author
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-10tdf#158044 handling of paragraph attributes in RTF importOliver Specht
style attributes need to be repeated at the paragraph if not repeated then defaults have to be applied Change-Id: I4ee567e8006c240c046b7e7bb75eae92e5563776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158839 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-11-10tdf#62603 Fix find/replace to not extend font attributesMatt K
This change modifies the logic of the core replace code to now not replace the 1st character and extend its attributes, but instead to actually replace characters to keep respective formatting. Additional checks are made for whether the replacement was shorter or longer than the found text, and to handle trimming or appending the final portions as needed. Change-Id: I03a5645898e55ad386bacc2766af9b244a97bd21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155274 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-10loplugin:fieldcast in mailmerge unit testsNoel Grandin
Change-Id: I3c5f31848ea572678a6ba85463ebda04b882eeaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159303 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10sw floattable, insert UI: default to at-char for non-split flysMiklos Vajna
Inserting new images defaulted to the at-char anchor type, but inserting a new frame defaulted to at-para, which is inconsistent. This is now more visible, since LOK exposes the insert frame dialog. An additional problem is that the LOK case hides anything other than at-char and as-char in the frame properties dialog since commit 4154d281fbecaadf6cd118c00cc6cff929e339a4 (sw lok: hide UI to set Word-incompatible anchor types, 2019-07-05), which was intended for images, but also affects text frames as well. But floating tables want to-para anchored frames to be able to split. Fix the problem by defaulting to at-char anchoring, unless we deal with floating tables. And show the to-para anchor widget in the LOK case again, given that all of to-para, to-char and as-char have their use-cases, even when editing Word documents. Change-Id: I89b0973183a750d86f56e0cccd7b0fbcb3dc070d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159261 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-11-10Disable flakey navigator UITest againStephan Bergmann
f2ba17fecb60d936599efb975d96a3ea06c2a43f "disable more flakey navigator UITest", then 0a0c5a5b0521bea6cb695731d448e62c41ed4c57 "UITest_sw_navigator: avoid oneprocess" enabled it again, apparently in the false hopes that non-oneprocess would magically fix this issue. But this still hangs frequently, e.g. <https://ci.libreoffice.org//job/lo_tb_master_linux_dbg/45650/> hung here (and got killed by kill-wrapper) with the python.bin process at > Thread 1 (Thread 0x7f85438bbb80 (LWP 217701) "python3"): > Traceback (most recent call first): > <built-in method sleep of module object at remote 0x7f854143b728> > File "/home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/uitest/uitest/test.py", line 72, in wait_until_property_is_updated > time.sleep(DEFAULT_SLEEP) > File "/home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/sw/qa/uitest/navigator/tdf154521.py", line 158, in test_query_selected_bookmark > self.ui_test.wait_until_property_is_updated(xContentTree, "SelectEntryText", "Bookmark 2") > File "/usr/lib64/python3.6/unittest/case.py", line 622, in run > testMethod() > File "/usr/lib64/python3.6/unittest/case.py", line 670, in __call__ > return self.run(*args, **kwds) > File "/usr/lib64/python3.6/unittest/suite.py", line 122, in run > test(result) > File "/usr/lib64/python3.6/unittest/suite.py", line 84, in __call__ > return self.run(*args, **kwds) > File "/usr/lib64/python3.6/unittest/runner.py", line 176, in run > test(result) > File "/home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/uitest/test_main.py", line 138, in <module> > result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(test_suite) and the soffice.bin process just idling with nothing going on. Change-Id: I44a38b12050cfe2cf4831631406df9018018e2ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159260 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-10tdf#153178 writerfilter: do not create text frame spuriouslyMichael Stahl
There are different RTF keywords that end up in RTFFrame, and some of them cause Word to create a frame, while others don't. Getting this right requires implementing support for all the missing wrapping keywords, as most of them create a frame in Word but \wrapdefault does not. Change-Id: I1e55d15180564f3d66a5ee7d98274ae18f032872 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159228 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
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-10Fix STYLEREF crashes and forwards-compatibilitySkyler Grey
This commit fixes a crash in STYLEREF caused by a dereferenced nullptr when serializing chapter fields for .doc export. Along with the STYLEREF changes, I also changed the chapter export logic to allow exporting chapter fields when they were in document text, and to use the style of the thing they pointed to. Unfortunately, in some cases that would be null. This commit makes us fall back to previous behavior in those cases. This commit also adds import logic for styleref on the TEXT namespace in addition to LO_EXT. This is important as if/when the STYLEREF field is no longer LO_EXT we want to be able to open new documents in old versions of libreoffice. This was erroneously missed when we changed TEXT references to LO_EXT in our export logic. Change-Id: I383828c9409afc8545af379307f528cee2e1a960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159226 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-10tdf#158007 - UI: Part 23 - Unify lockdown behavior of Options dialogBalazs Varga
for Writer - General Page. Change-Id: I2c679ee7f8e2d282a9f9ff19fc1743cb9bb6dbe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159250 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2023-11-10resave with newer glade versionBalazs Varga
Change-Id: Ie0796286fd5648e5df4397861ba1f9afcce881c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159229 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2023-11-10sw layout xml dump: avoid a static_cast in SwFrame::dumpAsXmlAttributes()Miklos Vajna
Move the code to SwLayoutFrame from SwFrame, then no cast is needed. Change-Id: Ieb402efb19710adf94bce022fca484178fce719f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159227 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-09tdf#158006 - UI: Part 21 - Unify lockdown behavior of Options dialogBalazs Varga
for Writer - View Page. Change-Id: Icbca23d3ec1dd95bbf703227b9479291a978a426 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159126 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2023-11-09give the Language Selection dialog the usual spacingsCaolán McNamara
Change-Id: I82dd94e0a0205bee2b6b2d0ef005f734d9d80f54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159220 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-09loplugin:fieldcast in ParaRstFormatNoel Grandin
Change-Id: I684e53a2c06ed1a6b2e85eb07162cd4ef43d0dd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159136 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-09sw floattable, insert UI: allow direct creation of floating tablesMiklos Vajna
The frame insert UI could move a table into a new fly, and then the frame properties allowed marking this fly as a split fly, but not in one step. This happened because the "split fly" checkbox is only visible when we have a fly that has exactly 1 table, but the "new frame" dialog has no fly as it still has to be created. Fix the problem by showing the "split fly" checkbox if we don't have a fly, but a single table is selected, because we know SwDoc::MakeFlyAndMove() will create a fly that has exactly one table in it. Extract the common code to a new SwFlyFrameAttrMgr::SingleTableSelected() to avoid copy&paste. Change-Id: I24129e3fb4cb6231fb10b0adda53c205dfd90d62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159201 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-11-09loplugin:fieldcast in SwDocShellNoel Grandin
Change-Id: I81739c24ae1174ff9f889490b8152dda7b61f328 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159171 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-09loplugin:fieldcast in Num_InfoNoel Grandin
Change-Id: I9d839c22579e5bc5fe6250a8aab0285ca9e0a4c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-09loplugin:fieldcast in SwGrfNodeNoel Grandin
Change-Id: I95411fa20c38238d1ee74e8d73dd0a9553b9ad45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-09loplugin:fieldcast in SwSelPaintRectsNoel Grandin
Change-Id: I62471db74c30baf8bd42a3679624c767c68c66f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159137 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08tdf#43784 tdf#158114 sw accessibility: check missing linked graphicLászló Németh
Show missing linked graphics and their abbreviated paths, (and as tooltips, full paths) in the accessibility checker. Change-Id: Ia378f4ea3260251d1b2530fadc48aea6e0323a08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159150 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2023-11-08loplugin:fieldcast in SwHTMLParserNoel Grandin
Change-Id: Ie610358d3f9b1a1950edf617720ad13d4cfc57d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159129 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08loplugin:fieldcast in SwXMLTableContextNoel Grandin
Change-Id: I510a37b4caeb93719083eb09efd908672006428a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159118 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08loplugin:fieldcast in XMLRedlineImportHelperNoel Grandin
Change-Id: I8338e6bf675b9508a5e085f353b23223da48067f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159119 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08loplugin:fieldcast in SwWW8ImplReaderNoel Grandin
Change-Id: If27ac0047d5f63164ea6b142b857077abf7b5a51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159128 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08loplugin:fieldcast in SwXMLItemSetContextNoel Grandin
Change-Id: I9a3789d1ea28ddb0e21de73f1dafcaa9dcf68d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159127 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08loplugin:fieldcast in SwXTextViewNoel Grandin
Change-Id: Ifa5fc5fc537ec58ae9380e5af65a98dd016e2e9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159117 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08fix spelling, selektion->selectionNoel Grandin
Change-Id: I1924f3aaaf703e8fcdd5c56c4c22523124ff0746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159108 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08fix spelling, Attribut -> AttributeNoel Grandin
Change-Id: Iac208ec7d7bf0b03dd957bbe547e42822c5e4c90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159107 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08sw floattable, insert UI: inherit fly width from selected table widthMiklos Vajna
Inline table width defaults to the body frame width, so a hardcoded 2cm default for the fly width is a bit poor. Leave the normal fly insert case unchanged, but if an entire table is selected, then change the default to the table width. Check for the table selection like SwFEShell::NewFlyFrame() does it, and determine if the entire table is selected like SwDoc::MakeFlyAndMove() does it. With this, a default table with a default frame keeps its width on frame insert. Change-Id: Iaf954395a4799222074acd83b5eae52ca75ae0ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159104 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-11-08CppunitTest_sw_mailmerge: clean up not needed preTest()Miklos Vajna
1) preTest() retuns a unique_ptr which has to be hold till the test runs, which didn't happen here. 2) This was just copy&paste probably, since preTest() is not overwritten in this suite. Change-Id: Ib391f68d5dccb02ba6c42a298d1c86fe29c8606c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159081 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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-07use more TypedWhichIdNoel Grandin
Change-Id: Ic52321ba38589a396a52d95454524ab8985cbafd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159060 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-07use more TypedWhichIdNoel Grandin
Change-Id: I37683d59e4994546ad4591d213b825ab080940eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159059 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-07use more TypedWhichIdNoel Grandin
Change-Id: If76b02a20b01624c2cc0aa5e3c310aa1dd930c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159058 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-07use more concrete *PoolItem types in SwLanguageIteratorNoel Grandin
rather than casting Change-Id: Ic134c30490fea7ae42bbf3194532ae0aad4c61c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159057 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-07warn about exotic protocols as wellCaolán McNamara
Change-Id: I50dcf4f36cd20d75f5ad3876353143268740a50f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151834 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-07sw floattable, insert UI: fix default frame width when inserting a new oneMiklos Vajna
Insert -> Frame -> Frame presented a dialog which stated the width of the new frame will be 2cm, but the width was ~zero. This is a regression from commit 9da7b1592e010928c26c43ee93b91cdd66403985 (sw: remove all uses of MM50 with (added) o3tl::toTwip, 2021-07-23). Previously the code worked because the 2cm was speficified as MM50*4 (283*4=1132 twips), and we compared this to the 2cm from the UI, which had no rounding errors (283.46456692913387*4=1134 twips), and this 1132 vs 1134 meant the dialog put the unchanged size to the output item set. Now we don't have rounding errors anymore, so we have 1134 everywhere, which means the dialog doesn't specify a default size, but no other code would do it, resulting in a frame with minimal width, which is clearly not wanted. Fix the problem by checking if this will be a new frame, and if so, the dialog should send the default size to the caller, even if the user didn't customize the size. This restores the lost 2cm default width while keeping the rounding improvements. This requires running the test in its own process, because the measurement unit is only loaded once from the config and the rounding error is not hit with the default inches. Change-Id: I9a5945fdd0e5cd64ff8bd84f95f11be5277b8d18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159050 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-11-07Fix SwLanguageIterator::Next for RES_TXTATR_AUTOFMTStephan Bergmann
...following advice by mstahl, as discussed in the comments starting at <https://gerrit.libreoffice.org/c/core/+/158732/2#message-053bc195667ee3ba396ed12a85f3af8d4b7e5efc> "tdf#157667 sw track changes: fix cycle case on multiple words", which had started to cause > /sw/inc/txatritr.hxx:69:18: runtime error: downcast of address 0x603001b45d90 which does not point to an object of type 'const SvxLanguageItem' > 0x603001b45d90: note: object is of type 'SwFormatAutoFormat' > 00 00 00 00 f0 0f 53 4e 3b 7f 00 00 02 00 00 00 32 00 90 be 20 31 36 00 80 60 00 00 c0 5d b4 01 > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'SwFormatAutoFormat' > #0 0x7f3b45ef75d2 in SwLanguageIterator::GetLanguage() const /sw/inc/txatritr.hxx:69:18 > #1 0x7f3b45ee2765 in SwTextNode::TransliterateText(utl::TransliterationWrapper&, int, int, SwUndoTransliterate*, bool) /sw/source/core/txtnode/txtedt.cxx:1980:32 > #2 0x7f3b429f1d40 in sw::DocumentContentOperationsManager::TransliterateText(SwPaM const&, utl::TransliterationWrapper&) /sw/source/core/doc/DocumentContentOperationsManager.cxx:3186:15 > #3 0x7f3b43a52777 in SwEditShell::TransliterateText(TransliterationFlags) /sw/source/core/edit/editsh.cxx:1076:51 > #4 0x7f3b49118c97 in SwTextShell::ExecRotateTransliteration(SfxRequest const&) /sw/source/uibase/shells/textsh.cxx:866:20 > #5 0x7f3b49118984 in SfxStubSwTextShellExecRotateTransliteration(SfxShell*, SfxRequest&) /workdir/SdiTarget/sw/sdi/swslots.hxx:3194:1 > #6 0x7f3b6529ff75 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) /sfx2/source/control/dispatch.cxx:254:9 > #7 0x7f3b652b5e85 in SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) /sfx2/source/control/dispatch.cxx:753:9 > #8 0x7f3b65240e3b in SfxBindings::Execute_Impl(SfxRequest&, SfxSlot const*, SfxShell*) /sfx2/source/control/bindings.cxx:1061:22 > #9 0x7f3b656c2760 in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) /sfx2/source/control/unoctitm.cxx:688:53 > #10 0x7f3b656c4ec1 in SfxOfficeDispatch::dispatchWithNotification(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) /sfx2/source/control/unoctitm.cxx:266:16 > #11 0x7f3b193705a6 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatch> const&, com::sun::star::util::URL const&, bool, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx:163:30 > #12 0x7f3b1936f482 in framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx:120:16 > #13 0x7f3b19370e54 in non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/dispatchhelper.cxx > #14 0x7f3b3810b5e9 in unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:94:33 > #15 0x7f3b7245e5fd in testTdf157667::TestBody() /sw/qa/extras/uiwriter/uiwriter6.cxx:793:5 Change-Id: I0e0545a134d86a333b971da83a66f58c5e70f601 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159002 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-07tdf#99822 sw floattable: testcase for objects from different cellsMiklos Vajna
Fails with commit 435f1aadf7dd8087a8997924bedfccff0f496ba2 (tdf#99822 sw floattable: allow nomimal overlap of objects from different cells, 2023-10-27) reverted. Change-Id: Ic90a2aa254a47804dc50eba8fc1daf0131e65a26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159007 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-11-06sw floattable: make Insert Frame dialog async and mark it as a jsdialogMiklos Vajna
- with this, once a LOK client dispatches .uno:InsertFrame, we don't open two dialogs (one tunelled, one jsdialog) - all the tabpages were already allowed as jsdialogs, the tabpages don't open any unwanted file picker (hyperlink browse button, area -> image -> import button) - switching to async means we can't work with the original SfxRequest (which is no longer there by the time the callback is invoked), but 057eca05f23d9d15465e591bd0da671735d62d50 (sc: convert optimal width/height and normal width/height dialog to async, 2022-04-12) shows we can re-create the SfxRequest after the fact, do the same here - similar problem with SwFlyFrameAttrMgr, but looks like the SwFlyFrameAttrMgr before launching the dialog doesn't share state with the SwFlyFrameAttrMgr after the dialog is gone, so work with two instances here Change-Id: I97aad336b613d105f380012f8c79e92d89c583ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158978 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-11-06uitest: Clean up redundant usage of gb_UITest_use_oneprocessXisco Fauli
After 8c39af455c4dee53c6f3c918b0497f80a4fb0f21 "uitest oneprocess mode: default to this and clean up one test" Change-Id: Ib6e0fc3de2997beebc650253ae3ea19a3314ae09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158844 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-11-05tdf#158067 Replace OUStringLiteral in accdocBogdan B
Change-Id: I88bfdf41137adf34ca5af4e73cf6ca487d8fe5ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158899 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-04tdf#114441 Convert use of sal_uLong to better integer typesEMartinGube
Return type of GetColumnFormat() is changed to sal_uInt32. All the values from the function calls inside GetCloumnFormat() which were involved in the return value seem to be positive right now. Change-Id: Id19b2982d8372e10fee5fc0fd4233576076ec3df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155680 Tested-by: Hossein <hossein@libreoffice.org> Reviewed-by: Hossein <hossein@libreoffice.org>
2023-11-03sw a11y: No longer report underline for misspellingMichael Weghorn
No longer report a red wavy underline for misspelled words in Writer. The underline isn't really a character/text attribute, since it's not part of the actual formatting of the text, but is just shown visually. Each platform a11y API has a better way to explicitly report misspelling. commit ec2e02cfa41510c3d30b118cbf7595c84a046d03 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue Oct 17 14:36:58 2023 +0200 tdf#157696 a11y: Report spelling error via IA2 "invalid:spelling" attr and commit 2bf88c172c9c9d159344b95fb96073f4891a6c30 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Wed Oct 18 13:44:42 2023 +0200 tdf#157696 wina11y: Switch from custom to IA2 text attributes added the implementation for Windows and the Qt-based VCL plugins on Linux. On macOS (`NSAccessibilityMarkedMisspelledTextAttribute`/ `NSAccessibilityMisspelledTextAttribute`) and for gtk3/ATK, the corresponding attributes were already used before. Therefore, reporting an underline as a workaround is no longer needed. Orca on Linux, NVDA on Windows (with [1] in place) and CrossOver on macOS all make use of the specific character attribute to announce spelling errors, not the underline. If any assistive technology should stop reporting spelling errors due to this change, it should be fixed to handle the proper text attribute as well. After switching to text attributes according to the IAccessible2 specification on Windows (i.e. with, the above-mentioned commits and the NVDA commit to switch to IAccessible2 text attributes for LO [1]), NVDA was starting to announce not only that a word is misspelled, but an underline in addition, which is no more the case now that the underlining is no more reported. [1] https://github.com/nvaccess/nvda/commit/de4e8814f39ab6ae9fbc5330b007494ef6888cd3 Change-Id: Ifa29e0080a4a039c5a119dd0debe5e924fa546ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158847 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-03tdf#157801 Fix direct formatting is applied after pressing OK in theJim Raykowski
Character properties dialog when the Highlighting tab Color page is open and the color has not been changed This is noticeable when character highlighting direct formatting is already at paragraph level. The expected result of opening the properties dialog, and immediately pressing OK without changing anything (or alternatively, after changing something there and then pressing Reset then OK), is no changes in applied properties at all. Inspiration for rework of the background tab page. With this patch XATTR_FILL items need not be included in the InAttrs set, for example, as part of this patch, the XATTR_FILLSTYLE, XATTR_FILLCOLOR range is removed from the sw_CharDialog core set. Change-Id: Ic2de53a29579c33820fc381d354a4afebe048a5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158100 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-11-03tdf#158039 sw track changes: fix cycle case of selected sentencesLászló Németh
Previous tracked changes of cycle case weren't removed, if the selection doesn't end in a tracked change, i.e. sentences with punctuation, or selections end in a capitalized word etc. Fix also lost selection of multiple selected nodes. Follow up to commit 4cf8de89bad9143a5b2dd3d6351080bf62b76029 "tdf#157667 sw track changes: fix cycle case on multiple words", commit dc748d7dbd114fbf663752258dbaf003af2926c3 "tdf#141198 sw: fix cycle case with change tracking" and commit 79435eb55ef226fb0e3507aabdc2f8af062680f6 "tdf#157988 sw track changes: fix cycle case on a selected word". Change-Id: I24476c359200a25ca9bcd467c33b0ebeb1afb037 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158804 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2023-11-03SwNavigator: Improve field content sortingJim Raykowski
Shave some time off sorting field content entries for documents with large number of fields by eliminating a second sort and the loop used to determine if a second sort is done because a field is found in a frame. Also corrects ordering of fields in nested frames which prior to this patch are placed at the beginning of the field content entries. Change-Id: I5fbd67b6fb0ac1ef49a5df7721bb209d4cba4013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158606 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
2023-11-02Related: ofz#63786 make it clearer what m_aShortSprm is used forCaolán McNamara
its not used as a SVBT32, only as a little buffer Change-Id: I7a6d364c68ae31520cbb7432da832d108a9daeff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158787 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>