summaryrefslogtreecommitdiff
path: root/sw/inc/pam.hxx
AgeCommit message (Collapse)Author
2024-08-12SwContentIndex owner pointersNoel Grandin
we already have two things that "own" a SwContentIndex, for which we store a pointer in the SwContentIndex. I want to add more things, so rather than add more fields to a very heavily used structure, generalise the mechanism so we can store a single field (since only thing at a time will ever own a SwContentIndex). Also add an enum and a GetOwnerType() method so I can avoid dynamic_cast, this is a pretty performance-sensitive area. Change-Id: Ifb03a06b0bb69a325f41a8041e9d23cfc82c3268 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171606 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-04simplify IMark hierarchy (6)Noel Grandin
merge IMark into MarkBase Change-Id: I5d3c648c950f97497c96912c25081906de434056 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171464 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2023-05-07Simplify a bitMike Kaganski
Change-Id: Ibcf59feaa1631c06a393017d1b6342d4a646b9a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151387 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-17tdf#130199 sw Confirm deletion of hidden sectionsBalazs Varga
To enhance the existing discoverability of hidden sections via Navigator by a confirmation box when a hidden section is to be deleted. Also add an option to switch on/off this warning message named "ShowWarningHiddenSection". The default setting is on. Change-Id: I91a1a32524f8d8d8fd0f230c142654df4367e729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150231 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-09-16create less SwPosition temporariesNoel Grandin
because they need to hook themselves into global rings, which results in a lot of unnecessary pointer chasing Change-Id: I27173c5f0d5e2998fdbfbb7781e2cbd1be6d14b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140065 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-23Use more SwPosition::AdjustNoel Grandin
to keep the internal fields of SwPosition in sync. Change-Id: I46dbb7e562cf41dcceab57e2f5bf1e19babb955a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138731 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-23Use more SwPosition::AdjustNoel Grandin
to keep the internal fields of SwPosition in sync. Add a new SwPosition::AdjustContent for when we need to update the context index alone Change-Id: Iad277f742a903157afdacd1d5c11b2abfa7d477c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-23sw: enable Replace with Protect BookmarksMichael Stahl
The dialog calls Replace on the whole bookmark, and with commit 7974cea6c788e02d7c36573e2d10dcc51884f70e the bookmark is preserved, so the HasReadonlySel() should not prevent this replace from happening. Change-Id: I823b042c8327c6716b2ac1a8a86beffd887e6e4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138693 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-16pass SwNode and sal_Int32 to DelFlyInRangeNoel Grandin
instead of SwNodeIndex and SwContentIndex. Part of the process of hiding the implementation of SwPosition. And fix a missing SwPosition constructor. Change-Id: Idc4d2675a53596e6f2ea53043dc7109b9c7bc2e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138317 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-14rename SwPaM::GetContentNode to GetPointContentNode/GetMarkContentNodeNoel Grandin
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 Grandin
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-08make more of the SwPaM constructors explicitNoel Grandin
which flushes out some more places where we were implicitly construcing temporaries Change-Id: I2eee5f99071cd8c155de1be369ba89ec1d732bae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137921 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-07make SwNodeIndex constructors explicitNoel Grandin
which flushes out some more places where we were implicitly construcing SwNodeIndex temporaries Change-Id: If044cb54acd1fe1265837c8076d7fdfe4de49290 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137910 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-06make CheckNodesRange take a SwNode, not an SwNodeIndexNoel Grandin
as part of the process of hiding the internals of SwPosition Change-Id: If8e9426df4b78ebf95bbac54ebfdcff4b19b6292 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137874 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-05use more SwPosition::AssignNoel Grandin
as part of the process of hiding the internals of SwPosition these are still the easy ones, i.e. no functional change intended Change-Id: Ibb2adf17de47bab5374730b508d9c020991a945e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137802 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-04introduce SwPosition::AssignStartIndex and AssignEndIndexNoel Grandin
as part of the process of hiding the internals of SwPosition Change-Id: I496a0e24257a1ec6653a3becef4889b6fdf5339b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137788 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-04use more SwPosition::AssignNoel Grandin
Updating some more of the places where the usage is "safe" i.e. this patch should introduce no functional change. Change-Id: I02390b3daecf23c1541a69f1957e6cf507cef72d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137777 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-04elide some SwNodeIndex temporariesNoel Grandin
Change-Id: I5391aa409d760870ead26d43b2287b23d2d40089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137776 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-04add more SwPosition::AssignNoel Grandin
These are just the "obviously correct" places where we can use SwPosition::Assign, i.e. the places where we are already correctly setting both nNode and nContent in SwPosition. Change-Id: I27078c91e491c9162770ce729364197056d62cb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137775 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-04introduce SwPosition::AssignNoel Grandin
as part of the process of hiding the internals of SwPosition And use it in a handful of places where it is obviously correct to do so (leaving all the hard stuff for later) Change-Id: Ic1b8e80072f45acc8d2f08264662611168b1dd85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137736 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::GetContentNodeNoel Grandin
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nContent.GetContentNode' | xargs perl -pi -e 's/\bnContent\.GetContentNode/GetContentNode/g' Change-Id: I50bcde481a4a2785062b974fb81465a401b0a3e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::SetRedlineNoel Grandin
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nContent.SetRedline' | xargs perl -pi -e 's/\bnContent\.SetRedline/SetRedline/g' Change-Id: If4d774959b0cc0fb87040f8f91c094dcd830dcd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137698 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::SetMarkNoel Grandin
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nContent.SetMark' | xargs perl -pi -e 's/\bnContent\.SetMark/SetMark/g' Change-Id: I7fe558da8fffdd8e56598c3063a1058bd5239977 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02introduce SwPosition::GetContentIndexNoel Grandin
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 Grandin
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 Grandin
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-08-01introduce SwPosition::GetNodesNoel Grandin
as part of the process of hiding the internals of SwPosition largely done by doing: git grep -lF 'nNode.GetNodes' | xargs perl -pi -e 's/nNode\.GetNodes/GetNodes/g' Change-Id: I05ac253803ef3f265edfa9be6f24f8f66b2b02c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137670 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-26elide some temporaries when constructing SwPositionNoel Grandin
because the resulting pointer manipulation is not free, the temporary has to be attached to a linked list and then immediately de-linked Also add some asserts to catch SwPosition being created with mis-matching nodes in the SwNodeIndex and SwContentIndex. Which flushes out some bugs in SwHTMLParser::NewDivision SwIntrnlSectRefLink::DataChanged where it was creating a SwPosition with the SwNodeIndex and the SwContentIndex pointing at different nodes. Change-Id: Iea69f5ffc5860eb654435e161bc544b412d4c245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137411 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-26sw: extend SwPaM documentationMiklos Vajna
Explain which one stays and which one moves while adjusting a selection. Change-Id: I05ed0a376c1e75808f39a2683345ba389a83af3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137443 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-07-26elide some temporaries when constructing SwPositionNoel Grandin
because the resulting pointer manipulation is not free, the temporary has to be attached to a linked list and then immediately de-linked Change-Id: I10594026aa388064abc652b91aff024deeb5ca54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137410 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-26simplify some use of SwPositionNoel Grandin
by moving the const_cast inside the constructor Change-Id: I1b43a6d3759de250475f0ebc7d65449ff800b570 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137405 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-25rename SwIndex->SwContentIndexNoel Grandin
to help my poor brain with the different kinds of index we have floating around Change-Id: I47ed223922170687d7e07812445aed66b3218230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137404 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-17tdf#119840 reduce cost of SwPosition::operator<=Noel Grandin
by fetching Start/End from SwPaM at the same time reduces load time by 5% Change-Id: Ie4a06c667aa0950c04e98e46b30cdc4b97f75ba7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137147 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-21introduce SwNodeOffset strong typedefNoel Grandin
for indexing into node children. Replaces various usage of sal_uLong, tools::Long, sal_uInt32 with an underlying type of sal_Int32. Also add a NODE_OFFSET_MAX constant to replace usage of ULONG_MAX Change-Id: I2f466922e1ebc19029bb2883d2b29aa4c0614170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123892 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-30SwPosition::GetDoc can return a referenceCaolán McNamara
and remove discovered redundant null checks Change-Id: I90e2a84b260bfaf283b787db055cd1ed54dab4ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103676 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-30SwPaM::GetDoc can return a reference insteadCaolán McNamara
and remove discovered redundant null checks Change-Id: Iac8ad7821d9acfcc9550a96402c02ac248f16f2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103672 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-30SwNode::GetDoc can return a reference insteadCaolán McNamara
and remove discovered redundant null checks Change-Id: I6b8bc9593434f38947e399a48888a8fa0d4f7e77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103640 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2019-11-29make some function symbols module privateNoel Grandin
improve the script to filter out more noise generated by library symbols Change-Id: I22bf6037d56bc4015001825c3fb3b21a39d85e07 Reviewed-on: https://gerrit.libreoffice.org/84022 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03find symbols that can be privateNoel Grandin
update the script and make private standalone functions Change-Id: Icb26ce258107700c90f89ad4e0d3329d075a2eb1 Reviewed-on: https://gerrit.libreoffice.org/81879 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-10sw: WW8: do not create fieldmark with start in frame and end in bodyMichael Stahl
Actually the start and end must have the same start node; presumably CheckNodesRange(..., true) does that. Change-Id: I04b34b593a4383b565289254bdb756d95c2b7916 Reviewed-on: https://gerrit.libreoffice.org/80594 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-02-28use the xmlTextWriterPtr typedef consistentlyNoel Grandin
this is the single biggest chunk of stuff my upcoming paramtypedef loplugin will warn about, so do it separately Change-Id: I412e69e76406d6d947101885d4cd92c65e021508 Reviewed-on: https://gerrit.libreoffice.org/68486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-09-11loplugin:useuniqueptr in SwPaM::MakeRegionNoel Grandin
Change-Id: Ie069da6336d8d73c41c47a32308de751de438b31 Reviewed-on: https://gerrit.libreoffice.org/60253 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-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-04-25sw: fix remaining IWYU warnings in inc/*.hxxMiklos Vajna
Also check for not needed forward declarations. Change-Id: I92759f3f40d9458fd192665b39b87a78d8b97e5a Reviewed-on: https://gerrit.libreoffice.org/53418 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-09sw: fix some IWYU warningsMiklos Vajna
Change-Id: Idb8ad6cda75b7112280ae71b4340d0187a602794 Reviewed-on: https://gerrit.libreoffice.org/50974 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
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