[Libreoffice-commits] .: 6 commits - editeng/inc editeng/source hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk svtools/inc svtools/source test/prj unusedcode.easy vcl/generic vcl/inc vcl/source xmlsecurity/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Jan 12 03:04:42 PST 2012


 editeng/inc/editeng/unofdesc.hxx                  |    1 
 editeng/source/uno/unofdesc.cxx                   |   24 -
 hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk |    1 
 svtools/inc/svtools/collatorres.hxx               |    9 
 svtools/source/control/collatorres.cxx            |   26 -
 test/prj/build.lst                                |    2 
 unusedcode.easy                                   |    4 
 vcl/generic/fontmanager/fontmanager.cxx           |  358 ----------------------
 vcl/generic/print/glyphset.cxx                    |   25 -
 vcl/generic/print/glyphset.hxx                    |    3 
 vcl/inc/unx/strhelper.hxx                         |   44 --
 vcl/inc/vcl/fontmanager.hxx                       |   27 -
 vcl/inc/vcl/strhelper.hxx                         |   70 ++--
 vcl/source/helper/strhelper.cxx                   |    7 
 xmlsecurity/source/framework/buffernode.cxx       |   34 --
 xmlsecurity/source/framework/buffernode.hxx       |    1 
 16 files changed, 59 insertions(+), 577 deletions(-)

New commits:
commit 7d42c86f660b65f86a864a6b674dc8cba107911c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 12 10:28:08 2012 +0000

    pesky dependencies

diff --git a/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk b/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
index a6722cc..7beda1a 100644
--- a/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
+++ b/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
@@ -78,7 +78,6 @@ $(eval $(call gb_CppunitTest_set_args,hwpfilter_test_hwpfilter,\
 # we need to explicitly depend on library hwp because it is not implied
 # by a link relation
 $(call gb_CppunitTest_get_target,hwpfilter_test_hwpfilter) : \
-    $(call gb_Library_get_target,localedata_en) \
 	$(call gb_Library_get_target,hwp)
 
 # vim: set noet sw=4 ts=4:
diff --git a/test/prj/build.lst b/test/prj/build.lst
index a06591b..b58dc5b 100644
--- a/test/prj/build.lst
+++ b/test/prj/build.lst
@@ -1,2 +1,2 @@
-te test : unotest vcl i18npool NULL
+te test : unotest vcl i18npool filters NULL
 te test\source nmake - all source_cpp NULL
commit 87ceb5c987f8bf546bbc0c0fc3447c640780be91
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 12 09:30:09 2012 +0000

    VCL_DLLPUBLIC is in the wrong place
    
    and there's a unused duplicate header here too which can go

diff --git a/vcl/inc/unx/strhelper.hxx b/vcl/inc/unx/strhelper.hxx
deleted file mode 100644
index 78db605..0000000
--- a/vcl/inc/unx/strhelper.hxx
+++ /dev/null
@@ -1,44 +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 _SV_STRHELPER_HXX
-#define _SV_STRHELPER_HXX
-#include <tools/string.hxx>
-
-String GetCommandLineToken( int, const String& );
-// gets one token of a unix command line style string
-// doublequote, singlequote and singleleftquote protect their respective
-// contents
-
-int GetCommandLineTokenCount( const String& );
-// returns number of tokens (zero if empty or whitespace only)
-
-String WhitespaceToSpace( const String&, BOOL bProtect = TRUE );
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx
index 62e4fc0..fa8258d 100644
--- a/vcl/inc/vcl/strhelper.hxx
+++ b/vcl/inc/vcl/strhelper.hxx
@@ -35,47 +35,47 @@
 
 #include <cstring>
 
-namespace psp {
+namespace psp
+{
+    VCL_DLLPUBLIC String GetCommandLineToken( int, const String& );
+    VCL_DLLPUBLIC rtl::OString GetCommandLineToken(int, const rtl::OString&);
+    // gets one token of a unix command line style string
+    // doublequote, singlequote and singleleftquote protect their respective
+    // contents
 
-String VCL_DLLPUBLIC GetCommandLineToken( int, const String& );
-rtl::OString VCL_DLLPUBLIC GetCommandLineToken(int, const rtl::OString&);
-// gets one token of a unix command line style string
-// doublequote, singlequote and singleleftquote protect their respective
-// contents
+    VCL_DLLPUBLIC int GetCommandLineTokenCount(const rtl::OUString&);
+    VCL_DLLPUBLIC int GetCommandLineTokenCount(const rtl::OString&);
+    // returns number of tokens (zero if empty or whitespace only)
 
-int VCL_DLLPUBLIC GetCommandLineTokenCount( const String& );
-int VCL_DLLPUBLIC GetCommandLineTokenCount(const rtl::OString&);
-// returns number of tokens (zero if empty or whitespace only)
+    VCL_DLLPUBLIC String WhitespaceToSpace( const String&, sal_Bool bProtect = sal_True );
+    VCL_DLLPUBLIC rtl::OString WhitespaceToSpace(const rtl::OString&, sal_Bool bProtect = sal_True);
+    // returns a string with multiple adjacent occurrences of whitespace
+    // converted to a single space. if bProtect is sal_True (nonzero), then
+    // doublequote, singlequote and singleleftquote protect their respective
+    // contents
 
-String VCL_DLLPUBLIC WhitespaceToSpace( const String&, sal_Bool bProtect = sal_True );
-rtl::OString VCL_DLLPUBLIC WhitespaceToSpace(const rtl::OString&, sal_Bool bProtect = sal_True);
-// returns a string with multiple adjacent occurrences of whitespace
-// converted to a single space. if bProtect is sal_True (nonzero), then
-// doublequote, singlequote and singleleftquote protect their respective
-// contents
 
+    // parses the first double in the string; decimal is '.' only
+    VCL_DLLPUBLIC inline double StringToDouble( const String& rStr )
+    {
+        return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0));
+    }
 
-// parses the first double in the string; decimal is '.' only
-inline double VCL_DLLPUBLIC StringToDouble( const String& rStr )
-{
-    return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0));
-}
+    VCL_DLLPUBLIC inline double StringToDouble(const rtl::OString& rStr)
+    {
+        return rtl::math::stringToDouble(rStr, '.', static_cast<sal_Char>(0));
+    }
 
