summaryrefslogtreecommitdiff
path: root/sw/inc/crsrsh.hxx
AgeCommit message (Collapse)Author
2018-12-22use boost::optional for OUStringNoel Grandin
instead of storing on heap Change-Id: I4ca2bb58ec4f71b161c9e6081f5e456de54d8153 Reviewed-on: https://gerrit.libreoffice.org/65537 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-18sw_redlinehide_4b: FindText() adapt the replace part as wellMichael Stahl
When redlining is enabled, the result will be a delete redline for the existing text, and an insert redline for the new text; that much is obious (and ReplaceRange can deal with a selection larger than one SwTextNode easily, since it mostly adds redlines). For the case when redlining is disabled, there are 2 options, and i don't really know which is preferrable from UX point of view: One approach is to reuse GetRanges() to ignore delete redlines in the replace range; move its declaration to different header. Another approach is to DeleteAndJoin() the existing delete redlines, which is the same as the previous model based Hide mode, which calls DeleteRedline() to remove the hidden redlines. Also change ChgAutoCorrWord() to call DeleteSelImpl() directly. Change-Id: I5974409d09eb39e04cc0b5dfc20d4db510e1cf58
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-19sw_redlinehide_2: view cursor: IsSelOnePara(),IsStartPara(),IsEndPara()Michael Stahl
Change-Id: Idb7bdc139e501dfbd7e7d3b2d4598d211fa11591
2018-09-19sw_redlinehide_2: remove GetTextUntilEndOfNode()Michael Stahl
This is pretty silly, the only caller is actually interested in the position of the cursor, not any text at all. Change-Id: Ibf016d5526e18775c0e6e365b9823723267e76d5
2018-09-19sw_redlinehide_2: rename SwCursorShell::GetText()Michael Stahl
It's really not obvious *what* you can get here. Change-Id: I1f14b851a127847206f8eb5fd2da778d0acece9b
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-08-29loplugin:constantparam (3)Noel Grandin
Change-Id: Ifc47bb8e096c9a8563021b2fcb44199577740746 Reviewed-on: https://gerrit.libreoffice.org/59747 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-06tdf#101856 create bookmarks w/ new hidden/cond attrs, save as odtBernhard Widl
Committer's note: this is forward ported from 5.2+backports branch, with numerous conflicts. tdf#101856 add new checkbox/editfield for hidden/condition attrs Conflicts: sw/uiconfig/swriter/ui/insertbookmark.ui Author: Bernhard Widl <bernhard.widl@cib.de> (cherry picked from commit c347e00821791377731ab32acd103ea006f3cc1b) tdf#101856 Fix crash in Insert Bookmark dialog Author: Serge Krot <Serge.Krot@cib.de> Reviewed-on: https://gerrit.libreoffice.org/50616 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit bcc16920eec647f2a3753d60c4d969862f272942) Change-Id: Ib1df7a4c1477693aa2d0ec067635cdcbd393cebd Reviewed-on: https://gerrit.libreoffice.org/46820 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-06-13tdf#116537: use page #s excluding empty pages when they are ignoredMike Kaganski
Since commit 3c1a343f6936f1dcefdf79a677f8c26ce29676e6, SwDoc::CalculatePagesForPrinting expects that PageRange contains page numbers that don't include empty pages' numbers, when the org.openoffice.Office.Writer/Print/EmptyPages is false. Change-Id: I4057d6e36765707affbd5f3a4507ae03f4a27171 Reviewed-on: https://gerrit.libreoffice.org/55756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
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-04Translate German variable namesJohnny_M
Akt -> Current in crsrsh (Including translation fix of a two-line comment, where it was no longer cleat that it is one.) Change-Id: Iccf33ef63c2b02dcde04504676bc273ea059c3f0 Reviewed-on: https://gerrit.libreoffice.org/50704 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-02-08Fix some IWYU warningsMiklos Vajna
Change-Id: Ie1639cc4017d696ea3fd9ffb96f1559aa3ac6397 Reviewed-on: https://gerrit.libreoffice.org/49340 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-30loplugin:unused-returns in swNoel Grandin
Change-Id: I753fcdd35d461880a8d8160213cabd465cfde967 Reviewed-on: https://gerrit.libreoffice.org/48189 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-09-04loplugin:unnecessaryparen include c++ castsNoel Grandin
Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb Reviewed-on: https://gerrit.libreoffice.org/41874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-18loplugin:unnecessaryparenNoel Grandin
look for statements like return (function()); Change-Id: I906cf2183489f87225b99b987caca67e39b26cc3 Reviewed-on: https://gerrit.libreoffice.org/41260 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-12sw: change SwCursorShell::Pop() parameter from meaningless bool to enumMichael Stahl
Change-Id: Iadc660025e1501118cb0a659d92d42af924b1c6f
2017-05-08loplugin:checkunusedparams in sw(part1)Noel Grandin
Change-Id: I4847b0f96033016e020212fb8d7331309db25b55 Reviewed-on: https://gerrit.libreoffice.org/37287 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-08teach loplugin:constantparam about simple constructor callsNoel Grandin
Change-Id: I7d2a28ab5951fbdb5a427c84e9ac4c1e32ecf9f9 Reviewed-on: https://gerrit.libreoffice.org/37280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-07Fix typosAndrea Gelmini
To complete commit 076758857a98 Change-Id: I6424109e3aee8a3236e40168bdd98c725a7afafb Reviewed-on: https://gerrit.libreoffice.org/37306 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-05-05Fix typosAndrea Gelmini
To complete commit 0ef94e2b559547bc4e906e7f24e57ff5d642e108 and f12096272e684ddcd8ffa4e34dcb0a680cc594c2 Change-Id: Ie86bbfbd58dd728a013bef221e4d5c8fbcaf8e03 Reviewed-on: https://gerrit.libreoffice.org/37199 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-04-19sw: replace rudimentary SwCursorShell::m_nBasicActionCntMichael Stahl
The functions to modify the counter were removed in 2004-2006 and there is no evidence in the git repo of these functions ever being called, so the BasicActionPend() condition is effectively equivalent to ActionPend(). Change-Id: Ic8b9c8c6039c318943c96e90f2370cb5a1046ff9
2017-04-19sw: resolve m_pCursorStack overloadMichael Stahl
Both SwCursorShell and SwWrtShell have a m_pCursorStack member, which is confusing gdb. Change-Id: Ie4674fa08eafcfae5273740d7ed8271614f311ab
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-16Clean up integers representing positions in SwOutlineNodes vectorsStephan Bergmann
Change-Id: If1a6a9cb61ffd355a85835127e7c893969833587
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-07convert RES_FIELDS to scoped enumNoel Grandin
and rename to SwFieldIds Change-Id: I50d2b7550f68b4b020ffc1603f931c671c8e1de6 Reviewed-on: https://gerrit.libreoffice.org/34924 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@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>
2017-03-02Complete the transition of SwRedlineTable::size_typeStephan Bergmann
...from 9ca8a63fff65acf2ea13b391495ad232f4636548 "Use consistent integer types in the SwRedlineTable interface". This all started as an attempt to reduce the number of places a to-be-committed improved loplugin:loopvartoosmall complains about. Lets see where it ends... SwRedlineTable::size_type is now the size_type of the underlying std::vector, no longer sal_uInt16 from ancient times. I tried hard to find all places that are affected by this change, changing types of affected variables and non-static data members as needed. Some notes: * The original code used USHRT_MAX as a "not found" value. I replaced that with a new SwRedlineTable::npos, of type SwRedlineTable::size_type but still for now of value USHRT_MAX. This should eventually be changed to something more sensible, like std::numeric_limits<SwRedlineTable::size_type>::max() (which is best done after we have constexpr support in all toolchains, so that npos can be constexpr). It is important that the value of npos is towards positive infinity, as many places in the code use for (i = f(); // may return npos i < table.size(); ++i) table[i] ... * There are some borders where values of SwRedlineTable::size_type are converted into different types, for various reasons. But all of those other types should be large enough for practical purposes (at least 32 bits wide): MakrEntry::m_nIdx: long int SvxRedlinTable::InsertEntry: sal_uIntPtr nPos SwRangeRedline: size_t SwRedlineItr: sal_Int32 SwVbaRevision::GetPosition: sal_Int32 SwXRedlines: sal_Int32 * .uno:TrackedChangeIndex= transports textual representations of such values. libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx treats them purely as strings, while SwTiledRenderingTest converts them to int. * TODO: The one place I'm unsure about is SfxUInt16Items with IDs FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_REJECT_DIRECT, and FN_REDLINE_NEXT_CHANGE in sw/source/uibase/uiview/view2.cxx. For now, I kept those as SfxUInt16Items and take care to "map" USHRT_MAX to npos when reading from those items. But I have no idea where instances of those items would actually be created, and what it would mean to change those items' types? Change-Id: Ib7a14dc67e2b970766966e43f4732abd9f045ff8 Reviewed-on: https://gerrit.libreoffice.org/34775 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-02-13convert IsAttrAtPos to scoped o3tl::typed_flagsNoel Grandin
Change-Id: Ie3a361a96201cb1a0ab446bcf77b7c0e79e05e89
2017-02-05tdf#103258 Add contextual edit footnote endnote command.Gulsah Kose
Change-Id: I68126d2ec8b8dfb12c45ce577d110be2b94a4e33 Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/33803 Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Maxim Monastirsky <momonasmon@gmail.com> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.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-10-04loplugin:countusersofdefaultparams in swNoel Grandin
Change-Id: I65beb17816641cff6a07379b7ba234afe26806b3 Reviewed-on: https://gerrit.libreoffice.org/29488 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: Ibae4cac28e6ff52298c804519f683017729c07a5
2016-08-31sfx2 lok: introduce SfxViewShell::NotifyCursor()Miklos Vajna
It allows removing the hide/show cursor hack in SfxViewShell::registerLibreOfficeKitViewCallback() introduced in commit 4d211384f048b689f20e46d4d586f342b110cb5c (sfx2 lok: fix missing view cursors in a new view, 2016-06-20), and instead let the application code in sw/sc/sd implement the best way to show existing cursors in a new view. This way the per-app cleanup of view cursors introduced in commit bc9b4fd4c83af3532204237157821d4884c42d8e (lok::Document::destroyView: clean up view cursors/selections, 2016-07-15) has matching per-app init code. This commit just adds the API + adapts existing sw code to use it, sc/sd still has to be implemented. Based on a patch by Marco Cecchetti, thanks! Change-Id: I38510fa4962f405b1b96a79024206c9e7f33cad2 Reviewed-on: https://gerrit.libreoffice.org/28557 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-31convert SwDocPositions to scoped enumNoel Grandin
Change-Id: Idd9414b4a10398130337e474fb8fd4063e3bd4f8
2016-08-31remove the SwMoveFnCollection* typedefsNoel Grandin
which were just obscuring the code, and pass it around by const& Change-Id: I4fce5ef4bf616867c46a145f660a8e90d3c94462
2016-08-25loplugin:countusersofdefaultparamsNoel Grandin
Change-Id: I7150494a56abc6ec9c7fba39cefe3967a475f073
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-01loplugin:constantparam in swNoel Grandin
Change-Id: I68f1594ca3f647d055f5087def74452452f86910 Reviewed-on: https://gerrit.libreoffice.org/23718 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-15loplugin:constantparamNoel Grandin
Change-Id: I270e068b3c83e966e741b0a072fecce9d92d53f5
2016-03-09loplugin:constantparam in swNoel Grandin
Change-Id: I8fa1af4a34770b71f6f4bb28b3313edf4875322b
2016-02-29loplugin:unuseddefaultparam in sw (part3)Noel Grandin
Change-Id: Ibff7ac9718929349ee7daa3febb0f8fe4a9fa4db
2016-02-26sw: we don't have space to spell out "focus" in ShLooseFcs...Michael Stahl
...but we *do* have the space to mis-spell "lose". Change-Id: I0cb55d616dfee614e82975b7b3c25a0dcc37d0d7
2016-02-24let SvxSearchItem use SearchOptions2Eike Rathke
And all those places that interface to SvxSearchItem. Change-Id: I08915824a596cd0f247a89f44e4684cd22b98082