Keep LibreOfficeKit.hxx compatible with C++03
Change-Id: Ic2f123c9b341dbb421b766c3bba1fc56c1bfb41d
This commit is contained in:
@@ -42,6 +42,8 @@ public:
|
||||
bool VisitImplicitCastExpr(CastExpr const * expr);
|
||||
|
||||
private:
|
||||
bool isInLokIncludeFile(SourceLocation spellingLocation) const;
|
||||
|
||||
bool isFromCIncludeFile(SourceLocation spellingLocation) const;
|
||||
|
||||
bool isMacroBodyExpansion(SourceLocation location) const;
|
||||
@@ -134,6 +136,8 @@ bool Nullptr::VisitImplicitCastExpr(CastExpr const * expr) {
|
||||
((!compiler.getLangOpts().CPlusPlus
|
||||
|| isInUnoIncludeFile(
|
||||
compiler.getSourceManager().getSpellingLoc(loc))
|
||||
|| isInLokIncludeFile(
|
||||
compiler.getSourceManager().getSpellingLoc(loc))
|
||||
|| isFromCIncludeFile(
|
||||
compiler.getSourceManager().getSpellingLoc(loc)))
|
||||
? "NULL" : "nullptr"));
|
||||
@@ -143,6 +147,11 @@ bool Nullptr::VisitImplicitCastExpr(CastExpr const * expr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Nullptr::isInLokIncludeFile(SourceLocation spellingLocation) const {
|
||||
return compiler.getSourceManager().getFilename(spellingLocation)
|
||||
.startswith(SRCDIR "/include/LibreOfficeKit/");
|
||||
}
|
||||
|
||||
bool Nullptr::isFromCIncludeFile(SourceLocation spellingLocation) const {
|
||||
return !compat::isInMainFile(compiler.getSourceManager(), spellingLocation)
|
||||
&& (StringRef(
|
||||
|
Reference in New Issue
Block a user