-inline double VCL_DLLPUBLIC StringToDouble(const rtl::OString& rStr)
-{
-    return rtl::math::stringToDouble(rStr, '.', static_cast<sal_Char>(0));
-}
-
-// fills a character buffer with the string representation of a double
-// the buffer has to be long enough (e.g. 128 bytes)
-// returns the string len
-inline int VCL_DLLPUBLIC getValueOfDouble( char* pBuffer, double f, int nPrecision = 0)
-{
-    rtl::OString aStr( rtl::math::doubleToString( f, rtl_math_StringFormat_G, nPrecision, '.', true ) );
-    int nLen = aStr.getLength();
-    std::strncpy( pBuffer, aStr.getStr(), nLen+1 ); // copy string including terminating zero
-    return nLen;
-}
+    // fills a character buffer with the string representation of a double
+    // the buffer has to be long enough (e.g. 128 bytes)
+    // returns the string len
+    VCL_DLLPUBLIC inline int getValueOfDouble( char* pBuffer, double f, int nPrecision = 0)
+    {
+        rtl::OString aStr( rtl::math::doubleToString( f, rtl_math_StringFormat_G, nPrecision, '.', true ) );
+        int nLen = aStr.getLength();
+        std::strncpy( pBuffer, aStr.getStr(), nLen+1 ); // copy string including terminating zero
+        return nLen;
+    }
 
 } // namespace
 
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index e13f0f3..14b61a5 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -221,14 +221,13 @@ rtl::OString GetCommandLineToken(int nToken, const rtl::OString& rLine)
     return rtl::OString(pBuffer);
 }
 
