Commits

Anonymous committed c026f0a

CWS-TOOLING: integrate CWS bmpsum1

Comments (0)

Files changed (4)

svtools/bmpmaker/bmpgui.cxx

-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: bmpgui.cxx,v $
- * $Revision: 1.17 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svtools.hxx"
-
-#include <stdio.h>
-#include <signal.h>
-
-#include <sal/main.h>
-
-#include <vcl/svapp.hxx>
-#include <vcl/window.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/menu.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/group.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/virdev.hxx>
-#include <vcl/bmpacc.hxx>
-#include <tools/config.hxx>
-
-#include "svtools/solar.hrc"
-#include "filedlg.hxx"
-#include "bmpcore.hxx"
-#include "bmp.hrc"
-
-// -----------
-// - statics -
-// -----------
-
-static LangInfo aLangEntries[] =
-{
-    { "deut", 49 },
-    { "enus", 1 },
-    { "fren", 33 },
-    { "ital", 39 },
-    { "dtch", 31 },
-    { "span", 34 },
-    { "hung", 36 },
-    { "estonian", 77},
-    { "dan", 45 },
-    { "swed", 46 },
-    { "port", 03 },
-    { "japn", 81 },
-    { "chinsim", 86  },
-    { "chintrad", 88 },
-    { "hebrew", 97 },
-    { "russ", 07 },
-    { "pol", 48 },
-    { "arab",96 },
-    { "greek", 30 },
-    { "catalan", 37},
-    { "korean", 82 },
-    { "turk", 90 },
-    { "slovenian", 50 }
-};
-
-// ----------
-// - BmpApp -
-// ----------
-
-class BmpWin;
-
-static ResMgr* pAppResMgr = NULL;
-
-class BmpApp : public Application
-{
-private:
-
-	BmpWin* pBmpWin;
-	String	aOutputFileName;
-	BYTE	cExitCode;
-
-			DECL_LINK( Select, Menu* pMenu );
-
-public:
-
-	void	Main();
-	void	SetExitCode( BYTE cExit )
-			{
-				if( ( EXIT_NOERROR == cExitCode ) || ( cExit != EXIT_NOERROR ) )
-					cExitCode = cExit;
-			}
-};
-
-// -----------------------------------------------------------------------
-
-BmpApp aBmpApp;
-
-// ----------
-// - Pathes -
-// ----------
-
-class Pathes : public ModalDialog
-{
-	OKButton		aBtnOk;
-	CancelButton	aBtnCancel;
-	GroupBox		aGrpPath;
-	FixedText		aFtSrs;
-	FixedText		aFtRes;
-	FixedText		aFtOut;
-	Edit			aEdtSrs;
-	PushButton		aBtnSrs;
-	Edit			aEdtRes;
-	PushButton		aBtnRes;
-	Edit			aEdtOut;
-	PushButton		aBtnOut;
-	GroupBox		aGrpLang;
-	ListBox			aLbLang;
-
-	DECL_LINK( ClickSrsHdl, void* );
-	DECL_LINK( ClickResHdl, void* );
-	DECL_LINK( ClickOutHdl, void* );
-
-
-public:
-
-			Pathes( Window* pParent,
-					const String& rSrsPath,
-					const String& rResPath,
-					const String& rOutPath,
-					const USHORT nLang );
-
-	String	GetSrsPath() const { return aEdtSrs.GetText(); }
-	String	GetResPath() const { return aEdtRes.GetText(); }
-	String	GetOutPath() const { return aEdtOut.GetText(); }
-
-	USHORT	GetLangNum() const { return aLbLang.GetSelectEntryPos(); }
-};
-
-// -----------------------------------------------------------------------------
-
-Pathes::Pathes( Window* pParent,
-				const String& rSrsPath,
-				const String& rResPath,
-				const String& rOutPath,
-				const USHORT nLang ) :
-			ModalDialog	( pParent, ResId( DLG_PATH, *pAppResMgr ) ),
-			aBtnOk		( this, ResId( BTN_OK, *pAppResMgr ) ),
-			aBtnCancel	( this, ResId( BTN_CANCEL, *pAppResMgr ) ),
-			aGrpPath	( this, ResId( GRP_PATH, *pAppResMgr ) ),
-			aFtSrs		( this, ResId( FT_SRS, *pAppResMgr ) ),
-			aFtRes		( this, ResId( FT_RES, *pAppResMgr ) ),
-			aFtOut		( this, ResId( FT_OUT, *pAppResMgr ) ),
-			aEdtSrs		( this, ResId( EDT_SRS, *pAppResMgr ) ),
-			aBtnSrs		( this, ResId( BTN_SRS, *pAppResMgr ) ),
-			aEdtRes		( this, ResId( EDT_RES, *pAppResMgr ) ),
-			aBtnRes		( this, ResId( BTN_RES, *pAppResMgr ) ),
-			aEdtOut		( this, ResId( EDT_OUT, *pAppResMgr ) ),
-			aBtnOut		( this, ResId( BTN_OUT, *pAppResMgr ) ),
-			aGrpLang	( this, ResId( GRP_LANG, *pAppResMgr ) ),
-			aLbLang		( this, ResId( LB_LANG, *pAppResMgr ) )
-{
-	FreeResource();
-
-	aBtnSrs.SetClickHdl( LINK( this, Pathes, ClickSrsHdl ) );
-	aBtnRes.SetClickHdl( LINK( this, Pathes, ClickResHdl ) );
-	aBtnOut.SetClickHdl( LINK( this, Pathes, ClickOutHdl ) );
-
-	aEdtSrs.SetText( rSrsPath );
-	aEdtRes.SetText( rResPath );
-	aEdtOut.SetText( rOutPath );
-	aEdtSrs.GrabFocus();
-
-	aLbLang.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( "all" ) ), 0 );
-	for( USHORT i = 1, nCount = ( sizeof( aLangEntries ) / sizeof( aLangEntries[ 0 ] ) ); i <= nCount; i++ )
-		aLbLang.InsertEntry( String::CreateFromInt32( aLangEntries[ i - 1 ].mnLangNum ), i );
-
-	aLbLang.SelectEntryPos( nLang );
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( Pathes, ClickSrsHdl, void*, EMPTYARG )
-{
-	FileDialog	aFileDlg( this, WB_OPEN | WB_3DLOOK );
-	DirEntry	aPath( aEdtSrs.GetText() );
-
-	aFileDlg.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "SRS-Datei mit Imagelisten laden" ) ) );
-	aPath += DirEntry( String( RTL_CONSTASCII_USTRINGPARAM( "*.srs" ) ) );
-	aFileDlg.SetPath( aPath.GetFull() );
-	if ( aFileDlg.Execute() == RET_OK )
-		aEdtSrs.SetText( aFileDlg.GetPath() );
-
-	return 0L;
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( Pathes, ClickResHdl, void*, EMPTYARG )
-{
-	PathDialog aPathDlg( this, WB_OPEN | WB_3DLOOK );
-
-	aPathDlg.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Quellpfad BMP-Dateien" ) ) );
-	if ( aPathDlg.Execute() == RET_OK )
-		aEdtRes.SetText( aPathDlg.GetPath() );
-
-	return 0L;
-}
-
-// -----------------------------------------------------------------------------
-
-IMPL_LINK( Pathes, ClickOutHdl, void*, EMPTYARG )
-{
-	PathDialog aPathDlg( this, WB_OPEN | WB_3DLOOK );
-
-	aPathDlg.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Zielpfad BMP-Dateien" ) ) );
-	if ( aPathDlg.Execute() == RET_OK )
-		aEdtOut.SetText( aPathDlg.GetPath() );
-
-	return 0L;
-}
-
-// ----------
-// - BmpWin -
-// ----------
-
-class BmpWin : public WorkWindow, public BmpCreator
-{
-private:
-
-	ListBox			aLB;
-    USHORT          nPos;
-
-protected:
-    
-    virtual void    Message( const String& rText, BYTE cExitCode = EXIT_NOERROR );
-
-public:
-
-					BmpWin();
-
-	void			Resize();
-	void			SetMode( BOOL bMode ) { aLB.SetUpdateMode( bMode ); }
-	void			ClearInfo();
-};
-
-// -----------------------------------------------------------------------------
-
-BmpWin::BmpWin() :
-	WorkWindow( NULL, WB_APP | WB_STDWORK ),
-	aLB( this, WB_HSCROLL | WB_VSCROLL ),
-	nPos( 0 )
-{
-	SetText( String( RTL_CONSTASCII_USTRINGPARAM( "SVX - BmpMaker" ) ) );
-	aLB.SetUpdateMode( TRUE );
-	aLB.Show();
-}
-
-// -----------------------------------------------------------------------
-
-void BmpWin::Resize()
-{
-	aLB.SetPosSizePixel( Point(), GetOutputSizePixel() );
-}
-
-// -----------------------------------------------------------------------
-
-void BmpWin::Message( const String& rText, BYTE cExitCode )
-{
-	aLB.InsertEntry( rText, nPos );
-	aLB.SelectEntryPos( nPos++ );
-
-	if( EXIT_NOERROR != cExitCode )
-		aBmpApp.SetExitCode( cExitCode );
-
-	ByteString aText( rText, RTL_TEXTENCODING_UTF8 );
-#ifdef UNX
-	aText.Append( "\r\n" );
-#else
-	aText.Append( "\n" );
-#endif
-	fprintf( stderr, aText.GetBuffer() );
-}
-
-// -----------------------------------------------------------------------
-
-void BmpWin::ClearInfo()
-{
-	aLB.Clear();
-	Invalidate();
-	nPos = 0;
-}
-
-// ----------
-// - BmpApp -
-// ----------
-
-void BmpApp::Main( )
-{
-	// Param1: filename of *.srs input file with image lists
-	// Param2: path to local bitmaps
-	// Param3: output directory
-	// Param4: Langugage dependent directory
-
-	pAppResMgr = ResMgr::CreateResMgr( "bmp" );
-	MenuBar*    pMB = new MenuBar();
-	PopupMenu*  pPB = new PopupMenu();
-	String	    aLangDir;
-	String	    aOutName;
-
-	cExitCode = EXIT_NOERROR;
-
-	pMB->InsertItem( 1, String( RTL_CONSTASCII_USTRINGPARAM( "~ImageList" ) ) );
-		pPB->InsertItem( 1, String( RTL_CONSTASCII_USTRINGPARAM( "~Erstellen..." ) ) );
-		pPB->InsertSeparator();
-		pPB->InsertItem( 2, String( RTL_CONSTASCII_USTRINGPARAM( "~Beenden" ) ) );
-
-	pMB->SetPopupMenu( 1, pPB );
-	pMB->SetSelectHdl( LINK( this, BmpApp, Select ) );
-
-	pBmpWin = new BmpWin;
-	pBmpWin->SetMenuBar( pMB );
-	pBmpWin->Show();
-
-	Execute();
-	
-    delete pPB;
-	delete pMB;
-	delete pBmpWin;
-	
-	delete pAppResMgr;
-    pAppResMgr = NULL;
-
-	if( ( EXIT_NOERROR == cExitCode ) && aOutputFileName.Len() && aOutName.Len() )
-	{
-		SvFileStream	aOStm( aOutputFileName, STREAM_WRITE | STREAM_TRUNC );
-		ByteString		aStr( "Successfully generated ImageList(s) in: " );
-
-		aOStm.WriteLine( aStr.Append( ByteString( aOutName, RTL_TEXTENCODING_UTF8 ) ) );
-		aOStm.Close();
-	}
-
-	if( EXIT_NOERROR != cExitCode )
-		raise( SIGABRT );
-	
-    return;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( BmpApp, Select, Menu*, pMenu )
-{
-	if ( pMenu->GetCurItemId() == 1 )
-	{
-		Config	aCfg;
-		aCfg.SetGroup( "Path-Entries" );
-
-		String	aSrsPath( String::CreateFromAscii( aCfg.ReadKey( "SRS", ByteString() ).GetBuffer() ) );
-		String	aResPath( String::CreateFromAscii( aCfg.ReadKey( "RES", ByteString() ).GetBuffer() ) );
-		String	aOutPath( String::CreateFromAscii( aCfg.ReadKey( "OUT", ByteString() ).GetBuffer() ) );
-		USHORT	nLanguage = (USHORT) aCfg.ReadKey( "LNG", '1' ).ToInt32();
-		Pathes	aPathDlg( pBmpWin, aSrsPath, aResPath, aOutPath, nLanguage );
-
-		if ( aPathDlg.Execute() == RET_OK )
-		{
-		    ::std::vector< String > aInDirs;
-		
-			aCfg.WriteKey( "SRS", ByteString( aSrsPath = String( aPathDlg.GetSrsPath() ), RTL_TEXTENCODING_UTF8 ) );
-			aCfg.WriteKey( "RES", ByteString( aResPath = String( aPathDlg.GetResPath() ), RTL_TEXTENCODING_UTF8 ) );
-			aCfg.WriteKey( "OUT", ByteString( aOutPath = String( aPathDlg.GetOutPath() ), RTL_TEXTENCODING_UTF8 ) );
-			aCfg.WriteKey( "LNG", ByteString::CreateFromInt32( nLanguage = aPathDlg.GetLangNum() ) );
-
-			pBmpWin->ClearInfo();
-			
-			aInDirs.push_back( aResPath );
-			
-			if( getenv( "SOLARSRC" ) )
-			    aInDirs.push_back( ::rtl::OUString::createFromAscii( getenv( "SOLARSRC" ) ) );
-
-			if( !nLanguage )
-			{
-				for ( USHORT i = 0, nCount = ( sizeof( aLangEntries ) / sizeof( aLangEntries[ 0 ] ) ); i < nCount; i++ )
-					pBmpWin->Create( aSrsPath, aInDirs, aOutPath, aLangEntries[ i ] );
-			}
-			else
-				pBmpWin->Create( aSrsPath, aInDirs, aOutPath, aLangEntries[ nLanguage - 1 ] );
-		}
-	}
-	else if( pMenu->GetCurItemId() == 2 )
-		Quit();
-
-	return 0;
-}
-
-BOOL SVMain();
-
-SAL_IMPLEMENT_MAIN()
-{
-	SVMain();
-	return 0;
-}

svtools/bmpmaker/bmpsum.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: bmpsum.cxx,v $
- * $Revision: 1.13 $
+ * $Revision: 1.13.150.1 $
  *
  * This file is part of OpenOffice.org.
  *
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_svtools.hxx"
 
-#include <stdio.h>
-#include <signal.h>
+#include <cstdio>
+#include <csignal>
 #include <vector>
 #include <set>
 #include <map>
 #include <vcl/pngread.hxx>
 
 #include "svtools/solar.hrc"
-#include "filedlg.hxx"
 
 #define EXIT_NOERROR        0x00000000
 #define EXIT_INVALIDFILE    0x00000001
 private:
 
 	sal_uInt32      cExitCode;
-                    
+
 	BOOL	        GetCommandOption( const ::std::vector< String >& rArgs, const String& rSwitch, String& rSwitchParam );
 	BOOL	        GetCommandOptions( const ::std::vector< String >& rArgs, const String& rSwitch, ::std::vector< String >& rSwitchParams );
 
 			        }
     void            ShowUsage();
     void            Message( const String& rText, BYTE cExitCode );
-    
-    sal_uInt64      GetCRC( Bitmap& rBmp );
-    
+
+    sal_uInt64      GetCRC( const BitmapEx& rBmpEx );
+
     void            ProcessFile( const String& rBmpFileName );
     void            ProcessFileList( const String& rInFileList, const String& rOutFileList, const String& rOutPath );
 
 public:
-
+//
                     BmpSum();
                     ~BmpSum();
 
 					rParams.push_back( rArgs[ i + 1 ] );
 				else
 					rParams.push_back( String() );
-			
+
 			    break;
 			}
 
 // -----------------------------------------------------------------------------
 
 void BmpSum::ShowUsage()
-{   
+{
     Message( String( RTL_CONSTASCII_USTRINGPARAM( "Usage:" ) ), EXIT_NOERROR );
     Message( String( RTL_CONSTASCII_USTRINGPARAM( "    bmpsum bmp_inputfile" ) ), EXIT_NOERROR );
     Message( String( RTL_CONSTASCII_USTRINGPARAM( "    bmpsum -i input_filelist -o output_filelist [-p path_for_copied_bitmaps]" ) ), EXIT_NOERROR );
 	if( rArgs.size() >= 1 )
 	{
 	    String  aInFileList, aOutFileList, aOutPath;
-   
-	    if( GetCommandOption( rArgs, 'i', aInFileList ) && 
+
+	    if( GetCommandOption( rArgs, 'i', aInFileList ) &&
 	        GetCommandOption( rArgs, 'o', aOutFileList ) )
 	    {
             GetCommandOption( rArgs, 'p', aOutPath );
         ShowUsage();
         cExitCode = EXIT_COMMONERROR;
     }
-	
+
     return cExitCode;
 }
 
 // -----------------------------------------------------------------------------
 
-sal_uInt64 BmpSum::GetCRC( Bitmap& rBmp )
+sal_uInt64 BmpSum::GetCRC( const BitmapEx& rBmpEx )
 {
-    BitmapReadAccess* pRAcc = rBmp.AcquireReadAccess();
-	sal_uInt64        nRet = 0; 
-    sal_uInt32	      nCrc = 0;
+    Bitmap              aBmp( rBmpEx.GetBitmap() );
+    BitmapReadAccess*   pRAcc = aBmp.AcquireReadAccess();
+    AlphaMask           aAlpha;
+    BitmapReadAccess*   pAAcc = NULL;
+    sal_uInt64          nRet = 0;
+    sal_uInt32          nCrc = 0;
+
+    if( rBmpEx.IsTransparent() )
+    {
+        aAlpha = rBmpEx.GetAlpha();
+        pAAcc = aAlpha.AcquireReadAccess();
+    }
 
 	if( pRAcc && pRAcc->Width() && pRAcc->Height() )
 	{
 
         		UInt32ToSVBT32( aCol.GetBlue(), aBT32 );
 		        nCrc = rtl_crc32( nCrc, aBT32, 4 );
+
+                if( pAAcc )
+                {
+                    const BitmapColor aMaskCol( pAAcc->GetColor( nY, nX ) );
+
+                    UInt32ToSVBT32( aMaskCol.GetRed(), aBT32 );
+                    nCrc = rtl_crc32( nCrc, aBT32, 4 );
+
+                    UInt32ToSVBT32( aMaskCol.GetGreen(), aBT32 );
+                    nCrc = rtl_crc32( nCrc, aBT32, 4 );
+
+                    UInt32ToSVBT32( aMaskCol.GetBlue(), aBT32 );
+                    nCrc = rtl_crc32( nCrc, aBT32, 4 );
+                }
     		}
 		}
-		
-		nRet = ( ( (sal_uInt64) pRAcc->Width() ) << 48 ) | 
+
+		nRet = ( ( (sal_uInt64) pRAcc->Width() ) << 48 ) |
 		       ( ( (sal_uInt64) pRAcc->Height() ) << 32 ) |
 		       ( (sal_uInt64) nCrc );
 	}
-	
-    rBmp.ReleaseAccess( pRAcc );
-    
+
+    if( pAAcc )
+        aAlpha.ReleaseAccess( pAAcc);
+
+    aBmp.ReleaseAccess( pRAcc );
+
     return nRet;
 }
 
 
     if( aIStm.IsOpen() )
     {
-        Bitmap aBmp;
-    	
-	    aIStm >> aBmp;
-        
-	    if( !aBmp.IsEmpty() )
+        BitmapEx aBmpEx;
+
+	    aIStm >> aBmpEx;
+
+	    if( !aBmpEx.IsEmpty() )
 	    {
-	        fprintf( stdout, "%" SAL_PRIuUINT64 "\r\n", GetCRC( aBmp ) );
-        }        
+            fprintf( stdout, "%" SAL_PRIuUINT64 "\r\n", GetCRC( aBmpEx ) );
+        }
 	    else
         {
             aIStm.ResetError();
             aIStm.Seek( 0 );
-            
+
        		::vcl::PNGReader aPngReader( aIStm );
-            
-            aBmp = aPngReader.Read().GetBitmap();
 
-      	    if( !aBmp.IsEmpty() )
+            aBmpEx = aPngReader.Read();
+
+      	    if( !aBmpEx.IsEmpty() )
             {
-    	        fprintf( stdout, "%" SAL_PRIuUINT64 "\r\n", GetCRC( aBmp ) );
-            }        
+    	        fprintf( stdout, "%" SAL_PRIuUINT64 "\r\n", GetCRC( aBmpEx ) );
+            }
             else
                 Message( String( RTL_CONSTASCII_USTRINGPARAM( "file not valid" ) ), EXIT_INVALIDFILE );
         }
 
 // -----------------------------------------------------------------------------
 
-void BmpSum::ProcessFileList( const String& rInFileList, 
-                              const String& rOutFileList, 
+void BmpSum::ProcessFileList( const String& rInFileList,
+                              const String& rOutFileList,
                               const String& rOutPath )
 {
     SvFileStream    aIStm( rInFileList, STREAM_READ );
     {
         ByteString                  aReadLine;
         ::std::set< ByteString >    aFileNameSet;
-        
+
         while( aIStm.ReadLine( aReadLine ) )
         {
             if( aReadLine.Len() )
                 aFileNameSet.insert( aReadLine );
-                
+
             if( aReadLine.Search( "enus" ) != STRING_NOTFOUND )
             {
-                static const char* aLanguages[] = 
+                static const char* aLanguages[] =
                 {
                     "chinsim",
                     "chintrad",
                     "span",
                     "turk"
                 };
-                
+
                 for( sal_uInt32 n = 0; n < 14; ++n )
                 {
                     ByteString aLangPath( aReadLine );
-                    
+
                     aLangPath.SearchAndReplace( "enus", aLanguages[ n ] );
-                    
+
                     DirEntry aTestFile( aLangPath );
-                    
+
                     if( aTestFile.Exists() )
                         aFileNameSet.insert( aLangPath );
                 }
             }
-            
+
             aReadLine.Erase();
         }
-        
+
         aIStm.Close();
-        
+
         ::std::set< ByteString >::iterator aIter( aFileNameSet.begin() );
         ::std::map< sal_uInt64, ::std::vector< ByteString > > aFileNameMap;
-        
+
         while( aIter != aFileNameSet.end() )
         {
             ByteString      aStr( *aIter++ );
 
             if( aBmpStm.IsOpen() )
             {
-                Bitmap aBmp;
-            	
-	            aBmpStm >> aBmp;
-                
-	            if( !aBmp.IsEmpty() )
-	                nCRC = GetCRC( aBmp );
+                BitmapEx aBmpEx;
+
+	            aBmpStm >> aBmpEx;
+
+	            if( !aBmpEx.IsEmpty() )
+	                nCRC = GetCRC( aBmpEx );
                 else
                 {
                     aBmpStm.ResetError();
                     aBmpStm.Seek( 0 );
-            
+
                		::vcl::PNGReader aPngReader( aBmpStm );
-            
-                    aBmp = aPngReader.Read().GetBitmap();
 
-              	    if( !aBmp.IsEmpty() )
-       	                nCRC = GetCRC( aBmp );
- 
+                    aBmpEx = aPngReader.Read();
+
+              	    if( !aBmpEx.IsEmpty() )
+       	                nCRC = GetCRC( aBmpEx );
+
                     else
                         fprintf( stderr, "%s could not be opened\n", aStr.GetBuffer() );
                }
-                
+
                 aBmpStm.Close();
             }
-            
+
             if( nCRC )
             {
                 ::std::map< sal_uInt64, ::std::vector< ByteString > >::iterator aFound( aFileNameMap.find( nCRC ) );
-           
+
                 if( aFound != aFileNameMap.end() )
                     (*aFound).second.push_back( aStr );
                 else
                     ::std::vector< ByteString > aVector( 1, aStr );
                     aFileNameMap[ nCRC ]  = aVector;
                 }
-                    
+
             }
             else
             {
                 aFileNameMap[ nCRC ]  = aVector;
             }
         }
-        
+
         ::std::map< sal_uInt64, ::std::vector< ByteString > >::iterator aMapIter( aFileNameMap.begin() );
         sal_uInt32 nFileCount = 0;
-        
+
         while( aMapIter != aFileNameMap.end() )
         {
             ::std::pair< const sal_uInt64, ::std::vector< ByteString > > aPair( *aMapIter++ );
             ::std::vector< ByteString > aFileNameVector( aPair.second );
-           
+
             // write new entries
             for( sal_uInt32 i = 0; i < aFileNameVector.size(); ++i )
             {
                 ByteString  aStr( ByteString::CreateFromInt64( aPair.first ) );
                 ByteString  aFileName( aFileNameVector[ i ] );
                 DirEntry    aSrcFile( aFileName );
-                
+
                 aStr += '\t';
                 aStr += aFileName;
-                
+
                 aOStm.WriteLine( aStr );
 
                 // copy bitmap
                 {
                     if( aFileName.Search( ":\\" ) != STRING_NOTFOUND )
                         aFileName.Erase( 0, aFileName.Search( ":\\" ) + 2 );
-                
+
                     aFileName.SearchAndReplaceAll( '\\', '/' );
-                
+
                     sal_uInt16  nTokenCount = aFileName.GetTokenCount( '/' );
                     DirEntry    aNewDir( aBaseDir );
-                    
+
                     for( sal_uInt16 n = 0; ( n < nTokenCount - 1 ); n++ )
                     {
                         aNewDir += DirEntry( aFileName.GetToken( n, '/' ) );
                     aSrcFile.CopyTo( aNewDir, FSYS_ACTION_COPYFILE );
                 }
             }
-            
+
             ++nFileCount;
         }
-        
+
         fprintf(
             stdout, "unique file count: %lu",
             sal::static_int_cast< unsigned long >(nFileCount) );
 
 int main( int nArgCount, char* ppArgs[] )
 {
+#ifdef UNX
+    static char aDisplayVar[ 1024 ];
+
+    strcpy( aDisplayVar, "DISPLAY=" );
+    putenv( aDisplayVar );
+#endif
+
     ::std::vector< String > aArgs;
     BmpSum                  aBmpSum;
 
 
     for( int i = 1; i < nArgCount; i++ )
         aArgs.push_back( String( ppArgs[ i ], RTL_TEXTENCODING_ASCII_US ) );
-    
+
     return aBmpSum.Start( aArgs );
 }

svtools/bmpmaker/makefile.mk

 # --- Files --------------------------------------------------------
 
 OBJFILES=   $(OBJ)$/bmp.obj			\
-			$(OBJ)$/bmpgui.obj		\
 			$(OBJ)$/bmpcore.obj		\
 			$(OBJ)$/g2g.obj			\
 			$(OBJ)$/bmpsum.obj
 
-SRC1FILES=bmp.src
-SRS1NAME=bmp
-RES1TARGET=bmp
-SRS1FILES=$(SRS)$/bmp.srs
-
 # --- APP1TARGET ---------------------------------------------------
 
 APP1TARGET= $(TARGET)

svtools/util/makefile.mk

 DEFLIB2NAME=svl
 DEF2DES =SvTools lite
 
-# --- bmpgui application --------------------------------------------------
-
-APP1TARGET	=	bmpgui
-APP1BASE	=	0x10000000
-APP1DEPN	=   $(SHL1TARGETN) $(SHL2TARGETN)
-APP1OBJS	=   $(OBJ)$/bmpgui.obj	\
-				$(OBJ)$/bmpcore.obj
-
-.IF "$(GUI)"!="UNX"
-APP1STDLIBS+= $(SVTOOLLIB)
-.ELSE
-APP1STDLIBS+= -lsvt$(DLLPOSTFIX)
-APP1STDLIBS+= -lsvl$(DLLPOSTFIX)
-.ENDIF # UNX
-
-APP1STDLIBS+=	\
-				$(VCLLIB)		\
-				$(TOOLSLIB)		\
-				$(VOSLIB) 		\
-				$(SALLIB)
-
 # --- g2g application --------------------------------------------------
 
 APP2TARGET	=	g2g