[Libreoffice-commits] core.git: 14 commits - basic/source compilerplugins/clang connectivity/source dbaccess/source editeng/source filter/source idl/source include/vcl sc/source sd/source sot/source svl/source svtools/source svx/source sw/source tools/source vcl/source

Stephan Bergmann sbergman at redhat.com
Fri Apr 17 06:23:49 PDT 2015


 basic/source/classes/sbxmod.cxx                  |    2 
 basic/source/sbx/sbxcoll.cxx                     |    2 
 compilerplugins/clang/implicitboolconversion.cxx |  362 ++++++++++++++++++++---
 connectivity/source/commontools/FValue.cxx       |    2 
 dbaccess/source/ui/inc/tabletree.hxx             |    2 
 editeng/source/editeng/editattr.cxx              |    2 
 editeng/source/editeng/editdoc.cxx               |    2 
 editeng/source/editeng/editobj.cxx               |    6 
 editeng/source/items/bulitem.cxx                 |    6 
 editeng/source/items/frmitems.cxx                |    4 
 editeng/source/items/textitem.cxx                |   18 -
 editeng/source/outliner/outliner.cxx             |    2 
 filter/source/flash/swfwriter2.cxx               |    8 
 filter/source/msfilter/escherex.cxx              |    2 
 idl/source/objects/bastype.cxx                   |    2 
 include/vcl/salbtype.hxx                         |   12 
 sc/source/core/data/patattr.cxx                  |    2 
 sc/source/core/tool/autoform.cxx                 |   12 
 sc/source/core/tool/ddelink.cxx                  |    2 
 sc/source/filter/inc/xcl97rec.hxx                |    2 
 sc/source/filter/xcl97/xcl97rec.cxx              |    4 
 sc/source/ui/drawfunc/fupoor.cxx                 |    4 
 sc/source/ui/unoobj/cellsuno.cxx                 |    6 
 sc/source/ui/unoobj/docuno.cxx                   |    4 
 sd/source/filter/eppt/pptexanimations.cxx        |    2 
 sd/source/filter/html/pubdlg.cxx                 |   22 -
 sd/source/ui/dlg/morphdlg.cxx                    |    4 
 sd/source/ui/dlg/vectdlg.cxx                     |    2 
 sot/source/sdstor/stgelem.cxx                    |   20 -
 sot/source/sdstor/stgelem.hxx                    |    4 
 svl/source/items/cenumitm.cxx                    |    2 
 svl/source/items/ctypeitm.cxx                    |    2 
 svtools/source/graphic/grfattr.cxx               |    2 
 svtools/source/graphic/grfmgr.cxx                |    2 
 svtools/source/misc/imap.cxx                     |    4 
 svx/source/gallery2/galobj.cxx                   |    2 
 svx/source/gallery2/galtheme.cxx                 |    4 
 svx/source/items/pageitem.cxx                    |    2 
 svx/source/svdraw/svdattr.cxx                    |    2 
 sw/source/core/doc/tblafmt.cxx                   |   14 
 sw/source/core/doc/tblrwcl.cxx                   |    2 
 sw/source/core/edit/ednumber.cxx                 |    2 
 sw/source/filter/inc/rtf.hxx                     |    4 
 sw/source/filter/ww8/wrtww8.hxx                  |   16 -
 sw/source/filter/ww8/ww8atr.cxx                  |   12 
 sw/source/filter/ww8/ww8par.cxx                  |    6 
 sw/source/filter/ww8/ww8par2.cxx                 |   18 -
 sw/source/filter/ww8/ww8par3.cxx                 |   34 +-
 sw/source/filter/ww8/ww8par6.cxx                 |    2 
 sw/source/filter/ww8/ww8scan.cxx                 |    3 
 sw/source/filter/ww8/ww8scan.hxx                 |    4 
 sw/source/filter/ww8/ww8struc.hxx                |    3 
 tools/source/generic/poly.cxx                    |    2 
 vcl/source/gdi/animate.cxx                       |    2 
 vcl/source/gdi/cvtsvm.cxx                        |   18 -
 vcl/source/gdi/dibtools.cxx                      |   61 ++-
 vcl/source/gdi/font.cxx                          |   10 
 vcl/source/gdi/mapmod.cxx                        |    2 
 vcl/source/gdi/metaact.cxx                       |   22 -
 vcl/source/gdi/region.cxx                        |    2 
 vcl/source/gdi/wall.cxx                          |    2 
 61 files changed, 543 insertions(+), 244 deletions(-)

New commits:
commit 8e4d82cd1125502c26ddaaa85c49c4aa44f65811
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 15:07:50 2015 +0200

    loplugin:implicitboolconversion: warn about conversions to unsigned char
    
    ...while avoiding warnings about conversions to bool-like typedefs (sal_Bool
    etc.), also in cases where those typedefs are used as type arguments of
    template specializations (which is no little feat, and the current code is only
    an approximation of it, one that appears to cover the relevant cases in our code
    base though).
    
    Change-Id: I0ed3801aec7787bf38b429b66e25244ec00cac9b

diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx
index d8ef00e..57d0016 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -36,30 +36,68 @@ template<> struct std::iterator_traits<ConstExprIterator> {
 
 namespace {
 
-bool isBool(Expr const * expr, bool allowTypedefs = true) {
-    QualType t1 { expr->getType() };
-    if (t1->isBooleanType()) {
+Expr const * ignoreParenAndTemporaryMaterialization(Expr const * expr) {
+    for (;;) {
+        expr = expr->IgnoreParens();
+        auto e = dyn_cast<MaterializeTemporaryExpr>(expr);
+        if (e == nullptr) {
+            return expr;
+        }
+        expr = e->GetTemporaryExpr();
+    }
+}
+
+Expr const * ignoreParenImpCastAndComma(Expr const * expr) {
+    for (;;) {
+        expr = expr->IgnoreParenImpCasts();
+        BinaryOperator const * op = dyn_cast<BinaryOperator>(expr);
+        if (op == nullptr || op->getOpcode() != BO_Comma) {
+            return expr;
+        }
+        expr = op->getRHS();
+    }
+}
+
+SubstTemplateTypeParmType const * getAsSubstTemplateTypeParmType(QualType type)
+{
+    //TODO: unwrap all kinds of (non-SubstTemplateTypeParmType) sugar, not only
+    // TypedefType sugar:
+    for (;;) {
+        TypedefType const * t = type->getAs<TypedefType>();
+        if (t == nullptr) {
+            return dyn_cast<SubstTemplateTypeParmType>(type);
+        }
+        type = t->desugar();
+    }
+}
+
+bool isBool(QualType type, bool allowTypedefs = true) {
+    if (type->isBooleanType()) {
         return true;
     }
     if (!allowTypedefs) {
         return false;
     }
-// css::uno::Sequence<sal_Bool> s(1);s[0]=false /*unotools/source/config/configitem.cxx*/:
-if(t1->isSpecificBuiltinType(BuiltinType::UChar))return true;
-    TypedefType const * t2 = t1->getAs<TypedefType>();
+    TypedefType const * t2 = type->getAs<TypedefType>();
     if (t2 == nullptr) {
         return false;
     }
     std::string name(t2->getDecl()->getNameAsString());
-    return name == "sal_Bool" || name == "BOOL" || name == "FcBool"
-        || name == "UBool" || name == "dbus_bool_t" || name == "gboolean"
-        || name == "hb_bool_t";
+    return name == "sal_Bool" || name == "BOOL" || name == "Boolean"
+        || name == "FT_Bool" || name == "FcBool" || name == "GLboolean"
+        || name == "NPBool" || name == "UBool" || name == "dbus_bool_t"
+        || name == "gboolean" || name == "hb_bool_t" || name == "jboolean";
+}
+
+bool isBool(Expr const * expr, bool allowTypedefs = true) {
+    return isBool(expr->getType(), allowTypedefs);
 }
 
 bool isBoolExpr(Expr const * expr) {
     if (isBool(expr)) {
         return true;
     }
+    expr = ignoreParenImpCastAndComma(expr);
     ConditionalOperator const * co = dyn_cast<ConditionalOperator>(expr);
     if (co != nullptr) {
         ImplicitCastExpr const * ic1 = dyn_cast<ImplicitCastExpr>(
@@ -75,6 +113,88 @@ bool isBoolExpr(Expr const * expr) {
             return true;
         }
     }
+    std::stack<Expr const *> stack;
+    Expr const * e = expr;
+    for (;;) {
+        e = ignoreParenImpCastAndComma(e);
+        MemberExpr const * me = dyn_cast<MemberExpr>(e);
+        if (me == nullptr) {
+            break;
+        }
+        stack.push(e);
+        e = me->getBase();
+    }
+    for (;;) {
+        e = ignoreParenImpCastAndComma(e);
+        CXXOperatorCallExpr const * op = dyn_cast<CXXOperatorCallExpr>(e);
+        if (op == nullptr || op->getOperator() != OO_Subscript) {
+            break;
+        }
+        stack.push(e);
+        e = op->getArg(0);
+    }
+    if (!stack.empty()) {
+        TemplateSpecializationType const * t
+            = e->getType()->getAs<TemplateSpecializationType>();
+        for (;;) {
+            if (t == nullptr) {
+                break;
+            }
+            QualType ty;
+            MemberExpr const * me = dyn_cast<MemberExpr>(stack.top());
+            if (me != nullptr) {
+                TemplateDecl const * td
+                    = t->getTemplateName().getAsTemplateDecl();
+                if (td == nullptr) {
+                    break;
+                }
+                TemplateParameterList const * ps = td->getTemplateParameters();
+                SubstTemplateTypeParmType const * t2
+                    = getAsSubstTemplateTypeParmType(
+                        me->getMemberDecl()->getType());
+                if (t2 == nullptr) {
+                    break;
+                }
+                auto i = std::find(
+                    ps->begin(), ps->end(),
+                    t2->getReplacedParameter()->getDecl());
+                if (i == ps->end()) {
+                    break;
+                }
+                if (ps->size() != t->getNumArgs()) { //TODO
+                    break;
+                }
+                TemplateArgument const & arg = t->getArg(i - ps->begin());
+                if (arg.getKind() != TemplateArgument::Type) {
+                    break;
+                }
+                ty = arg.getAsType();
+            } else {
+                CXXOperatorCallExpr const * op
+                    = dyn_cast<CXXOperatorCallExpr>(stack.top());
+                assert(op != nullptr);
+                TemplateDecl const * d
+                    = t->getTemplateName().getAsTemplateDecl();
+                if (d == nullptr
+                    || (d->getQualifiedNameAsString()
+                        != "com::sun::star::uno::Sequence")
+                    || t->getNumArgs() != 1
+                    || t->getArg(0).getKind() != TemplateArgument::Type)
+                {
+                    break;
+                }
+                ty = t->getArg(0).getAsType();
+            }
+            stack.pop();
+            if (stack.empty()) {
+                if (isBool(ty)) {
+                    return true;
+                }
+                break;
+            }
+            t = ty->getAs<TemplateSpecializationType>();
+        }
+    }
     return false;
 }
 
@@ -117,6 +237,12 @@ public:
 
     bool TraverseCallExpr(CallExpr * expr);
 
+    bool TraverseCXXMemberCallExpr(CXXMemberCallExpr * expr);
+
+    bool TraverseCXXConstructExpr(CXXConstructExpr * expr);
+
+    bool TraverseCXXTemporaryObjectExpr(CXXTemporaryObjectExpr * expr);
+
     bool TraverseCStyleCastExpr(CStyleCastExpr * expr);
 
     bool TraverseCXXStaticCastExpr(CXXStaticCastExpr * expr);
@@ -152,6 +278,8 @@ public:
     bool VisitImplicitCastExpr(ImplicitCastExpr const * expr);
 
 private:
+    void checkCXXConstructExpr(CXXConstructExpr const * expr);
+
     void reportWarning(ImplicitCastExpr const * expr);
 
     std::stack<std::vector<ImplicitCastExpr const *>> nested;
@@ -191,31 +319,68 @@ bool ImplicitBoolConversion::TraverseCallExpr(CallExpr * expr) {
     }
     assert(!nested.empty());
     for (auto i: nested.top()) {
-        if (ext) {
-            auto j = std::find_if(
-                expr->arg_begin(), expr->arg_end(),
-                [&i](Expr * e) { return i == e->IgnoreParens(); });
-            if (j == expr->arg_end()) {
-                reportWarning(i);
-            } else if (t != nullptr) {
-                std::ptrdiff_t n = j - expr->arg_begin();
-                assert(n >= 0);
-                assert(
-                    static_cast<std::size_t>(n) < compat::getNumParams(*t)
-                    || t->isVariadic());
-                if (static_cast<std::size_t>(n) < compat::getNumParams(*t)
-                    && !(compat::getParamType(*t, n)->isSpecificBuiltinType(
-                             BuiltinType::Int)
-                         || (compat::getParamType(*t, n)->isSpecificBuiltinType(
-                                 BuiltinType::UInt))
-                         || (compat::getParamType(*t, n)->isSpecificBuiltinType(
-                                 BuiltinType::Long))))
-                {
+        auto j = std::find_if(
+            expr->arg_begin(), expr->arg_end(),
+            [&i](Expr * e) {
+                return i == ignoreParenAndTemporaryMaterialization(e);
+            });
+        if (j == expr->arg_end()) {
+            reportWarning(i);
+        } else {
+            std::ptrdiff_t n = j - expr->arg_begin();
+            assert(n >= 0);
+            if (ext) {
+                if (t != nullptr) {
+                    assert(
+                        static_cast<std::size_t>(n) < compat::getNumParams(*t)
+                        || t->isVariadic());
+                    if (static_cast<std::size_t>(n) < compat::getNumParams(*t)
+                        && !(compat::getParamType(*t, n)->isSpecificBuiltinType(
+                                 BuiltinType::Int)
+                             || (compat::getParamType(*t, n)
+                                 ->isSpecificBuiltinType(BuiltinType::UInt))
+                             || (compat::getParamType(*t, n)
+                                 ->isSpecificBuiltinType(BuiltinType::Long))))
+                    {
+                        reportWarning(i);
+                    }
+                } else {
                     reportWarning(i);
                 }
+            } else {
+                // Filter out
+                //
+                //   template<typename T> void f(T);
+                //   f<sal_Bool>(true);
+                //
+                DeclRefExpr const * dr = dyn_cast<DeclRefExpr>(
+                    expr->getCallee()->IgnoreParenImpCasts());
+                if (dr != nullptr && dr->hasExplicitTemplateArgs()) {
+                    FunctionDecl const * fd
+                        = dyn_cast<FunctionDecl>(dr->getDecl());
+                    if (fd != nullptr
+                        && static_cast<std::size_t>(n) < fd->getNumParams())
+                    {
+                        SubstTemplateTypeParmType const * t2
+                            = getAsSubstTemplateTypeParmType(
+                                fd->getParamDecl(n)->getType()
+                                .getNonReferenceType());
+                        if (t2 != nullptr) {
+                            //TODO: fix this superficial nonsense check:
+                            ASTTemplateArgumentListInfo const & ai
+                                = dr->getExplicitTemplateArgs();
+                            if (ai.NumTemplateArgs == 1
+                                && (ai[0].getArgument().getKind()
+                                    == TemplateArgument::Type)
+                                && isBool(ai[0].getTypeSourceInfo()->getType()))
+                            {
+                                continue;
+                            }
+                        }
+                    }
+                }
+                reportWarning(i);
             }
-        } else {
-            reportWarning(i);
         }
     }
     calls.pop();
@@ -223,6 +388,80 @@ bool ImplicitBoolConversion::TraverseCallExpr(CallExpr * expr) {
     return ret;
 }
 
+bool ImplicitBoolConversion::TraverseCXXMemberCallExpr(CXXMemberCallExpr * expr)
+{
+    nested.push(std::vector<ImplicitCastExpr const *>());
+    bool ret = RecursiveASTVisitor::TraverseCXXMemberCallExpr(expr);
+    assert(!nested.empty());
+    for (auto i: nested.top()) {
+        auto j = std::find_if(
+            expr->arg_begin(), expr->arg_end(),
+            [&i](Expr * e) {
+                return i == ignoreParenAndTemporaryMaterialization(e);
+            });
+        if (j != expr->arg_end()) {
+            // Filter out
+            //
+            //  template<typename T> struct S { void f(T); };
+            //  S<sal_Bool> s;
+            //  s.f(true);
+            //
+            std::ptrdiff_t n = j - expr->arg_begin();
+            assert(n >= 0);
+            QualType ty
+                = ignoreParenImpCastAndComma(expr->getImplicitObjectArgument())
+                ->getType();
+            if (dyn_cast<MemberExpr>(expr->getCallee())->isArrow()) {
+                ty = ty->getAs<PointerType>()->getPointeeType();
+            }
+            TemplateSpecializationType const * ct
+                = ty->getAs<TemplateSpecializationType>();
+            CXXMethodDecl const * d = expr->getMethodDecl();
+            if (ct != nullptr
+                && static_cast<std::size_t>(n) < d->getNumParams())
+            {
+                SubstTemplateTypeParmType const * pt
+                    = getAsSubstTemplateTypeParmType(
+                        d->getParamDecl(n)->getType().getNonReferenceType());
+                if (pt != nullptr) {
+                    TemplateDecl const * td
+                        = ct->getTemplateName().getAsTemplateDecl();
+                    if (td != nullptr) {
+                        //TODO: fix this superficial nonsense check:
+                        if (ct->getNumArgs() >= 1
+                            && ct->getArg(0).getKind() == TemplateArgument::Type
+                            && isBool(ct->getArg(0).getAsType()))
+                        {
+                            continue;
+                        }
+                    }
+                }
+            }
+        }
+        reportWarning(i);
+    }
+    nested.pop();
+    return ret;
+}
+
+bool ImplicitBoolConversion::TraverseCXXConstructExpr(CXXConstructExpr * expr) {
+    nested.push(std::vector<ImplicitCastExpr const *>());
+    bool ret = RecursiveASTVisitor::TraverseCXXConstructExpr(expr);
+    checkCXXConstructExpr(expr);
+    nested.pop();
+    return ret;
+}
+
+bool ImplicitBoolConversion::TraverseCXXTemporaryObjectExpr(
+    CXXTemporaryObjectExpr * expr)
+{
+    nested.push(std::vector<ImplicitCastExpr const *>());
+    bool ret = RecursiveASTVisitor::TraverseCXXTemporaryObjectExpr(expr);
+    checkCXXConstructExpr(expr);
+    nested.pop();
+    return ret;
+}
+
 bool ImplicitBoolConversion::TraverseCStyleCastExpr(CStyleCastExpr * expr) {
     nested.push(std::vector<ImplicitCastExpr const *>());
     bool ret = RecursiveASTVisitor::TraverseCStyleCastExpr(expr);
@@ -386,13 +625,13 @@ bool ImplicitBoolConversion::TraverseBinNE(BinaryOperator * expr) {
     return ret;
 }
 
-// /usr/include/gtk-2.0/gtk/gtktogglebutton.h: struct _GtkToggleButton:
-//  guint GSEAL (active) : 1;
-// even though <http://www.gtk.org/api/2.6/gtk/GtkToggleButton.html>:
-//  "active"               gboolean              : Read / Write
 bool ImplicitBoolConversion::TraverseBinAssign(BinaryOperator * expr) {
     nested.push(std::vector<ImplicitCastExpr const *>());
     bool ret = RecursiveASTVisitor::TraverseBinAssign(expr);
+    // /usr/include/gtk-2.0/gtk/gtktogglebutton.h: struct _GtkToggleButton:
+    //  guint GSEAL (active) : 1;
+    // even though <http://www.gtk.org/api/2.6/gtk/GtkToggleButton.html>:
+    //  "active"               gboolean              : Read / Write
     bool ext = false;
     MemberExpr const * me = dyn_cast<MemberExpr>(expr->getLHS());
     if (me != nullptr) {
@@ -406,7 +645,9 @@ bool ImplicitBoolConversion::TraverseBinAssign(BinaryOperator * expr) {
     }
     assert(!nested.empty());
     for (auto i: nested.top()) {
-        if (i != expr->getRHS()->IgnoreParens() || !ext) {
+        if (i != expr->getRHS()->IgnoreParens()
+            || !(ext || isBoolExpr(expr->getLHS())))
+        {
             reportWarning(i);
         }
     }
@@ -574,7 +815,7 @@ bool ImplicitBoolConversion::VisitImplicitCastExpr(
             << sub->getType() << expr->getType() << expr->getSourceRange();
         return true;
     }
-    if (expr->getType()->isBooleanType() && !isBool(expr->getSubExpr())
+    if (expr->getType()->isBooleanType() && !isBoolExpr(expr->getSubExpr())
         && !calls.empty())
     {
         CallExpr const * call = calls.top();
@@ -595,6 +836,53 @@ bool ImplicitBoolConversion::VisitImplicitCastExpr(
     return true;
 }
 
+void ImplicitBoolConversion::checkCXXConstructExpr(
+    CXXConstructExpr const * expr)
+{
+    assert(!nested.empty());
+    for (auto i: nested.top()) {
+        auto j = std::find_if(
+            expr->arg_begin(), expr->arg_end(),
+            [&i](Expr const * e) {
+                return i == ignoreParenAndTemporaryMaterialization(e);
+            });
+        if (j != expr->arg_end()) {
+            TemplateSpecializationType const * t1 = expr->getType()->
+                getAs<TemplateSpecializationType>();
+            SubstTemplateTypeParmType const * t2 = nullptr;
+            CXXConstructorDecl const * d = expr->getConstructor();
+            if (d->getNumParams() == expr->getNumArgs()) { //TODO: better check
+                t2 = getAsSubstTemplateTypeParmType(
+                    d->getParamDecl(j - expr->arg_begin())->getType()
+                    .getNonReferenceType());
+            }
+            if (t1 != nullptr && t2 != nullptr) {
+                TemplateDecl const * td
+                    = t1->getTemplateName().getAsTemplateDecl();
+                if (td != nullptr) {
+                    TemplateParameterList const * ps
+                        = td->getTemplateParameters();
+                    auto i = std::find(
+                        ps->begin(), ps->end(),
+                        t2->getReplacedParameter()->getDecl());
+                    if (i != ps->end()) {
+                        if (ps->size() == t1->getNumArgs()) { //TODO
+                            TemplateArgument const & arg = t1->getArg(
+                                i - ps->begin());
+                            if (arg.getKind() == TemplateArgument::Type
+                                && isBool(arg.getAsType()))
+                            {
+                                continue;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        reportWarning(i);
+    }
+}
+
 void ImplicitBoolConversion::reportWarning(ImplicitCastExpr const * expr) {
     report(
         DiagnosticsEngine::Warning,
commit b76f96a520ec71308529802442aafe9364edde23
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 15:07:36 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: I3c6baec2cec24e23e9bdf78882a69838f10b533c

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index d5bbc73..95d9c58 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -105,7 +105,7 @@ private:
     sal_uInt8               mcBlueOrIndex;
     sal_uInt8               mcGreen;
     sal_uInt8               mcRed;
-    sal_uInt8               mbIndex;
+    sal_uInt8               mbIndex; // should be bool, but see above warning
 
 public:
 
@@ -272,7 +272,7 @@ inline BitmapColor::BitmapColor() :
             mcBlueOrIndex   ( 0 ),
             mcGreen         ( 0 ),
             mcRed           ( 0 ),
-            mbIndex         ( false )
+            mbIndex         ( sal_uInt8(false) )
 {
 }
 
@@ -280,7 +280,7 @@ inline BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBl
             mcBlueOrIndex   ( cBlue ),
             mcGreen         ( cGreen ),
             mcRed           ( cRed ),
-            mbIndex         ( false )
+            mbIndex         ( sal_uInt8(false) )
 {
 }
 
@@ -296,7 +296,7 @@ inline BitmapColor::BitmapColor( const Color& rColor ) :
             mcBlueOrIndex   ( rColor.GetBlue() ),
             mcGreen         ( rColor.GetGreen() ),
             mcRed           ( rColor.GetRed() ),
-            mbIndex         ( 0 )
+            mbIndex         ( sal_uInt8(false) )
 {
 }
 
@@ -304,14 +304,14 @@ inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) :
             mcBlueOrIndex   ( cIndex ),
             mcGreen         ( 0 ),
             mcRed           ( 0 ),
-            mbIndex         ( true )
+            mbIndex         ( sal_uInt8(true) )
 {
 }
 
 inline bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
 {
     return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) &&
-            ( mbIndex ? rBitmapColor.mbIndex :
+            ( mbIndex ? bool(rBitmapColor.mbIndex) :
             ( mcGreen == rBitmapColor.mcGreen && mcRed == rBitmapColor.mcRed ) ) );
 }
 
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index f732f8d..3ef0482 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -433,7 +433,7 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPol
                 ReadPair( rIStm , aCandidate[b] );
             }
 
-            sal_uInt8 bHasFlags(false);
+            sal_uInt8 bHasFlags(int(false));
             rIStm.ReadUChar( bHasFlags );
 
             if(bHasFlags)
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 044b096..4267cce 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -1564,49 +1564,54 @@ bool ReadDIBBitmapEx(
 
         if(bRetval)
         {
-            sal_uInt8 bTransparent(false);
+            sal_uInt8 transparent = TRANSPARENT_NONE;
 
-            rIStm.ReadUChar( bTransparent );
+            rIStm.ReadUChar( transparent );
             bRetval = !rIStm.GetError();
 
             if(bRetval)
             {
-                if((sal_uInt8)TRANSPARENT_BITMAP == bTransparent)
+                switch (transparent)
                 {
-                    Bitmap aMask;
+                case TRANSPARENT_BITMAP:
+                    {
+                        Bitmap aMask;
 
-                    bRetval = ImplReadDIB(aMask, 0, rIStm, true);
+                        bRetval = ImplReadDIB(aMask, 0, rIStm, true);
 
-                    if(bRetval)
-                    {
-                        if(!!aMask)
+                        if(bRetval)
                         {
-                            // do we have an alpha mask?
-                            if((8 == aMask.GetBitCount()) && aMask.HasGreyPalette())
-                            {
-                                AlphaMask aAlpha;
-
-                                // create alpha mask quickly (without greyscale conversion)
-                                aAlpha.ImplSetBitmap(aMask);
-                                rTarget = BitmapEx(aBmp, aAlpha);
-                            }
-                            else
+                            if(!!aMask)
                             {
-                                rTarget = BitmapEx(aBmp, aMask);
+                                // do we have an alpha mask?
+                                if((8 == aMask.GetBitCount()) && aMask.HasGreyPalette())
+                                {
+                                    AlphaMask aAlpha;
+
+                                    // create alpha mask quickly (without greyscale conversion)
+                                    aAlpha.ImplSetBitmap(aMask);
+                                    rTarget = BitmapEx(aBmp, aAlpha);
+                                }
+                                else
+                                {
+                                    rTarget = BitmapEx(aBmp, aMask);
+                                }
                             }
                         }
+                        break;
                     }
-                }
-                else if((sal_uInt8)TRANSPARENT_COLOR == bTransparent)
-                {
-                    Color aTransparentColor;
+                case TRANSPARENT_COLOR:
+                    {
+                        Color aTransparentColor;
 
-                    ReadColor( rIStm, aTransparentColor );
-                    bRetval = !rIStm.GetError();
+                        ReadColor( rIStm, aTransparentColor );
+                        bRetval = !rIStm.GetError();
 
-                    if(bRetval)
-                    {
-                        rTarget = BitmapEx(aBmp, aTransparentColor);
+                        if(bRetval)
+                        {
+                            rTarget = BitmapEx(aBmp, aTransparentColor);
+                        }
+                        break;
                     }
                 }
             }
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index d8cf71a..f1c5c9c 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -637,7 +637,7 @@ void Font::Merge( const vcl::Font& rFont )
     SetOrientation( rFont.GetOrientation() );
     SetVertical( rFont.IsVertical() );
     SetEmphasisMark( rFont.GetEmphasisMark() );
-    SetKerning( rFont.IsKerning() );
+    SetKerning( rFont.IsKerning() ? KERNING_FONTSPECIFIC : 0 );
     SetOutline( rFont.IsOutline() );
     SetShadow( rFont.IsShadow() );
     SetRelief( rFont.GetRelief() );
commit d881bde066a891c921feafe0a06c568e6c3efb0f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 15:06:51 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: I049b2eec5b2201f4056bb6e7b9b97e7763e5e214

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 2fed3d8..420318f 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -387,7 +387,7 @@ static void lcl_CopyCol( _FndBox & rFndBox, _CpyPara *const pCpyPara)
 
         const _FndBoxes& rFndBxs = rFndBox.GetUpper()->GetBoxes();
         if( 8 > pCpyPara->nDelBorderFlag
-                ? pCpyPara->nDelBorderFlag
+                ? pCpyPara->nDelBorderFlag != 0
                 : &rFndBox == &rFndBxs[rFndBxs.size() - 1] )
         {
             const SvxBoxItem& rBoxItem = pBox->GetFrmFmt()->GetBox();
diff --git a/sw/source/filter/inc/rtf.hxx b/sw/source/filter/inc/rtf.hxx
index 73adefe..ec655d7 100644
--- a/sw/source/filter/inc/rtf.hxx
+++ b/sw/source/filter/inc/rtf.hxx
@@ -25,7 +25,7 @@ class RTFSurround
 {
     union {
         struct {
-            sal_uInt8 nGoldCut : 1;
+            sal_uInt8 nGoldCut : 1; // should ideally be bool
             sal_uInt8 nOrder : 4;
             sal_uInt8 nJunk : 3;
         } Flags;
@@ -35,7 +35,7 @@ public:
     RTFSurround( sal_uInt8 nValue ) { Value.nVal = nValue; }
 
     RTFSurround( bool bGoldCut, sal_uInt8 nOrder ) {
-        Value.Flags.nGoldCut = bGoldCut;
+        Value.Flags.nGoldCut = sal_uInt8(bGoldCut);
         Value.Flags.nOrder = nOrder;
         Value.Flags.nJunk = 0;
     }
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index e2e2421..1a35a65 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -330,7 +330,7 @@ public:
     void WriteFontTable( const RtfAttributeOutput& rAttrOutput );
 
     /// If true, all fonts are loaded before processing the document.
-    sal_uInt8 bLoadAllFonts: 1;
+    bool bLoadAllFonts: 1;
 };
 
 class DrawObj
@@ -436,12 +436,12 @@ struct MSWordSaveData
     const sw::Frame* pOldFlyFmt;
     const SwPageDesc* pOldPageDesc;
 
-    sal_uInt8 bOldWriteAll : 1;          ///< WW8Export only
-    sal_uInt8 bOldOutTable : 1;
-    sal_uInt8 bOldIsInTable: 1;
-    sal_uInt8 bOldFlyFrmAttrs : 1;
-    sal_uInt8 bOldStartTOX : 1;
-    sal_uInt8 bOldInWriteTOX : 1;
+    bool bOldWriteAll : 1;          ///< WW8Export only
+    bool bOldOutTable : 1;
+    bool bOldIsInTable: 1;
+    bool bOldFlyFrmAttrs : 1;
+    bool bOldStartTOX : 1;
+    bool bOldInWriteTOX : 1;
     // bOutPageDesc muss nicht gesichert werden, da es nur nicht waehrend der
     // Ausgabe von Spezial-Texten veraendert wird.
 };
@@ -947,7 +947,7 @@ public:
     WW8_WrPlcFtnEdn *pEdn;              ///< Endnotes - structure to remember them, and output
     WW8_WrPlcSepx* pSepx;               ///< Sections/headers/footers
 
-    sal_uInt8 bWrtWW8 : 1;                   ///< Write WW95 (false) or WW97 (true) file format
+    bool bWrtWW8 : 1;                   ///< Write WW95 (false) or WW97 (true) file format
     bool m_bDot; ///< Template or document.
 
 protected:
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index a9ba08a..7199c68 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -166,7 +166,7 @@ bool WW8Export::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich
             case RES_CHRATR_CTL_LANGUAGE:
             case RES_CHRATR_CTL_POSTURE:
             case RES_CHRATR_CTL_WEIGHT:
-                if (bWrtWW8 == 0)
+                if (!bWrtWW8)
                     bRet = false;
             default:
                 break;
@@ -177,7 +177,7 @@ bool WW8Export::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich
         //Complex is ok in ww8, but for ww6 there is only
         //one font, one fontsize, one fontsize (weight/posture)
         //and only one language
-        if ( bWrtWW8 == 0 )
+        if ( !bWrtWW8 )
         {
             switch ( nWhich )
             {
@@ -217,7 +217,7 @@ bool WW8Export::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich
             case RES_CHRATR_CTL_LANGUAGE:
             case RES_CHRATR_CTL_POSTURE:
             case RES_CHRATR_CTL_WEIGHT:
-                if ( bWrtWW8 == 0 )
+                if ( !bWrtWW8 )
                     bRet = false;
             default:
                 break;
@@ -3173,7 +3173,7 @@ void WW8AttributeOutput::ParaSnapToGrid( const SvxParaGridItem& rGrid )
         return;
 
     m_rWW8Export.InsUInt16( NS_sprm::LN_PFUsePgsuSettings );
-    m_rWW8Export.pO->push_back( rGrid.GetValue() );
+    m_rWW8Export.pO->push_back( rGrid.GetValue() ? 1 : 0 );
 }
 
 void WW8AttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign )
@@ -4870,12 +4870,12 @@ void WW8AttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDir
         m_rWW8Export.InsUInt16( NS_sprm::LN_STextFlow );
         m_rWW8Export.InsUInt16( nTextFlow );
         m_rWW8Export.InsUInt16( NS_sprm::LN_SFBiDi );
-        m_rWW8Export.pO->push_back( bBiDi );
+        m_rWW8Export.pO->push_back( bBiDi ? 1 : 0 );
     }
     else if ( !m_rWW8Export.bOutFlyFrmAttrs )  //paragraph/style
     {
         m_rWW8Export.InsUInt16( NS_sprm::LN_PFBiDi );
-        m_rWW8Export.pO->push_back( bBiDi );
+        m_rWW8Export.pO->push_back( bBiDi ? 1 : 0 );
     }
 }
 
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index ab30cee..77f578e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2613,12 +2613,12 @@ bool SwWW8ImplReader::ProcessSpecial(bool &rbReSync, WW8_CP nStartCp)
     sal_uInt8 nCellLevel = 0;
 
     if (bVer67)
-        nCellLevel = 0 != pPlcxMan->HasParaSprm(24);
+        nCellLevel = int(0 != pPlcxMan->HasParaSprm(24));
     else
     {
-        nCellLevel = 0 != pPlcxMan->HasParaSprm(0x2416);
+        nCellLevel = int(0 != pPlcxMan->HasParaSprm(0x2416));
         if (!nCellLevel)
-            nCellLevel = 0 != pPlcxMan->HasParaSprm(0x244B);
+            nCellLevel = int(0 != pPlcxMan->HasParaSprm(0x244B));
     }
     do
     {
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index ff1b507..852dee7 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1157,8 +1157,8 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const sal_uInt8* pS)
                 if( i < nColsToRead )
                 {               // TC from file ?
                     sal_uInt8 aBits1 = pTc->aBits1Ver6;
-                    pAktTC->bFirstMerged    = ( ( aBits1 & 0x01 ) != 0 );
-                    pAktTC->bMerged     = ( ( aBits1 & 0x02 ) != 0 );
+                    pAktTC->bFirstMerged = sal_uInt8( ( aBits1 & 0x01 ) != 0 );
+                    pAktTC->bMerged = sal_uInt8( ( aBits1 & 0x02 ) != 0 );
                     pAktTC->rgbrc[ WW8_TOP ]
                         = WW8_BRC( pTc->rgbrcVer6[ WW8_TOP ] );
                     pAktTC->rgbrc[ WW8_LEFT ]
@@ -1187,13 +1187,13 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const sal_uInt8* pS)
             for (int k = 0; k < nColsToRead; ++k, ++pAktTC, ++pTc )
             {
                 sal_uInt16 aBits1 = SVBT16ToShort( pTc->aBits1Ver8 );
-                pAktTC->bFirstMerged    = ( ( aBits1 & 0x0001 ) != 0 );
-                pAktTC->bMerged         = ( ( aBits1 & 0x0002 ) != 0 );
-                pAktTC->bVertical       = ( ( aBits1 & 0x0004 ) != 0 );
-                pAktTC->bBackward       = ( ( aBits1 & 0x0008 ) != 0 );
-                pAktTC->bRotateFont     = ( ( aBits1 & 0x0010 ) != 0 );
-                pAktTC->bVertMerge      = ( ( aBits1 & 0x0020 ) != 0 );
-                pAktTC->bVertRestart    = ( ( aBits1 & 0x0040 ) != 0 );
+                pAktTC->bFirstMerged    = sal_uInt8( ( aBits1 & 0x0001 ) != 0 );
+                pAktTC->bMerged         = sal_uInt8( ( aBits1 & 0x0002 ) != 0 );
+                pAktTC->bVertical       = sal_uInt8( ( aBits1 & 0x0004 ) != 0 );
+                pAktTC->bBackward       = sal_uInt8( ( aBits1 & 0x0008 ) != 0 );
+                pAktTC->bRotateFont     = sal_uInt8( ( aBits1 & 0x0010 ) != 0 );
+                pAktTC->bVertMerge      = sal_uInt8( ( aBits1 & 0x0020 ) != 0 );
+                pAktTC->bVertRestart    = sal_uInt8( ( aBits1 & 0x0040 ) != 0 );
                 pAktTC->nVertAlign      = ( ( aBits1 & 0x0180 ) >> 7 );
                 // note: in aBits1 there are 7 bits unused,
                 //       followed by another 16 unused bits
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index f085e7f..9f7415f 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -332,8 +332,8 @@ struct WW8LST   // nur DIE Eintraege, die WIR benoetigen!
                             //   nIStDNil if no style linked
     sal_uInt32 nIdLst;     // Unique List ID
     sal_uInt32 nTplC;      // Unique template code - Was ist das bloss?
-    sal_uInt8 bSimpleList:1; // Flag: Liste hat nur EINEN Level
-    sal_uInt8 bRestartHdn:1; // WW6-Kompatibilitaets-Flag:
+    bool bSimpleList:1;    // Flag: Liste hat nur EINEN Level
+    bool bRestartHdn:1;    // WW6-Kompatibilitaets-Flag:
                                                         //   true if the list should start numbering over
 };                                                      //   at the beginning of each section
 
@@ -380,11 +380,11 @@ struct WW8LFOLVL
     // dieses Byte ist _absichtlich_ nicht in das folgende Byte hineingepackt   !!
     // (siehe Kommentar unten bei struct WW8LFOInfo)
 
-    sal_uInt8 bStartAt :1;       // true if the start-at value is overridden
-    sal_uInt8 bFormat :1;        // true if the formatting is overridden
+    bool bStartAt :1;       // true if the start-at value is overridden
+    bool bFormat :1;        // true if the formatting is overridden
 
     WW8LFOLVL() :
-        nStartAt(1), nLevel(0), bStartAt(1), bFormat(0) {}
+        nStartAt(1), nLevel(0), bStartAt(true), bFormat(false) {}
 };
 
 // in den ListenInfos zu speichernde Daten
@@ -398,13 +398,13 @@ struct WW8LSTInfo   // sortiert nach nIdLst (in WW8 verwendete Listen-Id)
 
     SwNumRule*  pNumRule;        // Zeiger auf entsprechende Listenvorlage im Writer
     sal_uInt32      nIdLst;          // WW8Id dieser Liste
-    sal_uInt8 bSimpleList:1;// Flag, ob diese NumRule nur einen Level verwendet
-    sal_uInt8 bUsedInDoc :1;// Flag, ob diese NumRule im Doc verwendet wird,
+    bool bSimpleList:1;// Flag, ob diese NumRule nur einen Level verwendet
+    bool bUsedInDoc :1;// Flag, ob diese NumRule im Doc verwendet wird,
                                                      //   oder beim Reader-Ende geloescht werden sollte
 
     WW8LSTInfo(SwNumRule* pNumRule_, WW8LST& aLST)
         : pNumRule(pNumRule_), nIdLst(aLST.nIdLst),
-        bSimpleList(aLST.bSimpleList), bUsedInDoc(0)
+        bSimpleList(aLST.bSimpleList), bUsedInDoc(false)
     {
         memcpy( aIdSty, aLST.aIdSty, sizeof( aIdSty   ));
         memset(&aItemSet, 0,  sizeof( aItemSet ));
@@ -429,12 +429,12 @@ struct WW8LFOInfo   // unsortiert, d.h. Reihenfolge genau wie im WW8 Stream
     // Byte mit hineinpacken, doch waere das eine ziemliche Fehlerquelle,
     // an dem Tag, wo MS ihr Listenformat auf mehr als 15 Level aufbohren.
 
-    sal_uInt8 bOverride  :1;// Flag, ob die NumRule nicht in maLSTInfos steht,
+    bool bOverride  :1;// Flag, ob die NumRule nicht in maLSTInfos steht,
                                                      //   sondern fuer pLFOInfos NEU angelegt wurde
-    sal_uInt8 bSimpleList:1;// Flag, ob diese NumRule nur einen Level verwendet
-    sal_uInt8 bUsedInDoc :1;// Flag, ob diese NumRule im Doc verwendet wird,
+    bool bSimpleList:1;// Flag, ob diese NumRule nur einen Level verwendet
+    bool bUsedInDoc :1;// Flag, ob diese NumRule im Doc verwendet wird,
                                                      //   oder beim Reader-Ende geloescht werden sollte
-    sal_uInt8 bLSTbUIDSet    :1;// Flag, ob bUsedInDoc in maLSTInfos gesetzt wurde,
+    bool bLSTbUIDSet    :1;// Flag, ob bUsedInDoc in maLSTInfos gesetzt wurde,
                                                      //   und nicht nochmals gesetzt zu werden braucht
     WW8LFOInfo(const WW8LFO& rLFO);
 };
@@ -447,8 +447,8 @@ WW8LFOInfo::WW8LFOInfo(const WW8LFO& rLFO)
     , nLfoLvl(rLFO.nLfoLvl)
     , bOverride(rLFO.nLfoLvl ? true : false)
     , bSimpleList(rLFO.bSimpleList)
-    , bUsedInDoc(0)
-    , bLSTbUIDSet(0)
+    , bUsedInDoc(false)
+    , bLSTbUIDSet(false)
 {
 }
 
@@ -518,9 +518,9 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
     rSt.ReadUChar( aBits1 );
     if( 0 != rSt.GetError() ) return false;
     aLVL.nAlign = (aBits1 & 0x03);
-    if( aBits1 & 0x10 ) aLVL.bV6Prev    = true;
-    if( aBits1 & 0x20 ) aLVL.bV6PrSp    = true;
-    if( aBits1 & 0x40 ) aLVL.bV6        = true;
+    if( aBits1 & 0x10 ) aLVL.bV6Prev    = sal_uInt8(true);
+    if( aBits1 & 0x20 ) aLVL.bV6PrSp    = sal_uInt8(true);
+    if( aBits1 & 0x40 ) aLVL.bV6        = sal_uInt8(true);
     bool bLVLOkB = true;
     sal_uInt8 nLevelB = 0;
     for(nLevelB = 0; nLevelB < nMaxLevel; ++nLevelB)
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index b63e639..d107eba 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -886,7 +886,7 @@ void wwSectionManager::CreateSep(const long nTxtPos, bool /*bMustHaveBreak*/)
 
     // Has a table page
     aNewSection.maSep.fTitlePage =
-        (0 != ReadBSprm( pSep, pIds[1], 0 ));
+        sal_uInt8(0 != ReadBSprm( pSep, pIds[1], 0 ));
 
     // sprmSNfcPgn
     aNewSection.maSep.nfcPgn = ReadBSprm( pSep, pIds[2], 0 );
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 11c117b..703bcf2 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1843,7 +1843,8 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
     void* pData;
     sal_uLong nOldIdx = rPLCF.GetIdx();
 
-    rF.nLen = rF.nId = rF.nOpt = rF.bCodeNest = rF.bResNest = false;
+    rF.nLen = rF.nId = rF.nOpt = 0;
+    rF.bCodeNest = rF.bResNest = false;
 
     if( !rPLCF.Get( rF.nSCode, pData ) )             // end of PLCFspecial?
         goto Err;
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 819e348..80c8dcc 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -605,8 +605,8 @@ private:
     WW8PLCFx_PCD* pPcd;
     WW8PLCFpcd_Iter *pPieceIter;
     WW8_CP nAttrStart, nAttrEnd;
-    sal_uInt8 bLineEnd : 1;
-    sal_uInt8 bComplex : 1;
+    bool bLineEnd : 1;
+    bool bComplex : 1;
 
     WW8PLCFx_Cp_FKP(const WW8PLCFx_Cp_FKP&) SAL_DELETED_FUNCTION;
     WW8PLCFx_Cp_FKP& operator=(const WW8PLCFx_Cp_FKP&) SAL_DELETED_FUNCTION;
diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx
index 79d96b2..fbfbf65 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -534,6 +534,9 @@ struct WW8_TBD
 
 struct WW8_TCell    // hiermit wird weitergearbeitet (entspricht weitestgehend dem Ver8-Format)
 {
+    // The single-bit fields should ideally be bool, but probably need to keep
+    // them as sal_uInt8 to make them combine with the following two-bit
+    // nVertAlign:
     sal_uInt8 bFirstMerged   : 1;// 0001 set to 1 when cell is first cell of a range of cells that have been merged.
     sal_uInt8 bMerged        : 1;// 0002 set to 1 when cell has been merged with preceding cell.
     sal_uInt8 bVertical      : 1;// set to 1 when cell has vertical text flow
commit 9b77b33a2dbdbb3e44a51742f0bcb7dcdea4db52
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 15:03:59 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: I10d50f76dff5d5e456b28393c48b4de21201779b

diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index cd6c072..8e2f9bd 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -74,7 +74,7 @@ StgHeader::StgHeader()
 , nByteOrder( 0 )
 , nPageSize( 0 )
 , nDataPageSize( 0 )
-, bDirty( 0 )
+, bDirty( sal_uInt8(false) )
 , nFATSize( 0 )
 , nTOCstrm( 0 )
 , nReserved( 0 )
@@ -98,7 +98,7 @@ void StgHeader::Init()
     nByteOrder    = 0xFFFE;
     nPageSize     = 9;          // 512 bytes
     nDataPageSize = 6;          // 64 bytes
-    bDirty = 0;
+    bDirty = sal_uInt8(false);
     memset( cReserved, 0, sizeof( cReserved ) );
     nFATSize = 0;
     nTOCstrm = 0;
@@ -175,7 +175,7 @@ bool StgHeader::Store( StgIo& rIo )
      .WriteInt32( nMaster );                   // 48 # of additional master blocks
     for( short i = 0; i < cFATPagesInHeader; i++ )
         r.WriteInt32( nMasterFAT[ i ] );
-    bDirty = !rIo.Good();
+    bDirty = sal_uInt8(!rIo.Good());
     return !bDirty;
 }
 
@@ -221,39 +221,39 @@ void StgHeader::SetFATPage( short n, sal_Int32 nb )
     if( n >= 0 && n < cFATPagesInHeader )
     {
         if( nMasterFAT[ n ] != nb )
-            bDirty = sal_True, nMasterFAT[ n ] = nb;
+            bDirty = sal_uInt8(true), nMasterFAT[ n ] = nb;
     }
 }
 
 void StgHeader::SetTOCStart( sal_Int32 n )
 {
-    if( n != nTOCstrm ) bDirty = sal_True, nTOCstrm = n;
+    if( n != nTOCstrm ) bDirty = sal_uInt8(true), nTOCstrm = n;
 }
 
 void StgHeader::SetDataFATStart( sal_Int32 n )
 {
-    if( n != nDataFAT ) bDirty = sal_True, nDataFAT = n;
+    if( n != nDataFAT ) bDirty = sal_uInt8(true), nDataFAT = n;
 }
 
 void StgHeader::SetDataFATSize( sal_Int32 n )
 {
-    if( n != nDataFATSize ) bDirty = sal_True, nDataFATSize = n;
+    if( n != nDataFATSize ) bDirty = sal_uInt8(true), nDataFATSize = n;
 }
 
 void StgHeader::SetFATSize( sal_Int32 n )
 {
-    if( n != nFATSize ) bDirty = sal_True, nFATSize = n;
+    if( n != nFATSize ) bDirty = sal_uInt8(true), nFATSize = n;
 }
 
 void StgHeader::SetFATChain( sal_Int32 n )
 {
     if( n != nMasterChain )
-        bDirty = sal_True, nMasterChain = n;
+        bDirty = sal_uInt8(true), nMasterChain = n;
 }
 
 void StgHeader::SetMasters( sal_Int32 n )
 {
-    if( n != nMaster ) bDirty = sal_True, nMaster = n;
+    if( n != nMaster ) bDirty = sal_uInt8(true), nMaster = n;
 }
 
 ///////////////////////////// class StgEntry
diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx
index 7afe220..385ee9b 100644
--- a/sot/source/sdstor/stgelem.hxx
+++ b/sot/source/sdstor/stgelem.hxx
@@ -41,7 +41,9 @@ class StgHeader
     sal_uInt16  nByteOrder;                 // 1C Unicode byte order indicator
     sal_Int16   nPageSize;                  // 1E 1 << nPageSize = block size
     sal_Int16   nDataPageSize;              // 20 1 << this size == data block size
-    sal_uInt8   bDirty;                     // 22 internal dirty flag
+    sal_uInt8   bDirty;                     // 22 internal dirty flag (should be
+                                            //    bool, but probably required to
+                                            //    be exactly one byte)
     sal_uInt8   cReserved[ 9 ];             // 23
     sal_Int32   nFATSize;                   // 2C total number of FAT pages
     sal_Int32   nTOCstrm;                   // 30 starting page for the TOC stream
commit 12685fe6b8c28ceeaacf590503c9c30ef64af3e9
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 14:59:02 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: If12ec14db83001fe2b51bda25fc71302953d0496

diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index eeb4bc3..3dbbe10 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1059,7 +1059,7 @@ sal_Int16 AnimationExporter::exportAnimPropertySet( SvStream& rStrm, const Refer
     {
         bool bAfterEffect = false;
         if ( *pAny[ DFF_ANIM_AFTEREFFECT ] >>= bAfterEffect )
-            exportAnimPropertyByte( rStrm, DFF_ANIM_AFTEREFFECT, bAfterEffect, TRANSLATE_NONE );
+            exportAnimPropertyByte( rStrm, DFF_ANIM_AFTEREFFECT, int(bAfterEffect), TRANSLATE_NONE );
     }
 
     if ( pAny[ DFF_ANIM_RUNTIMECONTEXT ] )
commit 958048faf2a28264047c20fa470d3b24bb3c2811
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 14:58:43 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: I165f9cff6c0e942213dddf3b5841c4bb22017330

diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx
index e84241e..222c5cb 100644
--- a/sc/source/filter/inc/xcl97rec.hxx
+++ b/sc/source/filter/inc/xcl97rec.hxx
@@ -375,7 +375,7 @@ private:
     XclExpString                sName;
     XclExpString                sComment;
     XclExpString                sUserName;
-    sal_uInt8                   nProtected;
+    bool                        nProtected;
 
     std::vector<ExcEScenarioCell> aCells;
 
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index be7b485..6dec063 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1236,7 +1236,7 @@ ExcEScenario::ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab )
     sComment.Assign( sTmpComm, EXC_STR_DEFAULT, 255 );
     if( sComment.Len() )
         nRecLen += sComment.GetSize();
-    nProtected = (nFlags & SC_SCENARIO_PROTECT) ? 1 : 0;
+    nProtected = (nFlags & SC_SCENARIO_PROTECT);
 
     sUserName.Assign( rRoot.GetUserName(), EXC_STR_DEFAULT, 255 );
     nRecLen += sUserName.GetSize();
@@ -1294,7 +1294,7 @@ void ExcEScenario::SaveCont( XclExpStream& rStrm )
     sal_uInt16 count = aCells.size();
 
     rStrm   << (sal_uInt16) count               // number of cells
-            << nProtected                       // fProtection
+            << sal_uInt8(nProtected)            // fProtection
             << (sal_uInt8) 0                    // fHidden
             << (sal_uInt8) sName.Len()          // length of scen name
             << (sal_uInt8) sComment.Len()       // length of comment
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index 074987b..aab4372 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -192,10 +192,10 @@ sal_uInt8 FuPoor::Command(const CommandEvent& rCEvt)
         if ( pOutView )
             return pOutView->HasSelection() ? (pView->Command(rCEvt,pWindow) ? 1 : 0) : SC_CMD_NONE;
         else
-            return pView->Command(rCEvt,pWindow);
+            return pView->Command(rCEvt,pWindow) ? 1 : 0;
     }
     else
-        return pView->Command(rCEvt,pWindow);
+        return pView->Command(rCEvt,pWindow) ? 1 : 0;
 }
 
 /*************************************************************************
commit f4022fedc676e3b5c8e5dc1e559a2b9fe9c0fcf7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 14:57:50 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: Ib7138c40a7f78adae2c362019bc9e20900391ebf

diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index fc9d3b8..e799444 100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -59,7 +59,7 @@ static bool ReadRangeSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm,
 
 SvStream& WriteSvBOOL(SvStream & rStm, const SvBOOL & rb )
 {
-    sal_uInt8 n = rb.nVal;
+    sal_uInt8 n = int(rb.nVal);
     if( rb.bSet )
         n |= 0x02;
     rStm.WriteUChar( n );
commit b6df255ff1111d4400edd42b12f4f9929be3e83f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 14:57:34 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: Ia175eef112cd79019be26a6a068992d796cb2faf

diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx
index dfa8bbd..28e8426 100644
--- a/filter/source/flash/swfwriter2.cxx
+++ b/filter/source/flash/swfwriter2.cxx
@@ -306,9 +306,9 @@ void Tag::writeMatrix( SvStream& rOut, const ::basegfx::B2DHomMatrix& rMatrix )
 
     BitStream aBits;
 
-    const sal_uInt8 bHasScale = rMatrix.get(0, 0) != 1.0 || rMatrix.get(1, 1) != 1.0;
+    const bool bHasScale = rMatrix.get(0, 0) != 1.0 || rMatrix.get(1, 1) != 1.0;
 
-    aBits.writeUB( bHasScale, 1 );
+    aBits.writeUB( int(bHasScale), 1 );
 
     if( bHasScale )
     {
@@ -319,9 +319,9 @@ void Tag::writeMatrix( SvStream& rOut, const ::basegfx::B2DHomMatrix& rMatrix )
         aBits.writeFB( getFixed( rMatrix.get(1, 1) ), nScaleBits ); // Scale Y
     }
 
-    const sal_uInt8 bHasRotate = rMatrix.get(0, 1) != 0.0 || rMatrix.get(1, 0) != 0.0;
+    const bool bHasRotate = rMatrix.get(0, 1) != 0.0 || rMatrix.get(1, 0) != 0.0;
 
-    aBits.writeUB( bHasRotate, 1 );
+    aBits.writeUB( int(bHasRotate), 1 );
 
     if( bHasRotate )
     {
commit ab8405cae9e25ac5201b3648a53a811670ebb715
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 14:57:03 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: I248a35364e7bc24ec2d62f70ac9a9e91f07ddf68

diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx
index 85676ab..3076ead 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -411,7 +411,7 @@ EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAt
 
 void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* )
 {
-    rFont.SetKerning( static_cast<const SvxAutoKernItem*>(GetItem())->GetValue() );
+    rFont.SetKerning( static_cast<const SvxAutoKernItem*>(GetItem())->GetValue() ? KERNING_FONTSPECIFIC : 0 );
 }
 
 
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index a1651ab..4d67332 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2083,7 +2083,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S
         rFont.SetEscapement( nEsc );
     }
     if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_PAIRKERNING ) == SfxItemState::SET ) )
-        rFont.SetKerning( static_cast<const SvxAutoKernItem&>(rSet.Get( EE_CHAR_PAIRKERNING )).GetValue() );
+        rFont.SetKerning( static_cast<const SvxAutoKernItem&>(rSet.Get( EE_CHAR_PAIRKERNING )).GetValue() ? KERNING_FONTSPECIFIC : 0 );
     if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_KERNING ) == SfxItemState::SET ) )
         rFont.SetFixKerning( static_cast<const SvxKerningItem&>(rSet.Get( EE_CHAR_KERNING )).GetValue() );
     if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_WLM ) == SfxItemState::SET ) )
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index f1069cc..724a149 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1015,7 +1015,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
                     }
 
                     DrawingText(aTextPos, pPara->GetText(), 0, pPara->GetText().getLength(), pBuf.get(),
-                        aSvxFont, nPara, -1, bRightToLeftPara, 0, 0, false, false, true, 0, Color(), Color());
+                        aSvxFont, nPara, -1, bRightToLeftPara ? 1 : 0, 0, 0, false, false, true, 0, Color(), Color());
                 }
                 else
                 {
commit 66d412cacd0e22aee4e7ee119c93440c18baaac2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 14:56:11 2015 +0200

    loplugin:implicitboolconversion clean-up
    
    Change-Id: I231012b4603158a6b81d42741076f1742da6695c

diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 6c2ee2f..cd3b9e2 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -1234,7 +1234,7 @@ sal_uInt8 ORowSetValue::getUInt8()    const
                 break;
             case DataType::BIT:
             case DataType::BOOLEAN:
-                nRet = m_aValue.m_bBool;
+                nRet = int(m_aValue.m_bBool);
                 break;
             case DataType::TINYINT:
                 if ( m_bSigned )
commit 9f23260105672903a047c2194a36ebd448fff135
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 14:55:13 2015 +0200

    SvStream: WriteUChar -> WriteBool
    
    Change-Id: I89aa0e22c31d368ab36fe46917db6aacb11c7b14

diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 4aeb38e..8ac5bee 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2064,7 +2064,7 @@ bool SbMethod::StoreData( SvStream& rStrm ) const
          .WriteInt16( nLine1 )
          .WriteInt16( nLine2 )
          .WriteInt16( nStart )
-         .WriteUChar( bInvalid );
+         .WriteBool( bInvalid );
     return true;
 }
 
diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx
index 2e1d382..0946345 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -316,7 +316,7 @@ bool SbxStdCollection::StoreData( SvStream& rStrm ) const
     {
         write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aElemClass,
             RTL_TEXTENCODING_ASCII_US);
-        rStrm.WriteUChar( bAddRemoveOk );
+        rStrm.WriteBool( bAddRemoveOk );
     }
     return bRes;
 }
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 2f4c3d4..c62dbb6 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1100,7 +1100,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
     sal_uInt16 nVer = 602;
     rOStream.WriteUInt16( nVer );
 
-    rOStream.WriteUChar( bOwnerOfPool );
+    rOStream.WriteBool( bOwnerOfPool );
 
     // First store the pool, later only the Surregate
     if ( bOwnerOfPool )
@@ -1243,10 +1243,10 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
     rOStream.WriteUInt16( nUserType );
     rOStream.WriteUInt32( nObjSettings );
 
-    rOStream.WriteUChar( bVertical );
+    rOStream.WriteBool( bVertical );
     rOStream.WriteUInt16( static_cast<sal_uInt16>(nScriptType) );
 
-    rOStream.WriteUChar( bStoreUnicodeStrings );
+    rOStream.WriteBool( bStoreUnicodeStrings );
     if ( bStoreUnicodeStrings )
     {
         for ( size_t nPara = 0; nPara < nParagraphs_Stream; nPara++ )
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 1a5738d..b064667 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -54,9 +54,9 @@ void SvxBulletItem::StoreFont( SvStream& rStream, const vcl::Font& rFont )
     // UNICODE: rStream << rFont.GetName();
     rStream.WriteUniOrByteString(rFont.GetName(), rStream.GetStreamCharSet());
 
-    rStream.WriteUChar( rFont.IsOutline() );
-    rStream.WriteUChar( rFont.IsShadow() );
-    rStream.WriteUChar( rFont.IsTransparent() );
+    rStream.WriteBool( rFont.IsOutline() );
+    rStream.WriteBool( rFont.IsShadow() );
+    rStream.WriteBool( rFont.IsTransparent() );
 }
 
 
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index a25bc0a..32ccb2c 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1521,7 +1521,7 @@ SvStream& SvxShadowItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ )
 {
     rStrm.WriteSChar( GetLocation() )
          .WriteUInt16( GetWidth() )
-         .WriteUChar( aShadowColor.GetTransparency() > 0 );
+         .WriteBool( aShadowColor.GetTransparency() > 0 );
     WriteColor( rStrm, GetColor() );
     WriteColor( rStrm, GetColor() );
     rStrm.WriteSChar( aShadowColor.GetTransparency() > 0 ? 0 : 1 ); //BRUSH_NULL : BRUSH_SOLID
@@ -3874,7 +3874,7 @@ SfxPoolItem* SvxBrushItem::Create( SvStream& rStream, sal_uInt16 nVersion ) cons
 
 SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ ) const
 {
-    rStream.WriteUChar( false );
+    rStream.WriteBool( false );
     WriteColor( rStream, aColor );
     WriteColor( rStream, aColor );
     rStream.WriteSChar( aColor.GetTransparency() > 0 ? 0 : 1 ); //BRUSH_NULL : BRUSH_SOLID
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 7b3f647..db11b63 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1611,7 +1611,7 @@ SfxPoolItem* SvxShadowedItem::Clone( SfxItemPool * ) const
 
 SvStream& SvxShadowedItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
 {
-    rStrm.WriteUChar( GetValue() );
+    rStrm.WriteBool( GetValue() );
     return rStrm;
 }
 
@@ -1660,7 +1660,7 @@ SfxPoolItem* SvxAutoKernItem::Clone( SfxItemPool * ) const
 
 SvStream& SvxAutoKernItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
 {
-    rStrm.WriteUChar( GetValue() );
+    rStrm.WriteBool( GetValue() );
     return rStrm;
 }
 
@@ -1710,7 +1710,7 @@ SfxPoolItem* SvxWordLineModeItem::Clone( SfxItemPool * ) const
 
 SvStream& SvxWordLineModeItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
 {
-    rStrm.WriteUChar( GetValue() );
+    rStrm.WriteBool( GetValue() );
     return rStrm;
 }
 
@@ -1759,7 +1759,7 @@ SfxPoolItem* SvxContourItem::Clone( SfxItemPool * ) const
 
 SvStream& SvxContourItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
 {
-    rStrm.WriteUChar( GetValue() );
+    rStrm.WriteBool( GetValue() );
     return rStrm;
 }
 
@@ -2567,7 +2567,7 @@ SfxPoolItem* SvxNoLinebreakItem::Clone( SfxItemPool* ) const
 
 SvStream& SvxNoLinebreakItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
 {
-    rStrm.WriteUChar( GetValue() );
+    rStrm.WriteBool( GetValue() );
     return rStrm;
 }
 
@@ -2612,7 +2612,7 @@ SfxPoolItem* SvxNoHyphenItem::Clone( SfxItemPool* ) const
 
 SvStream& SvxNoHyphenItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
 {
-    rStrm.WriteUChar( GetValue() );
+    rStrm.WriteBool( GetValue() );
     return rStrm;
 }
 
@@ -2700,7 +2700,7 @@ SfxPoolItem* SvxBlinkItem::Clone( SfxItemPool * ) const
 
 SvStream& SvxBlinkItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const
 {
-    rStrm.WriteUChar( GetValue() );
+    rStrm.WriteBool( GetValue() );
     return rStrm;
 }
 
@@ -2984,7 +2984,7 @@ SfxPoolItem* SvxTwoLinesItem::Create( SvStream & rStrm, sal_uInt16 /*nVer*/) con
 
 SvStream& SvxTwoLinesItem::Store(SvStream & rStrm, sal_uInt16 /*nIVer*/) const
 {
-    rStrm.WriteUChar( GetValue() ).WriteUInt16( GetStartBracket() ).WriteUInt16( GetEndBracket() );
+    rStrm.WriteBool( GetValue() ).WriteUInt16( GetStartBracket() ).WriteUInt16( GetEndBracket() );
     return rStrm;
 }
 
@@ -3026,7 +3026,7 @@ SfxPoolItem* SvxCharRotateItem::Create( SvStream& rStrm, sal_uInt16 ) const
 SvStream& SvxCharRotateItem::Store( SvStream & rStrm, sal_uInt16 ) const
 {
     bool bFlag = IsFitToLine();
-    rStrm.WriteUInt16( GetValue() ).WriteUChar( bFlag );
+    rStrm.WriteUInt16( GetValue() ).WriteBool( bFlag );
     return rStrm;
 }
 
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 67680c0..a3a3a5b 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -4134,7 +4134,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
                    .WriteInt16( pGraphicAttr->GetChannelG() )
                    .WriteInt16( pGraphicAttr->GetChannelB() )
                    .WriteDouble( pGraphicAttr->GetGamma() );
-                aSt.WriteUChar( pGraphicAttr->IsInvert() )
+                aSt.WriteBool( pGraphicAttr->IsInvert() )
                    .WriteUChar( pGraphicAttr->GetTransparency() );
                 mnIdentifier[ 1 ] = rtl_crc32( 0, aSt.GetData(), aSt.Tell() );
             }
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 0dfc369..08d258c 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -173,7 +173,7 @@ SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */
 
 SvStream& ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */) const
 {
-    rStream.WriteUChar( true );
+    rStream.WriteBool( true );
 
     if ( pStyle )
         rStream.WriteUniOrByteString( pStyle->GetName(), rStream.GetStreamCharSet() );
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 6d69934..c68a4f6 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -795,12 +795,12 @@ bool ScAutoFormatData::Save(SvStream& rStream, sal_uInt16 fileVersion)
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rStream, aName, RTL_TEXTENCODING_UTF8);
 
     rStream.WriteUInt16( nStrResId );
-    rStream.WriteUChar( bIncludeFont );
-    rStream.WriteUChar( bIncludeJustify );
-    rStream.WriteUChar( bIncludeFrame );
-    rStream.WriteUChar( bIncludeBackground );
-    rStream.WriteUChar( bIncludeValueFormat );
-    rStream.WriteUChar( bIncludeWidthHeight );
+    rStream.WriteBool( bIncludeFont );
+    rStream.WriteBool( bIncludeJustify );
+    rStream.WriteBool( bIncludeFrame );
+    rStream.WriteBool( bIncludeBackground );
+    rStream.WriteBool( bIncludeValueFormat );
+    rStream.WriteBool( bIncludeWidthHeight );
 
     if (fileVersion >= SOFFICE_FILEFORMAT_50)
         WriteAutoFormatSwBlob( rStream, m_swFields );
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index f449912..bf7770c 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -110,7 +110,7 @@ void ScDdeLink::Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const
     rStream.WriteUniOrByteString( aItem, eCharSet );
 
     bool bHasValue = ( pResult != 0 );
-    rStream.WriteUChar( bHasValue );
+    rStream.WriteBool( bHasValue );
 
     if( rStream.GetVersion() > SOFFICE_FILEFORMAT_40 )      // nicht bei 4.0 Export
         rStream.WriteUChar( nMode );                                   // seit 388b
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 7edbf12..36bc197 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -302,8 +302,8 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes
         RTL_TEXTENCODING_UTF8);
 
     rOut.WriteUInt16( rDesign.m_eMode );
-    rOut.WriteUChar( rDesign.m_bContentPage );
-    rOut.WriteUChar( rDesign.m_bNotes );
+    rOut.WriteBool( rDesign.m_bContentPage );
+    rOut.WriteBool( rDesign.m_bNotes );
     rOut.WriteUInt16( rDesign.m_nResolution );
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCompression,
         RTL_TEXTENCODING_UTF8);
@@ -316,17 +316,17 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes
         RTL_TEXTENCODING_UTF8);
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aMisc,
         RTL_TEXTENCODING_UTF8);
-    rOut.WriteUChar( rDesign.m_bDownload );
-    rOut.WriteUChar( rDesign.m_bCreated );     // not used
+    rOut.WriteBool( rDesign.m_bDownload );
+    rOut.WriteBool( rDesign.m_bCreated );     // not used
     rOut.WriteInt16( rDesign.m_nButtonThema );
-    rOut.WriteUChar( rDesign.m_bUserAttr );
+    rOut.WriteBool( rDesign.m_bUserAttr );
     WriteColor( rOut, rDesign.m_aBackColor );
     WriteColor( rOut, rDesign.m_aTextColor );
     WriteColor( rOut, rDesign.m_aLinkColor );
     WriteColor( rOut, rDesign.m_aVLinkColor );
     WriteColor( rOut, rDesign.m_aALinkColor );
-    rOut.WriteUChar( rDesign.m_bUseAttribs );
-    rOut.WriteUChar( rDesign.m_bUseColor );
+    rOut.WriteBool( rDesign.m_bUseAttribs );
+    rOut.WriteBool( rDesign.m_bUseColor );
 
     rOut.WriteUInt16( rDesign.m_eScript );
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aURL,
@@ -334,11 +334,11 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCGI,
         RTL_TEXTENCODING_UTF8);
 
-    rOut.WriteUChar( rDesign.m_bAutoSlide );
+    rOut.WriteBool( rDesign.m_bAutoSlide );
     rOut.WriteUInt32( rDesign.m_nSlideDuration );
-    rOut.WriteUChar( rDesign.m_bEndless );
-    rOut.WriteUChar( rDesign.m_bSlideSound );
-    rOut.WriteUChar( rDesign.m_bHiddenSlides );
+    rOut.WriteBool( rDesign.m_bEndless );
+    rOut.WriteBool( rDesign.m_bSlideSound );
+    rOut.WriteBool( rDesign.m_bHiddenSlides );
 
     return rOut;
 }
diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx
index d21de6f..db55129 100644
--- a/sd/source/ui/dlg/morphdlg.cxx
+++ b/sd/source/ui/dlg/morphdlg.cxx
@@ -102,8 +102,8 @@ void MorphDlg::SaveSettings() const
         SdIOCompat aCompat( *xOStm, StreamMode::WRITE, 1 );
 
         xOStm->WriteUInt16( m_pMtfSteps->GetValue() )
-              .WriteUChar( m_pCbxOrientation->IsChecked() )
-              .WriteUChar( m_pCbxAttributes->IsChecked() );
+              .WriteBool( m_pCbxOrientation->IsChecked() )
+              .WriteBool( m_pCbxAttributes->IsChecked() );
     }
 }
 
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 71d6ed9..f533073 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -335,7 +335,7 @@ void SdVectorizeDlg::SaveSettings() const
     {
         SdIOCompat aCompat( *xOStm, StreamMode::WRITE, 1 );
         xOStm->WriteUInt16( m_pNmLayers->GetValue() ).WriteUInt16( m_pMtReduce->GetValue() );
-        xOStm->WriteUInt16( m_pMtFillHoles->GetValue() ).WriteUChar( m_pCbFillHoles->IsChecked() );
+        xOStm->WriteUInt16( m_pMtFillHoles->GetValue() ).WriteBool( m_pCbFillHoles->IsChecked() );
     }
 }
 
diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx
index bb4ada8..a5525be 100644
--- a/svl/source/items/cenumitm.cxx
+++ b/svl/source/items/cenumitm.cxx
@@ -211,7 +211,7 @@ SfxPoolItem * SfxBoolItem::Create(SvStream & rStream, sal_uInt16) const
 // virtual
 SvStream & SfxBoolItem::Store(SvStream & rStream, sal_uInt16) const
 {
-    rStream.WriteUChar( m_bValue ); // not bool for serialization!
+    rStream.WriteBool( m_bValue ); // not bool for serialization!
     return rStream;
 }
 
diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx
index 4e79d88..a5427df 100644
--- a/svl/source/items/ctypeitm.cxx
+++ b/svl/source/items/ctypeitm.cxx
@@ -90,7 +90,7 @@ SvStream & CntContentTypeItem::Store(SvStream & rStream, sal_uInt16) const
     // CntContentTypeItem used to be derived from CntStringItem, so take that
     // into account:
     writeUnicodeString(rStream, GetValue());
-    rStream.WriteUInt32( CNTSTRINGITEM_STREAM_MAGIC ).WriteUChar( false );
+    rStream.WriteUInt32( CNTSTRINGITEM_STREAM_MAGIC ).WriteBool( false );
     return rStream;
 }
 
diff --git a/svtools/source/graphic/grfattr.cxx b/svtools/source/graphic/grfattr.cxx
index 6a11cb2..29e5e50 100644
--- a/svtools/source/graphic/grfattr.cxx
+++ b/svtools/source/graphic/grfattr.cxx
@@ -108,7 +108,7 @@ SvStream& WriteGraphicAttr( SvStream& rOStm, const GraphicAttr& rAttr )
     rOStm.WriteDouble( rAttr.mfGamma );
     rOStm.WriteUInt32( rAttr.mnMirrFlags ).WriteUInt16( rAttr.mnRotate10 );
     rOStm.WriteInt16( rAttr.mnContPercent ).WriteInt16( rAttr.mnLumPercent ).WriteInt16( rAttr.mnRPercent ).WriteInt16( rAttr.mnGPercent ).WriteInt16( rAttr.mnBPercent );
-    rOStm.WriteUChar( rAttr.mbInvert ).WriteUChar( rAttr.mcTransparency ).WriteUInt16( rAttr.meDrawMode );
+    rOStm.WriteBool( rAttr.mbInvert ).WriteUChar( rAttr.mcTransparency ).WriteUInt16( rAttr.meDrawMode );
     rOStm.WriteInt32( rAttr.mnLeftCrop )
          .WriteInt32( rAttr.mnTopCrop )
          .WriteInt32( rAttr.mnRightCrop )
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index c91b6e0..0ee4ff9 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1122,7 +1122,7 @@ SvStream& WriteGraphicObject( SvStream& rOStm, const GraphicObject& rGraphicObj
 
     WriteGraphic( rOStm, rGraphicObj.GetGraphic() );
     WriteGraphicAttr( rOStm, rGraphicObj.GetAttr() );
-    rOStm.WriteUChar( bLink );
+    rOStm.WriteBool( bLink );
 
     if( bLink )
         write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8);
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 3df94ab..d005651 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -78,7 +78,7 @@ void IMapObject::Write( SvStream& rOStm, const OUString& rBaseURL ) const
         URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), eEncoding);
     write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, aRelURL);
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aAltText, eEncoding);
-    rOStm.WriteUChar( bActive );
+    rOStm.WriteBool( bActive );
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aTarget, eEncoding);
 
     boost::scoped_ptr<IMapCompat> pCompat(new IMapCompat( rOStm, StreamMode::WRITE ));
