summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-04-21 07:50:54 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2018-04-21 11:02:29 +0200
commitde07f40030bbd604bc42d58f0e954cca284a2646 (patch)
treed16090c7008b533b8af295b68701681012ba7608 /sw
parent3322661414a558d29146c40c0cd5e9db0a7b21dd (diff)
cppcheck: identicalInnerCondition
renamed temporary list in EnhancedCustomShape2d.cxx to avoid shadow of a local variable Change-Id: I17a2261dafd2067480fcc5314af4f48765d6b690 Reviewed-on: https://gerrit.libreoffice.org/53244 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'sw')
-rwxr-xr-xsw/source/core/text/itrform2.cxx7
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx44
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx18
-rw-r--r--sw/source/uibase/utlui/content.cxx4
4 files changed, 34 insertions, 39 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 3e32430d1c36..92091f901bd8 100755
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -486,10 +486,9 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
else if ( bHasGrid && pGrid->IsSnapToChars() && ! pGridKernPortion && ! pMulti && ! pPor->InTabGrp() )
{
// insert a grid kerning portion
- if ( ! pGridKernPortion )
- pGridKernPortion = pPor->IsKernPortion() ?
- static_cast<SwKernPortion*>(pPor) :
- new SwKernPortion( *m_pCurr );
+ pGridKernPortion = pPor->IsKernPortion() ?
+ static_cast<SwKernPortion*>(pPor) :
+ new SwKernPortion( *m_pCurr );
// if we have a new GridKernPortion, we initially calculate
// its size so that its ends on the grid
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 0395b9902528..0f328d303d0f 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1146,30 +1146,28 @@ void WW8TabBandDesc::ReadDef(bool bVer67, const sal_uInt8* pS, short nLen)
WW8_TCellVer6 const * pTc = reinterpret_cast<WW8_TCellVer6 const *>(pT);
for (int i = 0; i < nColsToRead; i++, ++pCurrentTC,++pTc)
{
- if( i < nColsToRead )
- { // TC from file ?
- sal_uInt8 aBits1 = pTc->aBits1Ver6;
- pCurrentTC->bFirstMerged = sal_uInt8( ( aBits1 & 0x01 ) != 0 );
- pCurrentTC->bMerged = sal_uInt8( ( aBits1 & 0x02 ) != 0 );
- pCurrentTC->rgbrc[ WW8_TOP ]
- = WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_TOP ] ));
- pCurrentTC->rgbrc[ WW8_LEFT ]
- = WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_LEFT ] ));
- pCurrentTC->rgbrc[ WW8_BOT ]
- = WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_BOT ] ));
- pCurrentTC->rgbrc[ WW8_RIGHT ]
+ // TC from file ?
+ sal_uInt8 aBits1 = pTc->aBits1Ver6;
+ pCurrentTC->bFirstMerged = sal_uInt8( ( aBits1 & 0x01 ) != 0 );
+ pCurrentTC->bMerged = sal_uInt8( ( aBits1 & 0x02 ) != 0 );
+ pCurrentTC->rgbrc[ WW8_TOP ]
+ = WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_TOP ] ));
+ pCurrentTC->rgbrc[ WW8_LEFT ]
+ = WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_LEFT ] ));
+ pCurrentTC->rgbrc[ WW8_BOT ]
+ = WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_BOT ] ));
+ pCurrentTC->rgbrc[ WW8_RIGHT ]
+ = WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_RIGHT ] ));
+ if( ( pCurrentTC->bMerged )
+ && ( i > 0 ) )
+ {
+ // Cell merged -> remember
+ //bWWMergedVer6[i] = true;
+ pTCs[i-1].rgbrc[ WW8_RIGHT ]
= WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_RIGHT ] ));
- if( ( pCurrentTC->bMerged )
- && ( i > 0 ) )
- {
- // Cell merged -> remember
- //bWWMergedVer6[i] = true;
- pTCs[i-1].rgbrc[ WW8_RIGHT ]
- = WW8_BRCVer9(WW8_BRC( pTc->rgbrcVer6[ WW8_RIGHT ] ));
- // apply right border to previous cell
- // bExist must not be set to false, because WW
- // does not count this cells in text boxes....
- }
+ // apply right border to previous cell
+ // bExist must not be set to false, because WW
+ // does not count this cells in text boxes....
}
}
}
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 35aecdbbbeee..85a395f0671a 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -177,17 +177,15 @@ void SwMailMergeGreetingsPage::UpdatePreview()
try
{
bFemale = xColumn->getString() == sFemaleValue;
- if( !bNoValue )
+
+ //no last name value marks the greeting also as neutral
+ const OUString sLastNameColumn =
+ m_rConfigItem.GetAssignedColumn(MM_PART_LASTNAME);
+ if ( xColAccess->hasByName(sLastNameColumn) )
{
- //no last name value marks the greeting also as neutral
- const OUString sLastNameColumn =
- m_rConfigItem.GetAssignedColumn(MM_PART_LASTNAME);
- if ( xColAccess->hasByName(sLastNameColumn) )
- {
- aCol = xColAccess->getByName(sLastNameColumn);
- aCol >>= xColumn;
- bNoValue = xColumn->getString().isEmpty();
- }
+ aCol = xColAccess->getByName(sLastNameColumn);
+ aCol >>= xColumn;
+ bNoValue = xColumn->getString().isEmpty();
}
}
catch (const sdbc::SQLException&)
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index a4932d34a7eb..4fe719131123 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1250,7 +1250,7 @@ VclPtr<PopupMenu> SwContentTree::CreateContextMenu()
pSubPop4->CheckItem( 405, SwEditShell::IsTOXBaseReadonly(*pBase));
pSubPop4->InsertItem(501, m_aContextStrings[IDX_STR_DELETE_ENTRY]);
}
- else if(ContentTypeId::TABLE == nContentType && !bReadonly)
+ else if(ContentTypeId::TABLE == nContentType)
{
bSubPop4 = true;
pSubPop4->InsertItem(403, m_aContextStrings[IDX_STR_EDIT_ENTRY]);
@@ -1262,7 +1262,7 @@ VclPtr<PopupMenu> SwContentTree::CreateContextMenu()
pSubPop4->EnableItem(404, bProt );
pSubPop4->InsertItem(501, m_aContextStrings[IDX_STR_DELETE_ENTRY]);
}
- else if(bEditable || bDeletable)
+ else
{
if(bEditable && bDeletable)