From 8dca2d5ac740f262b045f6529bd8e97af0ec9c47 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 26 Jun 2017 14:47:16 +0200 Subject: loplugin:oncevar in starmath..svl Change-Id: I20e3796407c7e429a88d2811673929ac1141a41c Reviewed-on: https://gerrit.libreoffice.org/39280 Tested-by: Jenkins Reviewed-by: Noel Grandin --- store/source/stordata.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'store/source') diff --git a/store/source/stordata.cxx b/store/source/stordata.cxx index 01822cd44e56..a2c992b983d6 100644 --- a/store/source/stordata.cxx +++ b/store/source/stordata.cxx @@ -1015,8 +1015,7 @@ storeError OStoreDirectoryPageObject::truncate ( if (eScope == page::SCOPE_DIRECT) { // Truncate direct data pages. - sal_uInt16 i, n = OStoreDirectoryDataBlock::directCount; - for (i = n; i > nRemain; i--) + for (sal_uInt16 i = OStoreDirectoryDataBlock::directCount; i > nRemain; i--) { // Obtain data page location. sal_uInt32 nAddr = directLink (i - 1); @@ -1038,8 +1037,7 @@ storeError OStoreDirectoryPageObject::truncate ( if (eScope == page::SCOPE_SINGLE) { // Truncate single indirect pages. - sal_uInt16 i, n = OStoreDirectoryDataBlock::singleCount; - for (i = n; i > nRemain; i--) + for (sal_uInt16 i = OStoreDirectoryDataBlock::singleCount; i > nRemain; i--) { // Truncate single indirect page to zero data pages. eErrCode = store_truncate_Impl (singleLink (i - 1), 0, rBIOS); @@ -1057,8 +1055,7 @@ storeError OStoreDirectoryPageObject::truncate ( if (eScope == page::SCOPE_DOUBLE) { // Truncate double indirect pages. - sal_uInt16 i, n = OStoreDirectoryDataBlock::doubleCount; - for (i = n; i > nRemain; i--) + for (sal_uInt16 i = OStoreDirectoryDataBlock::doubleCount; i > nRemain; i--) { // Truncate double indirect page to zero single indirect pages. eErrCode = store_truncate_Impl (doubleLink (i - 1), 0, 0, rBIOS); @@ -1076,8 +1073,7 @@ storeError OStoreDirectoryPageObject::truncate ( if (eScope == page::SCOPE_TRIPLE) { // Truncate triple indirect pages. - sal_uInt16 i, n = OStoreDirectoryDataBlock::tripleCount; - for (i = n; i > nRemain; i--) + for (sal_uInt16 i = OStoreDirectoryDataBlock::tripleCount; i > nRemain; i--) { // Truncate to zero double indirect pages. eErrCode = store_truncate_Impl (tripleLink (i - 1), 0, 0, 0, rBIOS); -- cgit