diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-17 17:05:29 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-17 18:45:15 +0100 |
commit | 03725013b64e74473e1a9e925b24927e7e61d412 (patch) | |
tree | 3f7c276d44feda7071b296f0c73b4b7c111b5011 /svx | |
parent | 20223e2374bb6a966e44471c224d22d968d19025 (diff) |
bool improvements
Change-Id: Ic46fa46c200b94e2e6c5a073ba89b9aae5c14542
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/rulritem.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/float3d.cxx | 16 | ||||
-rw-r--r-- | svx/source/items/SmartTagItem.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/clipfmtitem.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/customshapeitem.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/galleryitem.cxx | 4 | ||||
-rw-r--r-- | svx/source/sdr/attribute/sdrformtextattribute.cxx | 4 | ||||
-rw-r--r-- | svx/source/sdr/attribute/sdrtextattribute.cxx | 18 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontact.cxx | 4 | ||||
-rw-r--r-- | svx/source/sdr/properties/customshapeproperties.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgm1.hxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdglev.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdibrow.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/viewcontactoftableobj.cxx | 10 |
17 files changed, 41 insertions, 45 deletions
diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx index 2abb3c5981c0..8e0f4d1b50df 100644 --- a/svx/source/dialog/rulritem.cxx +++ b/svx/source/dialog/rulritem.cxx @@ -712,7 +712,7 @@ SvxColumnDescription::SvxColumnDescription(long start, long end, long endMin, lo nEndMax (endMax) {} -int SvxColumnDescription::operator==(const SvxColumnDescription& rCmp) const +bool SvxColumnDescription::operator==(const SvxColumnDescription& rCmp) const { return nStart == rCmp.nStart && bVisible == rCmp.bVisible @@ -721,7 +721,7 @@ int SvxColumnDescription::operator==(const SvxColumnDescription& rCmp) const && nEndMax == rCmp.nEndMax; } -int SvxColumnDescription::operator!=(const SvxColumnDescription& rCmp) const +bool SvxColumnDescription::operator!=(const SvxColumnDescription& rCmp) const { return !operator==(rCmp); } diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 07a07b681ef1..b1c73cf86722 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -715,7 +715,7 @@ private: } -void SvxSearchDialog::Init_Impl( int bSearchPattern ) +void SvxSearchDialog::Init_Impl( bool bSearchPattern ) { DBG_ASSERT( pSearchItem, "SearchItem == 0" ); diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 486a1cf8809c..ac60b73cdb8d 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -1016,7 +1016,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_1); if( eState != SFX_ITEM_DONTCARE ) { - bool bOn = ((const Svx3DLightOnOff1Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue() != 0; + bool bOn = ((const Svx3DLightOnOff1Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue(); if( ( bOn && !GetUILightState( aBtnLight1 )) || ( !bOn && GetUILightState( aBtnLight1 )) ) { @@ -1065,7 +1065,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_2); if( eState != SFX_ITEM_DONTCARE ) { - bool bOn = ((const Svx3DLightOnOff2Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue() != 0; + bool bOn = ((const Svx3DLightOnOff2Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue(); if( ( bOn && !GetUILightState( aBtnLight2 )) || ( !bOn && GetUILightState( aBtnLight2 )) ) { @@ -1114,7 +1114,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_3); if( eState != SFX_ITEM_DONTCARE ) { - bool bOn = ((const Svx3DLightOnOff3Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue() != 0; + bool bOn = ((const Svx3DLightOnOff3Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue(); if( ( bOn && !GetUILightState( aBtnLight3)) || ( !bOn && GetUILightState( aBtnLight3)) ) { @@ -1163,7 +1163,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_4); if( eState != SFX_ITEM_DONTCARE ) { - bool bOn = ((const Svx3DLightOnOff4Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue() != 0; + bool bOn = ((const Svx3DLightOnOff4Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue(); if( ( bOn && !GetUILightState( aBtnLight4 )) || ( !bOn && GetUILightState( aBtnLight4 )) ) { @@ -1212,7 +1212,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_5); if( eState != SFX_ITEM_DONTCARE ) { - bool bOn = ((const Svx3DLightOnOff5Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue() != 0; + bool bOn = ((const Svx3DLightOnOff5Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue(); if( ( bOn && !GetUILightState( aBtnLight5 )) || ( !bOn && GetUILightState( aBtnLight5 )) ) { @@ -1261,7 +1261,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_6); if( eState != SFX_ITEM_DONTCARE ) { - bool bOn = ((const Svx3DLightOnOff6Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue() != 0; + bool bOn = ((const Svx3DLightOnOff6Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue(); if( ( bOn && !GetUILightState( aBtnLight6 )) || ( !bOn && GetUILightState( aBtnLight6 )) ) { @@ -1310,7 +1310,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_7); if( eState != SFX_ITEM_DONTCARE ) { - bool bOn = ((const Svx3DLightOnOff7Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue() != 0; + bool bOn = ((const Svx3DLightOnOff7Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue(); if( ( bOn && !GetUILightState( aBtnLight7 )) || ( !bOn && GetUILightState( aBtnLight7 )) ) { @@ -1359,7 +1359,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs ) eState = rAttrs.GetItemState(SDRATTR_3DSCENE_LIGHTON_8); if( eState != SFX_ITEM_DONTCARE ) { - bool bOn = ((const Svx3DLightOnOff8Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue() != 0; + bool bOn = ((const Svx3DLightOnOff8Item&)rAttrs.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue(); if( ( bOn && !GetUILightState( aBtnLight8 )) || ( !bOn && GetUILightState( aBtnLight8 )) ) { diff --git a/svx/source/items/SmartTagItem.cxx b/svx/source/items/SmartTagItem.cxx index 3fd891d7fad3..03dede7fa335 100644 --- a/svx/source/items/SmartTagItem.cxx +++ b/svx/source/items/SmartTagItem.cxx @@ -72,15 +72,13 @@ bool SvxSmartTagItem::operator==( const SfxPoolItem& rAttr ) const const SvxSmartTagItem& rItem = static_cast<const SvxSmartTagItem&>(rAttr); - int bRet = maActionComponentsSequence == rItem.maActionComponentsSequence && + return maActionComponentsSequence == rItem.maActionComponentsSequence && maActionIndicesSequence == rItem.maActionIndicesSequence && maStringKeyMaps == rItem.maStringKeyMaps && mxRange == rItem.mxRange && mxController == rItem.mxController && maApplicationName == rItem.maApplicationName && maRangeText == rItem.maRangeText; - - return bRet; } // ----------------------------------------------------------------------- diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx index 47537c0a4232..fe978749b5c2 100644 --- a/svx/source/items/clipfmtitem.cxx +++ b/svx/source/items/clipfmtitem.cxx @@ -102,7 +102,7 @@ bool SvxClipboardFmtItem::operator==( const SfxPoolItem& rComp ) const for( sal_uInt16 n = 0, nEnd = rCmp.pImpl->aFmtNms.size(); n < nEnd; ++n ) { if( pImpl->aFmtIds[ n ] != rCmp.pImpl->aFmtIds[ n ] || - ( pImpl->aFmtNms.is_null(n) ^ rCmp.pImpl->aFmtNms.is_null(n) ) || + ( pImpl->aFmtNms.is_null(n) != rCmp.pImpl->aFmtNms.is_null(n) ) || ( !pImpl->aFmtNms.is_null(n) && pImpl->aFmtNms[n] != rCmp.pImpl->aFmtNms[n] ) ) { nRet = 0; diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx index ab67dd275267..25bea99cf298 100644 --- a/svx/source/items/customshapeitem.cxx +++ b/svx/source/items/customshapeitem.cxx @@ -233,7 +233,7 @@ SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( SvStream& /*rIn*/, sal_u } bool SdrCustomShapeGeometryItem::operator==( const SfxPoolItem& rCmp ) const { - int bRet = SfxPoolItem::operator==( rCmp ); + bool bRet = SfxPoolItem::operator==( rCmp ); if ( bRet ) bRet = ((SdrCustomShapeGeometryItem&)rCmp).aPropSeq == aPropSeq; return bRet; diff --git a/svx/source/items/galleryitem.cxx b/svx/source/items/galleryitem.cxx index b626e1a9eaf1..3b94645e4a4f 100644 --- a/svx/source/items/galleryitem.cxx +++ b/svx/source/items/galleryitem.cxx @@ -132,12 +132,10 @@ bool SvxGalleryItem::operator==( const SfxPoolItem& rAttr ) const const SvxGalleryItem& rItem = static_cast<const SvxGalleryItem&>(rAttr); - int bRet = m_nType == rItem.m_nType && + return m_nType == rItem.m_nType && m_aURL == rItem.m_aURL && m_xDrawing == rItem.m_xDrawing && m_xGraphic == rItem.m_xGraphic; - - return bRet; } SfxPoolItem* SvxGalleryItem::Clone( SfxItemPool * ) const diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx index 4f0a145fc1a9..b0ee633c9938 100644 --- a/svx/source/sdr/attribute/sdrformtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx @@ -169,8 +169,8 @@ namespace drawinglayer SdrFormTextOutlineAttribute maShadowOutline; // bitfield - unsigned mbFormTextMirror : 1; // change orientation - unsigned mbFormTextOutline : 1; // show contour of objects + bool mbFormTextMirror : 1; // change orientation + bool mbFormTextOutline : 1; // show contour of objects explicit ImpSdrFormTextAttribute(const SfxItemSet& rSet) : mnRefCount(0), diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index df0214a20073..ee5e1a2b027c 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -60,15 +60,15 @@ namespace drawinglayer SdrTextVertAdjust maSdrTextVertAdjust; // bitfield - unsigned mbContour : 1; - unsigned mbFitToSize : 1; - unsigned mbAutoFit : 1; - unsigned mbHideContour : 1; - unsigned mbBlink : 1; - unsigned mbScroll : 1; - unsigned mbInEditMode : 1; - unsigned mbFixedCellHeight : 1; - unsigned mbWrongSpell : 1; + bool mbContour : 1; + bool mbFitToSize : 1; + bool mbAutoFit : 1; + bool mbHideContour : 1; + bool mbBlink : 1; + bool mbScroll : 1; + bool mbInEditMode : 1; + bool mbFixedCellHeight : 1; + bool mbWrongSpell : 1; public: ImpSdrTextAttribute( diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 5cc4e2daa5da..d0705428eeb5 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -58,10 +58,10 @@ namespace // bitfield // text animation allowed? - unsigned mbTextAnimationAllowed : 1; + bool mbTextAnimationAllowed : 1; // graphic animation allowed? - unsigned mbGraphicAnimationAllowed : 1; + bool mbGraphicAnimationAllowed : 1; // as tooling, the process() implementation takes over API handling and calls this // virtual render method when the primitive implementation is BasePrimitive2D-based. diff --git a/svx/source/sdr/properties/customshapeproperties.cxx b/svx/source/sdr/properties/customshapeproperties.cxx index cf94df262e4c..6309e5bcf909 100644 --- a/svx/source/sdr/properties/customshapeproperties.cxx +++ b/svx/source/sdr/properties/customshapeproperties.cxx @@ -37,7 +37,7 @@ namespace sdr SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); SdrTextAutoGrowHeightItem& rAutoGrowHeightItem = (SdrTextAutoGrowHeightItem&)rObj.GetMergedItem( SDRATTR_TEXT_AUTOGROWHEIGHT ); - rObj.bTextFrame = rAutoGrowHeightItem.GetValue() != 0; + rObj.bTextFrame = rAutoGrowHeightItem.GetValue(); if ( rObj.bTextFrame ) rObj.NbcAdjustTextFrameWidthAndHeight(); @@ -117,7 +117,7 @@ namespace sdr if( SFX_ITEM_SET == rSet.GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) ) { - rObj.bTextFrame = ((SdrTextAutoGrowHeightItem&)rSet.Get( SDRATTR_TEXT_AUTOGROWHEIGHT )).GetValue() != 0; + rObj.bTextFrame = ((SdrTextAutoGrowHeightItem&)rSet.Get( SDRATTR_TEXT_AUTOGROWHEIGHT )).GetValue(); } // call parent @@ -133,7 +133,7 @@ namespace sdr if( pNewItem && ( SDRATTR_TEXT_AUTOGROWHEIGHT == nWhich ) ) { - rObj.bTextFrame = ((SdrTextAutoGrowHeightItem*)pNewItem)->GetValue() != 0; + rObj.bTextFrame = ((SdrTextAutoGrowHeightItem*)pNewItem)->GetValue(); } // call parent TextProperties::ItemChange( nWhich, pNewItem ); diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 45984d1f8110..2c5c2bc9607f 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -1475,7 +1475,7 @@ SdrCustomShapeAdjustmentItem::~SdrCustomShapeAdjustmentItem() bool SdrCustomShapeAdjustmentItem::operator==( const SfxPoolItem& rCmp ) const { - int bRet = SfxPoolItem::operator==( rCmp ); + bool bRet = SfxPoolItem::operator==( rCmp ); if ( bRet ) { bRet = GetCount() == ((SdrCustomShapeAdjustmentItem&)rCmp).GetCount(); diff --git a/svx/source/svdraw/svddrgm1.hxx b/svx/source/svdraw/svddrgm1.hxx index 2cb51d99e8e4..e4a2b334c2d9 100644 --- a/svx/source/svdraw/svddrgm1.hxx +++ b/svx/source/svdraw/svddrgm1.hxx @@ -143,7 +143,7 @@ private: SdrHdlGradient* pIAOHandle; // is this for gradient (or for transparency)? - unsigned bIsGradient : 1; + bool bIsGradient : 1; public: TYPEINFO(); diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index 0260e6954c26..bc72272a4755 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -136,7 +136,7 @@ static void ImpGetPercent(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const vo sal_Bool& bFirst=*(sal_Bool*)pbFirst; if (nRet!=FUZZY) { bool bOn=rGP.IsPercent(); - if (bFirst) { nRet=bOn; bFirst=sal_False; } + if (bFirst) { nRet=sal_uInt16(bOn); bFirst=sal_False; } else if ((nRet!=0)!=bOn) nRet=FUZZY; } } diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 393186ec9bbe..ce24f747514f 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -998,7 +998,7 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem case ITEM_INT32 : aEntry.bIsNum = true; aEntry.nVal=((SfxInt32Item &)rItem).GetValue(); break; case ITEM_UINT32 : aEntry.bIsNum = true; aEntry.nVal=((SfxUInt32Item&)rItem).GetValue(); aEntry.nMin=0; /*aEntry.nMax=0xFF...*/;break; case ITEM_ENUM : aEntry.bCanNum = true; aEntry.nVal=((SfxEnumItemInterface&)rItem).GetEnumValue(); aEntry.nMin=0; aEntry.nMax=((SfxEnumItemInterface&)rItem).GetValueCount()-1; break; - case ITEM_BOOL : aEntry.bCanNum = true; aEntry.nVal=((SfxBoolItem &)rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=1; break; + case ITEM_BOOL : aEntry.bCanNum = true; aEntry.nVal=sal_Int32(((SfxBoolItem &)rItem).GetValue()); aEntry.nMin=0; aEntry.nMax=1; break; case ITEM_FLAG : aEntry.bCanNum = true; aEntry.nVal=((SfxFlagItem &)rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=0xFFFF; break; case ITEM_FONTHEIGHT: aEntry.bCanNum = true; aEntry.nVal=((SvxFontHeightItem&)rItem).GetHeight(); aEntry.nMin=0; break; case ITEM_FONTWIDTH : aEntry.bCanNum = true; aEntry.nVal=((SvxCharScaleWidthItem&)rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=0xFFFF;break; diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 09c21e2a67d6..ed93d905a5f9 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -1078,7 +1078,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any& aBoxInfo.SetLine(bSet ? &aLine : 0, BOXINFO_LINE_VERT); aBoxInfo.SetValid(VALID_VERT, pBorder->IsVerticalLineValid); - aBox.SetDistance(pBorder->Distance, false); + aBox.SetDistance(pBorder->Distance); //TODO aBoxInfo.SetValid(VALID_DISTANCE, pBorder->IsDistanceValid); mpProperties->SetObjectItem(aBox); diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 683ec24f5165..a5325eb6b4b4 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -171,11 +171,11 @@ namespace drawinglayer SvxBorderLine maBottomFromRLine; // bitfield - unsigned mbLeftIsOutside : 1; - unsigned mbBottomIsOutside : 1; - unsigned mbRightIsOutside : 1; - unsigned mbTopIsOutside : 1; - unsigned mbInTwips : 1; + bool mbLeftIsOutside : 1; + bool mbBottomIsOutside : 1; + bool mbRightIsOutside : 1; + bool mbTopIsOutside : 1; + bool mbInTwips : 1; protected: // local decomposition. |