[Libreoffice-commits] .: 12 commits - compilerplugins/clang compilerplugins/Makefile-clang.mk compilerplugins/README sot/source

Luboš Luňák l.lunak at suse.cz
Sat Feb 2 14:06:19 PST 2013


 compilerplugins/Makefile-clang.mk                          |   33 +-
 compilerplugins/README                                     |   38 --
 compilerplugins/clang/bodynotinblock.cxx                   |   17 -
 compilerplugins/clang/bodynotinblock.hxx                   |    2 
 compilerplugins/clang/lclstaticfix.cxx                     |   52 ---
 compilerplugins/clang/lclstaticfix.hxx                     |   32 --
 compilerplugins/clang/plugin.cxx                           |  182 +-----------
 compilerplugins/clang/plugin.hxx                           |   76 ++++-
 compilerplugins/clang/pluginhandler.cxx                    |  178 +++++++++++
 compilerplugins/clang/pluginhandler.hxx                    |   54 +++
 compilerplugins/clang/postfixincrementfix.cxx              |   21 -
 compilerplugins/clang/postfixincrementfix.hxx              |    2 
 compilerplugins/clang/removeforwardstringdecl.cxx          |    5 
 compilerplugins/clang/removeforwardstringdecl.hxx          |    2 
 compilerplugins/clang/sallogareas.cxx                      |   18 -
 compilerplugins/clang/sallogareas.hxx                      |    2 
 compilerplugins/clang/store/README                         |    3 
 compilerplugins/clang/store/lclstaticfix.cxx               |   51 +++
 compilerplugins/clang/store/lclstaticfix.hxx               |   32 ++
 compilerplugins/clang/store/tutorial/tutorial1.cxx         |   65 ++++
 compilerplugins/clang/store/tutorial/tutorial1.hxx         |   38 ++
 compilerplugins/clang/store/tutorial/tutorial1_example.cxx |   18 +
 compilerplugins/clang/store/tutorial/tutorial2.cxx         |   92 ++++++
 compilerplugins/clang/store/tutorial/tutorial2.hxx         |   37 ++
 compilerplugins/clang/store/tutorial/tutorial2_example.cxx |   15 
 compilerplugins/clang/store/tutorial/tutorial3.cxx         |   74 ++++
 compilerplugins/clang/store/tutorial/tutorial3.hxx         |   39 ++
 compilerplugins/clang/unusedvariablecheck.cxx              |    8 
 compilerplugins/clang/unusedvariablecheck.hxx              |    2 
 sot/source/sdstor/stgdir.cxx                               |  196 ++++++-------
 sot/source/sdstor/stgdir.hxx                               |   58 +--
 sot/source/sdstor/stgstrms.cxx                             |  156 +++++-----
 sot/source/sdstor/stgstrms.hxx                             |   40 +-
 sot/source/sdstor/ucbstorage.cxx                           |    1 
 34 files changed, 1088 insertions(+), 551 deletions(-)

New commits:
commit 4fd910a096532fed2552c67bceabe237a9e3c7d6
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 22:59:17 2013 +0100

    tutorial examples for writing new Clang plugin actions
    
    http://wiki.documentfoundation.org/Clang_plugins
    
    Change-Id: Ieb4fc186490e81ab961c094ca0a7fcdabc0f348f

diff --git a/compilerplugins/README b/compilerplugins/README
index 9d531db..a5441c9 100644
--- a/compilerplugins/README
+++ b/compilerplugins/README
@@ -40,4 +40,5 @@ Modifications will be written directly to the source files.
 
 == Code documentation / howtos ==
 
-TBD
+http://wiki.documentfoundation.org/Clang_plugins
+
diff --git a/compilerplugins/clang/store/tutorial/tutorial1.cxx b/compilerplugins/clang/store/tutorial/tutorial1.cxx
new file mode 100644
index 0000000..fa1ec44
--- /dev/null
+++ b/compilerplugins/clang/store/tutorial/tutorial1.cxx
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#include "tutorial1.hxx"
+
+/*
+This is a compile check.
+
+Checks all return statements and warns if they return literal false (i.e. 'return false').
+*/
+
+namespace loplugin
+{
+
+// Ctor, nothing special, pass the argument(s).
+Tutorial1::Tutorial1( ASTContext& context )
+    : Plugin( context )
+    {
+    }
+
+// Perform the actual action.
+void Tutorial1::run()
+    {
+    // Traverse the whole AST of the translation unit (i.e. examine the whole source file).
+    // The Clang AST helper class will call VisitReturnStmt for every return statement.
+    TraverseDecl( context.getTranslationUnitDecl());
+    }
+
+// This function is called for every return statement.
+// Returning true means to continue with examining the AST, false means to stop (just always return true).
+bool Tutorial1::VisitReturnStmt( ReturnStmt* returnstmt )
+    {
+    // Helper function from the LO base plugin class, call at the very beginning to ignore sources
+    // that should not be processed (e.g. system headers).
+    if( ignoreLocation( returnstmt ))
+        return true;
+    // Get the expression in the return statement (see ReturnStmt API docs).
+    const Expr* expression = returnstmt->getRetValue();
+    if( expression == NULL )
+        return true; // plain 'return;' without expression
+    // Check if the expression is a bool literal (Clang uses dyn_cast<> instead of dynamic_cast<>).
+    if( const CXXBoolLiteralExpr* boolliteral = dyn_cast< CXXBoolLiteralExpr >( expression ))
+        { // It is.
+        if( boolliteral->getValue() == false ) // Is it 'return false;' ? (See CXXBoolLiteralExpr API docs)
+            { // Ok, warn, use LO plugin helper function.
+            report( DiagnosticsEngine::Warning, // It's just a warning.
+                "returning false",  // the message
+                boolliteral->getLocStart()) // and the exact position where the message should point
+                    << returnstmt->getSourceRange(); // and the full return statement to highlight (optional)
+            }
+        }
+    return true;
+    }
+
+// Register the plugin action with the LO plugin handling.
+static Plugin::Registration< Tutorial1 > X( "tutorial1" );
+
+} // namespace
diff --git a/compilerplugins/clang/store/tutorial/tutorial1.hxx b/compilerplugins/clang/store/tutorial/tutorial1.hxx
new file mode 100644
index 0000000..0f5127d
--- /dev/null
+++ b/compilerplugins/clang/store/tutorial/tutorial1.hxx
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#ifndef TUTORIAL1_H
+#define TUTORIAL1_H
+
+#include "plugin.hxx"
+
+namespace loplugin
+{
+
+// The class implementing the plugin action.
+class Tutorial1
+    // Inherits from the Clang class that will allow examing the Clang AST tree (i.e. syntax tree).
+    : public RecursiveASTVisitor< Tutorial1 >
+    // And the base class for LO Clang plugins.
+    , public Plugin
+    {
+    public:
+        // Ctor, nothing special.
+        Tutorial1( ASTContext& context );
+        // The function that will be called to perform the actual action.
+        virtual void run();
+        // Function from Clang, it will be called for every return statement in the source.
+        bool VisitReturnStmt( ReturnStmt* returnstmt );
+    };
+
+} // namespace
+
+#endif // POSTFIXINCREMENTFIX_H
+
diff --git a/compilerplugins/clang/store/tutorial/tutorial1_example.cxx b/compilerplugins/clang/store/tutorial/tutorial1_example.cxx
new file mode 100644
index 0000000..ca4c768
--- /dev/null
+++ b/compilerplugins/clang/store/tutorial/tutorial1_example.cxx
@@ -0,0 +1,18 @@
+// This is just an example file to see what AST looks like for return statements.
+// To the the AST, run :
+// clang++ -fsyntax-only -Xclang -ast-dump tutorial1_example.cxx
+
+void f()
+    {
+    return;
+    }
+
+bool g()
+    {
+    return false;
+    }
+
+bool h()
+    {
+    return 3 > 2;
+    }
diff --git a/compilerplugins/clang/store/tutorial/tutorial2.cxx b/compilerplugins/clang/store/tutorial/tutorial2.cxx
new file mode 100644
index 0000000..d5fc60b
--- /dev/null
+++ b/compilerplugins/clang/store/tutorial/tutorial2.cxx
@@ -0,0 +1,92 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#include "tutorial2.hxx"
+
+/*
+This is a compile check.
+
+Warns about if statements with a comparison followed by literal return false:
+if( a == 1 )
+    return false;
+*/
+
+namespace loplugin
+{
+
+Tutorial2::Tutorial2( ASTContext& context )
+    : Plugin( context )
+    {
+    }
+
+void Tutorial2::run()
+    {
+    // The Clang AST helper class will call VisitIfStmt for every if statement.
+    TraverseDecl( context.getTranslationUnitDecl());
+    }
+
+// This function is called for every if statement.
+bool Tutorial2::VisitIfStmt( IfStmt* ifstmt )
+    {
+    if( ignoreLocation( ifstmt ))
+        return true;
+    // Check if the condition of the if statement is a binary operator.
+    if( const BinaryOperator* oper = dyn_cast< BinaryOperator >( ifstmt->getCond()))
+        {
+        // And if it's operator==.
+        if( oper->getOpcode() == BO_EQ )
+            {
+            // Now check if the sub-statement is 'return false'.
+            const Stmt* warn = NULL; // The return statement (for the warning message).
+            // Check if the sub-statement is directly 'return false;'.
+            if( isReturnFalse( ifstmt->getThen()))
+                warn = ifstmt->getThen();
+            // Check if the sub-statement is '{ return false; }'
+            else if( CompoundStmt* compound = dyn_cast< CompoundStmt >( ifstmt->getThen()))
+                {
+                if( compound->size() == 1 ) // one statement
+                    if( isReturnFalse( *compound->body_begin())) // check the one sub-statement
+                        warn = *compound->body_begin();
+                }
+            if( warn != NULL ) // there is a return statement to warn about.
+                {
+                report( DiagnosticsEngine::Warning,
+                    "returning false after if with equality comparison",
+                    cast< ReturnStmt >( warn )->getRetValue()->getLocStart()) // the 'false' in the return
+                    << warn->getSourceRange();
+                // Also add a note showing the if statement.
+                report( DiagnosticsEngine::Note,
+                    "the if statement is here",
+                    ifstmt->getLocStart());
+                }
+            }
+        }
+    return true;
+    }
+
+bool Tutorial2::isReturnFalse( const Stmt* stmt )
+    {
+    // Is it return statement?
+    if( const ReturnStmt* returnstmt = dyn_cast< ReturnStmt >( stmt ))
+        {
+        // dyn_cast_or_null<> can also be passed NULL, unlike dyn_cast<>
+        if( const CXXBoolLiteralExpr* boolliteral = dyn_cast_or_null< CXXBoolLiteralExpr >( returnstmt->getRetValue()))
+            {
+            if( boolliteral->getValue() == false )
+                return true;
+            }
+        }
+    return false;
+    }
+
+// Register the plugin action with the LO plugin handling.
+static Plugin::Registration< Tutorial2 > X( "tutorial2" );
+
+} // namespace
diff --git a/compilerplugins/clang/store/tutorial/tutorial2.hxx b/compilerplugins/clang/store/tutorial/tutorial2.hxx
new file mode 100644
index 0000000..97c56ba
--- /dev/null
+++ b/compilerplugins/clang/store/tutorial/tutorial2.hxx
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#ifndef TUTORIAL2_H
+#define TUTORIAL2_H
+
+#include "plugin.hxx"
+
+namespace loplugin
+{
+
+// The same like for Tutorial1.
+class Tutorial2
+    : public RecursiveASTVisitor< Tutorial2 >
+    , public Plugin
+    {
+    public:
+        Tutorial2( ASTContext& context );
+        virtual void run();
+        // Will be called for every if statement.
+        bool VisitIfStmt( IfStmt* ifstmt );
+    private:
+        // Helper function to check if the statement is 'return false;'.
+        bool isReturnFalse( const Stmt* stmt );
+    };
+
+} // namespace
+
+#endif // POSTFIXINCREMENTFIX_H
+
diff --git a/compilerplugins/clang/store/tutorial/tutorial2_example.cxx b/compilerplugins/clang/store/tutorial/tutorial2_example.cxx
new file mode 100644
index 0000000..d3c14ab
--- /dev/null
+++ b/compilerplugins/clang/store/tutorial/tutorial2_example.cxx
@@ -0,0 +1,15 @@
+// This is just an example file to see what AST looks like for return statements.
+// To the the AST, run :
+// clang++ -fsyntax-only -Xclang -ast-dump tutorial1_example.cxx
+
+bool g()
+    {
+    if( 1 == 2 )
+        return false;
+    if( 1 == 2 )
+        {
+        return false;
+        }
+    if( true )
+        return false;
+    }
diff --git a/compilerplugins/clang/store/tutorial/tutorial3.cxx b/compilerplugins/clang/store/tutorial/tutorial3.cxx
new file mode 100644
index 0000000..e0589f6
--- /dev/null
+++ b/compilerplugins/clang/store/tutorial/tutorial3.cxx
@@ -0,0 +1,74 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#include "tutorial3.hxx"
+
+/*
+This is a rewriter.
+
+It looks for if statements with a comparison followed by literal return false
+and modifies the return statements to 'return maybereturntrue;'
+*/
+
+namespace loplugin
+{
+
+// Ctor, pass arguments.
+Tutorial3::Tutorial3( ASTContext& context, Rewriter& rewriter )
+    : RewritePlugin( context, rewriter )
+    {
+    }
+
+void Tutorial3::run()
+    {
+    TraverseDecl( context.getTranslationUnitDecl());
+    }
+
+bool Tutorial3::VisitIfStmt( IfStmt* ifstmt )
+    {
+    if( ignoreLocation( ifstmt ))
+        return true;
+    if( const BinaryOperator* oper = dyn_cast< BinaryOperator >( ifstmt->getCond()))
+        {
+        if( oper->getOpcode() == BO_EQ )
+            {
+            // Modify the sub-statement if it is 'return false'.
+            modifyReturnFalse( ifstmt->getThen());
+            // Modify the sub-statement if it is '{ return false; }'.
+            if( CompoundStmt* compound = dyn_cast< CompoundStmt >( ifstmt->getThen()))
+                {
+                if( compound->size() == 1 ) // one statement
+                    modifyReturnFalse( *compound->body_begin());
+                }
+            }
+        }
+    return true;
+    }
+
+void Tutorial3::modifyReturnFalse( const Stmt* stmt )
+    {
+    // Is it return statement?
+    if( const ReturnStmt* returnstmt = dyn_cast< ReturnStmt >( stmt ))
+        {
+        // dyn_cast_or_null<> can also be passed NULL, unlike dyn_cast<>
+        if( const CXXBoolLiteralExpr* boolliteral = dyn_cast_or_null< CXXBoolLiteralExpr >( returnstmt->getRetValue()))
+            {
+            if( boolliteral->getValue() == false )
+                { // It is, modify the false to true using LO plugin helper function.
+                replaceText( boolliteral->getSourceRange(), "maybereturntrue" );
+                }
+            }
+        }
+    }
+
+// Register the plugin action with the LO plugin handling.
+static Plugin::Registration< Tutorial3 > X( "tutorial3" );
+
+} // namespace
diff --git a/compilerplugins/clang/store/tutorial/tutorial3.hxx b/compilerplugins/clang/store/tutorial/tutorial3.hxx
new file mode 100644
index 0000000..69747ee
--- /dev/null
+++ b/compilerplugins/clang/store/tutorial/tutorial3.hxx
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#ifndef TUTORIAL3_H
+#define TUTORIAL3_H
+
+#include "plugin.hxx"
+
+namespace loplugin
+{
+
+// Similar like for Tutorial2, but this time the base class is RewritePlugin.
+class Tutorial3
+    : public RecursiveASTVisitor< Tutorial3 >
+    , public RewritePlugin
+    {
+    public:
+        // One more argument for ctor.
+        Tutorial3( ASTContext& context, Rewriter& rewriter );
+        virtual void run();
+        // Will be called for every if statement.
+        bool VisitIfStmt( IfStmt* ifstmt );
+    private:
+        // Helper function to check if the statement is 'return false;' and
+        // modify it if yes.
+        void modifyReturnFalse( const Stmt* stmt );
+    };
+
+} // namespace
+
+#endif // POSTFIXINCREMENTFIX_H
+
commit 18e615189df93cb704c32553a41505a1bdc984f1
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 20:41:51 2013 +0100

    a bit more reliable detection of removed/added sources
    
    Change-Id: I7fdde46334c648ab6cba54210e31fada87dcfb55

diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk
index 619e11d..9d6aa14 100644
--- a/compilerplugins/Makefile-clang.mk
+++ b/compilerplugins/Makefile-clang.mk
@@ -46,6 +46,10 @@ ifeq ($(CLANGSRCCHANGED),1)
 CLANGFORCE:
 $(CLANGOUTDIR)/plugin.so: CLANGFORCE
 endif
+# Make the .so also explicitly depend on the sources list, to force update in case CLANGSRCCHANGED was e.g. during 'make clean'.
+$(CLANGOUTDIR)/plugin.so: $(CLANGOUTDIR)/sources.txt
+$(CLANGOUTDIR)/sources.txt:
+	touch $@
 
 compilerplugins: $(CLANGOUTDIR) $(CLANGOUTDIR)/plugin.so
 
commit c2e2d77b1962e9bd95a54389d8ff568ec7b19a89
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 20:04:40 2013 +0100

    unused variable
    
    Change-Id: I636229e88f76d8e2f6ccd24fd7b5063ca64f9b27

diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index ff081f2..bc8fc90 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -2881,7 +2881,6 @@ BaseStorage* UCBStorage::OpenStorage_Impl( const String& rEleName, StreamMode nM
         {
             // make sure that the root storage object has been created before substorages will be created
             INetURLObject aFolderObj( pImp->m_aURL );
-            String aName = aFolderObj.GetName();
             aFolderObj.removeSegment();
 
             Content aFolder( aFolderObj.GetMainURL( INetURLObject::NO_DECODE ), Reference < XCommandEnvironment >(), comphelper::getProcessComponentContext() );
commit 276953ef21c3b9278538000c3322d5fb212c2686
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 19:45:47 2013 +0100

    remove not needed #include
    
    Change-Id: I0fa791733407199db5be2cc9606ac9be1da64188

diff --git a/compilerplugins/clang/bodynotinblock.cxx b/compilerplugins/clang/bodynotinblock.cxx
index 56edfbd..cd3e1a0 100644
--- a/compilerplugins/clang/bodynotinblock.cxx
+++ b/compilerplugins/clang/bodynotinblock.cxx
@@ -10,9 +10,6 @@
 
 #include "bodynotinblock.hxx"
 
-#include <clang/AST/ASTContext.h>
-#include <clang/Basic/SourceManager.h>
-
 namespace loplugin
 {
 
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 0c9769e..f6c81f5 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -10,7 +10,6 @@
 
 #include "plugin.hxx"
 
-#include <clang/AST/ASTContext.h>
 #include <clang/Basic/FileManager.h>
 
 #include "pluginhandler.hxx"
diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx
index f7f8e9f..92ff6f3 100644
--- a/compilerplugins/clang/plugin.hxx
+++ b/compilerplugins/clang/plugin.hxx
@@ -13,6 +13,7 @@
 
 #include <config_clang.h>
 
+#include <clang/AST/ASTContext.h>
 #include <clang/AST/RecursiveASTVisitor.h>
 
 #if __clang_major__ < 3 || __clang_major__ == 3 && __clang_minor__ < 2
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx
index 3282ef0..eeda78a 100644
--- a/compilerplugins/clang/pluginhandler.cxx
+++ b/compilerplugins/clang/pluginhandler.cxx
@@ -10,7 +10,6 @@
 
 #include "pluginhandler.hxx"
 
-#include <clang/AST/ASTContext.h>
 #include <clang/Frontend/CompilerInstance.h>
 #include <clang/Frontend/FrontendPluginRegistry.h>
 #include <stdio.h>
diff --git a/compilerplugins/clang/postfixincrementfix.cxx b/compilerplugins/clang/postfixincrementfix.cxx
index 6d8da1f..9dac516 100644
--- a/compilerplugins/clang/postfixincrementfix.cxx
+++ b/compilerplugins/clang/postfixincrementfix.cxx
@@ -10,9 +10,6 @@
 
 #include "postfixincrementfix.hxx"
 
-#include <clang/AST/ASTContext.h>
-#include <clang/Basic/SourceManager.h>
-
 /*
 This is a rewriter.
 
diff --git a/compilerplugins/clang/removeforwardstringdecl.cxx b/compilerplugins/clang/removeforwardstringdecl.cxx
index 711d9604..736cbe3 100644
--- a/compilerplugins/clang/removeforwardstringdecl.cxx
+++ b/compilerplugins/clang/removeforwardstringdecl.cxx
@@ -10,9 +10,6 @@
 
 #include "removeforwardstringdecl.hxx"
 
-#include <clang/AST/ASTContext.h>
-#include <clang/Basic/SourceManager.h>
-
 /*
 This is a rewriter.
 
diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
index db4453c..2f88905 100644
--- a/compilerplugins/clang/sallogareas.cxx
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -10,8 +10,6 @@
 
 #include "sallogareas.hxx"
 
-#include <clang/AST/ASTContext.h>
-#include <clang/Basic/SourceManager.h>
 #include <clang/Lex/Lexer.h>
 
 #include <fstream>
diff --git a/compilerplugins/clang/store/lclstaticfix.cxx b/compilerplugins/clang/store/lclstaticfix.cxx
index e966139..6b3ba16 100644
--- a/compilerplugins/clang/store/lclstaticfix.cxx
+++ b/compilerplugins/clang/store/lclstaticfix.cxx
@@ -10,9 +10,6 @@
 
 #include "lclstaticfix.hxx"
 
-#include <clang/AST/ASTContext.h>
-#include <clang/Basic/SourceManager.h>
-
 /*
 This is a rewriter.
 
diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx
index d13c726..989269f 100644
--- a/compilerplugins/clang/unusedvariablecheck.cxx
+++ b/compilerplugins/clang/unusedvariablecheck.cxx
@@ -10,9 +10,7 @@
 
 #include "unusedvariablecheck.hxx"
 
-#include <clang/AST/ASTContext.h>
 #include <clang/AST/Attr.h>
-#include <clang/Basic/SourceManager.h>
 
 namespace loplugin
 {
commit f5ee30c3eeb104c9178646b8a098e882593ea4df
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 19:38:56 2013 +0100

    append [loplugin] automatically in report() rathen than manually everywhere
    
    Change-Id: I2f98622f152ae0c7ac8d1113d6380f686ac7234c

diff --git a/compilerplugins/clang/bodynotinblock.cxx b/compilerplugins/clang/bodynotinblock.cxx
index 76ab565..56edfbd 100644
--- a/compilerplugins/clang/bodynotinblock.cxx
+++ b/compilerplugins/clang/bodynotinblock.cxx
@@ -122,10 +122,10 @@ void BodyNotInBlock::checkBody( const Stmt* body, SourceLocation stmtLocation, c
                     if( bodyColumn == nextStatementColumn )
                         {
                         report( DiagnosticsEngine::Warning,
-                            "statement aligned as second statement in %select{if|while|for}0 body but not in a statement block [loplugin]",
+                            "statement aligned as second statement in %select{if|while|for}0 body but not in a statement block",
                             (*it)->getLocStart()) << stmtType;
                         report( DiagnosticsEngine::Note,
-                            "%select{if|while|for}0 body statement is here [loplugin]",
+                            "%select{if|while|for}0 body statement is here",
                             body->getLocStart()) << stmtType;
                         }
                     return;
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 799fbab..0c9769e 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -42,10 +42,11 @@ DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef mess
     if( level == DiagnosticsEngine::Error && diag.getErrorsAsFatal())
         level = DiagnosticsEngine::Fatal;
 #endif
+    string fullMessage = ( message + " [loplugin]" ).str();
     if( loc.isValid())
-        return diag.Report( loc, diag.getCustomDiagID( level, message ));
+        return diag.Report( loc, diag.getCustomDiagID( level, fullMessage ));
     else
-        return diag.Report( diag.getCustomDiagID( level, message ));
+        return diag.Report( diag.getCustomDiagID( level, fullMessage ));
     }
 
 bool Plugin::ignoreLocation( SourceLocation loc )
@@ -174,7 +175,7 @@ bool RewritePlugin::replaceText( SourceRange range, SourceRange replacementRange
 
 bool RewritePlugin::reportEditFailure( SourceLocation loc )
     {
-    report( DiagnosticsEngine::Warning, "cannot perform source modification (macro expansion involved?) [loplugin]", loc );
+    report( DiagnosticsEngine::Warning, "cannot perform source modification (macro expansion involved?)", loc );
     return false;
     }
 
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx
index 1c36ede..3282ef0 100644
--- a/compilerplugins/clang/pluginhandler.cxx
+++ b/compilerplugins/clang/pluginhandler.cxx
@@ -61,7 +61,7 @@ PluginHandler::PluginHandler( ASTContext& context, const vector< string >& args
         }
     pluginObjectsCreated = true;
     if( !args.empty() && !wasCreated )
-        report( DiagnosticsEngine::Fatal, "unknown plugin tool %0 [loplugin]" ) << args.front();
+        report( DiagnosticsEngine::Fatal, "unknown plugin tool %0" ) << args.front();
     }
 
 PluginHandler::~PluginHandler()
@@ -126,17 +126,17 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context )
                     }
                 }
             if( modifyFile.empty())
-                report( DiagnosticsEngine::Warning, "modified source in solver/ : %0 [loplugin]" ) << e->getName();
+                report( DiagnosticsEngine::Warning, "modified source in solver/ : %0" ) << e->getName();
             }
         else if( strncmp( e->getName(), WORKDIR, strlen( WORKDIR )) == 0 )
-            report( DiagnosticsEngine::Warning, "modified source in workdir/ : %0 [loplugin]" ) << e->getName();
+            report( DiagnosticsEngine::Warning, "modified source in workdir/ : %0" ) << e->getName();
         else if( strcmp( SRCDIR, BUILDDIR ) != 0 && strncmp( e->getName(), BUILDDIR, strlen( BUILDDIR )) == 0 )
-            report( DiagnosticsEngine::Warning, "modified source in build dir : %0 [loplugin]" ) << e->getName();
+            report( DiagnosticsEngine::Warning, "modified source in build dir : %0" ) << e->getName();
         else if( strncmp( e->getName(), SRCDIR, strlen( SRCDIR )) == 0 )
             ; // ok
         else
             {
-            report( DiagnosticsEngine::Warning, "modified source in unknown location, not modifying : %0 [loplugin]" )
+            report( DiagnosticsEngine::Warning, "modified source in unknown location, not modifying : %0" )
                  << e->getName();
             continue; // --->
             }
@@ -157,7 +157,7 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context )
         ostream.clear_error();
         unlink( filename );
         if( !ok )
-            report( DiagnosticsEngine::Error, "cannot write modified source to %0 (%1) [loplugin]" ) << modifyFile << error;
+            report( DiagnosticsEngine::Error, "cannot write modified source to %0 (%1)" ) << modifyFile << error;
         delete[] filename;
         }
     }
diff --git a/compilerplugins/clang/postfixincrementfix.cxx b/compilerplugins/clang/postfixincrementfix.cxx
index e1f6849..6d8da1f 100644
--- a/compilerplugins/clang/postfixincrementfix.cxx
+++ b/compilerplugins/clang/postfixincrementfix.cxx
@@ -119,7 +119,7 @@ bool PostfixIncrementFix::canChangePostfixToPrefix( const CXXOperatorCallExpr* o
             return canChangeInConditionStatement( op, dyn_cast< ForStmt >( parents[ parent_pos ] )->getCond(),
                 parents, parent_pos );
         default:
-            report( DiagnosticsEngine::Fatal, "cannot analyze operator++ (plugin needs fixing) [loplugin]",
+            report( DiagnosticsEngine::Fatal, "cannot analyze operator++ (plugin needs fixing)",
                 op->getLocStart()) << parents[ parent_pos ]->getSourceRange();
 //            parents[ parent_pos ]->dump();
 //            parents[ std::max( parent_pos - 3, 0 ) ]->dump();
@@ -155,7 +155,7 @@ bool PostfixIncrementFix::shouldDoChange( const Expr* operand )
             return true;
         default:
             {
-            report( DiagnosticsEngine::Fatal, "cannot analyze operator++ (plugin needs fixing) [loplugin]",
+            report( DiagnosticsEngine::Fatal, "cannot analyze operator++ (plugin needs fixing)",
                 expr->getLocStart()) << operand->getSourceRange();
             expr->dump();
             operand->dump();
diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
index 051c1d7..db4453c 100644
--- a/compilerplugins/clang/sallogareas.cxx
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -70,7 +70,7 @@ bool SalLogAreas::VisitCallExpr( CallExpr* call )
                     if( area->getKind() == StringLiteral::Ascii )
                         checkArea( area->getBytes(), area->getExprLoc());
                     else
-                        report( DiagnosticsEngine::Warning, "unsupported string literal kind (plugin needs fixing?) [loplugin]",
+                        report( DiagnosticsEngine::Warning, "unsupported string literal kind (plugin needs fixing?)",
                             area->getLocStart());
                     return true;
                     }
@@ -87,11 +87,11 @@ bool SalLogAreas::VisitCallExpr( CallExpr* call )
                         if( inMacro == "SAL_DEBUG" )
                             return true; // ok
                         }
-                    report( DiagnosticsEngine::Warning, "missing log area [loplugin]",
+                    report( DiagnosticsEngine::Warning, "missing log area",
                         call->getArg( 1 )->IgnoreParenImpCasts()->getLocStart());
                     return true;
                     }
-                report( DiagnosticsEngine::Warning, "cannot analyse log area argument (plugin needs fixing?) [loplugin]",
+                report( DiagnosticsEngine::Warning, "cannot analyse log area argument (plugin needs fixing?)",
                     call->getLocStart());
                 }
             }
@@ -105,7 +105,7 @@ void SalLogAreas::checkArea( StringRef area, SourceLocation location )
         readLogAreas();
     if( !logAreas.count( area ))
         {
-        report( DiagnosticsEngine::Warning, "unknown log area '%0' (check or extend sal/inc/sal/log-areas.dox) [loplugin]",
+        report( DiagnosticsEngine::Warning, "unknown log area '%0' (check or extend sal/inc/sal/log-areas.dox)",
             location ) << area;
         }
     }
@@ -130,7 +130,7 @@ void SalLogAreas::readLogAreas()
         }
     // If you get this error message, you possibly have too old icecream (ICECC_EXTRAFILES is needed).
     if( logAreas.empty())
-        report( DiagnosticsEngine::Warning, "error reading log areas [loplugin]" );
+        report( DiagnosticsEngine::Warning, "error reading log areas" );
     }
 
 static Plugin::Registration< SalLogAreas > X( "sallogareas" );
diff --git a/compilerplugins/clang/unusedvariablecheck.cxx b/compilerplugins/clang/unusedvariablecheck.cxx
index 93ad851..d13c726 100644
--- a/compilerplugins/clang/unusedvariablecheck.cxx
+++ b/compilerplugins/clang/unusedvariablecheck.cxx
@@ -89,11 +89,11 @@ bool UnusedVariableCheck::VisitVarDecl( VarDecl* var )
                 if( const FunctionDecl* func = dyn_cast_or_null< FunctionDecl >( param->getParentFunctionOrMethod()))
                     if( !func->doesThisDeclarationHaveABody())
                         return true;
-                report( DiagnosticsEngine::Warning, "unused parameter %0 [loplugin]",
+                report( DiagnosticsEngine::Warning, "unused parameter %0",
                     var->getLocation()) << var->getDeclName();
                 }
             else
-                report( DiagnosticsEngine::Warning, "unused variable %0 [loplugin]",
+                report( DiagnosticsEngine::Warning, "unused variable %0",
                     var->getLocation()) << var->getDeclName();
             }
         }
commit b4392c575e5aaf31ccf0813a20450187df37cf59
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 19:31:24 2013 +0100

    always use the report() helper
    
    Change-Id: I2966fdb5bd98b1ddf718079584acf90a3e3a3700

diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 01b2894..799fbab 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -28,6 +28,12 @@ Plugin::Plugin( ASTContext& context )
 
 DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc )
     {
+    return report( level, message, context, loc );
+    }
+
+DiagnosticBuilder Plugin::report( DiagnosticsEngine::Level level, StringRef message, ASTContext& context,
+    SourceLocation loc )
+    {
     DiagnosticsEngine& diag = context.getDiagnostics();
 #if 0
     // Do some mappings (e.g. for -Werror) that clang does not do for custom messages for some reason.
@@ -168,9 +174,7 @@ bool RewritePlugin::replaceText( SourceRange range, SourceRange replacementRange
 
 bool RewritePlugin::reportEditFailure( SourceLocation loc )
     {
-    DiagnosticsEngine& diag = context.getDiagnostics();
-    diag.Report( loc, diag.getCustomDiagID( DiagnosticsEngine::Warning,
-        "cannot perform source modification (macro expansion involved?) [loplugin]" ));
+    report( DiagnosticsEngine::Warning, "cannot perform source modification (macro expansion involved?) [loplugin]", loc );
     return false;
     }
 
diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx
index 014329e..f7f8e9f 100644
--- a/compilerplugins/clang/plugin.hxx
+++ b/compilerplugins/clang/plugin.hxx
@@ -41,8 +41,10 @@ class Plugin
         virtual ~Plugin();
         virtual void run() = 0;
         template< typename T > class Registration;
-    protected:
         DiagnosticBuilder report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc = SourceLocation());
+        static DiagnosticBuilder report( DiagnosticsEngine::Level level, StringRef message,
+            ASTContext& context, SourceLocation loc = SourceLocation());
+    protected:
         bool ignoreLocation( SourceLocation loc );
         bool ignoreLocation( const Decl* decl );
         bool ignoreLocation( const Stmt* stmt );
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx
index 023a270..1c36ede 100644
--- a/compilerplugins/clang/pluginhandler.cxx
+++ b/compilerplugins/clang/pluginhandler.cxx
@@ -37,7 +37,8 @@ static int pluginCount = 0;
 static bool pluginObjectsCreated = false;
 
 PluginHandler::PluginHandler( ASTContext& context, const vector< string >& args )
-    : rewriter( context.getSourceManager(), context.getLangOpts())
+    : context( context )
+    , rewriter( context.getSourceManager(), context.getLangOpts())
     {
     bool wasCreated = false;
     for( int i = 0;
@@ -60,11 +61,7 @@ PluginHandler::PluginHandler( ASTContext& context, const vector< string >& args
         }
     pluginObjectsCreated = true;
     if( !args.empty() && !wasCreated )
-        {
-        DiagnosticsEngine& diag = context.getDiagnostics();
-        diag.Report( diag.getCustomDiagID( DiagnosticsEngine::Fatal,
-            "unknown plugin tool %0 [loplugin]" )) << args.front();
-        }
+        report( DiagnosticsEngine::Fatal, "unknown plugin tool %0 [loplugin]" ) << args.front();
     }
 
 PluginHandler::~PluginHandler()
@@ -87,6 +84,11 @@ void PluginHandler::registerPlugin( Plugin* (*create)( ASTContext&, Rewriter& ),
     ++pluginCount;
     }
 
+DiagnosticBuilder PluginHandler::report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc )
+    {
+    return Plugin::report( level, message, context, loc );
+    }
+
 void PluginHandler::HandleTranslationUnit( ASTContext& context )
     {
     if( context.getDiagnostics().hasErrorOccurred())
@@ -103,7 +105,6 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context )
          ++it )
         {
         const FileEntry* e = context.getSourceManager().getFileEntryForID( it->first );
-        DiagnosticsEngine& diag = context.getDiagnostics();
         /* Check where the file actually is, and warn about cases where modification
            most probably doesn't matter (generated files in workdir).
            The order here is important, as OUTDIR and WORKDIR are often in SRCDIR/BUILDDIR,
@@ -125,21 +126,18 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context )
                     }
                 }
             if( modifyFile.empty())
-                diag.Report( diag.getCustomDiagID( DiagnosticsEngine::Warning,
-                    "modified source in solver/ : %0 [loplugin]" )) << e->getName();
+                report( DiagnosticsEngine::Warning, "modified source in solver/ : %0 [loplugin]" ) << e->getName();
             }
         else if( strncmp( e->getName(), WORKDIR, strlen( WORKDIR )) == 0 )
-            diag.Report( diag.getCustomDiagID( DiagnosticsEngine::Warning,
-                "modified source in workdir/ : %0 [loplugin]" )) << e->getName();
+            report( DiagnosticsEngine::Warning, "modified source in workdir/ : %0 [loplugin]" ) << e->getName();
         else if( strcmp( SRCDIR, BUILDDIR ) != 0 && strncmp( e->getName(), BUILDDIR, strlen( BUILDDIR )) == 0 )
-            diag.Report( diag.getCustomDiagID( DiagnosticsEngine::Warning,
-                "modified source in build dir : %0 [loplugin]" )) << e->getName();
+            report( DiagnosticsEngine::Warning, "modified source in build dir : %0 [loplugin]" ) << e->getName();
         else if( strncmp( e->getName(), SRCDIR, strlen( SRCDIR )) == 0 )
             ; // ok
         else
             {
-            diag.Report( diag.getCustomDiagID( DiagnosticsEngine::Warning,
-                "modified source in unknown location, not modifying : %0 [loplugin]" )) << e->getName();
+            report( DiagnosticsEngine::Warning, "modified source in unknown location, not modifying : %0 [loplugin]" )
+                 << e->getName();
             continue; // --->
             }
         if( modifyFile.empty())
@@ -159,8 +157,7 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context )
         ostream.clear_error();
         unlink( filename );
         if( !ok )
-            diag.Report( diag.getCustomDiagID( DiagnosticsEngine::Error,
-                "cannot write modified source to %0 (%1) [loplugin]" )) << modifyFile << error;
+            report( DiagnosticsEngine::Error, "cannot write modified source to %0 (%1) [loplugin]" ) << modifyFile << error;
         delete[] filename;
         }
     }
diff --git a/compilerplugins/clang/pluginhandler.hxx b/compilerplugins/clang/pluginhandler.hxx
index 2211275..23ca217 100644
--- a/compilerplugins/clang/pluginhandler.hxx
+++ b/compilerplugins/clang/pluginhandler.hxx
@@ -31,6 +31,8 @@ class PluginHandler
         virtual void HandleTranslationUnit( ASTContext& context );
         static void registerPlugin( Plugin* (*create)( ASTContext&, Rewriter& ), const char* optionName, bool isRewriter );
     private:
+        DiagnosticBuilder report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc = SourceLocation());
+        ASTContext& context;
         Rewriter rewriter;
     };
 
diff --git a/compilerplugins/clang/postfixincrementfix.cxx b/compilerplugins/clang/postfixincrementfix.cxx
index 3f4688e..e1f6849 100644
--- a/compilerplugins/clang/postfixincrementfix.cxx
+++ b/compilerplugins/clang/postfixincrementfix.cxx
@@ -119,10 +119,8 @@ bool PostfixIncrementFix::canChangePostfixToPrefix( const CXXOperatorCallExpr* o
             return canChangeInConditionStatement( op, dyn_cast< ForStmt >( parents[ parent_pos ] )->getCond(),
                 parents, parent_pos );
         default:
-            DiagnosticsEngine& diag = context.getDiagnostics();
-            unsigned diagid = diag.getCustomDiagID( DiagnosticsEngine::Fatal,
-                "cannot analyze operator++ (plugin needs fixing) [loplugin]" );
-            diag.Report( op->getLocStart(), diagid ) << parents[ parent_pos ]->getSourceRange();
+            report( DiagnosticsEngine::Fatal, "cannot analyze operator++ (plugin needs fixing) [loplugin]",
+                op->getLocStart()) << parents[ parent_pos ]->getSourceRange();
 //            parents[ parent_pos ]->dump();
 //            parents[ std::max( parent_pos - 3, 0 ) ]->dump();
             return false;
@@ -157,10 +155,8 @@ bool PostfixIncrementFix::shouldDoChange( const Expr* operand )
             return true;
         default:
             {
-            DiagnosticsEngine& diag = context.getDiagnostics();
-            unsigned diagid = diag.getCustomDiagID( DiagnosticsEngine::Fatal,
-                "cannot analyze operator++ (plugin needs fixing) [loplugin]" );
-            diag.Report( expr->getLocStart(), diagid ) << operand->getSourceRange();
+            report( DiagnosticsEngine::Fatal, "cannot analyze operator++ (plugin needs fixing) [loplugin]",
+                expr->getLocStart()) << operand->getSourceRange();
             expr->dump();
             operand->dump();
             return false;
commit efe9bf61ed408e94a9171992c1582e00f21d209e
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 19:01:51 2013 +0100

    sal_Bool to bool
    
    Change-Id: I7d05020b6e07268349fb269bd58ce11aeddf6631

diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index fd890fc..31c2de2 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -44,7 +44,7 @@
 // Problem der Implementation: Keine Hierarchischen commits. Daher nur
 // insgesamt transaktionsorientert oder direkt.
 
-StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk ) : StgAvlNode()
+StgDirEntry::StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, bool * pbOk ) : StgAvlNode()
 {
     *pbOk = aEntry.Load( pBuffer, nBufferLen );
 
@@ -71,14 +71,14 @@ void StgDirEntry::InitMembers()
     nEntry      =
     nRefCnt     = 0;
     nMode       = STREAM_READ;
-    bDirect     = sal_True;
+    bDirect     = true;
     bInvalid    =
     bCreated    =
     bRenamed    =
     bRemoved    =
     bTemp       =
     bDirty      =
-    bZombie     = sal_False;
+    bZombie     = false;
 }
 
 StgDirEntry::~StgDirEntry()
@@ -132,17 +132,17 @@ void StgDirEntry::Enum( sal_Int32& n )
 // Delete all temporary entries before writing the TOC stream.
 // Until now Deltem is never called with bForce True
 
-void StgDirEntry::DelTemp( sal_Bool bForce )
+void StgDirEntry::DelTemp( bool bForce )
 {
     if( pLeft )
-        ((StgDirEntry*) pLeft)->DelTemp( sal_False );
+        ((StgDirEntry*) pLeft)->DelTemp( false );
     if( pRight )
-        ((StgDirEntry*) pRight)->DelTemp( sal_False );
+        ((StgDirEntry*) pRight)->DelTemp( false );
     if( pDown )
     {
         // If the storage is dead, of course all elements are dead, too
         if( bInvalid && aEntry.GetType() == STG_STORAGE )
-            bForce = sal_True;
+            bForce = true;
         pDown->DelTemp( bForce );
     }
     if( ( bForce || bInvalid )
@@ -152,12 +152,12 @@ void StgDirEntry::DelTemp( sal_Bool bForce )
         if( pUp )
         {
             // this deletes the element if refcnt == 0!
-            sal_Bool bDel = nRefCnt == 0;
+            bool bDel = nRefCnt == 0;
             StgAvlNode::Remove( (StgAvlNode**) &pUp->pDown, this, bDel );
             if( !bDel )
             {
                 pLeft = pRight = pDown = 0;
-                bInvalid = bZombie = sal_True;
+                bInvalid = bZombie = true;
             }
         }
     }
@@ -165,26 +165,26 @@ void StgDirEntry::DelTemp( sal_Bool bForce )
 
 // Save the tree into the given dir stream
 
-sal_Bool StgDirEntry::Store( StgDirStrm& rStrm )
+bool StgDirEntry::Store( StgDirStrm& rStrm )
 {
-    void* pEntry = rStrm.GetEntry( nEntry, sal_True );
+    void* pEntry = rStrm.GetEntry( nEntry, true );
     if( !pEntry )
-        return sal_False;
+        return false;
     // Do not store the current (maybe not commited) entry
     aSave.Store( pEntry );
     if( pLeft )
         if( !((StgDirEntry*) pLeft)->Store( rStrm ) )
-            return sal_False;
+            return false;
     if( pRight )
         if( !((StgDirEntry*) pRight)->Store( rStrm ) )
-            return sal_False;
+            return false;
     if( pDown )
         if( !pDown->Store( rStrm ) )
-            return sal_False;
-    return sal_True;
+            return false;
+    return true;
 }
 
-sal_Bool StgDirEntry::StoreStream( StgIo& rIo )
+bool StgDirEntry::StoreStream( StgIo& rIo )
 {
     if( aEntry.GetType() == STG_STREAM || aEntry.GetType() == STG_ROOT )
     {
@@ -201,27 +201,27 @@ sal_Bool StgDirEntry::StoreStream( StgIo& rIo )
         }
         // or write the data stream
         else if( !Tmp2Strm() )
-            return sal_False;
+            return false;
     }
-    return sal_True;
+    return true;
 }
 
 // Save all dirty streams
 
-sal_Bool StgDirEntry::StoreStreams( StgIo& rIo )
+bool StgDirEntry::StoreStreams( StgIo& rIo )
 {
     if( !StoreStream( rIo ) )
-        return sal_False;
+        return false;
     if( pLeft )
         if( !((StgDirEntry*) pLeft)->StoreStreams( rIo ) )
-            return sal_False;
+            return false;
     if( pRight )
         if( !((StgDirEntry*) pRight)->StoreStreams( rIo ) )
-            return sal_False;
+            return false;
     if( pDown )
         if( !pDown->StoreStreams( rIo ) )
-            return sal_False;
-    return sal_True;
+            return false;
+    return true;
 }
 
 // Revert all directory entries after failure to write the TOC stream
@@ -239,22 +239,22 @@ void StgDirEntry::RevertAll()
 
 // Look if any element of the tree is dirty
 
-sal_Bool StgDirEntry::IsDirty()
+bool StgDirEntry::IsDirty()
 {
     if( bDirty || bInvalid )
-        return sal_True;
+        return true;
     if( pLeft && ((StgDirEntry*) pLeft)->IsDirty() )
-        return sal_True;
+        return true;
     if( pRight && ((StgDirEntry*) pRight)->IsDirty() )
-        return sal_True;
+        return true;
     if( pDown && pDown->IsDirty() )
-        return sal_True;
-    return sal_False;
+        return true;
+    return false;
 }
 
 // Set up a stream.
 
-void StgDirEntry::OpenStream( StgIo& rIo, sal_Bool bForceBig )
+void StgDirEntry::OpenStream( StgIo& rIo, bool bForceBig )
 {
     sal_Int32 nThreshold = (sal_uInt16) rIo.aHdr.GetThreshold();
     delete pStgStrm;
@@ -266,7 +266,7 @@ void StgDirEntry::OpenStream( StgIo& rIo, sal_Bool bForceBig )
     {
         // This entry has invalid data, so delete that data
         SetSize( 0L );
-//      bRemoved = bInvalid = sal_False;
+//      bRemoved = bInvalid = false;
     }
     nPos = 0;
 }
@@ -299,14 +299,14 @@ sal_Int32 StgDirEntry::GetSize()
 
 // Set the stream size. This means also creating a temp stream.
 
-sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize )
+bool StgDirEntry::SetSize( sal_Int32 nNewSize )
 {
     if (
          !( nMode & STREAM_WRITE ) ||
          (!bDirect && !pTmpStrm && !Strm2Tmp())
        )
     {
-        return sal_False;
+        return false;
     }
 
     if( nNewSize < nPos )
@@ -315,15 +315,15 @@ sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize )
     {
         pTmpStrm->SetSize( nNewSize );
         pStgStrm->GetIo().SetError( pTmpStrm->GetError() );
-        return sal_Bool( pTmpStrm->GetError() == SVSTREAM_OK );
+        return pTmpStrm->GetError() == SVSTREAM_OK;
     }
     else
     {
         OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
         if ( !pStgStrm )
-            return sal_False;
+            return false;
 
-        sal_Bool bRes = sal_False;
+        bool bRes = false;
         StgIo& rIo = pStgStrm->GetIo();
         sal_Int32 nThreshold = rIo.aHdr.GetThreshold();
         // ensure the correct storage stream!
@@ -355,11 +355,11 @@ sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize )
                     pStgStrm->Pos2Page( 0L );
                     if( pOld->Read( pBuf, nOldSize )
                      && pStgStrm->Write( pBuf, nOldSize ) )
-                        bRes = sal_True;
+                        bRes = true;
                     delete[] static_cast<sal_uInt8*>(pBuf);
                 }
                 else
-                    bRes = sal_True;
+                    bRes = true;
                 if( bRes )
                 {
                     pOld->SetSize( 0 );
@@ -377,7 +377,7 @@ sal_Bool StgDirEntry::SetSize( sal_Int32 nNewSize )
             else
             {
                 pStgStrm->Pos2Page( nPos );
-                bRes = sal_True;
+                bRes = true;
             }
         }
         return bRes;
@@ -517,12 +517,12 @@ void StgDirEntry::Copy( BaseStorageStream& rDest )
 
 // Commit this entry
 
-sal_Bool StgDirEntry::Commit()
+bool StgDirEntry::Commit()
 {
     // OSL_ENSURE( nMode & STREAM_WRITE, "Trying to commit readonly stream!" );
 
     aSave = aEntry;
-    sal_Bool bRes = sal_True;
+    bool bRes = true;
     if( aEntry.GetType() == STG_STREAM )
     {
         if( pTmpStrm )
@@ -543,7 +543,7 @@ sal_Bool StgDirEntry::Commit()
 
 // Revert the entry
 
-sal_Bool StgDirEntry::Revert()
+bool StgDirEntry::Revert()
 {
     aEntry = aSave;
     switch( aEntry.GetType() )
@@ -554,24 +554,24 @@ sal_Bool StgDirEntry::Revert()
             break;
         case STG_STORAGE:
         {
-            sal_Bool bSomeRenamed = sal_False;
+            bool bSomeRenamed = false;
             StgIterator aOIter( *this );
             StgDirEntry* op = aOIter.First();
             while( op )
             {
                 op->aEntry = op->aSave;
-                op->bDirty = sal_False;
-                bSomeRenamed = sal_Bool( bSomeRenamed | op->bRenamed );
+                op->bDirty = false;
+                bSomeRenamed = ( bSomeRenamed | op->bRenamed );
                 // Remove any new entries
                 if( op->bCreated )
                 {
-                    op->bCreated = sal_False;
+                    op->bCreated = false;
                     op->Close();
-                    op->bInvalid = sal_True;
+                    op->bInvalid = true;
                 }
                 // Reactivate any removed entries
                 else if( op->bRemoved )
-                    op->bRemoved = op->bInvalid = op->bTemp = sal_False;
+                    op->bRemoved = op->bInvalid = op->bTemp = false;
                 op = aOIter.Next();
             }
             // Resort all renamed entries
@@ -586,12 +586,12 @@ sal_Bool StgDirEntry::Revert()
                         StgAvlNode::Move
                             ( (StgAvlNode**) &p->pUp->pDown,
                               (StgAvlNode**) &p->pUp->pDown, p );
-                        p->bRenamed = sal_False;
+                        p->bRenamed = false;
                     }
                     p = aIter.Next();
                 }
             }
-            DelTemp( sal_False );
+            DelTemp( false );
             break;
         }
         case STG_EMPTY:
@@ -600,12 +600,12 @@ sal_Bool StgDirEntry::Revert()
         case STG_ROOT:
          break;
     }
-    return sal_True;
+    return true;
 }
 
 // Copy the stg stream to the temp stream
 
-sal_Bool StgDirEntry::Strm2Tmp()
+bool StgDirEntry::Strm2Tmp()
 {
     if( !pTmpStrm )
     {
@@ -615,7 +615,7 @@ sal_Bool StgDirEntry::Strm2Tmp()
             // It was already commited once
             pTmpStrm = new StgTmpStrm;
             if( pTmpStrm->GetError() == SVSTREAM_OK && pTmpStrm->Copy( *pCurStrm ) )
-                return sal_True;
+                return true;
             n = 1;  // indicates error
         }
         else
@@ -628,7 +628,7 @@ sal_Bool StgDirEntry::Strm2Tmp()
                 {
                     OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
                     if ( !pStgStrm )
-                        return sal_False;
+                        return false;
 
                     sal_uInt8 aTempBytes[ 4096 ];
                     void* p = static_cast<void*>( aTempBytes );
@@ -660,15 +660,15 @@ sal_Bool StgDirEntry::Strm2Tmp()
 
             delete pTmpStrm;
             pTmpStrm = NULL;
-            return sal_False;
+            return false;
         }
     }
-    return sal_True;
+    return true;
 }
 
 // Copy the temp stream to the stg stream during the final commit
 
-sal_Bool StgDirEntry::Tmp2Strm()
+bool StgDirEntry::Tmp2Strm()
 {
     // We did commit once, but have not written since then
     if( !pTmpStrm )
@@ -677,7 +677,7 @@ sal_Bool StgDirEntry::Tmp2Strm()
     {
         OSL_ENSURE( pStgStrm, "The pointer may not be NULL!" );
         if ( !pStgStrm )
-            return sal_False;
+            return false;
         sal_uLong n = pTmpStrm->GetSize();
         StgStrm* pNewStrm;
         StgIo& rIo = pStgStrm->GetIo();
@@ -706,7 +706,7 @@ sal_Bool StgDirEntry::Tmp2Strm()
                 pTmpStrm->Seek( nPos );
                 pStgStrm->GetIo().SetError( pTmpStrm->GetError() );
                 delete pNewStrm;
-                return sal_False;
+                return false;
             }
             else
             {
@@ -722,12 +722,12 @@ sal_Bool StgDirEntry::Tmp2Strm()
             }
         }
     }
-    return sal_True;
+    return true;
 }
 
 // Check if the given entry is contained in this entry
 
-sal_Bool StgDirEntry::IsContained( StgDirEntry* pStg )
+bool StgDirEntry::IsContained( StgDirEntry* pStg )
 {
     if( aEntry.GetType() == STG_STORAGE )
     {
@@ -736,25 +736,25 @@ sal_Bool StgDirEntry::IsContained( StgDirEntry* pStg )
         while( p )
         {
             if( !p->aEntry.Compare( pStg->aEntry ) )
-                return sal_False;
+                return false;
             if( p->aEntry.GetType() == STG_STORAGE )
                 if( !p->IsContained( pStg ) )
-                    return sal_False;
+                    return false;
             p = aIter.Next();
         }
     }
-    return sal_True;
+    return true;
 }
 
 // Invalidate all open entries by setting the RefCount to 0. If the bDel
 // flag is set, also set the invalid flag to indicate deletion during the
 // next dir stream flush.
 
-void StgDirEntry::Invalidate( sal_Bool bDel )
+void StgDirEntry::Invalidate( bool bDel )
 {
 //  nRefCnt = 0;
     if( bDel )
-        bRemoved = bInvalid = sal_True;
+        bRemoved = bInvalid = true;
     switch( aEntry.GetType() )
     {
         case STG_STORAGE:
@@ -813,7 +813,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
     void* p = ( n == STG_FREE ) ? NULL : GetEntry( n );
     if( p )
     {
-        sal_Bool bOk(sal_False);
+        bool bOk(false);
         StgDirEntry* pCur = new StgDirEntry( p, STGENTRY_SIZE, &bOk );
 
         if( !bOk )
@@ -888,7 +888,7 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
 
 // Extend or shrink the directory stream.
 
-sal_Bool StgDirStrm::SetSize( sal_Int32 nBytes )
+bool StgDirStrm::SetSize( sal_Int32 nBytes )
 {
     // Always allocate full pages
     if ( nBytes < 0 )
@@ -900,12 +900,12 @@ sal_Bool StgDirStrm::SetSize( sal_Int32 nBytes )
 
 // Save the TOC stream into a new substream after saving all data streams
 
-sal_Bool StgDirStrm::Store()
+bool StgDirStrm::Store()
 {
     if( !pRoot || !pRoot->IsDirty() )
-        return sal_True;
+        return true;
     if( !pRoot->StoreStreams( rIo ) )
-        return sal_False;
+        return false;
     // After writing all streams, the data FAT stream has changed,
     // so we have to commit the root again
     pRoot->Commit();
@@ -916,7 +916,7 @@ sal_Bool StgDirStrm::Store()
     nSize  = nPos = 0;
     nOffset = 0;
     // Delete all temporary entries
-    pRoot->DelTemp( sal_False );
+    pRoot->DelTemp( false );
     // set the entry numbers
     sal_Int32 n = 0;
     pRoot->Enum( n );
@@ -924,19 +924,19 @@ sal_Bool StgDirStrm::Store()
     {
         nStart = nOldStart; nSize = nOldSize;
         pRoot->RevertAll();
-        return sal_False;
+        return false;
     }
     // set up the cache elements for the new stream
     if( !Copy( STG_FREE, nSize ) )
     {
         pRoot->RevertAll();
-        return sal_False;
+        return false;
     }
     // Write the data to the new stream
     if( !pRoot->Store( *this ) )
     {
         pRoot->RevertAll();
-        return sal_False;
+        return false;
     }
     // fill any remaining entries with empty data
     sal_Int32 ne = nSize / STGENTRY_SIZE;
@@ -944,23 +944,23 @@ sal_Bool StgDirStrm::Store()
     aEmpty.Init();
     while( n < ne )
     {
-        void* p = GetEntry( n++, sal_True );
+        void* p = GetEntry( n++, true );
         if( !p )
         {
             pRoot->RevertAll();
-            return sal_False;
+            return false;
         }
         aEmpty.Store( p );
     }
     // Now we can release the old stream
-    pFat->FreePages( nOldStart, sal_True );
+    pFat->FreePages( nOldStart, true );
     rIo.aHdr.SetTOCStart( nStart );
-    return sal_True;
+    return true;
 }
 
 // Get a dir entry.
 
-void* StgDirStrm::GetEntry( sal_Int32 n, sal_Bool bDirty )
+void* StgDirStrm::GetEntry( sal_Int32 n, bool bDirty )
 {
     if( n < 0 )
         return NULL;
@@ -968,7 +968,7 @@ void* StgDirStrm::GetEntry( sal_Int32 n, sal_Bool bDirty )
     n *= STGENTRY_SIZE;
     if( n < 0 && n >= nSize )
         return NULL;
-    return GetPtr( n, sal_True, bDirty );
+    return GetPtr( n, true, bDirty );
 }
 
 // Find a dir entry.
@@ -1015,9 +1015,9 @@ StgDirEntry* StgDirStrm::Create
         }
         pRes->bInvalid =
         pRes->bRemoved =
-        pRes->bTemp    = sal_False;
+        pRes->bTemp    = false;
         pRes->bCreated =
-        pRes->bDirty   = sal_True;
+        pRes->bDirty   = true;
     }
     else
     {
@@ -1027,7 +1027,7 @@ StgDirEntry* StgDirStrm::Create
             pRes->pUp    = &rStg;
             pRes->ppRoot = &pRoot;
             pRes->bCreated =
-            pRes->bDirty = sal_True;
+            pRes->bDirty = true;
         }
         else
         {
@@ -1040,44 +1040,44 @@ StgDirEntry* StgDirStrm::Create
 
 // Rename the given entry.
 
-sal_Bool StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew )
+bool StgDirStrm::Rename( StgDirEntry& rStg, const String& rOld, const String& rNew )
 {
     StgDirEntry* p = Find( rStg, rOld );
     if( p )
     {
 
-        if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, sal_False ) )
-            return sal_False;
+        if( !StgAvlNode::Remove( (StgAvlNode**) &rStg.pDown, p, false ) )
+            return false;
         p->aEntry.SetName( rNew );
         if( !StgAvlNode::Insert( (StgAvlNode**) &rStg.pDown, p ) )
-            return sal_False;
-        p->bRenamed = p->bDirty   = sal_True;
-        return sal_True;
+            return false;
+        p->bRenamed = p->bDirty   = true;
+        return true;
     }
     else
     {
         rIo.SetError( SVSTREAM_FILE_NOT_FOUND );
-        return sal_False;
+        return false;
     }
 }
 
 // Move the given entry to a different storage.
 
-sal_Bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName )
+bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const String& rName )
 {
     StgDirEntry* p = Find( rStg1, rName );
     if( p )
     {
         if( !StgAvlNode::Move
             ( (StgAvlNode**) &rStg1.pDown, (StgAvlNode**) &rStg2.pDown, p ) )
-            return sal_False;
-        p->bDirty = sal_True;
-        return sal_True;
+            return false;
+        p->bDirty = true;
+        return true;
     }
     else
     {
         rIo.SetError( SVSTREAM_FILE_NOT_FOUND );
-        return sal_False;
+        return false;
     }
 }
 
diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx
index c62a035..d2196d3 100644
--- a/sot/source/sdstor/stgdir.hxx
+++ b/sot/source/sdstor/stgdir.hxx
@@ -43,46 +43,46 @@ class StgDirEntry : public StgAvlNode
     StgTmpStrm*  pCurStrm;                  // temp stream after commit
     sal_Int32        nEntry;                    // entry # in TOC stream (temp)
     sal_Int32        nPos;                      // current position
-    sal_Bool         bDirty;                    // dirty directory entry
-    sal_Bool         bCreated;                  // newly created entry
-    sal_Bool         bRemoved;                  // removed per Invalidate()
-    sal_Bool         bRenamed;                  // renamed
+    bool         bDirty;                    // dirty directory entry
+    bool         bCreated;                  // newly created entry
+    bool         bRemoved;                  // removed per Invalidate()
+    bool         bRenamed;                  // renamed
     void         InitMembers();             // ctor helper
     virtual short Compare( const StgAvlNode* ) const;
-    sal_Bool         StoreStream( StgIo& );     // store the stream
-    sal_Bool         StoreStreams( StgIo& );    // store all streams
+    bool         StoreStream( StgIo& );     // store the stream
+    bool         StoreStreams( StgIo& );    // store all streams
     void         RevertAll();               // revert the whole tree
-    sal_Bool         Strm2Tmp();                // copy stgstream to temp file
-    sal_Bool         Tmp2Strm();                // copy temp file to stgstream
+    bool         Strm2Tmp();                // copy stgstream to temp file
+    bool         Tmp2Strm();                // copy temp file to stgstream
 public:
     StgEntry     aEntry;                    // entry data
     sal_Int32        nRefCnt;                   // reference count
     StreamMode   nMode;                     // open mode
-    sal_Bool         bTemp;                     // sal_True: delete on dir flush
-    sal_Bool         bDirect;                   // sal_True: direct mode
-    sal_Bool         bZombie;                   // sal_True: Removed From StgIo
-    sal_Bool         bInvalid;                  // sal_True: invalid entry
-    StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, sal_Bool * pbOk );
+    bool         bTemp;                     // true: delete on dir flush
+    bool         bDirect;                   // true: direct mode
+    bool         bZombie;                   // true: Removed From StgIo
+    bool         bInvalid;                  // true: invalid entry
+    StgDirEntry( const void* pBuffer, sal_uInt32 nBufferLen, bool * pbOk );
     StgDirEntry( const StgEntry& );
     ~StgDirEntry();
 
-    void Invalidate( sal_Bool=sal_False );          // invalidate all open entries
+    void Invalidate( bool=false );          // invalidate all open entries
     void Enum( sal_Int32& );                    // enumerate entries for iteration
-    void DelTemp( sal_Bool );                   // delete temporary entries
-    sal_Bool Store( StgDirStrm& );              // save entry into dir strm
-    sal_Bool IsContained( StgDirEntry* );       // check if subentry
+    void DelTemp( bool );                   // delete temporary entries
+    bool Store( StgDirStrm& );              // save entry into dir strm
+    bool IsContained( StgDirEntry* );       // check if subentry
 
-    void SetDirty()  { bDirty = sal_True; }
-    sal_Bool IsDirty();
+    void SetDirty()  { bDirty = true; }
+    bool IsDirty();
     void ClearDirty();
 
-    sal_Bool Commit();
-    sal_Bool Revert();
+    bool Commit();
+    bool Revert();
 
-    void  OpenStream( StgIo&, sal_Bool=sal_False );     // set up an approbiate stream
+    void  OpenStream( StgIo&, bool=false );     // set up an approbiate stream
     void  Close();
     sal_Int32 GetSize();
-    sal_Bool  SetSize( sal_Int32 );
+    bool  SetSize( sal_Int32 );
     sal_Int32 Seek( sal_Int32 );
     sal_Int32 Tell() { return nPos; }
     sal_Int32 Read( void*, sal_Int32 );
@@ -99,15 +99,15 @@ class StgDirStrm : public StgDataStrm
 public:
     StgDirStrm( StgIo& );
     ~StgDirStrm();
-    virtual sal_Bool SetSize( sal_Int32 );              // change the size
-    sal_Bool         Store();
-    void*        GetEntry( sal_Int32 n, sal_Bool=sal_False );// get an entry
+    virtual bool SetSize( sal_Int32 );              // change the size
+    bool         Store();
+    void*        GetEntry( sal_Int32 n, bool=false );// get an entry
     StgDirEntry* GetRoot() { return pRoot; }
     StgDirEntry* Find( StgDirEntry&, const String& );
     StgDirEntry* Create( StgDirEntry&, const String&, StgEntryType );
-    sal_Bool         Remove( StgDirEntry&, const String& );
-    sal_Bool         Rename( StgDirEntry&, const String&, const String& );
-    sal_Bool         Move( StgDirEntry&, StgDirEntry&, const String& );
+    bool         Remove( StgDirEntry&, const String& );
+    bool         Rename( StgDirEntry&, const String&, const String& );
+    bool         Move( StgDirEntry&, StgDirEntry&, const String& );
 };
 
 class StgIterator : public StgAvlIterator
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index b2c94ef..4dda871 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -36,10 +36,10 @@
 ///////////////////////////// class StgFAT ///////////////////////////////
 
 // The FAT class performs FAT operations on an underlying storage stream.
-// This stream is either the master FAT stream (m == sal_True ) or a normal
+// This stream is either the master FAT stream (m == true ) or a normal
 // storage stream, which then holds the FAT for small data allocations.
 
-StgFAT::StgFAT( StgStrm& r, sal_Bool m ) : rStrm( r )
+StgFAT::StgFAT( StgStrm& r, bool m ) : rStrm( r )
 {
     bPhys   = m;
     nPageSize = rStrm.GetIo().GetPhysPageSize();
@@ -61,7 +61,7 @@ rtl::Reference< StgPage > StgFAT::GetPhysPage( sal_Int32 nByteOff )
         nOffset = rStrm.GetOffset();
         sal_Int32 nPhysPage = rStrm.GetPage();
         // get the physical page (must be present)
-        pPg = rStrm.GetIo().Get( nPhysPage, sal_True );
+        pPg = rStrm.GetIo().Get( nPhysPage, true );
     }
     return pPg;
 }
@@ -90,7 +90,7 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
     sal_Int32 nMaxStart = STG_EOF, nMaxLen = 0x7FFFFFFFL;
     sal_Int32 nTmpStart = STG_EOF, nTmpLen = 0;
     sal_Int32 nPages    = rStrm.GetSize() >> 2;
-    sal_Bool bFound     = sal_False;
+    bool bFound     = false;
     rtl::Reference< StgPage > pPg;
     short nEntry = 0;
     for( sal_Int32 i = 0; i < nPages; i++, nEntry++ )
@@ -121,12 +121,12 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
         {
             if( nTmpLen > nPgs && nTmpLen < nMaxLen )
                 // block > requested size
-                nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = sal_True;
+                nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = true;
             else if( nTmpLen >= nMinLen )
             {
                 // block < requested size
                 nMinLen = nTmpLen, nMinStart = nTmpStart;
-                bFound = sal_True;
+                bFound = true;
                 if( nTmpLen == nPgs )
                     break;
             }
@@ -164,19 +164,19 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs )
 
 // Set up the consecutive chain for a given block.
 
-sal_Bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs )
+bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs )
 {
     sal_Int32 nPos = nStart << 2;
     rtl::Reference< StgPage > pPg = GetPhysPage( nPos );
     if( !pPg.is() || !nPgs )
-        return sal_False;
+        return false;
     while( --nPgs )
     {
         if( nOffset >= nPageSize )
         {
             pPg = GetPhysPage( nPos );
             if( !pPg.is() )
-                return sal_False;
+                return false;
         }
         rStrm.GetIo().SetToPage( pPg, nOffset >> 2, ++nStart );
         nOffset += 4;
@@ -186,10 +186,10 @@ sal_Bool StgFAT::MakeChain( sal_Int32 nStart, sal_Int32 nPgs )
     {
         pPg = GetPhysPage( nPos );
         if( !pPg.is() )
-            return sal_False;
+            return false;
     }
     rStrm.GetIo().SetToPage( pPg, nOffset >> 2, STG_EOF );
-    return sal_True;
+    return true;
 }
 
 // Allocate a block of data from the given page number on.
@@ -237,7 +237,7 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
             if( !rStrm.SetSize( ( nPages + nPgs ) << 2 ) )
                 return STG_EOF;
             if( !bPhys && !InitNew( nPages ) )
-                return sal_False;
+                return false;
             nPages = rStrm.GetSize() >> 2;
             nPasses++;
         }
@@ -257,7 +257,7 @@ sal_Int32 StgFAT::AllocPages( sal_Int32 nBgn, sal_Int32 nPgs )
 // It can be assumed that the stream size is always on
 // a page boundary
 
-sal_Bool StgFAT::InitNew( sal_Int32 nPage1 )
+bool StgFAT::InitNew( sal_Int32 nPage1 )
 {
     sal_Int32 n = ( ( rStrm.GetSize() >> 2 ) - nPage1 ) / nEntries;
     if ( n > 0 )
@@ -271,30 +271,30 @@ sal_Bool StgFAT::InitNew( sal_Int32 nPage1 )
             // Initialize the page
             pPg = rStrm.GetIo().Copy( rStrm.GetPage(), STG_FREE );
             if ( !pPg.is() )
-                return sal_False;
+                return false;
             for( short i = 0; i < nEntries; i++ )
                 rStrm.GetIo().SetToPage( pPg, i, STG_FREE );
             nPage1++;
         }
     }
-    return sal_True;
+    return true;
 }
 
 // Release a chain
 
-sal_Bool StgFAT::FreePages( sal_Int32 nStart, sal_Bool bAll )
+bool StgFAT::FreePages( sal_Int32 nStart, bool bAll )
 {
     while( nStart >= 0 )
     {
         rtl::Reference< StgPage > pPg = GetPhysPage( nStart << 2 );
         if( !pPg.is() )
-            return sal_False;
+            return false;
         nStart = rStrm.GetIo().GetFromPage( pPg, nOffset >> 2 );
         // The first released page is either set to EOF or FREE
         rStrm.GetIo().SetToPage( pPg, nOffset >> 2, bAll ? STG_FREE : STG_EOF );
-        bAll = sal_True;
+        bAll = true;
     }
-    return sal_True;
+    return true;
 }
 
 ///////////////////////////// class StgStrm ////////////////////////////////
@@ -366,10 +366,10 @@ void StgStrm::scanBuildPageChainCache(sal_Int32 *pOptionalCalcSize)
 // Compute page number and offset for the given byte position.
 // If the position is behind the size, set the stream right
 // behind the EOF.
-sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
+bool StgStrm::Pos2Page( sal_Int32 nBytePos )
 {
     if ( !pFat )
-        return sal_False;
+        return false;
 
     // Values < 0 seek to the end
     if( nBytePos < 0 || nBytePos >= nSize )
@@ -382,7 +382,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
     nOffset = (short) ( nBytePos & ~nMask );
     nPos = nBytePos;
     if( nOld == nNew )
-        return sal_True;
+        return true;
 
     // See fdo#47644 for a .doc with a vast amount of pages where seeking around the
     // document takes a colossal amount of time
@@ -419,7 +419,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
         rIo.SetError( SVSTREAM_FILEFORMAT_ERROR );
         nPage = STG_EOF;
         nOffset = nPageSize;
-        return sal_False;
+        return false;
     }
     // special case: seek to 1st byte of new, unallocated page
     // (in case the file size is a multiple of the page size)
@@ -431,7 +431,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
     else if ( nIdx == m_aPagesCache.size() )
     {
         nPage = STG_EOF;
-        return sal_False;
+        return false;
     }
 
     nPage = m_aPagesCache[ nIdx ];
@@ -441,7 +441,7 @@ sal_Bool StgStrm::Pos2Page( sal_Int32 nBytePos )
 
 // Retrieve the physical page for a given byte offset.
 
-rtl::Reference< StgPage > StgStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce )
+rtl::Reference< StgPage > StgStrm::GetPhysPage( sal_Int32 nBytePos, bool bForce )
 {
     if( !Pos2Page( nBytePos ) )
         return NULL;
@@ -451,10 +451,10 @@ rtl::Reference< StgPage > StgStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bFo
 // Copy an entire stream. Both streams are allocated in the FAT.
 // The target stream is this stream.
 
-sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes )
+bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes )
 {
     if ( !pFat )
-        return sal_False;
+        return false;
 
     m_aPagesCache.clear();
 
@@ -465,7 +465,7 @@ sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes )
         if( nTo < 0 )
         {
             rIo.SetError( SVSTREAM_FILEFORMAT_ERROR );
-            return sal_False;
+            return false;
         }
         rIo.Copy( nTo, nFrom );
         if( nFrom >= 0 )
@@ -474,18 +474,18 @@ sal_Bool StgStrm::Copy( sal_Int32 nFrom, sal_Int32 nBytes )
             if( nFrom < 0 )
             {
                 rIo.SetError( SVSTREAM_FILEFORMAT_ERROR );
-                return sal_False;
+                return false;
             }
         }
         nTo = pFat->GetNextPage( nTo );
     }
-    return sal_True;
+    return true;
 }
 
-sal_Bool StgStrm::SetSize( sal_Int32 nBytes )
+bool StgStrm::SetSize( sal_Int32 nBytes )
 {
     if ( nBytes < 0 || !pFat )
-        return sal_False;
+        return false;
 
     m_aPagesCache.clear();
 
@@ -495,18 +495,18 @@ sal_Bool StgStrm::SetSize( sal_Int32 nBytes )
     if( nNew > nOld )
     {
         if( !Pos2Page( nSize ) )
-            return sal_False;
+            return false;
         sal_Int32 nBgn = pFat->AllocPages( nPage, ( nNew - nOld ) / nPageSize );
         if( nBgn == STG_EOF )
-            return sal_False;
+            return false;
         if( nStart == STG_EOF )
             nStart = nPage = nBgn;
     }
     else if( nNew < nOld )
     {
-        sal_Bool bAll = sal_Bool( nBytes == 0 );
+        bool bAll = ( nBytes == 0 );
         if( !Pos2Page( nBytes ) || !pFat->FreePages( nPage, bAll ) )
-            return sal_False;
+            return false;
         if( bAll )
             nStart = nPage = STG_EOF;
     }
@@ -520,7 +520,7 @@ sal_Bool StgStrm::SetSize( sal_Int32 nBytes )
     }
     nSize = nBytes;
     pFat->SetLimit( GetPages() );
-    return sal_True;
+    return true;
 }
 
 // Return the # of allocated pages
@@ -538,11 +538,11 @@ sal_Int32 StgStrm::GetPages() const
 
 StgFATStrm::StgFATStrm( StgIo& r ) : StgStrm( r )
 {
-    pFat = new StgFAT( *this, sal_True );
+    pFat = new StgFAT( *this, true );
     nSize = rIo.aHdr.GetFATSize() * nPageSize;
 }
 
-sal_Bool StgFATStrm::Pos2Page( sal_Int32 nBytePos )
+bool StgFATStrm::Pos2Page( sal_Int32 nBytePos )
 {
     // Values < 0 seek to the end
     if( nBytePos < 0 || nBytePos >= nSize  )
@@ -550,15 +550,15 @@ sal_Bool StgFATStrm::Pos2Page( sal_Int32 nBytePos )
     nPage   = nBytePos / nPageSize;
     nOffset = (short) ( nBytePos % nPageSize );
     nPos    = nBytePos;
-    nPage   = GetPage( (short) nPage, sal_False );
-    return sal_Bool( nPage >= 0 );
+    nPage   = GetPage( (short) nPage, false );
+    return nPage >= 0;
 }
 
 // Retrieve the physical page for a given byte offset.
 // Since Pos2Page() already has computed the physical offset,
 // use the byte offset directly.
 
-rtl::Reference< StgPage > StgFATStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce )
+rtl::Reference< StgPage > StgFATStrm::GetPhysPage( sal_Int32 nBytePos, bool bForce )
 {
     OSL_ENSURE( nBytePos >= 0, "The value may not be negative!" );
     return rIo.Get( nBytePos / ( nPageSize >> 2 ), bForce );
@@ -566,7 +566,7 @@ rtl::Reference< StgPage > StgFATStrm::GetPhysPage( sal_Int32 nBytePos, sal_Bool
 
 // Get the page number entry for the given page offset.
 
-sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterAlloc )
+sal_Int32 StgFATStrm::GetPage( short nOff, bool bMake, sal_uInt16 *pnMasterAlloc )
 {
     OSL_ENSURE( nOff >= 0, "The offset may not be negative!" );
     if( pnMasterAlloc ) *pnMasterAlloc = 0;
@@ -612,7 +612,7 @@ sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterA
                     {
                         if( !Pos2Page( nFAT << 2 ) )
                             return STG_EOF;
-                        rtl::Reference< StgPage > pPg = rIo.Get( nPage, sal_True );
+                        rtl::Reference< StgPage > pPg = rIo.Get( nPage, true );
                         if( !pPg.is() )
                             return STG_EOF;
                         rIo.SetToPage( pPg, nOffset >> 2, STG_MASTER );
@@ -626,7 +626,7 @@ sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterA
         }
         else
         {
-            pMaster = rIo.Get( nFAT, sal_True );
+            pMaster = rIo.Get( nFAT, true );
             if ( pMaster.is() )
             {
                 nFAT = rIo.GetFromPage( pMaster, nMasterCount );
@@ -643,12 +643,12 @@ sal_Int32 StgFATStrm::GetPage( short nOff, sal_Bool bMake, sal_uInt16 *pnMasterA
 
 // Set the page number entry for the given page offset.
 
-sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
+bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
 {
     OSL_ENSURE( nOff >= 0, "The offset may not be negative!" );
     m_aPagesCache.clear();
 
-    sal_Bool bRes = sal_True;
+    bool bRes = true;
     if( nOff < rIo.aHdr.GetFAT1Size() )
         rIo.aHdr.SetFATPage( nOff, nNewPage );
     else
@@ -669,7 +669,7 @@ sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
                 pMaster = 0;
                 break;
             }
-            pMaster = rIo.Get( nFAT, sal_True );
+            pMaster = rIo.Get( nFAT, true );
             if ( pMaster.is() )
                 nFAT = rIo.GetFromPage( pMaster, nMasterCount );
         }
@@ -678,7 +678,7 @@ sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
         else
         {
             rIo.SetError( SVSTREAM_GENERALERROR );
-            bRes = sal_False;
+            bRes = false;
         }
     }
 
@@ -686,19 +686,19 @@ sal_Bool StgFATStrm::SetPage( short nOff, sal_Int32 nNewPage )
     if( bRes )
     {
         Pos2Page( nNewPage << 2 );
-        rtl::Reference< StgPage > pPg = rIo.Get( nPage, sal_True );
+        rtl::Reference< StgPage > pPg = rIo.Get( nPage, true );
         if( pPg.is() )
             rIo.SetToPage( pPg, nOffset >> 2, STG_FAT );
         else
-            bRes = sal_False;
+            bRes = false;
     }
     return bRes;
 }
 
-sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes )
+bool StgFATStrm::SetSize( sal_Int32 nBytes )
 {
     if ( nBytes < 0 )
-        return sal_False;
+        return false;
 
     m_aPagesCache.clear();
 
@@ -720,9 +720,9 @@ sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes )
             // find a free master page slot
             sal_Int32 nPg = 0;
             sal_uInt16 nMasterAlloc = 0;
-            nPg = GetPage( nOld, sal_True, &nMasterAlloc );
+            nPg = GetPage( nOld, true, &nMasterAlloc );
             if( nPg == STG_EOF )
-                return sal_False;
+                return false;
             // 4 Bytes have been used for Allocation of each MegaMasterPage
             nBytes += nMasterAlloc << 2;
 
@@ -742,12 +742,12 @@ sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes )
                 // adjust the file size if necessary
                 if( nNewPage >= rIo.GetPhysPages() )
                     if( !rIo.SetSize( nNewPage + 1 ) )
-                        return sal_False;
+                        return false;
             }
             // Set up the page with empty entries
             rtl::Reference< StgPage > pPg = rIo.Copy( nNewPage, STG_FREE );
             if ( !pPg.is() )
-                return sal_False;
+                return false;
             for( short j = 0; j < ( nPageSize >> 2 ); j++ )
                 rIo.SetToPage( pPg, j, STG_FREE );
 
@@ -764,16 +764,16 @@ sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes )
                 for( sal_uInt16 nCount = 0; nCount < nMax; nCount++ )
                 {
                     if( !Pos2Page( nFAT << 2 ) )
-                        return sal_False;
+                        return false;
                     if( nMax - nCount <= nMasterAlloc )
                     {
-                        rtl::Reference< StgPage > piPg = rIo.Get( nPage, sal_True );
+                        rtl::Reference< StgPage > piPg = rIo.Get( nPage, true );
                         if( !piPg.is() )
-                            return sal_False;
+                            return false;
                         rIo.SetToPage( piPg, nOffset >> 2, STG_MASTER );
                     }
-                    rtl::Reference< StgPage > pPage = rIo.Get( nFAT, sal_True );
-                    if( !pPage.is() ) return sal_False;
+                    rtl::Reference< StgPage > pPage = rIo.Get( nFAT, true );
+                    if( !pPage.is() ) return false;
                     nFAT = rIo.GetFromPage( pPage, (nPageSize >> 2 ) - 1 );
                 }
 
@@ -786,7 +786,7 @@ sal_Bool StgFATStrm::SetSize( sal_Int32 nBytes )
     }
     nSize = nNew * nPageSize;
     rIo.aHdr.SetFATSize( nNew );
-    return sal_True;
+    return true;
 }
 
 /////////////////////////// class StgDataStrm //////////////////////////////
@@ -811,7 +811,7 @@ StgDataStrm::StgDataStrm( StgIo& r, StgDirEntry& p ) : StgStrm( r )
 void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
 {
     if ( rIo.pFAT )
-        pFat = new StgFAT( *rIo.pFAT, sal_True );
+        pFat = new StgFAT( *rIo.pFAT, true );
 
     OSL_ENSURE( pFat, "The pointer should not be empty!" );
 
@@ -829,21 +829,21 @@ void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
 
 // Set the size of a physical stream.
 
-sal_Bool StgDataStrm::SetSize( sal_Int32 nBytes )
+bool StgDataStrm::SetSize( sal_Int32 nBytes )
 {
     if ( !pFat )
-        return sal_False;
+        return false;
 
     nBytes = ( ( nBytes + nIncr - 1 ) / nIncr ) * nIncr;
     sal_Int32 nOldSz = nSize;
     if( ( nOldSz != nBytes ) )
     {
         if( !StgStrm::SetSize( nBytes ) )
-            return sal_False;
+            return false;
         sal_Int32 nMaxPage = pFat->GetMaxPage();
         if( nMaxPage > rIo.GetPhysPages() )
             if( !rIo.SetSize( nMaxPage ) )
-                return sal_False;
+                return false;
         // If we only allocated one page or less, create this
         // page in the cache for faster throughput. The current
         // position is the former EOF point.
@@ -854,14 +854,14 @@ sal_Bool StgDataStrm::SetSize( sal_Int32 nBytes )
                 rIo.Copy( nPage, STG_FREE );
         }
     }
-    return sal_True;
+    return true;
 }
 
 // Get the address of the data byte at a specified offset.
-// If bForce = sal_True, a read of non-existent data causes
+// If bForce = true, a read of non-existent data causes
 // a read fault.
 
-void* StgDataStrm::GetPtr( sal_Int32 Pos, sal_Bool bForce, sal_Bool bDirty )
+void* StgDataStrm::GetPtr( sal_Int32 Pos, bool bForce, bool bDirty )
 {
     if( Pos2Page( Pos ) )
     {
@@ -914,7 +914,7 @@ sal_Int32 StgDataStrm::Read( void* pBuf, sal_Int32 n )
             else
             {
                 // partial block read thru the cache.
-                pPg = rIo.Get( nPage, sal_False );
+                pPg = rIo.Get( nPage, false );
                 if( !pPg.is() )
                     break;
                 memcpy( p, (sal_uInt8*)pPg->GetData() + nOffset, nBytes );
@@ -974,7 +974,7 @@ sal_Int32 StgDataStrm::Write( const void* pBuf, sal_Int32 n )
             else
             {
                 // partial block read thru the cache.
-                pPg = rIo.Get( nPage, sal_False );
+                pPg = rIo.Get( nPage, false );
                 if( !pPg.is() )
                     break;
                 memcpy( (sal_uInt8*)pPg->GetData() + nOffset, p, nBytes );
@@ -1017,7 +1017,7 @@ StgSmallStrm::StgSmallStrm( StgIo& r, StgDirEntry& p ) : StgStrm( r )
 void StgSmallStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
 {
     if ( rIo.pDataFAT )
-        pFat = new StgFAT( *rIo.pDataFAT, sal_False );
+        pFat = new StgFAT( *rIo.pDataFAT, false );
     pData = rIo.pDataStrm;
     OSL_ENSURE( pFat && pData, "The pointers should not be empty!" );
 
@@ -1073,7 +1073,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n )
     {
         sal_Int32 nOld = nPos;
         if( !SetSize( nPos + n ) )
-            return sal_False;
+            return false;
         Pos2Page( nOld );
     }
     while( n )
@@ -1126,7 +1126,7 @@ StgTmpStrm::StgTmpStrm( sal_uLong nInitSize )
         SetSize( nInitSize );
 }
 
-sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
+bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
 {
     sal_uLong n    = rSrc.GetSize();
     sal_uLong nCur = rSrc.Tell();
@@ -1150,10 +1150,10 @@ sal_Bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
         delete [] p;
         rSrc.Seek( nCur );
         Seek( nCur );
-        return sal_Bool( n == 0 );
+        return n == 0;
     }
     else
-        return sal_False;
+        return false;
 }
 
 StgTmpStrm::~StgTmpStrm()
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 1b9f93d..dfd3908 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -30,7 +30,7 @@ class StgPage;
 class StgDirEntry;
 
 // The FAT class performs FAT operations on an underlying storage stream.
-// This stream is either the physical FAT stream (bPhys == sal_True ) or a normal
+// This stream is either the physical FAT stream (bPhys == true ) or a normal
 // storage stream, which then holds the FAT for small data allocations.
 
 class StgFAT
@@ -41,16 +41,16 @@ class StgFAT
     short nEntries;                     // FAT entries per page
     short nOffset;                      // current offset within page
     sal_Int32 nLimit;                       // search limit recommendation
-    sal_Bool  bPhys;                        // sal_True: physical FAT
+    bool  bPhys;                        // true: physical FAT
     rtl::Reference< StgPage > GetPhysPage( sal_Int32 nPage );
-    sal_Bool  MakeChain( sal_Int32 nStart, sal_Int32 nPages );
-    sal_Bool  InitNew( sal_Int32 nPage1 );
+    bool  MakeChain( sal_Int32 nStart, sal_Int32 nPages );
+    bool  InitNew( sal_Int32 nPage1 );
 public:
-    StgFAT( StgStrm& rStrm, sal_Bool bMark );
+    StgFAT( StgStrm& rStrm, bool bMark );
     sal_Int32 FindBlock( sal_Int32& nPages );
     sal_Int32 GetNextPage( sal_Int32 nPg );
     sal_Int32 AllocPages( sal_Int32 nStart, sal_Int32 nPages );
-    sal_Bool  FreePages( sal_Int32 nStart, sal_Bool bAll );
+    bool  FreePages( sal_Int32 nStart, bool bAll );
     sal_Int32 GetMaxPage() { return nMaxPage; }
     void  SetLimit( sal_Int32 n ) { nLimit = n; }
 };
@@ -72,7 +72,7 @@ protected:
     short nPageSize;                    // logical page size
     std::vector<sal_Int32> m_aPagesCache;
     void scanBuildPageChainCache(sal_Int32 *pOptionalCalcSize = NULL);
-    sal_Bool  Copy( sal_Int32 nFrom, sal_Int32 nBytes );
+    bool  Copy( sal_Int32 nFrom, sal_Int32 nBytes );
     StgStrm( StgIo& );
 public:
     virtual ~StgStrm();
@@ -85,12 +85,12 @@ public:
     sal_Int32   GetPages() const;
     short   GetOffset() const { return nOffset;}
     void    SetEntry( StgDirEntry& );
-    virtual sal_Bool SetSize( sal_Int32 );
-    virtual sal_Bool Pos2Page( sal_Int32 nBytePos );
+    virtual bool SetSize( sal_Int32 );
+    virtual bool Pos2Page( sal_Int32 nBytePos );
     virtual sal_Int32 Read( void*, sal_Int32 )        { return 0; }
     virtual sal_Int32 Write( const void*, sal_Int32 ) { return 0; }
-    virtual rtl::Reference< StgPage > GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False );
-    virtual sal_Bool IsSmallStrm() const { return sal_False; }
+    virtual rtl::Reference< StgPage > GetPhysPage( sal_Int32 nBytePos, bool bForce = false );
+    virtual bool IsSmallStrm() const { return false; }
 };
 
 // The FAT stream class provides physical access to the master FAT.
@@ -98,15 +98,15 @@ public:
 // FAT allocator.
 
 class StgFATStrm : public StgStrm {     // the master FAT stream
-    virtual sal_Bool Pos2Page( sal_Int32 nBytePos );
-    sal_Bool  SetPage( short, sal_Int32 );
+    virtual bool Pos2Page( sal_Int32 nBytePos );
+    bool  SetPage( short, sal_Int32 );
 public:
     StgFATStrm( StgIo& );
     virtual ~StgFATStrm() {}
     using StgStrm::GetPage;
-    sal_Int32 GetPage( short, sal_Bool, sal_uInt16 *pnMasterAlloc = 0);
-    virtual sal_Bool SetSize( sal_Int32 );
-    virtual rtl::Reference< StgPage > GetPhysPage( sal_Int32 nBytePos, sal_Bool bForce = sal_False );
+    sal_Int32 GetPage( short, bool, sal_uInt16 *pnMasterAlloc = 0);
+    virtual bool SetSize( sal_Int32 );
+    virtual rtl::Reference< StgPage > GetPhysPage( sal_Int32 nBytePos, bool bForce = false );
 };
 
 // The stream has a size increment which normally is 1, but which can be
@@ -119,9 +119,9 @@ class StgDataStrm : public StgStrm      // a physical data stream
 public:
     StgDataStrm( StgIo&, sal_Int32 nBgn, sal_Int32 nLen=-1 );
     StgDataStrm( StgIo&, StgDirEntry& );
-    void* GetPtr( sal_Int32 nPos, sal_Bool bForce, sal_Bool bDirty );
+    void* GetPtr( sal_Int32 nPos, bool bForce, bool bDirty );
     void SetIncrement( short n ) { nIncr = n ; }
-    virtual sal_Bool SetSize( sal_Int32 );
+    virtual bool SetSize( sal_Int32 );
     virtual sal_Int32 Read( void*, sal_Int32 );
     virtual sal_Int32 Write( const void*, sal_Int32 );
 };
@@ -140,7 +140,7 @@ public:
     StgSmallStrm( StgIo&, StgDirEntry& );
     virtual sal_Int32 Read( void*, sal_Int32 );
     virtual sal_Int32 Write( const void*, sal_Int32 );
-    virtual sal_Bool IsSmallStrm() const { return sal_True; }
+    virtual bool IsSmallStrm() const { return true; }
 };
 
 class StgTmpStrm : public SvMemoryStream
@@ -156,7 +156,7 @@ class StgTmpStrm : public SvMemoryStream
 public:
     StgTmpStrm( sal_uLong=16 );
    ~StgTmpStrm();
-    sal_Bool Copy( StgTmpStrm& );
+    bool Copy( StgTmpStrm& );
     void SetSize( sal_uLong );
     sal_uLong GetSize() const;
 };
commit 108a95630d5f4a8cf8aa075cee950a75d2628dfe
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 18:39:10 2013 +0100

    move clang plugin that's no longer needed
    
    But still keep it in case it'd be needed again, or simply
    as a starting reference.
    
    Change-Id: If519e1320e1bd6dce7746b57172324b33504051e

diff --git a/compilerplugins/clang/lclstaticfix.cxx b/compilerplugins/clang/lclstaticfix.cxx
deleted file mode 100644
index e966139..0000000
--- a/compilerplugins/clang/lclstaticfix.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * Based on LLVM/Clang.
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- */
-
-#include "lclstaticfix.hxx"
-
-#include <clang/AST/ASTContext.h>
-#include <clang/Basic/SourceManager.h>
-
-/*
-This is a rewriter.
-
-Check all lcl_ functions and prepend static if needed.
-*/
-
-namespace loplugin
-{
-
-LclStaticFix::LclStaticFix( ASTContext& context, Rewriter& rewriter )
-    : RewritePlugin( context, rewriter )
-    {
-    }
-
-void LclStaticFix::run()
-    {
-    TraverseDecl( context.getTranslationUnitDecl());
-    }
-
-bool LclStaticFix::VisitFunctionDecl( FunctionDecl* declaration )
-    {
-    if( ignoreLocation( declaration ))
-        return true;
-    if( declaration->isCXXClassMember())
-        return true;
-    if( declaration->getStorageClass() == SC_Static )
-        return true;
-    string name = declaration->getQualifiedNameAsString();
-    if( name.find( "::" ) != string::npos )
-        return true;
-    if( name.compare( 0, 4, "lcl_" ) != 0 )
-        return true;
-    insertText( declaration->getLocStart(), "static " );
-    return true;
-    }
-
-static Plugin::Registration< LclStaticFix > X( "lclstaticfix" );
-
-} // namespace
diff --git a/compilerplugins/clang/lclstaticfix.hxx b/compilerplugins/clang/lclstaticfix.hxx
deleted file mode 100644
index 64e5b29..0000000
--- a/compilerplugins/clang/lclstaticfix.hxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * Based on LLVM/Clang.
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- */
-
-#ifndef LCLSTATICFIX_H
-#define LCLSTATICFIX_H
-
-#include "plugin.hxx"
-
-namespace loplugin
-{
-
-class LclStaticFix
-    : public RecursiveASTVisitor< LclStaticFix >
-    , public RewritePlugin
-    {
-    public:
-        explicit LclStaticFix( ASTContext& context, Rewriter& rewriter );
-        virtual void run();
-        bool VisitFunctionDecl( FunctionDecl* declaration );
-    };
-
-} // namespace
-
-#endif // POSTFIXINCREMENTFIX_H
-
diff --git a/compilerplugins/clang/store/README b/compilerplugins/clang/store/README
new file mode 100644
index 0000000..b562544
--- /dev/null
+++ b/compilerplugins/clang/store/README
@@ -0,0 +1,3 @@
+This plugin actions are not used. They are still kept in case they would be useful again
+(they can be activated again by simply moving them back in the clang/ source directory)
+or simply as a reference when writing new plugins.
diff --git a/compilerplugins/clang/store/lclstaticfix.cxx b/compilerplugins/clang/store/lclstaticfix.cxx
new file mode 100644
index 0000000..e966139
--- /dev/null
+++ b/compilerplugins/clang/store/lclstaticfix.cxx
@@ -0,0 +1,54 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#include "lclstaticfix.hxx"
+
+#include <clang/AST/ASTContext.h>
+#include <clang/Basic/SourceManager.h>
+
+/*
+This is a rewriter.
+
+Check all lcl_ functions and prepend static if needed.
+*/
+
+namespace loplugin
+{
+
+LclStaticFix::LclStaticFix( ASTContext& context, Rewriter& rewriter )
+    : RewritePlugin( context, rewriter )
+    {
+    }
+
+void LclStaticFix::run()
+    {
+    TraverseDecl( context.getTranslationUnitDecl());
+    }
+
+bool LclStaticFix::VisitFunctionDecl( FunctionDecl* declaration )
+    {
+    if( ignoreLocation( declaration ))
+        return true;
+    if( declaration->isCXXClassMember())
+        return true;
+    if( declaration->getStorageClass() == SC_Static )
+        return true;
+    string name = declaration->getQualifiedNameAsString();
+    if( name.find( "::" ) != string::npos )
+        return true;
+    if( name.compare( 0, 4, "lcl_" ) != 0 )
+        return true;
+    insertText( declaration->getLocStart(), "static " );
+    return true;
+    }
+
+static Plugin::Registration< LclStaticFix > X( "lclstaticfix" );
+
+} // namespace
diff --git a/compilerplugins/clang/store/lclstaticfix.hxx b/compilerplugins/clang/store/lclstaticfix.hxx
new file mode 100644
index 0000000..64e5b29
--- /dev/null
+++ b/compilerplugins/clang/store/lclstaticfix.hxx
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * Based on LLVM/Clang.
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ */
+
+#ifndef LCLSTATICFIX_H
+#define LCLSTATICFIX_H
+
+#include "plugin.hxx"
+
+namespace loplugin
+{
+
+class LclStaticFix
+    : public RecursiveASTVisitor< LclStaticFix >
+    , public RewritePlugin
+    {
+    public:
+        explicit LclStaticFix( ASTContext& context, Rewriter& rewriter );
+        virtual void run();
+        bool VisitFunctionDecl( FunctionDecl* declaration );
+    };
+
+} // namespace
+
+#endif // POSTFIXINCREMENTFIX_H
+
commit a1c61eb11298d5ed565c06e4b925d51d855fd8ff
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 18:34:12 2013 +0100

    move documentation of plugins to the .cxx files
    
    It's mostly there already anyway, no need to duplicate it.
    
    Change-Id: I5b066f90725a064fb0746e1411900e835e3f66c3

diff --git a/compilerplugins/README b/compilerplugins/README
index 8578005..9d531db 100644
--- a/compilerplugins/README
+++ b/compilerplugins/README
@@ -18,10 +18,12 @@ are found or explicitly using --enable-compiler-plugins.
 
 == Functionality ==
 
-There are two kinds of modules:
+There are two kinds of plugin actions:
 - compile checks - these are run during normal compilation
 - rewriters - these must be run manually and modify source files
 
+Each source has a comment saying whether it's compile check or a rewriter
+and description of functionality.
 
 === Compile checks ===
 
@@ -29,42 +31,13 @@ Used during normal compilation to perform additional checks.
 All warnings and errors are marked '[loplugin]' in the message.
 
 
-==== Unused variable check ====
-
-- unused parameter 'foo' [loplugin]
-- unused variable 'foo' [loplugin]
-
-Additional check for unused variables.
-
-
-==== Body of if/while/for not in {} ====
-
-- statement aligned as second statement in if/while/for body but not in a statement block [loplugin]
-
-Warn about the following construct:
-
-    if( a != 0 )
-        b = 2;
-        c = 3;
-        
-Here either both statements should be inside {} or the second statement in indented wrong.
-
-
-==== Sal log areas ====
-
-- unknown log area 'foo' (check or extend sal/inc/sal/log-areas.dox) [loplugin]
-
-Check area used in SAL_INFO/SAL_WARN macros against the list in sal/inc/sal/log-areas.dox and
-report if the area is not listed there. The fix is either use a proper area or add it to the list
-if appropriate.
-
-
 === Rewriters ===
 
 Rewriters analyse and possibly modify given source files.
 Usage: make COMPILER_PLUGIN_TOOL=<rewriter_name>
 Modifications will be written directly to the source files.
 
+
 == Code documentation / howtos ==
 
 TBD
diff --git a/compilerplugins/clang/bodynotinblock.cxx b/compilerplugins/clang/bodynotinblock.cxx
index 74cab89..76ab565 100644
--- a/compilerplugins/clang/bodynotinblock.cxx
+++ b/compilerplugins/clang/bodynotinblock.cxx
@@ -21,6 +21,14 @@ This is a compile check.
 
 Check for two statements that are both indented to look like a body of if/while/for
 but are not inside a compound statement and thus the second one is unrelated.
+
+For example:
+
+    if( a != 0 )
+        b = 2;
+        c = 3;
+
+Here either both statements should be inside {} or the second statement in indented wrong.
 */
 
 BodyNotInBlock::BodyNotInBlock( ASTContext& context )
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 9ab9f2d..01b2894 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -15,6 +15,9 @@
 
 #include "pluginhandler.hxx"
 
+/*
+Base classes for plugin actions.
+*/
 namespace loplugin
 {
 
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx
index 35d881e..023a270 100644
--- a/compilerplugins/clang/pluginhandler.cxx
+++ b/compilerplugins/clang/pluginhandler.cxx
@@ -16,6 +16,10 @@
 #include <stdio.h>
 #include <unistd.h>
 
+/*
+This source file manages all plugin actions. It is not necessary to modify this
+file when adding new actions.
+*/
 namespace loplugin
 {
 
diff --git a/compilerplugins/clang/postfixincrementfix.cxx b/compilerplugins/clang/postfixincrementfix.cxx
index 2f47476..3f4688e 100644
--- a/compilerplugins/clang/postfixincrementfix.cxx
+++ b/compilerplugins/clang/postfixincrementfix.cxx
@@ -13,6 +13,12 @@
 #include <clang/AST/ASTContext.h>
 #include <clang/Basic/SourceManager.h>
 
+/*
+This is a rewriter.
+
+Change all postfix ++ operators of non-trivial types to prefix if possible.
+*/
+
 namespace loplugin
 {
 
diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
index 1a3a651..051c1d7 100644
--- a/compilerplugins/clang/sallogareas.cxx
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -22,7 +22,9 @@ namespace loplugin
 /*
 This is a compile check.
 
-Check that areas used in SAL_LOG/SAL_WARN are listed in sal/inc/sal/log-areas.dox .
+Check area used in SAL_INFO/SAL_WARN macros against the list in sal/inc/sal/log-areas.dox and
+report if the area is not listed there. The fix is either use a proper area or add it to the list
+if appropriate.
 */
 
 SalLogAreas::SalLogAreas( ASTContext& context )
commit c6ffe17631cccf11fbe00479d2169116d494a7da
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Sat Feb 2 18:26:03 2013 +0100

    automatically link all .cxx files in clang/ into the plugin
    
    This means that just moving sources to the dir will enable the plugin
    action in that source, without modifying any sources, so those changes
    would not be accidentally committed when using a rewriter to change
    LO sources.
    
    Change-Id: Ic5a9c52dbf1939a1e78ad39ed6691ce3a1f399df

diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk
index ea5d961..619e11d 100644
--- a/compilerplugins/Makefile-clang.mk
+++ b/compilerplugins/Makefile-clang.mk
@@ -8,18 +8,6 @@
 
 # Make sure variables in this Makefile do not conflict with other variables (e.g. from gbuild).
 
-# The list of source files.
-CLANGSRC= \
-    plugin.cxx \
-    pluginhandler.cxx \
-    bodynotinblock.cxx \
-    lclstaticfix.cxx \
-    postfixincrementfix.cxx \
-    removeforwardstringdecl.cxx \
-    sallogareas.cxx \
-    unusedvariablecheck.cxx \
-
-
 # You may occassionally want to override some of these
 
 # Compile flags ('make CLANGCXXFLAGS=-g' if you need to debug the plugin)
@@ -41,6 +29,24 @@ CLANGINDIR=$(SRCDIR)/compilerplugins/clang
 # plugin will cause cache misses with ccache.
 CLANGOUTDIR=$(BUILDDIR)/compilerplugins/obj
 
+# The list of source files, generated automatically (all files in clang/, but not subdirs).
+CLANGSRC=$(foreach src,$(wildcard $(CLANGINDIR)/*.cxx), $(notdir $(src)))
+# Remember the sources and if they have changed, force plugin relinking.
+CLANGSRCCHANGED= \
+    $(shell echo $(CLANGSRC) | sort > $(CLANGOUTDIR)/sources-new.txt; \
+            if diff $(CLANGOUTDIR)/sources.txt $(CLANGOUTDIR)/sources-new.txt >/dev/null 2>/dev/null; then \
+                echo 0; \
+            else \
+                mv $(CLANGOUTDIR)/sources-new.txt $(CLANGOUTDIR)/sources.txt; \
+                echo 1; \
+            fi; \
+    )
+ifeq ($(CLANGSRCCHANGED),1)

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list