@@ -418,7 +418,7 @@ void IMapPolygonObject::ImpConstruct( const Polygon& rPoly, bool bPixel )
 void IMapPolygonObject::WriteIMapObject( SvStream& rOStm ) const
 {
     WritePolygon( rOStm, aPoly );
-    rOStm.WriteUChar( bEllipse );  // >= Version 2
+    rOStm.WriteBool( bEllipse );  // >= Version 2
     WriteRectangle( rOStm, aEllipse );  // >= Version 2
 }
 
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 3205a9c..35a35ef 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -174,7 +174,7 @@ void SgaObject::WriteData( SvStream& rOut, const OUString& rDestDir ) const
     static const sal_uInt32 nInventor = COMPAT_FORMAT( 'S', 'G', 'A', '3' );
 
     rOut.WriteUInt32( nInventor ).WriteUInt16( 0x0004 ).WriteUInt16( GetVersion() ).WriteUInt16( GetObjKind() );
-    rOut.WriteUChar( bIsThumbBmp );
+    rOut.WriteBool( bIsThumbBmp );
 
     if( bIsThumbBmp )
     {
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index f037a0b..b3e2c39 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -1346,7 +1346,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const
                           << m_aDestDir << "' in '" << aPath << "'");
         }
 
-        rOStm.WriteUChar( bRel );
+        rOStm.WriteBool( bRel );
         write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aPath, RTL_TEXTENCODING_UTF8);
         rOStm.WriteUInt32( pObj->nOffset ).WriteUInt16( pObj->eObjKind );
     }
