summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2017-09-17 13:29:35 +0200
committerBjörn Michaelsen <bjoern.michaelsen@libreoffice.org>2017-09-17 15:04:29 +0200
commit035f205202da2756fe1aaea5f730228f3d40cf51 (patch)
treeba18deb8f07cbaf2bb1666cc17889947e668ca85 /sw
parent9177f87b69f877c88eab584cd39cb423b400c13d (diff)
replace some boilerplate with C11++
- also get rid of old OSL_* in favor of SAL_WARN* Change-Id: I4292cb3292c37fe9905a40903d9094c6206ab7f6 Reviewed-on: https://gerrit.libreoffice.org/42374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unotext.cxx44
1 files changed, 10 insertions, 34 deletions
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index ab240ba3cdf2..70d3b682deb9 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2005,18 +2005,11 @@ lcl_ApplyCellProperties(
{
// 'close' all the cell with the same left position
// if separate vertical merges in the same column exist
- if (rMergedCells.size())
+ for(auto& aMergedCell : rMergedCells)
{
- std::vector<VerticallyMergedCell>::iterator aMergedIter =
- rMergedCells.begin();
- while (aMergedIter != rMergedCells.end())
+ if(lcl_SimilarPosition(aMergedCell.nLeftPosition, nLeftPos))
{
- if (lcl_SimilarPosition(aMergedIter->nLeftPosition,
- nLeftPos))
- {
- aMergedIter->bOpen = false;
- }
- ++aMergedIter;
+ aMergedCell.bOpen = false;
}
}
// add the new group of merged cells
@@ -2024,34 +2017,17 @@ lcl_ApplyCellProperties(
}
else
{
- // find the cell that
- OSL_ENSURE(rMergedCells.size(),
- "the first merged cell is missing");
- if (rMergedCells.size())
+ bool bFound = false;
+ SAL_WARN_IF(rMergedCells.empty(), "sw.uno", "the first merged cell is missing");
+ for(auto& aMergedCell : rMergedCells)
{
- std::vector<VerticallyMergedCell>::iterator aMergedIter =
- rMergedCells.begin();
-#if OSL_DEBUG_LEVEL > 0
- bool bDbgFound = false;
-#endif
- while (aMergedIter != rMergedCells.end())
+ if (aMergedCell.bOpen && lcl_SimilarPosition(aMergedCell.nLeftPosition, nLeftPos))
{
- if (aMergedIter->bOpen &&
- lcl_SimilarPosition(aMergedIter->nLeftPosition,
- nLeftPos))
- {
- aMergedIter->aCells.push_back( xCellPS );
-#if OSL_DEBUG_LEVEL > 0
- bDbgFound = true;
-#endif
- }
- ++aMergedIter;
+ aMergedCell.aCells.push_back( xCellPS );
+ bFound = true;
}
-#if OSL_DEBUG_LEVEL > 0
- OSL_ENSURE( bDbgFound,
- "couldn't find first vertically merged cell" );
-#endif
}
+ SAL_WARN_IF(!bFound, "sw.uno", "couldn't find first vertically merged cell" );
}
}
else