summaryrefslogtreecommitdiff
path: root/svx/source/unodraw/unomtabl.cxx
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2015-01-14 18:03:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-14 20:42:32 +0000
commitc752d8bdf099b4ba2ef2e145e0d9da42ba7e74d7 (patch)
tree8386738dfe2bb6b05e8ee0e3cbc6709499bfd937 /svx/source/unodraw/unomtabl.cxx
parentc0948f29ebd61a232406c30c306d7d8b23a596a6 (diff)
fdo#39440 svx: reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: I8c63a767c62b3a666ad445a0a3095d1bb1224f5e Reviewed-on: https://gerrit.libreoffice.org/13908 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/unodraw/unomtabl.cxx')
-rw-r--r--svx/source/unodraw/unomtabl.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx
index 5ce33fa114fc..7a9d20f3e1b8 100644
--- a/svx/source/unodraw/unomtabl.cxx
+++ b/svx/source/unodraw/unomtabl.cxx
@@ -196,12 +196,11 @@ void SAL_CALL SvxUnoMarkerTable::removeByName( const OUString& aApiName )
ItemPoolVector::iterator aIter = maItemSetVector.begin();
const ItemPoolVector::iterator aEnd = maItemSetVector.end();
- const NameOrIndex *pItem;
const OUString aSearchName( Name );
while( aIter != aEnd )
{
- pItem = static_cast<const NameOrIndex *>(&((*aIter)->Get( XATTR_LINEEND ) ));
+ const NameOrIndex *pItem = static_cast<const NameOrIndex *>(&((*aIter)->Get( XATTR_LINEEND ) ));
if( pItem->GetName() == aSearchName )
{
delete (*aIter);
@@ -286,11 +285,10 @@ void SAL_CALL SvxUnoMarkerTable::replaceByName( const OUString& aApiName, const
static bool getByNameFromPool( const OUString& rSearchName, SfxItemPool* pPool, sal_uInt16 nWhich, uno::Any& rAny )
{
- const NameOrIndex *pItem;
const sal_uInt32 nSurrogateCount = pPool ? pPool->GetItemCount2( nWhich ) : 0;
for( sal_uInt32 nSurrogate = 0; nSurrogate < nSurrogateCount; nSurrogate++ )
{
- pItem = static_cast<const NameOrIndex*>(pPool->GetItem2( nWhich, nSurrogate ));
+ const NameOrIndex *pItem = static_cast<const NameOrIndex*>(pPool->GetItem2( nWhich, nSurrogate ));
if( pItem && pItem->GetName() == rSearchName )
{