-int GetCommandLineTokenCount( const String& rLine )
+int GetCommandLineTokenCount(const rtl::OUString& rLine)
 {
-    if( ! rLine.Len() )
+    if (rLine.isEmpty())
         return 0;
 
     int nTokenCount = 0;
-    const sal_Unicode *pRun = rLine.GetBuffer();
-
+    const sal_Unicode *pRun = rLine.getStr();
 
     while( *pRun )
     {
commit df6d0dc8f010365a8f6948e2394b2c7acfc2ecda
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 12 09:20:49 2012 +0000

    post padmin shrinkage a lot of FontManager can go now

diff --git a/unusedcode.easy b/unusedcode.easy
index 262034a..33bfd14 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -626,7 +626,6 @@ SvxTabStopArr::Remove(SvxTabStop const&, unsigned short)
 SvxTabStopArr_SAR::Replace(SvxTabStop const&, unsigned short)
 SvxTabStopArr_SAR::Replace(SvxTabStop const*, unsigned short, unsigned short)
 SvxTabStopArr_SAR::_ForEach(unsigned short, unsigned short, unsigned char (*)(SvxTabStop const&, void*), void*)
-SvxUnoFontDescriptor::getPropertyState(SfxItemSet const&)
 SvxUnoTextBase::InsertField(SvxFieldItem const&)
 SvxUnoTextBase::SvxUnoTextBase(SvxEditSource const*, SvxItemPropertySet const*)
 SvxUnoTextContent::SvxUnoTextContent()
@@ -1758,8 +1757,6 @@ pdfi::PDFIProcessor::sortDocument(bool)
 pdfi::PDFIRawAdaptor::odfConvert(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&, com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator> const&)
 pdfparse::PDFReader::read(char const*, unsigned int)
 psp::GetCommandLineTokenCount(rtl::OString const&)
-psp::GlyphSet::GlyphSet()
-psp::GlyphSet::SetFont(int, unsigned char)
 psp::PrinterGfx::DrawBitmap(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, psp::PrinterBmp const&)
 psp::PrinterGfx::DrawMask(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, psp::PrinterColor&)
 psp::PrinterGfx::GetGlyphBoundRect(unsigned short, Rectangle&)
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 35517cd..63145f9 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -2275,9 +2275,7 @@ void PrintFontManager::initialize()
                     nBuiltinFonts++;
                 nCached++;
 #if OSL_DEBUG_LEVEL > 2
-                fprintf( stderr, "adding cached font %d: \"%s\" from %s\n", aFont,
-                         OUStringToOString( getFontFamily( aFont ), RTL_TEXTENCODING_MS_1252 ).getStr(),
-                         getFontFileSysPath( aFont ).getStr() );
+                fprintf( stderr, "adding cached font %d: %s\n", aFont, getFontFileSysPath( aFont ).getStr() );
 #endif
 #endif
             }
@@ -2355,8 +2353,7 @@ void PrintFontManager::initialize()
                                 m_pFontCache->updateFontCacheEntry( *font_it, false );
                                 nDirFonts++;
 #if OSL_DEBUG_LEVEL > 2
-                                fprintf( stderr, "adding font %d: \"%s\" from %s\n", aFont,
-                                         OUStringToOString( getFontFamily( aFont ), RTL_TEXTENCODING_MS_1252 ).getStr(),
+                                fprintf( stderr, "adding font %d: from %s\n", aFont,
                                          getFontFileSysPath( aFont ).getStr() );
 #endif
                             }
@@ -2407,8 +2404,7 @@ void PrintFontManager::initialize()
                     nBuiltinFonts++;
                 nCached++;
 #if OSL_DEBUG_LEVEL > 2
-                fprintf( stderr, "adding cached font %d: \"%s\" from %s\n", aFont,
-                         OUStringToOString( getFontFamily( aFont ), RTL_TEXTENCODING_MS_1252 ).getStr(),
+                fprintf( stderr, "adding cached font %d: from %s\n", aFont,
                          getFontFileSysPath( aFont ).getStr() );
 #endif
 #endif
@@ -2886,14 +2882,6 @@ FontFamily PrintFontManager::matchFamilyName( const ::rtl::OUString& rFamily ) c
 
 // -------------------------------------------------------------------------
 
-const ::rtl::OUString& PrintFontManager::getFontFamily( fontID nFontID ) const
-{
-    PrintFont* pFont = getFont( nFontID );
-    return m_pAtoms->getString( ATOM_FAMILYNAME, pFont ? pFont->m_nFamilyName : INVALID_ATOM );
-}
-
-// -------------------------------------------------------------------------
-
 OString PrintFontManager::getAfmFile( PrintFont* pFont ) const
 {
     OString aMetricPath;
@@ -3025,21 +3013,6 @@ void PrintFontManager::hasVerticalSubstitutions( fontID nFontID,
 
 // -------------------------------------------------------------------------
 
-OUString PrintFontManager::getFontXLFD( fontID nFontID ) const
-{
-    PrintFont* pFont = getFont( nFontID );
-    OUString aRet;
-    if( pFont )
-    {
-        OString aXLFD( getXLFD( pFont ) );
-        rtl_TextEncoding aEncoding = getToken(aXLFD, 6, '-').indexOf( "utf8" ) != -1 ? RTL_TEXTENCODING_UTF8 : RTL_TEXTENCODING_ISO_8859_1;
-        aRet = OStringToOUString( aXLFD, aEncoding );
-    }
-    return aRet;
-}
-
-// -------------------------------------------------------------------------
-
 const ::std::list< KernPair >& PrintFontManager::getKernPairs( fontID nFontID, bool bVertical ) const
 {
     static ::std::list< KernPair > aEmpty;
@@ -3209,331 +3182,6 @@ static bool createWriteablePath( const ByteString& rPath )
     return bSuccess;
 }
 
-
-// -------------------------------------------------------------------------
-
-int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bLinkOnly, ImportFontCallback* pCallback )
-{
-    int nSuccess = 0;
-
-    // find a directory with write access
-    rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
-    bool bCanWrite = false;
-    int nDirID = 0;
-    INetURLObject aDir;
-    for( ::std::list< int >::const_iterator dir_it = m_aPrivateFontDirectories.begin();
-         ! bCanWrite && dir_it != m_aPrivateFontDirectories.end(); ++dir_it )
-    {
-        // check if we can create files in that directory
-        ByteString aDirPath = getDirectory( *dir_it );
-        if( createWriteablePath( aDirPath ) )
-        {
-            aDir = INetURLObject( OStringToOUString( aDirPath, aEncoding ), INET_PROT_FILE, INetURLObject::ENCODE_ALL );
-            nDirID = *dir_it;
-            bCanWrite = true;
-        }
-    }
-    if( bCanWrite )
-    {
-        for( ::std::list< OString >::const_iterator font_it = rFiles.begin();
-             font_it != rFiles.end(); ++font_it )
-        {
-            INetURLObject aFrom( OStringToOUString( *font_it, aEncoding ), INET_PROT_FILE, INetURLObject::ENCODE_ALL );
-            INetURLObject aTo( aDir );
-            aTo.Append( aFrom.GetName() );
-
-            if( pCallback )
-                pCallback->progress( aTo.PathToFileName() );
-
-            if( pCallback && pCallback->isCanceled() )
-                break;
-
-            if (!access( rtl::OUStringToOString(aTo.PathToFileName(), aEncoding).getStr(), F_OK))
-            {
-                if( ! ( pCallback ? pCallback->queryOverwriteFile( aTo.PathToFileName() ) : false ) )
-                    continue;
-            }
-            // look for afm if necessary
-            OUString aAfmCopied;
-            FileBase::RC nError;
-            if( aFrom.getExtension().equalsIgnoreAsciiCaseAscii( "pfa" ) ||
-                aFrom.getExtension().equalsIgnoreAsciiCaseAscii( "pfb" ) )
-            {
-                INetURLObject aFromAfm( aFrom );
-                aFromAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "afm" ) ) );
-                if (access(rtl::OUStringToOString(aFromAfm.PathToFileName(), aEncoding).getStr(), F_OK))
-                {
-                    aFromAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AFM" ) ) );
-                    if (access(rtl::OUStringToOString(aFromAfm.PathToFileName(), aEncoding).getStr(), F_OK))
-                    {
-                        aFromAfm.removeSegment();
-                        aFromAfm.Append( String( RTL_CONSTASCII_USTRINGPARAM( "afm" ) ) );
-                        aFromAfm.Append( aTo.GetName() );
-                        aFromAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "afm" ) ) );
-                        if (access(rtl::OUStringToOString(aFromAfm.PathToFileName(), aEncoding).getStr(), F_OK))
-                        {
-                            aFromAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AFM" ) ) );
-                            if (access(rtl::OUStringToOString(aFromAfm.PathToFileName(), aEncoding).getStr(), F_OK))
-                            {
-                                // give up
-                                if( pCallback )
-                                    pCallback->importFontFailed( aTo.PathToFileName(), ImportFontCallback::NoAfmMetric );
-                                continue;
-                            }
-                        }
-                    }
-                }
-                INetURLObject aToAfm( aTo );
-                aToAfm.setExtension( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "afm" ) ) );
-                OUString aFromPath, aToPath;
-                if( bLinkOnly )
-                {
-                    rtl::OString aLinkFromPath(rtl::OUStringToOString(aFromAfm.PathToFileName(),
-                        aEncoding));
-                    rtl::OString aLinkToPath(rtl::OUStringToOString(aToAfm.PathToFileName(),
-                        aEncoding));
-                    nError = (FileBase::RC)symlink(aLinkFromPath.getStr(), aLinkToPath.getStr());
-                }
-                else
-                    nError = File::copy( aFromAfm.GetMainURL(INetURLObject::DECODE_TO_IURI), aToAfm.GetMainURL(INetURLObject::DECODE_TO_IURI) );
-                if( nError )
-                {
-                    if( pCallback )
-                        pCallback->importFontFailed( aTo.PathToFileName(), ImportFontCallback::AfmCopyFailed );
-                    continue;
-                }
-                aAfmCopied = aToPath;
-            }
-            if( bLinkOnly )
-            {
-                rtl::OString aFromPath(rtl::OUStringToOString(aFrom.PathToFileName(), aEncoding));
-                rtl::OString aToPath(rtl::OUStringToOString(aTo.PathToFileName(), aEncoding));
-                nError = (FileBase::RC)symlink(aFromPath.getStr(), aToPath.getStr());
-            }
-            else
-                nError = File::copy( aFrom.GetMainURL(INetURLObject::DECODE_TO_IURI), aTo.GetMainURL(INetURLObject::DECODE_TO_IURI) );
-            // copy font file
-            if( nError )
-            {
-                if( aAfmCopied.getLength() )
-                    File::remove( aAfmCopied );
-                if( pCallback )
-                    pCallback->importFontFailed( aTo.PathToFileName(), ImportFontCallback::FontCopyFailed );
-                continue;
-            }
-
-            ::std::list< PrintFont* > aNewFonts;
-            ::std::list< PrintFont* >::iterator it;
-            if( analyzeFontFile( nDirID, OUStringToOString( aTo.GetName(), aEncoding ), ::std::list<OString>(), aNewFonts ) )
-            {
-                // remove all fonts for the same file
-                // discarding their font ids
-                ::boost::unordered_map< fontID, PrintFont* >::iterator current, next;
-                current = m_aFonts.begin();
-                OString aFileName( OUStringToOString( aTo.GetName(), aEncoding ) );
-                while( current != m_aFonts.end() )
-                {
-                    bool bRemove = false;
-                    switch( current->second->m_eType )
-                    {
-                        case fonttype::Type1:
-                            if( static_cast<Type1FontFile*>(current->second)->m_aFontFile == aFileName )
-                                bRemove = true;
-                            break;
-                        case fonttype::TrueType:
-                            if( static_cast<TrueTypeFontFile*>(current->second)->m_aFontFile == aFileName )
-                                bRemove = true;
-                            break;
-                        default: break;
-                    }
-                    if( bRemove )
-                    {
-                        next = current;
-                        ++next;
-                        m_aFontFileToFontID[ aFileName ].erase( current->first );
-                        delete current->second;
-                        m_aFonts.erase( current );
-                        current = next;
-                    }
-                    else
-                        ++current;
-                }
-
-                DBG_ASSERT( !knownFontFile( nDirID, aFileName ), "not all fonts removed for file" );
-
-                nSuccess++;
-                for( it = aNewFonts.begin(); it != aNewFonts.end(); ++it )
-                {
-                    m_aFontFileToFontID[ aFileName ].insert( m_nNextFontID );
-                    m_aFonts[ m_nNextFontID++ ] = *it;
-                    m_pFontCache->updateFontCacheEntry( *it, false );
-                }
-            }
-        }
-
-        m_pFontCache->updateDirTimestamp( nDirID );
-        m_pFontCache->flush();
-    }
-    else if( pCallback )
-        pCallback->importFontsFailed( ImportFontCallback::NoWritableDirectory );
-
-    return nSuccess;
-}
-
-// -------------------------------------------------------------------------
-
-bool PrintFontManager::checkImportPossible() const
-{
-    bool bSuccess = false;
-
-    // find a directory with write access
-    ByteString aDir;
-    for( std::list< int >::const_iterator dir_it = m_aPrivateFontDirectories.begin();
-         dir_it != m_aPrivateFontDirectories.end(); ++dir_it )
-    {
-        aDir = getDirectory( *dir_it );
-        if( createWriteablePath( aDir ) )
-        {
-            bSuccess = true;
-            break;
-        }
-    }
-
-#if OSL_DEBUG_LEVEL > 1
-    if( bSuccess )
-        fprintf( stderr, "found writable %s\n", aDir.GetBuffer() );
-#endif
-
-    return bSuccess;
-}
-
-// -------------------------------------------------------------------------
-
-bool PrintFontManager::checkChangeFontPropertiesPossible( fontID /*nFontID*/ ) const
-{
-    // since font properties are changed in the font cache file only nowadays
-    // they can always be changed
-    return true;
-}
-
-// -------------------------------------------------------------------------
-
-bool PrintFontManager::changeFontProperties( fontID nFontID, const ::rtl::OUString& rXLFD )
-{
-    ByteString aXLFD( OUStringToOString( rXLFD, RTL_TEXTENCODING_UTF8 ) );
-    ByteString aAddStyle = comphelper::string::getToken(aXLFD, '-', 6);
-    if( aAddStyle.Search( "utf8" ) == STRING_NOTFOUND )
-    {
-        aAddStyle.Append( aAddStyle.Len() ? ";utf8" : "utf8" );
-        aXLFD.SetToken( 6, ';', aAddStyle );
-    }
-    PrintFont* pFont = getFont( nFontID );
-    std::list< OString > aDummyList;
-    aDummyList.push_back( aXLFD );
-    getFontAttributesFromXLFD( pFont, aDummyList );
-    pFont->m_bUserOverride = true;
-    m_pFontCache->updateFontCacheEntry( pFont, true );
-
-    return true;
-}
-
-// -------------------------------------------------------------------------
-
-bool PrintFontManager::
-getImportableFontProperties(
-                            const OString& rFile,
-                            ::std::list< FastPrintFontInfo >& rFontProps
-                            )
-{
-    rFontProps.clear();
-    int nIndex = rFile.lastIndexOf( '/' );
-    OString aDir, aFile( rFile.copy( nIndex+1 ) );
-    if( nIndex != -1 )
-        aDir = rFile.copy( 0, nIndex );
-    int nDirID = getDirectoryAtom( aDir, true );
-    ::std::list< PrintFont* > aFonts;
-    bool bRet = analyzeFontFile( nDirID, aFile, ::std::list<OString>(), aFonts );
-    while( aFonts.begin() != aFonts.end() )
-    {
-        PrintFont* pFont = aFonts.front();
-        aFonts.pop_front();
-        FastPrintFontInfo aInfo;
-        fillPrintFontInfo( pFont, aInfo );
-        rFontProps.push_back( aInfo );
-        delete pFont;
-    }
-    return bRet;
-}
-
-// -------------------------------------------------------------------------
-
-bool PrintFontManager::isPrivateFontFile( fontID nFont ) const
-{
-    bool bRet = false;
-    int nDirID = -1;
-    PrintFont* pFont = getFont( nFont );
-    if( pFont )
-    {
-        switch( pFont->m_eType )
-        {
-            case fonttype::Type1: nDirID = static_cast< Type1FontFile* >(pFont)->m_nDirectory;break;
-            case fonttype::TrueType: nDirID = static_cast< TrueTypeFontFile* >(pFont)->m_nDirectory;break;
-            default: break;
-        }
-    }
-    if( nDirID != -1 )
-    {
-        for( ::std::list< int >::const_iterator it = m_aPrivateFontDirectories.begin(); it != m_aPrivateFontDirectories.end(); ++it )
-        {
-            if( nDirID == *it )
-            {
-                bRet = true;
-                break;
-            }
-        }
-    }
-    return bRet;
-}
-
-// -------------------------------------------------------------------------
-
-bool PrintFontManager::getAlternativeFamilyNames( fontID nFont, ::std::list< OUString >& rNames ) const
-{
-    rNames.clear();
-
-    PrintFont* pFont = getFont( nFont );
-    if( pFont && pFont->m_eType == fonttype::TrueType )
-    {
-        TrueTypeFontFile* pTTFontFile = static_cast< TrueTypeFontFile* >(pFont);
-        ByteString aFile( getFontFile( pFont ) );
-        TrueTypeFont* pTTFont;
-        if( OpenTTFontFile( aFile.GetBuffer(), pTTFontFile->m_nCollectionEntry, &pTTFont ) == SF_OK )
-        {
-            NameRecord* pNameRecords = NULL;
-            int nNameRecords = GetTTNameRecords( pTTFont, &pNameRecords );
-            for( int i = 0; i < nNameRecords; i++ )
-            {
-                if( pNameRecords[i].nameID != 1 ) // family name
-                    continue;
-
-                OUString aFamily( convertTrueTypeName( pNameRecords+i ) );
-                if( aFamily.getLength()
-                    &&
-                    m_pAtoms->getAtom( ATOM_FAMILYNAME, aFamily, sal_True ) != pFont->m_nFamilyName
-                    )
-                {
-                    rNames.push_back( aFamily );
-                }
-            }
-
-            if( nNameRecords )
-                DisposeNameRecords( pNameRecords, nNameRecords );
-            CloseTTFont( pTTFont );
-        }
-    }
-    return rNames.begin() != rNames.end();
-}
-
 // -------------------------------------------------------------------------
 
 // TODO: move most of this stuff into the central font-subsetting code
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx
index 3255e81..6287eda 100644
--- a/vcl/generic/print/glyphset.cxx
+++ b/vcl/generic/print/glyphset.cxx
@@ -55,12 +55,6 @@ using ::rtl::OString;
 using ::rtl::OStringBuffer;
 using ::rtl::OUStringToOString;
 