@@ -1358,7 +1358,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const
     const long      nReservePos = rOStm.Tell();
     boost::scoped_ptr<VersionCompat> pCompat(new VersionCompat( rOStm, StreamMode::WRITE, 2 ));
 
-    rOStm.WriteUInt32( GetId() ).WriteUChar( IsThemeNameFromResource() ); // From version 2 and up
+    rOStm.WriteUInt32( GetId() ).WriteBool( IsThemeNameFromResource() ); // From version 2 and up
 
     pCompat.reset();
 
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index 1ebbdea..b92e946 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -246,7 +246,7 @@ SvStream& SvxPageItem::Store( SvStream &rStrm, sal_uInt16 /*nItemVersion*/ ) con
     // UNICODE: rStrm << aDescName;
     rStrm.WriteUniOrByteString(aDescName, rStrm.GetStreamCharSet());
 
-    rStrm.WriteUChar( eNumType ).WriteUChar( bLandscape ).WriteUInt16( eUse );
+    rStrm.WriteUChar( eNumType ).WriteBool( bLandscape ).WriteUInt16( eUse );
     return rStrm;
 }
 
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 4bd62ac..408a694 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1405,7 +1405,7 @@ SvStream& SdrTextFixedCellHeightItem::Store( SvStream& rOut, sal_uInt16 nItemVer
     if ( nItemVersion )
     {
         bool bValue = GetValue();
-        rOut.WriteUChar( bValue );
+        rOut.WriteBool( bValue );
     }
     return rOut;
 }
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 5880d2f..66bc940 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -967,12 +967,12 @@ bool SwTableAutoFmt::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
     write_uInt16_lenPrefixed_uInt8s_FromOUString(rStream, m_aName,
         RTL_TEXTENCODING_UTF8 );
     rStream.WriteUInt16( nStrResId );
