summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-10 13:51:56 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-06-11 06:48:29 +0000
commitd203948fdb780c7af5777fcc26ad88bac1bd714e (patch)
tree95458f3a290eed3d9a4ca13f28ec63f50490d7a6 /vcl
parent754ade38ddb2e96187d00f3e621203cea34961fa (diff)
convert 'it.begin() == it.end()' to 'it.empty()'
Change-Id: I244a9eb6bce6b1c649653ec38ebb9a39f8b4c145 Reviewed-on: https://gerrit.libreoffice.org/16212 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/app/gendisp.cxx4
-rw-r--r--vcl/generic/fontmanager/fontcache.cxx2
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx6
-rw-r--r--vcl/generic/print/common_gfx.cxx12
-rw-r--r--vcl/generic/print/glyphset.cxx2
-rw-r--r--vcl/osx/clipboard.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx6
-rw-r--r--vcl/unx/generic/app/sm.cxx4
-rw-r--r--vcl/unx/generic/dtrans/X11_selection.cxx6
-rw-r--r--vcl/unx/generic/window/salframe.cxx8
10 files changed, 27 insertions, 27 deletions
diff --git a/vcl/generic/app/gendisp.cxx b/vcl/generic/app/gendisp.cxx
index 1275465c4fb1..06473a95f080 100644
--- a/vcl/generic/app/gendisp.cxx
+++ b/vcl/generic/app/gendisp.cxx
@@ -73,7 +73,7 @@ bool SalGenericDisplay::DispatchInternalEvent()
if( osl_acquireMutex( m_aEventGuard ) )
{
- if( m_aUserEvents.begin() != m_aUserEvents.end() )
+ if( !m_aUserEvents.empty() )
{
pFrame = m_aUserEvents.front().m_pFrame;
pData = m_aUserEvents.front().m_pData;
@@ -137,7 +137,7 @@ bool SalGenericDisplay::HasUserEvents() const
bool bRet = false;
if( osl_acquireMutex( m_aEventGuard ) )
{
- if( m_aUserEvents.begin() != m_aUserEvents.end() )
+ if( !m_aUserEvents.empty() )
bRet = true;
osl_releaseMutex( m_aEventGuard );
}
diff --git a/vcl/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx
index 7448570c8ada..f7735d1e4264 100644
--- a/vcl/generic/fontmanager/fontcache.cxx
+++ b/vcl/generic/fontmanager/fontcache.cxx
@@ -125,7 +125,7 @@ void FontCache::flush()
{
// insert cache entries
const FontCacheEntry& rEntry( entry_it->second.m_aEntry );
- if( rEntry.begin() == rEntry.end() )
+ if( rEntry.empty() )
continue;
aLine.append("File:");
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 2f4b49a09f3e..9752e8677684 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -1208,7 +1208,7 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const
// set family name from XLFD if possible
if( ! pFont->m_nFamilyName )
{
- if( aNames.begin() != aNames.end() )
+ if( !aNames.empty() )
{
pFont->m_nFamilyName = m_pAtoms->getAtom( ATOM_FAMILYNAME, aNames.front(), true );
aNames.pop_front();
@@ -2187,7 +2187,7 @@ std::list< OString > PrintFontManager::getAdobeNameFromUnicode( sal_Unicode aCha
for( ; range.first != range.second; ++range.first )
aRet.push_back( range.first->second );
- if( aRet.begin() == aRet.end() && aChar != 0 )
+ if( aRet.empty() && aChar != 0 )
{
sal_Char aBuf[8];
sal_Int32 nChars = snprintf( aBuf, sizeof( aBuf ), "uni%.4hX", aChar );
@@ -2207,7 +2207,7 @@ std::list< sal_Unicode > PrintFontManager::getUnicodeFromAdobeName( const OStri
for( ; range.first != range.second; ++range.first )
aRet.push_back( range.first->second );
- if( aRet.begin() == aRet.end() )
+ if( aRet.empty() )
{
if( rName.getLength() == 7 && rName.startsWith( "uni" ) )
{
diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx
index b02c57706c27..14574edc1878 100644
--- a/vcl/generic/print/common_gfx.cxx
+++ b/vcl/generic/print/common_gfx.cxx
@@ -228,12 +228,12 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it,
Point aLastPoint = leftside.front();
PSBinMoveTo (aLastPoint, rOldPoint, rColumn);
leftside.pop_front();
- while( leftside.begin() != leftside.end() )
+ while( !leftside.empty() )
{
Point aPoint (leftside.front());
leftside.pop_front();
// may have been the last one
- if( leftside.begin() != leftside.end() )
+ if( !leftside.empty() )
{
nNewDX = aPoint.X() - aLastPoint.X();
nNewDY = aPoint.Y() - aLastPoint.Y();
@@ -248,11 +248,11 @@ PrinterGfx::JoinVerticalClipRectangles( std::list< Rectangle >::iterator& it,
aLastPoint = rightside.back();
PSBinLineTo (aLastPoint, rOldPoint, rColumn);
rightside.pop_back();
- while( rightside.begin() != rightside.end() )
+ while( !rightside.empty() )
{
Point aPoint (rightside.back());
rightside.pop_back();
- if( rightside.begin() != rightside.end() )
+ if( !rightside.empty() )
{
nNewDX = aPoint.X() - aLastPoint.X();
nNewDY = aPoint.Y() - aLastPoint.Y();
@@ -663,7 +663,7 @@ PrinterGfx::PSGSave ()
{
WritePS (mpPageBody, "gsave\n" );
GraphicsStatus aNewState;
- if( maGraphicsStack.begin() != maGraphicsStack.end() )
+ if( !maGraphicsStack.empty() )
aNewState = maGraphicsStack.front();
maGraphicsStack.push_front( aNewState );
}
@@ -672,7 +672,7 @@ void
PrinterGfx::PSGRestore ()
{
WritePS (mpPageBody, "grestore\n" );
- if( maGraphicsStack.begin() == maGraphicsStack.end() )
+ if( maGraphicsStack.empty() )
WritePS (mpPageBody, "Error: too many grestores\n" );
else
maGraphicsStack.pop_front();
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx
index 37bd752525f8..f0c4e301ec65 100644
--- a/vcl/generic/print/glyphset.cxx
+++ b/vcl/generic/print/glyphset.cxx
@@ -657,7 +657,7 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx)
std::list< OString > aName( rMgr.getAdobeNameFromUnicode((*aSortedGlyph).second) );
- if( aName.begin() != aName.end() )
+ if( !aName.empty() )
nSize += psp::appendStr ( aName.front().getStr(), pEncodingVector + nSize);
else
nSize += psp::appendStr (".notdef", pEncodingVector + nSize );
diff --git a/vcl/osx/clipboard.cxx b/vcl/osx/clipboard.cxx
index 1f444ca7c0c7..008ec32ade5e 100644
--- a/vcl/osx/clipboard.cxx
+++ b/vcl/osx/clipboard.cxx
@@ -259,14 +259,14 @@ void AquaClipboard::fireClipboardChangedEvent()
list<Reference< XClipboardListener > > listeners(mClipboardListeners);
ClipboardEvent aEvent;
- if (listeners.begin() != listeners.end())
+ if (!listeners.empty())
{
aEvent = ClipboardEvent(static_cast<OWeakObject*>(this), getContents());
}
aGuard.clear();
- while (listeners.begin() != listeners.end())
+ while (!listeners.empty())
{
if (listeners.front().is())
{
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index fc13cbb5d765..7b733eac5ad2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2174,7 +2174,7 @@ bool PDFWriterImpl::writeBuffer( const void* pBuffer, sal_uInt64 nBytes )
if( ! nBytes ) // huh ?
return true;
- if( m_aOutputStreams.begin() != m_aOutputStreams.end() )
+ if( !m_aOutputStreams.empty() )
{
m_aOutputStreams.front().m_pStream->Seek( STREAM_SEEK_TO_END );
m_aOutputStreams.front().m_pStream->Write( pBuffer, sal::static_int_cast<sal_Size>(nBytes) );
@@ -2314,13 +2314,13 @@ sal_Int32 PDFWriterImpl::newPage( sal_Int32 nPageWidth, sal_Int32 nPageHeight, P
void PDFWriterImpl::endPage()
{
- if( m_aPages.begin() != m_aPages.end() )
+ if( !m_aPages.empty() )
{
// close eventual MC sequence
endStructureElementMCSeq();
// sanity check
- if( m_aOutputStreams.begin() != m_aOutputStreams.end() )
+ if( !m_aOutputStreams.empty() )
{
OSL_FAIL( "redirection across pages !!!" );
m_aOutputStreams.clear(); // leak !
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index 97a472473c4a..8627fdeab94b 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -352,8 +352,8 @@ IMPL_STATIC_LINK_NOARG( SessionManagerClient, ShutDownHdl )
}
const std::list< SalFrame* >& rFrames = vcl_sal::getSalDisplay(GetGenericData())->getFrames();
- SAL_INFO("vcl.sm", (rFrames.begin() != rFrames.end() ? "shutdown on first frame" : "shutdown event but no frame"));
- if( rFrames.begin() != rFrames.end() )
+ SAL_INFO("vcl.sm", (!rFrames.empty() ? "shutdown on first frame" : "shutdown event but no frame"));
+ if( !rFrames.empty() )
rFrames.front()->CallCallback( SALEVENT_SHUTDOWN, 0 );
return 0;
}
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 720b8c6e41bf..c8263b6e2356 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -1929,7 +1929,7 @@ bool SelectionManager::handleSendPropertyNotify( XPropertyEvent& rNotify )
}
}
- while( aTimeouts.begin() != aTimeouts.end() )
+ while( !aTimeouts.empty() )
{
// transfer broken, might even be a new client with the
// same window id
@@ -1979,7 +1979,7 @@ bool SelectionManager::handleSendPropertyNotify( XPropertyEvent& rNotify )
}
// eventually clean up the hash map
- if( it->second.begin() == it->second.end() )
+ if( it->second.empty() )
m_aIncrementals.erase( it );
}
}
@@ -3694,7 +3694,7 @@ void SelectionManager::run( void* pThis )
}
}
aGuard.clear();
- while( aChangeList.begin() != aChangeList.end() )
+ while( !aChangeList.empty() )
{
aChangeList.front().first->fireContentsChanged();
aChangeList.pop_front();
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index d2511917ee85..fa733cfd5870 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -103,7 +103,7 @@ static int nVisibleFloats = 0;
static void doReparentPresentationDialogues( SalDisplay* pDisplay )
{
GetGenericData()->ErrorTrapPush();
- while( aPresentationReparentList.begin() != aPresentationReparentList.end() )
+ while( !aPresentationReparentList.empty() )
{
int x, y;
::Window aRoot, aChild;
@@ -3539,7 +3539,7 @@ long X11SalFrame::HandleExposeEvent( XEvent *pEvent )
}
if( IsOverrideRedirect() && mbFullScreen &&
- aPresentationReparentList.begin() == aPresentationReparentList.end() )
+ aPresentationReparentList.empty() )
// we are in fullscreen mode -> override redirect
// focus is possibly lost, so reget it
XSetInputFocus( GetXDisplay(), GetShellWindow(), RevertToNone, CurrentTime );
@@ -3562,7 +3562,7 @@ long X11SalFrame::HandleExposeEvent( XEvent *pEvent )
void X11SalFrame::RestackChildren( ::Window* pTopLevelWindows, int nTopLevelWindows )
{
- if( maChildren.begin() != maChildren.end() )
+ if( !maChildren.empty() )
{
int nWindow = nTopLevelWindows;
while( nWindow-- )
@@ -3604,7 +3604,7 @@ void X11SalFrame::RestackChildren( ::Window* pTopLevelWindows, int nTopLevelWind
void X11SalFrame::RestackChildren()
{
if( ! GetDisplay()->getWMAdaptor()->isTransientBehaviourAsExpected()
- && maChildren.begin() != maChildren.end() )
+ && !maChildren.empty() )
{
::Window aRoot, aParent, *pChildren = NULL;
unsigned int nChildren;