-GlyphSet::GlyphSet ()
-        : mnFontID   (-1),
-          mbVertical (0),
-          mbUseFontEncoding (false)
-{}
-
 GlyphSet::GlyphSet (sal_Int32 nFontID, sal_Bool bVertical)
         : mnFontID (nFontID),
           mbVertical (bVertical)
@@ -97,25 +91,6 @@ GlyphSet::IsVertical ()
 }
 
 sal_Bool
-GlyphSet::SetFont (sal_Int32 nFontID, sal_Bool bVertical)
-{
-    if (mnFontID != -1)
-        return sal_False;
-
-    mnFontID   = nFontID;
-    mbVertical = bVertical;
-
-    PrintFontManager &rMgr = PrintFontManager::get();
-    meBaseType      = rMgr.getFontType (mnFontID);
-    maBaseName      = OUStringToOString (rMgr.getPSName(mnFontID),
-                                           RTL_TEXTENCODING_ASCII_US);
-    mnBaseEncoding  = rMgr.getFontEncoding(mnFontID);
-    mbUseFontEncoding   = rMgr.getUseOnlyFontEncoding(mnFontID);
-
-    return sal_True;
-}
-
-sal_Bool
 GlyphSet::GetCharID (
                      sal_Unicode nChar,
                      sal_uChar* nOutGlyphID,
diff --git a/vcl/generic/print/glyphset.hxx b/vcl/generic/print/glyphset.hxx
index c8b009c..d2d5a3f 100644
--- a/vcl/generic/print/glyphset.hxx
+++ b/vcl/generic/print/glyphset.hxx
@@ -100,7 +100,6 @@ private:
 
 public:
 
-    GlyphSet ();
     GlyphSet (sal_Int32 nFontID, sal_Bool bVertical);
     ~GlyphSet ();
 
@@ -114,8 +113,6 @@ public:
                              const rtl::OString &rFontName);
     sal_Bool        IsVertical ();
 
