Commit Graph

2092 Commits

Author SHA1 Message Date
Noel Grandin
5abc669599 new plugin stylepolice
check for local variables which follow our member field naming
convention, which is highly confusing

Change-Id: Idacedf7145d09843e96a584237b385f7662eea10
2016-04-21 08:32:47 +02:00
Stephan Bergmann
9ad66e5ae9 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: I626b79e1450d78aec96c206db82bf64a47305d08
2016-04-20 17:25:39 +02:00
Stephan Bergmann
6b7594a84e Use IsRightToLeft()
...instead of computing this from GetRightToLeftLevel()

Change-Id: If0068c8aae581b6f097ba3897b4a3031db8d9afd
2016-04-20 07:56:54 +02:00
Stephan Bergmann
5be5f00fe1 So this is apparently about right-to-left levels, not a boolean flag
Although the cases where GetRightToLeftLevel() is contextually converted to bool
look fishy, and might have been intended to use IsRightToLeft() instead?

Change-Id: I741b90cb6f1ccdac0886c451d05f4cfac79dbd5f
2016-04-19 18:23:49 +02:00
Noel Grandin
789055bc2a clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at
identifying leftover intermediate variables from previous
refactorings.

Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657
Reviewed-on: https://gerrit.libreoffice.org/24026
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:37:31 +00:00
Jochen Nitschke
150ac9cf05 clean-up: unused using declarations and includes
Searched source for using declarations.
Checked if those symbols reappear in the source file,
even in comments or dead code but not in #include statements.
If they don't reappear, remove the declaration.
Remove includes whose symbol got removed.

Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0
Reviewed-on: https://gerrit.libreoffice.org/24148
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:25:24 +00:00
Stephan Bergmann
c455fc6064 -Werror=logical-op (GCC 6)
"logical ‘and’ of mutually exclusive tests is always false"

<sberg> alg, in editeng/source/uno/unoipset.cxx:208 (wid < START && wid > END),
 is what's actually wanted to check for contained or for not contained in the
 START..END range?  You touched the code last, in
 b0c2ec72ff, 15+ years ago (although the line
 itself was already like that in the initial import,
 fd069bee7e)
<alg> sberg: sorry cannot remember - but looks correct. All values outside
 OWN_ATTR_VALUE_START/_END are answered with defaut. The renge should be the one
 from ditEngine
<sberg> alg, the code as is is clearly incorrect, as the condition is always
 false
<alg> sberg: Ah, yes! Should probably be an '||'
<sberg> alg, OK, thanks, I'll give that a "make check" try (a bit scary to thus
 enable code that had effectively been disabled since at least the turn of the
 century)
<alg> sberg: Yes - scary is the right word. Looking further, eState ==
 SfxItemState::DEFAULT should result when outside, thus pItem->QueryValue would
 be taken which *should* get the default from the pool when not in the local
 ItemSet range. In theory, the same *should* happen

Change-Id: I906361272dfe3f6af0e1ed3cb4e245ead7eabaec
2016-04-14 17:32:17 +02:00
Stephan Bergmann
1e752272d9 -Werror=logical-op (GCC 6)
"logical ‘or’ of collectively exhaustive tests is always true"; apparently a
typo in 63114e6d86 "Create SvxFieldData instance
directly from the UNO textfield object"

Change-Id: I9e504ccb5ebad5a42a8c07d7f16d7c316dd82cf1
2016-04-14 17:32:16 +02:00
Noel Grandin
27b6782f5b loplugin:passstuffbyref in editeng
Change-Id: I11deb7c73a1c160d587d74c9851ff10c875c972b
2016-04-13 13:27:52 +02:00
Jochen Nitschke
4c7ec9f112 cleanup: remove unused com/sun/star/uno includes
Sequence.h(xx), Any.h(xx) and Type.h(xx)
and remove unused using-declarations from these files.

Add a few missing includes provided by them.

Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4
Reviewed-on: https://gerrit.libreoffice.org/23805
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-12 06:38:26 +00:00
Noel Grandin
5cf725b626 clang-tidy performance-unnecessary-value-param in editeng
Change-Id: Idfebcc36c756023e491baf2c4259bd580785dd44
2016-04-11 11:38:57 +02:00
Jochen Nitschke
d84ef731d8 tdf#94306 replace boost::noncopyable ...
... in modules editeng to oox.
Replace with C++11 delete copy-constructur and
copy-assignment.
Remove boost/noncopyable.hpp includes and
one unused boost/checked_delete.hpp include in linguistic.

Change-Id: I5a38d8e5ac1b4286bdeb3858d56490a53d13fe80
Reviewed-on: https://gerrit.libreoffice.org/23928
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-11 07:22:50 +00:00
Markus Mohrhard
be829fa157 don't pool SvxFieldItem, tdf#92773
In documents with many different hyperlinks pooling them is incredibly
slow. I doubt that in most cases the hyperlinks are the same so let us
just not pool them.

