summaryrefslogtreecommitdiff
path: root/sw/inc/swcrsr.hxx
AgeCommit message (Collapse)Author
2021-06-11loplugin:unnecessaryreturn in sw/Noel Grandin
Change-Id: Iaca3f5385fd2c763cd1121ae50624aaa4a1f6165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24loplugin:stringviewparam extend to comparison operatorsNoel
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 swNoel
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-25tdf#101830 sw: show field name for inline input fields tooMichael Stahl
Currently if the View->Field Names is toggled, SwViewShell::ImplApplyViewOptions() will call Reformat() and throw away all existing portions. So we can just create a different kind of portion altogether depending on the value of the setting, and avoid complex multi-inheritance portion or copying lots of code around. This requires correcting a few assumptions that a SwFieldPortion has a length of 0 or 1; for the input field, its length is the length of the entire input field including CH_TXT_ATR_INPUTFIELDSTART/END (unless it's a follow/rest portion, those are length 0 as always). For the cursor travelling, LeftRight() works similar to f6a60ce214117946eef222701023dca612bf0a2b, while UpDown() and mouse click positioning need tweaks in SwTextCursor::GetModelPositionForViewPoint() to take the field length into account. Due to the previous point, mouse click related functions in edtwin.cxx require checking the position at the start now. When enabling Field Names, move any shell cursors out of input fields. Change-Id: I1304f419bd6fa20f0c55fd1b13165c4866d64000 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103155 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-09-09tdf#119286 speed up find/replaceNoel Grandin
SvxSearchItem is very expensive to construct, so move it outside the primary loop. This takes the time from 6s to 3s for me. Change-Id: Ie6491761e69c4f787910d7ecfbd071b7e68efd35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102231 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-31Translate German variable namesJohnny_M
Ende -> End Change-Id: Idf599738be9b1eaac51da3461edc424fcc83a94e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91217 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2018-12-18sw_redlinehide_4b: adapt FindFormat()Michael Stahl
Change-Id: I78cfca1cd629bf518f8294450a34ee228a360ef9
2018-12-18sw_redlinehide_4b: adapt FindAttrs()Michael Stahl
Iterate over merged nodes, and iterate over extents in them, so the complex attribute-finding logic doesn't need to be changed. Change-Id: Id72ca9247165a0c93f0cf2a38b7a0249771ca2eb
2018-12-18sw_redlinehide_4b: adapt FindText()Michael Stahl
Generally speaking, the find functions should find the strings that are visible in the document view. However, they may also be called from SwXTextDocument functions, where they ought to find the strings that are actually in the document model. So concoct some funny helper types and adapt this so it can handle both cases; it's not pretty but maybe it even works. Change-Id: I1917398ff928e922673353e75e8fb724dc042031
2018-12-18sw: refactor a confusing thicket of overloads, all named Find()Michael Stahl
Also, some of these don't really make much sense as member functions of SwPaM, so make them plain functions instead. Also, some pointer parameters are never null, but there is code to handle that case in MakeRegion(); simplify that. Change-Id: I822e814b0cab14f7f31cfa33478ed15774405a61
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-15sw_redlinehide_3: adapt SwCursorShell::LRMargin/IsAtLRMarginMichael Stahl
Change-Id: I4576a464b37e786178a3cb31a0be922f1b55db88
2018-09-19sw_redlinehide_2: view cursor movement, Word/Sentence functionsMichael Stahl
E.g. Ctrl+Left/Right, Ctrl+Shift+Del/Backspace, double-click to select word... These are all implemented in SwCursor, so they need a layout passed to them from the SwViewShell. There was a bug in the while loop in SwCursor::GoSentence() case NEXT_SENT that triggered assert in the mapping code when the endOfSentence() returned the length of the SwTextNode but then it was incremented once more. Change-Id: Ic3866860a8c07774dce35952271c207eb6e7d182
2018-09-19sw_redlinehide_2: adapt SwCursor::UpDown()Michael Stahl
Actually it already works, this is just a clean up to pass in the SwCursorShell's layout... Change-Id: I1a90bbe9966c7f4d5b5e959122ca1f995df93a45
2018-09-19sw_redlinehide_2: view cursor movement, SwCursorShell::LeftRight()Michael Stahl
Just put a loop in SwCursor::LeftRight() to repeat a movement if it didn't actually advance the text frame index; the SwContentNode::GoPrevious()/GoNext() take into account hidden text attributes from SwScriptInfo, so this ought to result in end positions that are neither hidden by attributes nor by redlines. This requires passing the layout to SwCursor. Change-Id: Ieb623840f6390fa6f1c78b7458ad8dc6523a2744
2018-08-16remove mempoolNoel Grandin
we've been using the normal memory allocator instead of the sal slab allocator ever since commit bc6a5d8e79e7d0e7d75ac107aa8e6aa275e434e9 Date: Wed Nov 15 16:52:44 2017 +0530 Disable custom allocator Change-Id: I3383962cedb85d56fbec695398901f6ff7057651 Reviewed-on: https://gerrit.libreoffice.org/58577 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-04-Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann
It is apparently by "design" that SwCursor has a deleted copy ctor and non- deleted copy assignment op, see bdf3c9bff607e3977c8455927b21ba292530d25a 'sw: replace SwPaM's so-called "copy constructor'" and c23dd470d49d722197c148f4ef64a6a3350af88d "sw: same treatment for SwCursor's fake 'copy constructor'" Change-Id: I7c44dcf022fa3edbd371d5a19c547f6ebdc13204 Reviewed-on: https://gerrit.libreoffice.org/56934 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-06-07provide overrides of GetNext/GetPrev in SwPaM subclassesNoel Grandin
so we don't need to cast at the call sites. Also fix the type of mpExtInputRing in SwDoc Change-Id: I60794a4b5c24ca552eafa87b8810dc08efdee3ea Reviewed-on: https://gerrit.libreoffice.org/52455 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-28loplugin:countusersofdefaultparamsNoel Grandin
Change-Id: I84868b3115c534a8240394283cc3beedf8cb3a80 Reviewed-on: https://gerrit.libreoffice.org/53543 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-23loplugin:useuniqueptr in SwCursorNoel Grandin
storing a struct with two integer values in it, in a linked list, just seems inefficient Change-Id: I2913aa867cc978271d7778f06546d47fa6c57973 Reviewed-on: https://gerrit.libreoffice.org/51761 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-21sw: fix some IWYU warningsMiklos Vajna
Change-Id: I3682cc475de8342e4cdf122a35f6c1cfddd4c01e Reviewed-on: https://gerrit.libreoffice.org/51677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-04Translate German variable namesJohnny_M
Akt -> Current in swcrsr Change-Id: I5c5dabefa6e2924620b8ab4829943b74dc7e6bcd Reviewed-on: https://gerrit.libreoffice.org/50665 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-11-27loplugin:countusersofdefaultparams in sw (2)Noel Grandin
Change-Id: Ibb045a0b7750cf6807d6f5caba86a9e6e59828ae Reviewed-on: https://gerrit.libreoffice.org/45237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: swStephan Bergmann
Change-Id: Ifc3c4c31a31ee7189eeab6f1af30b94d64f2f92a
2017-08-03loplugin:constparams in sw part1Noel Grandin
Change-Id: Id8d8afe268a82585ec2d3699411073dfb905d6ba Reviewed-on: https://gerrit.libreoffice.org/40734 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-19tdf#106929 sw: SwCursorShell::Pop() ensure cursor ring is recreatedMichael Stahl
... from table cursor. The problem is that in this case, between Push() and Pop() there is no call to ClearMark() or any of the other functions that sets the SwTableCursor::m_bChanged flag, so MakeBoxSels() is never called for the m_pCurrentCursor after Pop() and there is no cursor ring selecting all table cells. (regression from b227a8e4d65e4bbfe991aed9342fe3e30eca8639) Change-Id: I5bce18b71fed60a926f4ddf9938dfb7d1ddf4e92
2017-03-01typesafe wrappers for css::i18nutil::TransliterationModulesNoel Grandin
and related css::util::SearchOptions2 The TransliterationModules enum has it's constants spread over multiple UNO enum/constant-collections - TransliterationModules and TransliterationModulesExtra, which means that most code simply uses sal_Int32. Wrap them up into a better bundle so that only the lowest layer needs to deal directly with the UNO constants. Change-Id: I1edeab79fcc7817a4a97c933ef84ab7015bb849b Reviewed-on: https://gerrit.libreoffice.org/34582 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26loplugin: unnecessary destructor swNoel Grandin
Change-Id: I27dcd289177bd6a63f07d75fb3cfd5c14fa2ee9d Reviewed-on: https://gerrit.libreoffice.org/33572 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-29convert SwCursorSelOverFlags to o3tl::typed_flagsNoel Grandin
Change-Id: I399db07f508e5aeba005c8c6746cf5adc42702d2 Reviewed-on: https://gerrit.libreoffice.org/31350 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-07loplugin:unnecessaryvirtual in svx..swNoel Grandin
Change-Id: I4ae8de558550e6577c28b95e0aaed74f00d79c29 Reviewed-on: https://gerrit.libreoffice.org/30650 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-27loplugin:expandablemethods in swNoel Grandin
Change-Id: Ibc9edc28f4041235ab30c026bd3774bd74b7e960 Reviewed-on: https://gerrit.libreoffice.org/30287 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-08loplugin:constantparam in swNoel Grandin
Change-Id: Ic49d1c3c7b57fb213964ddc21b0f774c762aad94
2016-08-31convert FindRanges to o3tl::typed_flags_setNoel Grandin
Change-Id: I745b2f469e44b79a06a18bc5264aae75b096835c
2016-08-31remove the SwMoveFnCollection* typedefsNoel Grandin
which were just obscuring the code, and pass it around by const& Change-Id: I4fce5ef4bf616867c46a145f660a8e90d3c94462
2016-08-19loplugin:countusersofdefaultparams in swNoel Grandin
Change-Id: I668bfe93d77b06385544651583bcf71f6b5df2fc
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-03-22loplugin:constantparam in swNoel Grandin
Change-Id: I56925a8fd776b3ee787cc26adbaa08c58dd022c0
2016-02-24let SvxSearchItem use SearchOptions2Eike Rathke
And all those places that interface to SvxSearchItem. Change-Id: I08915824a596cd0f247a89f44e4684cd22b98082
2015-11-25bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-pointRobinson Tryon
This commit renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-11-06com::sun::star->css in sw/incNoel Grandin
Change-Id: I6ffdb1deaa32156c65f997a1a1056928b7cd863d Reviewed-on: https://gerrit.libreoffice.org/19803 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-07-21loplugin:unusedmethods swNoel Grandin
Change-Id: Ied51535fa169451fc4991237122817a34a59f6fe Reviewed-on: https://gerrit.libreoffice.org/17256 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-05-20bin/rename-sw-abbreviations.shlibreoffice-5-0-branch-pointChristian Lohmaier
renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-04-25sw: same treatment for SwCursor's fake "copy constructor"Michael Stahl
Change-Id: Id627274ca6ad87e7e85b5ce64419ed68a5d4c9c3
2015-03-14sw: prefix members of SwTableCursorMichael Stahl
Change-Id: Ib53119f01a97f2fb2e277a0b949465e4de9928b7
2015-03-14sw: prefix members of SwCursorMichael Stahl
Change-Id: Ica526f053c5e3870c7496ec0de83dc142ca9b583
2015-01-26new loplugin: change virtual methods to non-virtualNoel Grandin
Where we can prove that the virtual method is never overriden. In the case of pure-virtual methods, we remove the method entirely. Sometimes this leads to entire methods and fields being eliminated. Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae