summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/unnecessaryoverride.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-05-18 09:56:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-05-18 09:56:01 +0200
commitdf8d092c3a3c65bc23bc3c1da281cc4cb10a1e3d (patch)
treeea5daefc9c1665ab14aeeedc0de4298c7c85a8b1 /compilerplugins/clang/unnecessaryoverride.cxx
parent33cbc99fea5a3e4b87e883fd60ec97d4503109f3 (diff)
Adapt pathname checks to mixed usage of \ and / on Windows
Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5
Diffstat (limited to 'compilerplugins/clang/unnecessaryoverride.cxx')
-rw-r--r--compilerplugins/clang/unnecessaryoverride.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx
index 5102faab7a78..98b51a03a18b 100644
--- a/compilerplugins/clang/unnecessaryoverride.cxx
+++ b/compilerplugins/clang/unnecessaryoverride.cxx
@@ -34,24 +34,24 @@ public:
// ignore some files with problematic macros
StringRef fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() );
- if (fn == SRCDIR "/sd/source/ui/framework/factories/ChildWindowPane.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/sd/source/ui/framework/factories/ChildWindowPane.cxx"))
return;
- if (fn == SRCDIR "/forms/source/component/Date.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/forms/source/component/Date.cxx"))
return;
- if (fn == SRCDIR "/forms/source/component/Time.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/forms/source/component/Time.cxx"))
return;
- if (fn == SRCDIR "/svx/source/dialog/hyperdlg.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/svx/source/dialog/hyperdlg.cxx"))
return;
- if (fn == SRCDIR "/svx/source/dialog/rubydialog.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/svx/source/dialog/rubydialog.cxx"))
return;
- if (fn.startswith(SRCDIR "/canvas"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/canvas"))
return;
- if (fn == SRCDIR "/sc/source/ui/view/spelldialog.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/sc/source/ui/view/spelldialog.cxx"))
return;
- if (fn == SRCDIR "/sd/source/ui/dlg/SpellDialogChildWindow.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/sd/source/ui/dlg/SpellDialogChildWindow.cxx"))
return;
// HAVE_ODBC_ADMINISTRATION
- if (fn == SRCDIR "/dbaccess/source/ui/dlg/dsselect.cxx")
+ if (loplugin::isSamePathname(fn, SRCDIR "/dbaccess/source/ui/dlg/dsselect.cxx"))
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
@@ -84,7 +84,7 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
&& !isInUnoIncludeFile(methodDecl))
{
// the code is this method is only __compiled__ if OSL_DEBUG_LEVEL > 1
- if (aFileName == SRCDIR "/tools/source/stream/strmunx.cxx")
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/tools/source/stream/strmunx.cxx"))
return true;
// Warn about unnecessarily user-declared destructors.
@@ -206,16 +206,16 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
}
}
// sometimes the disambiguation happens in a base class
- if (aFileName == SRCDIR "/comphelper/source/property/propertycontainer.cxx")
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/comphelper/source/property/propertycontainer.cxx"))
return true;
// not sure what is happening here
- if (aFileName == SRCDIR "/extensions/source/bibliography/datman.cxx")
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/extensions/source/bibliography/datman.cxx"))
return true;
// some very creative method hiding going on here
- if (aFileName == SRCDIR "/svx/source/dialog/checklbx.cxx")
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/svx/source/dialog/checklbx.cxx"))
return true;
// entertaining template magic
- if (aFileName == SRCDIR "/sc/source/ui/vba/vbaformatcondition.cxx")
+ if (loplugin::isSamePathname(aFileName, SRCDIR "/sc/source/ui/vba/vbaformatcondition.cxx"))
return true;
// not sure what is going on here, but removing the override causes a crash
if (methodDecl->getQualifiedNameAsString() == "SwXTextDocument::queryAdapter")