summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/tblcpy.cxx
AgeCommit message (Collapse)Author
2019-11-05tdf#42949 Fix IWYU warnings in sw/source/core/d*/*cxxGabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Id33b8c1e0c02c21591b167a8b3f0ea288fac63bd Reviewed-on: https://gerrit.libreoffice.org/81689 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-22tdf#117185 tdf#110442 sw: bring harmony & peace to fly at-char selectionMichael Stahl
Use IsDestroyFrameAnchoredAtChar() to harmonize the at-char fly selection across all relevant operations: * CopyImpl: this is the most tricky one: - the code in CopyWithFlyInFly() and CopyFlyInFlyImpl() is quite con- voluted as it needs to do some things ignoring a partially selected start node, while including it in other cases - it had pre-existing bugs too that would lose a fly anchored to the 2nd (1st fully selected) node of a redline - now it needs to copy the flys in the selection if it is inside a single node - another complication is that flys that already existed at the insert position need to have their anchors corrected - SwUndoInsLayFormat need to be created for the appropriate flys - SwUndoInserts Undo/Redo needs to run the nested SwUndoInsLayFormat at the appropriate time - SwUndoInserts::UndoImpl() needs a special case to *never* delete flys at the start/end of the selection because those are handled by nested SwUndoInsLayFormat - Insert File (shellio.cxx) needs adapting to the SwUndoInserts change * DeleteRange: this just needs to delete the flys via DelFlyInRange() * MoveRange: - this is used by the old SwRangeRedline Show/Hide, i.e. on ODF export - the SaveFlyInRange()/RestFlyInRange() was rather inadequate and didn't even restore content indexes at all... * IsShown: the sw_redlinehide code needs to check visibility against the (inverted) extents The selection behavior is changed so that at-char flys in the start and end node of the selection are also selected, instead of having their anchor moved to a different content index by the operation. This appears more obvious and user-friendly, fixes tdf#110442, and is also more like what Word does. Selections exclude the start and end position except if it's a fully selected node or at the start or end of a section (i.e. Ctrl+A should also select every at-char fly). A special hack is needed to keep writerfilter happy for now; it likes to anchor flys at nodes which it then deletes in RemoveLastParagraph(), which likely could be improved there (disposing the SwXParagraph runs into the same problem...). Crashes fixed by this: tdf#117185 tdf#117215 except comment#12 tdf#124720 tdf#124721 tdf#124739 Previously fixed bugs tested: i#97570 plus the 2 bugs that already have UITests Change-Id: I4fec2a3c15ca0e64e5c4e99acfb04f59bb2bcf64 Reviewed-on: https://gerrit.libreoffice.org/75516 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-03-28use unique_ptr in SwTable::InsTableNoel Grandin
Change-Id: I02ad6fb65e39ed14fd1aff2df876a9704c0d8f3b Reviewed-on: https://gerrit.libreoffice.org/69882 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-07o3tl::make_unique -> std::make_unique in swGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I871312c1077439377c67b76112f38b7019fa6fb1 Reviewed-on: https://gerrit.libreoffice.org/67376 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-14Simplify containers iterations in sw/source/core/[d-l]*Arkadiy Illarionov
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-17clang-tidy readability-redundant-smartptr-getNoel Grandin
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-29Fix typosAndrea Gelmini
Change-Id: I483680622a75affb9822bbf5fc4d14512961493f Reviewed-on: https://gerrit.libreoffice.org/58130 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2018-01-12More loplugin:cstylecast: swStephan Bergmann
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-12-27ofz#4813: Direct-leakCaolán McNamara
Change-Id: I7bd257734a302ad00acf4336f4b478d6af4bc304 Reviewed-on: https://gerrit.libreoffice.org/47100 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-03Replace some lists by vectors in sw/doc partJulien Nabet
Change-Id: If0ff7d8790824eae5701cca208761d3ee707eb58 Reviewed-on: https://gerrit.libreoffice.org/45747 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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-06-16Make SfxItemSet ranges correct by constructionStephan Bergmann
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT) that each individual range has an upper bound not smaller than its lower bound. Arguably, all SfxItemSet instances should fulfill the stronger guarantees required and checked by MergeRange. And in many cases the ranges are statically known, so that the checking can happen at compile time. Therefore, replace the two SfxItemSet ctors taking explicit ranges with two other ctors that actually do proper checking. The (templated) overload taking an svl::Items struct should be used in all cases where the range values are statically known at compile time, while the overload taking a std::initializer_list<Pair> is for the remaining cases (that can only do runtime checking via assert). Most of those latter cases are simple cases with a single range covering a single item, but a few are more complex. (At least some of the uses of the existing SfxItemSet overload taking a const sal_uInt16* pWhichPairTable can probably also be strengthened, but that is left for another day.) This commit is the first in a series of two. Apart from the manual changes to compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and svl/source/items/itemset.cxx, it only consists of automatic rewriting of the relevant SfxItemSet ctor calls (plus a few required manual fixes, see next). But it does not yet check that the individual ranges are properly sorted (see the TODO in svl::detail::validGap). That check will be enabled, and the ensuing manual fixes will be made in a follow-up commit, to reduce the likelyhood of accidents. There were three cases of necessary manual intervention: * sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in braced-init-list syntax now, so needs explicit narrowing conversion to sal_uInt16. * In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually. * In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx, sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx, sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx, some comments had to be put back (see "TODO: the replaced range can contain relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx). A few uses of the variadic form erroneously used nullptr instead of 0 for termination. But this should have been harmless even if promoted std::nullptr_t is larger than promoted sal_uInt16, assuming that the part of the nullptr value that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly, some uses made the harmless error of using 0L instead of 0. Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35 Reviewed-on: https://gerrit.libreoffice.org/38861 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-20convert RndStdIds to scoped enumNoel Grandin
Change-Id: I029ad67dfcbc40f3953adf485957efcbd97f23d0 Reviewed-on: https://gerrit.libreoffice.org/35328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-08loplugin:loopvartoosmallStephan Bergmann
Change-Id: I01b42f92b553695724305c1604db967da114a818
2016-12-15tdf#104554: fix iterator calculusJulien Nabet
and avoid unexpected behaviours when pasting columns between tables regression from: https://cgit.freedesktop.org/libreoffice/core/commit/?id=f0fa43ea99ac7564f2cc7ca1d997831808056b68 http://www.cplusplus.com/reference/list/list/insert/ and http://www.cplusplus.com/reference/deque/deque/insert/ helped me to understand my mistake Change-Id: I6ff6b84a90c7ea8db1e4d7c2d12dd191f96141ae Reviewed-on: https://gerrit.libreoffice.org/32020 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2016-11-21Revert "Revert "std::list<sal_uLong> to deque""Julien Nabet
+ use returned iterator by insert method call This reverts commit 1a583283d6b58c8951cb52faac82ecb24fdbf1b3. Change-Id: I02547663230fb7b5959df349c4d395bbadd74c3b Reviewed-on: https://gerrit.libreoffice.org/30439 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2016-10-18Revert "std::list<sal_uLong> to deque"Caolán McNamara
stldebug assert on insert->table, ok, ctrl+a, ctrl+c, ctrl+v This reverts commit 9e9e7bd3c9dc9a3149436916e747c7f7ee040621.
2016-09-01std::list<sal_uLong> to dequeNoel Grandin
Change-Id: I99d4f5fb322301542519241ec65a38304ecc16a1
2016-08-29Get rid of pointless indirect function pointer variablesTor Lillqvist
Change-Id: Ic8eddec51d59b531ae22421b796a148267b9f3c1
2016-05-19tdf#75757: remove inheritance on vector (SwTableBoxes)Bjoern Michaelsen
- move SwTableBoxes::GetPos(..) up to SwTableLine::GetBoxPos(..) - SwTableBoxes is empty over plain vector then, make it an alias Change-Id: I72420d4fe1042a713d3e82f3df66f18ccbfca3f6 Reviewed-on: https://gerrit.libreoffice.org/25166 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-20clang-tidy clang-analyzer-deadcode.DeadStoresNoel Grandin
suspect that some of these may reveal latent bugs.... Change-Id: I9de9aabbda9c8952715631577c29c1830df1eb71 Reviewed-on: https://gerrit.libreoffice.org/24200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-12clang-tidy performance-unnecessary-value-param in swNoel Grandin
Change-Id: I3e030743b640d5a5f6b3bf4a4e9ba50ccd001287
2015-11-25bin/rename-sw-abbreviations.shlibreoffice-5-1-branch-pointRobinson Tryon
This commit renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I77e5134f42f25e3786afa36b7a505c7e3237a9e8
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I01e11fa956a249974e77dce9deebe79311f098d0
2015-10-27sw: prefix members of SwTableFormulaUpdateMiklos Vajna
Change-Id: Id9e18c67a4fa6e3646ac33cd616838819d1f10d8
2015-10-02tdf#94205 Use o3tl::make_unique instead of new + std::movebureken
Change-Id: I27ed3c3fb826e7ce63b0bc12f7d17e18b21c9949 Reviewed-on: https://gerrit.libreoffice.org/19071 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-09-17boost->stdCaolán McNamara
Change-Id: Idfbcfa1e5ba7bff92e98693c33c4b33a6beda08f
2015-09-07sw: convert boost::ptr_vector to std::vector<std::unique_ptr>Michael Stahl
Change-Id: I341fb7c0712dff77ebfed41560a487f85c27c25a
2015-09-07sw: convert boost::ptr_vector to std::vector<std::unique_ptr>Michael Stahl
Change-Id: If8d9770717c21875b4472b0d94a1fa5a9d136085
2015-08-20loplugin: defaultparamsNoel Grandin
Change-Id: I36c7086117112d35df98c05030c965c21d9330ac
2015-06-02loplugin:cstylecast: deal with those that are (technically) const_castStephan Bergmann
Change-Id: Icb8f62a167cc450bd156f0e3611f30c4d2a57c16
2015-05-20bin/rename-sw-abbreviations.shlibreoffice-5-0-branch-pointChristian Lohmaier
renames the most annoying abbreviations in Writer (and partially in the shared code too). Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-05-11loplugin:cstylecast: nop between pointer types of exactly same spellingStephan Bergmann
Change-Id: I0e42e757a6f7b0c28758193aad8b3cb01607b8b1
2015-05-05loplugin:staticmethodsNoel Grandin
Change-Id: I90dd921077bbfc57200e398e7959306f26c65cfe
2015-05-04cppcheck: noExplicitConstructorCaolán McNamara
Change-Id: I1f5272cdf05b36d1c6958159a29c04ed7374592d
2015-04-05Reduce scope and improve readabilityMatteo Casalin
Change-Id: I4bf1e2c0f928644e6f85acd75b88685303c4ac06
2015-04-05Use +=Matteo Casalin
Change-Id: I280a5ee0d63cabba7482164132b092f4087814bd
2015-04-05Use more proper integer types and range-for loopsMatteo Casalin
Change-Id: I66d2d469a6dc03b3e6ad3609b5a04ac670f6e000
2015-03-26const_cast: convert some C-style casts and remove some redundant onesStephan Bergmann
Change-Id: Icb14a036ea9d7636359b6bc5e0af17568c0d54cb
2015-01-05Resolves: fdo#87003 Kill BOOST_FOREACH on masterNathan Yee
use C++11s range-based for() loops instead Conflicts: sd/source/filter/eppt/pptx-epptooxml.cxx Change-Id: I0868eb345932c05b7e40b087035da252b99bf0b9 Reviewed-on: https://gerrit.libreoffice.org/13714 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-23kill some follow-up dead initsBjoern Michaelsen
Change-Id: Id8d9309c3d09224c55ff15521d4fa54b9fbb23c2
2014-11-21dead init (clang)Bjoern Michaelsen
Change-Id: Ic36b07e5632cc2d1e0e525543bb8da30f9785ddb
2014-11-18loplugin: cstylecastNoel Grandin
Change-Id: I939e4af2ca27b34f78d079bb1e209d9b118eed01
2014-11-16sal_True/sal_False to true/false in sw comments (also delete obsolete ones)Matteo Casalin
Change-Id: Ifb29bd3e9c5dc7671c189fd9daa010305f7a85a4
2014-09-12Turn SfxItemState into a C++11 scoped enumerationStephan Bergmann
...to gain further confidence in the claim "that none of the existing code tries to uses combinations of these enum values" (d92602c5b13d0a60439d86c5a033d124178726ca "more fixes for SfxItemState") Change-Id: I987922d945e8738e38adfde83b869adf3ff35b13 Reviewed-on: https://gerrit.libreoffice.org/11384 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-08-12Refactored IDocumentStylePoolAccess out of SwDoc.Valentin Kettner
Added non const SwDoc::GetDfltTxtFmtColl and SwDoc::GetTxtFmtColls and SwDoc::GetCharFmts. Had to make the manager friend of SwTxtFmtColl and SwConditionTxtFmtColl Had to make SwDoc::_MakeCharFmt and SwDoc::_MakeFrmFmt public. Change-Id: I19a36d91f92b3781a6c4313ec12eb8f7d4dfacc3
2014-08-12Refactored IDocumentLayoutAccess out of SwDoc.Valentin Kettner
Into the new class DocumentLayoutManager. Change-Id: I02d0cfcc63633d0bdab380508b2ef563187fd269
2014-08-12Refactored IDocumentFieldsAccess out of SwDoc.Valentin Kettner
Into the new class DocumentFieldsManager. Removed SwDoc::_MakeFldList because it is not defined anywhere. Also moved a few non interface methods that belong to the manager. Change-Id: Icefd7ca7adcbb05a18d6fae0529fc54150b862fd
2014-08-12Refactored IDocumentRedlineAccess out of SwDoc.Valentin Kettner
Into the new class DocumentRedlineManager. Added an non const version of GetRedlineTbl to the interface. Also Moved SetAutoFmtRedlineComment which is not part of interface. Change-Id: I600d5821d5d5831557f5fc5375fb1203fe67a295