summaryrefslogtreecommitdiff
path: root/sw/inc/tox.hxx
AgeCommit message (Collapse)Author
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-10-11use more string_view in swNoel Grandin
Change-Id: Ibefb8549834ba5011286e3221f1ae276e2c0c0bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141153 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-04clang-tidy modernize-pass-by-value in swNoel Grandin
Change-Id: Ie5c250c64f95e649d33d3f3da7b54e81a4b81d0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137781 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21use more concrete UNO classes in writerNoel Grandin
as opposed to opaque UNO interfaces. This is a prelude which enables performance work because now I can regular C++ method Change-Id: I9bcfdca1000b4439431c9ea3b17bed081d80f0b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137275 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-12elide some dynamic_castNoel Grandin
Change-Id: I32c804e64cf219364e27ad6d9549c68c1f737a19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137003 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-22Add XWeak constructor and operator= to uno::WeakReferenceNoel Grandin
which is faster since we can skip the UNO_QUERY. Change-Id: Id95ad9f3568213e974bd13659d92d4ea94dbfbd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130282 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11loplugin:moveparam in swNoel Grandin
Change-Id: I4fa524e4abb101ed0ff1b8f97b84582b84aa1d07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123387 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-04tdf#77051 DOCX: fix user index and index entry supportLászló Németh
defined by field code \f. E.g. INDEX \f "user-index" inserts only the entries defined by XE "entry" \f "user-index" field codes. Revert commit a7bc9c1e4977bd3430df69287fa0a8377a686c58 "fdo#77051: Preservation of Index field flag '\f'", which added an undocumented UNO property only for round-trip support of INDEX, but not for XE index entries, so the DOCX export still resulted a broken index with lost entries, not only the import was broken because of the missing functionality in com.sun.star.text.DocumentIndex. Now the import uses com.sun.star.text.UserIndex and com.sun.star.text.UserIndexMark index and index entry fields, which support the requested user index not only during the DOCX and OpenDocument round-trip, but its run-time functionality, the multiple user-defined indices. Note: for manual testing, update the user index (the first index) of the left original unit test document IndexFieldFlagF.docx: the updated index is not empty, as before, but contains the user index entries. Change-Id: Ia6139bba88907051fd050cfd40809f5544b9a89e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122930 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-18loplugin:unusedfieldsNoel Grandin
Change-Id: Ib574403a7f7f8b11c6263c9c19ec6b65c8374ddd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115753 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-16sw: DOCX export: write hyperlinks for TOXMark TOX entriesMichael Stahl
* add hyperlink preprocessing in MSWordExportBase::AddLinkTarget() * <w:hyperlink> in the TOX entry * <w:bookmarkStart>/<w:bookmarkEnd> in the field command Change-Id: I4d18778d8ac594a1b4cb43bf0e1234f875eeaf95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114170 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-02-08Remove SwModify::SetInDocDTOR ...Bjoern Michaelsen
... its only used once in SwTOXType and has no place in SwModify, which is the base of ~everything in Writer still. Change-Id: I07007f08723f8db2dd09bb7c07cb0ebfc2a6506a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110594 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-10-30Related: tdf#98868 add SwDoc& member to SwTOXTypeCaolán McNamara
Change-Id: Ic1dc600e75cb4f6a7a0aa86714a87e3ec5658cb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104926 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uStringStephan Bergmann
...from which an OUString can cheaply be instantiated. This is the OUString equivalent of 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String". Most remarks about that commit apply here too (this commit is just substantially bigger and a bit more complicated because there were so much more uses of OUStringLiteral than of OStringLiteral): The one downside is that OUStringLiteral now needs to be a template abstracting over the string length. But any uses for which that is a problem (e.g., as the element type of a container that would no longer be homogeneous, or in the signature of a function that shall not be turned into a template for one reason or another) can be replaced with std::u16string_view, without loss of efficiency compared to the original OUStringLiteral, and without loss of expressivity. The new OUStringLiteral ctor code would probably not be very efficient if it were ever executed at runtime, but it is intended to be only executed at compile time. Where available, C++20 "consteval" is used to statically ensure that. The intended use of the new OUStringLiteral is in all cases where an object that shall itself not be an OUString (e.g., because it shall be a global static variable for which the OUString ctor/dtor would be detrimental at library load/unload) must be converted to an OUString instance in at least one place. Other string literal abstractions could use std::u16string_view (or just plain char16_t const[N]), but interestingly OUStringLiteral might be more efficient than constexpr std::u16string_view even for such cases, as it should not need any relocations at library load time. For now, no existing uses of OUStringLiteral have been changed to some other abstraction (unless technically necessary as discussed above), and no additional places that would benefit from OUStringLiteral have been changed to use it. Global constexpr OUStringLiteral variables defined in an included file would be somewhat suboptimal, as each translation unit that uses them would create its own, unshared instance. The envisioned solution is to turn them into static data members of some class (and there may be a loplugin coming to find and fix affected places). Another approach that has been taken here in a few cases where such variables were only used in one .cxx anyway is to move their definitions from the .hxx into that one .cxx (in turn causing some files to become empty and get removed completely)---which also silenced some GCC -Werror=unused-variable if a variable from a .hxx was not used in some .cxx including it. To keep individual commits reasonably manageable, some consumers of OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a somewhat odd state for now, where they don't take advantage of OUStringLiteral's equivalence to rtl_uString, but just keep extracting its contents and copy it elsewhere. In follow-up commits, those consumers should be changed appropriately, making them treat OUStringLiteral like an rtl_uString or dropping the OUStringLiteral overload in favor of an existing (and cheap to use now) OUString overload, etc. In a similar vein, comparison operators between OUString and std::u16string_view have been added to the existing plethora of comparison operator overloads. It would be nice to eventually consolidate them, esp. with the overloads taking OUStringLiteral and/or char16_t const[N] string literals, but that appears tricky to get right without introducing new ambiguities. Also, a handful of places across the code base use comparisons between OUString and OUStringNumber, which are now ambiguous (converting the OUStringNumber to either OUString or std::u16string_view). For simplicity, those few places have manually been fixed for now by adding explicit conversion to std::u16string_view. Also some compilerplugins code needed to be adapted, and some of the compilerplugins/test cases have become irrelevant (and have been removed), as the tested code would no longer compile in the first place. sal/qa/rtl/strings/test_oustring_concat.cxx documents a workaround for GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96878> "Failed class template argument deduction in unevaluated, parenthesized context". That place, as well as uses of OUStringLiteral in extensions/source/abpilot/fieldmappingimpl.cxx and i18npool/source/localedata/localedata.cxx, which have been replaced with OUString::Concat (and which is arguably a better choice, anyway), also caused failures with at least Clang 5.0.2 (but would not have caused failures with at least recent Clang 12 trunk, so appear to be bugs in Clang that have meanwhile been fixed). Change-Id: I34174462a28f2000cfeb2d219ffd533a767920b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102222 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-13loplugin:stringstatic also look for local staticsNoel Grandin
Add some API to O*StringLiteral, to make it easier to use in some places that were using O*String Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-07SwTOXBaseSection::UpdateMarks: SwIterator no more ...Bjoern Michaelsen
Change-Id: Ib4b9e9bc47e6789d61dbe6187a870b986ed491f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98138 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-07-05GotoTOXMarkBase: SwIterator no more ...Bjoern Michaelsen
Change-Id: I60935850596eeb7209bd84782c954919c02cb259 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98050 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-07-03SwTOXMark::InsertTOXMarks: SwIterator no more ...Bjoern Michaelsen
- remove manual SwIterator usage - moved SwTOXMark from ::Modify to ::SwClientNotify - replaced static InsertTOXMarks() with SwTOXType::CollectTextMarks() where it belongs Change-Id: Ib8289c07882a61278dedb1bc1fadc1a9237fea4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97663 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
2020-06-30dont (ab-)use typeless GetInfo() interfaceBjoern Michaelsen
Change-Id: I73ab1e0efcb3559dfe37f3f408b3ec4862a408e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97472 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
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-12-12use covariant return type for SfxPoolItem::CloneCaolán McNamara
and can then remove some casting Change-Id: Id821c32ca2cbcdb7f57ef7a5fa1960042e630ffc Reviewed-on: https://gerrit.libreoffice.org/85022 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-06make some classes module-privateNoel Grandin
Change-Id: I00ab3a3f6a8bbc85320e7b4fd1aa13af798e7e4c Reviewed-on: https://gerrit.libreoffice.org/82062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-22SwXDocumentIndexMark::Impl: MultiWriterListener no moreBjoern Michaelsen
Change-Id: I9c167c5b56c098cfd85693a3bf5f16da51b6033c Reviewed-on: https://gerrit.libreoffice.org/79290 Tested-by: Jenkins Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2019-07-29Fix typo in codeAndrea Gelmini
"delimitter" It passed "make check" Change-Id: I54fb7200a71365675cefc506ea3c9f2c65bbff6d Reviewed-on: https://gerrit.libreoffice.org/76554 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-25Fix typosAndrea Gelmini
Change-Id: I59a0fd175fa5185c15d093d2d9bed9f95bb4cfd5 Reviewed-on: https://gerrit.libreoffice.org/76280 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-02-22loplugin:unusedfields in swNoel Grandin
Change-Id: Id68a01042f8398d7d4803a9ce7eb03620732f1ce Reviewed-on: https://gerrit.libreoffice.org/68163 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-21sw_redlinehide: adapt ToX UpdateMichael Stahl
The ToX exists only once in the model, so it either has to have the content corresponding to redlines being shown, or hidden. Adapt Update based on current layout setting. Change-Id: Ibf5ec092632cf3a5f513965afdb840fd8239a7fd Reviewed-on: https://gerrit.libreoffice.org/65527 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
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-01-25introduce SwClient::EndListeningAll()Bjoern Michaelsen
- this is to reduce the use of GetRegisterdIn(), which should be an implementation detail - remove SwTOXMark::DeRegister() which did the same for a part of the class tree - remove SwUndoSetFlyFormat::DeRegisterFromFormat(), same - remove doubletracking FrameDeleteWatch::m_bDeleted, just check GetRegisteredIn() Change-Id: Id9364076759446ee5ff1898683c3ca700c1014c9 Reviewed-on: https://gerrit.libreoffice.org/48548 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
2018-01-02loplugin:passstuffbyref improved return in swNoel Grandin
Change-Id: I4484ac461761e4c46364b4f473c7e62f8ec72103 Reviewed-on: https://gerrit.libreoffice.org/47243 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-04loplugin:constparams in sw part4Noel Grandin
Change-Id: Ic42b2691869b61ba906222db893e284d8b9c39c1 Reviewed-on: https://gerrit.libreoffice.org/40767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28loplugin:salunicodeliteral: swStephan Bergmann
Change-Id: I3ec5a60fff8577677eaa4977cddf69bec4078cec
2017-01-17sw, sd: fix indentationMiklos Vajna
The indentation in these files is consistent otherwise, let's keep it that way. Change-Id: I1d73caa03425cd4d1c98ff07935512b002fb2c72
2016-11-30convert SwTOOElements to o3tl::typed_flagsNoel Grandin
Change-Id: Ic0636c8f641cf70e0372b31f8a8d111b45ba6070 Reviewed-on: https://gerrit.libreoffice.org/31357 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-29convert SwTOIOptions to o3tl::typed_flagsNoel Grandin
Change-Id: I8f2996c0f0e40778877cddc4368c80f8a7f52a95 Reviewed-on: https://gerrit.libreoffice.org/31352 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-29convert SwTOXElement to o3tl::typed_flagsNoel Grandin
Change-Id: Ib0538602d0d363488a25b357f85e76293cd19319 Reviewed-on: https://gerrit.libreoffice.org/31351 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-17convert SvxTabAdjust to scoped enumNoel Grandin
Change-Id: I29a33b8ea5daaa4b9059d024ffa4a99ca924f7ef
2016-07-27improve passstuffbyref return analysisNoel Grandin
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c Reviewed-on: https://gerrit.libreoffice.org/27317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27loplugin:singlevalfields in sw(part4)Noel Grandin
Change-Id: I73d94ae89edb2e6f37cfa087a0d85b5a90df4a8a Reviewed-on: https://gerrit.libreoffice.org/26679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-23loplugin:unusedmethods in swNoel Grandin
Change-Id: I05e224bcc7d2b08cf1349c14e3acf274d422e109 Reviewed-on: https://gerrit.libreoffice.org/25145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-14loplugin:passstuffbyref in swNoel Grandin
Change-Id: I124bdd4f28c7d7508e77b902dfa23c398454bf38
2016-01-21loplugin: unused return valuesNoel Grandin
Change-Id: I4eb1f0c9245c04058fd5e47046f043f8840a79c7 Reviewed-on: https://gerrit.libreoffice.org/21628 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-10Fix typosAndrea Gelmini
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86 Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2015-11-115th step to remove tools/rtti.hxxOliver Specht
tools/rtti.hxx removed completed the interface of some Sdr.* Items and removed pseudo items Change-Id: I0cdcd01494be35b97a27d5985aa908affa96048a Reviewed-on: https://gerrit.libreoffice.org/19837 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
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-30sw: prefix members of SwFormMiklos Vajna
Change-Id: I91c1aa5149bff9c6489ad6f1a68818b502d95966