From df8d092c3a3c65bc23bc3c1da281cc4cb10a1e3d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 18 May 2017 09:56:01 +0200 Subject: Adapt pathname checks to mixed usage of \ and / on Windows Change-Id: I91bc89a9076c6642e06b238f65f2d31a1d20c6b5 --- compilerplugins/clang/useuniqueptr.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'compilerplugins/clang/useuniqueptr.cxx') diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx index 24f6007ca2af..59d1a3f3ec68 100644 --- a/compilerplugins/clang/useuniqueptr.cxx +++ b/compilerplugins/clang/useuniqueptr.cxx @@ -92,31 +92,31 @@ bool UseUniquePtr::VisitCXXDestructorDecl(const CXXDestructorDecl* destructorDec return true; // to ignore things like the CPPUNIT macros StringRef aFileName = compiler.getSourceManager().getFilename(compiler.getSourceManager().getSpellingLoc(pFieldDecl->getLocStart())); - if (aFileName.startswith(WORKDIR)) + if (loplugin::hasPathnamePrefix(aFileName, WORKDIR)) return true; // passes and stores pointers to member fields - if (aFileName.startswith(SRCDIR "/sot/source/sdstor/stgdir.hxx")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sot/source/sdstor/stgdir.hxx")) return true; // something platform-specific - if (aFileName.startswith(SRCDIR "/hwpfilter/source/htags.h")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/hwpfilter/source/htags.h")) return true; // @TODO there is clearly a bug in the ownership here, the operator= method cannot be right - if (aFileName.startswith(SRCDIR "/include/formula/formdata.hxx")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/formula/formdata.hxx")) return true; // passes pointers to member fields - if (aFileName.startswith(SRCDIR "/sd/inc/sdpptwrp.hxx")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sd/inc/sdpptwrp.hxx")) return true; // @TODO there is clearly a bug in the ownership here, the ScJumpMatrixToken copy constructor cannot be right - if (aFileName.startswith(SRCDIR "/sc/inc/token.hxx")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sc/inc/token.hxx")) return true; // @TODO intrusive linked-lists here, with some trickiness - if (aFileName.startswith(SRCDIR "/sw/source/filter/html/parcss1.hxx")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sw/source/filter/html/parcss1.hxx")) return true; // @TODO SwDoc has some weird ref-counting going on - if (aFileName.startswith(SRCDIR "/sw/inc/shellio.hxx")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sw/inc/shellio.hxx")) return true; // @TODO it's sharing pointers with another class - if (aFileName.startswith(SRCDIR "/sc/inc/formulacell.hxx")) + if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/sc/inc/formulacell.hxx")) return true; report( -- cgit