summaryrefslogtreecommitdiffstats
path: root/editeng
Commit message (Collapse)AuthorAgeFilesLines
* Make SfxItemSet ranges correct by constructionStephan Bergmann2017-06-168-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* use ERRCODE_NONE instead of 0Noel Grandin2017-06-141-1/+1
| | | | | | | | | peeling off a small chunk of my ErrCode strong_int conversion Change-Id: Idc89e8496083beed7608cba705cd981139eb7111 Reviewed-on: https://gerrit.libreoffice.org/38777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Use unique_ptr for ImpEditEngine::pEmptyItemSetStephan Bergmann2017-06-132-4/+2
| | | | Change-Id: I1d7757eafb52fc3cc7d7e1cb02cced0a6004a304
* Let SfxSetItem ctor take SfxItemSet by unique_ptrStephan Bergmann2017-06-131-1/+2
| | | | Change-Id: I219dd03477862169cd50eecc14822f6a023f879a
* cleanup unused css/frame/* includesJochen Nitschke2017-06-121-1/+0
| | | | | | | Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65 Reviewed-on: https://gerrit.libreoffice.org/38633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* clang-tidy readability-delete-null-pointerNoel Grandin2017-06-121-2/+1
| | | | | | | | | which in turn triggered some loplugin:useuniqueptr Change-Id: I0c38561fc9b68dac44e8cf58c8aa1f582196cc64 Reviewed-on: https://gerrit.libreoffice.org/38281 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* EditEngine Creating SvXMLImportContext for ODFVarun Dhall2017-06-071-0/+17
| | | | | | | Change-Id: I4083658db6068122b423fe5ec7a568fa222b4e80 Reviewed-on: https://gerrit.libreoffice.org/38358 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
* EditEngine Renamed InsertText to PasteTextVarun Dhall2017-06-073-3/+3
| | | | | | | | | The multiple overloads of InsertText cause pain in debugging Change-Id: Icb5b40c23ae85e198d57f3054bc07a8c7eb05f55 Reviewed-on: https://gerrit.libreoffice.org/38286 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
* EditEngine Implementing Paste for XML from clipboardVarun Dhall2017-06-071-13/+37
| | | | | | | Change-Id: Ia820a29bec8a6b102fb78cf325577b731a12c3c4 Reviewed-on: https://gerrit.libreoffice.org/38282 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
* Exporting EditEngine document into a buffer with ODF FilterVarun Dhall2017-06-073-3/+21
| | | | | | | Change-Id: Ib0304de5d873ac833dcc121235b8de494a1bb3bf Reviewed-on: https://gerrit.libreoffice.org/37999 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
* EditEngine Exporting flat XML from actual clipboardVarun Dhall2017-06-071-4/+5
| | | | | | | | | | Allowing export of EditEngine document into flat XML from actual clipboard by modifying SotClipboardFormatId Change-Id: I9c7dfd3ca428d0fa355bd3dfb7bfa0f0e30dada6 Reviewed-on: https://gerrit.libreoffice.org/38226 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
* add COVERITY_NOEXCEPT_FALSECaolán McNamara2017-06-061-1/+1
| | | | | | | | | | | | to markup dtors that coverity warns might throw exceptions which won't throw in practice, or where std::terminate is an acceptable response if they do Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4 Reviewed-on: https://gerrit.libreoffice.org/38318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* replace SVSTREAM_OK with ERRCODE_NONENoel Grandin2017-06-061-8/+8
| | | | | | | | | since the first is #define'd to the second, and offers no extra value Change-Id: I2c67e09ea3aa5361b8e7dfe7a20858c6ae054450 Reviewed-on: https://gerrit.libreoffice.org/38406 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Improved loplugin:cstylecast to reference types: editengStephan Bergmann2017-06-054-7/+7
| | | | Change-Id: I0a9321baf91ea0b460f4d1b6a638278275b184d3
* clang-tidy performance-unnecessary-value-paramNoel Grandin2017-06-051-1/+2
| | | | | | | Change-Id: I6ed8c54c7c45931d91709cc818f2483c70197192 Reviewed-on: https://gerrit.libreoffice.org/38400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* tdf#108324 fix crash: paste from textframeJochen Nitschke2017-06-041-2/+1
| | | | | | | | | | | | | | rAttr references *pC->maCharAttribs[nAttr].get() and assignment of a unique_ptr is essentially a reset, invalidating the reference. regression of commit dd891ec422fb35eada219ca7adddbd60d69f1fb7 cppcheck: memleak (false positive) but manage ownership from start Change-Id: Ica81f0af18e11b32d2f97045961630858c78e9af Reviewed-on: https://gerrit.libreoffice.org/38382 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
* Improved loplugin:redundantcast static_cast handling: editengStephan Bergmann2017-06-021-2/+2
| | | | Change-Id: Ia7541038df7c9eca00f99d70e5a1fc817028f686
* convert GRFILTER constants to ERRCODE_GRFILTER_Noel Grandin2017-06-021-2/+2
| | | | | | | | | | since various code mixes these constants in with ErrCode values from other code, let us just make it into real ErrCode values. Change-Id: Ifa3d0f7526172609a44e6749bed9f730ab6b1a95 Reviewed-on: https://gerrit.libreoffice.org/38313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* clang-tidy readability-redundant-control-flowNoel Grandin2017-05-311-4/+0
| | | | | | | Change-Id: I832f7ef0f1bd55e365db7e49823fe8bc30390c04 Reviewed-on: https://gerrit.libreoffice.org/38215 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* EditEngine Refactoring hand-coded XInterface implementations of EditDataObjectVarun Dhall2017-05-302-17/+2
| | | | | | | | | | EditDataObject has odd hand-coded XInterface implementations, this is unnecessary and can be improved by replacing its superclasses Change-Id: Ife19c114450dfd95a10a10de1a78b035babb5443 Reviewed-on: https://gerrit.libreoffice.org/38163 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
* teach redundantcast plugin about functional castsNoel Grandin2017-05-303-7/+5
| | | | | | | Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0 Reviewed-on: https://gerrit.libreoffice.org/37910 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
* remove unnecessary use of OString::getStrNoel Grandin2017-05-281-1/+1
| | | | | | | Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* cleanup unused css/linguistic2/ includesJochen Nitschke2017-05-284-9/+0
| | | | | | | Change-Id: Ifd4b495f965f948d37557d83a03a38df9322039a Reviewed-on: https://gerrit.libreoffice.org/38109 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:constantparamNoel Grandin2017-05-252-10/+7
| | | | | | | | | add the results files so I can just see the diff in future Change-Id: Ia20a1aa6418be95ed620719cde340c00b7b053e1 Reviewed-on: https://gerrit.libreoffice.org/37988 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Translate German comments and debug strings (leftovers in e... dirs)Johnny_M2017-05-207-10/+10
| | | | | | | | | | | | | Translates all (leftovers) found using a custom regex, in directories not shown by /bin/find-german-comments and beginning with "e". Additionally, following is translated: - A help string in /extensions/test/ole/EventListenerSample/EventListener/EventListener.idl Change-Id: Iff521ae1c4a616ed5a4ca79641a5cee6f380bee0 Reviewed-on: https://gerrit.libreoffice.org/37836 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
* no need for std::unique_ptr::reset in destructorMarkus Mohrhard2017-05-201-1/+0
| | | | Change-Id: Id8628ae1e1d17dedf1c06d6a3d44d8be40be4cef
* convert to use std::unique_ptrJulien Nabet2017-05-202-15/+10
| | | | | | | Change-Id: I37f8469fa4f41ac052d811ef56ad4bddfac6a7d1 Reviewed-on: https://gerrit.libreoffice.org/37848 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
* loplugin:stringcopy: editengStephan Bergmann2017-05-194-6/+6
| | | | Change-Id: I3d5b7673b2403bf670d85fa3c65f67aefcea48ff
* fix gdi resource leak (editeng/impedit)Julien Nabet2017-05-192-0/+5
| | | | | | | Change-Id: Ia2d9ad88b5bcc2adf7f28ac7833132c04045d55b Reviewed-on: https://gerrit.libreoffice.org/37790 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org>
* tdf#107176: just return initial selection when there's no rangeJulien Nabet2017-05-181-0/+4
| | | | | | | | | See https://bugs.documentfoundation.org/show_bug.cgi?id=107176#c2 Change-Id: I606b7f248821bb24b3a9026ecd26a9bc93971748 Reviewed-on: https://gerrit.libreoffice.org/36582 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
* loplugin:unusedmethodsNoel Grandin2017-05-181-4/+2
| | | | | | | Change-Id: I1c50d176e793397a1f9625f797a3750cf191a61c Reviewed-on: https://gerrit.libreoffice.org/37679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* remove some unused forward declarationsJochen Nitschke2017-05-141-2/+0
| | | | | | | | | and unused TransliterationModules include in editeng Change-Id: I02e2d6acfde562a3e0cc8516eb16bb2ce8a810cc Reviewed-on: https://gerrit.libreoffice.org/37556 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* remove unused uno::Reference varsNoel Grandin2017-05-121-3/+0
| | | | | | | | | found by temporarily marking Reference as SAL_WARN_UNUSED. Change-Id: I18809b62654467f890016adcc92576980ced393b Reviewed-on: https://gerrit.libreoffice.org/37511 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* make loplugin constantparam smarter about string paramsNoel Grandin2017-05-092-3/+3
| | | | | | | Change-Id: Id3df69b38fd35f46735246a6d307a89aa10d4294 Reviewed-on: https://gerrit.libreoffice.org/37426 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:constantparamNoel Grandin2017-05-091-2/+2
| | | | | | | Change-Id: Ia9500b25602c14aadf49fe373682ae9d87a0a1a2 Reviewed-on: https://gerrit.libreoffice.org/37390 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* cleanup tools/debug.hxx includesJochen Nitschke2017-05-081-1/+0
| | | | | | | | | | | | | | with command > git grep -l tools/debug.hxx | xargs grep -L DBG_ | xargs sed -i '/#include *\(<\|\"\)tools\/debug.hxx.*/d' don't change files in includes/ and */pch Change-Id: Ie429d6a7dca5dfa1073e0f5ba037f7c84bdbec08 Reviewed-on: https://gerrit.libreoffice.org/37349 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* convert EESelectionMode to scoped enumJochen Nitschke2017-05-072-3/+3
| | | | | | | | Change-Id: I4da22d40d5b14878b5efac1f3e4a5c76adec37b3 Reviewed-on: https://gerrit.libreoffice.org/37341 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
* create color config in ctor instead of on-demandCaolán McNamara2017-05-073-18/+4
| | | | | | | Change-Id: Id45b6cba3665c11074dbdc52757d1b6f0084b020 Reviewed-on: https://gerrit.libreoffice.org/37346 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
* revert OSL_ASSERT changesChris Sherlock2017-05-071-1/+1
| | | | Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
* tdf#43157: convert editeng module away from OSL_ASSERT to assertChris Sherlock2017-05-071-1/+1
| | | | Change-Id: Iad5ad8ce11be2fbafd50f46e68947e10752bd609
* ParaPortionList::SafeGetObject: remove SAL_WARN_IF, called on purposeEike Rathke2017-05-061-4/+0
| | | | | | | Gazillions of warnings leading nowhere.. all calling places now should handle this gracefully. Change-Id: I74b6dacb5a4a5adb9af73aa1adeee2c5b2a9323a
* convert HTML_TOKEN_IDS to scoped enumNoel Grandin2017-05-054-206/+208
| | | | | | | Change-Id: I525506e0103e4f17e5b8b95f15c1285d65b93de9 Reviewed-on: https://gerrit.libreoffice.org/37220 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* convert EVAnchorMode enum to scoped enumJochen Nitschke2017-05-044-45/+45
| | | | | | | | | change values to match position in definition to their meaning Change-Id: Ia96e0c7e0c70c847dea518ef871608516542d3cb Reviewed-on: https://gerrit.libreoffice.org/37186 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* Replace all OUString("") with OUString()Arnaud Versini2017-05-041-5/+5
| | | | | | | Change-Id: Ie14c4d76cb61cfbe0410103adfc1afc8ade0f3e0 Reviewed-on: https://gerrit.libreoffice.org/37146 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* editeng: add pUndoManager assert in ImpEditEngine::~ImpEditEngine()Michael Stahl2017-05-031-0/+4
| | | | | | | | | This too can be an application UndoManager loaned only temporarily from getSdrUndoManagerForEnhancedTextEdit() and SdrObjEditView::SdrBeginTextEdit() - it must be reset again via SdrEndTextEdit(). Change-Id: I1f9d64d7af47ddc53d183bde6a6244ba5c261b0c
* loplugin:checkunusedparams in editengNoel Grandin2017-05-0225-126/+115
| | | | | | | Change-Id: I2b770d40ac2339cd2b04a765a6d970675d2ea1c1 Reviewed-on: https://gerrit.libreoffice.org/37133 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
* loplugin:salunicodeliteral: editengStephan Bergmann2017-04-284-6/+6
| | | | Change-Id: I5db29ba3505d914ec05826128713d7e25091ed11
* tools: move errcode.hxx to the vcl moduleChris Sherlock2017-04-271-1/+1
| | | | | | | Change-Id: I17e5a033de5f0aeb0a726744f7b464cdab6e2ee3 Reviewed-on: https://gerrit.libreoffice.org/36854 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
* WaE: -Wsometimes-uninitializedCaolán McNamara2017-04-261-1/+1
| | | | Change-Id: Ia46d44e45a30761cc366273cda4fa62b83a79430
* check all ParaPortionList::SafeGetObject() return values for nullptrEike Rathke2017-04-264-119/+165
| | | | Change-Id: I46fdd613c9ad3762f045f984caff2a8dbef9bf16