Commit Graph

1137 Commits

Author SHA1 Message Date
ad9498f8b8 More -Werror,-Wunused-private-field
...detected with a modified trunk Clang with

> Index: lib/Sema/SemaDeclCXX.cpp
> ===================================================================
> --- lib/Sema/SemaDeclCXX.cpp	(revision 219190)
> +++ lib/Sema/SemaDeclCXX.cpp	(working copy)
> @@ -1917,9 +1917,10 @@
>    const Type *T = FD.getType()->getBaseElementTypeUnsafe();
>    // FIXME: Destruction of ObjC lifetime types has side-effects.
>    if (const CXXRecordDecl *RD = T->getAsCXXRecordDecl())
> -    return !RD->isCompleteDefinition() ||
> -           !RD->hasTrivialDefaultConstructor() ||
> -           !RD->hasTrivialDestructor();
> +    return !RD->hasAttr<WarnUnusedAttr>() &&
> +           (!RD->isCompleteDefinition() ||
> +            !RD->hasTrivialDefaultConstructor() ||
> +            !RD->hasTrivialDestructor());
>    return false;
>  }
>
> @@ -3517,9 +3518,11 @@
>    bool addFieldInitializer(CXXCtorInitializer *Init) {
>      AllToInit.push_back(Init);
>
> +#if 0
>      // Check whether this initializer makes the field "used".
>      if (Init->getInit()->HasSideEffects(S.Context))
>        S.UnusedPrivateFields.remove(Init->getAnyMember());
> +#endif
>
>      return false;
>    }

to warn about members of SAL_WARN_UNUSED-annotated class types, and warn about
initializations with side effects (cf.
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039602.html>
"-Wunused-private-field distracted by side effects").

Change-Id: I3f3181c4eb8180ca28e1fa3dffc9dbe1002c6628
2014-10-15 15:58:56 +02:00
58ff30d1a1 convert to floating point before divide
Change-Id: I0328ca6594b3809210ea124dcb744bad3b5eb92e
2014-10-06 14:08:58 +01:00
51183d5ab6 coverity#1242725 Result is not floating-point
Change-Id: I007ef5efa07f9124a08e049bca01aac87acfa48e
2014-10-04 09:36:27 -05:00
3b59dbbffd remove HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE check and macro
This is supported in GCC 4.6.0 already:
https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Diagnostic-Pragmas.html

Change-Id: I2f67e588eea3a323a2e9c81e39e56ab2e715a817
2014-10-02 20:00:18 +02:00
6b929c75be coverity#1242882 Result is not floating-point
Change-Id: I5072c29188e33b5711e67188441c497bf8759891
2014-10-02 14:48:53 +01:00
d541a89c4e coverity#982849 try and fix Unrecoverable parse warning
Change-Id: Iba0f175c7c079f2171bab6e5a7419c7d5966c541
2014-09-26 09:54:53 +01:00
ed0d0e8486 what is it with the explicit voids
Change-Id: I7d3995f16351cb1686003f2ba7a044ac99d6d10b
2014-09-26 09:50:40 +01:00
60e78fbb80 fdo#82577: Handle Font
Put the VCL Font class in the vcl namespace. Avoids clash with the X11
Font typedef.

Change-Id: I1a84f7cad8b31697b9860a3418f7dff794ff6537
2014-09-18 08:54:37 +02:00
5d06760664 sdext: check the copy on the stack, not the member
Change-Id: Id8aaccf5fa31ad670215db61853bb729302b1fec
2014-09-08 21:26:05 +02:00
9c6e517a77 Related fdo#82088: dropping aliases again :)
Change-Id: I41f6472423b60e3699ed6158cc5eccb10de1538d
Reviewed-on: https://gerrit.libreoffice.org/11295
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-09-06 15:55:08 -05:00
72f4f0e9e7 Resolves: fdo#83137 NULL pAction
Change-Id: I74c4e32aae1e3aa74d197f132c900627062b6d01
2014-08-27 15:43:58 +01:00
57a4337e25 set names on a bunch more threads...
Change-Id: I4c2f2f0bcce52839033876ec991529721e06a3c8
2014-08-25 13:21:59 +02:00
30541352a1 fix string out-of-bounds assert on rhbz496762-1.pdf
Change-Id: I224e3c9befd1a9ab3ba0cc2676cd6b4ba51214c8
2014-08-20 09:49:46 +01:00
5932906656 fdo#75757: remove inheritance to std::vector
... for PaneStyleContainer and ViewStyleContainer.

