summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
AgeCommit message (Collapse)AuthorFilesLines
2024-03-13sw: layout: use page style set on hidden paragraphMichael Stahl1-5/+17
SwPageFrame::FindPageDesc() now ignores paragraphs hidden for any reason, but to maintain layout compatibility it should only ignore paragraphs in a hidden section, not paragraphs hidden by fields. (regression from commit 0c96119895b347f8eb5bb89f393351bd3c02b9f1) Change-Id: Iad5e76f5cc437d35b4ae9bde6bc9b73dbe32bf3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164761 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-03-06sw: SelectAll of section with RES_PAGEDESC corner-caseMichael Stahl1-0/+109
The main problem here is that if a document has a RES_PAGEDESC on its first body text node, and you paste a section whose first text node also has a RES_PAGEDESC, the result inevitably has a page break that wasn't there before, and which is unwanted. SwEditShell::CopySelToDoc() needs a change to include the end node of a section at the start, so it is copied. Change CopyImplImpl() to insert a non-textnode *before* a text node at the insert position, instead of after it. This simplifies the implementation: only SwFEShell::Paste() needs to care about removing an empty trailing paragraph, but SwEditShell::CopySelToDoc() needs no changes; both functions would need to delete the empty paragraph when inserting after. Several tests such as CppunitTest_sw_ooxmlexport3 testCrashWhileSave fail because of this, which can be solved by removing the DelFullPara() call in SwXText::copyText() that is now unnecessary. Generalise and simplify the "bAfterTable" code in CopyImplImpl(): it doesn't really matter what is before the insert position, what matters is if the pasted text starts with a table or section. Also, the fly-anchor-correction code (both here and in SwUndoInserts::RedoImpl()) needs to move to the first text node also in case a section was inserted (but the equal-looking code *before* inserting remains as is!), in the situation where the last node will be deleted. Now there are some test failures: unowriter.cxx:430:Assertion Test name: (anonymous namespace)::testSectionAnchorCopyTableAtStart::TestBody equality assertion failed - Expected: quux foo bar - Actual : quux foo This is because the end position was created from SwNodeIndex aInsPos only, it needs to take also the aDestIdx from the "if (pEndTextNd)" branch. testTdf134250::TestBody finished in: 867ms uiwriter2.cxx:462:Assertion Test name: testTdf134250::TestBody equality assertion failed - Expected: 1 - Actual : 2 The section is pasted now, so there are 2. uiwriter3.cxx:1519:Assertion Test name: testTdf135733::TestBody equality assertion failed - Expected: 1 - Actual : 2 Table is now inserted before the first paragraph, which has a RES_PAGEDESC. (presumably regression from commit 9667e5ffd18d6167344e102b89a393bc981644ec) Change-Id: I820e381113fee90a81249afbc2280bfc3ddb7647 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164401 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski1-1/+1
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-21Remove DeleteItemOnIdlexArmin Le Grand (allotropia)1-2/+3
There are some CrashReports in 7.6 which have DeleteItemOnIdle on the stack, but there is nothing reproducable. So I took a look... I first thought it's a MCGR regression, due to classes on the stack. But the Item involved is just random, can happen with any Item. Then I thought it may have to do with ITEM refactorings, but it happens with DeleteItemOnIdle involved, so also not the case. I already saw DeleteItemOnIdle when doing these and qualified as 'hack' in the way. already It is only on Windows and DeleteItemOnIdle is involved. This again (took a deeper look now) is an old hack to keep an SfxPoolItem 'alive' for some 'time'. For that, it triggers an async reschedule which then deletes the Item when being called. If the Item will be used after that is pure coincidence - seems to work in most cases. It seems as if for Windows the timing slightly changed for some scenarios, so a reschedule is too early. This can happen with this hack anytime. DeleteItemOnIdle is used in scenarios where SfxPoolItem* is e.g. returned, but is *not* anchored, so e.g. not member of an SfxItemSet. Or in short: Lifetime is not safe. DeleteItemOnIdle exists since 1st import, but was changed to AsyncEvent ca. 4 months ago (see 57145acf9ec47c23e307b7a5c0029d21d937cc35), so that may have caused it. It is possible that these errors happen on Windows since then. Before something more complicated was used to delete it late, but surely also not really safe. Due to ITEM refactor I have the knowledge/tooling to solve this. It will not be a 1-5 lines fix, but it is a hack and in the way for further ITEM refactor anyways. What we have nowadays is a SfxPoolItemHolder -> it's like an SfxItemSet for a single Item. It safely holds/ controls the lifetime of an SfxPoolItem. It is already used in quite some places. It helps to solve many hacks, also the ones putting Items directly to the Pool - due to there never was an alternative for that. In principle the ItemPool/ItemSet/Item paradigm was never complete without SfxPoolItemHolder. Thus I started to fix that (and remove that hack for good, sooo many changes over the years, sigh), but as said is not straightforward. Will have to change retvals of involved stuff to SfxPoolItemHolder - it's just two pointers and designed to be copied (one is a Pool, needed to cleanup when destructing). CopyConstruct/destroy just counts the RefCnt up/down, so cheap. 1st version compiling, let's check on gerrit... Corrected one error in QueryState for securitypage, also added some security features/asserts. Change-Id: Ida49fd35ca88ead84b11d93e18b978cb9e395090 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161083 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-11-24tdf#148389 sw: fix Delete Undo/Redo of bookmark positionsMichael Stahl1-0/+146
The main problem is that in SwUndoSaveContent::DelContentIndex() if the selection start/end is equal to the bookmark start/end, the bookmark is not deleted and no SwHistoryBookmark is created, hence on Undo the bookmark positions are not restored. Since deleting bookmarks in more situations might cause user complaints, let's just extend the creation of SwHistoryBookmark to these cases, which means we need to take care both here and in SwHistoryBookmark::SetInDoc() that there is now a situation where all bookmark positions are saved and restored but the bookmark still exists in the document because it wasn't deleted. The next problem is that using Backspace/Delete keys sets the ArtificialSelection flag which is stored in SwUndoDelete, but when used multiple times the SwUndoDelete::CanGrouping() extends an existing SwUndoDelete, and if it previously would not delete a bookmark, the extended range might fully contain the bookmark and thus delete it on Redo, so check if there are saved bookmark positions and prevent grouping in that case. Another problem is then that SwUndoDelete::RedoImpl() deletes the bookmark anyway, as already indicated with a FIXME comment. This can be prevented by passing the now-existing m_DeleteFlags into DelBookmarks() from DeleteRangeImplImpl(). Change-Id: Id5eb1a58927aaa6e7e8b75be82d7f854d8057cfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159875 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-11-19Extended loplugin:ostr: swStephan Bergmann1-5/+5
Change-Id: I210f61f6d90776b086b7058fb1a831d235699fb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159670 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: swStephan Bergmann1-8/+8
Change-Id: I85fff7ed6932c5fc196e18f24fa01074ba4837e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158241 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann1-7/+7
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 Grandin1-1/+1
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-06-16tdf#125154 i18npool,sw: fix group separators in numbers in formulasMichael Stahl1-0/+47
Commit 776f7e7463de3e97f3056712ee567f49a314829d changed cclass_Unicode to reject group separators in numbers by default, but users are complaining that the neat "5.000" numbers in their existing documents are now considered invalid. * in SwCalc, use GROUP_SEPARATOR_IN_NUMBER * in cclass_Unicode::parseText(), reject a group separator if it is not followed by at least 3 digits With this, a number from tdf#42518 "0.19" is still considered invalid, while "5.000" is now valid again. Change-Id: If86f2ed4c27be16f866d7f4cee00789344e9ee2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153047 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-15tdf#155685 sw: fix another ExtendedSelectAll Redo crash w table at endMichael Stahl1-0/+18
This can be reproduced with a table containing in the last cell a paragraph followed by a table, then ExtendedSelectAll in the cell and delete. On Redo of the SwUndoDelete: warn:legacy.osl:326138:326138:sw/source/core/frmedt/tblsel.cxx:1775: MakeSelUnions with pStart or pEnd not in CellFrame In function: const_reference std::vector<SwTableBox *>::operator[](size_type) const [_Tp = SwTableBox *, _Allocator = std::allocator<SwTableBox *>] Error: attempt to subscript container with out-of-bounds index 0, but container only holds 0 elements. The problem is that DelTable() calls PaMCorrAbs() with a target that is outside of the outer table, so the SwEditShell::DeleteSel() rPam has one end in the last table cell and other end outside the table. Change-Id: Ia2764a4c99ba12102957153e005284a44be04fd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153114 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-06-01SwModelTestBase: simplify code a bitXisco Fauli1-1/+1
and rename reload method to saveAndReload to unify code and use it everywhere Change-Id: I7c0f4e8d2feb7a0f9ca28df4b6dddd7a11b2e57e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152455 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-04-13-Werror,-Wunused-variableStephan Bergmann1-2/+0
Unused ever since the two variables got introduced in 19b0171bbb6c2bcdab998b74a212dc68b1884e84 "tdf#108494 fix regression". (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: Idb06de376cf5bed273f0ebb46c00b9f6f675b223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150372 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-02qa: simplify codeXisco Fauli1-4/+1
Change-Id: I79328b4f26eeb01bfda0502657bf0d47f3699fdb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148123 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-28CppunitTest_sw_uiwriter*: use uno commands for copy/cut/pasteXisco Fauli1-14/+6
In order to unify the code and to make sure Scheduler::ProcessEventsToIdle() is always called afterwards See 9027920783dd04db925c41b559abe6442cedf39e "improve reliability of CppunitTest_sw_uiwriter3 something in the paste stuff seems to need UI events to be processed" Initially, these uno commands were replaced in 9d08a0cea018226ce155104d8df146dc2a412aac "avoid uno:Paste in tests clipboard is a shared resource (except for svp) so interleaved tests are not guaranteed to get out what they put in" However, this is no longer a problem since e25ba7dc57229d1cb9794abd1ca23c0d87ebecb3 "use a dummy clipboard when running unit tests so the multiple unit tests don't stomp on each other. This fixes a couple of things in my earlier attempt (*) actually set the env variable on Windows (*) don't use a global variable to test the env var, because that variable might be initialised BEFORE the env var is actually set" Change-Id: Ifae66e522b0a1e57fa1fa6d16980c6491b397f7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147957 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-21qa: call ProcessEventsToIdle inside dispatchCommandXisco Fauli1-2/+0
Change-Id: I909e6f334f4a659282141a97ccb3ffdea6ecc364 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147397 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-02-16SfxViewShell::GetViewFrame never returns null, change to a referenceCaolán McNamara1-1/+1
various null checks can be seen to be redundant and removed Change-Id: Icf49c1de4b0302795d2769a370af3abceaad0221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-01-26sw: no need to create the document twiceXisco Fauli1-1/+0
Change-Id: I566fde00f414b9b983770256697ff2a6f3cf1781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146175 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-01-05tdf#56258 en_US: increase outline levels definitions to 6Justin Luth1-1/+1
There are 10 levels in numbering, so it only makes sense to allow outline definitions for all 10 levels. Note that DOC/X formats only allow 9 levels, There are two code paths that read these definitions. The SVX toolbar code to allow 10 levels (SVX_MAX_NUM) was already completed in the previous patch. This commit allows 10 levels for the Bullets and Numbering menu dialog. Since all choices MUST define the same number of levels, I only added one more. I hope that there isn't some secret kind of requirement that ALL LOCALE's must also use the same number of definitions - it doesn't seem to. [Although not a direct comparison, bg_BG defines 10 single number levels, compared to en_US's 8, and some Chinese locales also do more than 8.] Change-Id: Ibe00d54cfa4577db83eba368b92be11055b076ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144976 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-12-16tdf#149548 sw: add unit testMichael Stahl1-0/+43
Change-Id: Ibb4eadc15f539ee2d4f030c6366c9abd92bc3823 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144249 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-12-14tdf#149595 sw: fix showing of fly at start/end of single-para deleteMichael Stahl1-0/+75
... with change tracking enabled. Corner case where there are no extents for the node but the deletion is in a single node (i.e. delete from node start to node end). Make this consistent with what happens without change tracking. (regression from commit 28b77c89dfcafae82cf2a6d85731b643ff9290e5) Change-Id: Ib63c4108c86c36508e1a378824ab3511dc46ae47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144109 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-11-23UnoApiTest: factor out createTempFileXisco Fauli1-10/+5
Change-Id: I8d7bb4593839d3660b6609d836b09d50b68f5712 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143141 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-23CppunitTest_sw_uiwriter: use more SwParaPortion::dumpAsXml()Miklos Vajna1-1/+1
Which means XmlPortionDumper can be finally removed. See commit feeed3e762cf077fbd9cf48f82e949365108ccc1 (CppunitTest_sw_layoutwriter: avoid some a11y-based layout testing, 2022-04-07) for motivation. Change-Id: I50e6c49a50c5ccbec9e426ad796d85865dcc93e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143128 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-11SwModelTestBase: use createSwDoc everywhereXisco Fauli1-42/+84
In order to unify the code Also call getSwDoc only when it's needed so move it outside createSwDoc Change-Id: I082d46108581e8f2e2e430e854980035f471ceac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142586 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-04SwModelTestBase: make mpTestDocumentPath privateXisco Fauli1-29/+30
in preparation for future inheritance from UnoApiTest Change-Id: Ie5dee5af3609d8490d7d7bad0d6dbc4c8fc17bb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142280 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-09-29split utl::TempFile into fast and named variantsNoel Grandin1-1/+1
which makes it easier to know what each variant requires to stay on it's happy path Change-Id: I3275a2543573367714bc78092e882f6535507285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-14rename SwPaM::GetContentNode to GetPointContentNode/GetMarkContentNodeNoel Grandin1-2/+2
Using a parameter to select point/mark makes the code much harder to read Change-Id: Ic24098a6045ff2262d4c808228ded7bf8206fe8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-14rename SwPaM::GetNode to GetPointNode/GetContentNodeNoel Grandin1-8/+8
Using a parameter to select point/mark makes the code much harder to read Change-Id: I4ac8b904ac423e2b99253b7e4b6adc72c8afe1a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138083 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::GetContentIndexNoel Grandin1-9/+9
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nContent.GetIndex' | xargs perl -pi -e 's/\bnContent\.GetIndex/GetContentIndex/g' Change-Id: I12684071a6666c365dbadbab2a4b37cf51b274d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137695 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::GetNodeIndexNoel Grandin1-8/+8
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nNode.GetIndex' | xargs perl -pi -e 's/\bnNode\.GetIndex/GetNodeIndex/g' Change-Id: I3616cea4c47595afe74f1aa8e3be553279f25d44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::GetNodeNoel Grandin1-4/+4
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nNode.GetNode' | xargs perl -pi -e 's/nNode\.GetNode/GetNode/g' Change-Id: Id1937df1bd5a54677c2c1bbfb2d693a4e22a7b98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137671 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-26convert CRSR_SKIP_* to typed enumNoel Grandin1-11/+11
Change-Id: Ia5cb9915fc7ad3238f4386f5ed3e43efc4b74a32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137478 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-11tools: rename getHeight/Width() to GetOpenHeight/Width()Chris Sherlock1-1/+1
By default Rectangle uses closed interval, if we really want to use half open intervals then we should specifically say as such in the name. Change-Id: Id7a91120ba1a1a4bc330014216b73a692dbf03a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136575 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-05-17tdf#147220 sw_redlinehide: update frames in ReplaceRangeImpl()Michael Stahl1-0/+38
Change-Id: Ie5d62eaec01a3b06ff1bd6070510384641ea7ad3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134483 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-03Just use Any ctor instead of makeAny in swStephan Bergmann1-3/+3
Change-Id: I2c9023ba8d07314d23ae7a65e670e8748c5e9322 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133766 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-25tdf#135978 sw_redlinehide: recreate fly frames anchored to subsequent nodesMichael Stahl1-0/+51
... in SwTextNode::JoinNext(). The 2nd node is deleted, so its frame is deleted, and if it is the start of a merged frame, fly frames on the node itself will be recreated already, but those on subseqent nodes need an extra call. Change-Id: I18999946334f5560b720d3d275610bc8b07973f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133335 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-04-19sw: check if cursor position is valid before inserting fileMichael Stahl1-0/+19
SwXTextCursor::insertDocumentFromURL() must not insert the file inside of an input field. If the CH_TXT_ATR_INPUTFIELD* become separated to different text nodes, things are going to break. Change-Id: Ia170e63f6c6d8a8fdd18f0b91e2b333e660ed924 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133028 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2022-04-08sw_uiwriter: put autocorrect tests togetherXisco Fauli1-109/+0
Change-Id: I06e720b6fccab298a866eb05403ca98152ab4c8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132679 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-05forcepoint#104 sw: do not delete fieldmark chars in MoveNodeRange()Caolán McNamara1-2/+2
The problem is that SwXTextTableCursor::mergeRange() wants to move some nodes, and the deleteMarks() deletes a fieldmark creating a SaveBookmark but it contains the positions relative to the CH_TXT_ATR_FIELD* still in the text, while deleting the fieldmark of course removes these. The SaveBookmark would need to adjust the indexes and store the separator position too and the vector would need to be restored in reverse order. But every time the SaveBookmarks are created, they are restored as well, so it looks simpler to just suppress deleting the CH_TXT_ATR_FIELD* in this case, and inserting them too (latter is already done when copying text). Change-Id: I690c6432a38eab6dec10adff74e638f0e52cca55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132531 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-04-04use string_view in comphelper::string::splitNoel Grandin1-1/+1
Change-Id: I4afe8aee85905ee35ba195b00b454aefa0ba38af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-28Recheck sw/ cxx files with IWYUGabor Kelemen1-3/+3
See tdf#42949 for motivation Change-Id: I8a8df68946297fad517b753d73e4373203a45ed6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132150 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-03-15sw: split CppunitTest_sw_uiwriter into uiwriter and uiwriter7Xisco Fauli1-2611/+1
Similar to a2a2e07996a0e49164663eaec5d79481bf7bb3e0 "sw: split CppunitTest_sw_uiwriter2 into uiwriter2 and uiwriter5" it already had 117 tests Change-Id: I6bcdcd672c655b853f8f366db3b78d3da49f9078 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131635 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-14add TypedWhichId version of QueryStateNoel Grandin1-5/+4
Change-Id: I95b86fc081847da01e06f50a1b2c7e7f5456c638 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131529 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-07do not pass XComponentContext to officecfg::...::get() callsLuboš Luňák1-2/+1
It's used only for the ConfigurationWrapper singleton, so it's used only the first time and then ignored. It also causes calls to comphelper::getProcessComponentContext() for every single invocation despite the value not being needed, and the calls may not be cheap (it's ~5% CPU during ODS save because relatively frequent calls to officecfg::Office::Common::Save::ODF::DefaultVersion::get()). Change-Id: I02c17a1a9cb498aeef220ddd5a0bde5523cb0ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131056 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-07sw_redlinehide: more issues with SwEditWin Surrounding functionsMichael Stahl1-3/+3
.. and SwEditWinUIObject. These need to work with TextFrameIndex. Add some functions to SwCursorShell to make it possible. Change-Id: I884c4822a0e7ecf254ea09a893762e1e6d539534 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131042 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-01-31tdf#46037 remove confighelper from uiwriter testsDhiraj Holden1-4/+10
Change-Id: I984d707e61d526791c60d57dd35727432f7f42bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129135 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2022-01-28CppunitTest_sw_uiwriter: no need to inherit from HtmlTestToolsXisco Fauli1-2/+1
Change-Id: I62413319720e110503a186e65ba0f7167a0cb069 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129093 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-01-28CppunitTest_sw_uiwriter*: remove unused includesXisco Fauli1-46/+0
Change-Id: I9f06f259df43ba5f5ea591427e86b1191c712dfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129087 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-01-27CppunitTest_sw_uiwriter: use CPPUNIT_TEST_FIXTUREXisco Fauli1-396/+156
there are two reason why i'm doing this: 1. Use the same way to define tests as CppunitTest_sw_uiwriter2 and CppunitTest_sw_uiwriter3 2. Over the time, these files grow quite large, it's easier to split them when they use CPPUNIT_TEST_FIXTURE Change-Id: Ibdeb23f08237d15063e99637297615343cb7ee1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129042 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-01-10Move HAVE_MORE_FONTS into an extra config headerJan-Marek Glogowski1-0/+1
No need to recompile most of LibreOffice, because the --with-fonts configure flag changed. This preprocessor define is just used by unit tests anyway. Change-Id: Ia2eae7d0c74e59e034fdd8513504a34e51ab428e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128197 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>