[Libreoffice-commits] core.git: 3 commits - compilerplugins/clang sax/source sw/source
LuboÅ¡ LuÅák
l.lunak at suse.cz
Mon Jul 15 14:13:34 PDT 2013
compilerplugins/clang/plugin.cxx | 22 +++++++++++++++++-----
sax/source/fastparser/fastparser.cxx | 2 +-
sw/source/filter/html/htmlatr.cxx | 4 ++--
3 files changed, 20 insertions(+), 8 deletions(-)
New commits:
commit 8e3bf1598fa95ac8d099e45ae4252e7654a6f590
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Jul 15 21:37:53 2013 +0200
avoid unwanted silent conversion to bool
Apparently there's no overload for const sal_Unicode*, so the pointer
gets silently converted to bool, but there's one for const char*.
Change-Id: I52bc13a19111a04c6d17029f44a262387aeff6d9
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 4ef9f7f..25581eb 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -2522,8 +2522,8 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
// #i120442#: if c is outside the unicode base plane output it as "&#******;"
else if( c > 0xffff)
{
- OUString sOut("&#");
- sOut += OUString::number( (sal_uInt64)c );
+ OString sOut("&#");
+ sOut += OString::number( (sal_uInt64)c );
sOut += ";";
rWrt.Strm() << sOut.getStr();
}
commit ba37e4062f538db7e51d6a64ba544eeddbc567cf
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Jul 15 20:46:29 2013 +0200
OUStringBuffer doesn't have append() overload for const char*
Change-Id: Ibde8e2021d33f01f91486fb6d3e24e7af0a47744
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 71dc093..3477996 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -631,7 +631,7 @@ OUString lclGetErrorMessage( XML_Error xmlE, const OUString& sSystemId, sal_Int3
aBuffer.append( " line " );
aBuffer.append( nLine );
aBuffer.append( "]: " );
- aBuffer.append( pMessage );
+ aBuffer.appendAscii( pMessage );
aBuffer.append( " error" );
return aBuffer.makeStringAndClear();
}
commit 9d65113efeff9b82acddf531d341ecb0e56447a9
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Jul 15 19:55:41 2013 +0200
fix finding all parents for AST nodes
Ctor bodies can also have code inside of member variables initialization,
which is not considered to be inside function body.
Change-Id: Id68960093a51396b9486f1364b1a361526c3431d
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 6611606..7454144 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -100,11 +100,23 @@ bool ParentBuilder::VisitFunctionDecl( const FunctionDecl* function )
{
// if( ignoreLocation( declaration ))
// return true; ???
- if( !function->doesThisDeclarationHaveABody())
- return true;
- const Stmt* body = function->getBody();
- (*parents)[ body ] = NULL; // no parent
- walk( body );
+ if( function->doesThisDeclarationHaveABody())
+ {
+ const Stmt* body = function->getBody();
+ (*parents)[ body ] = NULL; // no parent
+ walk( body );
+ }
+ if( const CXXConstructorDecl* ctor = dyn_cast< CXXConstructorDecl >( function ))
+ {
+ for( CXXConstructorDecl::init_const_iterator it = ctor->init_begin();
+ it != ctor->init_end();
+ ++it )
+ {
+ const Expr* init_expression = (*it)->getInit();
+ (*parents)[ init_expression ] = NULL;
+ walk( init_expression );
+ }
+ }
return true;
}
More information about the Libreoffice-commits
mailing list