[Libreoffice-commits] core.git: 6 commits - sc/source writerfilter/source

Stephan Bergmann sbergman at redhat.com
Fri Jan 17 02:58:19 PST 2014


 sc/source/core/opencl/openclwrapper.cxx           |   66 ++++++++++------------
 sc/source/core/opencl/openclwrapper.hxx           |   22 +++----
 sc/source/filter/excel/xecontent.cxx              |   16 ++---
 sc/source/filter/excel/xeescher.cxx               |    2 
 sc/source/filter/excel/xltoolbar.hxx              |    9 +--
 sc/source/filter/inc/scflt.hxx                    |   10 +--
 sc/source/filter/oox/unitconverter.cxx            |    2 
 sc/source/filter/starcalc/scflt.cxx               |    8 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |    2 
 writerfilter/source/dmapper/PropertyMap.cxx       |    2 
 writerfilter/source/dmapper/PropertyMap.hxx       |    2 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx    |   10 +--
 12 files changed, 73 insertions(+), 78 deletions(-)

New commits:
commit dbf05f8eece93127407c28e1a3f7dda8ad29e564
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 17 11:54:47 2014 +0100

    bool improvements
    
    Change-Id: Id890cfe8767b1ee760bb2049191a5cfc356f1af8

diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index da9a279..2c92bfe 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -900,13 +900,13 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
 {
     bool bFmla2 = false;
     ScConditionMode eOperation = mrFormatEntry.GetOperation();
-    sal_Int32 nAboveAverage = eOperation == SC_COND_ABOVE_AVERAGE ||
+    bool nAboveAverage = eOperation == SC_COND_ABOVE_AVERAGE ||
                                 eOperation == SC_COND_ABOVE_EQUAL_AVERAGE;
-    sal_Int32 nEqualAverage = eOperation == SC_COND_ABOVE_EQUAL_AVERAGE ||
+    bool nEqualAverage = eOperation == SC_COND_ABOVE_EQUAL_AVERAGE ||
                                 eOperation == SC_COND_BELOW_EQUAL_AVERAGE;
-    sal_Int32 nBottom = eOperation == SC_COND_BOTTOM10
+    bool nBottom = eOperation == SC_COND_BOTTOM10
         || eOperation == SC_COND_BOTTOM_PERCENT;
-    sal_Int32 nPercent = eOperation == SC_COND_TOP_PERCENT ||
+    bool nPercent = eOperation == SC_COND_TOP_PERCENT ||
         eOperation == SC_COND_BOTTOM_PERCENT;
     OString aRank("0");
     if(IsTopBottomRule(eOperation))
@@ -931,10 +931,10 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
             XML_type, GetTypeString( mrFormatEntry.GetOperation() ),
             XML_priority, OString::number( mnPriority + 1 ).getStr(),
             XML_operator, GetOperatorString( mrFormatEntry.GetOperation(), bFmla2 ),
-            XML_aboveAverage, OString::number( nAboveAverage ).getStr(),
-            XML_equalAverage, OString::number( nEqualAverage ).getStr(),
-            XML_bottom, OString::number( nBottom ).getStr(),
-            XML_percent, OString::number( nPercent ).getStr(),
+            XML_aboveAverage, OString::number( int(nAboveAverage) ).getStr(),
+            XML_equalAverage, OString::number( int(nEqualAverage) ).getStr(),
+            XML_bottom, OString::number( int(nBottom) ).getStr(),
+            XML_percent, OString::number( int(nPercent) ).getStr(),
             XML_rank, aRank.getStr(),
             XML_text, aText.getStr(),
             XML_dxfId, OString::number( GetDxfs().GetDxfId( mrFormatEntry.GetStyle() ) ).getStr(),
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 7d48615..f58bd9c 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1247,7 +1247,7 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos,
                     meTVA       = pCaption->GetTextVerticalAdjust();
                     meTHA       = pCaption->GetTextHorizontalAdjust();
                     mbAutoScale = pCaption->GetFitToSize()?true:false;
-                    mbLocked    = pCaption->IsMoveProtect() | pCaption->IsResizeProtect();
+                    mbLocked    = pCaption->IsMoveProtect() || pCaption->IsResizeProtect();
 
                     // AutoFill style would change if Postit.cxx object creation values are changed
                     OUString aCol(((XFillColorItem &)GETITEM(aItemSet, XFillColorItem , XATTR_FILLCOLOR)).GetValue());
diff --git a/sc/source/filter/excel/xltoolbar.hxx b/sc/source/filter/excel/xltoolbar.hxx
index ebb4f8e..9161f19 100644
--- a/sc/source/filter/excel/xltoolbar.hxx
+++ b/sc/source/filter/excel/xltoolbar.hxx
@@ -17,12 +17,13 @@ class ScCTBWrapper;
 class TBCCmd : public TBBase
 {
 public:
-    TBCCmd() : cmdID(0), A(0), B(0), cmdType(0), C(0), reserved3(0) {}
+    TBCCmd() : cmdID(0), A(false), B(false), cmdType(0), C(false), reserved3(0)
+    {}
     sal_uInt16 cmdID;
-    sal_uInt16 A:1;
-    sal_uInt16 B:1;
+    bool A:1;
+    bool B:1;
     sal_uInt16 cmdType:5;
-    sal_uInt16 C:1;
+    bool C:1;
     sal_uInt16 reserved3:8;
     bool Read( SvStream& rS );
     void Print(FILE* fp);
diff --git a/sc/source/filter/inc/scflt.hxx b/sc/source/filter/inc/scflt.hxx
index 4f15782..0c75fbd 100644
--- a/sc/source/filter/inc/scflt.hxx
+++ b/sc/source/filter/inc/scflt.hxx
@@ -212,7 +212,7 @@ struct Sc10LogFont
     sal_uInt8       lfPitchAndFamily;
     sal_Char    lfFaceName[32];
 
-    int operator==( const Sc10LogFont& rData ) const;
+    bool operator==( const Sc10LogFont& rData ) const;
 };
 
 // RGB-Frabwerte
@@ -222,7 +222,7 @@ struct Sc10Color
     sal_uInt8       Blue;
     sal_uInt8       Green;
     sal_uInt8       Red;
-    int operator==( const Sc10Color& rColor ) const;
+    bool operator==( const Sc10Color& rColor ) const;
 };
 
 // Blockbeschreibung
