summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-24 12:26:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-24 12:36:21 +0200
commit77fd72237c6d326e1a9c6ae1fa438459ca276519 (patch)
treeb3698cddc6ec5113b24a94e5bcec1bca7749017c
parent537921fd65a4e736269eb52986469c05268aae07 (diff)
loplugin:simplifybool
Change-Id: Idf2ae6b0b2c3d111125ad91ea7d13eec67325f36
-rw-r--r--filter/source/msfilter/escherex.cxx4
-rw-r--r--filter/source/msfilter/msdffimp.cxx8
-rw-r--r--filter/source/msfilter/svdfppt.cxx2
-rw-r--r--filter/source/pdf/impdialog.cxx2
-rw-r--r--filter/source/svg/svgexport.cxx6
-rw-r--r--include/filter/msfilter/svdfppt.hxx2
6 files changed, 12 insertions, 12 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index fdf5806daf01..c7444bfceb1e 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -967,14 +967,14 @@ void EscherPropertyContainer::CreateLineProperties(
bSwapLineEnds = true;
}
}
- if ( GetLineArrow( bSwapLineEnds ? false : true, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
+ if ( GetLineArrow( !bSwapLineEnds, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
{
AddOpt( ESCHER_Prop_lineStartArrowLength, nArrowLength );
AddOpt( ESCHER_Prop_lineStartArrowWidth, nArrowWidth );
AddOpt( ESCHER_Prop_lineStartArrowhead, eLineEnd );
nLineFlags |= 0x100010;
}
- if ( GetLineArrow( bSwapLineEnds ? true : false, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
+ if ( GetLineArrow( bSwapLineEnds, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) )
{
AddOpt( ESCHER_Prop_lineEndArrowLength, nArrowLength );
AddOpt( ESCHER_Prop_lineEndArrowWidth, nArrowWidth );
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 3f99bf1fb4e5..0dce7915648e 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1508,7 +1508,7 @@ void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
rSet.Put( makeSdrTextUpperDistItem( nTextTop ) );
rSet.Put( makeSdrTextLowerDistItem( nTextBottom ) );
- rSet.Put( makeSdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? true : false ) );
+ rSet.Put( makeSdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ) );
rSet.Put( makeSdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
}
@@ -5396,8 +5396,8 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
pImpRec->nCropFromRight = GetPropertyValue(
DFF_Prop_cropFromRight, 0 );
- pImpRec->bVFlip = (rObjData.nSpFlags & SP_FFLIPV) ? true : false;
- pImpRec->bHFlip = (rObjData.nSpFlags & SP_FFLIPH) ? true : false;
+ pImpRec->bVFlip = (rObjData.nSpFlags & SP_FFLIPV) != 0;
+ pImpRec->bHFlip = (rObjData.nSpFlags & SP_FFLIPH) != 0;
sal_uInt32 nLineFlags = GetPropertyValue( DFF_Prop_fNoLineDrawDash );
pImpRec->eLineStyle = (nLineFlags & 8)
@@ -5992,7 +5992,7 @@ bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt,
// Can the shape be replaced with a frame?
// (provided that it is a TextBox and the text is not rotated)
- bool bCanBeReplaced = (ULONG_MAX > nPosGroup) ? false : true;
+ bool bCanBeReplaced = nPosGroup >= ULONG_MAX;
// we don't know yet whether it's a TextBox
MSO_SPT eShapeType = mso_sptNil;
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 823a583d54ba..1f08100d97d1 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -3671,7 +3671,7 @@ bool PPTNumberFormatCreator::GetNumberFormat( SdrPowerPointImport& rManager, Svx
break;
}
}
- return ( nHardCount ) ? true : false;
+ return nHardCount != 0;
}
void PPTNumberFormatCreator::ImplGetNumberFormat( SdrPowerPointImport& rManager, SvxNumberFormat& rNumberFormat, sal_uInt32 /*nLevel*/)
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 00fd14ddee70..64bd9778e43d 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -885,7 +885,7 @@ void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
else if( mpRbPgLyContinueFacing->IsChecked() )
paParent->mnPageLayout = 3;
- paParent->mbFirstPageLeft = ( mbUseCTLFont ) ? mpCbPgLyFirstOnLeft->IsChecked() : false;
+ paParent->mbFirstPageLeft = mbUseCTLFont && mpCbPgLyFirstOnLeft->IsChecked();
}
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 049b6fc0bbe8..d156efc7aa54 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -341,8 +341,8 @@ SVGExport::SVGExport(
const char* pSVGDisableFontEmbedding = getenv( "SVG_DISABLE_FONT_EMBEDDING" );
OUString aEmbedFontEnv("${SVG_DISABLE_FONT_EMBEDDING}");
rtl::Bootstrap::expandMacros(aEmbedFontEnv);
- mbIsEmbedFonts=pSVGDisableFontEmbedding ? false : (
- aEmbedFontEnv.getLength() ? false : true);
+ mbIsEmbedFonts = pSVGDisableFontEmbedding == nullptr
+ && aEmbedFontEnv.isEmpty();
}
else
{
@@ -351,7 +351,7 @@ SVGExport::SVGExport(
}
// Native Decoration
- mbIsUseNativeTextDecoration = mbIsUseTinyProfile ? false : aFilterDataHashMap.getUnpackedValueOrDefault(SVG_PROP_NATIVEDECORATION, false);
+ mbIsUseNativeTextDecoration = !mbIsUseTinyProfile && aFilterDataHashMap.getUnpackedValueOrDefault(SVG_PROP_NATIVEDECORATION, false);
// Tiny Opacity (supported from SVG Tiny 1.2)
mbIsUseOpacity = aFilterDataHashMap.getUnpackedValueOrDefault(SVG_PROP_OPACITY, true);
diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx
index 2202947b548b..8f319261188d 100644
--- a/include/filter/msfilter/svdfppt.hxx
+++ b/include/filter/msfilter/svdfppt.hxx
@@ -588,7 +588,7 @@ protected:
SdrPage* MakeBlancPage(bool bMaster) const;
bool ReadFontCollection();
bool ForceFontCollection() const
- { return pFonts!=NULL?true:const_cast<SdrPowerPointImport*>(this)->ReadFontCollection(); }
+ { return pFonts != nullptr || const_cast<SdrPowerPointImport*>(this)->ReadFontCollection(); }
PptSlidePersistList* GetPageList(PptPageKind ePageKind) const;
sal_uInt32 GetAktPageId();
sal_uInt32 GetMasterPageId(sal_uInt16 nPageNum, PptPageKind ePageKind) const;