summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-11 10:06:49 +0200
committerNoel Grandin <noel@peralex.com>2015-06-11 10:07:08 +0200
commit776a3f14f2d987312b926ebc1ad09321a3a87f0d (patch)
tree09be8f37156fb9147e306dbd27d5dfa8e282c43f /sw
parentf60e521f24863643c7befed7f84db7d659c3c547 (diff)
convert expressions like 'size() == 0' to 'empty()'
Change-Id: Ia5c8c0f38a347f398d587970a22e03f29ffd37af
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx4
-rw-r--r--sw/source/core/doc/docbm.cxx4
-rw-r--r--sw/source/core/docnode/ndtbl.cxx8
-rw-r--r--sw/source/core/text/SwGrammarMarkUp.cxx10
-rw-r--r--sw/source/core/undo/untbl.cxx2
-rw-r--r--sw/source/core/unocore/unoobj2.cxx4
-rw-r--r--sw/source/core/unocore/unoportenum.cxx20
-rw-r--r--sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx14
8 files changed, 33 insertions, 33 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index bdf56b515766..4f7b0bda1ed0 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -483,7 +483,7 @@ namespace
lcl_CalcBreaks(Breaks, rPam);
- if (!Breaks.size())
+ if (Breaks.empty())
{
return (rDocumentContentOperations.*pFunc)(rPam, bForceJoinNext);
}
@@ -2968,7 +2968,7 @@ bool DocumentContentOperationsManager::ReplaceRange( SwPaM& rPam, const OUString
}
*rPam.Start() = *aPam.GetMark(); // update start of original pam w/ prefix
- if (!Breaks.size())
+ if (Breaks.empty())
{
// park aPam somewhere so it does not point to node that is deleted
aPam.DeleteMark();
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index b88bd17cc626..2cf2cafc00b0 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -170,7 +170,7 @@ namespace
back_inserter(vCandidates),
boost::bind( ::std::logical_not<bool>(), boost::bind( &IMark::EndsBefore, _1, rPos ) ) );
// no candidate left => we are in front of the first mark or there are none
- if(!vCandidates.size()) return NULL;
+ if(vCandidates.empty()) return NULL;
// return the highest (last) candidate using mark end ordering
return max_element(vCandidates.begin(), vCandidates.end(), &lcl_MarkOrderingByEnd)->get();
}
@@ -809,7 +809,7 @@ namespace sw { namespace mark
// in order to assure sorting. The sorting is critical for the
// deletion of a mark as it is searched in these container for
// deletion.
- if ( vMarksToDelete.size() > 0 && bMarksMoved )
+ if ( !vMarksToDelete.empty() && bMarksMoved )
{
sortSubsetMarks();
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 5fc6f391b774..863295462531 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -263,7 +263,7 @@ bool SwNodes::InsBoxen( SwTableNode* pTableNd,
if( !pPrvBox && !pNxtBox )
{
bool bSetIdxPos = true;
- if( pTableNd->GetTable().GetTabLines().size() && !nInsPos )
+ if( !pTableNd->GetTable().GetTabLines().empty() && !nInsPos )
{
const SwTableLine* pTableLn = pLine;
while( pTableLn->GetUpper() )
@@ -272,7 +272,7 @@ bool SwNodes::InsBoxen( SwTableNode* pTableNd,
if( pTableNd->GetTable().GetTabLines()[ 0 ] == pTableLn )
{
// Before the Table's first Box
- while( ( pNxtBox = pLine->GetTabBoxes()[0])->GetTabLines().size() )
+ while( !( pNxtBox = pLine->GetTabBoxes()[0])->GetTabLines().empty() )
pLine = pNxtBox->GetTabLines()[0];
nIdxPos = pNxtBox->GetSttIdx();
bSetIdxPos = false;
@@ -1351,7 +1351,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
SwTableBoxFormat* pBoxFormat,
SwTextFormatColl* /*pTextColl*/ /*, SwUndo... pUndo*/ )
{
- if( !rTableNodes.size() )
+ if( rTableNodes.empty() )
return 0;
SwTableNode * pTableNd = new SwTableNode( rTableNodes.begin()->begin()->aStart );
@@ -1846,7 +1846,7 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor )
ForEach_FndLineCopyCol( pTableNd->GetTable().GetTabLines(), &aPara );
}
- if( !aFndBox.GetLines().size() )
+ if( aFndBox.GetLines().empty() )
return false;
SwEditShell* pESh = GetEditShell();
diff --git a/sw/source/core/text/SwGrammarMarkUp.cxx b/sw/source/core/text/SwGrammarMarkUp.cxx
index d25ac883ff88..c5d57d54ce67 100644
--- a/sw/source/core/text/SwGrammarMarkUp.cxx
+++ b/sw/source/core/text/SwGrammarMarkUp.cxx
@@ -39,7 +39,7 @@ void SwGrammarMarkUp::CopyFrom( const SwWrongList& rCopy )
void SwGrammarMarkUp::MoveGrammar( sal_Int32 nPos, sal_Int32 nDiff )
{
Move( nPos, nDiff );
- if( !maSentence.size() )
+ if( maSentence.empty() )
return;
std::vector< sal_Int32 >::iterator pIter = maSentence.begin();
while( pIter != maSentence.end() && *pIter < nPos )
@@ -58,7 +58,7 @@ void SwGrammarMarkUp::MoveGrammar( sal_Int32 nPos, sal_Int32 nDiff )
SwGrammarMarkUp* SwGrammarMarkUp::SplitGrammarList( sal_Int32 nSplitPos )
{
SwGrammarMarkUp* pNew = static_cast<SwGrammarMarkUp*>(SplitList( nSplitPos ));
- if( !maSentence.size() )
+ if( maSentence.empty() )
return pNew;
std::vector< sal_Int32 >::iterator pIter = maSentence.begin();
while( pIter != maSentence.end() && *pIter < nSplitPos )
@@ -80,7 +80,7 @@ void SwGrammarMarkUp::JoinGrammarList( SwGrammarMarkUp* pNext, sal_Int32 nInsert
JoinList( pNext, nInsertPos );
if (pNext)
{
- if( !pNext->maSentence.size() )
+ if( pNext->maSentence.empty() )
return;
std::vector< sal_Int32 >::iterator pIter = pNext->maSentence.begin();
while( pIter != pNext->maSentence.end() )
@@ -126,7 +126,7 @@ void SwGrammarMarkUp::setSentence( sal_Int32 nStart )
sal_Int32 SwGrammarMarkUp::getSentenceStart( sal_Int32 nPos )
{
- if( !maSentence.size() )
+ if( maSentence.empty() )
return 0;
std::vector< sal_Int32 >::iterator pIter = maSentence.begin();
while( pIter != maSentence.end() && *pIter < nPos )
@@ -140,7 +140,7 @@ sal_Int32 SwGrammarMarkUp::getSentenceStart( sal_Int32 nPos )
sal_Int32 SwGrammarMarkUp::getSentenceEnd( sal_Int32 nPos )
{
- if( !maSentence.size() )
+ if( maSentence.empty() )
return COMPLETE_STRING;
std::vector< sal_Int32 >::iterator pIter = maSentence.begin();
while( pIter != maSentence.end() && *pIter <= nPos )
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index f4e21ef873bc..83bbe44e9fcb 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1233,7 +1233,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTable )
if( ULONG_MAX == nSttNode ) // no EndBox
{
- if( !rBox.GetTabLines().size() )
+ if( rBox.GetTabLines().empty() )
{
OSL_ENSURE( false, "Number of lines changed" );
}
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index a279fb6a93f8..0c238248c876 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1679,7 +1679,7 @@ void SwXParaFrameEnumerationImpl::FillFrame()
bool SwXParaFrameEnumerationImpl::CreateNextObject()
{
- if (!m_vFrames.size())
+ if (m_vFrames.empty())
return false;
SwFrameFormat* const pFormat = static_cast<SwFrameFormat*>(
@@ -1740,7 +1740,7 @@ throw (container::NoSuchElementException,
if (!GetCursor())
throw uno::RuntimeException();
PurgeFrameClients();
- if (!m_xNextObject.is() && m_vFrames.size())
+ if (!m_xNextObject.is() && !m_vFrames.empty())
CreateNextObject();
if (!m_xNextObject.is())
throw container::NoSuchElementException();
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index d95fd8bb4ea3..c3cc87864e22 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -391,7 +391,7 @@ throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- return m_Portions.size() > 0;
+ return !m_Portions.empty();
}
uno::Any SwXTextPortionEnumeration::nextElement()
@@ -400,7 +400,7 @@ throw( container::NoSuchElementException, lang::WrappedTargetException,
{
SolarMutexGuard aGuard;
- if (!m_Portions.size())
+ if (m_Portions.empty())
throw container::NoSuchElementException();
Any any;
@@ -1152,7 +1152,7 @@ static void lcl_ExportAnnotationStarts(
SwAnnotationStartPortion_ImplList& rAnnotationStartArr,
const sal_Int32 nIndex)
{
- if ( rAnnotationStartArr.size() > 0 )
+ if ( !rAnnotationStartArr.empty() )
{
for ( SwAnnotationStartPortion_ImplList::iterator aIter = rAnnotationStartArr.begin(), aEnd = rAnnotationStartArr.end();
aIter != aEnd; )
@@ -1187,11 +1187,11 @@ static sal_Int32 lcl_ExportFrames(
{
// Ignore frames which are not exported, as we are exporting a selection
// and they are anchored before the start of the selection.
- while (i_rFrames.size() && i_rFrames.front().nIndex < i_nCurrentIndex)
+ while (!i_rFrames.empty() && i_rFrames.front().nIndex < i_nCurrentIndex)
i_rFrames.pop_front();
// find first Frame in (sorted) i_rFrames at current position
- while (i_rFrames.size() && (i_rFrames.front().nIndex == i_nCurrentIndex))
+ while (!i_rFrames.empty() && (i_rFrames.front().nIndex == i_nCurrentIndex))
// do not check for i_nEnd here; this is done implicity by lcl_MoveCursor
{
const SwModify * const pFrame =
@@ -1205,7 +1205,7 @@ static sal_Int32 lcl_ExportFrames(
i_rFrames.pop_front();
}
- return i_rFrames.size() ? i_rFrames.front().nIndex : -1;
+ return !i_rFrames.empty() ? i_rFrames.front().nIndex : -1;
}
static sal_Int32 lcl_GetNextIndex(
@@ -1341,7 +1341,7 @@ static void lcl_CreatePortions(
if (!xRef.is() && !bCursorMoved)
{
if (!bAtEnd &&
- FieldMarks.size() && (FieldMarks.front() == nCurrentIndex))
+ !FieldMarks.empty() && (FieldMarks.front() == nCurrentIndex))
{
// moves cursor
xRef = lcl_ExportFieldMark(i_xParentText, pUnoCrsr, pTextNode);
@@ -1350,7 +1350,7 @@ static void lcl_CreatePortions(
}
else
{
- OSL_ENSURE(!FieldMarks.size() ||
+ OSL_ENSURE(FieldMarks.empty() ||
(FieldMarks.front() != nCurrentIndex),
"fieldmark and hint with CH_TXTATR at same pos?");
}
@@ -1360,8 +1360,8 @@ static void lcl_CreatePortions(
const sal_Int32 nNextPortionIndex =
lcl_GetNextIndex(Bookmarks, Redlines, SoftPageBreaks);
- sal_Int32 nNextMarkIndex = ( FieldMarks.size() ? FieldMarks.front() : -1 );
- if ( AnnotationStarts.size() > 0
+ sal_Int32 nNextMarkIndex = ( !FieldMarks.empty() ? FieldMarks.front() : -1 );
+ if ( !AnnotationStarts.empty()
&& ( nNextMarkIndex == -1
|| (*AnnotationStarts.begin())->getIndex() < nNextMarkIndex ) )
{
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index 01dbd79bcc86..84f6fddc86bb 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -300,7 +300,7 @@ The code below would only be part of the solution.
else
m_pSpellState->m_bOtherSpelled = true;
// if no result has been found try at the body text - completely
- if(!m_pSpellState->m_bBodySpelled && !aRet.size())
+ if(!m_pSpellState->m_bBodySpelled && aRet.empty())
{
pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START );
if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
@@ -334,7 +334,7 @@ The code below would only be part of the solution.
pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART );
(void)pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn);
}
- if(!aRet.size())
+ if(aRet.empty())
{
// end spelling
pWrtShell->SpellEnd();
@@ -370,7 +370,7 @@ The code below would only be part of the solution.
}
// search for a draw text object that contains error and spell it
- if(!aRet.size() &&
+ if(aRet.empty() &&
(m_pSpellState->m_bDrawingsSpelled ||
!FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet)))
{
@@ -383,7 +383,7 @@ The code below would only be part of the solution.
// now only the rest of the body text can be spelled -
// if the spelling started inside of the body
bool bCloseMessage = true;
- if(!aRet.size() && !m_pSpellState->m_bStartedInSelection)
+ if(aRet.empty() && !m_pSpellState->m_bStartedInSelection)
{
OSL_ENSURE(m_pSpellState->m_bDrawingsSpelled &&
m_pSpellState->m_bOtherSpelled && m_pSpellState->m_bBodySpelled,
@@ -413,7 +413,7 @@ The code below would only be part of the solution.
bCloseMessage = false; // no closing message if a wrap around has been denied
}
}
- if(!aRet.size())
+ if(aRet.empty())
{
if(bCloseMessage)
{
@@ -755,10 +755,10 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj);
}
}
- if(m_pSpellState->m_aTextObjects.size())
+ if(!m_pSpellState->m_aTextObjects.empty())
{
Reference< XSpellChecker1 > xSpell( GetSpellChecker() );
- while(!bNextDoc && m_pSpellState->m_aTextObjects.size())
+ while(!bNextDoc && !m_pSpellState->m_aTextObjects.empty())
{
std::list<SdrTextObj*>::iterator aStart = m_pSpellState->m_aTextObjects.begin();
SdrTextObj* pTextObj = *aStart;