28 Commits

Author SHA1 Message Date
Tomaž Vajngerl
bf5f6df9e4 vcl: separate ImplImageTree - ImageTree singleton and public iface
ImplImageTree was used outside of VCL which is not consistent with
the name and the header also contains a lot of implementation
detail. This separates the implementation to ImplImageTree and
the public interface and singleton to ImageTree only.

Change-Id: I3a26444f0f6971a6b1d83472e9cef19c93192d3e
Reviewed-on: https://gerrit.libreoffice.org/32134
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-12-19 07:26:24 +00:00
Tor Lillqvist
2da2cfcb19 Whitelist aLogger, in FormulaLogger& FormulaLogger::get()
To avoid this:

sc/source/core/tool/formulalogger.cxx:55:26: error: bad static variable causes crash on shutdown [loplugin:badstatics]
    static FormulaLogger aLogger;
    ~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sc/inc/formulalogger.hxx:42:31: note: ... due to this member of 'FormulaLogger' [loplugin:badstatics]
    const ScFormulaCellGroup* mpLastGroup = nullptr;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
sc/inc/formulacell.hxx:66:20: note: ... due to this member of 'ScFormulaCellGroup' [loplugin:badstatics]
    ScFormulaCell *mpTopCell;
    ~~~~~~~~~~~~~~~^~~~~~~~~
sc/inc/formulacell.hxx:114:21: note: ... due to this member of 'ScFormulaCell' [loplugin:badstatics]
    ScDocument*     pDocument;
    ~~~~~~~~~~~~~~~~^~~~~~~~~
sc/inc/document.hxx:312:27: note: ... due to this member of 'ScDocument' [loplugin:badstatics]
    VclPtr<SfxPrinter>    pPrinter;
    ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

Change-Id: I533e45f655ca928a801188aa48ee818d89a962ac
2016-12-12 15:52:53 +02:00
Stephan Bergmann
995318e299 loplugin:badstatics: reliably look into std container types
Change-Id: Ifca7325533e3f7d5ce5c59cc6b14d4232d4fc792
Reviewed-on: https://gerrit.libreoffice.org/29614
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-09 07:40:55 +00:00
Stephan Bergmann
160478912a loplugin:badstatics
ScAddInListener has a member

  ScAddInDocs* pDocs; // documents where this is used

where ScAddInDocs is set<ScDocument*>, and ScDocument has a memmber

  VclPtr<SfxPrinter>    pPrinter;

so that's only a chain of (apparently non-owning) pointers.

Change-Id: I050218320eb2c588dcfaee80225f4e45a515ed32
Reviewed-on: https://gerrit.libreoffice.org/29613
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-09 07:40:09 +00:00
Miklos Vajna
389d4d4142 sfx2: introduce SfxViewShell::GetViewShellId()
This is quite similar to SwFrame::GetFrameId(), i.e. it assigns a
numeric identifier to each instance to help debugging, as those
identifiers are stable accross runs.

Change-Id: I9cc57e316435f0284a1d481a956a703be859d67e
Reviewed-on: https://gerrit.libreoffice.org/27669
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-29 11:39:22 +00:00
Stephan Bergmann
45129b0a20 loplugin:badstatics: new static only found with libc++
Change-Id: I93f12629fe6aa4bddae7379a5a7ac4f4c42c7923
2016-06-30 21:14:45 +02:00
Stephan Bergmann
2ea01fb900 loplugin:badstatics: further (Linux-only) static only found with libc++
Change-Id: I048212e3feb3f548d5a65940dd71ccb71cade778
2016-06-30 12:53:40 +02:00
Stephan Bergmann
ded8e74df2 loplugin:badstatics: whitelist some more statics
...which use std containers and are only found at all with the libc++ container
implementations, not the libstdc++ ones.

Change-Id: Ic9af06139823befad4af1a9a825cba10c115aceb
2016-06-29 21:51:35 +02:00
Stephan Bergmann
0d3738a258 More Clang 3.4 "(anonymous namespace)" fixes
Change-Id: I7cb43f915565dadd611b90ee30373e472f97efb5
Reviewed-on: https://gerrit.libreoffice.org/26748
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-06-28 20:33:58 +00:00
Stephan Bergmann
85825e0fd5 Avoid reserved identifiers
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-22 10:08:07 +02:00
Noel Grandin
67d333c608 tdf#99352 - Some VclPtrs leak past DeInitVCL
Change-Id: I74b27b1d8b662a644df580ae128643b8495355f8
Reviewed-on: https://gerrit.libreoffice.org/24204
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 10:51:54 +00:00
Noel Grandin
4ff087565b update badstatics plugin to look for VclPtr<> statics
maybe we should create a "StaticVclPtr<>" class that checks if VCL is
still "alive" before destructing the object?

Change-Id: If8619f689c29294efa19c37ec782fa07acec728d
Reviewed-on: https://gerrit.libreoffice.org/24085
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2016-04-15 12:09:05 +00:00
Michael Stahl
f3f305b6a5 compilerplugins: rejoice, for pStaticThesSubMenu is dead
Change-Id: I6c7f250af4c1f09feb836aef3c468d97e8266e4b
2016-01-25 12:31:39 +01:00
Stephan Bergmann
bb24492c76 More loplugin::TypeCheck use
Change-Id: I2f4a26a918134568f541cd45bdcf5a12b1f1d2ee
2015-12-08 22:56:02 +01:00
Miklos Vajna
16677bbdb8 compilerplugins: adapt comment
...after 49c2b9808df8a6b197dec666dfc0cda6321a4306
"bin/rename-sw-abbreviations.sh"

Change-Id: Ibd74246403bead8100d181b335f9145013f31e5e
2015-11-26 10:18:52 +01:00
Stephan Bergmann
8830956414 Adapt whitelisted names
...after 49c2b9808df8a6b197dec666dfc0cda6321a4306
"bin/rename-sw-abbreviations.sh"

Change-Id: I90cec551bdc52ea4d76dd9e32b45692e8a3be70f
2015-11-26 09:58:15 +01:00
Michael Stahl
526bfba0a0 vcl, sd: rename some overly generic static variables
Change-Id: I89159df36361f9ceff3401ef379c8230465617b7
2015-11-17 23:49:50 +01:00
Stephan Bergmann
6e6c095187 Fix check for std::weak_ptr (that may be in an inline namespace)
Change-Id: I048aef08df43d07544aafc69b711d258dc40bc21
2015-11-17 21:50:45 +01:00
Stephan Bergmann
27b45cc23c Work around loplguins:badstatics
Change-Id: I597dbc3e4288acb5b71f7a344ae78ba568451614
2015-11-17 21:31:46 +01:00
Stephan Bergmann
60c51ac007 Work around loplguins:badstatics
Change-Id: I9d8d0f6cc001de09d8d3f96d8ad7e243e07f426d
2015-11-17 19:38:41 +01:00
Stephan Bergmann
b0526e291d Work around loplguins:badstatics
Change-Id: I243dcb86cc1a99550b26962daf47c19eb62aa8df
2015-11-17 16:41:40 +01:00
Stephan Bergmann
b45aef86fa Improve comment
Change-Id: I25931d59fc1b4feb1fd1eaa036a64a28a269f409
2015-11-17 16:28:33 +01:00
Stephan Bergmann
097f8d6dbc Work around loplugin:badstatics
...about

  static ImplImageTree instance;

in ImplImageTree::get (vcl/source/gdi/impimagetree.cxx) due to

  StyleIconSet ImplImageTree::maIconSet;

(of type std::unordered_map<OUString, IconSet, OUStringHash>) due to

  IconCache ImplImageTree::IconSet::maIconCache;

(of type std::unordered_map<OUString, std::pair<bool, BitmapEx>, OUStringHash>),
reported at least when building against Mac libc++.  This is a false positive,
as ImplImageTree::shutDown cleans this up.

Change-Id: Idb1a99aa33f71286e57b31b7adb833e3ee8b5f5a
2015-11-17 16:21:51 +01:00
Stephan Bergmann
530bc021eb Improve loplugin:badstatics diagnostic output
Change-Id: Ia2f088a79b03ff866429e1cae73edccd36a01b4f
2015-11-17 15:05:34 +01:00
Stephan Bergmann
8312d2816a Use a DiagnosticsEngine::Note
...a Remark prints the whole stack of includes leading up to the source

Change-Id: I41e5bd2855b4a55b54e63432703f2e65b4c44249
2015-11-17 14:27:05 +01:00
Michael Stahl
2ee802245e compilerplugins: enhance badstatics plugin to follow pointers
.... and references. This gives numerous false positives as pointers may
be re-set prior to shutdown, so needs a white-list.

Change-Id: I19a011c6f19501cc31b3d9ae76b599296f132478
Reviewed-on: https://gerrit.libreoffice.org/19949
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-11-17 09:19:24 +00:00
Michael Stahl
10afa00c8c compilerplugins: enhance "badstatics" plugin to find members
Finds static variables of types that have bad non-static members.

Change-Id: I81ee940580c0f043feb543840ea4d3dd27734202
2015-11-06 20:37:38 +01:00
Michael Stahl
bf18f1b353 compilerplugins: add "badstatics" to detect abuse of VCL Bitmaps
VCL Image/Bitmap/BitmapEx instances must not have static life-time
because then they will be destructed after DeInitVCL() and that
likely segfaults.

Change-Id: I3ff8d32de729c971b190028094cb4efe206395e2
2015-11-02 16:39:19 +01:00