diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-08-03 01:51:34 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2011-08-03 01:54:39 +0200 |
commit | 1b5f37d262718920f4efe6387287d76d97daeba4 (patch) | |
tree | d4010e93b3b373bb48aaadff6eefcd1200754904 | |
parent | 1e54169bb51f46a866857960afbb5065681c5745 (diff) |
callcatcher: remove unused methods
-rw-r--r-- | svl/inc/svl/itemiter.hxx | 1 | ||||
-rw-r--r-- | svl/inc/svl/itempool.hxx | 2 | ||||
-rw-r--r-- | svl/source/items/itemiter.cxx | 20 | ||||
-rw-r--r-- | svl/source/items/itempool.cxx | 51 | ||||
-rw-r--r-- | svl/source/items/poolio.cxx | 54 | ||||
-rw-r--r-- | toolkit/source/layout/vcl/wrapper.cxx | 195 | ||||
-rw-r--r-- | vcl/Library_vclplug_gen.mk | 1 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salcvt.cxx | 339 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salcvt.hxx | 95 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi3.cxx | 1 |
10 files changed, 0 insertions, 759 deletions
diff --git a/svl/inc/svl/itemiter.hxx b/svl/inc/svl/itemiter.hxx index 55ad0e7b02a5..0bb16cb49c93 100644 --- a/svl/inc/svl/itemiter.hxx +++ b/svl/inc/svl/itemiter.hxx @@ -56,7 +56,6 @@ public: const SfxPoolItem* GetCurItem() { return _rSet._nCount ? *(_rSet._aItems+_nAkt) : 0; } const SfxPoolItem* NextItem(); - const SfxPoolItem* PrevItem(); sal_Bool IsAtStart() const { return _nAkt == _nStt; } sal_Bool IsAtEnd() const { return _nAkt == _nEnd; } diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx index bceedeee1591..a2e54698059a 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.hxx @@ -239,7 +239,6 @@ public: return pMaster; } void FreezeIdRanges(); - void Cleanup(); void Delete(); #ifdef TF_POOLABLE @@ -274,7 +273,6 @@ public: return nId && nId > SFX_WHICH_MAX; } static const SfxItemPool* GetStoringPool(); - static void SetStoringPool( const SfxItemPool * ); private: const SfxItemPool& operator=(const SfxItemPool &); // n.i.!! diff --git a/svl/source/items/itemiter.cxx b/svl/source/items/itemiter.cxx index cd349a8c9321..edd30b9af508 100644 --- a/svl/source/items/itemiter.cxx +++ b/svl/source/items/itemiter.cxx @@ -95,24 +95,4 @@ const SfxPoolItem* SfxItemIter::NextItem() return 0; } -// -------------------------------------------------------------------------- - - -const SfxPoolItem* SfxItemIter::PrevItem() -{ - DBG_CHKTHIS(SfxItemIter, 0); - SfxItemArray ppFnd = _rSet._aItems; - - if ( _nAkt > _nStt ) - { - do { - --_nAkt; - } while( _nAkt && !*(ppFnd + _nAkt )); - return *(ppFnd+_nAkt); - } - return 0; -} - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 6d9346a3ac5c..3b4ff12d2b09 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -629,57 +629,6 @@ void SfxItemPool::Delete() // ---------------------------------------------------------------------- -void SfxItemPool::Cleanup() -{ - DBG_CHKTHIS(SfxItemPool, 0); - - //MA 16. Apr. 97: siehe ::Delete() - - SfxPoolItemArray_Impl** ppItemArr = pImp->ppPoolItems; - SfxPoolItem** ppDefaultItem = ppPoolDefaults; - SfxPoolItem** ppStaticDefaultItem = ppStaticDefaults; - sal_uInt16 nArrCnt; - - HACK( "fuer Image, dort gibt es derzeit keine Statics - Bug" ) - if ( ppStaticDefaults ) //HACK fuer Image, dort gibt es keine Statics!! - { - for ( nArrCnt = GetSize_Impl(); - nArrCnt; - --nArrCnt, ++ppItemArr, ++ppDefaultItem, ++ppStaticDefaultItem ) - { - //Fuer jedes Item gibt es entweder ein Default oder ein static Default! - if ( *ppItemArr && - ((*ppDefaultItem && (*ppDefaultItem)->ISA(SfxSetItem)) || - (*ppStaticDefaultItem)->ISA(SfxSetItem)) ) - { - SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); - for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) - if ( *ppHtArr && !(*ppHtArr)->GetRefCount() ) - { - DELETEZ(*ppHtArr); - } - } - } - } - - ppItemArr = pImp->ppPoolItems; - - for ( nArrCnt = GetSize_Impl(); - nArrCnt; - --nArrCnt, ++ppItemArr ) - { - if ( *ppItemArr ) - { - SfxPoolItemArrayBase_Impl::iterator ppHtArr = (*ppItemArr)->begin(); - for ( size_t n = (*ppItemArr)->size(); n; --n, ++ppHtArr ) - if ( *ppHtArr && !(*ppHtArr)->GetRefCount() ) - DELETEZ( *ppHtArr ); - } - } -} - -// ---------------------------------------------------------------------- - void SfxItemPool::SetPoolDefaultItem(const SfxPoolItem &rItem) { DBG_CHKTHIS(SfxItemPool, 0); diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index 4811340af938..ea49c2b2dd06 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -46,27 +46,6 @@ DBG_NAME(SfxItemPool); //======================================================================== -void SfxItemPool::SetStoringPool( const SfxItemPool *pStoringPool ) - -/* [Beschreibung] - - Diese Methode setzt den <SfxItemPool>, der gerade gespeichert wird. - Sie sollte nur in Notf"allen verwendet werden, um z.B. File-Format- - Kompatibilit"at zu gew"ahrleisten o."o. - z.B. in der "uberladung eines - <SfxPoolItem::Store()> zus"atzliche Daten aus dem dazuge"horigen - Pool mit <SfxItemPool::GetStoringPool()> zu besorgen. - - Sie wird von <SfxItemPool::Store()> bedient, kann jedoch f"ur nicht - poolable Items auch direkt gerufen werden. Bitte m"oglichst nicht - f"ur jedes Item einzeln, da 2 Calls! -*/ - -{ - ImpSvlData::GetSvlData().pStoringPool = pStoringPool; -} - -//------------------------------------------------------------------------- - const SfxItemPool* SfxItemPool::GetStoringPool() /* [Beschreibung] @@ -1477,39 +1456,6 @@ bool SfxItemPool::IsCurrentVersionLoading() const // ----------------------------------------------------------------------- -sal_uInt16 SfxItemPool::GetVersion() const - -/* [Beschreibung] - - Diese Methode liefert die aktuelle Versionsnummer des SfxItemPool-Aufbaus - (also des Which-Bereichs). - - Precondition: keine - Postcondition: unver"andert - Laufzeit: 2 - - - [Anmerkung] - - Achtung: Es mu\s ggf. die Versionsnummer von Sekund"arpools - ber"ucksichtigt werden. - - - [Querverweise] - - <SfxItemPool::IsLoadingVersionCurrent()const> - <SfxItemPool::SetVersionMap(sal_uInt16,sal_uInt16,sal_uInt16,sal_uInt16*)> - <SfxItemPool::GetNewWhich(sal_uInt16)const> -*/ - -{ - return pImp->nVersion; -} - -// ----------------------------------------------------------------------- - -//------------------------------------------------------------------------- - bool SfxItemPool::IsVer2_Impl() const { return pMaster->pImp->nMajorVer >= 2; diff --git a/toolkit/source/layout/vcl/wrapper.cxx b/toolkit/source/layout/vcl/wrapper.cxx index d4d16357d037..d78bb28dff07 100644 --- a/toolkit/source/layout/vcl/wrapper.cxx +++ b/toolkit/source/layout/vcl/wrapper.cxx @@ -376,101 +376,6 @@ void Window::SetHelpId( const rtl::OString& id ) GetWindow()->SetHelpId( id ); } -const rtl::OString& Window::GetHelpId() const -{ - return GetWindow()->GetHelpId(); -} - -void Window::EnterWait () -{ - GetWindow()->EnterWait (); -} -void Window::LeaveWait () -{ - GetWindow()->LeaveWait (); -} -bool Window::IsWait () const -{ - return GetWindow()->IsWait (); -} - -bool Window::IsVisible () const -{ - if (GetWindow ()) - return GetWindow()->IsVisible (); - return false; -} - -bool Window::HasChildPathFocus (bool systemWindow) const -{ - return GetWindow()->HasChildPathFocus (systemWindow); -} - -void Window::SetPosPixel (Point const&) -{ -} - -Point Window::GetPosPixel () const -{ - return Point (); -} - -void Window::SetSizePixel (Size const&) -{ -} - -void Window::SetPosSizePixel (Point const&, Size const&) -{ -} - -Size Window::GetSizePixel () const -{ - return Size (); -} - -// void Window::Enable (bool enable, bool child); -// { -// GetWindow ()->Enable (enable, child); -// } - -// void Window::Disable (bool child) -// { -// GetWindow ()->Disable (child); -// } - -bool Window::IsEnabled () const -{ - return GetWindow ()->IsEnabled (); -// if (getImpl().mxWindow.is ()) -// return getImpl ().mxWindow->isEnabled (); -// return false; -} - -void Window::EnableInput (bool enable, bool child) -{ - GetWindow ()->EnableInput (enable, child); -} - -bool Window::IsInputEnabled () const -{ - return GetWindow ()->IsInputEnabled (); -} - -bool Window::HasFocus () const -{ - return GetWindow ()->HasFocus (); -} - -Font& Window::GetFont () const -{ - return const_cast <Font&> (GetWindow ()->GetFont ()); -} - -void Window::SetFont (Font const& font) -{ - GetWindow ()->SetFont (font); -} - void Window::Invalidate (sal_uInt8 flags) { GetWindow ()->Invalidate (flags); @@ -541,52 +446,6 @@ static const ToolkitVclPropsMap toolkitVclPropsMap[] = static const int toolkitVclPropsMapLen = sizeof( toolkitVclPropsMap ) / sizeof( ToolkitVclPropsMap ); -void Window::SetStyle( WinBits nStyle ) -{ - uno::Reference< awt::XVclWindowPeer > xPeer = mpImpl->mxVclPeer; - for (int i = 0; i < toolkitVclPropsMapLen; i++) - { - if ( toolkitVclPropsMap[ i ].propName ) - { - short nValue; - if ( nStyle & toolkitVclPropsMap[ i ].vclStyle ) - nValue = toolkitVclPropsMap[ i ].enableProp; - else - nValue = toolkitVclPropsMap[ i ].disableProp; - uno::Any aValue; - if ( toolkitVclPropsMap[ i ].isBoolean ) - aValue = uno::makeAny( (bool) nValue ); - else - aValue = uno::makeAny( (short) nValue ); - mpImpl->setProperty( toolkitVclPropsMap[ i ].propName, aValue ); - } - } -} - -WinBits Window::GetStyle() -{ - uno::Reference< awt::XVclWindowPeer > xPeer = mpImpl->mxVclPeer; - WinBits ret = 0; - for (int i = 0; i < toolkitVclPropsMapLen; i++) - { - if ( toolkitVclPropsMap[ i ].propName ) - { - short nValue = 0; - if ( toolkitVclPropsMap[ i ].isBoolean ) - { - bool bValue = false; - mpImpl->getProperty( toolkitVclPropsMap[ i ].propName ) >>= bValue; - nValue = bValue ? 1 : 0; - } - else - mpImpl->getProperty( toolkitVclPropsMap[ i ].propName ) >>= nValue; - if ( nValue == toolkitVclPropsMap[ i ].enableProp ) - ret |= toolkitVclPropsMap[i].vclStyle; - } - } - return ret; -} - /* Unpleasant way to get an xToolkit pointer ... */ uno::Reference< awt::XToolkit > getToolkit() { @@ -616,13 +475,6 @@ PeerHandle Window::CreatePeer( Window *parent, WinBits nStyle, const char *pName return layoutimpl::WidgetFactory::createWidget (getToolkit(), parent->GetPeer(), OUString::createFromAscii( pName ), nWinAttrbs); } -void Window::Enable( bool bEnable ) -{ - if ( !getImpl().mxWindow.is() ) - return; - getImpl().mxWindow->setEnable( bEnable ); -} - void Window::Show( bool bVisible ) { if ( !getImpl().mxWindow.is() ) @@ -637,53 +489,11 @@ void Window::Show( bool bVisible ) } } -void Window::GrabFocus() -{ - if ( !getImpl().mxWindow.is() ) - return; - getImpl().mxWindow->setFocus(); -} - -void Window::SetUpdateMode(bool mode) -{ - GetWindow()->SetUpdateMode( mode ); -} - -void Window::SetPointer( Pointer const& pointer ) -{ - GetWindow()->SetPointer( pointer ); -} - -Pointer const& Window::GetPointer() const -{ - return GetWindow()->GetPointer(); -} - void Window::SetText( OUString const& str ) { GetWindow()->SetText( str ); } -String Window::GetText() const -{ - return GetWindow()->GetText(); -} - -sal_Int32 Window::GetCtrlTextWidth (OUString const&) const -{ - return 0; -} - -sal_Int32 Window::GetTextHeight () const -{ - return 0; -} - -Size Window::LogicToPixel( Size const& size, MapMode const&) const -{ - return size; -} - ControlImpl::ControlImpl (Context *context, const PeerHandle &peer, Window *window) : WindowImpl( context, peer, window ) { @@ -1099,8 +909,6 @@ TabControl::~TabControl () void TabControl::InsertPage (sal_uInt16 id, OUString const& title, sal_uInt16 pos) { (void) pos; -// GetTabControl ()->InsertPage (id, title, pos); -// GetTabControl ()->SetTabPage (id, new ::TabPage (GetTabControl ())); MX_TABCONTROL->insertTab (); SetCurPageId (id); @@ -1177,9 +985,6 @@ Link& TabControl::GetDeactivatePageHdl () const void TabControl::SetTabPageSizePixel (Size const& size) { GetTabControl ()->SetTabPageSizePixel (size); -// GetParent()->SetSizePixel (size); -// GetWindow()->SetSizePixel (size); - //GetVCLXTabControl->SetTabSize (size); } Size TabControl::GetTabPageSizePixel () const { diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index c671fd78ed04..aae1ed97a342 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -98,7 +98,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\ vcl/unx/generic/gdi/gcach_xpeer \ vcl/unx/generic/gdi/pspgraphics \ vcl/unx/generic/gdi/salbmp \ - vcl/unx/generic/gdi/salcvt \ vcl/unx/generic/gdi/salgdi2 \ vcl/unx/generic/gdi/salgdi3 \ vcl/unx/generic/gdi/salgdi \ diff --git a/vcl/unx/generic/gdi/salcvt.cxx b/vcl/unx/generic/gdi/salcvt.cxx deleted file mode 100644 index b67b5828bf13..000000000000 --- a/vcl/unx/generic/gdi/salcvt.cxx +++ /dev/null @@ -1,339 +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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_vcl.hxx" -#include "salcvt.hxx" - - -SalConverterCache::SalConverterCache() -{ -} - -SalConverterCache* -SalConverterCache::GetInstance () -{ - static SalConverterCache* pCvt = NULL; - if (pCvt == NULL) - pCvt = new SalConverterCache; - - return pCvt; -} - -SalConverterCache::~SalConverterCache() -{ -} - -// ---> FIXME -#include <stdio.h> - -rtl_UnicodeToTextConverter -SalConverterCache::GetU2TConverter( rtl_TextEncoding nEncoding ) -{ - if( rtl_isOctetTextEncoding( nEncoding ) ) - { - ConverterT& rConverter( m_aConverters[ nEncoding ] ); - if ( rConverter.mpU2T == NULL ) - { - rConverter.mpU2T = - rtl_createUnicodeToTextConverter( nEncoding ); -// ---> FIXME -if ( rConverter.mpU2T == NULL ) - fprintf( stderr, "failed to create Unicode -> %i converter\n", nEncoding); - } - return rConverter.mpU2T; - } - return NULL; -} - -rtl_TextToUnicodeConverter -SalConverterCache::GetT2UConverter( rtl_TextEncoding nEncoding ) -{ - if( rtl_isOctetTextEncoding( nEncoding ) ) - { - ConverterT& rConverter( m_aConverters[ nEncoding ] ); - if ( rConverter.mpT2U == NULL ) - { - rConverter.mpT2U = - rtl_createTextToUnicodeConverter( nEncoding ); -// ---> FIXME -if ( rConverter.mpT2U == NULL ) - fprintf( stderr, "failed to create %i -> Unicode converter\n", nEncoding ); - } - return rConverter.mpT2U; - } - return NULL; -} - -Bool -SalConverterCache::IsSingleByteEncoding( rtl_TextEncoding nEncoding ) -{ - if( rtl_isOctetTextEncoding( nEncoding ) ) - { - ConverterT& rConverter( m_aConverters[ nEncoding ] ); - if ( ! rConverter.mbValid ) - { - rConverter.mbValid = True; - - rtl_TextEncodingInfo aTextEncInfo; - aTextEncInfo.StructSize = sizeof( aTextEncInfo ); - rtl_getTextEncodingInfo( nEncoding, &aTextEncInfo ); - - if ( aTextEncInfo.MinimumCharSize == aTextEncInfo.MaximumCharSize - && aTextEncInfo.MinimumCharSize == 1) - rConverter.mbSingleByteEncoding = True; - else - rConverter.mbSingleByteEncoding = False; - } - - return rConverter.mbSingleByteEncoding; - } - return False; -} - -// check whether the character set nEncoding contains the unicode -// code point nChar. This list has been compiled from the according -// ttmap files in /usr/openwin/lib/X11/fonts/TrueType/ttmap/ -Bool -SalConverterCache::EncodingHasChar( rtl_TextEncoding nEncoding, - sal_Unicode nChar ) -{ - Bool bMatch = False; - - switch ( nEncoding ) - { - case RTL_TEXTENCODING_DONTKNOW: - bMatch = False; - break; - - case RTL_TEXTENCODING_MS_1252: - case RTL_TEXTENCODING_ISO_8859_1: - case RTL_TEXTENCODING_ISO_8859_15: - // handle iso8859-15 and iso8859-1 the same (and both with euro) - // handle them also like ms1252 - // this is due to the fact that so many X fonts say they are iso8859-1 - // but have the other glyphs anyway because they are really ms1252 - bMatch = ( /*nChar >= 0x0000 &&*/ nChar <= 0x00ff ) - || ( nChar == 0x20ac ) - || ( nChar == 0x201a ) - || ( nChar == 0x0192 ) - || ( nChar == 0x201e ) - || ( nChar == 0x2026 ) - || ( nChar == 0x2020 ) - || ( nChar == 0x2021 ) - || ( nChar == 0x02c6 ) - || ( nChar == 0x2030 ) - || ( nChar == 0x0160 ) - || ( nChar == 0x2039 ) - || ( nChar == 0x0152 ) - || ( nChar == 0x017d ) - || ( nChar == 0x2018 ) - || ( nChar == 0x2019 ) - || ( nChar == 0x201c ) - || ( nChar == 0x201d ) - || ( nChar == 0x2022 ) - || ( nChar == 0x2013 ) - || ( nChar == 0x2014 ) - || ( nChar == 0x02dc ) - || ( nChar == 0x2122 ) - || ( nChar == 0x0161 ) - || ( nChar == 0x203a ) - || ( nChar == 0x0153 ) - || ( nChar == 0x017e ) - || ( nChar == 0x0178 ) - ; - break; - - case RTL_TEXTENCODING_ISO_8859_2: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x017e ) - || ( nChar >= 0x02c7 && nChar <= 0x02dd ); - break; - - case RTL_TEXTENCODING_ISO_8859_4: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x017e ) - || ( nChar >= 0x02c7 && nChar <= 0x02db ); - break; - - case RTL_TEXTENCODING_ISO_8859_5: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x00ad ) - || ( nChar >= 0x0401 && nChar <= 0x045f ) - || ( nChar == 0x2116 ); - break; - - case RTL_TEXTENCODING_ISO_8859_6: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x0600 && nChar <= 0x06ff ) - || ( nChar >= 0xfb50 && nChar <= 0xfffe ); - break; - - case RTL_TEXTENCODING_ISO_8859_7: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x00bd ) - || ( nChar == 0x02bd ) - || ( nChar >= 0x0384 && nChar <= 0x03ce ) - || ( nChar >= 0x2014 && nChar <= 0x2019 ); - break; - - case RTL_TEXTENCODING_ISO_8859_8: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x00f7 ) - || ( nChar >= 0x05d0 && nChar <= 0x05ea ) - || ( nChar == 0x2017 ); - break; - - case RTL_TEXTENCODING_ISO_8859_9: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x015f ); - break; - - case RTL_TEXTENCODING_ISO_8859_13: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x017e ) - || ( nChar >= 0x2019 && nChar <= 0x201e ); - break; - - /* real case for RTL_TEXTENCODING_ISO_8859_15 - case RTL_TEXTENCODING_ISO_8859_15: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x00ff ) - || ( nChar >= 0x0152 && nChar <= 0x017e ) - || ( nChar == 0x20ac ); - break; - */ - - case RTL_TEXTENCODING_JIS_X_0201: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0xff61 && nChar <= 0xff9f ); - break; - - case RTL_TEXTENCODING_MS_1251: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x00bb ) - || ( nChar >= 0x0401 && nChar <= 0x045f ) - || ( nChar >= 0x0490 && nChar <= 0x0491 ) - || ( nChar >= 0x2013 && nChar <= 0x203a ) - || ( nChar >= 0x2116 && nChar <= 0x2122 ); - break; - - case RTL_TEXTENCODING_KOI8_R: - bMatch = ( nChar >= 0x0020 && nChar <= 0x007e ) - || ( nChar >= 0x00a0 && nChar <= 0x00b7 ) - || ( nChar == 0x00f7 ) - || ( nChar >= 0x0401 && nChar <= 0x0451 ) - || ( nChar >= 0x2219 && nChar <= 0x221a ) - || ( nChar >= 0x2248 && nChar <= 0x2265 ) - || ( nChar >= 0x2320 && nChar <= 0x2321 ) - || ( nChar >= 0x2500 && nChar <= 0x25a0 ); - break; - - case RTL_TEXTENCODING_UNICODE: - bMatch = True; - break; - - case RTL_TEXTENCODING_EUC_KR: - case RTL_TEXTENCODING_BIG5: - case RTL_TEXTENCODING_GBK: - case RTL_TEXTENCODING_GB_2312: - case RTL_TEXTENCODING_MS_1361: - case RTL_TEXTENCODING_JIS_X_0208: - - // XXX Big5 and Korean EUC contain Ascii chars, but Solaris - // *-big5-1 and *-ksc5601.1992-3 fonts dont, in general CJK fonts - // are monospaced, so dont trust them for latin chars - if (nChar <= 0xFF) - { - bMatch = False; - break; - } - - default: - // XXX really convert the unicode char into the encoding - // and check for conversion errors, this is expensive ! - rtl_UnicodeToTextConverter aConverter; - rtl_UnicodeToTextContext aContext; - - aConverter = GetU2TConverter(nEncoding); - aContext = rtl_createUnicodeToTextContext( aConverter ); - - // ---> FIXME - if ( aConverter == NULL ) - return False; - - sal_Char pConversionBuffer[ 32 ]; - sal_uInt32 nConversionInfo; - sal_Size nConvertedChars; - sal_Size nSize; - - nSize = rtl_convertUnicodeToText( aConverter, aContext, - &nChar, 1, pConversionBuffer, sizeof(pConversionBuffer), - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR - | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR, - &nConversionInfo, &nConvertedChars ); - - rtl_destroyUnicodeToTextContext( aConverter, aContext ); - - bMatch = (nConvertedChars == 1) - && (nSize == 1 || nSize == 2) // XXX Fix me this is a hack - && ((nConversionInfo & RTL_UNICODETOTEXT_INFO_ERROR) == 0); - break; - } - - return bMatch; -} - -// wrapper for rtl_convertUnicodeToText that handles the usual cases for -// textconversion in drawtext and gettextwidth routines -sal_Size -SalConverterCache::ConvertStringUTF16( const sal_Unicode *pText, int nTextLen, - sal_Char *pBuffer, sal_Size nBufferSize, rtl_TextEncoding nEncoding ) -{ - rtl_UnicodeToTextConverter aConverter = GetU2TConverter(nEncoding); - - const sal_uInt32 nCvtFlags = - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE - | RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK - | RTL_UNICODETOTEXT_FLAGS_INVALID_QUESTIONMARK ; - sal_uInt32 nCvtInfo; - sal_Size nCvtChars; - - rtl_UnicodeToTextContext aContext = - rtl_createUnicodeToTextContext( aConverter ); - - sal_Size nSize = rtl_convertUnicodeToText( aConverter, aContext, - pText, nTextLen, pBuffer, nBufferSize, - nCvtFlags, &nCvtInfo, &nCvtChars ); - - rtl_destroyUnicodeToTextContext( aConverter, aContext ); - - return nSize; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/salcvt.hxx b/vcl/unx/generic/gdi/salcvt.hxx deleted file mode 100644 index 896ae4f30b36..000000000000 --- a/vcl/unx/generic/gdi/salcvt.hxx +++ /dev/null @@ -1,95 +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 SAL_CONVERTER_CACHE_HXX_ -#define SAL_CONVERTER_CACHE_HXX_ - -#include <rtl/tencinfo.h> -#include <rtl/textcvt.h> - -#include <unx/salunx.h> - -#include <map> - -extern "C" const char* -pGetEncodingName( rtl_TextEncoding nEncoding ); - -// -// Cache TextToUnicode and UnicodeToText converter and conversion info which is -// used in DrawXYZ routines and in the Event loop -// - -class SalConverterCache { - - public: - SalConverterCache(); - ~SalConverterCache(); - Bool EncodingHasChar( - rtl_TextEncoding nEncoding, sal_Unicode nChar ); - rtl_UnicodeToTextConverter - GetU2TConverter( rtl_TextEncoding nEncoding ); - rtl_TextToUnicodeConverter - GetT2UConverter( rtl_TextEncoding nEncoding ); - Bool IsSingleByteEncoding( rtl_TextEncoding nEncoding ); - sal_Size ConvertStringUTF16( const sal_Unicode *pText, int nTextLen, - sal_Char *pBuffer, sal_Size nBufferSize, - rtl_TextEncoding nEncoding); - - static SalConverterCache* - GetInstance (); - - private: - - struct ConverterT { - rtl_UnicodeToTextConverter mpU2T; - rtl_TextToUnicodeConverter mpT2U; - Bool mbSingleByteEncoding; - Bool mbValid; - ConverterT() : - mpU2T( NULL ), - mpT2U( NULL ), - mbSingleByteEncoding( False ), - mbValid( False ) - { - } - ~ConverterT() - { - if( mpU2T ) - rtl_destroyUnicodeToTextConverter( mpU2T ); - if( mpT2U ) - rtl_destroyTextToUnicodeConverter( mpT2U ); - } - }; - - std::map< rtl_TextEncoding, ConverterT > m_aConverters; -}; - - - -#endif /* SAL_CONVERTER_CACHE_HXX_ */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 49ab62fb2044..f03bc353a740 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -71,7 +71,6 @@ #include "unx/pspgraphics.h" #include "unx/salvd.h" -#include "salcvt.hxx" #include "gcach_xpeer.hxx" #include "xrender_peer.hxx" #include "impfont.hxx" |