Commit Graph

2709 Commits

Author SHA1 Message Date
Aron Budea
51f616ddd7 tdf#108622: use correct type for last check timestamp during autocorrect
It's only supposed to check the files once every 2-mins, with
mismatching type that happens each time.

Change-Id: Ie9243cf928d952e28989dd981508de86cb7dbddb
Reviewed-on: https://gerrit.libreoffice.org/39428
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-01 15:39:10 +02:00
Varun Dhall
3c1fc723ff EditEngine: Changing export selection for copy/paste
Change-Id: I6f52f30eff76de5f0d641271ce3ea36ced572cc4
Reviewed-on: https://gerrit.libreoffice.org/39083
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-30 19:39:16 +02:00
Noel Grandin
71112060e0 loplugin:oncevar various
Change-Id: I8b82d46d4688b1a59d6fe1b05da7d5c8dfc13ca6
Reviewed-on: https://gerrit.libreoffice.org/38766
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-29 08:18:35 +02:00
Jochen Nitschke
594331cc81 remove default-able copy ctors and copy operators
The implicit defined ctors and operators will copy all members
(and bases).
Since C++11 implicit copy is depreciated if there is a non-default
dtor, keep such copies.

This commit includes only types that had either copy ctor or
copy operator and were found by cppcheck.

Change-Id: I93ee687fb3b3c5884f475a2c6054955cdde57ed7
Reviewed-on: https://gerrit.libreoffice.org/39351
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28 14:20:44 +02:00
Stephan Bergmann
d7436b75a9 In ImpEditEngine::ReplaceTextOnly, nLen has always been ignored
...ever since the code's introduction with
afb2f41ca9 "cws sw33bf08: #i113584#, #i113587#
transliteration fixed"

Change-Id: I9881ed1585857a95d2d8dd83ebf5d68d989e2c1d
2017-06-28 13:58:54 +02:00
Stephan Bergmann
d358fc1a45 -Werror=ignored-qualifiers (GCC 8)
Change-Id: I2a43ce3ca6af87ac53dd534c0c37150a000e7013
2017-06-28 10:24:53 +02:00
Varun Dhall
1ace4ed5c7 EditEngine: Added test to check MultiPara Copy/Paste with Bold/Italic text
Change-Id: Ic94338662009a4e0ddbc28e21ac1f5028ddd9126
Reviewed-on: https://gerrit.libreoffice.org/39219
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-26 17:10:35 +02:00
Andrea Gelmini
dbcc169d8c Fix typos
Change-Id: I2ce725f87ee6f8ebcffbac268cc7e7f8850023e5
Reviewed-on: https://gerrit.libreoffice.org/39232
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-06-26 09:20:18 +02:00
Noel Grandin
3f3181522b s/catched/caught
Change-Id: I7ea6977a9749e86f8058b78cdb91cd2c62da8264
Reviewed-on: https://gerrit.libreoffice.org/39164
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-26 08:59:38 +02:00
Varun Dhall
41f1474e63 EditEngine: Added test to check MultiPara SelectiveSelection Copy/Paste
Change-Id: Iffb55599c90483b231820f60536c93ec3bfec2c9
Reviewed-on: https://gerrit.libreoffice.org/39140
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-23 22:11:01 +02:00
Varun Dhall
84284429de EditEngine: Added test to check Multi Para Copy/Paste
Change-Id: Ida45d5861068c71e5c8d75eb711aaacbf543be79
Reviewed-on: https://gerrit.libreoffice.org/39119
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-23 22:08:03 +02:00
Noel Grandin
bf39807c67 loplugin:oncevar editeng..extensions
Change-Id: I3a63e3e3b873ef8a2d708d39be084124a6ad1346
Reviewed-on: https://gerrit.libreoffice.org/39153
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23 13:23:42 +02:00
Noel Grandin
222bc56e21 loplugin:unusedfields in desktop..editeng
Change-Id: Ieea12d0790a1034eba8975fe74fa205f02003b7d
Reviewed-on: https://gerrit.libreoffice.org/39134
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23 09:00:18 +02:00
Noel Grandin
528632660b convert ErrCode to strong typedef
would have preferred to re-use o3tl::strong_int, of which this
is a modified copy, but there are lots of convenience accessors
which are nice to define on the class.

Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a
Reviewed-on: https://gerrit.libreoffice.org/38497
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-21 08:42:30 +02:00
Caolán McNamara
3212a24194 consider field marks as text for auto quotes
Change-Id: I511a13f7785a0de6efaa8439d3f0bff20a1644ed
2017-06-19 16:27:16 +01:00
Caolán McNamara
0a9e57785e rename IsAutoCapitalizeWordDelim to NonFieldWordDelim
Change-Id: If8fb8f5e51bba8e631a6fc5db54487b418c19e05
2017-06-19 14:38:47 +01:00
Stephan Bergmann
1e3a00f0c7 Make SfxItemSet ranges correct by construction: Fix static cases
...with the aid of an extended compilerplugins/clang/store/sfxitemsetrewrite.cxx
(which in turn needed a small addition to compilerplugins/clang/check.hxx).

