summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docnum.cxx
AgeCommit message (Collapse)AuthorFilesLines
2018-12-18sw_redlinehide_4b: tdf#113479 SetRedlineFlags() calls no longer...Michael Stahl1-3/+4
...able to be triggered by the UI, so the performance problem should be gone. The SwXTextDocument "ShowChanges" property allows API clients to call SetRedlineFlags() and change the model; this API should be retained as-is for now, because there is no way currently (outside of the rather specialised a11y API) to get a "merged view" of the paragraphs in the document, so API clients may want to (temporarily) toggle this property to then retrieve properties from the model. In case we later find that there are no API clients that want to do such things, the property can be removed. A run with assert() instead of SAL_WARN_IF() found only 2 tests that explicitly call SetRedlineFlags() to clear ShowDelete. Change-Id: I44aee90f7727948ca0bbaaff9d04f8dd6b97cbd1
2018-12-13sw_redlinehide_4b: visibility checks for EnhancedPDFExport linksMichael Stahl1-4/+17
SwEnhancedPDFExportHelper should not create links to things that are hidden by the layout: * SwCursorShell::GotoFormatField() skips deleted fields (this triggers an assert in GetCharRect() with ooo69593-1.odt) * SwEditShell::GetINetAttrs() skips deleted INet attributes (which, as an additional bonus, hides then in the Navigator too) * SwDoc::GotoOutline() skips outline nodes where we know they have been deleted (as seen in ooo66088-9.odt) * SwFlyFrameFormats are skipped by EnhancedPDFExportHelper itself * footnotes dito Change-Id: Ife77dc7724688631d20cbaf8531b3c826a8ece94
2018-12-06sw_redlinehide_4b: fix some problems with pathological table redlinesMichael Stahl1-8/+31
As seen in ooo95711-1.odt, the ODF import may create a redline that starts on a SwTableNode - though i haven't been able to figure out how such an odd creature might arise from UI actions. Try to fix the obvious places so we don't crash easily; there might be more trouble elsewhere though with code that assumes that a redline starts on a SwTextNode. Change-Id: I8431c1416ac4503ff0209a946398656f1c28366d
2018-12-01sw_redlinehide_4a: more adapting of SwDoc::SetCounted()/SetNumRule()Michael Stahl1-9/+17
Apply to/reset only the paragraph properties node. Change-Id: I4dd3973a758f4afcc30f905b7351e9687d050e33
2018-11-16entirity of writer rebuilding when vcl widget headers changeCaolán McNamara1-0/+1
which seems a bit excessive Change-Id: If0ab5a33bfbbd399e270f3e140c9d44d843985aa Reviewed-on: https://gerrit.libreoffice.org/63422 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-11-15sw_redlinehide_3: pass layout into SwTextNode::GetExpandText()Michael Stahl1-7/+7
Thanks to [loplugin:nullptr] and [loplugin:implicitboolconversion] for finding one of the call sites; 3 current C++ compilers would otherwise have implicitly converted the parameters into nonsense without warning. Change-Id: I3cf6697b37616570fd56fd32da27752983a66f4a
2018-11-15sw_redlinehide_3: adapt PDFExport lcl_HasPreviousParaSameNumRuleMichael Stahl1-13/+17
Reuse some formerly static functions in docnum.cxx Change-Id: I8d6bcca28a4f8a6e197a1c302acdf22ce6de01ff
2018-11-15sw_redlinehide_3: fix SwDoc::MoveParagraph copying of redlined textMichael Stahl1-0/+41
If redlining is enabled, the selection is copied and so delete redlines become insert redline; better to delete the delete redlines so the insert redline consists only of the visible text. Change-Id: I5f7da96dd957262ccc2b83d0abe6add258b7067f
2018-11-15sw_redlinehide_3: adapt SwDoc::MoveParagraph()Michael Stahl1-2/+120
Very tricky... Change-Id: Ic4157d14c2a3ee7c90f103561a376ac6f753a694
2018-11-15sw_redlinehide_3: update frames in SwDoc::MoveParagraph()Michael Stahl1-0/+4
... for hidden mode. Change-Id: I61f240ee7e4e3b61d53b07170be195c15fd679ae
2018-11-15sw_redlinehide_3: fix bad redlines in SwDoc::MoveParagraph()Michael Stahl1-1/+10
Avoid creating a redline that ends on an EndNode (if the moved node is the last in the body), and also ensure that the redline has valid SwIndex nContent in its positions (because lcl_CheckPosition asserts that). Change-Id: I9b89d8cbc180453c24d9690ac937adb4512f0aeb
2018-11-15sw_redlinehide_3: adapt setters in SwEditShell tooMichael Stahl1-26/+72
SwEditShell::SetNumRule(), DelNumRules(), NumUpDown() The selection could start in a different node than the props-node but the operation with hidden redlines should apply to the props-node. Change-Id: I307f6497c8fabdf8e12e352c6b9f2c4bf9101720
2018-11-15sw_redlinehide_3: adapt SwEditShell::SearchNumRule()Michael Stahl1-5/+10
Change-Id: Ic7d07a1e4920d5776a8fec3893cd2cd2aff2c6fc
2018-11-15sw_redlinehide_3: adapt SwDoc::GotoNextNum()/GotoPrevNum()Michael Stahl1-11/+50
... and callers in SwCursorShell / SwEditShell. Change-Id: Iffe4ca7893b97df8bd07f25c9e0e1dc908011e3f
2018-11-15sw_redlinehide_3: SwEditShell::IsFirstNumRuleAtPos()Michael Stahl1-3/+4
IsFirstOfNumRule() needs a layout so it can check the correct SwNodeNum. Change-Id: Ic6bd9adc909d7c325f5e450fd9e53a15f68e7a63
2018-11-15sw_redlinehide_3: adapt SwEditShell callers of SwDoc::GetNumRuleAtPosMichael Stahl1-1/+8
Change-Id: I192a9743300a77bc463319789064abd89d046b0a
2018-11-15sw_redlinehide_3: adapt SwEditShell::OutlineUpDown()Michael Stahl1-1/+10
Change-Id: I1d1f4604c580fe4dd764cfb908cd18657ea54255
2018-11-15sw_redlinehide_3: adapt GotoOutline for SwCursrShellMichael Stahl1-10/+8
Adapt SwDoc::GotoOutline(), SwCursorShell::GotoNextOutline(), SwCursorShell::GotoPrevOutline() to skip over outline nodes that are merged away in the layout. Change-Id: Id6f6bb93177753ed21a438c89dc6d90098e11455
2018-11-14Simplify containers iterations in sw/source/core/[d-l]*Arkadiy Illarionov1-16/+5
Use range-based loop or replace with STL functions Change-Id: I143e9a769e1c1bb0228933a0a92150f00e3e1f20 Reviewed-on: https://gerrit.libreoffice.org/63347 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin1-1/+1
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann1-1/+1
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-05use std::unique_ptr in sw::IDocumentUndoRedoNoel Grandin1-28/+25
Change-Id: I504706ff1a3fc11a7a06ebe935f9dbc5323aefe8 Reviewed-on: https://gerrit.libreoffice.org/61369 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann1-1/+1
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-12loplugin:useuniqueptr in SwDoc::GetUniqueNumRuleNameNoel Grandin1-3/+2
Change-Id: I9612e3874aefa874b3d8733ac32b6f0a2e9a2a48 Reviewed-on: https://gerrit.libreoffice.org/60349 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08sw_redlinehide: add some checks in places that require the nodeMichael Stahl1-1/+4
... that contains the first text of the frame. Change-Id: I8efc1acd87a7fcb9e4e38925f1ba91ec1a004dfd
2018-06-08sw_redlinehide: use unwrapping SwIterator when iterating SwTextNodeMichael Stahl1-1/+1
... or SwContentNode. Change-Id: Ib05038fd5a5550f5ed6dd90e129a2d7c3da74c1e
2018-03-13Translate German variable namesJohnny_M1-9/+9
Akt -> Current in docnum Change-Id: Ia6d67ee3f3c4cf15bbfe2fabf2baa1f4adbd91a8 Reviewed-on: https://gerrit.libreoffice.org/51027 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-12More loplugin:cstylecast: swStephan Bergmann1-1/+1
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
2017-10-27loplugin:constantparam in swNoel Grandin1-3/+2
Change-Id: Ia477de0fb910f6a8fbb0a5054f4bdb43dd9ff381 Reviewed-on: https://gerrit.libreoffice.org/43951 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21migrate to boost::gettextCaolán McNamara1-2/+1
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-06-05Improved loplugin:cstylecast to reference types: swStephan Bergmann1-1/+1
Change-Id: I7206d3325b4bfedb852d559b68dc1678da524b41
2017-05-19make string translation loading more uniformCaolán McNamara1-1/+1
change various ResId classes that use conversion operator to OUString to functions that return a OUString drop various defines drop unnecessary toString calls Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92 Reviewed-on: https://gerrit.libreoffice.org/37817 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-12convert SwComparePosition to scoped enumNoel Grandin1-9/+9
Change-Id: I95c03e02078a1dc8878e44763502bb344dc3ac26 Reviewed-on: https://gerrit.libreoffice.org/36412 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-16Clean up integers representing positions in SwOutlineNodes vectorsStephan Bergmann1-6/+6
Change-Id: If1a6a9cb61ffd355a85835127e7c893969833587
2017-03-16convert SwUndoId to scoped enumNoel Grandin1-9/+9
Change-Id: I782fdd53641c0d7c629265b6179de70aa54382f9 Reviewed-on: https://gerrit.libreoffice.org/35246 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-08loplugin:loopvartoosmallStephan Bergmann1-6/+3
Change-Id: I01b42f92b553695724305c1604db967da114a818
2017-03-02Fix typosAndrea Gelmini1-1/+1
Change-Id: Ib725427225fe95fb39a72f96bbd60d5464c9351a Reviewed-on: https://gerrit.libreoffice.org/34782 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-03-02Complete the transition of SwRedlineTable::size_typeStephan Bergmann1-5/+5
...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>
2016-12-08convert SFX_HINT to scoped enumNoel Grandin1-3/+3
Notes (*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a dynamic_cast check. (*) In SC, removed the hint id field from ScIndexHint, no point in storing the hint id twice (*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no point in storing two different hint ids (*) In some cases, multiple #define's used to map to the same SFX_HINT value (notably the SFX_HINT_USER* values). I made all of those separate values. Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5 Reviewed-on: https://gerrit.libreoffice.org/31751 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-29convert ND constants to o3tl::typed_flagsNoel Grandin1-3/+5
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-11-18includes should be at the top of the fileNoel Grandin1-2/+2
not randomly scattered through the code found with something like: git ls-files *.cpp | xargs grep -Pzl "(?s){.*#include" Change-Id: I9c242fa4ef99e8677f2800d7ec9f16d16e488351 Reviewed-on: https://gerrit.libreoffice.org/30952 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-31sw: DocumentListsManager: no need for cryptographic randomness hereMichael Stahl1-5/+4
... or in SwDoc::GetUniqueNumRuleName() Change-Id: Ifd6df902f7feae9db77f38654d7eb246dfb3510a
2016-10-27loplugin:expandablemethods in swNoel Grandin1-9/+2
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-08convert nsRedlineMode_t to typed_flagsNoel Grandin1-4/+4
including fixing a bug in SwXMLExport::exportDoc where it was ORing with a constant from a different type: nsRedlineType_t::REDLINE_INSERT Change-Id: I2bb154c9a35d106e64fd1a8b6e928d0384c9fafe
2016-07-29sw undo: implement SfxUndoAction::GetViewShellId() interfaceMiklos Vajna1-1/+1
With this, it's possible to tell which view shell created which undo actions. It's visible only in the doc model xml dump only, though. Change-Id: Ia76d218a1d8b578aaad00ab733c772b10dda39f0 Reviewed-on: https://gerrit.libreoffice.org/27693 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-06-16Remove the :: prefix in ::std for swMark Page1-1/+1
This patch was created using a script Variable name textual alignment is preserved to the same level Change-Id: I6b4858f8059b8cf71fc253e87d6df634362d62e9 Reviewed-on: https://gerrit.libreoffice.org/26306 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-05-12clang-tidy modernize-loop-convert in swNoel Grandin1-3/+1
Change-Id: I1f4a0ad6658bd3154c48940296aa8edc1ea1612c Reviewed-on: https://gerrit.libreoffice.org/24876 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-09convert SfxStyleFamily to scoped enumNoel Grandin1-3/+3
and update the RSC compiler to accept such In the process fix some confusion in SD where it was confusing SfxStyleFamily and the index of the relevant family (which other parts of the code in SVL use) Change-Id: I1efc9f85fbed8ab76eafe8f6e1ada411753ae5f9
2016-04-29sw, xmlsecurity: indentation fixesMiklos Vajna1-1/+1
Change-Id: Iafb20132df4aba6b45cf49a7814084f66d087b25
2016-04-01tdf#97966 Drop 'static' keywordsWastack1-1/+1
Including no keywords from extern "C" blocks Change-Id: Ie3160af9decf04ceeda02dc20a6518afaa80f972 Reviewed-on: https://gerrit.libreoffice.org/23677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>