summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorJoseph Powers <jpowers27@cox.net>2011-07-20 05:26:52 -0700
committerJoseph Powers <jpowers27@cox.net>2011-07-20 05:27:27 -0700
commit5ff29e7a9302c51ca5a41d398ee247141bcde11d (patch)
tree85b997ac62ef845592f9b7d51ca4f7c0b24fdc5a /vcl
parentdon't prohibit rendering text with cairo due to antialias advice anymore (diff)
downloadcore-5ff29e7a9302c51ca5a41d398ee247141bcde11d.tar.gz
core-5ff29e7a9302c51ca5a41d398ee247141bcde11d.zip
Replace List with std::list< ImplBmpObj* >
bool should be set to "false" & "true" not the sal_ versions of them. Special thanks go to Matúš Kukan for compiling and help fixing the patch.
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/salbmp.h6
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx59
2 files changed, 40 insertions, 25 deletions
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h
index 42230d8bbde7..0fa69ae5a72f 100644
--- a/vcl/inc/unx/salbmp.h
+++ b/vcl/inc/unx/salbmp.h
@@ -36,6 +36,7 @@
#include <unx/saldisp.hxx>
#include <salbmp.hxx>
#include <vclpluginapi.h>
+#include <list>
struct BitmapBuffer;
class BitmapPalette;
@@ -246,11 +247,14 @@ public:
// - ImplSalBitmapCache -
// ----------------------
+struct ImplBmpObj;
+
class ImplSalBitmapCache
{
private:
+ typedef ::std::list< ImplBmpObj* > BmpList_impl;
- List maBmpList;
+ BmpList_impl maBmpList;
sal_uIntPtr mnTotalSize;
public:
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 0b9e69abb940..22a5d1eddb26 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -826,14 +826,14 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
bool X11SalBitmap::Create( const SalBitmap&, SalGraphics* )
{
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------------
bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 )
{
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------------
@@ -1100,7 +1100,7 @@ ImplSalDDB::~ImplSalDDB()
bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const
{
- bool bRet = sal_False;
+ bool bRet = false;
if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen)
{
@@ -1113,7 +1113,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe
)
{
// absolutely indentically
- bRet = sal_True;
+ bRet = true;
}
else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth
&& rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight
@@ -1125,7 +1125,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe
&& ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight )
)
{
- bRet = sal_True;
+ bRet = true;
}
}
@@ -1209,12 +1209,18 @@ ImplSalBitmapCache::~ImplSalBitmapCache()
void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags )
{
- ImplBmpObj* pObj;
- bool bFound = sal_False;
-
- for( pObj = (ImplBmpObj*) maBmpList.Last(); pObj && !bFound; pObj = (ImplBmpObj*) maBmpList.Prev() )
+ ImplBmpObj* pObj = NULL;
+ bool bFound = false;
+
+ for(
+ BmpList_impl::iterator it = maBmpList.begin();
+ (it != maBmpList.end() ) && !bFound ;
+ ++it
+ ) {
+ pObj = *it;
if( pObj->mpBmp == pBmp )
- bFound = sal_True;
+ bFound = true;
+ }
mnTotalSize += nMemSize;
@@ -1224,21 +1230,24 @@ void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uL
pObj->mnMemSize = nMemSize, pObj->mnFlags = nFlags;
}
else
- maBmpList.Insert( new ImplBmpObj( pBmp, nMemSize, nFlags ), LIST_APPEND );
+ maBmpList.push_back( new ImplBmpObj( pBmp, nMemSize, nFlags ) );
}
// -----------------------------------------------------------------------------
void ImplSalBitmapCache::ImplRemove( X11SalBitmap* pBmp )
{
- for( ImplBmpObj* pObj = (ImplBmpObj*) maBmpList.Last(); pObj; pObj = (ImplBmpObj*) maBmpList.Prev() )
- {
- if( pObj->mpBmp == pBmp )
+ for(
+ BmpList_impl::iterator it = maBmpList.begin();
+ it != maBmpList.end();
+ ++it
+ ) {
+ if( (*it)->mpBmp == pBmp )
{
- maBmpList.Remove( pObj );
- pObj->mpBmp->ImplRemovedFromCache();
- mnTotalSize -= pObj->mnMemSize;
- delete pObj;
+ (*it)->mpBmp->ImplRemovedFromCache();
+ mnTotalSize -= (*it)->mnMemSize;
+ delete *it;
+ maBmpList.erase( it );
break;
}
}
@@ -1248,13 +1257,15 @@ void ImplSalBitmapCache::ImplRemove( X11SalBitmap* pBmp )
void ImplSalBitmapCache::ImplClear()
{
- for( ImplBmpObj* pObj = (ImplBmpObj*) maBmpList.First(); pObj; pObj = (ImplBmpObj*) maBmpList.Next() )
- {
- pObj->mpBmp->ImplRemovedFromCache();
- delete pObj;
+ for(
+ BmpList_impl::iterator it = maBmpList.begin();
+ it != maBmpList.end();
+ ++it
+ ) {
+ (*it)->mpBmp->ImplRemovedFromCache();
+ delete *it;
}
-
- maBmpList.Clear();
+ maBmpList.clear();
mnTotalSize = 0;
}