-    sal_Bool        SetFont (sal_Int32 nFontID, sal_Bool bVertical);
-
     void            DrawText (PrinterGfx &rGfx, const Point& rPoint,
                               const sal_Unicode* pStr, sal_Int16 nLen,
                               const sal_Int32* pDeltaArray = NULL);
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 3fe2fac..adbe7d2 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -425,8 +425,6 @@ public:
 
     // routines to get font info in small pieces
 
-    // get a specific fonts family name
-    const rtl::OUString& getFontFamily( fontID nFontID ) const;
     // get a specific fonts PSName name
     const rtl::OUString& getPSName( fontID nFontID ) const;
 
@@ -504,12 +502,6 @@ public:
     void hasVerticalSubstitutions( fontID nFontID, const sal_Unicode* pCharacters,
         int nCharacters, bool* pHasSubst ) const;
 
-    // get the XLFD for a font that originated from the X fontpath
-    // note: this may not be the original line that was in the fonts.dir
-    // returns a string for every font, but only TrueType and Type1
-    // fonts originated from the X font path, so check for the font type
-    rtl::OUString getFontXLFD( fontID nFontID ) const;
-
     // get a specific fonts metrics
 
     // get metrics for a sal_Unicode range
@@ -593,25 +585,6 @@ public:
         virtual bool isCanceled() = 0;
     };
 
