summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-12-15 18:18:06 +0100
committerJulien Nabet <serval2412@yahoo.fr>2012-12-15 18:18:48 +0100
commit255528baadeb2c71b138a58c67937a0e548004b1 (patch)
tree2ba5ed9d8a5ced840d29f062922df10242317870 /sw
parent32877bf72b1e50fe968c1d4b56329ba47e292771 (diff)
Some cppcheck cleaning in sw/
Change-Id: I73365ed32a47e41c6f58191ee111d9b05741b421
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/bastyp/swcache.cxx2
-rw-r--r--sw/source/core/edit/ednumber.cxx6
-rw-r--r--sw/source/core/text/atrstck.cxx3
-rw-r--r--sw/source/filter/ww1/w1class.cxx3
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx3
-rw-r--r--sw/source/ui/dialog/macassgn.cxx3
-rw-r--r--sw/source/ui/misc/glosbib.cxx5
-rw-r--r--sw/source/ui/ribbar/conpoly.cxx4
-rw-r--r--sw/source/ui/uno/unomod.cxx1
9 files changed, 8 insertions, 22 deletions
diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx
index 2d8c58525288..588d2ce3f46e 100644
--- a/sw/source/core/bastyp/swcache.cxx
+++ b/sw/source/core/bastyp/swcache.cxx
@@ -272,7 +272,7 @@ SwCacheObj *SwCache::Get( const void *pOwner, const sal_uInt16 nIndex,
const sal_Bool bToTop )
{
SwCacheObj *pRet;
- if ( 0 != (pRet = nIndex < m_aCacheObjects.size() ? m_aCacheObjects[ nIndex ] : 0) )
+ if ( 0 != (pRet = (nIndex < m_aCacheObjects.size()) ? m_aCacheObjects[ nIndex ] : 0) )
{
if ( !pRet->IsOwner( pOwner ) )
pRet = 0;
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 64a23c0056bc..8bd4f50f691e 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -276,12 +276,8 @@ bool SwEditShell::IsFirstOfNumRule() const
bool SwEditShell::IsFirstOfNumRule(const SwPaM & rPaM) const
{
- bool bResult = false;
-
SwPosition aPos(*rPaM.GetPoint());
- bResult = GetDoc()->IsFirstOfNumRule(aPos);
-
- return bResult;
+ return (GetDoc()->IsFirstOfNumRule(aPos));
}
// <- #i23726#
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 27a9075ed41b..237b0243a577 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -866,12 +866,11 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu
{
bool bRuby = 0 !=
aAttrStack[ StackPos[ RES_TXTATR_CJK_RUBY ] ].Count();
- sal_Bool bTwoLineAct = sal_False;
// two line is activated, if
// 1. no ruby attribute is set and
// 2. attribute is active
- bTwoLineAct = ((SvxTwoLinesItem&)rItem).GetValue();
+ sal_Bool bTwoLineAct = ((SvxTwoLinesItem&)rItem).GetValue();
if ( !bRuby && bTwoLineAct )
{
diff --git a/sw/source/filter/ww1/w1class.cxx b/sw/source/filter/ww1/w1class.cxx
index 91b3d6eae745..28b543503223 100644
--- a/sw/source/filter/ww1/w1class.cxx
+++ b/sw/source/filter/ww1/w1class.cxx
@@ -1126,10 +1126,9 @@ sal_Bool Ww1Pap::HasId0(sal_uInt16 nId)
sal_Bool Ww1Pap::HasId(sal_uInt16 nId)
{
- sal_Bool bRet = sal_False;
sal_uInt16 nPushedPlcIndex2 = nPlcIndex;
sal_uInt16 nPushedFkpIndex2 = nFkpIndex;
- bRet = HasId0( nId );
+ sal_Bool bRet = HasId0( nId );
if (nPlcIndex != nPushedPlcIndex2)
{
delete pPap;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index eaaeeaf088f0..31c3b4075e0c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -742,11 +742,10 @@ void DrawObj::SetShapeDetails(sal_uInt32 nId, sal_Int32 nThick)
bool WW8_WrPlcTxtBoxes::WriteTxt( WW8Export& rWrt )
{
- bool bRet = false;
rWrt.bInWriteEscher = true;
WW8_CP& rccp=TXT_TXTBOX == nTyp ? rWrt.pFib->ccpTxbx : rWrt.pFib->ccpHdrTxbx;
- bRet = WriteGenericTxt( rWrt, nTyp, rccp );
+ bool bRet = WriteGenericTxt( rWrt, nTyp, rccp );
WW8_CP nCP = rWrt.Fc2Cp( rWrt.Strm().Tell() );
WW8Fib& rFib = *rWrt.pFib;
diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx
index 23a1b6266a42..ebf586ac647f 100644
--- a/sw/source/ui/dialog/macassgn.cxx
+++ b/sw/source/ui/dialog/macassgn.cxx
@@ -45,9 +45,8 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
{
SfxEventNamesItem aItem(SID_EVENTCONFIG);
- sal_Bool bHtmlMode = sal_False;
sal_uInt16 nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current());
- bHtmlMode = nHtmlMode & HTMLMODE_ON ? sal_True : sal_False;
+ sal_Bool bHtmlMode = nHtmlMode & HTMLMODE_ON ? sal_True : sal_False;
switch( eType )
{
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 760bcfa4dafb..5e824dc03b41 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -356,10 +356,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl)
bEnableNew = sal_False;
else if(sEntry.Len())
{
- sal_uLong nPos = 0xffffffff;
-
-
- nPos = aGroupTLB.GetEntryPos(sEntry, 0);
+ sal_uLong nPos = aGroupTLB.GetEntryPos(sEntry, 0);
//if it's not case sensitive you have to search for yourself
if( 0xffffffff == nPos)
{
diff --git a/sw/source/ui/ribbar/conpoly.cxx b/sw/source/ui/ribbar/conpoly.cxx
index c05a73fee8f8..50f354a3190b 100644
--- a/sw/source/ui/ribbar/conpoly.cxx
+++ b/sw/source/ui/ribbar/conpoly.cxx
@@ -69,9 +69,7 @@ sal_Bool ConstPolygon::MouseButtonDown(const MouseEvent& rMEvt)
sal_Bool ConstPolygon::MouseMove(const MouseEvent& rMEvt)
{
- sal_Bool bReturn = sal_False;
-
- bReturn = SwDrawBase::MouseMove(rMEvt);
+ sal_Bool bReturn = SwDrawBase::MouseMove(rMEvt);
return bReturn;
}
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index 91334001adaf..561259a48789 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -714,7 +714,6 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
default:
throw IllegalArgumentException(
::rtl::OUString( "SwXViewSettings: invalid zoom type"), 0, 0);
- break;
}
mpViewOption->SetZoomType( eZoom );
mbApplyZoom = sal_True;