summaryrefslogtreecommitdiff
path: root/sw/qa/extras/unowriter/unowriter.cxx
AgeCommit message (Collapse)AuthorFilesLines
2024-10-30SwModelTestBase: add getSwTextDoc and use it everywhereXisco Fauli1-3/+2
Change-Id: I09f132a9c79f0aa4c3f4d3ca5f2fed233d0dcb06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175641 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-29UnoApiTest: check mxComponent right after loadingXisco Fauli1-2/+1
Change-Id: Ia834d19a5af999440f7d5847aeeae863daacd952 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175784 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-10-25sw/qa: use getSwDocShell() when possibleXisco Fauli1-11/+5
Change-Id: Ia2e3dad4e62fb084c3a88564deb137cbcc7728b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175573 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-10-24sw/qa: use getSwDoc() moreXisco Fauli1-3/+1
Change-Id: I742309d99c4d9839dcd4f8b747fc9aef549998ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175555 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-08-15tdf#162480: Make sure to use correct anchor point for text box creationMike Kaganski1-0/+18
In the ODF import, when importing a table, initially a placeholder 1x1 table is created. When this is done from SwView::InsertMedium, frames are created for the table and its single cell at that stage. Then the actual table nodes are created, but frames are not created in parallel, until the table import is finished. Importing a text box, it used to be created anchored at the end of the document, and then the anchor was moved to the correct place. When a text box was anchored to a cell, the process was like this: the text content was inserted in the last paragraph outside of the current table; and then it was moved to the current cell. When this was done from SwView::InsertMedium, creation of the text content also created the frame; then the movement fired client notifications, including the SwFlyAtContentFrame::SwClientNotify, which needs the new anchor frame. With cell other than A1, there was no frames for the new anchor in the table, and that crashed. This change inserts the text content into the correct place from start, which avoids the need to move the anchor later. Co-authored-by: Miklos Vajna <vmiklos@collabora.com> Change-Id: I9dd3a2c5527f3c2dd860244456c617558943453a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171898 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-06-19tdf#62603: sw unit test: replace string mix font styleKira Tubo1-0/+91
Test to see if font style is retained when performing find/replace on strings containing mixed font style/sizes. 1) For example, with a doc containing the string: "test - Normal font: " - Italic font: test 2) Search for: "t (this contains both normal and italic font) 3) Replace with: "gu 4) Resulting string should be: "guest - Normal font: " - Italic font: guest An additional test has been added to test for changes in font sizes (per comment 24). Change-Id: I957077efbcced0b981c31d0e547299e12a61609b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168486 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
2024-06-19Fix typoAndrea Gelmini1-1/+1
Change-Id: Ifae040774dff2e75d4ddcfd38e8e67192f70d69a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169160 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-06-10loplugin:ostr in sw/qa/extrasNoel Grandin1-172/+179
Change-Id: Ia11b13ec7ed2402e717a4e64e7c7e4aa0b41d70f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168598 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-16tdf#161035: The previous bookmarks can legitimately be not processedMike Kaganski1-0/+27
The enumeration may be called for a partial paragraph selection, and then the bookmarks prior to the selection are not processed. Change-Id: Ib725ffb320ec5a81b39ce77f06392a82bd6d8ee0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167720 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-04-25tdf#141525: sw unit test: line w/ arrow/circle endpointsKira Tubo1-0/+26
Unit test checks that the "Line with Arrow/Circle" shape is inserted with "Arrow" at the start of the line and "Circle" at the end of the line. Without the fix from tdf#141525, the "Circle" is missing at the end of the line. Change-Id: I2c952deffea908b3daf855dabd9d19f1f6133268 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166576 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-03-21tdf#160278: restore cursor bounds properlyMike Kaganski1-0/+21
The passed string length is not a correct measure of how many steps should the selection expand in the resulting text: the cursor goes over glyphs, not over UTF-16 code units. Thus, it's easier to store the position prior to insertion, and restore it from the indexes. Change-Id: I1d592ff30199007ba3a99d7e1a6d2db2da35f1cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165056 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-12-21address nit: put unit tests in anonymouse namespaceJustin Luth1-5/+5
https://gerrit.libreoffice.org/c/core/+/160655/5/sw/qa/extras/rtfexport/rtfexport8.cxx Miklos "nitted" me that I didn't wrap this test in an anonymous namespace. Obviously anything I do is simply copy/paste, so lets make sure that at least the latest and greatest versions of each series of unit tests are done "correctly". Change-Id: I699c8d70e4f587373918e27f08304a0fe815bff4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160991 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: swStephan Bergmann1-6/+6
Change-Id: I85fff7ed6932c5fc196e18f24fa01074ba4837e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158241 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-03tdf#141908: CppUnittests: replace usage of sal_Int32 with colorsAnkit_Jaipuriar1-3/+3
Change-Id: I6c7d8d92fe6860cd213a3cbded2451e8788ae2f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157196 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-26new loplugin:constexprliteralNoel Grandin1-6/+6
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-09sw: remove unused DocumentContentOperationsManager::InsertGraphicObject()Miklos Vajna1-2/+3
Only tests called it, migrate those to DocumentContentOperationsManager::InsertGraphic() instead, which is what SwFEShell::Insert() and SwXFrame::attachToRange() use. Change-Id: Ie05b501507f8722bc0a312c2e729ecd76154ce98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143836 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-11SwModelTestBase: use createSwDoc everywhereXisco Fauli1-11/+11
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-11SwModelTestBase: remove duplicated methodXisco Fauli1-17/+17
Change-Id: I343fe2711e232ffbdec13f0072ee31a7549f7da8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142546 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-04SwModelTestBase: make mpTestDocumentPath privateXisco Fauli1-20/+15
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-08-14rename SwPaM::GetNode to GetPointNode/GetContentNodeNoel Grandin1-1/+1
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-07-26convert CRSR_SKIP_* to typed enumNoel Grandin1-4/+4
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-05-03Just use Any ctor instead of makeAny in swStephan Bergmann1-13/+13
Change-Id: I2c9023ba8d07314d23ae7a65e670e8748c5e9322 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133766 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-31Prepare for removal of non-const operator[] from Sequence in swMike Kaganski1-5/+4
Change-Id: Ie9530262e4addec01091cc1147e68be5b5a782f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124398 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-19Move svl::Items to include/svl/whichranges.hxx, and unify its usageMike Kaganski1-2/+2
... in WhichRangesContainer and SfxItemSet ctors. Now it's not needed to explicitly use 'value' in WhichRangesContainer's ctor, or create an instance for use in SfxItemSet ctor (svl::Items is already defined as a template value of corresponding type). Instead of WhichRangesContainer Foo(svl::Items<1, 2>::value); SfxItemSet Bar(rItemPool, svl::Items<1, 2>{}); now use: WhichRangesContainer Foo(svl::Items<1, 2>); SfxItemSet Bar(rItemPool, svl::Items<1, 2>); Change-Id: I4681d952b6442732025e5a26768098878907a238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119157 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-02sw: handle RANGE_IS_SECTION in SwXTextRange::getText()Michael Stahl1-0/+3
It always returned null. This was missing in 6471d88cb8b61741c51499ac579dd16cb5b67ebf Change-Id: Ibf34c24fdbbbc2f65c6948f58d12f257ccf120ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118286 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-05-12tdf#137810 sw: fix SwXNumberingRules setting CharStyleNameMichael Stahl1-0/+33
During ODF import, due to removal of the pDocShell parameter, this hits else rCharStyleName = sCharFormatName; while setting the "CharStyleName" property and later GetNumberingRuleByIndex() prefers m_sNewCharStyleNames over the format set in the SwCharFormat?? Also, "BulletFontName" has a similar problem; otoh "HeadingStyleName" only makes sense on chapter numbering. The m_pDoc and m_pDocShell members are such a WTF. (regression from ae0e4a6ba9be2fa99ac2be8e20157806e36209b2) Change-Id: I9d4d4cd7aeb7e6e29221d53facaff213fd4e35a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115495 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-03-25const OUString -> const OUStringLiteralMike Kaganski1-6/+6
Mostly automated rewrite Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-15loplugin:referencecasting in swNoel1-1/+1
Change-Id: Ie923fc8baaa26938378407f6e5f3c50b2cea7cca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110815 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-04sw: fix copying and deleting of table in section via APIMichael Stahl1-0/+59
This is a follow-up to 7ab349296dac79dad3fec09f60348efcbb9ea17e. The first problem was that tables that contain protected cells refused to be deleted, which caused an infinite loop in SwXTextRange::DeleteAndInsert(). This also affected SwXTextTable::dispose(), and DDE tables. Fix this by forcibly deleting even protected cells from UNO APIs; protection is an UI feature. The second problem was that pasting the table SwFEShell::Paste() would set up aCpyPam so that it selects from the start node of the table to the last text node in the table, excluding the table cell and table end nodes, which caused: DocumentContentOperationsManager.cxx:3548: An insufficient number of nodes were copied! Fix this by setting up aCpyPam over the entire body section of the clipboard document. Change-Id: I8c6caee5e75260dff79f106efc11f9669feddc0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110411 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-01-10fix coverity parse errorsCaolán McNamara1-1/+1
Change-Id: I4884bfb67a061b865e8cf38b2fea6de0cb1bc3d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109057 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-26New loplugin:stringliteralvarStephan Bergmann1-1/+1
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-24sw: fix SwXTextRange::createEnumeration() inside table cellMichael Stahl1-0/+27
This would set CursorType::SelectionInTable but leave m_pOwnTable and m_pOwnStartNode uninitialised, causing sw/source/core/unocore/unoobj2.cxx:399: SwXParagraphEnumeration: table type but no start node or table and then the enumeration would return the table it's in as the first element, which is quite annoying. Refactor the creation of SwXParagraphEnumeration to prevent this. Change-Id: I4e9e3456bdf66b9822d19ad985a20b094e6bbba4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106532 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-11-24sw: fix copying and deleting of section content via APIMichael Stahl1-0/+122
The problem happens if a section starts or ends with a table: SwXTextSection::getAnchor() may return a SwXTextRange with one position in a table cell and another position in a different table cell, or outside the table, neither of which is valid to set the cursor via SwXTextViewCurosor::gotoRange(). Introduce a new special mode for SwXTextRange, RANGE_IS_SECTION, analogous to RANGE_IS_TABLE but actually working. Only SwXTextView can be used to create XTransferables, and it requires selecting first via either the SwXTextViewCursor or select(). It's currently not possible to select the content of a section in the ViewShell in these problematic cases, and would be some effort to add. So add a new interface XTransferableTextSupplier that can be used to create XTransferable from the SwXTextRange with RANGE_IS_SECTION. The core CopyRange() and DeleteRange() functions can deal with SwPaMs that start or end in non-text-nodes, so pass the whole section content to these in SwXTextRange::setString() and in SwXTextView::getTransferableFromTextRange(). Change-Id: If7e3210e8a26f5618317c294f2b2f3ed5c217f1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106293 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel1-2/+2
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-20use tools::Long in swNoel1-1/+1
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-28sw: prefix members of SwFrameChangesLeave, SwSidebarItem, ...Miklos Vajna1-1/+1
... SwSizeEnterLeave and SwTextAPIObject See tdf#94879 for motivation. Change-Id: Iea12ac975b68700488f7b39bbb3596a011159c61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103528 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-08-23Fix typosAndrea Gelmini1-1/+1
Change-Id: I305ec375c0aed8832290fe872edd050e53262a90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101217 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-15Fix typo in codeAndrea Gelmini1-2/+2
Change-Id: If2a5e5533a8587c83279d61d764c201e8572f075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100730 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-08-03tdf#42949 Fix IWYU warnings in include/[t-x]*/*hxxGabor Kelemen1-0/+1
Recheck after 7-0 branchoff Also drop the now unused file include/vcl/field.hxx Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9e54c82f50d1e02a0f99858939cac999fc66f7de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99261 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-31sw: introduce a Library_swqahelperMiklos Vajna1-0/+14
So it is no longer necessary to define all SwModelTestBase functions inline. Change-Id: Ia1055ff967b3614102275ec92607c85ec063fce7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99820 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-05Upcoming loplugin:elidestringvar: swStephan Bergmann1-5/+5
Change-Id: I3805d7a0f8f0e93463a2285a1ce52f6a5daba27d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95578 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-15CppUnittest: sw: simplify code. use getShapes and getShapeXisco Fauli1-6/+4
Change-Id: I494349b99a122f67ed1f2881faf1a37e4358c55b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94214 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14sw: fix fly at-char deletion API behaviour changeMichael Stahl1-0/+51
28b77c89dfcafae82cf2a6d85731b643ff9290e5 changed at-char anchored fly selection. WollMux calls setString("") to remove one character in the first paragraph and a fly anchored at the start of the body text is deleted due to the new IsAtStartOfSection() check. It would be possible to treat deletion via API differently than via UI, as there is already a flag ExcludeFlyAtStartEnd but it would require passing the flag through 10 functions and also to store it in SwUndoDelete... The main intent of the IsAtStartOfSection() check was that Ctrl+A should delete every fly; this can be achieved by checking that everything was selected, so that selections only inside the first/last paragraph don't delete the flys at the edges. Change-Id: Id62e7d99a10b42eaecea5564372d29b6c43e3f7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91993 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-22Fix typoAndrea Gelmini1-1/+1
Change-Id: Ic6198edef14817f91d889359878636320a64c09c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89253 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-01-07tdf#129841: fix GetTextTableCursorPropertyMap cell background valuesMike Kaganski1-0/+34
... which were accidentally broken in 2003 in commit eba784710e92597282a2284b56dce3a45ac38776. Change-Id: I3dc96dff0a8935f927933bb3946528fb8ac9aed0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86315 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-06tdf#129839: pass initialized shared_ptr to SwDoc::GetBoxAttrMike Kaganski1-0/+24
Regression after commit 1e2682235cded9a7cd90e55f0bfc60a1285e9a46 Change-Id: I40acc9e0ffdd292283381366a31eb6647b80324f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86291 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-03tdf#129743 follow-up: implement the other variant of the fixMike Kaganski1-11/+11
Reimplement commit d8a188d8d59ae51621a0540fe931e1c70db285fe Seems that I was overly optimistic. The behaviour of CreateCursor affects many places; first of them is CreateNewShellCursor, which would start returning cursors with selection after the fix from commit d8a188d8d59ae51621a0540fe931e1c70db285fe. Or if we change which cursor is returned from that method, then the order of the chain would reverse. And there are many such places. So just make it like before, and do the conservative fix. Change-Id: Ib6bf414f0e91d6fb59f73fbfc0fbd799457d49c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86151 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-03sw: add UNO API for semi-transparent textMiklos Vajna1-0/+16
This makes the ODF filter work out of the box, since the same property was provided by Draw/Impress in the past already. Change-Id: Ie6a053864c9fa41fad6ca4571d7d04a3756b7591 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86147 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-02tdf#129743: don't delete mark of current cursor when creating new cursorMike Kaganski1-0/+38
The deletion was there since initial import in commit 84a3db80b4fd66c6854b3135b5f69b61fd828e62. It's unclear why would it be necessary and what depend on it. All tests pass => let's drop it. Another (less intrusive, and IMO more of a workaround) way would be to move setting mark of pCursor after the loop over GetNext() in SwCursorShell::SetSelection. Change-Id: I5402db58d8f829799bc16b8f4f6014bcea133995 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86142 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-20sw: revert change in expanding hints in SwXText::insertTextContent()Michael Stahl1-0/+91
The SwXText implementation for inserting text works like this: * XTextPortionAppend methods appendTextPortion()/insertTextPortion() get the text properties passed as a parameter, and they should apply only those properties to the inserted text, not expand any existing formatting hints at the insert position. * XSimpleText method insertString() does expand existing formatting at the insert position, just like editing in the UI does For inserting XTextContent: * XTextContentAppend methods appendTextContent()/insertTextContentWithProperties() with properties parameter, similar to XTextPortionAppend * XTextContent::insertTextContent(), without properties So arguably, by analogy to inserting text, the methods that take properties should not expand hints, and the insertTextContent() should follow the insertString and expand hints. Commit 18cbb8fe699131a234355e1d00fa917fede6ac46 is an important bugfix for writerfilter import, but the problem is, it added the DontExpandFormat() call to insertTextContent(), whereas the regression it was fixing (from commit 232ad2f2588beff50cb5c1f3b689c581ba317583) was that the call was removed from insertTextContentWithProperties(). So restore the state before 232ad2f2588beff50cb5c1f3b689c581ba317583. Turns out that SwUiWriterTest2::testTdf126206 was checking how a bookmark-start is formatted instead of how the text is formatted. Change-Id: If524409f88a1a36aa062b6e132996d3f9c1bb571 Reviewed-on: https://gerrit.libreoffice.org/83223 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>