@@ -282,7 +282,7 @@ struct Sc10HeadFootLine
     sal_uInt16          FrameColor; // Nibble Codierte Farben link oben rechts unten
     sal_uInt16          Reserved;
 
-    int operator==( const Sc10HeadFootLine& rData ) const;
+    bool operator==( const Sc10HeadFootLine& rData ) const;
 };
 
 // Seitenformat
@@ -317,7 +317,7 @@ struct Sc10PageFormat
     sal_Int16               ColRepeatEnd;
     sal_Char            Reserved[26];
 
-    int operator==( const Sc10PageFormat& rData ) const;
+    bool operator==( const Sc10PageFormat& rData ) const;
 };
 
 // Tabellenschutz
@@ -677,7 +677,7 @@ class Sc10PageData : public ScDataObject
 public:
     Sc10PageFormat      aPageFormat;
                         Sc10PageData( const Sc10PageFormat& rFormat ) : aPageFormat(rFormat) {}
-    int                 operator==( const Sc10PageData& rData ) const
+    bool                operator==( const Sc10PageData& rData ) const
                             { return aPageFormat == rData.aPageFormat; }
     virtual ScDataObject*   Clone() const;
 };
diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx
index 55ba77f..7754587 100644
--- a/sc/source/filter/oox/unitconverter.cxx
+++ b/sc/source/filter/oox/unitconverter.cxx
@@ -53,7 +53,7 @@ const double MM100_PER_EMU          = 1.0 / 360.0;
 // ----------------------------------------------------------------------------
 
 /** Returns true, if the passed year is a leap year. */
-inline sal_Int32 lclIsLeapYear( sal_Int32 nYear )
+inline bool lclIsLeapYear( sal_Int32 nYear )
 {
     return ((nYear % 4) == 0) && (((nYear % 100) != 0) || ((nYear % 400) == 0));
 }
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index 07261fb..93a1d4d 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -592,7 +592,7 @@ Sc10DataBaseCollection::Sc10DataBaseCollection(SvStream& rStream) :
 }
 
 
