summaryrefslogtreecommitdiff
path: root/sw/inc/node.hxx
AgeCommit message (Collapse)Author
2020-11-02move SwCondCollCondChg on top of SfxHintBjoern Michaelsen
... and get rid of ModifyNotifications along the way. Change-Id: I10fc9d24743d50cef771ff63dae004d31dce1846 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105195 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-11-01Make SwClient::ModifyNotification non-virtualBjoern Michaelsen
Change-Id: Ic34b0b7a3ad906da5f25103f32a28e2a3efd82fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105150 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-11-01sw/source/core/doc: Stop abusing observer pattern for code obfuscation.Bjoern Michaelsen
The old SwClient/SwModify combo is a questionable implementation of the observer pattern (among other things). The one thing the observer pattern is good for is dependency inversion: The creator of the message does not need to know the type of the receiver. Calling the message handling on the receiver directly introduces tight coupling and entirely defeats the purpose, leaving us with the worst of both worlds. In such case, at least be honest about the tight coupling and call a somewhat more explicit member function of the target. Thus introduce SwFootNoteInfo::UpdateFormatOrAttr, SwContentNode::UpdateAttr, remove some useless SwFormatChg clutter in Set{Foot,End}NodeInfo, and check for some invariants in SwContentNode::SwClientNotify to limit some of the "a message are two void pointers" madness. Change-Id: I32a8d6973231bb5f65c9e144be72d5bcf98f3f44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105104 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
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-10-04MakeCopy family never called with a null SwDoc* argCaolán McNamara
Change-Id: I4ba4569a529425a5e92fb3f82990e34ae4db3228 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103877 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>
2020-09-30SwNodes::GetDoc can return a reference insteadCaolán McNamara
Change-Id: I6c3b2e5b95fb9fac8faa36fc6ae378b92e08fd89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103639 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-01tdf#135056 sw_redlinehide: when moving sections to undo nodes-array,Michael Stahl
... delete frames with utmost prejudice - the code that was checking for empty frames or cells was going into infinite loop because first the *outer* section is moved to the undo nodes array, then when the *inner* (index header) section is moved, its section node's m_pStartOfSection points to the section node that is already in undo nodes array and so SwNodes::GoPrevSection() goes very wrong and CheckNodesRange() is called with positions in 2 different arrays. (regression from a60dd9ef1361c5925803acaa5292e99277d1faf3) Change-Id: I5682ebc2081ffc7dc49a9c43e613f72c26e93673 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101755 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-09compact namespace in swNoel Grandin
Change-Id: Ie2c3e3f95a687b12b89bcfc5cad44fb7a1d4568f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93862 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-13Revert "loplugin:constfields in sw"Noel Grandin
This reverts commit 4969f4c0d3e2581aaa8a5b5a5769840fa6b6f8ea. Change-Id: I527e9366b05e8a20633720e334395b285991c524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-04loplugin:finalclasses in sw/incNoel Grandin
Change-Id: I084502d8c5607f103ef987b54252ef95341f0bef Reviewed-on: https://gerrit.libreoffice.org/81981 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-28loplugin:constmethod in swNoel Grandin
Change-Id: I73c3c6d2165287d2d581a04b23b1d3b48166a488 Reviewed-on: https://gerrit.libreoffice.org/79780 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-26source/core/access: no more SwClientBjoern Michaelsen
- also, move BroadcastingModify up from TextNode to ContentNode Change-Id: I4e6e8767aaecb9cce20d5ec3da789532686dfe2a Reviewed-on: https://gerrit.libreoffice.org/79525 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-09-20no more SwClient in sw/source/filter/ww8Bjoern Michaelsen
- prevent apparently leaking ~all InsertedTableClient by using a unique_ptr - rename InsertedTableClient to InsertedTableListener Change-Id: I60407113bf0ba28f5944ff9241a2d8a80a03d399 Reviewed-on: https://gerrit.libreoffice.org/79262 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-08-01Fix typosAndrea Gelmini
Change-Id: I2238961a7b124652e90e948e27a6ca9d98dc54ac Reviewed-on: https://gerrit.libreoffice.org/76826 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-05-03The -fvisibility-ms-compat hack is no longer needed for UBSan on Linux...Stephan Bergmann
...with latest Clang trunk towards Clang 9. All the no-longer necessary hacks are made conditional on new NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY, which is still set for UBSan builds with older Clang on Linux (but which should eventually be purged). Various classes needed additional SAL_DLLPUBLIC_RTTI annotations, as building with UBSan instrumentation can generate references to RTTI symbols from additional places like outside a dynamic library that used to hide those symbols by default (but used to not hide them for old UBSan builds thanks to the -fvisibility-ms-compat hack). The odr-violation suppressions in solenv/sanitizers/asan-suppressions (which is not referenced from anywhere in the code base, but meant to be included in an ASan/UBSan build's ASAN_OPTIONS env var) are also no longer needed when NEED_CLANG_LINUX_UBSAN_RTTI_VISIBILITY is false. Change-Id: I24ec3e388b0cbab50dbe2bf008d9569bff7bf25a Reviewed-on: https://gerrit.libreoffice.org/70829 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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>
2019-01-09use unique_ptr in SwContentNode::CreateOLENodesArrayNoel Grandin
Change-Id: I4ff33dbdc4d87fd00e4a2b995fff1238c7e2a679 Reviewed-on: https://gerrit.libreoffice.org/65995 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-15sw_redlinehide_3: adapt SwCursorShell::GetContentAtPos()Michael Stahl
Have SwNode::FindOutlineNodeOfLevel() check if the outline node is merged away in the layout. Change-Id: I2da0bf8afe993f1bb60f488a015a33b5e15af217
2018-10-03loplugin:constfields in swNoel Grandin
Change-Id: I1eb6583bb9ec815bc0564b0d7c676f5b1fb9045f Reviewed-on: https://gerrit.libreoffice.org/61177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-19sw: rework annoying GetFrameOfModify/getLayoutFrame parametersMichael Stahl
The bCalcFrame is only evaluated if a pPoint is given; this is surprising and should be more visible in the interface, so people don't go on a goose chase to find places that may do formatting in inappropriate places. So put these parameters into a pair instead, which doesn't have particularly good ergonomics in C++, particularly since compilers warn about taking the address of a temporary object... Change-Id: I101c6eeb5bd6baf83c2bd9a6cb91ccaa04036cc3 Reviewed-on: https://gerrit.libreoffice.org/60695 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-09-19sw_redlinehide_2: SwContentNode::DelFrames()Michael Stahl
... needs to remove extents when it's called when moving nodes to Undo-nodes-array. Change-Id: I32cf38074d9f3d614d5f854979be6b0135d53914
2018-09-19sw: add a real create-no-frames flag to MakeCopy/MakeTextNodeMichael Stahl
SwNodes::CopyNodes calling MakeCopy() and then immediately DelFrames() considered silly. Apparently SwOLENode/SwGrfNode don't actually create frames anyway since that is done via their SwFrameFormats, so they just ignore the parameter. Change-Id: I8a8f52da1d25bb5689345e956a33aebd727e8fc7
2018-09-19sw_redlinehide_2: try to keep the pLastNode updated if it's deleted...Michael Stahl
Change-Id: Ied4ca532b336cacf3c4a8d96b9e75dcbaf47ba29
2018-09-19sw_redlinehide_2: fix ordering of SplitNode usage of ContentIdxStoreMichael Stahl
The problem is that now the ctor of SwTextFrame will check the redline positions, but the call to MakeFramesForAdjacentContentNode() happens before the call to ContentIdxStore::Restore() that updates the SwPositions of the redlines, hence they point to the wrong node. Try to fix this by not calling Restore directly but pass in a closure to SwTextNode::SplitContentNode() so that it can call ContentIdxStore::Restore() before frames are created and redline positions are checked. Also remove the useless SwContentNode::SplitContentNode() - only the SwTextNode override actually did anything. Change-Id: I2088fd124d04cf354f4f0f691a50ff5217d778d7
2018-09-19sw_redlinehide_2: add layout parameter to *Node::DelFramesMichael Stahl
A trivial patch to remove some FIXMEs; unfortunately one new FIXME because the SwSectionNode case isn't entirely trivial. Change-Id: I94f11ffd19b189b165ad1fb05488ba8617e81357
2018-09-19sw: rename SwNode MakeFrame overloadsMichael Stahl
Change-Id: Ida4f6d55801292c509e577056140d9ff7608de9b
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-26make SwContentNode handle legacy ModifyNotification() again (tdf#117749)Bjoern Michaelsen
Change-Id: If5fe61b6bfd4012be63c27d531100018fb31dd21 Reviewed-on: https://gerrit.libreoffice.org/58024 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2018-06-29loplugin:useuniqueptr in SwTableNodeNoel Grandin
Change-Id: I28bca27b6841ba9b263392b2e30f8684a8e2c4e5 Reviewed-on: https://gerrit.libreoffice.org/56622 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-18tdf#108523 Remove @author annotationsAbhyudaya Sharma
Change-Id: I85e364da59ce70ddd97fdae9bc03a4ea76b007fc Reviewed-on: https://gerrit.libreoffice.org/55263 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-06-08sw_redlinehide: add merge state flag to SwNodeMichael Stahl
Since checking redlines for every node is probably inefficient, the SwNode should cache if it's merged by delete redlines and hence if a layout that hides redlines should create frames for it. Change-Id: I846d94a95efe9c32f44e1ac17bf2cd5600ebf8b7
2018-05-05use WriterMultiListener instead of SwDepend in SwContentNodeBjoern Michaelsen
- also move SwContentNode and SwTextNode from Modify to SwClientNotify - this removes the last public use of SwDepend, which should now become an implementation detail of WriterMultiListener Change-Id: I5ae3a7a091fb2b6bb3bce44a0adc4f41f07a0c30 Reviewed-on: https://gerrit.libreoffice.org/53835 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2018-04-04loplugin:useuniqueptr in SwContentNodeNoel Grandin
Change-Id: I32dd7e43e3ca040c1d2b8c3bdf57141dd192ffab Reviewed-on: https://gerrit.libreoffice.org/52345 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-28loplugin:virtualdown in swNoel Grandin
Change-Id: Ia4053970a23d62ac7483f18d6caa559ddf43b176 Reviewed-on: https://gerrit.libreoffice.org/51988 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-21Fix some IWYU warningsMiklos Vajna
Change-Id: If1e6727e4b5bb225495e20d5dfb78fa5da770f75 Reviewed-on: https://gerrit.libreoffice.org/50060 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-10-23loplugin:includeform: swStephan Bergmann
Change-Id: Ifc3c4c31a31ee7189eeab6f1af30b94d64f2f92a
2017-09-04New loplugin:dyncastvisibilityStephan Bergmann
...to find uses of dynamic_cast where the static (base) type has hidden visibility while the dynamic (derived) one has default visibility, and which may thus fail at least on macOS like happened in d5ed3cd6dbd22bb18542778f1c48f4d5b3ae0f95 "Make WinMtfFontStyle's base class EMFIO_DLLPUBLIC, too". libcxxabi's __dynamic_cast takes static_type and dst_type arguments. Now, if dst_type (the derived type, with default visibility) is taken from .so A (and thus references the version of the base type info hidden in .so A) but the __dynamic_cast call is made from .so B, it passes for static_type the base type information hidden in .so B, and __dynamic_cast will consider the cast to fail. I'm not sure whether hidden intermediary types (in the hierarchy between the dynamic_cast's base and derived types) acutally cause a problem too, but lets flag them with the plugin anyway. The fixes use SAL_DLLPUBLIC_RTTI. For one, there appear to be no other reasons than type visibility to make those classes SAL_DLLPUBLIC. For another, this nicely avoids any actual changes on Windows (where SAL_DLLPUBLIC expands to nothing, and many of the affected classes were explicityl introduced into class hierarchies as "MSVC hacks"). Change-Id: Ia85a9635cebffb1009a9efc1484b8bd4025585d4 Reviewed-on: https://gerrit.libreoffice.org/41802 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-06sw: comment cosmeticsMichael Stahl
Change-Id: I572bf8b28738e82e2f207b5201a0c27d9d9b623d
2017-06-21loplugin:unusedfields in sw part5Noel Grandin
Change-Id: I4111ed1dcb04e010ecfb93df3a7e7bf715abf585 Reviewed-on: https://gerrit.libreoffice.org/39044 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-18Revert "Fix typos"Stephan Bergmann
This reverts commit 26a67002fcb9381b54de6cae1aaa37120d49066a. "Iff" is not a typo, see 2a65bf32ec270484dcea4d22d3c93552dc0c24dd "Revert 'Typo: iff->if'".
2017-05-18Fix typosAndrea Gelmini
Only replaced "iff" with "if" Change-Id: Ib9dfa5c12b05500043147fe3b65f923b1b12a581 Reviewed-on: https://gerrit.libreoffice.org/37782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-03-15convert SvxFrameDirection to scoped enumNoel Grandin
Based on the casts in chart2/source/view/main/ChartView.cxx and the similarity of naming of values, I conclude that this enum was intended to abstract over css::text::WritingMode2. Added a comment to that effect. Change-Id: I3af8bbe8b6ac8c4a9375f6ccde145b98b9c69a57 Reviewed-on: https://gerrit.libreoffice.org/35164 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-14remove noise UUUU tags in commentsNoel Grandin
Change-Id: Id8a2940ae7348bf75ca967f31adf8489dc678d00 Reviewed-on: https://gerrit.libreoffice.org/35161 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-03Remove redundant 'inline' keywordStephan Bergmann
...from function definitions occurring within class definitions. Done with a rewriting Clang plugin (to be pushed later). Change-Id: I9c6f2818a57ccdb361548895a7743107cbacdff8 Reviewed-on: https://gerrit.libreoffice.org/34874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-11-29convert ND constants to o3tl::typed_flagsNoel Grandin
Change-Id: I5fe3df5515017ec24db1184e8aca823714fcfdb3 Reviewed-on: https://gerrit.libreoffice.org/31343 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-08-19loplugin:countusersofdefaultparams in swNoel Grandin
Change-Id: I668bfe93d77b06385544651583bcf71f6b5df2fc
2016-03-22loplugin:constantparam in swNoel Grandin
Change-Id: I56925a8fd776b3ee787cc26adbaa08c58dd022c0
2016-03-09loplugin:constantparam in swNoel Grandin
Change-Id: I8fa1af4a34770b71f6f4bb28b3313edf4875322b