-    rStream.WriteUChar( bInclFont );
-    rStream.WriteUChar( bInclJustify );
-    rStream.WriteUChar( bInclFrame );
-    rStream.WriteUChar( bInclBackground );
-    rStream.WriteUChar( bInclValueFormat );
-    rStream.WriteUChar( bInclWidthHeight );
+    rStream.WriteBool( bInclFont );
+    rStream.WriteBool( bInclJustify );
+    rStream.WriteBool( bInclFrame );
+    rStream.WriteBool( bInclBackground );
+    rStream.WriteBool( bInclValueFormat );
+    rStream.WriteBool( bInclWidthHeight );
 
     {
         WriterSpecificAutoFormatBlock block(rStream);
@@ -980,7 +980,7 @@ bool SwTableAutoFmt::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
         m_aBreak.Store(rStream, m_aBreak.GetVersion(fileVersion));
         m_aPageDesc.Store(rStream, m_aPageDesc.GetVersion(fileVersion));
         m_aKeepWithNextPara.Store(rStream, m_aKeepWithNextPara.GetVersion(fileVersion));
-        rStream.WriteUInt16( m_aRepeatHeading ).WriteUChar( m_bLayoutSplit ).WriteUChar( m_bRowSplit ).WriteUChar( m_bCollapsingBorders );
+        rStream.WriteUInt16( m_aRepeatHeading ).WriteBool( m_bLayoutSplit ).WriteBool( m_bRowSplit ).WriteBool( m_bCollapsingBorders );
         m_aShadow.Store(rStream, m_aShadow.GetVersion(fileVersion));
     }
 
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index e4153b9..5357742 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1643,7 +1643,7 @@ void Polygon::ImplWrite( SvStream& rOStream ) const
 {
     bool bHasPolyFlags = mpImplPolygon->mpFlagAry != NULL;
     WritePolygon( rOStream, *this );
-    rOStream.WriteUChar(bHasPolyFlags);
+    rOStream.WriteBool(bHasPolyFlags);
 
     if ( bHasPolyFlags )
         rOStream.Write( mpImplPolygon->mpFlagAry, mpImplPolygon->mnPoints );
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index f4ba559..f83581f 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -720,7 +720,7 @@ SvStream& WriteAnimation( SvStream& rOStm, const Animation& rAnimation )
             WritePair( rOStm, rAnimation.maGlobalSize );
             rOStm.WriteUInt16( ( ANIMATION_TIMEOUT_ON_CLICK == rAnimBmp.nWait ) ? 65535 : rAnimBmp.nWait );
             rOStm.WriteUInt16( rAnimBmp.eDisposal );
-            rOStm.WriteUChar( rAnimBmp.bUserInput );
+            rOStm.WriteBool( rAnimBmp.bUserInput );
             rOStm.WriteUInt32( rAnimation.mnLoopCount );
             rOStm.WriteUInt32( nDummy32 ); // Unused
             rOStm.WriteUInt32( nDummy32 ); // Unused
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 2f4b17a..f732f8d 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -252,10 +252,10 @@ void ImplWriteFont( SvStream& rOStm, const vcl::Font& rFont,
     rOStm.WriteInt16( nWeight );
     rOStm.WriteInt16( rFont.GetUnderline() );
     rOStm.WriteInt16( rFont.GetStrikeout() );
-    rOStm.WriteUChar( rFont.GetItalic() != ITALIC_NONE );
-    rOStm.WriteUChar( rFont.IsOutline() );
-    rOStm.WriteUChar( rFont.IsShadow() );
-    rOStm.WriteUChar( rFont.IsTransparent() );
+    rOStm.WriteBool( rFont.GetItalic() != ITALIC_NONE );
+    rOStm.WriteBool( rFont.IsOutline() );
+    rOStm.WriteBool( rFont.IsShadow() );
+    rOStm.WriteBool( rFont.IsTransparent() );
     if ( rActualCharSet == RTL_TEXTENCODING_DONTKNOW )
         rActualCharSet = osl_getThreadTextEncoding();
 }
@@ -371,7 +371,7 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const tools::PolyPolygo
 
                     if(rCandidate.HasFlags())
                     {
-                        rOStm.WriteUChar( true );
+                        rOStm.WriteBool( true );
 
                         for(sal_uInt16 c(0); c < nPointCount; c++)
                         {
@@ -380,7 +380,7 @@ bool ImplWriteExtendedPolyPolygonAction(SvStream& rOStm, const tools::PolyPolygo
                     }
                     else
                     {
-                        rOStm.WriteUChar( false );
+                        rOStm.WriteBool( false );
                     }
                 }
             }
@@ -2344,7 +2344,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
 
                 // write data
                 WritePair( rOStm, rRefPoint );
-                rOStm.WriteUChar( bSet );
+                rOStm.WriteBool( bSet );
                 rOStm.WriteInt32( 0 ); // number of actions that follow this comment
 
                 // calculate and write ActionSize of comment
@@ -2373,7 +2373,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
 
                 // write data
                 WriteColor( rOStm, rColor );
-                rOStm.WriteUChar( bSet );
+                rOStm.WriteBool( bSet );
                 rOStm.WriteInt32( 0 ); // number of actions that follow this comment
 
                 // calculate and write ActionSize of comment
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 8e3be59..d8cf71a 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -719,15 +719,15 @@ SvStream& WriteImpl_Font( SvStream& rOStm, const Impl_Font& rImpl_Font )
 
     rOStm.WriteInt16( rImpl_Font.mnOrientation );
 
-    rOStm.WriteUChar( rImpl_Font.mbWordLine );
-    rOStm.WriteUChar( rImpl_Font.mbOutline );
-    rOStm.WriteUChar( rImpl_Font.mbShadow );
+    rOStm.WriteBool( rImpl_Font.mbWordLine );
+    rOStm.WriteBool( rImpl_Font.mbOutline );
+    rOStm.WriteBool( rImpl_Font.mbShadow );
     rOStm.WriteUChar( rImpl_Font.mnKerning );
 
     // new in version 2
     rOStm.WriteUChar( rImpl_Font.meRelief );
     rOStm.WriteUInt16( rImpl_Font.maCJKLanguageTag.getLanguageType( false) );
-    rOStm.WriteUChar( rImpl_Font.mbVertical );
+    rOStm.WriteBool( rImpl_Font.mbVertical );
     rOStm.WriteUInt16( rImpl_Font.meEmphasisMark );
 
     // new in version 3
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index ec568fa..b3b71c5 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -88,7 +88,7 @@ SvStream& WriteImplMapMode(SvStream& rOStm, const MapMode::ImplMapMode& rImplMap
     WritePair( rOStm, rImplMapMode.maOrigin );
     WriteFraction( rOStm, rImplMapMode.maScaleX );
     WriteFraction( rOStm, rImplMapMode.maScaleY );
-    rOStm.WriteUChar( rImplMapMode.mbSimple );
+    rOStm.WriteBool( rImplMapMode.mbSimple );
 
     return rOStm;
 }
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 9dbcce0..8701959 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -889,8 +889,8 @@ void MetaPolyLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     WritePolygon( rOStm, aSimplePoly );                               // Version 1
     WriteLineInfo( rOStm, maLineInfo );                                // Version 2
 
-    sal_uInt8 bHasPolyFlags = maPoly.HasFlags();        // Version 3
-    rOStm.WriteUChar( bHasPolyFlags );
+    bool bHasPolyFlags = maPoly.HasFlags();        // Version 3
+    rOStm.WriteBool( bHasPolyFlags );
     if ( bHasPolyFlags )
         maPoly.Write( rOStm );
 }