Change-Id: I2387aee57ef0ab3183d9cc3486ddbf8ca2883e0b
2016-04-10 05:55:55 +02:00
Stephan Bergmann
fb411e93ae Avoid reserved identifier
Change-Id: Ia2af17bbf08cebc9e3c8f772583a61bde194328f
2016-04-06 13:06:38 +02:00
Stephan Bergmann
308eee791f Avoid reserved identifiers
Change-Id: I0505cf418688d568c0c110bc70b2552e2fb8265c
2016-04-06 12:59:10 +02:00
Stephan Bergmann
81284624d8 Avoid reserved identifier
Change-Id: I87a6afeffaf7c87c6037a416783f1f22015b2fbf
2016-04-06 12:31:15 +02:00
Stephan Bergmann
ffd919b2d0 Avoid reserved identifiers
Change-Id: I4c76a7d3f5a209578b5a7c230fbbcdea2ec47ae0
2016-04-06 12:13:25 +02:00
Stephan Bergmann
311167193b Avoid reserved identifiers
Change-Id: I2c83911433a8f89e7366d9f7711ca4879e44bae9
2016-04-06 12:07:30 +02:00
Noel Grandin
50bb5eddaa loplugin:constantparam in editeng
Change-Id: If8342112e0657014266133954269b9396085a27d
Reviewed-on: https://gerrit.libreoffice.org/23807
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-05 06:26:05 +00:00
Jochen Nitschke
f7a75a66fa cleanup: remove unused Reference.h(xx) includes
and unused using-declarations from Reference.h

Change-Id: I297a7ae6044fa329d245ecf08fd5c4cb930f5b19
Reviewed-on: https://gerrit.libreoffice.org/23735
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-02 19:01:24 +00:00
Noel Grandin
6439005484 use SAL_N_ELEMENTS more widely
found using
   git grep -n 'sizeof.*/.*sizeof.*[0]'

Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
2016-03-31 11:30:36 +02:00
Stephan Bergmann
9b1307f790 Avoid reserved identifiers
Change-Id: I759939aa74570be63f5d41814c22aad1851d65c4
Reviewed-on: https://gerrit.libreoffice.org/23587
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-29 07:11:31 +00:00
Noel Grandin
168efab3c4 loplugin:constantparam in editeng
Change-Id: I50ee4a0a3403cbed2aa8cdd6daaa951c9d0dad37
2016-03-23 11:22:33 +02:00
Noel Grandin
9391688f61 loplugin:constantfunction in editeng
Change-Id: I8f8414b4867d3248e6d836ed8037de4da41b97f1
Reviewed-on: https://gerrit.libreoffice.org/23331
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-18 06:02:18 +00:00
Noel Grandin
b47cb646ff loplugin:constantparam
Change-Id: I270e068b3c83e966e741b0a072fecce9d92d53f5
2016-03-15 08:27:25 +02:00
Caolán McNamara
c27d0a583d coverity#1355507 uninitialized scalar field
I think

commit b2fb84499e
Author: Noel Grandin <noel@peralex.com>
Date:   Mon Mar 7 14:19:22 2016 +0200

    loplugin:write only fields

wrong wrong and took out this param along with the unused nIndex
beside it

Change-Id: Idc34e03b5d59d4b0017fff456b79c807fda2535f
2016-03-10 22:14:59 +00:00
Noel Grandin
70fca3e901 loplugin:constantparam in editeng
Change-Id: I078061c502c09bccf515151d3a5bdcd1176e64fb
2016-03-10 10:09:59 +02:00
Noel Grandin
c8a93253e4 remove unused NOT_POOLABLE enum value
and simplify the resulting SfxItemInfo field down to a single bool

Change-Id: I73e24e83d39afc7660ac85872ba96bc790713cb2
Reviewed-on: https://gerrit.libreoffice.org/23058
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-09 09:46:53 +00:00
Noel Grandin
b2fb84499e loplugin:write only fields
Change-Id: Ia0fb487c5590e096659b81f76c4dc543e184c59c
2016-03-07 14:55:55 +02:00
Noel Grandin
70f87284c6 improve defaultparams loplugin
to catch calling params with defaults like "= OUSString()"

Change-Id: Iad060e318ed492c22f8be44e326174fe6d28fff9
Reviewed-on: https://gerrit.libreoffice.org/22932
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-07 05:57:17 +00:00
Noel Grandin
5f6e5cb695 loplugin:unuseddefaultparam in editeng
Change-Id: Ifd86b0f6cca5d5d30daeee1c087c0124f2f18f3c
Reviewed-on: https://gerrit.libreoffice.org/22899
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-07 05:56:43 +00:00
Caolán McNamara
22d2b498ce bIsExpanding is unused
Change-Id: I187ca7dc0e9e1a99e82145f4bcdce6abaac68278
2016-03-06 19:22:37 +00:00
Caolán McNamara
3342a557e4 coverity#1355252 Uninitialized pointer field
Change-Id: I34c5565adcfd3fd39f9b03967e5c4272767a58ea
2016-03-06 19:22:37 +00:00
Miklos Vajna
0ba96ffcd8 editeng: fix -Werror=unused-but-set-variable
Change-Id: I14364bc833c97dbb5dfe323c65282f69ba7e393f
2016-03-03 09:44:47 +01:00
Noel Grandin
b76842f63b loplugin:unuseddefaultparams in editeng
Change-Id: I1dc0ba262c06bd69cf92aae20b344fe23f460f55
2016-03-03 09:42:49 +02:00
Eike Rathke
21edff2a37 let SvxSearchItem use SearchOptions2
And all those places that interface to SvxSearchItem.