Change-Id: I6a6e2b1733266f54a94a49ab491cf854eb5df492
Reviewed-on: https://gerrit.libreoffice.org/10847
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-08-09 15:25:08 +00:00
787ed0a267 avoid memory leak
Change-Id: I9ac97c4e5c7b01b5e05cb1132c0d245f5843799e
2014-08-01 10:21:31 +02:00
e644bb59ff fix parsing of cmdline args
Change-Id: I4005c08d4163d5d26f227e01c2520379f717343a
2014-08-01 10:21:31 +02:00
4aece3e69d Does not look like Library_pdfimport needs poppler
Change-Id: I1dd162f939ce4f0689ea14724c1e7cec8a6c16b0
2014-07-03 18:12:30 +02:00
4a32ef9c3f Improve test code
(never call CPPUNIT_ASSERT etc., which work by throwing exceptions, from a dtor)

Change-Id: I293d54eb40c2ad9205d485ccff0ffd2161257142
2014-07-03 13:11:58 +02:00
44565f46b2 Check exit code of spawned xpdfimport
Change-Id: I4bea1ebe5c9915ad5e3a4f8fecb516bc056d060d
2014-07-03 13:11:58 +02:00
f8018266cc Remove double assignment
The semantic match that finds this problem is follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression i,f;
position p1,p2;
@@
(
(<+...i++...+>) = ...;
|
(<+...++i...+>) = ...;
|
(<+...i--...+>) = ...;
|
(<+...--i...+>) = ...;
|
i = <+...f(...)...+>;
|
i@p1 = ...;
(
i = <+...i...+>;
|
i = <+...f(...)...+>;
|
i@p2 = ...;
)
)

@@
expression i;
position r.p1,r.p2;
@@

* i@p1 = ...;
i@p2 = ...;
// </smpl>

Change-Id: Ifacb878d58486f2645560592484ce24b2bc0bd6f
Reviewed-on: https://gerrit.libreoffice.org/9968
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-06-30 07:06:29 +00:00
e48a233960 loplugin:unreffun: also warn about redundant redeclarations
Change-Id: I9a812220b58cf6da00d854e65794f7c673ab239d
2014-06-27 15:27:39 +02:00
0c7c8aa5f6 prevent invalid memory access
e.g. fdo26139-1.pdf

Change-Id: Ic5854e2056c246d48e2962dfe0a91f67c2c30c04
2014-06-21 04:21:39 +02:00
1d241f445a loplugin:staticcall
Change-Id: Iacd3efa9e5d6103ad92e15884e8aa010d7b2ae93
2014-06-13 17:54:31 +02:00
184a00b962 loplugin: inlinesimplememberfunctions
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-09 10:10:13 +02:00
c2034f3993 fixincludeguards: fix include guards
Change-Id: Ie6e8d4272b0b1d0d2ce93bcbc2e818a9eac1a56b
Reviewed-on: https://gerrit.libreoffice.org/9629
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-06-06 19:16:40 +00:00
e9ae2b07c2 sdext: remove SAL_THROW macro
Change-Id: Ib8649fb4d5aa2249d99d5c9d9ecf9d2307a93c72
2014-06-05 08:17:51 +02:00
b312a38797 update_pch: add a bunch of pch files
desktop:    1m51s ->   54s
 framework:  1m55s -> 1m04s
 package:      32s ->   16s
 sdext:      1m31s ->   47s
 svgio:        32s ->   15s
 uui:          49s ->   20s
 vbahelper:  1m44s ->   27s
 xmlscript:    15s ->   10s
 xmlsecurity:  45s ->   23s

Change-Id: Ia437969c091bf877983ababc5ea2d044bbc0bee0
2014-06-04 21:18:37 +02:00
079e57658b coverity#982645 bMissingDefaultsToNormal is always true
Change-Id: Ica58be0b5512eb8f386e51ec6e84d0ec09c3027f
2014-06-04 12:36:06 +01:00
369d95931f DeInitVCL at end of tests
This required some changes to the framework:

* Init-/DeInitVCL is no longer done per individual test in BootstrapFixture, but
  once per CppunitTest invocation in a new vclbootstrapprotector (similarly to
  the exisiting unobootstrapprotector).  CppunitTests that need VCL now need to
  declare gb_CppunitTest_use_vcl.

* For things to work properly, the UNO component context needs to be disposed
  from within DeInitVCL (cf. Desktop's Application::DeInit called from
  DeInitVCL).  The easiest solution was to introduce an
  Application::setDeInitHook (where the hook is called from DeInitVCL)
  specifically for vclbootstrapprotector to call.

* PythonTests don't (yet) call DeInitVCL; they still hook into
  BootstrapFixture's original test_init functionality (to call InitVCL), and do
  not make use of the vclbootstrapprotector.

Change-Id: I4f3a3c75db30b58c1cd49d81c51db14902ed68b2
2014-06-04 08:55:12 +02:00
7e4a51ee50 Use boost::hash_value to avoid undef conv of neg/large floating -> size_t
Change-Id: I85853ffc6083d46c02c08f14d5d3321803c31301
2014-06-02 14:46:04 +02:00
ebc0a15515 remove more unnecesary OUString constructor use
when throwing exceptions