-    // checks wether font import would fail due to no writeable directory
-    bool checkImportPossible() const;
-    // expects system paths not UNC paths
-    // returns the number of fonts successfully imported
-    int importFonts( const std::list< rtl::OString >& rFiles, bool bLinkOnly = false, ImportFontCallback* pCallback = NULL );
-
-    // check wether changeFontProperties would fail due to not writable fonts.dir
-    bool checkChangeFontPropertiesPossible( fontID nFont ) const;
-    // change fonts.dir entry for font
-    bool changeFontProperties( fontID nFont, const rtl::OUString& rXLFD );
-
-    // get properties of a not imported font file
-    bool getImportableFontProperties( const rtl::OString& rFile, std::list< FastPrintFontInfo >& rFontProps );
-
-    bool isPrivateFontFile( fontID ) const;
-
-    // returns false if there were not any
-    bool getAlternativeFamilyNames( fontID nFont, std::list< rtl::OUString >& rNames ) const;
-
     /*  system dependendent font matching
 
     <p>
commit 5d53969bbbe74e15fc991f63e0795938ff219815
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 11 22:55:41 2012 +0000

    ditch a tools/string.hxx

diff --git a/svtools/inc/svtools/collatorres.hxx b/svtools/inc/svtools/collatorres.hxx
index 467e8b7..c91197e 100644
--- a/svtools/inc/svtools/collatorres.hxx
+++ b/svtools/inc/svtools/collatorres.hxx
@@ -4,7 +4,7 @@
 #define SVTOOLS_COLLATORRESSOURCE_HXX
 
 #include "svtools/svtdllapi.h"
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
 
 class CollatorRessourceData;
 
@@ -15,12 +15,11 @@ class SVT_DLLPUBLIC CollatorRessource
         CollatorRessourceData  *mp_Data;
 
     public:
-                                CollatorRessource ();
-                                ~CollatorRessource ();
-        const String&           GetTranslation (const String& r_Algorithm);
+        CollatorRessource();
+        ~CollatorRessource();
+        const rtl::OUString& GetTranslation (const rtl::OUString& r_Algorithm);
 };
 
 #endif /* SVTOOLS_COLLATORRESSOURCE_HXX */
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/control/collatorres.cxx b/svtools/source/control/collatorres.cxx
index 7ad862a..2dc30a5 100644
--- a/svtools/source/control/collatorres.cxx
+++ b/svtools/source/control/collatorres.cxx
@@ -41,17 +41,17 @@ class CollatorRessourceData
 {
     friend class CollatorRessource;
     private: /* data */
-        String          ma_Name;
-        String          ma_Translation;
+        rtl::OUString ma_Name;
+        rtl::OUString ma_Translation;
     private: /* member functions */
         CollatorRessourceData () {}
     public:
-        CollatorRessourceData ( const String &r_Algorithm, const String &r_Translation)
+        CollatorRessourceData ( const rtl::OUString &r_Algorithm, const rtl::OUString &r_Translation)
                     : ma_Name (r_Algorithm), ma_Translation (r_Translation) {}
 
-        const String&   GetAlgorithm () const { return ma_Name; }
+        const rtl::OUString& GetAlgorithm () const { return ma_Name; }
 
-        const String&   GetTranslation () const { return ma_Translation; }
+        const rtl::OUString& GetTranslation () const { return ma_Translation; }
 
         ~CollatorRessourceData () {}
 
@@ -75,8 +75,8 @@ CollatorRessource::CollatorRessource()
 {
     mp_Data = new CollatorRessourceData[COLLATOR_RESSOURCE_COUNT];
 
-    #define ASCSTR(str) String(RTL_CONSTASCII_USTRINGPARAM(str))
-    #define RESSTR(rid) String(SvtResId(rid))
+    #define ASCSTR(str) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(str))
+    #define RESSTR(rid) ResId::toString(SvtResId(rid))
 
 
     mp_Data[0] = CollatorRessourceData (ASCSTR("alphanumeric"), RESSTR(STR_SVT_COLLATE_ALPHANUMERIC));
@@ -98,20 +98,20 @@ CollatorRessource::~CollatorRessource()
     delete[] mp_Data;
 }
 
-const String&
-CollatorRessource::GetTranslation (const String &r_Algorithm)
+const rtl::OUString&
+CollatorRessource::GetTranslation(const rtl::OUString &r_Algorithm)
 {
-    xub_StrLen nIndex = r_Algorithm.Search('.');
-    String aLocaleFreeAlgorithm;
+    sal_Int32 nIndex = r_Algorithm.indexOf('.');
+    rtl::OUString aLocaleFreeAlgorithm;
 
-    if (nIndex == STRING_NOTFOUND)
+    if (nIndex == -1)
     {
         aLocaleFreeAlgorithm = r_Algorithm;
     }
     else
     {
         nIndex += 1;
-        aLocaleFreeAlgorithm = String(r_Algorithm, nIndex, r_Algorithm.Len() - nIndex);
+        aLocaleFreeAlgorithm = r_Algorithm.copy(nIndex, r_Algorithm.getLength() - nIndex);
     }
 
     for (sal_uInt32 i = 0; i < COLLATOR_RESSOURCE_COUNT; i++)
commit 284482072ddb2be95e28e0138829554002e4fe79
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 11 22:38:31 2012 +0000

    valgrind: ditch some unused code

diff --git a/editeng/inc/editeng/unofdesc.hxx b/editeng/inc/editeng/unofdesc.hxx
index 8a4af58..fb98d7f 100644
--- a/editeng/inc/editeng/unofdesc.hxx
+++ b/editeng/inc/editeng/unofdesc.hxx
@@ -44,7 +44,6 @@ public:
     static void FillItemSet( const ::com::sun::star::awt::FontDescriptor& rDesc, SfxItemSet& rSet );
     static void FillFromItemSet( const SfxItemSet& rSet, ::com::sun::star::awt::FontDescriptor& rDesc );
 
-    static com::sun::star::beans::PropertyState getPropertyState( const SfxItemSet& rSet );
     static void setPropertyToDefault( SfxItemSet& rSet );
     static ::com::sun::star::uno::Any getPropertyDefault( SfxItemPool* pPool );
 
diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx
index 2f2d485..ae9981d 100644
--- a/editeng/source/uno/unofdesc.cxx
+++ b/editeng/source/uno/unofdesc.cxx
@@ -186,30 +186,6 @@ void SvxUnoFontDescriptor::FillFromItemSet( const SfxItemSet& rSet, awt::FontDes
     }
 }
 
-#define CheckState( state ) \
-    switch( state ) \
-    { \
-    case SFX_ITEM_DONTCARE: \
-    case SFX_ITEM_DISABLED: \
-        return beans::PropertyState_AMBIGUOUS_VALUE; \
-    case SFX_ITEM_READONLY: \
-    case SFX_ITEM_SET: \
-        return beans::PropertyState_DIRECT_VALUE; \
-    }
-
-beans::PropertyState SvxUnoFontDescriptor::getPropertyState( const SfxItemSet& rSet )
-{
-    CheckState(rSet.GetItemState( EE_CHAR_FONTINFO, sal_False ));
-    CheckState(rSet.GetItemState( EE_CHAR_FONTHEIGHT, sal_False ));
-    CheckState(rSet.GetItemState( EE_CHAR_ITALIC, sal_False ));
-    CheckState(rSet.GetItemState( EE_CHAR_UNDERLINE, sal_False ));
-    CheckState(rSet.GetItemState( EE_CHAR_WEIGHT, sal_False ));
-    CheckState(rSet.GetItemState( EE_CHAR_STRIKEOUT, sal_False ));
-    CheckState(rSet.GetItemState( EE_CHAR_WLM, sal_False ));
-
-    return beans::PropertyState_DEFAULT_VALUE;
-}
-
 void SvxUnoFontDescriptor::setPropertyToDefault( SfxItemSet& rSet )
 {
     rSet.InvalidateItem( EE_CHAR_FONTINFO );
commit 0d7932327bf221b5132f0c84b25c67deb4cd904b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 11 22:30:39 2012 +0000

    callcatcher: ditch unused childat

diff --git a/unusedcode.easy b/unusedcode.easy
index 14d7c9b..262034a 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1,7 +1,6 @@
 AtomDocument::AtomDocument(AtomPubSession*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)
 AtomFolder::AtomFolder(AtomPubSession*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)
 AtomPubSession::getCollectionUrl(Collection::Type)
-BufferNode::childAt(int) const
 ByteString::Assign(char const*, unsigned short)
 ByteString::Assign(char)
 ByteString::ByteString(char const*, unsigned short)
diff --git a/xmlsecurity/source/framework/buffernode.cxx b/xmlsecurity/source/framework/buffernode.cxx
index e706429..a6de3ca 100644
--- a/xmlsecurity/source/framework/buffernode.cxx
+++ b/xmlsecurity/source/framework/buffernode.cxx
@@ -537,40 +537,6 @@ sal_Int32 BufferNode::indexOfChild(const BufferNode* pChild) const
     return nIndex;
 }
 
-const BufferNode* BufferNode::childAt(sal_Int32 nIndex) const
-/****** BufferNode/childAt ***************************************************
- *
- *   NAME
- *  childAt -- retrieves the child BufferNode at specific possition.
- *
- *   SYNOPSIS
- *  child = childAt(nIndex);
- *
- *   FUNCTION
- *  see NAME
- *
- *   INPUTS
- *  nIndex - the index of the child BufferNode to be retrieved
- *
- *   RESULT
- *  child - the child BufferNode at index position, or NULL if the index
- *          is out of the range of children.
- *
- *   AUTHOR
- *  Michael Mi
- *  Email: michael.mi at sun.com
- ******************************************************************************/
-{
-    BufferNode* rc = NULL;
-
-    if (nIndex < ((sal_Int32)m_vChildren.size()) && nIndex >= 0)
-    {
-        rc = (BufferNode*)m_vChildren[nIndex];
-    }
-
-    return (const BufferNode*)rc;
-}
-
 const BufferNode* BufferNode::getParent() const
 {
     return m_pParent;
diff --git a/xmlsecurity/source/framework/buffernode.hxx b/xmlsecurity/source/framework/buffernode.hxx
index bdece77..7744a2d 100644
--- a/xmlsecurity/source/framework/buffernode.hxx
+++ b/xmlsecurity/source/framework/buffernode.hxx
@@ -114,7 +114,6 @@ public:
     void addChild(const BufferNode* pChild);
     void removeChild(const BufferNode* pChild);
     sal_Int32 indexOfChild(const BufferNode* pChild) const;
-    const BufferNode* childAt(sal_Int32 nIndex) const;
     const BufferNode* getParent() const;
     void setParent(const BufferNode* pParent);
     const BufferNode* getNextSibling() const;


More information about the Libreoffice-commits mailing list