Change-Id: I08915824a596cd0f247a89f44e4684cd22b98082
2016-02-24 22:42:05 +01:00
Noel Grandin
c45d3badc9 new loplugin: commaoperator
Change-Id: I03f24e61f696b7619855e3c7010aa0d874e5a4ff
2016-02-23 08:08:56 +02:00
Miklos Vajna
7073d20627 editeng: remove never read mpLibreOfficeKitCallback
As all callback invocations happen with SdrModel's callback pointer.

Change-Id: I0111040c501b7927332f88cc4797b8ebab2bc57a
2016-02-19 08:43:02 +01:00
Miklos Vajna
9ecd31fd3f Fix SdrModel::libreOfficeKitCallback() vs ImpEditView duplication
It's better if ImpEditView doesn't have a copy of the event types which
should be ignored during searching.

Change-Id: I9044b9a6af4e3f8e5bf75973e1f975fb45ec72cf
2016-02-18 09:27:27 +01:00
David Ostrovsky
a3c70e760f Fix missing iterator include on MSVC 14.0
Change-Id: I55de612aef52038fd9979426950d4ae4131ca586
Reviewed-on: https://gerrit.libreoffice.org/22448
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Ostrovsky <david@ostrovsky.org>
2016-02-17 23:43:45 +00:00
Chris Sherlock
6858d51757 vcl: include vcl headers via triangular brackets instead of quotes
Change-Id: I311f7db622ce341527fe12a92b516f800b602f92
2016-02-13 00:29:50 +11:00
Stephan Bergmann
de907bf54d Simplify code
Change-Id: I2ac0564a5a6714111abdcff48edff070d75892b7
2016-02-10 08:04:22 +01:00
Stephan Bergmann
5a5dbb31d5 Use rtl::Reference<CppType> instead of HardCppRef<UnoType,CppType>
Change-Id: I089b5caca5e05726105f78aeb00db1869d0a17f4
2016-02-09 18:30:54 +01:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Chris Sherlock
538f276ae0 Formatting changes across all modules
+ Removed comment cruft
+ Tab formatting in number of files
+ Some commented out code removed
+ Tab characters replaced with spaces
+ Newline cleanup in quite a few files
+ Tweak header guard #endifs

Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc
Reviewed-on: https://gerrit.libreoffice.org/22221
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:11:34 +00:00
Noel Grandin
b14224fe97 loplugin:unusedmethods
using an idea from dtardon:

<dtardon> noelgrandin, hi. could you try to run the unusedmethods clang
plugin with "make build-nocheck"? that would catch functions that are
only used in tests. e.g., i just removed the whole o3tl::range class,
which has not been used in many years, but htere was a test for it...
<noelgrandin> dtardon, interesting idea! Sure, I can do that.

Change-Id: I5653953a426a2186a1e43017212d87ffce520387
Reviewed-on: https://gerrit.libreoffice.org/22041
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-08 06:08:14 +00:00
Eike Rathke
599f0cbe1d interface to new XTextSearch2 with SearchOptions2, tdf#72196
Places that had utl::TextSearch::UpgradeToSearchOptions2() introduced
are worth an inspection if the new SearchAlgorithms2::WILDCARD search
should be supported or at least use SearchOptions2 instead of
SearchOptions to eliminate the small performance penalty that conversion
involves.

Change-Id: I565f73af2b551ae9ad0f488e672823dc6c5c1109
2016-02-05 17:02:47 +01:00
Chris Sherlock
697d445ed0 vcl: take into account the font width is the average font width
I'm changing the Font class function names:

- SetSize       -> SetFontSize
- GetSize       -> GetFontSize
- SetHeight     -> SetFontHeight
- GetHeight     -> GetFontHeight
- SetWidth      -> SetAverageFontWidth
- GetWidth      -> GetAverageFontWidth

That's because it really makes no sense to say that there is a
single constant font width because obviously proportional fonts
don't have one - the best we can do is an average font width,
which is what folks like Microsoft sort of do already. On a fixed
font, the average is still accurate, for obvious reasons :-)

I'm also not a fan of GetSize/SetSize as I find it a might too
generic.

Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70
Reviewed-on: https://gerrit.libreoffice.org/22069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-04 03:17:26 +00:00
Chris Sherlock
8db902785e tdf#94269 Replace "n" prefix for bool variables with "b"
Change-Id: I8999dc2701010424ea4d2504e99ed429030d7d4e
2016-02-04 00:24:51 +11:00
Caolán McNamara
c3224db8ba Related: tdf#97375 a cut doesn't refresh the editview
but a delete does. The diff from delete to cut is the
EnterBlockNotifications/LeaveBlockNotifications calls so try that

Change-Id: I10147043d6fe358bf2f4f4bd6877210b86cbbd1f
2016-02-02 14:52:34 +00:00