-int Sc10LogFont::operator==( const Sc10LogFont& rData ) const
+bool Sc10LogFont::operator==( const Sc10LogFont& rData ) const
 {
     return !strcmp( lfFaceName, rData.lfFaceName )
         && lfHeight == rData.lfHeight
@@ -611,13 +611,13 @@ int Sc10LogFont::operator==( const Sc10LogFont& rData ) const
 }
 
 
-int Sc10Color::operator==( const Sc10Color& rColor ) const
+bool Sc10Color::operator==( const Sc10Color& rColor ) const
 {
     return ((Red == rColor.Red) && (Green == rColor.Green) && (Blue == rColor.Blue));
 }
 
 
-int Sc10HeadFootLine::operator==( const Sc10HeadFootLine& rData ) const
+bool Sc10HeadFootLine::operator==( const Sc10HeadFootLine& rData ) const
 {
     return !strcmp(Title, rData.Title)
         && LogFont == rData.LogFont
@@ -633,7 +633,7 @@ int Sc10HeadFootLine::operator==( const Sc10HeadFootLine& rData ) const
 }
 
 
-int Sc10PageFormat::operator==( const Sc10PageFormat& rData ) const
+bool Sc10PageFormat::operator==( const Sc10PageFormat& rData ) const
 {
     return !strcmp(PrintAreaName, rData.PrintAreaName)
         && HeadLine == rData.HeadLine
commit 6ba099a065b95dbf795a611382e18f3d93294db9
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 17 11:49:58 2014 +0100

    Fix function return types
    
    Change-Id: I8110296dfdddb974540afd21171fa5d7d37f8d15

diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index 790846c..f7693d8 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -119,28 +119,22 @@ void clearCache()
 
 OString OpenclDevice::maCacheFolder = getCacheFolder();
 
-int OpenclDevice::releaseOpenclRunEnv()
+void OpenclDevice::releaseOpenclRunEnv()
 {
     releaseOpenclEnv( &gpuEnv );
-
-    return 1;
 }
 
-int OpenclDevice::registOpenclKernel()
+void OpenclDevice::registOpenclKernel()
 {
     if ( !gpuEnv.mnIsUserCreated )
         memset( &gpuEnv, 0, sizeof(gpuEnv) );
-
-    return 0;
 }
 
-int OpenclDevice::setKernelEnv( KernelEnv *envInfo )
+void OpenclDevice::setKernelEnv( KernelEnv *envInfo )
 {
     envInfo->mpkContext = gpuEnv.mpContext;
     envInfo->mpkCmdQueue = gpuEnv.mpCmdQueue;
     envInfo->mpkProgram = gpuEnv.mpArryPrograms[0];
-
-    return 1;
 }
 
 namespace {
@@ -222,7 +216,7 @@ std::vector<boost::shared_ptr<osl::File> > OpenclDevice::binaryGenerated( const
     return aGeneratedFiles;
 }
 
-int OpenclDevice::writeBinaryToFile( const OString& rFileName, const char* binary, size_t numBytes )
+bool OpenclDevice::writeBinaryToFile( const OString& rFileName, const char* binary, size_t numBytes )
 {
     clearCache();
     osl::File file(rtl::OStringToOUString(rFileName, RTL_TEXTENCODING_UTF8));
@@ -230,17 +224,17 @@ int OpenclDevice::writeBinaryToFile( const OString& rFileName, const char* binar
             osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
 
     if(status != osl::FileBase::E_None)
-        return 0;
+        return false;
 
     sal_uInt64 nBytesWritten = 0;
     file.write( binary, numBytes, nBytesWritten );
 
     assert(numBytes == nBytesWritten);
 
-    return 1;
+    return true;
 }
 
-int OpenclDevice::generatBinFromKernelSource( cl_program program, const char * clFileName )
+bool OpenclDevice::generatBinFromKernelSource( cl_program program, const char * clFileName )
 {
     cl_uint numDevices;
 
@@ -301,13 +295,13 @@ int OpenclDevice::generatBinFromKernelSource( cl_program program, const char * c
         delete[] binaries[i];
     }
 
-    return 1;
+    return true;
 }
 
-int OpenclDevice::initOpenclAttr( OpenCLEnv * env )
+bool OpenclDevice::initOpenclAttr( OpenCLEnv * env )
 {
     if ( gpuEnv.mnIsUserCreated )
-        return 1;
+        return true;
 
     gpuEnv.mpContext = env->mpOclContext;
     gpuEnv.mpPlatformID = env->mpOclPlatformID;
@@ -316,14 +310,14 @@ int OpenclDevice::initOpenclAttr( OpenCLEnv * env )
 
     gpuEnv.mnIsUserCreated = 1;
 
-    return 0;
+    return false;
 }
 
-int OpenclDevice::releaseOpenclEnv( GPUEnv *gpuInfo )
+void OpenclDevice::releaseOpenclEnv( GPUEnv *gpuInfo )
 {
     if ( !isInited )
     {
-        return 1;
+        return;
     }
 
     if ( gpuEnv.mpCmdQueue )
@@ -340,7 +334,7 @@ int OpenclDevice::releaseOpenclEnv( GPUEnv *gpuInfo )
     gpuInfo->mnIsUserCreated = 0;
     free( gpuInfo->mpArryDevsID );
 
-    return 1;
+    return;
 }
 
 namespace {
@@ -481,14 +475,14 @@ bool OpenclDevice::buildProgramFromBinary(const char* buildOption, GPUEnv* gpuIn
     return buildProgram(buildOption, gpuInfo, idx);
 }
 
-int OpenclDevice::initOpenclRunEnv( int argc )
+bool OpenclDevice::initOpenclRunEnv( int argc )
 {
     if ( MAX_CLKERNEL_NUM <= 0 )
     {
-        return 1;
+        return true;
     }
     if ( ( argc > MAX_CLFILE_NUM ) || ( argc < 0 ) )
-        return 1;
+        return true;
 
     if ( !isInited )
     {
@@ -497,7 +491,7 @@ int OpenclDevice::initOpenclRunEnv( int argc )
         bool status = initOpenclRunEnv( &gpuEnv );
         if ( status )
         {
-            return 1;
+            return true;
         }
         //initialize program, kernelName, kernelCount
         if( getenv( "SC_FLOAT" ) )
@@ -519,7 +513,7 @@ int OpenclDevice::initOpenclRunEnv( int argc )
         }
         isInited = 1;
     }
-    return 0;
+    return false;
 }
 
 namespace {
@@ -558,7 +552,7 @@ void checkDeviceForDoubleSupport(cl_device_id deviceId, bool& bKhrFp64, bool& bA
 
 }
 
-int OpenclDevice::initOpenclRunEnv( GPUEnv *gpuInfo )
+bool OpenclDevice::initOpenclRunEnv( GPUEnv *gpuInfo )
 {
     size_t length;
     cl_int clStatus;
@@ -579,7 +573,7 @@ int OpenclDevice::initOpenclRunEnv( GPUEnv *gpuInfo )
             platforms = (cl_platform_id*) malloc( numPlatforms * sizeof( cl_platform_id ) );
             if (!platforms)
             {
-                return 1;
+                return true;
             }
             clStatus = clGetPlatformIDs( numPlatforms, platforms, NULL );
             CHECK_OPENCL(clStatus, "clGetPlatformIDs");
@@ -624,10 +618,10 @@ int OpenclDevice::initOpenclRunEnv( GPUEnv *gpuInfo )
             }
             free( platforms );
             if ( clStatus != CL_SUCCESS )
-                return 1;
+                return true;
         }
         if ( NULL == gpuInfo->mpPlatformID )
-            return 1;
+            return true;
 
         // Use available platform.
         cl_context_properties cps[3];
@@ -656,16 +650,16 @@ int OpenclDevice::initOpenclRunEnv( GPUEnv *gpuInfo )
             gpuInfo->mpContext = clCreateContextFromType( cps, gpuInfo->mDevType, NULL, NULL, &clStatus );
         }
         if ( ( gpuInfo->mpContext == (cl_context) NULL) || ( clStatus != CL_SUCCESS ) )
-            return 1;
+            return true;
         // Detect OpenCL devices.
         // First, get the size of device list data
         clStatus = clGetContextInfo( gpuInfo->mpContext, CL_CONTEXT_DEVICES, 0, NULL, &length );
         if ( ( clStatus != CL_SUCCESS ) || ( length == 0 ) )
-            return 1;
+            return true;
         // Now allocate memory for device list based on the size we got earlier
         gpuInfo->mpArryDevsID = (cl_device_id*) malloc( length );
         if ( gpuInfo->mpArryDevsID == (cl_device_id*) NULL )
-            return 1;
+            return true;
         // Now, get the device list data
         clStatus = clGetContextInfo( gpuInfo->mpContext, CL_CONTEXT_DEVICES, length,
                        gpuInfo->mpArryDevsID, NULL );
@@ -684,7 +678,7 @@ int OpenclDevice::initOpenclRunEnv( GPUEnv *gpuInfo )
     gpuInfo->mnKhrFp64Flag = bKhrFp64;
     gpuInfo->mnAmdFp64Flag = bAmdFp64;
 
-    return 0;
+    return false;
 }
 
 void OpenclDevice::setOpenclState( int state )
diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index 56fc845..0193c48 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -154,18 +154,18 @@ public:
     static int isInited;
     static OString maCacheFolder;
 
-    static int registOpenclKernel();
-    static int releaseOpenclRunEnv();
-    static int initOpenclRunEnv( GPUEnv *gpu );
-    static int releaseOpenclEnv( GPUEnv *gpuInfo );
-    static int initOpenclRunEnv( int argc );
-    static int generatBinFromKernelSource( cl_program program, const char * clFileName );
-    static int writeBinaryToFile( const OString& rName, const char* birary, size_t numBytes );
+    static void registOpenclKernel();
+    static void releaseOpenclRunEnv();
+    static bool initOpenclRunEnv( GPUEnv *gpu );
+    static void releaseOpenclEnv( GPUEnv *gpuInfo );
+    static bool initOpenclRunEnv( int argc );
+    static bool generatBinFromKernelSource( cl_program program, const char * clFileName );
+    static bool writeBinaryToFile( const OString& rName, const char* birary, size_t numBytes );
     static std::vector<boost::shared_ptr<osl::File> > binaryGenerated( const char * clFileName, cl_context context);
     static bool buildProgramFromBinary(const char* buildOption, GPUEnv* gpuEnv, const char* filename, int idx);
 
-    static int initOpenclAttr( OpenCLEnv * env );
-    static int setKernelEnv( KernelEnv *envInfo );
+    static bool initOpenclAttr( OpenCLEnv * env );
+    static void setKernelEnv( KernelEnv *envInfo );
 
     static int getOpenclState();
     static void setOpenclState( int state );
commit 43d4fc82ed161aa9d4f690730b97f6fef126848f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 17 11:49:26 2014 +0100

    bool improvements
    
    Change-Id: Id95748748000eb59e2f9343bca4f7e1c5f15514a

diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx
index ce6191f..790846c 100644
--- a/sc/source/core/opencl/openclwrapper.cxx
+++ b/sc/source/core/opencl/openclwrapper.cxx
@@ -494,7 +494,7 @@ int OpenclDevice::initOpenclRunEnv( int argc )
     {
         registOpenclKernel();
         //initialize devices, context, command_queue
-        int status = initOpenclRunEnv( &gpuEnv );
+        bool status = initOpenclRunEnv( &gpuEnv );
         if ( status )
         {
             return 1;
@@ -502,8 +502,8 @@ int OpenclDevice::initOpenclRunEnv( int argc )
         //initialize program, kernelName, kernelCount
         if( getenv( "SC_FLOAT" ) )
         {
-            gpuEnv.mnKhrFp64Flag = 0;
-            gpuEnv.mnAmdFp64Flag = 0;
+            gpuEnv.mnKhrFp64Flag = false;
+            gpuEnv.mnAmdFp64Flag = false;
         }
         if( gpuEnv.mnKhrFp64Flag )
         {
diff --git a/sc/source/core/opencl/openclwrapper.hxx b/sc/source/core/opencl/openclwrapper.hxx
index e72600c..56fc845 100644
--- a/sc/source/core/opencl/openclwrapper.hxx
+++ b/sc/source/core/opencl/openclwrapper.hxx
@@ -121,8 +121,8 @@ struct GPUEnv
     cl_command_queue mpCmdQueue;
     cl_program mpArryPrograms[MAX_CLFILE_NUM]; //one program object maps one kernel source file
     int mnIsUserCreated; // 1: created , 0:no create and needed to create by opencl wrapper
-    int mnKhrFp64Flag;
-    int mnAmdFp64Flag;
+    bool mnKhrFp64Flag;
+    bool mnAmdFp64Flag;
 };
 
 struct SingleVectorFormula
commit 68ff48e96db33ad03268ca57b1a31e68a514261a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 17 11:41:17 2014 +0100

    Make bRestartAtEachPage a proper bool
    
    ...the "silent change" of creating a proper bool Any from it in
    DomainMapper::sprmWithProps (writerfilter/source/dmapper/DomainMapper.cxx) now
    is probably OK, given that css.text.LineNumberingProperties specifies
    RestartAtEachPage as a boolean property.
    
    Change-Id: I4f98630eed8327e97feac1aa99f0abfa9fc32043

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index d50ffd3..9a3de2b 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -273,7 +273,7 @@ struct LineNumberSettings
     bool        bIsOn;
     sal_Int32   nDistance;
     sal_Int32   nInterval;
-    sal_Int32   bRestartAtEachPage;
+    bool        bRestartAtEachPage;
     sal_Int32   nStartValue;
     LineNumberSettings() :
         bIsOn(false)
commit 91b285c13c306afc1b8478fe386e40c964d88014
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 17 11:40:35 2014 +0100

    bool improvements
    
    Change-Id: I664cf2cd71fc795d8592752c2b486f8b62709da7

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index efbede5..629e154 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1332,7 +1332,7 @@ ParagraphProperties::~ParagraphProperties()
 }
 
 
-int ParagraphProperties::operator==(const ParagraphProperties& rCompare)
+bool ParagraphProperties::operator==(const ParagraphProperties& rCompare)
 {
     return
         m_bFrameMode == rCompare.m_bFrameMode &&
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index 968d7f1..a9279f2 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -322,7 +322,7 @@ public:
     ParagraphProperties(const ParagraphProperties&);
     ~ParagraphProperties();
 
-    int operator==(const ParagraphProperties&); //does not compare the starting/ending range, m_sParaStyleName and m_nDropCapLength
+    bool operator==(const ParagraphProperties&); //does not compare the starting/ending range, m_sParaStyleName and m_nDropCapLength
 
     void    SetFrameMode( bool set = true ) { m_bFrameMode = set; }
     bool    IsFrameMode()const { return m_bFrameMode; }
commit 912a78c2c8c493af2997a657d41a6897a70a7ea4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 17 11:39:50 2014 +0100

    Be explicit when using bool as integral value
    
    Change-Id: Ia5b787a4c02792eb47b7a8eea7af6234f8a2c6b2

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 9b4f852..d04698f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2340,7 +2340,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
         case RTF_WIDCTLPAR:
         case RTF_NOWIDCTLPAR:
             {
-                RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_WIDCTLPAR));
+                RTFValue::Pointer_t pValue(new RTFValue(int(nKeyword == RTF_WIDCTLPAR)));
                 m_aStates.top().aParagraphSprms.set(NS_sprm::LN_PFWidowControl, pValue);
             }
             break;
@@ -2505,7 +2505,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
             }
         case RTF_SECTUNLOCKED:
             {
-                RTFValue::Pointer_t pValue(new RTFValue(!nParam));
+                RTFValue::Pointer_t pValue(new RTFValue(int(!nParam)));
                 m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_formProt, pValue);
             }
         case RTF_PGNDEC:
@@ -3081,7 +3081,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
             break;
         case RTF_HORZVERT:
             {
-                RTFValue::Pointer_t pValue(new RTFValue(true));
+                RTFValue::Pointer_t pValue(new RTFValue(int(true)));
                 m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_EastAsianLayout_vert, pValue);
                 if (nParam)
                     // rotate fits to a single line
@@ -3096,7 +3096,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
             break;
         case RTF_TWOINONE:
             {
-                RTFValue::Pointer_t pValue(new RTFValue(true));
+                RTFValue::Pointer_t pValue(new RTFValue(int(true)));
                 m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_EastAsianLayout_combine, pValue);
                 if (nParam > 0)
                     m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_EastAsianLayout_combineBrackets, pIntValue);
@@ -3695,7 +3695,7 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
     setNeedSect();
     RTFSkipDestination aSkip(*this);
     int nSprm = -1;
-    RTFValue::Pointer_t pBoolValue(new RTFValue(!bParam || nParam != 0));
+    RTFValue::Pointer_t pBoolValue(new RTFValue(int(!bParam || nParam != 0)));
 
     // Map all underline toggles to a single sprm.
     switch (nKeyword)


More information about the Libreoffice-commits mailing list