Change-Id: I6edfb6b6745499f802b0e3c0e096a36fb7c32aac
2014-05-29 09:01:40 +02:00
f0ae48b684 remove unnecessary NULL parameter passed to UNO Exception
.. now that we have a default value for that parameter

Change-Id: I54d6b0a0a01ce2f2e5168ada0c427424de0477bc
2014-05-29 09:01:40 +02:00
9af0abebfd remove unnecessary use of Reference constructor in throw
Convert code like this:
  throw IOException("xx",
     Reference< XInterface >(static_cast<OWeakObject*>(this)) );
to this:
  throw IOException("xx",
     static_cast<OWeakObject*>(this) );

Change-Id: Ife9f645f0f1810a8e80219126193015502c43dbb
2014-05-27 08:20:11 +02:00
3b24dcc8a8 Remove unnecessary semicolons
A simplified version of the semantic match that finds this problem is
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
    cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Change-Id: Ib9708d37fbb4c6060f88d5dae3814a2d37b2091e
Reviewed-on: https://gerrit.libreoffice.org/9493
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:19:00 -05:00
31ded17441 coverity#983807 Uncaught exception
Change-Id: Ic303dae356690db009b5917168b77da2f2d8d433
2014-05-24 16:10:59 +01:00
ac76cc7e60 Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part20
Change-Id: If87cdfb2c605254f6d69baa4ca5aec09091caa68
2014-05-23 22:11:52 +02:00
a130817f7d Correct linker library sequence for pdfimport
Otherwise I get a lot of missing fontconfig symbols.

Change-Id: I9bc3e395d54380a36cd6dd73cf95b7f4e4cab54e
2014-05-20 19:59:49 +02:00
a092418f30 we need fontconfig now
Change-Id: I0482f613d7c908488e7d9f84f891bd521e91cc15
2014-05-20 13:19:56 +01:00
be7ec1384e fdo#78689 PDF Import: get font's ascent value from different source
Change-Id: I19018d25ef53bbea225bb5a9ef806ce5c1b4adc7
Reviewed-on: https://gerrit.libreoffice.org/9410
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-05-20 06:55:32 -05:00
0ff4909a55 coverity#984442 Use after free
Change-Id: I28822f6b74cbf8ace8f7a194248840cb401679be
2014-05-16 16:42:52 +01:00
a050856a67 fdo#78549 PDF Import: fix incorrect transformation matrix writing
Change-Id: I60d77e01ea7774c234d1ad1b81b90a7db3461e22
Reviewed-on: https://gerrit.libreoffice.org/9310
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-05-15 11:48:33 +00:00
7249ba6877 remove external header guards
that's the problem with those: none of them was actually defined...

Change-Id: I496140e43cf8ff8a5712394023d98516aaf21adc
2014-05-14 18:12:57 +02:00
b81ec527f0 use our css prefix to make this readable
Change-Id: I360832edafcfcff7e63fd3b185c2575165c2d728
2014-05-14 18:03:20 +02:00
b2096deaff various loplugin:passsequencebyref
Change-Id: Id1045a7f66b4fa10b6491587ba07246a31ceba72
2014-05-14 16:54:27 +02:00
ffa2229a8e remove dead code
Change-Id: Ic4fb478921714429af138ca212bd7f67f408d434
2014-05-13 12:00:27 +02:00
e0bde4c53b fdo#78427 PDF Import: Improve detection of bold italic font
(Bug #78427 is fixed only partially by this commit)

Change-Id: I080dca98a77a645c4c5ae19a9bbcae7d54179d3c
Reviewed-on: https://gerrit.libreoffice.org/9276
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-05-08 09:04:12 +00:00
d7fc306cd7 fdo#78382 PDF Import: add opacity support for fill and stroke
Change-Id: I76375280ee4726c1d497858165f38f4e8b4224cb
Reviewed-on: https://gerrit.libreoffice.org/9268
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-05-07 12:35:48 +00:00
0ece50a4ce fix build problem
Change-Id: Ia6a54d86d4f283c7220a88b6bc68f0fb47ed3014
2014-05-06 16:12:40 +01:00
b27fca822c fdo#78241 PDF Import: add dashes support
Change-Id: Ifd9fbce44c7d18114d5be466bfb9d92192573205
Reviewed-on: https://gerrit.libreoffice.org/9246
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-05-06 15:07:59 +00:00
4f9b21248f simplify ternary conditions "xxx ? yyy : false"
Look for code like:
   xxx ? yyy : false;
Which can be simplified to:
   xxx && yyy

Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
2014-05-05 12:47:48 +02:00