@@ -962,8 +962,8 @@ void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     maPoly.AdaptiveSubdivide( aSimplePoly );
     WritePolygon( rOStm, aSimplePoly );
 
-    sal_uInt8 bHasPolyFlags = maPoly.HasFlags();    // Version 2
-    rOStm.WriteUChar( bHasPolyFlags );
+    bool bHasPolyFlags = maPoly.HasFlags();    // Version 2
+    rOStm.WriteBool( bHasPolyFlags );
     if ( bHasPolyFlags )
         maPoly.Write( rOStm );
 }
@@ -2485,7 +2485,7 @@ void MetaClipRegionAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     VersionCompat aCompat(rOStm, StreamMode::WRITE, 1);
 
     WriteRegion( rOStm, maRegion );
-    rOStm.WriteUChar( mbClip );
+    rOStm.WriteBool( mbClip );
 }
 
 void MetaClipRegionAction::Read( SvStream& rIStm, ImplMetaReadData* )
@@ -2695,7 +2695,7 @@ void MetaLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     MetaAction::Write(rOStm, pData);
     VersionCompat aCompat(rOStm, StreamMode::WRITE, 1);
     maColor.Write( rOStm, true );
-    rOStm.WriteUChar( mbSet );
+    rOStm.WriteBool( mbSet );
 }
 
 void MetaLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
