diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-16 22:18:32 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-12-17 07:32:56 +0000 |
commit | e31657a1eaad12de1ad89aec5b50f8116f67fa3e (patch) | |
tree | 435fe84175e5a597d671a86befdf23e91b1fc975 /hwpfilter/source/hwpfile.cxx | |
parent | 28d9983e2c561528c27c0dd40c2c0ea5b46a270f (diff) |
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: I9812658e8a96dd35d686c7ae7a8b829267c5c8bc
Reviewed-on: https://gerrit.libreoffice.org/13499
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'hwpfilter/source/hwpfile.cxx')
-rw-r--r-- | hwpfilter/source/hwpfile.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index c4a0bfc63430..e248a3f46f99 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -270,13 +270,10 @@ bool HWPFile::ReadParaList(std::list < HWPPara* > &aplist, unsigned char flag) bool HWPFile::TagsRead(void) { - ulong tag; - long size; - while (true) { - tag = Read4b(); - size = Read4b(); + ulong tag = Read4b(); + long size = Read4b(); if (size <= 0 && tag > 0){ continue; } @@ -374,11 +371,10 @@ ColumnDef *HWPFile::GetColumnDef(int num) int HWPFile::GetPageMasterNum(int page) { std::list<ColumnInfo*>::iterator it = columnlist.begin(); - ColumnInfo *now = 0; int i; for( i = 1 ; it != columnlist.end() ; ++it, i++){ - now = *it; + ColumnInfo *now = *it; if( page < now->start_page ) return i-1; } @@ -619,10 +615,9 @@ int HWPFile::compareCharShape(CharShape *shape) int count = cslist.size(); if( count > 0 ) { - CharShape *cshape=0; for(int i = 0; i< count; i++) { - cshape = getCharShape(i); + CharShape *cshape = getCharShape(i); if( shape->size == cshape->size && shape->font[0] == cshape->font[0] && @@ -646,10 +641,9 @@ int HWPFile::compareParaShape(ParaShape *shape) int count = pslist.size(); if( count > 0 ) { - ParaShape *pshape=0; for(int i = 0; i< count; i++) { - pshape = getParaShape(i); + ParaShape *pshape = getParaShape(i); if( shape->left_margin == pshape->left_margin && shape->right_margin == pshape->right_margin && shape->pspacing_prev == pshape->pspacing_prev && |