diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-17 11:54:47 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-17 11:57:52 +0100 |
commit | dbf05f8eece93127407c28e1a3f7dda8ad29e564 (patch) | |
tree | a71d94c212b53c2037413c315704ff43cd189a0a | |
parent | 6ba099a065b95dbf795a611382e18f3d93294db9 (diff) |
bool improvements
Change-Id: Id890cfe8767b1ee760bb2049191a5cfc356f1af8
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 16 | ||||
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xltoolbar.hxx | 9 | ||||
-rw-r--r-- | sc/source/filter/inc/scflt.hxx | 10 | ||||
-rw-r--r-- | sc/source/filter/oox/unitconverter.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/starcalc/scflt.cxx | 8 |
6 files changed, 24 insertions, 23 deletions
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index da9a27996cc8..2c92bfe87a95 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 7d48615272b6..f58bd9cbdd96 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 ebb4f8e88e43..9161f19b3cf7 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 4f157823b534..0c75fbdb47f2 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 55ba77fe15e3..775458758d27 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 07261fb070dc..93a1d4d158d9 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 |