Enable svl::detail::validGap check for the static case, but keep it disabled for
now for the dynamic case.

Change-Id: I4846ba8e99aff94a86518e2cb5044e575093386e
2017-06-19 09:38:05 +02:00
Jochen Nitschke
a5dba7dbec remove unused osl/mutex.hxx includes
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb
Reviewed-on: https://gerrit.libreoffice.org/38905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-06-18 13:38:25 +02:00
Jochen Nitschke
d69795b9c9 use local statics in getTypes functions
... instead of double checked locking patterns.

Change-Id: I1b86ce723ff22dd357b3ed69a52757b085472424
Reviewed-on: https://gerrit.libreoffice.org/38906
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17 13:28:18 +02:00
Stephan Bergmann
13bb5a4b09 Make SfxItemSet ranges correct by construction
This is a follow-up to 45a7f5b62d "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-06-16 17:28:41 +02:00
Noel Grandin
a6aa57ff59 use ERRCODE_NONE instead of 0
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>
2017-06-14 15:42:31 +02:00
Stephan Bergmann
a109a9ef74 Use unique_ptr for ImpEditEngine::pEmptyItemSet
Change-Id: I1d7757eafb52fc3cc7d7e1cb02cced0a6004a304
2017-06-13 11:20:36 +02:00
Stephan Bergmann
5389b44827 Let SfxSetItem ctor take SfxItemSet by unique_ptr
Change-Id: I219dd03477862169cd50eecc14822f6a023f879a
2017-06-13 10:46:16 +02:00
Jochen Nitschke
febbad7263 cleanup unused css/frame/* includes
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>
2017-06-12 13:05:38 +02:00
Noel Grandin
e4e4d5713e clang-tidy readability-delete-null-pointer
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>
2017-06-12 08:43:48 +02:00
Varun Dhall
65f98346c2 EditEngine Creating SvXMLImportContext for ODF
Change-Id: I4083658db6068122b423fe5ec7a568fa222b4e80
Reviewed-on: https://gerrit.libreoffice.org/38358
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-07 14:50:04 +02:00
Varun Dhall
fec801d6d9 EditEngine Renamed InsertText to PasteText
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>
2017-06-07 14:49:43 +02:00
Varun Dhall
b863b1cb9c EditEngine Implementing Paste for XML from clipboard
Change-Id: Ia820a29bec8a6b102fb78cf325577b731a12c3c4
Reviewed-on: https://gerrit.libreoffice.org/38282
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-07 14:49:19 +02:00
Varun Dhall
0703af9e78 Exporting EditEngine document into a buffer with ODF Filter
Change-Id: Ib0304de5d873ac833dcc121235b8de494a1bb3bf
Reviewed-on: https://gerrit.libreoffice.org/37999
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-06-07 14:48:28 +02:00
Varun Dhall
223a04e77f EditEngine Exporting flat XML from actual clipboard
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>
2017-06-07 14:40:08 +02:00
Caolán McNamara
d0069e5189 add COVERITY_NOEXCEPT_FALSE
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>
2017-06-06 14:15:43 +02:00
Noel Grandin
de8caac6be replace SVSTREAM_OK with ERRCODE_NONE
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>
2017-06-06 08:15:57 +02:00
Stephan Bergmann
256dfb9e78 Improved loplugin:cstylecast to reference types: editeng
Change-Id: I0a9321baf91ea0b460f4d1b6a638278275b184d3
2017-06-05 21:18:11 +02:00
Noel Grandin
17a2c9e8e2 clang-tidy performance-unnecessary-value-param
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>
2017-06-05 09:22:51 +02:00
Jochen Nitschke
453ce05c39 tdf#108324 fix crash: paste from textframe
rAttr references *pC->maCharAttribs[nAttr].get() and assignment of
a unique_ptr is essentially a reset, invalidating the reference.

regression of commit	dd891ec422
	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>
2017-06-04 12:47:55 +02:00
Stephan Bergmann
9b80567859 Improved loplugin:redundantcast static_cast handling: editeng
Change-Id: Ia7541038df7c9eca00f99d70e5a1fc817028f686
2017-06-02 09:37:35 +02:00
Noel Grandin
0265bdb92e convert GRFILTER constants to ERRCODE_GRFILTER_
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>
2017-06-02 09:00:13 +02:00
Noel Grandin
307be8c9ce clang-tidy readability-redundant-control-flow
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>
2017-05-31 08:33:40 +02:00
Varun Dhall
5ae5fb482f EditEngine Refactoring hand-coded XInterface implementations of EditDataObject
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>
2017-05-30 11:19:58 +02:00
Noel Grandin
2ccde70d60 teach redundantcast plugin about functional casts
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>
2017-05-30 08:50:31 +02:00
Noel Grandin
ef513fd4b0 remove unnecessary use of OString::getStr
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>
2017-05-28 19:44:08 +02:00
Jochen Nitschke
2e0444d316 cleanup unused css/linguistic2/ includes
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>
2017-05-28 17:27:45 +02:00
Noel Grandin
4a340e36e8 loplugin:constantparam
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>
2017-05-25 08:12:17 +02:00
Johnny_M
f46e8802c2 Translate German comments and debug strings (leftovers in e... dirs)
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>
2017-05-20 13:48:39 +02:00
Markus Mohrhard
25e8148a1b no need for std::unique_ptr::reset in destructor
Change-Id: Id8628ae1e1d17dedf1c06d6a3d44d8be40be4cef
2017-05-20 10:02:56 +02:00
Julien Nabet
417f65de89 convert to use std::unique_ptr
Change-Id: I37f8469fa4f41ac052d811ef56ad4bddfac6a7d1
Reviewed-on: https://gerrit.libreoffice.org/37848
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-05-20 09:58:43 +02:00
Stephan Bergmann
c556c65d71 loplugin:stringcopy: editeng
Change-Id: I3d5b7673b2403bf670d85fa3c65f67aefcea48ff
2017-05-19 17:18:20 +02:00
Julien Nabet
ba9b44270b fix gdi resource leak (editeng/impedit)
Change-Id: Ia2d9ad88b5bcc2adf7f28ac7833132c04045d55b
Reviewed-on: https://gerrit.libreoffice.org/37790
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Jenkins <ci@libreoffice.org>
2017-05-19 08:45:36 +02:00
Julien Nabet
6bde2e93a2 tdf#107176: just return initial selection when there's no range
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>
2017-05-18 20:32:34 +02:00
Noel Grandin
4c05834a36 loplugin:unusedmethods
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>
2017-05-18 09:17:43 +02:00