@@ -2745,7 +2745,7 @@ void MetaFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     MetaAction::Write(rOStm, pData);
     VersionCompat aCompat(rOStm, StreamMode::WRITE, 1);
     maColor.Write( rOStm, true );
-    rOStm.WriteUChar( mbSet );
+    rOStm.WriteBool( mbSet );
 }
 
 void MetaFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
@@ -2837,7 +2837,7 @@ void MetaTextFillColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     MetaAction::Write(rOStm, pData);
     VersionCompat aCompat(rOStm, StreamMode::WRITE, 1);
     maColor.Write( rOStm, true );
-    rOStm.WriteUChar( mbSet );
+    rOStm.WriteBool( mbSet );
 }
 
 void MetaTextFillColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
@@ -2887,7 +2887,7 @@ void MetaTextLineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     MetaAction::Write(rOStm, pData);
     VersionCompat aCompat(rOStm, StreamMode::WRITE, 1);
     maColor.Write( rOStm, true );
-    rOStm.WriteUChar( mbSet );
+    rOStm.WriteBool( mbSet );
 }
 
 void MetaTextLineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
@@ -2937,7 +2937,7 @@ void MetaOverlineColorAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     MetaAction::Write(rOStm, pData);
     VersionCompat aCompat(rOStm, StreamMode::WRITE, 1);
     maColor.Write( rOStm, true );
-    rOStm.WriteUChar( mbSet );
+    rOStm.WriteBool( mbSet );
 }
 
 void MetaOverlineColorAction::Read( SvStream& rIStm, ImplMetaReadData* )
@@ -3479,7 +3479,7 @@ void MetaRefPointAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
     VersionCompat aCompat(rOStm, StreamMode::WRITE, 1);
 
     WritePair( rOStm, maRefPoint );
-    rOStm.WriteUChar( mbSet );
+    rOStm.WriteBool( mbSet );
 }
 
 void MetaRefPointAction::Read( SvStream& rIStm, ImplMetaReadData* )
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index d6114ef..086739a 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -1682,7 +1682,7 @@ SvStream& WriteRegion( SvStream& rOStrm, const vcl::Region& rRegion )
 
     // write polypolygon if available
     const bool bHasPolyPolygon(rRegion.HasPolyPolygonOrB2DPolyPolygon());
-    rOStrm.WriteUChar( bHasPolyPolygon );
+    rOStrm.WriteBool( bHasPolyPolygon );
 
     if(bHasPolyPolygon)
     {
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index b4208f2..847a5a1 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -151,7 +151,7 @@ SvStream& WriteImplWallpaper( SvStream& rOStm, const ImplWallpaper& rImplWallpap
     rOStm.WriteUInt16( rImplWallpaper.meStyle );
 
     // version 2
-    rOStm.WriteUChar( bRect ).WriteUChar( bGrad ).WriteUChar( bBmp ).WriteUChar( bDummy ).WriteUChar( bDummy ).WriteUChar( bDummy );
+    rOStm.WriteBool( bRect ).WriteBool( bGrad ).WriteBool( bBmp ).WriteBool( bDummy ).WriteBool( bDummy ).WriteBool( bDummy );
 
     if( bRect )
         WriteRectangle( rOStm, *rImplWallpaper.mpRect );
commit c007829a67456ef01b82b8368f7ed3e5a3026c95
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 14:24:35 2015 +0200

    Clean up conversions from ScBreakType (aka sal_uInt8) to bool
    
    ...assuming these shall indeed all convert everything but BREAK_NONE to true?
    
    Change-Id: Ib1c863bfbf9be58aa7867aa69c8347f6358f6550

diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index c2b9637..7fa734f 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -8871,7 +8871,7 @@ void ScTableColumnObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
         else if ( pEntry->nWID == SC_WID_UNO_NEWPAGE )
         {
             ScBreakType nBreak = rDoc.HasColBreak(nCol, nTab);
-            ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak );
+            ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak != BREAK_NONE );
         }
         else if ( pEntry->nWID == SC_WID_UNO_MANPAGE )
         {
@@ -9024,12 +9024,12 @@ void ScTableRowObj::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pEntr
         else if ( pEntry->nWID == SC_WID_UNO_NEWPAGE )
         {
             ScBreakType nBreak = rDoc.HasRowBreak(nRow, nTab);
-            ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak );
+            ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak != BREAK_NONE );
         }
         else if ( pEntry->nWID == SC_WID_UNO_MANPAGE )
         {
             ScBreakType nBreak = (rDoc.HasRowBreak(nRow, nTab) & BREAK_MANUAL);
-            ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak );
+            ScUnoHelpFunctions::SetBoolInAny( rAny, nBreak != BREAK_NONE );
         }
         else
             ScCellRangeObj::GetOnePropertyValue(pEntry, rAny);
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 20ffa33..6bbc540 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -3543,7 +3543,7 @@ uno::Any SAL_CALL ScTableColumnsObj::getPropertyValue( const OUString& aProperty
     else if ( aNameString == SC_UNONAME_NEWPAGE )
     {
         ScBreakType nBreak = rDoc.HasColBreak(nStartCol, nTab);
-        ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak );
+        ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak != BREAK_NONE );
     }
     else if ( aNameString == SC_UNONAME_MANPAGE )
     {
@@ -3820,7 +3820,7 @@ uno::Any SAL_CALL ScTableRowsObj::getPropertyValue( const OUString& aPropertyNam
     else if ( aNameString == SC_UNONAME_NEWPAGE )
     {
         ScBreakType nBreak = rDoc.HasRowBreak(nStartRow, nTab);
-        ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak );
+        ScUnoHelpFunctions::SetBoolInAny( aAny, nBreak != BREAK_NONE );
     }
     else if ( aNameString == SC_UNONAME_MANPAGE )
     {
commit 0b49aaf09becf8775411b7082b95e87086e8b5d7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 11:46:38 2015 +0200

    loplugin:implicitboolconversion gold?
    
    The code was like that ever since 84a3db80b4fd66c6854b3135b5f69b61fd828e62
    "initial import" but looks very much like the intent was to make the conditional
    operator bind tighter than the less-than operator.
    
    Change-Id: I810aa5dc56f02e98111f4879db50c59a9b69b8d6

diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index c885aac..ee3b3c8 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -510,7 +510,7 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft )
                 bRet = GetDoc()->MoveParagraph( aCrsr, nOffset );
             }
         }
-        else if( bUpperLeft ? nUpperLevel : nLowerLevel+1 < MAXLEVEL )
+        else if( (bUpperLeft ? nUpperLevel : nLowerLevel+1) < MAXLEVEL )
         {
             aCrsr.Move( fnMoveBackward, fnGoNode );
             bRet = GetDoc()->NumUpDown( aCrsr, !bUpperLeft );
commit 1d6c30889d808ec50d0a5c6164481ebc09f6fce4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Apr 17 11:40:23 2015 +0200

    Use bool instead of sal_Bool
    
    Change-Id: I931d1931c231e9b8a489d718bd51b490bda071c2

diff --git a/dbaccess/source/ui/inc/tabletree.hxx b/dbaccess/source/ui/inc/tabletree.hxx
index 52afd27..f9390a9 100644
--- a/dbaccess/source/ui/inc/tabletree.hxx
+++ b/dbaccess/source/ui/inc/tabletree.hxx
@@ -50,7 +50,7 @@ public:
 
     void init(bool bVirtualRoot) { m_bVirtualRoot = bVirtualRoot; }
 
-    typedef ::std::pair< OUString,sal_Bool>  TTableViewName;
+    typedef ::std::pair< OUString, bool > TTableViewName;
     typedef ::std::vector< TTableViewName >         TNames;
 
     void    suppressEmptyFolders() { m_bNoEmptyFolders = true; }


More information about the Libreoffice-commits mailing list