[Libreoffice-commits] .: 12 commits - libcmis/ExternalLib_libcmis.mk libcmis/libcmis-0001-virtualdtor.patch libcmis/makefile.mk padmin/Library_spa.mk padmin/source redland/raptor tools/inc tools/source unusedcode.easy vcl/generic vcl/headless vcl/inc vcl/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Jan 11 06:13:58 PST 2012
libcmis/ExternalLib_libcmis.mk | 1
libcmis/libcmis-0001-virtualdtor.patch | 22 +
libcmis/makefile.mk | 2
padmin/Library_spa.mk | 1
padmin/source/fontentry.cxx | 590 --------------------------------
padmin/source/fontentry.hxx | 138 -------
padmin/source/padialog.cxx | 17
padmin/source/padialog.hrc | 93 -----
padmin/source/padialog.hxx | 1
padmin/source/padialog.src | 346 ------------------
redland/raptor/makefile.mk | 9
tools/inc/tools/pstm.hxx | 1
tools/inc/tools/ref.hxx | 4
tools/source/debug/debug.cxx | 17
tools/source/ref/pstm.cxx | 3
unusedcode.easy | 7
vcl/generic/fontmanager/fontcache.cxx | 4
vcl/generic/fontmanager/fontconfig.cxx | 62 ++-
vcl/generic/fontmanager/fontmanager.cxx | 258 +++++--------
vcl/generic/fontmanager/fontsubst.cxx | 2
vcl/generic/print/genpspgraphics.cxx | 5
vcl/generic/print/glyphset.cxx | 2
vcl/headless/svptext.cxx | 2
vcl/inc/vcl/event.hxx | 6
vcl/inc/vcl/field.hxx | 2
vcl/inc/vcl/fontmanager.hxx | 43 +-
vcl/inc/vcl/keycod.hxx | 1
vcl/source/components/dtranscomp.cxx | 9
vcl/source/components/factory.cxx | 1
vcl/source/control/field2.cxx | 15
vcl/source/window/keycod.cxx | 9
vcl/source/window/keyevent.cxx | 31 -
vcl/unx/generic/gdi/salgdi3.cxx | 39 +-
33 files changed, 236 insertions(+), 1507 deletions(-)
New commits:
commit 6c06dd347ca2e8a5dc42884344ed8c7c4c5f18b9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 11 13:48:09 2012 +0000
Resolves: fdo#44492 look up font by FC_FILE+FC_INDEX rather than FC_FAMILY
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index d3b1f2b..daf4fee 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -746,7 +746,7 @@ static void addtopattern(FcPattern *pPattern,
}
}
-bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& rMissingCodes ) const
+bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& rMissingCodes )
{
bool bRet = false;
@@ -814,21 +814,48 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& r
if( pSet->nfont > 0 )
{
//extract the closest match
- FcChar8* family = NULL;
- FcResult eFileRes = FcPatternGetString( pSet->fonts[0], FC_FAMILY, 0, &family );
-
- // get the family name
+ FcChar8* file = NULL;
+ FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file);
+ int nCollectionEntry = 0;
+ FcResult eIndexRes = FcPatternGetInteger(pSet->fonts[0], FC_INDEX, 0, &nCollectionEntry);
+ if (eIndexRes != FcResultMatch)
+ nCollectionEntry = 0;
if( eFileRes == FcResultMatch )
{
- bRet = true;
+ OString aDir, aBase, aOrgPath( (sal_Char*)file );
+ splitPath( aOrgPath, aDir, aBase );
+ int nDirID = getDirectoryAtom( aDir, true );
+ fontID aFont = findFontFileID( nDirID, aBase, nCollectionEntry );
+ if( aFont > 0 )
+ {
+ FastPrintFontInfo aInfo;
+ bRet = getFontFastInfo( aFont, aInfo );
+ rPattern.maSearchName = aInfo.m_aFamilyName;
+ }
+ }
+
+ SAL_WARN_IF(!bRet, "vcl", "no FC_FILE found, falling back to name search");
- OString sFamily((sal_Char*)family);
- boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI =
- rWrapper.m_aFontNameToLocalized.find(sFamily);
- if (aI != rWrapper.m_aFontNameToLocalized.end())
- sFamily = aI->second;
- rPattern.maSearchName = rtl::OStringToOUString( sFamily, RTL_TEXTENCODING_UTF8 );
+ if (!bRet)
+ {
+ FcChar8* family = NULL;
+ FcResult eFamilyRes = FcPatternGetString( pSet->fonts[0], FC_FAMILY, 0, &family );
+ // get the family name
+ if( eFamilyRes == FcResultMatch )
+ {
+ OString sFamily((sal_Char*)family);
+ boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI =
+ rWrapper.m_aFontNameToLocalized.find(sFamily);
+ if (aI != rWrapper.m_aFontNameToLocalized.end())
+ sFamily = aI->second;
+ rPattern.maSearchName = rtl::OStringToOUString( sFamily, RTL_TEXTENCODING_UTF8 );
+ bRet = true;
+ }
+ }
+
+ if (bRet)
+ {
int val = 0;
if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WEIGHT, 0, &val))
rPattern.meWeight = convertWeight(val);
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 09e64c9..35517cd 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -1483,12 +1483,8 @@ fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile, i
{
TrueTypeFontFile* const pFont = static_cast< TrueTypeFontFile* const >((*it).second);
if( pFont->m_nDirectory == nDirID &&
- pFont->m_aFontFile == rFontFile )
- {
- fprintf(stderr, "candidate %d vs %d\n", pFont->m_nCollectionEntry, nFaceIndex);
- if (pFont->m_nCollectionEntry == nFaceIndex)
+ pFont->m_aFontFile == rFontFile && pFont->m_nCollectionEntry == nFaceIndex )
nID = it->first;
- }
}
break;
case fonttype::Builtin:
diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
index 2607668..1086531 100644
--- a/vcl/generic/fontmanager/fontsubst.cxx
+++ b/vcl/generic/fontmanager/fontsubst.cxx
@@ -117,7 +117,7 @@ void SalGenericInstance::RegisterFontSubstitutors( ImplDevFontList* pList )
static FontSelectPattern GetFcSubstitute(const FontSelectPattern &rFontSelData, rtl::OUString& rMissingCodes )
{
FontSelectPattern aSubstituted(rFontSelData);
- const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
+ psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
rMgr.Substitute(aSubstituted, rMissingCodes);
return aSubstituted;
}
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index a429b7e..3fe2fac 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -648,7 +648,7 @@ public:
bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale );
ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)) const;
- bool Substitute( FontSelectPattern &rPattern, rtl::OUString& rMissingCodes ) const;
+ bool Substitute( FontSelectPattern &rPattern, rtl::OUString& rMissingCodes );
int FreeTypeCharIndex( void *pFace, sal_uInt32 aChar );
};
commit 6b5eacd10dde8fc5e68c64b532c441c2888b1b4e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 11 11:57:01 2012 +0000
align m_nCollectionEntry with getFontFaceNumber and FC_FACE, bump cache magic
diff --git a/vcl/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx
index cbad197..9c71963 100644
--- a/vcl/generic/fontmanager/fontcache.cxx
+++ b/vcl/generic/fontmanager/fontcache.cxx
@@ -48,7 +48,7 @@
#endif
#define FONTCACHEFILE "/user/psprint/pspfontcache"
-#define CACHE_MAGIC "PspFontCacheFile format 4"
+#define CACHE_MAGIC "LibreOffice PspFontCacheFile format 5"
using namespace std;
using namespace psp;
@@ -170,7 +170,7 @@ void FontCache::flush()
if( nEntrySize > 1 )
nSubEntry = static_cast<const PrintFontManager::TrueTypeFontFile*>(*it)->m_nCollectionEntry;
else
- nSubEntry = -1;
+ nSubEntry = 0;
aLine.append(OUStringToOString(pAtoms->getString( ATOM_FAMILYNAME, (*it)->m_nFamilyName), RTL_TEXTENCODING_UTF8));
for( ::std::list< int >::const_iterator name_it = (*it)->m_aAliases.begin(); name_it != (*it)->m_aAliases.end(); ++name_it )
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index e99044e..09e64c9 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -392,7 +392,7 @@ PrintFontManager::Type1FontFile::~Type1FontFile()
PrintFontManager::TrueTypeFontFile::TrueTypeFontFile()
: PrintFont( fonttype::TrueType )
, m_nDirectory( 0 )
-, m_nCollectionEntry(-1)
+, m_nCollectionEntry( 0 )
, m_nTypeFlags( TYPEFLAG_INVALID )
{}
@@ -432,7 +432,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr
TrueTypeFont* pTTFont = NULL;
- if( OpenTTFontFile( aFile.GetBuffer(), m_nCollectionEntry < 0 ? 0 : m_nCollectionEntry, &pTTFont ) == SF_OK )
+ if( OpenTTFontFile( aFile.GetBuffer(), m_nCollectionEntry, &pTTFont ) == SF_OK )
{
if( ! m_pMetrics )
{
@@ -1422,7 +1422,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
TrueTypeFontFile* pFont = new TrueTypeFontFile();
pFont->m_nDirectory = nDirID;
pFont->m_aFontFile = rFontFile;
- pFont->m_nCollectionEntry = -1;
+ pFont->m_nCollectionEntry = 0;
if( rXLFDs.size() )
getFontAttributesFromXLFD( pFont, rXLFDs );
@@ -1963,7 +1963,7 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const
TrueTypeFont* pTTFont = NULL;
TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont);
- if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK )
+ if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK )
{
TTGlobalFontInfo aInfo;
GetTTGlobalFontInfo( pTTFont, & aInfo );
@@ -3076,7 +3076,7 @@ bool PrintFontManager::isFontDownloadingAllowed( fontID nFont ) const
{
TrueTypeFont* pTTFont = NULL;
ByteString aFile = getFontFile( pFont );
- if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK )
+ if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK )
{
// get type flags
TTGlobalFontInfo aInfo;
@@ -3511,7 +3511,7 @@ bool PrintFontManager::getAlternativeFamilyNames( fontID nFont, ::std::list< OUS
TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont);
ByteString aFile( getFontFile( pFont ) );
TrueTypeFont* pTTFont;
- if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK )
+ if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK )
{
NameRecord* pNameRecords = NULL;
int nNameRecords = GetTTNameRecords( pTTFont, &pNameRecords );
@@ -3602,7 +3602,7 @@ bool PrintFontManager::createFontSubset(
TrueTypeFont* pTTFont = NULL; // TODO: rename to SfntFont
TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont);
- if( OpenTTFontFile( aFromFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) != SF_OK )
+ if( OpenTTFontFile( aFromFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) != SF_OK )
return false;
// prepare system name for write access for subset file target
@@ -3696,7 +3696,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
TrueTypeFont* pTTFont = NULL;
TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont);
ByteString aFromFile = getFontFile( pFont );
- if( OpenTTFontFile( aFromFile.GetBuffer(), pTTFontFile->m_nCollectionEntry < 0 ? 0 : pTTFontFile->m_nCollectionEntry, &pTTFont ) != SF_OK )
+ if( OpenTTFontFile( aFromFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) != SF_OK )
return;
int nGlyphs = GetTTGlyphCount( pTTFont );
if( nGlyphs > 0 )
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 6a522c1..a429b7e 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -248,11 +248,11 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
struct TrueTypeFontFile : public PrintFont
{
- int m_nDirectory; // atom containing system dependent path
- rtl::OString m_aFontFile; // relative to directory
- rtl::OString m_aXLFD; // mainly for administration, contains the XLFD from fonts.dir
- int m_nCollectionEntry; // -1 for regular fonts, 0 to ... for fonts stemming from collections
- unsigned int m_nTypeFlags; // copyright bits and PS-OpenType flag
+ int m_nDirectory; // atom containing system dependent path
+ rtl::OString m_aFontFile; // relative to directory
+ rtl::OString m_aXLFD; // mainly for administration, contains the XLFD from fonts.dir
+ int m_nCollectionEntry; // 0 for regular fonts, 0 to ... for fonts stemming from collections
+ unsigned int m_nTypeFlags; // copyright bits and PS-OpenType flag
TrueTypeFontFile();
virtual ~TrueTypeFontFile();
commit 6eddd1b54cb6fc21cdc6883eee708d1247d15f9d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 11 11:42:25 2012 +0000
further shrinkage of padmin non-fontconfig code-paths
diff --git a/padmin/Library_spa.mk b/padmin/Library_spa.mk
index 6bba1dd..ec6c1e7 100644
--- a/padmin/Library_spa.mk
+++ b/padmin/Library_spa.mk
@@ -54,7 +54,6 @@ $(eval $(call gb_Library_add_linked_libs,spa,\
$(eval $(call gb_Library_add_exception_objects,spa,\
padmin/source/adddlg \
padmin/source/cmddlg \
- padmin/source/fontentry \
padmin/source/helper \
padmin/source/newppdlg \
padmin/source/padialog \
diff --git a/padmin/source/fontentry.cxx b/padmin/source/fontentry.cxx
deleted file mode 100644
index f26283c..0000000
--- a/padmin/source/fontentry.cxx
+++ /dev/null
@@ -1,590 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * 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.
- *
- ************************************************************************/
-
-#include "fontentry.hxx"
-#include "helper.hxx"
-#include "padialog.hrc"
-#include "vcl/strhelper.hxx"
-
-#include "vcl/msgbox.hxx"
-#include "vcl/fontmanager.hxx"
-
-#include "osl/thread.h"
-
-#include "tools/config.hxx"
-
-using namespace padmin;
-using namespace osl;
-using namespace psp;
-
-using ::rtl::OUString;
-using ::rtl::OUStringHash;
-using ::rtl::OUStringToOString;
-using ::rtl::OString;
-using ::rtl::OStringHash;
-
-FontNameDlg::FontNameDlg( Window *pParent ) :
- ModalDialog( pParent, PaResId( RID_FONTNAMEDIALOG ) ),
- m_aOKButton( this, PaResId( RID_FNTNM_BTN_OK ) ),
- m_aRenameButton( this, PaResId( RID_FNTNM_BTN_RENAME ) ),
- m_aRemoveButton( this, PaResId( RID_FNTNM_BTN_REMOVE ) ),
- m_aImportButton( this, PaResId( RID_FNTNM_BTN_IMPORT ) ),
- m_aFontBox( this, PaResId( RID_FNTNM_LB_FONTS ) ),
- m_aFixedText( this, PaResId( RID_FNTNM_FIXED ) ),
- m_aRenameString( PaResId( RID_FNTNM_STR_RENAME ) ),
- m_aRenameTTCString( PaResId( RID_FNTNM_STR_TTCRENAME ) ),
- m_aNoRenameString( PaResId( RID_FNTNM_STR_NOTRENAMABLE ) ),
- m_rFontManager( PrintFontManager::get() )
-{
- FreeResource();
-
- m_aFontBox.EnableMultiSelection( sal_True );
-
- m_aOKButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
- m_aRenameButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
- m_aRemoveButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
- m_aImportButton.SetClickHdl( LINK( this, FontNameDlg, ClickBtnHdl ) );
- m_aFontBox.setDelPressedLink( LINK( this, FontNameDlg, DelPressedHdl ) );
- m_aFontBox.SetSelectHdl( LINK( this, FontNameDlg, SelectHdl ) );
-
- init();
-}
-
-FontNameDlg::~FontNameDlg()
-{
-}
-
-String FontNameDlg::fillFontEntry( FastPrintFontInfo& rInfo, const String& rFile, bool bAddRegular )
-{
- 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 ) );
-
- String aEntry( rInfo.m_aFamilyName );
- bool bWeight = true, bItalic = true, bWidth = true;
- switch( rInfo.m_eWeight )
- {
- 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;
- }
- switch( rInfo.m_eItalic )
- {
- case ITALIC_OBLIQUE: aEntry.AppendAscii( ", " ); aEntry.Append( aObliqueTxt ); break;
- case ITALIC_NORMAL: aEntry.AppendAscii( ", " ); aEntry.Append( aItalicTxt ); break;
- default:
- bItalic = false;
- break;
- }
- switch( rInfo.m_eWidth )
- {
- case WIDTH_ULTRA_CONDENSED: aEntry.AppendAscii( ", " ); aEntry.Append( aUltraCondensedTxt ); break;
- case WIDTH_EXTRA_CONDENSED: aEntry.AppendAscii( ", " ); aEntry.Append( aExtraCondensedTxt ); break;
- case WIDTH_CONDENSED: aEntry.AppendAscii( ", " ); aEntry.Append( aCondensedTxt ); break;
- case WIDTH_SEMI_CONDENSED: aEntry.AppendAscii( ", " ); aEntry.Append( aSemiCondensedTxt ); break;
- case WIDTH_SEMI_EXPANDED: aEntry.AppendAscii( ", " ); aEntry.Append( aSemiExpandedTxt ); break;
- case WIDTH_EXPANDED: aEntry.AppendAscii( ", " ); aEntry.Append( aExpandedTxt ); break;
- case WIDTH_EXTRA_EXPANDED: aEntry.AppendAscii( ", " ); aEntry.Append( aExtraExpandedTxt ); break;
- case WIDTH_ULTRA_EXPANDED: 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;
- }
-
- aEntry.AppendAscii( " (" );
- aEntry.Append( rFile );
- aEntry.AppendAscii( ")" );
- return aEntry;
-}
-
-void FontNameDlg::init()
-{
- ::std::list< fontID > aFonts;
- m_rFontManager.getFontList( aFonts );
- m_aFontBox.Clear();
- m_aRemoveButton.Enable( sal_False );
- m_aRenameButton.Enable( sal_False );
-
- ::boost::unordered_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 )
- {
- if( m_rFontManager.isPrivateFontFile( *font_it ) )
- {
- 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 );
- std::list< fontID > aDups;
- String aEntry;
- if( m_rFontManager.getFileDuplicates( *font_it, aDups ) )
- {
- FastPrintFontInfo aDupInfo;
- std::list< FastPrintFontInfo > aInfos;
- aInfos.push_back( aInfo );
- for( std::list< fontID >::iterator dup = aDups.begin(); dup != aDups.end(); ++dup )
- {
- 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 );
- sal_uInt16 nEntry = m_aFontBox.InsertEntry( aEntry );
- m_aFontBox.SetEntryData( nEntry, (void*)(sal_IntPtr)(*font_it) );
- }
- }
-}
-
-IMPL_LINK( FontNameDlg, SelectHdl, ListBox*, pBox )
-{
- if( pBox == &m_aFontBox )
- {
- sal_Bool bEnable = m_aFontBox.GetSelectEntryCount() ? sal_True : sal_False;
- m_aRemoveButton.Enable( bEnable );
- m_aRenameButton.Enable( bEnable );
- }
- return 0;
-}
-
-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();
- }
- else if( pButton == &m_aRemoveButton && AreYouSure( this, RID_QUERY_REMOVEFONTFROMLIST ) && m_aFontBox.GetSelectEntryCount() )
- {
- ::std::list< fontID > aRemoveIDs;
- for( i = 0; i < m_aFontBox.GetSelectEntryCount(); i++ )
- {
- int nSelect = m_aFontBox.GetSelectEntryPos( i );
- aRemoveIDs.push_back( (fontID)(sal_IntPtr)m_aFontBox.GetEntryData( nSelect ) );
- }
- m_rFontManager.removeFonts( aRemoveIDs );
- init();
- }
- else if( pButton == &m_aImportButton )
- {
- FontImportDialog aDialog( this );
- aDialog.Execute();
- init();
- }
- else if( pButton == &m_aRenameButton && m_aFontBox.GetSelectEntryCount() )
- {
- for( i = 0; i < m_aFontBox.GetSelectEntryCount(); i++ )
- {
- fontID aFont = (fontID)(sal_IntPtr)m_aFontBox.GetEntryData( m_aFontBox.GetSelectEntryPos( i ) );
- 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;
- }
- ::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 ) );
- }
- aQueryTxt.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aFamily );
- 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();
- }
- 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 ) ),
- m_aSelectAllBtn( this, PaResId( RID_FIMP_BTN_SELECTALL ) ),
- m_aNewFontsBox( this, PaResId( RID_FIMP_BOX_NEWFONTS ) ),
- m_aFromFL( this, PaResId( RID_FIMP_FL_FROM ) ),
- m_aFromDirEdt( this, PaResId( RID_FIMP_EDT_FROM ) ),
- m_aFromBtn( this, PaResId( RID_FIMP_BTN_FROM ) ),
- m_aSubDirsBox( this, PaResId( RID_FIMP_BOX_SUBDIRS ) ),
- m_aTargetOptFL( this, PaResId( RID_FIMP_FL_TARGETOPTS ) ),
- m_aLinkOnlyBox( this, PaResId( RID_FIMP_BOX_LINKONLY ) ),
- m_aFixedText( this, PaResId( RID_FIMP_TXT_HELP ) ),
- 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();
-
- m_aNewFontsBox.EnableMultiSelection( sal_True );
-
- m_aOKBtn.SetClickHdl( LINK( this, FontImportDialog, ClickBtnHdl ) );
- m_aSelectAllBtn.SetClickHdl( LINK( this, FontImportDialog, ClickBtnHdl ) );
- m_aFromBtn.SetClickHdl( LINK( this, FontImportDialog, ClickBtnHdl ) );
- m_aFromDirEdt.SetModifyHdl( LINK( this, FontImportDialog, ModifyHdl ) );
- m_aRefreshTimer.SetTimeoutHdl( LINK( this, FontImportDialog, RefreshTimeoutHdl ) );
- m_aRefreshTimer.SetTimeout( 2000 );
- m_aLinkOnlyBox.Check( sal_False );
- m_aSubDirsBox.Check( sal_True );
- m_aSubDirsBox.SetToggleHdl( LINK( this, FontImportDialog, ToggleHdl ) );
-
- Config& rPadminRC( getPadminRC() );
- rPadminRC.SetGroup( "FontImport" );
- m_aFromDirEdt.SetText( rtl::OStringToOUString(rPadminRC.ReadKey("FromPath"), RTL_TEXTENCODING_UTF8) );
- RefreshTimeoutHdl( NULL );
-}
-
-FontImportDialog::~FontImportDialog()
-{
- Config& rPadminRC( getPadminRC() );
- rPadminRC.SetGroup( "FontImport" );
- rPadminRC.WriteKey( "FromPath", rtl::OUStringToOString(m_aFromDirEdt.GetText(), RTL_TEXTENCODING_UTF8) );
-}
-
-void FontImportDialog::importFontsFailed( ::psp::PrintFontManager::ImportFontCallback::FailCondition eReason )
-{
- String aText;
- switch( eReason )
- {
- case psp::PrintFontManager::ImportFontCallback::NoWritableDirectory:
- aText = m_aNoWritableFontsDirText;
- break;
- default:
- break;
- }
- 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 )
- {
- case psp::PrintFontManager::ImportFontCallback::NoAfmMetric:
- aText = m_aNoAfmText;
- break;
- case psp::PrintFontManager::ImportFontCallback::AfmCopyFailed:
- aText = m_aAfmCopyFailedText;
- break;
- case psp::PrintFontManager::ImportFontCallback::FontCopyFailed:
- aText = m_aFontCopyFailedText;
- break;
- default:
- break;
- }
- 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();
-}
-
-IMPL_LINK( FontImportDialog, ModifyHdl, Edit*, EMPTYARG )
-{
- m_aRefreshTimer.Start();
- return 0;
-}
-
-IMPL_LINK( FontImportDialog, RefreshTimeoutHdl, void*, EMPTYARG )
-{
- rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
- std::list< String > aFiles;
- m_aNewFonts.clear();
- OUString aDirectory( m_aFromDirEdt.GetText() );
- FindFiles( aDirectory, aFiles, String( RTL_CONSTASCII_USTRINGPARAM( "PFA;PFB;TTF;TTC;OTF" ) ), m_aSubDirsBox.IsChecked() );
- OString aDir( OUStringToOString( aDirectory, aEncoding ) );
- aDir += "/";
- while( aFiles.begin() != aFiles.end() )
- {
- OString aFont( aDir );
- aFont += OUStringToOString( aFiles.front(), aEncoding );
- aFiles.pop_front();
- ::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();
-
- ::boost::unordered_map< OUString, int, OUStringHash > aFamilies;
- ::boost::unordered_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 )
- {
- OString aFileName( it->first.copy( it->first.lastIndexOf( '/' )+1 ) );
- OUString aFile( OStringToOUString( aFileName, aEncoding ) );
- 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 );
- sal_uInt16 nPos = m_aNewFontsBox.InsertEntry( aEntry );
- m_aNewFontsBox.SetEntryData( nPos, (void*)&(it->first) );
- }
-}
-
-void FontImportDialog::copyFonts()
-{
- ::std::list< OString > aFiles;
- for( int i = 0; i < m_aNewFontsBox.GetSelectEntryCount(); i++ )
- {
- OString* pFile = (OString*)m_aNewFontsBox.GetEntryData( m_aNewFontsBox.GetSelectEntryPos( i ) );
- aFiles.push_back( *pFile );
- }
-
- int nSuccess = 0;
- if( aFiles.size() )
- {
- m_nFont = 0;
- m_pProgress = new ProgressDialog( this );
- m_pProgress->setRange( 0, aFiles.size() );
- m_pProgress->startOperation( m_aImportOperation );
- m_pProgress->Show( sal_True );
- m_pProgress->setValue( 0 );
- m_pProgress->Invalidate();
- m_pProgress->Sync();
- nSuccess = m_rFontManager.importFonts( aFiles, m_aLinkOnlyBox.IsChecked() ? true : false, this );
- m_pProgress->Show( sal_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 )
-{
- if( pButton == &m_aFromBtn )
- {
- String aPath( m_aFromDirEdt.GetText() );
- if( chooseDirectory( aPath ) )
- {
- m_aFromDirEdt.SetText( aPath );
- RefreshTimeoutHdl( NULL );
- }
- }
- else if( pButton == &m_aOKBtn )
- {
- copyFonts();
- EndDialog( 0 );
- }
- else if( pButton == &m_aSelectAllBtn )
- {
- m_aNewFontsBox.SetUpdateMode( sal_False );
- for( int i = 0; i < m_aNewFontsBox.GetEntryCount(); i++ )
- m_aNewFontsBox.SelectEntryPos( i, sal_True );
- m_aNewFontsBox.SetUpdateMode( sal_True );
- }
- return 0;
-}
-
-IMPL_LINK( FontImportDialog, ToggleHdl, CheckBox*, pBox )
-{
- if( pBox == &m_aSubDirsBox )
- {
- RefreshTimeoutHdl( NULL );
- }
-
- return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/padmin/source/fontentry.hxx b/padmin/source/fontentry.hxx
deleted file mode 100644
index 88d05d9..0000000
--- a/padmin/source/fontentry.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * 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.
- *
- ************************************************************************/
-
-#ifndef _PAD_FONTENTRY_HXX_
-#define _PAD_FONTENTRY_HXX_
-
-#include "progress.hxx"
-#include "helper.hxx"
-
-#include "vcl/timer.hxx"
-#include "vcl/dialog.hxx"
-#include "vcl/button.hxx"
-#include "vcl/combobox.hxx"
-#include "vcl/lstbox.hxx"
-#include "vcl/group.hxx"
-#include "vcl/fontmanager.hxx"
-
-namespace padmin {
-
- class FontImportDialog :
- public ModalDialog,
- public ::psp::PrintFontManager::ImportFontCallback
- {
- OKButton m_aOKBtn;
- CancelButton m_aCancelBtn;
- PushButton m_aSelectAllBtn;
- ListBox m_aNewFontsBox;
- FixedLine m_aFromFL;
- Edit m_aFromDirEdt;
- PushButton m_aFromBtn;
- CheckBox m_aSubDirsBox;
- FixedLine m_aTargetOptFL;
- CheckBox m_aLinkOnlyBox;
- FixedText m_aFixedText;
- bool m_bOverwriteAll;
- bool m_bOverwriteNone;
- ProgressDialog* m_pProgress;
- int m_nFont;
-
- String m_aImportOperation;
- String m_aOverwriteQueryText;
- String m_aOverwriteAllText;
- String m_aOverwriteNoneText;
- String m_aNoAfmText;
- String m_aAfmCopyFailedText;
- String m_aFontCopyFailedText;
- String m_aNoWritableFontsDirText;
- String m_aFontsImportedText;
-
- ::boost::unordered_map< ::rtl::OString, ::std::list< ::psp::FastPrintFontInfo >, ::rtl::OStringHash >
- m_aNewFonts;
-
- Timer m_aRefreshTimer;
- DECL_LINK( RefreshTimeoutHdl, void* );
-
-
- ::psp::PrintFontManager& m_rFontManager;
-
- DECL_LINK( ClickBtnHdl, Button* );
- DECL_LINK( ModifyHdl, Edit* );
- DECL_LINK( ToggleHdl, CheckBox* );
-
- // implement ImportFontCallback
- virtual void importFontsFailed( ::psp::PrintFontManager::ImportFontCallback::FailCondition eReason );
- virtual void progress( const ::rtl::OUString& rFile );
- virtual bool queryOverwriteFile( const ::rtl::OUString& rFile );
- virtual void importFontFailed( const ::rtl::OUString& rFile, ::psp::PrintFontManager::ImportFontCallback::FailCondition eReason );
- virtual bool isCanceled();
-
- void copyFonts();
- void fillFontBox();
- public:
- FontImportDialog( Window* );
- ~FontImportDialog();
- };
-
- class FontNameDlg : public ModalDialog
- {
- private:
- OKButton m_aOKButton;
- PushButton m_aRenameButton;
- PushButton m_aRemoveButton;
- PushButton m_aImportButton;
-
- DelListBox m_aFontBox;
- FixedText m_aFixedText;
-
- String m_aRenameString;
- String m_aRenameTTCString;
- String m_aNoRenameString;
-
- ::psp::PrintFontManager& m_rFontManager;
-
- // maps fontID to XLFD
- ::boost::unordered_map< ::psp::fontID, String >
- m_aFonts;
- void init();
- public:
- FontNameDlg( Window* );
- ~FontNameDlg();
-
- DECL_LINK( ClickBtnHdl, Button* );
- DECL_LINK( DelPressedHdl, ListBox* );
- DECL_LINK( SelectHdl, ListBox* );
-
- static String fillFontEntry( ::psp::FastPrintFontInfo& rInfo, const String& rFile, bool bAddRegular );
- static String fillFontEntry( const ::std::list< ::psp::FastPrintFontInfo >& rInfos, const String& rFile );
- };
-} // namespace
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index 9b0e62e..3da1b5d 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -33,7 +33,6 @@
#include <math.h>
#include "padialog.hrc"
-#include "fontentry.hxx"
#include "helper.hxx"
#include "padialog.hxx"
#include "adddlg.hxx"
diff --git a/padmin/source/padialog.hrc b/padmin/source/padialog.hrc
index 9ae1bfe..439cab7 100644
--- a/padmin/source/padialog.hrc
+++ b/padmin/source/padialog.hrc
@@ -48,7 +48,7 @@
#define RID_PA_TXT_COMMENT_STRING 17
#define RID_PA_STR_DEFPRT 18
#define RID_PA_BTN_ADD 19
-#define RID_PA_BTN_ADDFONTS 20
+
#define RID_PA_STR_RENAME 21
#define RID_PA_FL_SEPBUTTON 22
#define RID_PA_FL_CUPSUSAGE 23
@@ -84,12 +84,6 @@
#define RID_ERR_FILEOPENWRITE 1017
#define RID_QRY_PRTNAME 1022
-#define RID_FONTLISTDLG 1026
-#define RID_FLDLG_BTN_OK 1
-#define RID_FLDLG_LB_FONTS 2
-#define RID_FLDLG_BTN_REMOVE 3
-#define RID_FLDLG_TXT 4
-
#define RID_METRICOPTIONS_DLG 1029
#define RID_METDLG_BTN_OK 1
#define RID_METDLG_BTN_CANCEL 2
@@ -97,17 +91,6 @@
#define RID_METDLG_BTN_ALL 4
#define RID_METDLG_BTN_CORRECT 5
-#define RID_FONTNAMEDIALOG 1030
-#define RID_FNTNM_FIXED 1
-#define RID_FNTNM_BTN_OK 2
-#define RID_FNTNM_BTN_REMOVE 3
-#define RID_FNTNM_LB_FONTS 4
-#define RID_FNTNM_BTN_IMPORT 5
-#define RID_FNTNM_BTN_RENAME 6
-#define RID_FNTNM_STR_RENAME 7
-#define RID_FNTNM_STR_TTCRENAME 8
-#define RID_FNTNM_STR_NOTRENAMABLE 9
-
#define RID_TXT_REFETCH 1031
#define RID_BXT_TESTPAGE 1034
@@ -123,42 +106,18 @@
#define RID_COMMAND_TXT_ADDENTRY 1050
#define RID_ERR_REMOVESGENPRT 1051
#define RID_PA_TXT_NOWRITE 1052
-#define RID_DOUBLEFONTFILE 1053
-#define RID_INVALIDFONTPATH 1054
+
+
#define RID_TESTPAGESAVE 1055
-#define RID_FNTNM_FONTNAME_TXT 1056
-#define RID_FNTNM_NOFONT_TXT 1057
+
+
#define RID_QUERY_REMOVEDRIVER 1058
#define RID_QUERY_REMOVEPRINTER 1059
-#define RID_QUERY_REMOVEFONTFROMLIST 1060
#define RID_QUERY_DRIVERUSED 1062
#define RID_ERR_REMOVEDEFAULTDRIVER 1063
-#define RID_ERR_WRITEFONTSDIR 1064
-
-#define RID_FONTIMPORT_DIALOG 1065
-#define RID_FIMP_BTN_OK 1
-#define RID_FIMP_BTN_CANCEL 2
-#define RID_FIMP_EDT_FROM 3
-#define RID_FIMP_BTN_FROM 4
-#define RID_FIMP_FL_FROM 5
-#define RID_FIMP_BTN_SELECTALL 6
-#define RID_FIMP_BOX_NEWFONTS 7
-#define RID_FIMP_TXT_HELP 8
-#define RID_FIMP_STR_IMPORTOP 9
-#define RID_FIMP_STR_QUERYOVERWRITE 10
-#define RID_FIMP_STR_OVERWRITEALL 11
-#define RID_FIMP_STR_OVERWRITENONE 12
-#define RID_FIMP_STR_NOAFM 13
-#define RID_FIMP_STR_AFMCOPYFAILED 14
-#define RID_FIMP_STR_FONTCOPYFAILED 15
-#define RID_FIMP_STR_NOWRITEABLEFONTSDIR 16
-#define RID_FIMP_STR_NUMBEROFFONTSIMPORTED 17
-#define RID_FIMP_BOX_LINKONLY 18
-#define RID_FIMP_BOX_SUBDIRS 19
-#define RID_FIMP_FL_TARGETOPTS 20
#define RID_TXT_IMPORTTITLE 1066
-#define RID_TXT_FONTS2IMPORT 1067
+
#define RID_TXT_TESTPAGE_MODEL 1068
#define RID_TXT_TESTPAGE_QUEUE 1069
#define RID_TXT_TESTPAGE_DATE 1070
@@ -170,41 +129,11 @@
#define RID_TXT_TESTPAGE_COMMENT 1076
#define RID_TXT_TESTPAGE_NAME 1077
-#define RID_TXT_FONT_ITALIC 1078
-#define RID_TXT_FONT_OBLIQUE 1079
-#define RID_TXT_FONT_THIN 1080
-#define RID_TXT_FONT_ULTRALIGHT 1081
-#define RID_TXT_FONT_LIGHT 1082
-#define RID_TXT_FONT_SEMILIGHT 1083
-#define RID_TXT_FONT_SEMIBOLD 1084
-#define RID_TXT_FONT_BOLD 1085
-#define RID_TXT_FONT_ULTRABOLD 1086
-#define RID_TXT_FONT_ULTRACONDENSED 1087
-#define RID_TXT_FONT_EXTRACONDENSED 1088
-#define RID_TXT_FONT_CONDENSED 1089
-#define RID_TXT_FONT_SEMICONDENSED 1090
-#define RID_TXT_FONT_SEMIEXPANDED 1091
-#define RID_TXT_FONT_EXPANDED 1092
-#define RID_TXT_FONT_EXTRAEXPANDED 1093
-#define RID_TXT_FONT_ULTRAEXPANDED 1094
-#define RID_TXT_FONT_REGULAR 1095
-
#define RID_BMP_SMALL_PRINTER 1096
#define RID_BMP_SMALL_FAX 1098
#define RID_BMP_SMALL_PDF 1100
#define RID_BMP_PRINTER 1102
-#define RID_AFMERROR_OK 1300
-#define RID_AFMERROR_NO_FONT_NAME 1301
-#define RID_AFMERROR_NO_FULL_NAME 1302
-#define RID_AFMERROR_NO_FAMILY_NAME 1303
-#define RID_AFMERROR_MOVETO_FAILED 1304
-#define RID_AFMERROR_STREAM_READ_FAILED 1305
-#define RID_AFMERROR_STREAM_WRITE_FAILED 1306
-#define RID_AFMERROR_NOT_A_METRIC 1307
-
-#define RID_AFMERROR_BOX_TXT 1350
-
#define RID_PROGRESS_DLG 1400
#define RID_PROGRESS_BTN_CANCEL 1
#define RID_PROGRESS_OPERATION_TXT 2
@@ -212,12 +141,6 @@
#define RID_PROGRESS_STATUSBAR 5
#define RID_PROGRESS_FILENAME_TXT 6
-#define RID_OPERATION_FONTINTEGRATE 1402
-#define RID_OPERATION_FONTADD 1403
-#define RID_OPERATION_CONVERTMETRIC 1406
-#define RID_OPERATION_FONTCOLLECT 1407
-#define RID_OPERATION_FONTIMPORT 1408
-
#define RID_ADD_PRINTER_DIALOG 2000
#define RID_ADDP_BTN_FINISH 1
#define RID_ADDP_BTN_CANCEL 2
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index 194dea7..11c3352 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -27,130 +27,6 @@
#include "padialog.hrc"
-ModalDialog RID_FONTIMPORT_DIALOG
-{
- HelpID = "padmin:ModalDialog:RID_FONTIMPORT_DIALOG";
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 230 , 185 );
- Moveable = TRUE ;
- Closeable = TRUE ;
-
- ListBox RID_FIMP_BOX_NEWFONTS
- {
- HelpID = "padmin:ListBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_NEWFONTS";
- Border = TRUE;
- Sort=TRUE;
- AutoHScroll = TRUE;
- Pos = MAP_APPFONT( 5, 5 );
- Size = MAP_APPFONT( 155, 75 );
- };
- FixedText RID_FIMP_TXT_HELP
- {
- Pos = MAP_APPFONT( 5, 155 );
- Size = MAP_APPFONT( 220, 24 );
- WordBreak=TRUE;
- Text [ en-US ] = "Please select the folder from which you want to import fonts. Add the selected fonts by clicking the OK button.";
- };
- FixedLine RID_FIMP_FL_FROM
- {
- Pos = MAP_APPFONT( 5, 85 );
- Size = MAP_APPFONT( 160, 8 );
- Text [ en-US ] = "Source directory";
- };
- Edit RID_FIMP_EDT_FROM
- {
- HelpID = "padmin:Edit:RID_FONTIMPORT_DIALOG:RID_FIMP_EDT_FROM";
- Border = TRUE;
- Pos = MAP_APPFONT( 10, 97 );
- Size = MAP_APPFONT( 130, 12 );
- };
- PushButton RID_FIMP_BTN_FROM
- {
- HelpID = "padmin:PushButton:RID_FONTIMPORT_DIALOG:RID_FIMP_BTN_FROM";
- Pos = MAP_APPFONT( 145, 97 );
- Size = MAP_APPFONT( 15, 12 );
- Text = "...";
- };
- CheckBox RID_FIMP_BOX_SUBDIRS
- {
- HelpID = "padmin:CheckBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_SUBDIRS";
- Pos = MAP_APPFONT( 10, 115 );
- Size = MAP_APPFONT( 145, 10 );
- Text [ en-US ] = "Sea~rch Subdirectories";
- };
- FixedLine RID_FIMP_FL_TARGETOPTS
- {
- Pos = MAP_APPFONT( 5, 130 );
- Size = MAP_APPFONT( 160, 8 );
- Text [ en-US ] = "Target options";
- };
-
- CheckBox RID_FIMP_BOX_LINKONLY
- {
- HelpID = "padmin:CheckBox:RID_FONTIMPORT_DIALOG:RID_FIMP_BOX_LINKONLY";
- Pos = MAP_APPFONT( 10, 140 );
- Size = MAP_APPFONT( 145, 10 );
- Text [ en-US ] = "Create ~soft links only";
- };
- OKButton RID_FIMP_BTN_OK
- {
- DefButton = TRUE;
- Pos = MAP_APPFONT( 175, 10 );
- Size = MAP_APPFONT( 50, 12 );
- };
- CancelButton RID_FIMP_BTN_CANCEL
- {
- Pos = MAP_APPFONT( 175, 27 );
- Size = MAP_APPFONT( 50, 12 );
- };
- PushButton RID_FIMP_BTN_SELECTALL
- {
- HelpID = "padmin:PushButton:RID_FONTIMPORT_DIALOG:RID_FIMP_BTN_SELECTALL";
- Pos = MAP_APPFONT( 175, 44 );
- Size = MAP_APPFONT( 50, 12 );
- Text [ en-US ] = "~Select All";
- };
- String RID_FIMP_STR_IMPORTOP
- {
- Text [ en-US ] = "Add fonts";
- };
- String RID_FIMP_STR_QUERYOVERWRITE
- {
- Text [ en-US ] = "Do you really want to overwrite this font file?\n %s";
- };
- String RID_FIMP_STR_OVERWRITEALL
- {
- Text [ en-US ] = "All";
- };
- String RID_FIMP_STR_OVERWRITENONE
- {
- Text [ en-US ] = "None";
- };
-
- String RID_FIMP_STR_NOAFM
- {
- Text [ en-US ] = "A format file (with an .afm extension) has not been found for the font\n%s\ntherefore, the font cannot be installed. Format files can be created with ghostscript, for example, and have to be located in the same directory as the font files or its afm subdirectory.";
- };
- String RID_FIMP_STR_AFMCOPYFAILED
- {
- Text [ en-US ] = "The metric file for the font file\n %s\ncould not be copied. The font will not be installed.";
- };
- String RID_FIMP_STR_FONTCOPYFAILED
- {
- Text [ en-US ] = "The font file\n %s\ncould not be copied. The font will not be installed.";
- };
- String RID_FIMP_STR_NOWRITEABLEFONTSDIR
- {
- Text [ en-US ] = "A directory containing a writable fonts.dir file is not located in the Fontpath. Therefore, fonts cannot be installed.";
- };
- String RID_FIMP_STR_NUMBEROFFONTSIMPORTED
- {
- Text [ en-US ] = "%d new fonts were added.";
- };
- Text [ en-US ] = "Add Fonts";
-};
-
ModalDialog RID_PADIALOG
{
HelpID = "padmin:ModalDialog:RID_PADIALOG";
@@ -394,73 +270,6 @@ String RID_TXT_TESTPAGE_TIME
};
-ModalDialog RID_FONTNAMEDIALOG
-{
- HelpID = "padmin:ModalDialog:RID_FONTNAMEDIALOG";
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 255 , 110 ) ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- OKButton RID_FNTNM_BTN_OK
- {
- DefButton = TRUE ;
- Pos = MAP_APPFONT ( 196 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- Text [ en-US ] = "Close";
- };
- PushButton RID_FNTNM_BTN_RENAME
- {
- HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_RENAME";
- Pos = MAP_APPFONT( 196, 31 );
- Size = MAP_APPFONT( 50, 12 );
- Text [ en-US ] = "Re~name...";
- };
- PushButton RID_FNTNM_BTN_REMOVE
- {
- HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_REMOVE";
- Pos = MAP_APPFONT ( 196 , 48 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- Text [ en-US ] = "~Remove...";
- };
- PushButton RID_FNTNM_BTN_IMPORT
- {
- HelpID = "padmin:PushButton:RID_FONTNAMEDIALOG:RID_FNTNM_BTN_IMPORT";
- Pos = MAP_APPFONT ( 196 , 65 ) ;
- Size = MAP_APPFONT ( 50 , 12 ) ;
- Text [ en-US ] = "~Add...";
- };
- ListBox RID_FNTNM_LB_FONTS
- {
- HelpID = "padmin:ListBox:RID_FONTNAMEDIALOG:RID_FNTNM_LB_FONTS";
- Border = TRUE ;
- Sort = TRUE ;
- AutoHScroll = TRUE;
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 185 , 70 ) ;
- };
- FixedText RID_FNTNM_FIXED
- {
- Pos = MAP_APPFONT ( 6 , 81 ) ;
- Size = MAP_APPFONT ( 175 , 24 ) ;
- WordBreak = TRUE;
- Text [ en-US ] = "Note: The fonts are only available to the applications.";
- };
- String RID_FNTNM_STR_RENAME
- {
- Text [ en-US ] = "~New name for %s";
- };
- String RID_FNTNM_STR_TTCRENAME
- {
- Text [ en-US ] = "~New name for %s (%d1 of %d2)";
- };
- String RID_FNTNM_STR_NOTRENAMABLE
- {
- Text [ en-US ] = "The font %s cannot be renamed due to missing write permission.";
- };
- Text [ en-US ] = "Fonts";
-};
-
String RID_BXT_TESTPAGE
{
Text [ en-US ] = "Test page";
@@ -501,51 +310,6 @@ Bitmap RID_BMP_PRINTER
File = "source/printer_large.png";
};
-String RID_AFMERROR_OK
-{
- Text [ en-US ] = "No error";
-};
-
-String RID_AFMERROR_NO_FONT_NAME
-{
- Text [ en-US ] = "The metric does not contain a 'FontName' entry.";
-};
-
-String RID_AFMERROR_NO_FULL_NAME
-{
- Text [ en-US ] = "The metric does not contain a 'FullName' entry.";
-};
-
-String RID_AFMERROR_NO_FAMILY_NAME
-{
- Text [ en-US ] = "The metric does not contain a 'FamilyName' entry.";
-};
-
-String RID_AFMERROR_MOVETO_FAILED
-{
- Text [ en-US ] = "The converted metric could not be written.";
-};
-
-String RID_AFMERROR_STREAM_READ_FAILED
-{
- Text [ en-US ] = "The metric could not be read.";
-};
-
-String RID_AFMERROR_STREAM_WRITE_FAILED
-{
- Text [ en-US ] = "A temporary file could not be created.";
-};
-
-STRING RID_AFMERROR_NOT_A_METRIC
-{
- Text [ en-US ] = "The file does not contain a metric.";
-};
-
-String RID_AFMERROR_BOX_TXT
-{
- Text [ en-US ] = "The metric\n\n%s\n\ncould not be converted for the following reason:\n\n";
-};
-
ModelessDialog RID_PROGRESS_DLG
{
HelpID = "padmin:ModelessDialog:RID_PROGRESS_DLG";
@@ -586,12 +350,6 @@ ModelessDialog RID_PROGRESS_DLG
Text [ en-US ] = "Please wait";
};
-String RID_OPERATION_CONVERTMETRIC
-{
- Text [ en-US ] = "Font metrics conversion";
-};
-
-
ModalDialog RID_PPDIMPORT_DLG
{
HelpID = "padmin:ModalDialog:RID_PPDIMPORT_DLG";
@@ -683,11 +441,6 @@ String RID_QUERY_REMOVEPRINTER
Text [ en-US ] = "Do you really want to remove this printer ?";
};
-String RID_QUERY_REMOVEFONTFROMLIST
-{
- Text [ en-US ] = "Do you really want to remove the selected fonts ?";
-};
-
String RID_QUERY_DRIVERUSED
{
Text [ en-US ] = "There are still printers using the driver \"%s\". Do you really want to remove it? The corresponding printers will also be removed.";
@@ -1110,95 +863,3 @@ TabPage RID_ADDP_PAGE_PDFDRIVER
Text [ en-US ] = "A spec~ific driver, to adapt the format to another printer";
};
};
-
-String RID_TXT_FONT_ITALIC
-{
- Text [ en-US ] = "Italic";
-};
-
-String RID_TXT_FONT_OBLIQUE
-{
- Text [ en-US ] = "Oblique";
-};
-
-String RID_TXT_FONT_THIN
-{
- Text [ en-US ] = "Thin";
-};
-
-String RID_TXT_FONT_ULTRALIGHT
-{
- Text [ en-US ] = "Ultralight";
-};
-
-String RID_TXT_FONT_SEMILIGHT
-{
- Text [ en-US ] = "Semilight";
-};
-
-String RID_TXT_FONT_LIGHT
-{
- Text [ en-US ] = "Light";
-};
-
-String RID_TXT_FONT_SEMIBOLD
-{
- Text [ en-US ] = "Semibold";
-};
-
-String RID_TXT_FONT_BOLD
-{
- Text [ en-US ] = "Bold";
-};
-
-String RID_TXT_FONT_ULTRABOLD
-{
- Text [ en-US ] = "Ultrabold";
-};
-
-String RID_TXT_FONT_ULTRACONDENSED
-{
- Text [ en-US ] = "Ultracondensed";
-};
-
-String RID_TXT_FONT_EXTRACONDENSED
-{
- Text [ en-US ] = "Extracondensed";
-};
-
-String RID_TXT_FONT_CONDENSED
-{
- Text [ en-US ] = "Condensed";
-};
-
-String RID_TXT_FONT_SEMICONDENSED
-{
- Text [ en-US ] = "Semicondensed";
-};
-
-String RID_TXT_FONT_SEMIEXPANDED
-{
- Text [ en-US ] = "Semiexpanded";
-};
-
-String RID_TXT_FONT_EXPANDED
-{
- Text [ en-US ] = "Expanded";
-};
-
-String RID_TXT_FONT_EXTRAEXPANDED
-{
- Text [ en-US ] = "Extraexpanded";
-};
-
-String RID_TXT_FONT_ULTRAEXPANDED
-{
- Text [ en-US ] = "Ultraexpanded";
-};
-
-String RID_TXT_FONT_REGULAR
-{
- Text [ en-US ] = "Regular";
-};
-
-
diff --git a/unusedcode.easy b/unusedcode.easy
index 16a4630..14d7c9b 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1897,7 +1897,6 @@ utl::NodeValueAccessor::bind(com::sun::star::uno::Any*)
utl::OConfigurationNode::appendNode(rtl::OUString const&, utl::OConfigurationNode const&) const
utl::OConfigurationValueContainer::getServiceFactory() const
utl::TransliterationWrapper::compareSubstring(String const&, int, int, String const&, int, int) const
-vcl::Clipboard_getSupportedServiceNames()
vcl::I18nHelper::GetDate(Date const&) const
vcl::I18nHelper::getLocale() const
vcl::LabeledElement::setLabel(boost::shared_ptr<vcl::WindowArranger> const&)
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 5ca8694..e99044e 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -3471,96 +3471,6 @@ getImportableFontProperties(
// -------------------------------------------------------------------------
-bool PrintFontManager::getFileDuplicates( fontID nFont, ::std::list< fontID >& rFonts ) const
-{
- bool bRet = false;
-
- rFonts.clear();
-
- PrintFont* pSearchFont = getFont( nFont );
- if( ! pSearchFont ||
- pSearchFont->m_eType != fonttype::TrueType ||
- static_cast<TrueTypeFontFile*>(pSearchFont)->m_nCollectionEntry == -1
- )
- return false;
-
- OString aFile( getFontFileSysPath( nFont ) );
- if( ! aFile.getLength() )
- return false;
-
- for( ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it )
- {
- if( nFont != it->first )
- {
- OString aCompFile( getFontFile( it->second ) );
- if( aCompFile == aFile )
- {
- rFonts.push_back( it->first );
- bRet = true;
- }
- }
- }
- return bRet;
-}
-
-// -------------------------------------------------------------------------
-
-bool PrintFontManager::removeFonts( const ::std::list< fontID >& rFonts )
-{
- bool bRet = true;
- ::std::list< fontID > aDuplicates;
- for( ::std::list< fontID >::const_iterator it = rFonts.begin(); it != rFonts.end(); ++it )
- {
- ::boost::unordered_map< fontID, PrintFont* >::const_iterator haveFont = m_aFonts.find( *it );
- if( haveFont == m_aFonts.end() )
- continue;
-
- PrintFont* pFont = haveFont->second;
- bool bRemoveDuplicates = getFileDuplicates( *it, aDuplicates );
- ByteString aFile( getFontFile( pFont ) );
- if( aFile.Len() )
- {
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "try unlink( \"%s\" ) ... ", aFile.GetBuffer() );
-#endif
- if( unlink( aFile.GetBuffer() ) )
- {
- bRet = false;
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "failed\n" );
-#endif
- continue;
- }
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "succeeded\n" );
-#endif
- OString aAfm( getAfmFile( pFont ) );
- if( aAfm.getLength() )
- {
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "unlink( \"%s\" )\n", aAfm.getStr() );
-#endif
- unlink( aAfm.getStr() );
- }
- m_aFonts.erase( *it );
- delete pFont;
- if( bRemoveDuplicates )
- {
- for( ::std::list< fontID >::iterator dup = aDuplicates.begin(); dup != aDuplicates.end(); ++dup )
- {
- m_aFontFileToFontID[ aFile ].erase( *dup );
- PrintFont* pDup = m_aFonts[ *dup ];
- m_aFonts.erase( *dup );
- delete pDup;
- }
- }
- }
- }
- return bRet;
-}
-
-// -------------------------------------------------------------------------
-
bool PrintFontManager::isPrivateFontFile( fontID nFont ) const
{
bool bRet = false;
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index f9708c3..6a522c1 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -607,11 +607,6 @@ public:
// get properties of a not imported font file
bool getImportableFontProperties( const rtl::OString& rFile, std::list< FastPrintFontInfo >& rFontProps );
- // get fonts that come from the same font file
- bool getFileDuplicates( fontID nFont, std::list< fontID >& rFonts ) const;
- // remove font files
- bool removeFonts( const std::list< fontID >& rFonts );
-
bool isPrivateFontFile( fontID ) const;
// returns false if there were not any
commit 44cf768131e8a06ff688ddfa8b53f144ffb9e4a0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 11 11:03:55 2012 +0000
adapt findFontFileID to know about multiple font faces in a font file
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index 0c3655c..d3b1f2b 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -1019,12 +1019,16 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star
//extract the closest match
FcChar8* file = NULL;
FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file);
+ int nCollectionEntry = 0;
+ FcResult eIndexRes = FcPatternGetInteger(pSet->fonts[0], FC_INDEX, 0, &nCollectionEntry);
+ if (eIndexRes != FcResultMatch)
+ nCollectionEntry = 0;
if( eFileRes == FcResultMatch )
{
OString aDir, aBase, aOrgPath( (sal_Char*)file );
splitPath( aOrgPath, aDir, aBase );
int nDirID = getDirectoryAtom( aDir, true );
- fontID aFont = findFontFileID( nDirID, aBase );
+ fontID aFont = findFontFileID( nDirID, aBase, nCollectionEntry );
if( aFont > 0 )
bSuccess = getFontFastInfo( aFont, rInfo );
}
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 6f57f4b..5ca8694 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -1253,7 +1253,7 @@ int PrintFontManager::getDirectoryAtom( const OString& rDirectory, bool bCreate
// -------------------------------------------------------------------------
-int PrintFontManager::addFontFile( const ::rtl::OString& rFileName )
+std::vector<fontID> PrintFontManager::addFontFile( const ::rtl::OString& rFileName )
{
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
INetURLObject aPath( OStringToOUString( rFileName, aEncoding ), INET_PROT_FILE, INetURLObject::ENCODE_ALL );
@@ -1261,8 +1261,8 @@ int PrintFontManager::addFontFile( const ::rtl::OString& rFileName )
OString aDir( OUStringToOString( aPath.GetPath(), aEncoding ) );
int nDirID = getDirectoryAtom( aDir, true );
- fontID nFontId = findFontFileID( nDirID, aName );
- if( !nFontId )
+ std::vector<fontID> aFontIds = findFontFileIDs( nDirID, aName );
+ if( aFontIds.empty() )
{
::std::list< PrintFont* > aNewFonts;
if( analyzeFontFile( nDirID, aName, ::std::list<OString>(), aNewFonts ) )
@@ -1270,13 +1270,15 @@ int PrintFontManager::addFontFile( const ::rtl::OString& rFileName )
for( ::std::list< PrintFont* >::iterator it = aNewFonts.begin();
it != aNewFonts.end(); ++it )
{
- m_aFonts[ nFontId = m_nNextFontID++ ] = *it;
+ fontID nFontId = m_nNextFontID++;
+ m_aFonts[nFontId] = *it;
m_aFontFileToFontID[ aName ].insert( nFontId );
m_pFontCache->updateFontCacheEntry( *it, true );
+ aFontIds.push_back(nFontId);
}
}
}
- return nFontId;
+ return aFontIds;
}
enum fontFormat
@@ -1454,50 +1456,98 @@ fontID PrintFontManager::findFontBuiltinID( int nPSNameAtom ) const
// -------------------------------------------------------------------------
-fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile ) const
+fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile, int nFaceIndex ) const
{
fontID nID = 0;
::boost::unordered_map< OString, ::std::set< fontID >, OStringHash >::const_iterator set_it = m_aFontFileToFontID.find( rFontFile );
- if( set_it != m_aFontFileToFontID.end() )
+ if( set_it == m_aFontFileToFontID.end() )
+ return nID;
+
+ for( ::std::set< fontID >::const_iterator font_it = set_it->second.begin(); font_it != set_it->second.end() && ! nID; ++font_it )
{
- for( ::std::set< fontID >::const_iterator font_it = set_it->second.begin(); font_it != set_it->second.end() && ! nID; ++font_it )
+ ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.find( *font_it );
+ if( it == m_aFonts.end() )
+ continue;
+ switch( it->second->m_eType )
{
- ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.find( *font_it );
- if( it != m_aFonts.end() )
+ case fonttype::Type1:
{
- switch( it->second->m_eType )
+ Type1FontFile* const pFont = static_cast< Type1FontFile* const >((*it).second);
+ if( pFont->m_nDirectory == nDirID &&
+ pFont->m_aFontFile == rFontFile )
+ nID = it->first;
+ }
+ break;
+ case fonttype::TrueType:
+ {
+ TrueTypeFontFile* const pFont = static_cast< TrueTypeFontFile* const >((*it).second);
+ if( pFont->m_nDirectory == nDirID &&
+ pFont->m_aFontFile == rFontFile )
{
- case fonttype::Type1:
- {
- Type1FontFile* const pFont = static_cast< Type1FontFile* const >((*it).second);
- if( pFont->m_nDirectory == nDirID &&
- pFont->m_aFontFile == rFontFile )
- nID = it->first;
- }
- break;
- case fonttype::TrueType:
- {
- TrueTypeFontFile* const pFont = static_cast< TrueTypeFontFile* const >((*it).second);
- if( pFont->m_nDirectory == nDirID &&
- pFont->m_aFontFile == rFontFile )
- nID = it->first;
- }
- break;
- case fonttype::Builtin:
- if( static_cast<const BuiltinFont*>((*it).second)->m_nDirectory == nDirID &&
- static_cast<const BuiltinFont*>((*it).second)->m_aMetricFile == rFontFile )
- nID = it->first;
- break;
- default:
- break;
+ fprintf(stderr, "candidate %d vs %d\n", pFont->m_nCollectionEntry, nFaceIndex);
+ if (pFont->m_nCollectionEntry == nFaceIndex)
+ nID = it->first;
}
}
+ break;
+ case fonttype::Builtin:
+ if( static_cast<const BuiltinFont*>((*it).second)->m_nDirectory == nDirID &&
+ static_cast<const BuiltinFont*>((*it).second)->m_aMetricFile == rFontFile )
+ nID = it->first;
+ break;
+ default:
+ break;
}
}
+
return nID;
}
+std::vector<fontID> PrintFontManager::findFontFileIDs( int nDirID, const OString& rFontFile ) const
+{
+ std::vector<fontID> aIds;
+
+ ::boost::unordered_map< OString, ::std::set< fontID >, OStringHash >::const_iterator set_it = m_aFontFileToFontID.find( rFontFile );
+ if( set_it == m_aFontFileToFontID.end() )
+ return aIds;
+
+ for( ::std::set< fontID >::const_iterator font_it = set_it->second.begin(); font_it != set_it->second.end(); ++font_it )
+ {
+ ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.find( *font_it );
+ if( it == m_aFonts.end() )
+ continue;
+ switch( it->second->m_eType )
+ {
+ case fonttype::Type1:
+ {
+ Type1FontFile* const pFont = static_cast< Type1FontFile* const >((*it).second);
+ if( pFont->m_nDirectory == nDirID &&
+ pFont->m_aFontFile == rFontFile )
+ aIds.push_back(it->first);
+ }
+ break;
+ case fonttype::TrueType:
+ {
+ TrueTypeFontFile* const pFont = static_cast< TrueTypeFontFile* const >((*it).second);
+ if( pFont->m_nDirectory == nDirID &&
+ pFont->m_aFontFile == rFontFile )
+ aIds.push_back(it->first);
+ }
+ break;
+ case fonttype::Builtin:
+ if( static_cast<const BuiltinFont*>((*it).second)->m_nDirectory == nDirID &&
+ static_cast<const BuiltinFont*>((*it).second)->m_aMetricFile == rFontFile )
+ aIds.push_back(it->first);
+ break;
+ default:
+ break;
+ }
+ }
+
+ return aIds;
+}
+
// -------------------------------------------------------------------------
bool PrintFontManager::parseXLFD( const OString& rXLFD, XLFDEntry& rEntry )
@@ -2288,7 +2338,7 @@ void PrintFontManager::initialize()
if( ! stat( aFilePath.getStr(), &aStat ) &&
S_ISREG( aStat.st_mode ) )
{
- if( findFontFileID( nDirID, aFileName ) == 0 )
+ if (!knownFontFile(nDirID, aFileName))
{
::std::list<OString> aXLFDs;
::boost::unordered_map< OString, ::std::list<OString>, OStringHash >::const_iterator it =
@@ -3313,7 +3363,7 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL
++current;
}
- DBG_ASSERT( !findFontFileID( nDirID, aFileName ), "not all fonts removed for file" );
+ DBG_ASSERT( !knownFontFile( nDirID, aFileName ), "not all fonts removed for file" );
nSuccess++;
for( it = aNewFonts.begin(); it != aNewFonts.end(); ++it )
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index b632908..f9708c3 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -337,9 +337,18 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
rtl::OUString convertTrueTypeName( void* pNameRecord ) const; // actually a NameRecord* formt font subsetting code
void analyzeTrueTypeFamilyName( void* pTTFont, std::list< rtl::OUString >& rnames ) const; // actually a TrueTypeFont* from font subsetting code
bool analyzeTrueTypeFile( PrintFont* pFont ) const;
- // finds the FIRST id for this font file; there may be more
- // for TrueType collections
- fontID findFontFileID( int nDirID, const rtl::OString& rFile ) const;
+ // finds the font id for the nFaceIndex face in this font file
+ // There may be multiple font ids for TrueType collections
+ fontID findFontFileID( int nDirID, const rtl::OString& rFile, int nFaceIndex ) const;
+
+ // There may be multiple font ids for TrueType collections
+ std::vector<fontID> findFontFileIDs( int nDirID, const rtl::OString& rFile ) const;
+
+ bool knownFontFile( int nDirID, const rtl::OString& rFile ) const
+ {
+ return findFontFileID(nDirID, rFile, 0) != 0;
+ }
+
fontID findFontBuiltinID( int nPSNameAtom ) const;
FontFamily matchFamilyName( const rtl::OUString& rFamily ) const;
@@ -390,7 +399,8 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
public:
static PrintFontManager& get(); // one instance only
- int addFontFile( const rtl::OString& rFileName );
+ // There may be multiple font ids for TrueType collections
+ std::vector<fontID> addFontFile( const rtl::OString& rFileName );
void initialize();
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index 671e20e..d492df2 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -537,24 +537,28 @@ bool X11SalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
OString aOFileName( OUStringToOString( aUSystemPath, aEncoding ) );
psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
- int nFontId = rMgr.addFontFile( aOFileName );
- if( !nFontId )
+ std::vector<psp::fontID> aFontIds = rMgr.addFontFile( aOFileName );
+ if( aFontIds.empty() )
return false;
- // prepare font data
- psp::FastPrintFontInfo aInfo;
- rMgr.getFontFastInfo( nFontId, aInfo );
- aInfo.m_aFamilyName = rFontName;
+ GlyphCache& rGC = X11GlyphCache::GetInstance();
- // inform glyph cache of new font
- ImplDevFontAttributes aDFA = GenPspGraphics::Info2DevFontAttributes( aInfo );
- aDFA.mnQuality += 5800;
+ for (std::vector<psp::fontID>::iterator aI = aFontIds.begin(), aEnd = aFontIds.end(); aI != aEnd; ++aI)
+ {
+ // prepare font data
+ psp::FastPrintFontInfo aInfo;
+ rMgr.getFontFastInfo( *aI, aInfo );
+ aInfo.m_aFamilyName = rFontName;
- int nFaceNum = rMgr.getFontFaceNumber( aInfo.m_nID );
+ // inform glyph cache of new font
+ ImplDevFontAttributes aDFA = GenPspGraphics::Info2DevFontAttributes( aInfo );
+ aDFA.mnQuality += 5800;
- GlyphCache& rGC = X11GlyphCache::GetInstance();
- const rtl::OString& rFileName = rMgr.getFontFileSysPath( aInfo.m_nID );
- rGC.AddFontFile( rFileName, nFaceNum, aInfo.m_nID, aDFA );
+ int nFaceNum = rMgr.getFontFaceNumber( aInfo.m_nID );
+
+ const rtl::OString& rFileName = rMgr.getFontFileSysPath( aInfo.m_nID );
+ rGC.AddFontFile( rFileName, nFaceNum, aInfo.m_nID, aDFA );
+ }
// announce new font to device's font list
rGC.AnnounceFonts( pFontList );
commit 42aeb8d9e163361c1b489916370eab7c2a3a391b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 11 10:16:42 2012 +0000
addFontFile always add all font faces in that file
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 23fb0d8..6f57f4b 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -1253,7 +1253,7 @@ int PrintFontManager::getDirectoryAtom( const OString& rDirectory, bool bCreate
// -------------------------------------------------------------------------
-int PrintFontManager::addFontFile( const ::rtl::OString& rFileName, int /*nFaceNum*/ )
+int PrintFontManager::addFontFile( const ::rtl::OString& rFileName )
{
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
INetURLObject aPath( OStringToOUString( rFileName, aEncoding ), INET_PROT_FILE, INetURLObject::ENCODE_ALL );
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index c7abfc4..b632908 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -390,7 +390,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
public:
static PrintFontManager& get(); // one instance only
- int addFontFile( const rtl::OString& rFileName, int nFaceNum );
+ int addFontFile( const rtl::OString& rFileName );
void initialize();
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index b10b362..671e20e 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -537,7 +537,7 @@ bool X11SalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
OString aOFileName( OUStringToOString( aUSystemPath, aEncoding ) );
psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
- int nFontId = rMgr.addFontFile( aOFileName, 0 );
+ int nFontId = rMgr.addFontFile( aOFileName );
if( !nFontId )
return false;
commit 7c3545a13809ba47079bab9c89c62546b14cfa72
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 11 10:08:03 2012 +0000
align getFontFaceNumber with FC_FACE
getFontFaceNumber returns the index of the font in the collection,
font formats without indexes are now "0" rather than -1. All
existing code already converted < 0 to 0 anyway, so simplifys a
little.
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 2b99ca5..23fb0d8 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -2761,10 +2761,12 @@ bool PrintFontManager::getFontBoundingBox( fontID nFontID, int& xMin, int& yMin,
int PrintFontManager::getFontFaceNumber( fontID nFontID ) const
{
- int nRet = -1;
+ int nRet = 0;
PrintFont* pFont = getFont( nFontID );
if( pFont && pFont->m_eType == fonttype::TrueType )
nRet = static_cast< TrueTypeFontFile* >(pFont)->m_nCollectionEntry;
+ if (nRet < 0)
+ nRet = 0;
return nRet;
}
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx
index 0881550..3255e81 100644
--- a/vcl/generic/print/glyphset.cxx
+++ b/vcl/generic/print/glyphset.cxx
@@ -847,7 +847,7 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
TrueTypeFont *pTTFont;
OString aTTFileName (rGfx.GetFontMgr().getFontFileSysPath(mnFontID));
int nFace = rGfx.GetFontMgr().getFontFaceNumber(mnFontID);
- sal_Int32 nSuccess = OpenTTFontFile(aTTFileName.getStr(), nFace < 0 ? 0 : nFace, &pTTFont);
+ sal_Int32 nSuccess = OpenTTFontFile(aTTFileName.getStr(), nFace, &pTTFont);
if (nSuccess != SF_OK)
return sal_False;
FILE* pTmpFile = tmpfile();
diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx
index 988e476..26abf38 100644
--- a/vcl/headless/svptext.cxx
+++ b/vcl/headless/svptext.cxx
@@ -342,8 +342,6 @@ void SvpSalGraphics::GetDevFontList( ImplDevFontList* pDevFontList )
// normalize face number to the GlyphCache
int nFaceNum = rMgr.getFontFaceNumber( aInfo.m_nID );
- if( nFaceNum < 0 )
- nFaceNum = 0;
// for fonts where extra kerning info can be provided on demand
// an ExtraKernInfo object is supplied
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index 1a496c4..b10b362 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -551,8 +551,6 @@ bool X11SalGraphics::AddTempDevFont( ImplDevFontList* pFontList,
aDFA.mnQuality += 5800;
int nFaceNum = rMgr.getFontFaceNumber( aInfo.m_nID );
- if( nFaceNum < 0 )
- nFaceNum = 0;
GlyphCache& rGC = X11GlyphCache::GetInstance();
const rtl::OString& rFileName = rMgr.getFontFileSysPath( aInfo.m_nID );
@@ -587,8 +585,6 @@ void X11SalGraphics::GetDevFontList( ImplDevFontList *pList )
// normalize face number to the GlyphCache
int nFaceNum = rMgr.getFontFaceNumber( aInfo.m_nID );
- if( nFaceNum < 0 )
- nFaceNum = 0;
// for fonts where extra kerning info can be provided on demand
// an ExtraKernInfo object is supplied
commit 67ddbfa97c567568eae5d5f0abe4dff8d5704f25
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 11 09:52:58 2012 +0000
on generic X11 unix we always use fontconfig
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index ee3a815..9b0e62e 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -99,7 +99,6 @@ PADialog::PADialog( Window* pParent, sal_Bool /*bAdmin*/ ) :
m_aCUPSCB( this, PaResId( RID_PA_CB_CUPSUSAGE ) ),
m_aSepButtonFL( this, PaResId( RID_PA_FL_SEPBUTTON ) ),
m_aAddPB( this, PaResId( RID_PA_BTN_ADD ) ),
- m_aFontsPB( this, PaResId( RID_PA_BTN_FONTS ) ),
m_aCancelButton( this, PaResId( RID_PA_BTN_CANCEL ) ),
m_aDefPrt( PaResId( RID_PA_STR_DEFPRT ) ),
m_aRenameStr( PaResId( RID_PA_STR_RENAME ) ),
@@ -135,20 +134,10 @@ void PADialog::Init()
m_aConfPB.SetClickHdl( LINK( this, PADialog, ClickBtnHdl ) );
m_aRenamePB.SetClickHdl( LINK( this, PADialog, ClickBtnHdl ) );
m_aTestPagePB.SetClickHdl( LINK( this, PADialog, ClickBtnHdl ) );
- m_aFontsPB.SetClickHdl( LINK( this, PADialog, ClickBtnHdl ) );
m_aAddPB.SetClickHdl( LINK( this, PADialog, ClickBtnHdl ) );
m_aDevicesLB.setDelPressedLink( LINK( this, PADialog, DelPressedHdl ) );
m_aCUPSCB.SetClickHdl( LINK( this, PADialog, ClickBtnHdl ) );
- ::psp::PrintFontManager& rFontManager( ::psp::PrintFontManager::get() );
- if( ! rFontManager.checkImportPossible() )
- m_aFontsPB.Enable( sal_False );
- if( rFontManager.hasFontconfig() )
- {
- m_aFontsPB.Enable( sal_False );
- m_aFontsPB.Show( sal_False );
- }
-
// at this point no actual changes will be written
// but the write will have checked whether any writeable config exists
if( ! m_rPIManager.writePrinterConfig() )
@@ -227,11 +216,6 @@ IMPL_LINK( PADialog, ClickBtnHdl, PushButton*, pButton )
PrintTestPage();
else if( pButton == &m_aAddPB )
AddDevice();
- else if( pButton == &m_aFontsPB )
- {
- FontNameDlg aDialog( this );
- aDialog.Execute();
- }
else if( static_cast<Button*>(pButton) == &m_aCUPSCB )
{
m_rPIManager.setCUPSDisabled( m_aCUPSCB.IsChecked() );
diff --git a/padmin/source/padialog.hrc b/padmin/source/padialog.hrc
index 69e1242..9ae1bfe 100644
--- a/padmin/source/padialog.hrc
+++ b/padmin/source/padialog.hrc
@@ -33,11 +33,11 @@
#define RID_PA_BTN_STD 2
#define RID_PA_BTN_DEL 3
#define RID_PA_LB_DEV 4
-#define RID_PA_FL_PRINTERS 5
+#define RID_PA_FL_PRINTERS 5
#define RID_PA_BTN_CONF 6
#define RID_PA_BTN_RENAME 7
#define RID_PA_TESTPAGE 8
-#define RID_PA_BTN_FONTS 9
+
#define RID_PA_TXT_DRIVER 10
#define RID_PA_TXT_DRIVER_STRING 11
#define RID_PA_TXT_LOCATION 12
diff --git a/padmin/source/padialog.hxx b/padmin/source/padialog.hxx
index 4f39f03..9c6646f 100644
--- a/padmin/source/padialog.hxx
+++ b/padmin/source/padialog.hxx
@@ -68,7 +68,6 @@ namespace padmin {
FixedLine m_aSepButtonFL;
PushButton m_aAddPB;
- PushButton m_aFontsPB;
CancelButton m_aCancelButton;
String m_aDefPrt;
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index f9f9b16..194dea7 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -281,13 +281,6 @@ ModalDialog RID_PADIALOG
Text [ en-US ] = "Test ~Page";
};
- PushButton RID_PA_BTN_FONTS
- {
- HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_FONTS";
- Pos = MAP_APPFONT( 80, 181 );
- Size = MAP_APPFONT( 70, 12 );
- Text [ en-US ] = "Fon~ts...";
- };
PushButton RID_PA_BTN_ADD
{
HelpID = "padmin:PushButton:RID_PADIALOG:RID_PA_BTN_ADD";
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index 4d02a76..0c3655c 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -104,7 +104,7 @@ namespace
class FontCfgWrapper
{
- FcFontSet* m_pOutlineSet;
+ FcFontSet* m_pOutlineSet;
void addFontSet( FcSetName );
@@ -383,10 +383,9 @@ FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern* pPattern, FcChar
/*
* PrintFontManager::initFontconfig
*/
-bool PrintFontManager::initFontconfig()
+void PrintFontManager::initFontconfig()
{
FontCfgWrapper::get();
- return true;
}
namespace
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 37f0bf7..2b99ca5 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -1195,12 +1195,11 @@ PrintFontManager& PrintFontManager::get()
* the PrintFontManager
*/
-PrintFontManager::PrintFontManager() :
- m_nNextFontID( 1 ),
- m_pAtoms( new MultiAtomProvider() ),
- m_nNextDirAtom( 1 ),
- m_pFontCache( NULL ),
- m_bFontconfigSuccess( false )
+PrintFontManager::PrintFontManager()
+ : m_nNextFontID( 1 )
+ , m_pAtoms( new MultiAtomProvider() )
+ , m_nNextDirAtom( 1 )
+ , m_pFontCache( NULL )
{
for( unsigned int i = 0; i < SAL_N_ELEMENTS( aAdobeCodes ); i++ )
{
@@ -2153,7 +2152,7 @@ void PrintFontManager::initialize()
#endif
// first try fontconfig
- m_bFontconfigSuccess = initFontconfig();
+ initFontconfig();
// part one - look for downloadable fonts
rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
@@ -2177,7 +2176,7 @@ void PrintFontManager::initialize()
// if registering an app-specific fontdir with fontconfig fails
// and fontconfig-based substitutions are enabled
// then trying to use these app-specific fonts doesn't make sense
- if( m_bFontconfigSuccess && !addFontconfigDir( aToken ) )
+ if( !addFontconfigDir( aToken ) )
if( bAreFCSubstitutionsEnabled )
continue;
m_aFontDirectories.push_back( aToken );
@@ -2188,15 +2187,8 @@ void PrintFontManager::initialize()
// protect against duplicate paths
boost::unordered_map< OString, int, OStringHash > visited_dirs;
- // now that all global and local font dirs are known to fontconfig
- // check that there are fonts actually managed by fontconfig
- // also don't search directories that fontconfig already did
- if( m_bFontconfigSuccess )
- m_bFontconfigSuccess = (countFontconfigFonts( visited_dirs ) > 0);
-
- // don't search through many directories fontconfig already told us about
- if( ! m_bFontconfigSuccess )
- ImplGetSVData()->mpDefInst->FillFontPathList( m_aFontDirectories );
+ // Don't search directories that fontconfig already did
+ countFontconfigFonts( visited_dirs );
// fill XLFD aliases from fonts.alias files
initFontsAlias();
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 4d869c5..67bb759 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -903,9 +903,8 @@ void GenPspGraphics::GetDevFontList( ImplDevFontList *pList )
if (rMgr.getFontFastInfo (*it, aInfo))
AnnounceFonts( pList, aInfo );
- // register platform specific font substitutions if available
- if( rMgr.hasFontconfig() )
- SalGenericInstance::RegisterFontSubstitutors( pList );
+ // register platform specific font substitutions if available
+ SalGenericInstance::RegisterFontSubstitutors( pList );
}
void GenPspGraphics::GetDevFontSubstList( OutputDevice* pOutDev )
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 7236009..c7abfc4 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -325,7 +325,6 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
boost::unordered_multimap< sal_uInt8, sal_Unicode > m_aAdobecodeToUnicode;
mutable FontCache* m_pFontCache;
- bool m_bFontconfigSuccess;
mutable std::vector< fontID > m_aOverrideFonts;
@@ -361,12 +360,8 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
/* try to initialize fonts from libfontconfig
called from <code>initialize()</code>
-
- @returns
- true if at least one font was added by libfontconfig
- false else (e.g. no libfontconfig found)
*/
- bool initFontconfig();
+ void initFontconfig();
int countFontconfigFonts( boost::unordered_map<rtl::OString, int, rtl::OStringHash>& o_rVisitedPaths );
/* deinitialize fontconfig
*/
@@ -649,7 +644,6 @@ public:
ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)) const;
bool Substitute( FontSelectPattern &rPattern, rtl::OUString& rMissingCodes ) const;
- bool hasFontconfig() const { return m_bFontconfigSuccess; }
int FreeTypeCharIndex( void *pFace, sal_uInt32 aChar );
};
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index a7e532b..1a496c4 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -607,10 +607,9 @@ void X11SalGraphics::GetDevFontList( ImplDevFontList *pList )
rGC.AnnounceFonts( pList );
// register platform specific font substitutions if available
- if( rMgr.hasFontconfig() )
- SalGenericInstance::RegisterFontSubstitutors( pList );
+ SalGenericInstance::RegisterFontSubstitutors( pList );
- ImplGetSVData()->maGDIData.mbNativeFontConfig = rMgr.hasFontconfig();
+ ImplGetSVData()->maGDIData.mbNativeFontConfig = true;
}
// ----------------------------------------------------------------------------
commit 0e3292f7c7c1369a716314f708361d4a83fb0724
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 11 09:10:09 2012 +0000
remove redundant Clipboard_getSupportedServiceNames
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
index cc978eb..02fbae9 100644
--- a/vcl/source/components/dtranscomp.cxx
+++ b/vcl/source/components/dtranscomp.cxx
@@ -276,15 +276,6 @@ Reference< XInterface > ClipboardFactory::createInstanceWithArguments( const Seq
return xResult;
}
-// ------------------------------------------------------------------------
-
-Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames()
-{
- Sequence< OUString > aRet(1);
- aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard"));
- return aRet;
-}
-
OUString SAL_CALL Clipboard_getImplementationName()
{
#if defined UNX
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 6772db7..b482431 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -58,7 +58,6 @@ extern Sequence< OUString > SAL_CALL StringMirror_getSupportedServiceNames();
extern OUString SAL_CALL StringMirror_getImplementationName();
extern Reference< XInterface > SAL_CALL StringMirror_createInstance( const Reference< XMultiServiceFactory > & );
-extern Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames();
extern OUString SAL_CALL Clipboard_getImplementationName();
extern Reference< XSingleServiceFactory > SAL_CALL Clipboard_createFactory( const Reference< XMultiServiceFactory > & );
commit ac310071eb397c3701e3c3cf650a893a225274f3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jan 10 23:20:46 2012 +0000
callcatcher: lets trust my own tooling
diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx
index 68b4932..e557b63 100644
--- a/tools/inc/tools/pstm.hxx
+++ b/tools/inc/tools/pstm.hxx
@@ -127,7 +127,6 @@ class TOOLS_DLLPUBLIC SvPersistBaseMemberList : public SuperSvPersistBaseMemberL
{
public:
SvPersistBaseMemberList();
- SvPersistBaseMemberList(sal_uInt16 nInitSz, sal_uInt16 nResize );
void WriteObjects( SvPersistStream &, sal_Bool bOnlyStreamedObj = sal_False ) const;
TOOLS_DLLPUBLIC friend SvPersistStream& operator << (SvPersistStream &, const SvPersistBaseMemberList &);
diff --git a/tools/inc/tools/ref.hxx b/tools/inc/tools/ref.hxx
index d5ecfe4..24fb962 100644
--- a/tools/inc/tools/ref.hxx
+++ b/tools/inc/tools/ref.hxx
@@ -274,7 +274,6 @@ inline void CN##MemberList::Append( const CN##MemberList & rList )\
/************************** S v M e m b e r L i s t **********************/
#define PRV_SV_DECL_MEMBER_LIST(Class,EntryName) \
Class##MemberList() {} \
-inline Class##MemberList(sal_uInt16 nInitSz,sal_uInt16 nResize);\
inline void Insert( EntryName p ); \
inline void Insert( EntryName p, sal_uIntPtr nIndex ); \
inline void Append( EntryName p ); \
@@ -295,9 +294,6 @@ inline EntryName Prev();\
inline void Append( const Class##MemberList & rList );
#define PRV_SV_IMPL_MEMBER_LIST(ClassName,EntryName,BaseList)\
-inline ClassName##MemberList::ClassName##MemberList\
- (sal_uInt16 nInitSz,sal_uInt16 nResize)\
- : BaseList( nInitSz, nResize ){}\
inline void ClassName##MemberList::Insert( EntryName p )\
{BaseList::Insert(p);}\
inline void ClassName##MemberList::Insert( EntryName p, sal_uIntPtr nIdx )\
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index a91b078..6a0b17c 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -62,9 +62,6 @@ TYPEINIT0( SvRttiBase );
/****************** SvPersistBaseMemberList ******************************/
SvPersistBaseMemberList::SvPersistBaseMemberList(){}
-SvPersistBaseMemberList::SvPersistBaseMemberList(
- sal_uInt16 nInitSz, sal_uInt16 nResize )
- : SuperSvPersistBaseMemberList( nInitSz, nResize ){}
#define PERSIST_LIST_VER (sal_uInt8)0
#define PERSIST_LIST_DBGUTIL (sal_uInt8)0x80
diff --git a/unusedcode.easy b/unusedcode.easy
index 5fbf555..16a4630 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -119,9 +119,6 @@ InsCapOptArr::Insert(InsCaptionOpt* const*, unsigned short)
InsCapOptArr::Remove(InsCaptionOpt* const&, unsigned short)
InsCapOptArr::Remove(unsigned short, unsigned short)
ItemList::FindAttrib(unsigned short)
-KeyCode::GetSymbolName(String const&, Window*) const
-KeyEvent::InitKeyEvent(com::sun::star::awt::KeyEvent&) const
-KeyEvent::KeyEvent(com::sun::star::awt::KeyEvent const&)
KeyboardSettings::CopyData()
Line::Enum(Link const&)
Line::NearestPoint(Point const&) const
@@ -186,7 +183,6 @@ ParagraphObj::ParagraphObj(ParagraphObj&)
ParagraphStyleManager::get(WPXString const&) const
PathDialog::SetPath(Edit const&)
PatternFormatter::ImplLoadRes(ResId const&)
-PatternFormatter::SelectFixedFont()
PluginConnector::getInstance(_NPP*)
PluginConnector::getInstanceById(unsigned int)
PopupMenu::SetSelectedEntry(unsigned short)
@@ -472,7 +468,6 @@ SvLBoxButtonData::SvLBoxButtonData()
SvLBoxEntryArr::DeleteAndDestroy(unsigned short, unsigned short)
SvLBoxItem::GetSize(SvLBoxEntry*, SvViewDataEntry*)
SvListView::SvListView(SvTreeList*)
-SvPersistBaseMemberList::SvPersistBaseMemberList(unsigned short, unsigned short)
SvPersistStream::InsertObj(SvPersistBase*)
SvPersistStream::RemoveObj(SvPersistBase*)
SvPersistStream::SvPersistStream(SvClassManager&, SvStream*, SvPersistStream const&)
diff --git a/vcl/inc/vcl/event.hxx b/vcl/inc/vcl/event.hxx
index 2fe32e7..f912a39 100644
--- a/vcl/inc/vcl/event.hxx
+++ b/vcl/inc/vcl/event.hxx
@@ -66,12 +66,6 @@ public:
KeyEvent( xub_Unicode nChar, const KeyCode& rKeyCode,
sal_uInt16 nRepeat = 0 );
- /** inits this vcl KeyEvent with all settings from the given awt event **/
- KeyEvent( const ::com::sun::star::awt::KeyEvent& rEvent );
-
- /** fills out the given awt KeyEvent with all settings from this vcl event **/
- void InitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent ) const;
-
xub_Unicode GetCharCode() const { return mnCharCode; }
const KeyCode& GetKeyCode() const { return maKeyCode; }
sal_uInt16 GetRepeat() const { return mnRepeat; }
diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx
index f43f7d5..5f5e8d6 100644
--- a/vcl/inc/vcl/field.hxx
+++ b/vcl/inc/vcl/field.hxx
@@ -142,8 +142,6 @@ public:
void SetString( const XubString& rStr );
XubString GetString() const;
sal_Bool IsStringModified() const { return !(GetString().Equals( maFieldString )); }
-
- void SelectFixedFont();
};
// --------------------
diff --git a/vcl/inc/vcl/keycod.hxx b/vcl/inc/vcl/keycod.hxx
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list