2001-05-08 05:56:39 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 04:00:34 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-05-08 05:56:39 -05:00
|
|
|
*
|
2008-04-11 04:00:34 -05:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2001-05-08 05:56:39 -05:00
|
|
|
*
|
2008-04-11 04:00:34 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-05-08 05:56:39 -05:00
|
|
|
*
|
2008-04-11 04:00:34 -05:00
|
|
|
* $RCSfile: fontentry.cxx,v $
|
|
|
|
* $Revision: 1.17 $
|
2001-05-08 05:56:39 -05:00
|
|
|
*
|
2008-04-11 04:00:34 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-05-08 05:56:39 -05:00
|
|
|
*
|
2008-04-11 04:00:34 -05:00
|
|
|
* 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.
|
2001-05-08 05:56:39 -05:00
|
|
|
*
|
2008-04-11 04:00:34 -05:00
|
|
|
* 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).
|
2001-05-08 05:56:39 -05:00
|
|
|
*
|
2008-04-11 04:00:34 -05:00
|
|
|
* 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.
|
2001-05-08 05:56:39 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include <vcl/msgbox.hxx>
|
2001-06-05 11:33:50 -05:00
|
|
|
#include <osl/thread.h>
|
2001-05-08 05:56:39 -05:00
|
|
|
#include <psprint/fontmanager.hxx>
|
|
|
|
|
|
|
|
#ifndef _PAD_PADIALOG_HRC_
|
|
|
|
#include <padialog.hrc>
|
|
|
|
#endif
|
|
|
|
#include <fontentry.hxx>
|
|
|
|
#include <helper.hxx>
|
2001-06-06 07:54:31 -05:00
|
|
|
#ifndef _CONFIG_HXX_
|
|
|
|
#include <tools/config.hxx>
|
|
|
|
#endif
|
2001-06-26 13:27:24 -05:00
|
|
|
#include <psprint/strhelper.hxx>
|
2001-05-08 05:56:39 -05:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
#include <convafm.hxx>
|
|
|
|
#include <progress.hxx>
|
|
|
|
#include <osl/file.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
using namespace padmin;
|
|
|
|
using namespace osl;
|
|
|
|
using namespace rtl;
|
|
|
|
using namespace psp;
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
static void CreateAfmFile( const INetURLObject& rFontFile )
|
|
|
|
{
|
|
|
|
rtl_TextEncoding aEncoding = gsl_getSystemTextEncoding();
|
|
|
|
|
|
|
|
INetURLObject aFontMap( rFontFile.GetPath(), INET_PROT_FILE, INetURLObject::ENCODE_ALL );
|
|
|
|
aFontMap.Append( String( RTL_CONSTASCII_USTRINGPARAM( "Fontmap" ) ) );
|
|
|
|
INetURLObject aAfmFile( rFontFile );
|
|
|
|
aAfmFile.setExtension( String::CreateFromAscii( "afm", 3 ) );
|
|
|
|
|
|
|
|
|
|
|
|
SvFileStream aMap( aFontMap.PathToFileName(), STREAM_WRITE | STREAM_TRUNC );
|
|
|
|
if( aMap.IsOpen() )
|
|
|
|
{
|
|
|
|
SvFileStream aRead( rFontFile.GetFull(), STREAM_READ );
|
|
|
|
ByteString aLine;
|
|
|
|
ByteString aFullName;
|
|
|
|
int nPos;
|
|
|
|
while( ! aRead.IsEof() &&
|
|
|
|
( nPos = aLine.Search( "/FullName" ) ) == STRING_NOTFOUND )
|
|
|
|
aRead.ReadLine( aLine );
|
|
|
|
aRead.Close();
|
|
|
|
if( nPos != STRING_NOTFOUND )
|
|
|
|
{
|
|
|
|
aLine.Erase( 0, nPos );
|
|
|
|
aFullName = aLine.GetToken( 1, '(' ).GetToken( 0, ')' );
|
|
|
|
|
|
|
|
aLine = '/';
|
|
|
|
aLine += aFullName;
|
|
|
|
aLine += ' ';
|
|
|
|
aLine += '(';
|
|
|
|
aLine += ByteString( rFontFile.GetName(), aEncoding );
|
|
|
|
aLine += ')';
|
|
|
|
aLine += ';';
|
|
|
|
|
|
|
|
aMap.WriteLine( aLine );
|
|
|
|
}
|
|
|
|
aMap.Close();
|
|
|
|
pid_t nPID = fork();
|
|
|
|
if( ! nPID )
|
|
|
|
{
|
|
|
|
INetURLObject aTmp( rFontFile );
|
|
|
|
aTmp.CutName();
|
|
|
|
ByteString aEnv( "GS_LIB=" );
|
|
|
|
aEnv += ByteString( aTmp.PathToFileName(), aEncoding );
|
|
|
|
putenv( const_cast<char*>(aEnv.GetBuffer()) );
|
|
|
|
|
|
|
|
int nDescr = open( ByteString( aAfmFile.PathToFileName(), aEncoding ).GetBuffer(),
|
|
|
|
O_CREAT | O_TRUNC| O_WRONLY,
|
|
|
|
00755 );
|
2003-04-15 11:21:31 -05:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2001-05-08 05:56:39 -05:00
|
|
|
if( nDescr < 0 )
|
|
|
|
fprintf( stderr, "open( %s ) failed because of %d\n", ByteString( aAfmFile.GetFull(), aEncoding ).GetBuffer(), errno );
|
|
|
|
#endif
|
|
|
|
if( dup2( nDescr, STDOUT_FILENO ) > 0 )
|
|
|
|
{
|
|
|
|
execlp( "gs",
|
|
|
|
"-q",
|
|
|
|
"-dNODISPLAY",
|
|
|
|
"--", "printafm.ps",
|
|
|
|
aFullName.GetBuffer(),
|
|
|
|
NULL );
|
|
|
|
}
|
2003-04-15 11:21:31 -05:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2001-05-08 05:56:39 -05:00
|
|
|
else
|
|
|
|
fprintf( stderr, "dup2( %d, %d ) failed because of %d\n", nDescr, STDOUT_FILENO, errno );
|
|
|
|
#endif
|
|
|
|
_exit( 0 );
|
|
|
|
}
|
|
|
|
if( nPID > 0 )
|
|
|
|
waitpid( nPID, NULL, 0 );
|
|
|
|
MetricConverter::ConvertAFM( aAfmFile );
|
|
|
|
}
|
|
|
|
|
|
|
|
struct stat aStat;
|
|
|
|
ByteString aSysFile( aAfmFile.PathToFileName(), aEncoding );
|
|
|
|
if( stat( aSysFile.GetBuffer(), &aStat ) || ! aStat.st_size )
|
|
|
|
unlink( aSysFile.GetBuffer() );
|
2003-04-15 11:21:31 -05:00
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
2001-05-08 05:56:39 -05:00
|
|
|
fprintf( stderr, " %s\n", ! access( aSysFile.GetBuffer(), F_OK ) ? "success" : "failed" );
|
|
|
|
#endif
|
|
|
|
unlink( ByteString( aFontMap.PathToFileName(), aEncoding ).GetBuffer() );
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
FontNameDlg::FontNameDlg( Window *pParent ) :
|
|
|
|
ModalDialog( pParent, PaResId( RID_FONTNAMEDIALOG ) ),
|
|
|
|
m_aOKButton( this, PaResId( RID_FNTNM_BTN_OK ) ),
|
2001-06-26 13:27:24 -05:00
|
|
|
m_aRenameButton( this, PaResId( RID_FNTNM_BTN_RENAME ) ),
|
2004-03-17 03:44:23 -06:00
|
|
|
m_aRemoveButton( this, PaResId( RID_FNTNM_BTN_REMOVE ) ),
|
2001-06-05 11:33:50 -05:00
|
|
|
m_aImportButton( this, PaResId( RID_FNTNM_BTN_IMPORT ) ),
|
2004-03-17 03:44:23 -06:00
|
|
|
m_aFontBox( this, PaResId( RID_FNTNM_LB_FONTS ) ),
|
|
|
|
m_aFixedText( this, PaResId( RID_FNTNM_FIXED ) ),
|
2001-06-26 13:27:24 -05:00
|
|
|
m_aRenameString( PaResId( RID_FNTNM_STR_RENAME ) ),
|
|
|
|
m_aRenameTTCString( PaResId( RID_FNTNM_STR_TTCRENAME ) ),
|
2001-06-27 10:03:31 -05:00
|
|
|
m_aNoRenameString( PaResId( RID_FNTNM_STR_NOTRENAMABLE ) ),
|
2001-06-05 11:33:50 -05:00
|
|
|
m_rFontManager( PrintFontManager::get() )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
|
|
|
|
m_aFontBox.EnableMultiSelection( TRUE );
|
|
|
|
|
|
|
|
m_aOKButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
|
2001-06-26 13:27:24 -05:00
|
|
|
m_aRenameButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
|
2001-05-08 05:56:39 -05:00
|
|
|
m_aRemoveButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
|
2001-06-05 11:33:50 -05:00
|
|
|
m_aImportButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
|
2001-05-08 05:56:39 -05:00
|
|
|
m_aFontBox.setDelPressedLink( LINK( this, FontNameDlg, DelPressedHdl ) );
|
2001-06-27 07:37:56 -05:00
|
|
|
m_aFontBox.SetSelectHdl( LINK( this, FontNameDlg, SelectHdl ) );
|
2001-06-05 11:33:50 -05:00
|
|
|
|
|
|
|
init();
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
FontNameDlg::~FontNameDlg()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2001-06-06 07:54:31 -05:00
|
|
|
String FontNameDlg::fillFontEntry( FastPrintFontInfo& rInfo, const String& rFile, bool bAddRegular )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-06 07:54:31 -05:00
|
|
|
static String aThinTxt( PaResId( RID_TXT_FONT_THIN ) );
|
|
|
|
static String aUltraLightTxt( PaResId( RID_TXT_FONT_ULTRALIGHT ) );
|
|
|
|
static String aLightTxt( PaResId( RID_TXT_FONT_LIGHT ) );
|
|
|
|
static String aSemiLightTxt( PaResId( RID_TXT_FONT_SEMILIGHT ) );
|
|
|
|
static String aSemiBoldTxt( PaResId( RID_TXT_FONT_SEMIBOLD ) );
|
|
|
|
static String aBoldTxt( PaResId( RID_TXT_FONT_BOLD ) );
|
|
|
|
static String aUltraBoldTxt( PaResId( RID_TXT_FONT_ULTRABOLD ) );
|
|
|
|
|
|
|
|
static String aItalicTxt( PaResId( RID_TXT_FONT_ITALIC ) );
|
|
|
|
static String aObliqueTxt( PaResId( RID_TXT_FONT_OBLIQUE ) );
|
|
|
|
|
|
|
|
static String aUltraCondensedTxt( PaResId( RID_TXT_FONT_ULTRACONDENSED ) );
|
|
|
|
static String aExtraCondensedTxt( PaResId( RID_TXT_FONT_EXTRACONDENSED ) );
|
|
|
|
static String aCondensedTxt( PaResId( RID_TXT_FONT_CONDENSED ) );
|
|
|
|
static String aSemiCondensedTxt( PaResId( RID_TXT_FONT_SEMICONDENSED ) );
|
|
|
|
static String aSemiExpandedTxt( PaResId( RID_TXT_FONT_SEMIEXPANDED ) );
|
|
|
|
static String aExpandedTxt( PaResId( RID_TXT_FONT_EXPANDED ) );
|
|
|
|
static String aExtraExpandedTxt( PaResId( RID_TXT_FONT_EXTRAEXPANDED ) );
|
|
|
|
static String aUltraExpandedTxt( PaResId( RID_TXT_FONT_ULTRAEXPANDED ) );
|
|
|
|
|
|
|
|
static String aRegularTxt( PaResId( RID_TXT_FONT_REGULAR ) );
|
|
|
|
|
2001-06-05 11:33:50 -05:00
|
|
|
String aEntry( rInfo.m_aFamilyName );
|
2001-06-06 07:54:31 -05:00
|
|
|
bool bWeight = true, bItalic = true, bWidth = true;
|
2001-06-05 11:33:50 -05:00
|
|
|
switch( rInfo.m_eWeight )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-06 07:54:31 -05:00
|
|
|
case weight::Thin: aEntry.AppendAscii( ", " ); aEntry.Append( aThinTxt ); break;
|
|
|
|
case weight::UltraLight: aEntry.AppendAscii( ", " ); aEntry.Append( aUltraLightTxt ); break;
|
|
|
|
case weight::Light: aEntry.AppendAscii( ", " ); aEntry.Append( aLightTxt ); break;
|
|
|
|
case weight::SemiLight: aEntry.AppendAscii( ", " ); aEntry.Append( aSemiLightTxt ); break;
|
|
|
|
case weight::SemiBold: aEntry.AppendAscii( ", " ); aEntry.Append( aSemiBoldTxt ); break;
|
|
|
|
case weight::Bold: aEntry.AppendAscii( ", " ); aEntry.Append( aBoldTxt ); break;
|
|
|
|
case weight::UltraBold: aEntry.AppendAscii( ", " ); aEntry.Append( aUltraBoldTxt ); break;
|
|
|
|
default:
|
|
|
|
bWeight = false;
|
|
|
|
break;
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
2001-06-05 11:33:50 -05:00
|
|
|
switch( rInfo.m_eItalic )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-06 07:54:31 -05:00
|
|
|
case italic::Oblique: aEntry.AppendAscii( ", " ); aEntry.Append( aObliqueTxt ); break;
|
|
|
|
case italic::Italic: aEntry.AppendAscii( ", " ); aEntry.Append( aItalicTxt ); break;
|
|
|
|
default:
|
|
|
|
bItalic = false;
|
|
|
|
break;
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
2001-06-05 11:33:50 -05:00
|
|
|
switch( rInfo.m_eWidth )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-06 07:54:31 -05:00
|
|
|
case width::UltraCondensed: aEntry.AppendAscii( ", " ); aEntry.Append( aUltraCondensedTxt ); break;
|
|
|
|
case width::ExtraCondensed: aEntry.AppendAscii( ", " ); aEntry.Append( aExtraCondensedTxt ); break;
|
|
|
|
case width::Condensed: aEntry.AppendAscii( ", " ); aEntry.Append( aCondensedTxt ); break;
|
|
|
|
case width::SemiCondensed: aEntry.AppendAscii( ", " ); aEntry.Append( aSemiCondensedTxt ); break;
|
|
|
|
case width::SemiExpanded: aEntry.AppendAscii( ", " ); aEntry.Append( aSemiExpandedTxt ); break;
|
|
|
|
case width::Expanded: aEntry.AppendAscii( ", " ); aEntry.Append( aExpandedTxt ); break;
|
|
|
|
case width::ExtraExpanded: aEntry.AppendAscii( ", " ); aEntry.Append( aExtraExpandedTxt ); break;
|
|
|
|
case width::UltraExpanded: aEntry.AppendAscii( ", " ); aEntry.Append( aUltraExpandedTxt ); break;
|
|
|
|
default:
|
|
|
|
bWidth = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bAddRegular && ! bItalic && ! bWidth && ! bWeight )
|
|
|
|
{
|
|
|
|
aEntry.AppendAscii( ", " );
|
|
|
|
aEntry.Append( aRegularTxt );
|
|
|
|
}
|
|
|
|
|
|
|
|
aEntry.AppendAscii( " (" );
|
|
|
|
aEntry.Append( rFile );
|
|
|
|
aEntry.AppendAscii( ")" );
|
|
|
|
return aEntry;
|
|
|
|
}
|
|
|
|
|
|
|
|
String FontNameDlg::fillFontEntry( const ::std::list< FastPrintFontInfo >& rInfos, const String& rFile )
|
|
|
|
{
|
|
|
|
String aEntry;
|
|
|
|
bool bFirst = true;
|
|
|
|
for( ::std::list< FastPrintFontInfo >::const_iterator it = rInfos.begin(); it != rInfos.end(); ++it )
|
|
|
|
{
|
|
|
|
if( ! bFirst )
|
|
|
|
aEntry.AppendAscii( " & " );
|
|
|
|
aEntry.Append( String( it->m_aFamilyName ) );
|
|
|
|
bFirst = false;
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
|
|
|
|
2001-06-05 11:33:50 -05:00
|
|
|
aEntry.AppendAscii( " (" );
|
|
|
|
aEntry.Append( rFile );
|
|
|
|
aEntry.AppendAscii( ")" );
|
|
|
|
return aEntry;
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
|
|
|
|
2001-06-05 11:33:50 -05:00
|
|
|
void FontNameDlg::init()
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-05 11:33:50 -05:00
|
|
|
::std::list< fontID > aFonts;
|
|
|
|
m_rFontManager.getFontList( aFonts );
|
|
|
|
m_aFontBox.Clear();
|
2001-06-27 07:37:56 -05:00
|
|
|
m_aRemoveButton.Enable( FALSE );
|
|
|
|
m_aRenameButton.Enable( FALSE );
|
2001-06-06 07:54:31 -05:00
|
|
|
|
|
|
|
::std::hash_map< OUString, int, OUStringHash > aFamilies;
|
|
|
|
::std::list< fontID >::iterator font_it;
|
|
|
|
for( font_it = aFonts.begin(); font_it != aFonts.end(); ++font_it )
|
|
|
|
{
|
|
|
|
if( m_rFontManager.isPrivateFontFile( *font_it ) )
|
|
|
|
{
|
|
|
|
const OUString& rFamily( m_rFontManager.getFontFamily( *font_it ) );
|
|
|
|
if( aFamilies.find( rFamily ) == aFamilies.end() )
|
|
|
|
aFamilies[rFamily] = 0;
|
|
|
|
aFamilies[rFamily]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for( font_it = aFonts.begin(); font_it != aFonts.end(); ++font_it )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-05 11:33:50 -05:00
|
|
|
if( m_rFontManager.isPrivateFontFile( *font_it ) )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-05 11:33:50 -05:00
|
|
|
OString aFile( m_rFontManager.getFontFileSysPath( *font_it ) );
|
|
|
|
int nLast = aFile.lastIndexOf( '/' );
|
|
|
|
if( nLast != -1 )
|
|
|
|
aFile = aFile.copy( nLast+1 );
|
|
|
|
|
|
|
|
FastPrintFontInfo aInfo;
|
|
|
|
m_rFontManager.getFontFastInfo( *font_it, aInfo );
|
2005-09-28 09:11:25 -05:00
|
|
|
std::list< fontID > aDups;
|
2001-06-06 07:54:31 -05:00
|
|
|
String aEntry;
|
|
|
|
if( m_rFontManager.getFileDuplicates( *font_it, aDups ) )
|
|
|
|
{
|
|
|
|
FastPrintFontInfo aDupInfo;
|
2005-09-28 09:11:25 -05:00
|
|
|
std::list< FastPrintFontInfo > aInfos;
|
2001-06-06 07:54:31 -05:00
|
|
|
aInfos.push_back( aInfo );
|
2005-09-28 09:11:25 -05:00
|
|
|
for( std::list< fontID >::iterator dup = aDups.begin(); dup != aDups.end(); ++dup )
|
2001-06-06 07:54:31 -05:00
|
|
|
{
|
|
|
|
m_rFontManager.getFontFastInfo( *dup, aDupInfo );
|
|
|
|
aInfos.push_back( aDupInfo );
|
|
|
|
aFonts.remove( *dup );
|
|
|
|
}
|
|
|
|
aEntry = fillFontEntry( aInfos, String( ByteString( aFile ), osl_getThreadTextEncoding() ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
aEntry = fillFontEntry( aInfo, String( ByteString( aFile ), osl_getThreadTextEncoding() ), aFamilies[ aInfo.m_aFamilyName ] > 1 );
|
2001-06-05 11:33:50 -05:00
|
|
|
USHORT nEntry = m_aFontBox.InsertEntry( aEntry );
|
|
|
|
m_aFontBox.SetEntryData( nEntry, (void*)(*font_it) );
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-27 07:37:56 -05:00
|
|
|
IMPL_LINK( FontNameDlg, SelectHdl, ListBox*, pBox )
|
|
|
|
{
|
|
|
|
if( pBox == &m_aFontBox )
|
|
|
|
{
|
|
|
|
BOOL bEnable = m_aFontBox.GetSelectEntryCount() ? TRUE : FALSE;
|
|
|
|
m_aRemoveButton.Enable( bEnable );
|
|
|
|
m_aRenameButton.Enable( bEnable );
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-05-08 05:56:39 -05:00
|
|
|
IMPL_LINK( FontNameDlg, DelPressedHdl, ListBox*, pBox )
|
|
|
|
{
|
|
|
|
if( pBox == &m_aFontBox && m_aRemoveButton.IsEnabled() )
|
|
|
|
{
|
|
|
|
ClickBtnHdl( &m_aRemoveButton );
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
IMPL_LINK( FontNameDlg, ClickBtnHdl, Button*, pButton )
|
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if( pButton == &m_aOKButton )
|
|
|
|
{
|
|
|
|
EndDialog();
|
|
|
|
}
|
2001-06-27 07:37:56 -05:00
|
|
|
else if( pButton == &m_aRemoveButton && AreYouSure( this, RID_QUERY_REMOVEFONTFROMLIST ) && m_aFontBox.GetSelectEntryCount() )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-06 07:54:31 -05:00
|
|
|
::std::list< fontID > aRemoveIDs;
|
2001-05-08 05:56:39 -05:00
|
|
|
for( i = 0; i < m_aFontBox.GetSelectEntryCount(); i++ )
|
|
|
|
{
|
2001-06-05 11:33:50 -05:00
|
|
|
int nSelect = m_aFontBox.GetSelectEntryPos( i );
|
2005-10-05 09:02:44 -05:00
|
|
|
aRemoveIDs.push_back( (fontID)(sal_IntPtr)m_aFontBox.GetEntryData( nSelect ) );
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
2001-06-05 11:33:50 -05:00
|
|
|
m_rFontManager.removeFonts( aRemoveIDs );
|
|
|
|
init();
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
2001-06-05 11:33:50 -05:00
|
|
|
else if( pButton == &m_aImportButton )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-05 11:33:50 -05:00
|
|
|
FontImportDialog aDialog( this );
|
|
|
|
aDialog.Execute();
|
|
|
|
init();
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
2001-06-27 07:37:56 -05:00
|
|
|
else if( pButton == &m_aRenameButton && m_aFontBox.GetSelectEntryCount() )
|
2001-06-26 13:27:24 -05:00
|
|
|
{
|
|
|
|
for( i = 0; i < m_aFontBox.GetSelectEntryCount(); i++ )
|
|
|
|
{
|
2005-10-05 09:02:44 -05:00
|
|
|
fontID aFont = (fontID)(sal_IntPtr)m_aFontBox.GetEntryData( m_aFontBox.GetSelectEntryPos( i ) );
|
2001-06-27 10:03:31 -05:00
|
|
|
if( ! m_rFontManager.checkChangeFontPropertiesPossible( aFont ) )
|
|
|
|
{
|
|
|
|
String aErrorText( m_aNoRenameString );
|
|
|
|
aErrorText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), m_aFontBox.GetSelectEntry( i ) );
|
|
|
|
ErrorBox aBox( this, WB_OK | WB_DEF_OK, aErrorText );
|
|
|
|
aBox.Execute();
|
|
|
|
continue;
|
|
|
|
}
|
2001-06-26 13:27:24 -05:00
|
|
|
::std::list< fontID > aDuplicates;
|
|
|
|
m_rFontManager.getFileDuplicates( aFont, aDuplicates );
|
|
|
|
aDuplicates.push_front( aFont );
|
|
|
|
int nFonts = aDuplicates.size();
|
|
|
|
for( int n = 0; n < nFonts; n++ )
|
|
|
|
{
|
|
|
|
aFont = aDuplicates.front();
|
|
|
|
aDuplicates.pop_front();
|
|
|
|
String aFamily( m_rFontManager.getFontFamily( aFont ) );
|
|
|
|
::std::list< OUString > aAlternatives;
|
|
|
|
m_rFontManager.getAlternativeFamilyNames( aFont, aAlternatives );
|
|
|
|
::std::list< String > aChoices;
|
|
|
|
while( aAlternatives.size() )
|
|
|
|
{
|
|
|
|
aChoices.push_back( aAlternatives.front() );
|
|
|
|
aAlternatives.pop_front();
|
|
|
|
}
|
|
|
|
String aQueryTxt( m_aRenameString );
|
|
|
|
if( nFonts > 1 )
|
|
|
|
{
|
|
|
|
aQueryTxt = m_aRenameTTCString;
|
|
|
|
aQueryTxt.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%d1" ) ), String::CreateFromInt32( n+1 ) );
|
|
|
|
aQueryTxt.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%d2" ) ), String::CreateFromInt32( nFonts ) );
|
|
|
|
}
|
2001-06-27 07:37:56 -05:00
|
|
|
aQueryTxt.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aFamily );
|
2001-06-26 13:27:24 -05:00
|
|
|
QueryString aQuery( this, aQueryTxt, aFamily, aChoices );
|
|
|
|
if( aQuery.Execute() )
|
|
|
|
{
|
|
|
|
aFamily.SearchAndReplaceAll( '-', ' ' );
|
|
|
|
aFamily.SearchAndReplaceAll( '?', ' ' );
|
|
|
|
aFamily.SearchAndReplaceAll( '*', ' ' );
|
|
|
|
aFamily = WhitespaceToSpace( aFamily );
|
|
|
|
if( aFamily.Len() )
|
|
|
|
{
|
|
|
|
String aXLFD = m_rFontManager.getFontXLFD( aFont );
|
|
|
|
aXLFD.SetToken( 2, '-', aFamily );
|
|
|
|
m_rFontManager.changeFontProperties( aFont, aXLFD );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
init();
|
|
|
|
}
|
2001-05-08 05:56:39 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------
|
|
|
|
|
|
|
|
FontImportDialog::FontImportDialog( Window* pParent ) :
|
|
|
|
ModalDialog( pParent, PaResId( RID_FONTIMPORT_DIALOG ) ),
|
|
|
|
m_aOKBtn( this, PaResId( RID_FIMP_BTN_OK ) ),
|
|
|
|
m_aCancelBtn( this, PaResId( RID_FIMP_BTN_CANCEL ) ),
|
2004-03-17 03:44:23 -06:00
|
|
|
m_aSelectAllBtn( this, PaResId( RID_FIMP_BTN_SELECTALL ) ),
|
|
|
|
m_aNewFontsBox( this, PaResId( RID_FIMP_BOX_NEWFONTS ) ),
|
2001-06-15 09:30:08 -05:00
|
|
|
m_aFromFL( this, PaResId( RID_FIMP_FL_FROM ) ),
|
2001-05-08 05:56:39 -05:00
|
|
|
m_aFromDirEdt( this, PaResId( RID_FIMP_EDT_FROM ) ),
|
|
|
|
m_aFromBtn( this, PaResId( RID_FIMP_BTN_FROM ) ),
|
2004-03-30 06:45:42 -06:00
|
|
|
m_aSubDirsBox( this, PaResId( RID_FIMP_BOX_SUBDIRS ) ),
|
|
|
|
m_aTargetOptFL( this, PaResId( RID_FIMP_FL_TARGETOPTS ) ),
|
2001-06-05 11:33:50 -05:00
|
|
|
m_aLinkOnlyBox( this, PaResId( RID_FIMP_BOX_LINKONLY ) ),
|
|
|
|
m_aFixedText( this, PaResId( RID_FIMP_TXT_HELP ) ),
|
2001-05-08 05:56:39 -05:00
|
|
|
m_bOverwriteAll( false ),
|
|
|
|
m_bOverwriteNone( false ),
|
|
|
|
m_pProgress( NULL ),
|
|
|
|
m_aImportOperation( PaResId( RID_FIMP_STR_IMPORTOP ) ),
|
|
|
|
m_aOverwriteQueryText( PaResId( RID_FIMP_STR_QUERYOVERWRITE ) ),
|
|
|
|
m_aOverwriteAllText( PaResId( RID_FIMP_STR_OVERWRITEALL ) ),
|
|
|
|
m_aOverwriteNoneText( PaResId( RID_FIMP_STR_OVERWRITENONE ) ),
|
|
|
|
m_aNoAfmText( PaResId( RID_FIMP_STR_NOAFM ) ),
|
|
|
|
m_aAfmCopyFailedText( PaResId( RID_FIMP_STR_AFMCOPYFAILED ) ),
|
|
|
|
m_aFontCopyFailedText( PaResId( RID_FIMP_STR_FONTCOPYFAILED ) ),
|
|
|
|
m_aNoWritableFontsDirText( PaResId( RID_FIMP_STR_NOWRITEABLEFONTSDIR ) ),
|
|
|
|
m_aFontsImportedText( PaResId( RID_FIMP_STR_NUMBEROFFONTSIMPORTED ) ),
|
|
|
|
m_rFontManager( ::psp::PrintFontManager::get() )
|
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
|
2001-06-06 07:54:31 -05:00
|
|
|
m_aNewFontsBox.EnableMultiSelection( TRUE );
|
|
|
|
|
2001-05-08 05:56:39 -05:00
|
|
|
m_aOKBtn.SetClickHdl( LINK( this, FontImportDialog, ClickBtnHdl ) );
|
2001-06-06 07:54:31 -05:00
|
|
|
m_aSelectAllBtn.SetClickHdl( LINK( this, FontImportDialog, ClickBtnHdl ) );
|
2001-05-08 05:56:39 -05:00
|
|
|
m_aFromBtn.SetClickHdl( LINK( this, FontImportDialog, ClickBtnHdl ) );
|
2001-06-05 11:33:50 -05:00
|
|
|
m_aFromDirEdt.SetModifyHdl( LINK( this, FontImportDialog, ModifyHdl ) );
|
|
|
|
m_aRefreshTimer.SetTimeoutHdl( LINK( this, FontImportDialog, RefreshTimeoutHdl ) );
|
|
|
|
m_aRefreshTimer.SetTimeout( 2000 );
|
|
|
|
m_aLinkOnlyBox.Check( FALSE );
|
2004-03-30 06:45:42 -06:00
|
|
|
m_aSubDirsBox.Check( TRUE );
|
|
|
|
m_aSubDirsBox.SetToggleHdl( LINK( this, FontImportDialog, ToggleHdl ) );
|
2001-06-06 07:54:31 -05:00
|
|
|
|
|
|
|
Config& rPadminRC( getPadminRC() );
|
|
|
|
rPadminRC.SetGroup( "FontImport" );
|
|
|
|
m_aFromDirEdt.SetText( String( rPadminRC.ReadKey( "FromPath" ), RTL_TEXTENCODING_UTF8 ) );
|
|
|
|
RefreshTimeoutHdl( NULL );
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
FontImportDialog::~FontImportDialog()
|
|
|
|
{
|
2001-06-06 07:54:31 -05:00
|
|
|
Config& rPadminRC( getPadminRC() );
|
|
|
|
rPadminRC.SetGroup( "FontImport" );
|
|
|
|
rPadminRC.WriteKey( "FromPath", ByteString( m_aFromDirEdt.GetText(), RTL_TEXTENCODING_UTF8 ) );
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void FontImportDialog::importFontsFailed( ::psp::PrintFontManager::ImportFontCallback::FailCondition eReason )
|
|
|
|
{
|
|
|
|
String aText;
|
|
|
|
switch( eReason )
|
|
|
|
{
|
2004-03-17 03:44:23 -06:00
|
|
|
case psp::PrintFontManager::ImportFontCallback::NoWritableDirectory:
|
2001-05-08 05:56:39 -05:00
|
|
|
aText = m_aNoWritableFontsDirText;
|
2004-03-17 03:44:23 -06:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
|
|
|
ErrorBox aBox( m_pProgress ? (Window*)m_pProgress : (Window*)this, WB_OK | WB_DEF_OK, aText );
|
|
|
|
aBox.Execute();
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontImportDialog::progress( const ::rtl::OUString& rFile )
|
|
|
|
{
|
|
|
|
m_pProgress->setValue( ++m_nFont );
|
|
|
|
m_pProgress->setFilename( rFile );
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FontImportDialog::queryOverwriteFile( const ::rtl::OUString& rFile )
|
|
|
|
{
|
|
|
|
bool bRet = false;
|
|
|
|
|
|
|
|
if( m_bOverwriteNone )
|
|
|
|
return false;
|
|
|
|
if( m_bOverwriteAll )
|
|
|
|
return true;
|
|
|
|
|
|
|
|
String aText( m_aOverwriteQueryText );
|
|
|
|
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), rFile );
|
|
|
|
|
|
|
|
QueryBox aQueryBox( m_pProgress ? (Window*)m_pProgress : (Window*)this, WB_YES_NO | WB_DEF_NO, aText );
|
|
|
|
aQueryBox.AddButton( m_aOverwriteAllText, 20, 0 );
|
|
|
|
aQueryBox.AddButton( m_aOverwriteNoneText, 21, 0 );
|
|
|
|
|
|
|
|
int nResult = aQueryBox.Execute();
|
|
|
|
switch( nResult )
|
|
|
|
{
|
|
|
|
case BUTTONID_YES: bRet = true; break;
|
|
|
|
case BUTTONID_NO: bRet = false; break;
|
|
|
|
case 20: bRet = m_bOverwriteAll = true; break;
|
|
|
|
case 21: bRet = false; m_bOverwriteNone = true; break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontImportDialog::importFontFailed( const ::rtl::OUString& rFile, ::psp::PrintFontManager::ImportFontCallback::FailCondition eReason )
|
|
|
|
{
|
|
|
|
String aText;
|
|
|
|
switch( eReason )
|
|
|
|
{
|
2004-03-17 03:44:23 -06:00
|
|
|
case psp::PrintFontManager::ImportFontCallback::NoAfmMetric:
|
2001-05-08 05:56:39 -05:00
|
|
|
aText = m_aNoAfmText;
|
|
|
|
break;
|
2004-03-17 03:44:23 -06:00
|
|
|
case psp::PrintFontManager::ImportFontCallback::AfmCopyFailed:
|
2001-05-08 05:56:39 -05:00
|
|
|
aText = m_aAfmCopyFailedText;
|
|
|
|
break;
|
2004-03-17 03:44:23 -06:00
|
|
|
case psp::PrintFontManager::ImportFontCallback::FontCopyFailed:
|
2001-05-08 05:56:39 -05:00
|
|
|
aText = m_aFontCopyFailedText;
|
|
|
|
break;
|
2004-03-17 03:44:23 -06:00
|
|
|
default:
|
|
|
|
break;
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
|
|
|
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), rFile );
|
|
|
|
ErrorBox aBox( m_pProgress ? (Window*)m_pProgress : (Window*)this, WB_OK | WB_DEF_OK, aText );
|
|
|
|
aBox.Execute();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool FontImportDialog::isCanceled()
|
|
|
|
{
|
|
|
|
return m_pProgress->isCanceled();
|
|
|
|
}
|
|
|
|
|
2006-06-19 06:15:32 -05:00
|
|
|
IMPL_LINK( FontImportDialog, ModifyHdl, Edit*, EMPTYARG )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-06-05 11:33:50 -05:00
|
|
|
m_aRefreshTimer.Start();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-06-19 06:15:32 -05:00
|
|
|
IMPL_LINK( FontImportDialog, RefreshTimeoutHdl, void*, EMPTYARG )
|
2001-06-05 11:33:50 -05:00
|
|
|
{
|
|
|
|
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
|
2004-03-30 06:45:42 -06:00
|
|
|
std::list< String > aFiles;
|
2001-06-05 11:33:50 -05:00
|
|
|
m_aNewFonts.clear();
|
|
|
|
OUString aDirectory( m_aFromDirEdt.GetText() );
|
2004-03-30 06:45:42 -06:00
|
|
|
FindFiles( aDirectory, aFiles, String( RTL_CONSTASCII_USTRINGPARAM( "PFA;PFB;TTF;TTC" ) ), m_aSubDirsBox.IsChecked() );
|
2001-06-05 11:33:50 -05:00
|
|
|
OString aDir( OUStringToOString( aDirectory, aEncoding ) );
|
|
|
|
aDir += "/";
|
2001-05-08 05:56:39 -05:00
|
|
|
while( aFiles.begin() != aFiles.end() )
|
|
|
|
{
|
2001-06-05 11:33:50 -05:00
|
|
|
OString aFont( aDir );
|
|
|
|
aFont += OUStringToOString( aFiles.front(), aEncoding );
|
2001-05-08 05:56:39 -05:00
|
|
|
aFiles.pop_front();
|
2001-06-05 11:33:50 -05:00
|
|
|
::std::list< FastPrintFontInfo > aInfos;
|
|
|
|
if( m_rFontManager.getImportableFontProperties( aFont, aInfos ) )
|
|
|
|
m_aNewFonts[ aFont ] = aInfos;
|
|
|
|
}
|
|
|
|
fillFontBox();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void FontImportDialog::fillFontBox()
|
|
|
|
{
|
|
|
|
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
|
|
|
|
m_aNewFontsBox.Clear();
|
2001-06-06 07:54:31 -05:00
|
|
|
|
|
|
|
::std::hash_map< OUString, int, OUStringHash > aFamilies;
|
|
|
|
::std::hash_map< OString, ::std::list< FastPrintFontInfo >, OStringHash >::iterator it;
|
|
|
|
for( it = m_aNewFonts.begin(); it != m_aNewFonts.end(); ++it )
|
|
|
|
{
|
|
|
|
const OUString& rFamily( it->second.front().m_aFamilyName );
|
|
|
|
if( aFamilies.find( rFamily ) == aFamilies.end() )
|
|
|
|
aFamilies[rFamily] = 0;
|
|
|
|
aFamilies[rFamily]++;
|
|
|
|
}
|
|
|
|
|
|
|
|
for( it = m_aNewFonts.begin(); it != m_aNewFonts.end(); ++it )
|
2001-06-05 11:33:50 -05:00
|
|
|
{
|
|
|
|
OString aFileName( it->first.copy( it->first.lastIndexOf( '/' )+1 ) );
|
|
|
|
OUString aFile( OStringToOUString( aFileName, aEncoding ) );
|
2001-06-06 07:54:31 -05:00
|
|
|
String aEntry;
|
|
|
|
if( it->second.size() == 1 )
|
|
|
|
aEntry = FontNameDlg::fillFontEntry( it->second.front(), aFile, aFamilies[ it->second.front().m_aFamilyName ] > 1 );
|
|
|
|
else
|
|
|
|
aEntry = FontNameDlg::fillFontEntry( it->second, aFile );
|
|
|
|
USHORT nPos = m_aNewFontsBox.InsertEntry( aEntry );
|
|
|
|
m_aNewFontsBox.SetEntryData( nPos, (void*)&(it->first) );
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
2001-06-05 11:33:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void FontImportDialog::copyFonts()
|
|
|
|
{
|
|
|
|
::std::list< OString > aFiles;
|
2001-06-06 07:54:31 -05:00
|
|
|
for( int i = 0; i < m_aNewFontsBox.GetSelectEntryCount(); i++ )
|
|
|
|
{
|
|
|
|
OString* pFile = (OString*)m_aNewFontsBox.GetEntryData( m_aNewFontsBox.GetSelectEntryPos( i ) );
|
|
|
|
aFiles.push_back( *pFile );
|
|
|
|
}
|
2001-06-05 11:33:50 -05:00
|
|
|
|
2001-05-08 05:56:39 -05:00
|
|
|
int nSuccess = 0;
|
2001-06-05 11:33:50 -05:00
|
|
|
if( aFiles.size() )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
|
|
|
m_nFont = 0;
|
|
|
|
m_pProgress = new ProgressDialog( this );
|
2001-06-05 11:33:50 -05:00
|
|
|
m_pProgress->setRange( 0, aFiles.size() );
|
2001-05-08 05:56:39 -05:00
|
|
|
m_pProgress->startOperation( m_aImportOperation );
|
|
|
|
m_pProgress->Show( TRUE );
|
|
|
|
m_pProgress->setValue( 0 );
|
|
|
|
m_pProgress->Invalidate();
|
|
|
|
m_pProgress->Sync();
|
2001-06-05 11:33:50 -05:00
|
|
|
nSuccess = m_rFontManager.importFonts( aFiles, m_aLinkOnlyBox.IsChecked() ? true : false, this );
|
2001-05-08 05:56:39 -05:00
|
|
|
m_pProgress->Show( FALSE );
|
|
|
|
delete m_pProgress;
|
|
|
|
m_pProgress = NULL;
|
|
|
|
}
|
|
|
|
String aText( m_aFontsImportedText );
|
|
|
|
aText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%d" ) ), String::CreateFromInt32( nSuccess ) );
|
|
|
|
InfoBox aBox( this, aText );
|
|
|
|
aBox.Execute();
|
|
|
|
}
|
|
|
|
|
|
|
|
IMPL_LINK( FontImportDialog, ClickBtnHdl, Button*, pButton )
|
|
|
|
{
|
2001-06-05 11:33:50 -05:00
|
|
|
if( pButton == &m_aFromBtn )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
2001-09-04 10:24:50 -05:00
|
|
|
String aPath( m_aFromDirEdt.GetText() );
|
2006-06-19 06:15:32 -05:00
|
|
|
if( chooseDirectory( aPath ) )
|
2001-06-05 11:33:50 -05:00
|
|
|
{
|
2001-09-04 10:24:50 -05:00
|
|
|
m_aFromDirEdt.SetText( aPath );
|
2001-06-05 11:33:50 -05:00
|
|
|
RefreshTimeoutHdl( NULL );
|
|
|
|
}
|
2001-05-08 05:56:39 -05:00
|
|
|
}
|
2001-06-05 11:33:50 -05:00
|
|
|
else if( pButton == &m_aOKBtn )
|
2001-05-08 05:56:39 -05:00
|
|
|
{
|
|
|
|
copyFonts();
|
|
|
|
EndDialog( 0 );
|
|
|
|
}
|
2001-06-06 07:54:31 -05:00
|
|
|
else if( pButton == &m_aSelectAllBtn )
|
2001-06-05 11:33:50 -05:00
|
|
|
{
|
2001-06-06 07:54:31 -05:00
|
|
|
m_aNewFontsBox.SetUpdateMode( FALSE );
|
|
|
|
for( int i = 0; i < m_aNewFontsBox.GetEntryCount(); i++ )
|
|
|
|
m_aNewFontsBox.SelectEntryPos( i, TRUE );
|
|
|
|
m_aNewFontsBox.SetUpdateMode( TRUE );
|
2001-06-05 11:33:50 -05:00
|
|
|
}
|
2001-05-08 05:56:39 -05:00
|
|
|
return 0;
|
|
|
|
}
|
2004-03-30 06:45:42 -06:00
|
|
|
|
|
|
|
IMPL_LINK( FontImportDialog, ToggleHdl, CheckBox*, pBox )
|
|
|
|
{
|
|
|
|
if( pBox == &m_aSubDirsBox )
|
|
|
|
{
|
|
|
|
RefreshTimeoutHdl( NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|