Kaydet (Commit) e6cf9b3b authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS oointroaboutbrand (1.30.40); FILE MERGED

2007/05/25 11:26:17 cd 1.30.40.3: RESYNC: (1.30-1.31); FILE MERGED
2007/03/27 10:45:27 cd 1.30.40.2: i66426# Don't use resource system to retrieve intro/about bitmap
2007/03/26 11:35:01 cd 1.30.40.1: i66426# Use more flexibel way to detect and use intro/about bitmaps
üst 9e0086b3
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: about.cxx,v $ * $RCSfile: about.cxx,v $
* *
* $Revision: 1.31 $ * $Revision: 1.32 $
* *
* last change: $Author: rt $ $Date: 2007-04-26 10:09:37 $ * last change: $Author: obo $ $Date: 2007-06-11 14:01:47 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "precompiled_sfx2.hxx" #include "precompiled_sfx2.hxx"
// include --------------------------------------------------------------- // include ---------------------------------------------------------------
#include <aboutbmpnames.hxx>
#ifndef _SV_APP_HXX #ifndef _SV_APP_HXX
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
...@@ -93,6 +94,21 @@ static void layoutText( FixedInfo &rText, long &nY, long nTextWidth, Size a6Size ...@@ -93,6 +94,21 @@ static void layoutText( FixedInfo &rText, long &nY, long nTextWidth, Size a6Size
nY += aTxtSiz.Height(); nY += aTxtSiz.Height();
} }
static bool impl_loadBitmap( const rtl::OUString &rBmpFileName, Image &rLogo )
{
INetURLObject aObj( SvtPathOptions().GetModulePath(), INET_PROT_FILE );
aObj.insertName( rBmpFileName );
SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
if ( !aStrm.GetError() )
{
Bitmap aBmp;
aStrm >> aBmp;
rLogo = Image( aBmp );
return true;
}
return false;
}
AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerStr ) : AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerStr ) :
SfxModalDialog ( pParent, rId ), SfxModalDialog ( pParent, rId ),
...@@ -130,20 +146,18 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS ...@@ -130,20 +146,18 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
} }
// load image from module path // load image from module path
String aBmpFileName( DEFINE_CONST_UNICODE("about.bmp") ); rtl::OUString aAbouts( RTL_CONSTASCII_USTRINGPARAM( ABOUT_BITMAP_STRINGLIST ) );
INetURLObject aObj( SvtPathOptions().GetModulePath(), INET_PROT_FILE ); bool bLoaded = false;
aObj.insertName( aBmpFileName ); sal_Int32 nIndex = 0;
SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); do
if ( !aStrm.GetError() )
{ {
Bitmap aBmp; bLoaded = impl_loadBitmap( aAbouts.getToken( 0, ',', nIndex ), aAppLogo );
aStrm >> aBmp;
aAppLogo = Image( aBmp );
}
else
{
aAppLogo = Image( Bitmap( ResId( RID_DEFAULT_ABOUT_BMP_LOGO, *rId.GetResMgr() ) ) );
} }
while ( !bLoaded && ( nIndex >= 0 ) );
// fallback to "about.bmp"
if ( !bLoaded )
bLoaded = impl_loadBitmap( rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
// Transparenter Font // Transparenter Font
Font aFont = GetFont(); Font aFont = GetFont();
......
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