convert some plugins to use the sharedplugin infrastructure

Change-Id: I690d9df436abdadc51a6d3f7df686a2e37f79f73
Reviewed-on: https://gerrit.libreoffice.org/75624
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2019-07-15 12:14:34 +02:00
parent fd55c09eba
commit fc1b213d15
16 changed files with 540 additions and 53 deletions

View File

@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef LO_CLANG_SHARED_PLUGINS
#include "plugin.hxx"
#include "check.hxx"
#include "compat.hxx"
@@ -28,6 +30,7 @@ public:
{
}
bool preRun() override;
void run() override;
bool TraverseConstructorInitializer(CXXCtorInitializer* init);
@@ -44,15 +47,23 @@ private:
CXXConstructorDecl* m_currentConstructor = nullptr;
};
void StaticConstField::run()
bool StaticConstField::preRun()
{
std::string fn = handler.getMainFileName();
loplugin::normalizeDotDotInFilePath(fn);
// unusual case where a user constructor sets a field to one value, and a copy constructor sets it to a different value
if (fn == SRCDIR "/sw/source/core/attr/hints.cxx")
return;
return false;
if (fn == SRCDIR "/oox/source/core/contexthandler2.cxx")
return false;
return true;
}
void StaticConstField::run()
{
if (!preRun())
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
@@ -168,7 +179,10 @@ bool StaticConstField::TraverseConstructorInitializer(CXXCtorInitializer* init)
return true;
}
loplugin::Plugin::Registration<StaticConstField> X("staticconstfield", true);
}
loplugin::Plugin::Registration<StaticConstField> staticconstfield("staticconstfield");
} // namespace
#endif // LO_CLANG_SHARED_PLUGINS
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */