Kaydet (Commit) 7fd1ed86 authored tarafından Michael Meeks's avatar Michael Meeks

vcl: add BitmapEx load from icon theme constructor.

Change-Id: I3dbad69664b7417928a6be10ac561307dd94f67b
üst 72e901c1
......@@ -46,6 +46,7 @@ public:
BitmapEx();
BitmapEx( const ResId& rResId );
BitmapEx( const OUString& rIconName );
BitmapEx( const BitmapEx& rBitmapEx );
BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize );
BitmapEx( const Bitmap& rBmp );
......@@ -460,6 +461,7 @@ public:
private:
friend class ImpGraphic;
friend bool VCL_DLLPUBLIC WriteDIBBitmapEx(const BitmapEx& rSource, SvStream& rOStm);
void loadFromIconTheme( const OUString& rIconName );
Bitmap aBitmap;
Bitmap aMask;
......
......@@ -85,11 +85,15 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) :
CopyPixel( aDestRect, aSrcRect, &rBitmapEx );
}
BitmapEx::BitmapEx( const OUString& rIconName )
{
loadFromIconTheme( rIconName );
}
BitmapEx::BitmapEx( const ResId& rResId ) :
eTransparent( TRANSPARENT_NONE ),
bAlpha ( false )
{
static ImplImageTreeSingletonRef aImageTree;
ResMgr* pResMgr = NULL;
ResMgr::GetResourceSkipHeader( rResId.SetRT( RSC_BITMAP ), &pResMgr );
......@@ -97,13 +101,20 @@ BitmapEx::BitmapEx( const ResId& rResId ) :
pResMgr->ReadLong();
const OUString aFileName( pResMgr->ReadString() );
loadFromIconTheme( aFileName );
}
void BitmapEx::loadFromIconTheme( const OUString& rIconName )
{
static ImplImageTreeSingletonRef aImageTree;
OUString aIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme();
if( !aImageTree->loadImage( aFileName, aIconTheme, *this, true ) )
if( !aImageTree->loadImage( rIconName, aIconTheme, *this, true ) )
{
#ifdef DBG_UTIL
OStringBuffer aErrorStr(
"BitmapEx::BitmapEx( const ResId& rResId ): could not load image <");
"BitmapEx::BitmapEx(): could not load image <");
aErrorStr.append(OUStringToOString(aFileName, RTL_TEXTENCODING_ASCII_US)).append("> via icon theme ");
aErrorStr.append(OUStringToOString(aIconTheme, RTL_TEXTENCODING_ASCII_US)).append('.');
OSL_FAIL(aErrorStr.getStr());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment