Kaydet (Commit) e986d3e3 authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) David Tardon

fdo#39468 Translation and cleanup

Cleanup of source code:
- translated German to English
- removed useless comment decorations
- removed commented out code
- some reformatting of code

Change-Id: I71d5fdab8226d61bda9ac906bb82176dc11cafd2
Reviewed-on: https://gerrit.libreoffice.org/3643Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst e81d0c40
...@@ -21,13 +21,11 @@ ...@@ -21,13 +21,11 @@
#include "generic/glyphcache.hxx" #include "generic/glyphcache.hxx"
#include <string.h> #include <string.h>
//------------------------------------------------------------------------
RawBitmap::RawBitmap() RawBitmap::RawBitmap()
: mpBits(0), mnAllocated(0) : mpBits(0), mnAllocated(0)
{} {}
//------------------------------------------------------------------------
RawBitmap::~RawBitmap() RawBitmap::~RawBitmap()
{ {
...@@ -36,7 +34,6 @@ RawBitmap::~RawBitmap() ...@@ -36,7 +34,6 @@ RawBitmap::~RawBitmap()
mnAllocated = 0; mnAllocated = 0;
} }
//------------------------------------------------------------------------
// used by 90 and 270 degree rotations on 8 bit deep bitmaps // used by 90 and 270 degree rotations on 8 bit deep bitmaps
static void ImplRotate8_90( unsigned char* p1, const unsigned char* p2, static void ImplRotate8_90( unsigned char* p1, const unsigned char* p2,
...@@ -51,7 +48,6 @@ static void ImplRotate8_90( unsigned char* p1, const unsigned char* p2, ...@@ -51,7 +48,6 @@ static void ImplRotate8_90( unsigned char* p1, const unsigned char* p2,
} }
} }
//------------------------------------------------------------------------
// used by inplace 180 degree rotation on 8 bit deep bitmaps // used by inplace 180 degree rotation on 8 bit deep bitmaps
static void ImplRotate8_180( unsigned char* p1, int xmax, int ymax, int nPad ) static void ImplRotate8_180( unsigned char* p1, int xmax, int ymax, int nPad )
...@@ -79,7 +75,6 @@ static void ImplRotate8_180( unsigned char* p1, int xmax, int ymax, int nPad ) ...@@ -79,7 +75,6 @@ static void ImplRotate8_180( unsigned char* p1, int xmax, int ymax, int nPad )
} }
} }
//------------------------------------------------------------------------
// used by 90 or 270 degree rotations on 1 bit deep bitmaps // used by 90 or 270 degree rotations on 1 bit deep bitmaps
static void ImplRotate1_90( unsigned char* p1, const unsigned char* p2, static void ImplRotate1_90( unsigned char* p1, const unsigned char* p2,
...@@ -119,7 +114,6 @@ static void ImplRotate1_90( unsigned char* p1, const unsigned char* p2, ...@@ -119,7 +114,6 @@ static void ImplRotate1_90( unsigned char* p1, const unsigned char* p2,
} }
} }
//------------------------------------------------------------------------
// used by 180 degrees rotations on 1 bit deep bitmaps // used by 180 degrees rotations on 1 bit deep bitmaps
static void ImplRotate1_180( unsigned char* p1, const unsigned char* p2, static void ImplRotate1_180( unsigned char* p1, const unsigned char* p2,
...@@ -157,7 +151,6 @@ static void ImplRotate1_180( unsigned char* p1, const unsigned char* p2, ...@@ -157,7 +151,6 @@ static void ImplRotate1_180( unsigned char* p1, const unsigned char* p2,
} }
} }
//------------------------------------------------------------------------
bool RawBitmap::Rotate( int nAngle ) bool RawBitmap::Rotate( int nAngle )
{ {
...@@ -261,6 +254,4 @@ bool RawBitmap::Rotate( int nAngle ) ...@@ -261,6 +254,4 @@ bool RawBitmap::Rotate( int nAngle )
return true; return true;
} }
//------------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -36,10 +36,6 @@ ...@@ -36,10 +36,6 @@
#include <osl/file.hxx> #include <osl/file.hxx>
#include <tools/debug.hxx> #include <tools/debug.hxx>
// =======================================================================
// GlyphCache
// =======================================================================
static GlyphCache* pInstance = NULL; static GlyphCache* pInstance = NULL;
GlyphCache::GlyphCache( GlyphCachePeer& rPeer ) GlyphCache::GlyphCache( GlyphCachePeer& rPeer )
...@@ -55,7 +51,6 @@ GlyphCache::GlyphCache( GlyphCachePeer& rPeer ) ...@@ -55,7 +51,6 @@ GlyphCache::GlyphCache( GlyphCachePeer& rPeer )
mpFtManager = new FreetypeManager; mpFtManager = new FreetypeManager;
} }
// -----------------------------------------------------------------------
GlyphCache::~GlyphCache() GlyphCache::~GlyphCache()
{ {
...@@ -63,7 +58,6 @@ GlyphCache::~GlyphCache() ...@@ -63,7 +58,6 @@ GlyphCache::~GlyphCache()
delete mpFtManager; delete mpFtManager;
} }
// -----------------------------------------------------------------------
void GlyphCache::InvalidateAllGlyphs() void GlyphCache::InvalidateAllGlyphs()
{ {
...@@ -78,7 +72,6 @@ void GlyphCache::InvalidateAllGlyphs() ...@@ -78,7 +72,6 @@ void GlyphCache::InvalidateAllGlyphs()
mpCurrentGCFont = NULL; mpCurrentGCFont = NULL;
} }
// -----------------------------------------------------------------------
inline inline
size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData ) const size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData ) const
...@@ -105,7 +98,6 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData ...@@ -105,7 +98,6 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData
return nHash; return nHash;
} }
// -----------------------------------------------------------------------
bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const FontSelectPattern& rB) const bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const FontSelectPattern& rB) const
{ {
...@@ -154,14 +146,12 @@ bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const Font ...@@ -154,14 +146,12 @@ bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const Font
return true; return true;
} }
// -----------------------------------------------------------------------
GlyphCache& GlyphCache::GetInstance() GlyphCache& GlyphCache::GetInstance()
{ {
return *pInstance; return *pInstance;
} }
// -----------------------------------------------------------------------
void GlyphCache::AddFontFile( const OString& rNormalizedName, int nFaceNum, void GlyphCache::AddFontFile( const OString& rNormalizedName, int nFaceNum,
sal_IntPtr nFontId, const ImplDevFontAttributes& rDFA, const ExtraKernInfo* pExtraKern ) sal_IntPtr nFontId, const ImplDevFontAttributes& rDFA, const ExtraKernInfo* pExtraKern )
...@@ -170,7 +160,6 @@ void GlyphCache::AddFontFile( const OString& rNormalizedName, int nFaceNum, ...@@ -170,7 +160,6 @@ void GlyphCache::AddFontFile( const OString& rNormalizedName, int nFaceNum,
mpFtManager->AddFontFile( rNormalizedName, nFaceNum, nFontId, rDFA, pExtraKern ); mpFtManager->AddFontFile( rNormalizedName, nFaceNum, nFontId, rDFA, pExtraKern );
} }
// -----------------------------------------------------------------------
void GlyphCache::AnnounceFonts( ImplDevFontList* pList ) const void GlyphCache::AnnounceFonts( ImplDevFontList* pList ) const
{ {
...@@ -185,7 +174,6 @@ void GlyphCache::ClearFontCache() ...@@ -185,7 +174,6 @@ void GlyphCache::ClearFontCache()
mpFtManager->ClearFontList(); mpFtManager->ClearFontList();
} }
// -----------------------------------------------------------------------
ServerFont* GlyphCache::CacheFont( const FontSelectPattern& rFontSelData ) ServerFont* GlyphCache::CacheFont( const FontSelectPattern& rFontSelData )
{ {
...@@ -238,7 +226,6 @@ ServerFont* GlyphCache::CacheFont( const FontSelectPattern& rFontSelData ) ...@@ -238,7 +226,6 @@ ServerFont* GlyphCache::CacheFont( const FontSelectPattern& rFontSelData )
return pNew; return pNew;
} }
// -----------------------------------------------------------------------
void GlyphCache::UncacheFont( ServerFont& rServerFont ) void GlyphCache::UncacheFont( ServerFont& rServerFont )
{ {
...@@ -254,7 +241,6 @@ void GlyphCache::UncacheFont( ServerFont& rServerFont ) ...@@ -254,7 +241,6 @@ void GlyphCache::UncacheFont( ServerFont& rServerFont )
} }
} }
// -----------------------------------------------------------------------
void GlyphCache::GarbageCollect() void GlyphCache::GarbageCollect()
{ {
...@@ -306,14 +292,12 @@ void GlyphCache::GarbageCollect() ...@@ -306,14 +292,12 @@ void GlyphCache::GarbageCollect()
} }
} }
// -----------------------------------------------------------------------
inline void GlyphCache::UsingGlyph( ServerFont&, GlyphData& rGlyphData ) inline void GlyphCache::UsingGlyph( ServerFont&, GlyphData& rGlyphData )
{ {
rGlyphData.SetLruValue( mnLruIndex++ ); rGlyphData.SetLruValue( mnLruIndex++ );
} }
// -----------------------------------------------------------------------
inline void GlyphCache::AddedGlyph( ServerFont& rServerFont, GlyphData& rGlyphData ) inline void GlyphCache::AddedGlyph( ServerFont& rServerFont, GlyphData& rGlyphData )
{ {
...@@ -323,7 +307,6 @@ inline void GlyphCache::AddedGlyph( ServerFont& rServerFont, GlyphData& rGlyphDa ...@@ -323,7 +307,6 @@ inline void GlyphCache::AddedGlyph( ServerFont& rServerFont, GlyphData& rGlyphDa
GrowNotify(); GrowNotify();
} }
// -----------------------------------------------------------------------
void GlyphCache::GrowNotify() void GlyphCache::GrowNotify()
{ {
...@@ -331,7 +314,6 @@ void GlyphCache::GrowNotify() ...@@ -331,7 +314,6 @@ void GlyphCache::GrowNotify()
GarbageCollect(); GarbageCollect();
} }
// -----------------------------------------------------------------------
inline void GlyphCache::RemovingGlyph( ServerFont& rSF, GlyphData& rGD, int nGlyphIndex ) inline void GlyphCache::RemovingGlyph( ServerFont& rSF, GlyphData& rGD, int nGlyphIndex )
{ {
...@@ -340,11 +322,10 @@ inline void GlyphCache::RemovingGlyph( ServerFont& rSF, GlyphData& rGD, int nGly ...@@ -340,11 +322,10 @@ inline void GlyphCache::RemovingGlyph( ServerFont& rSF, GlyphData& rGD, int nGly
--mnGlyphCount; --mnGlyphCount;
} }
// -----------------------------------------------------------------------
void ServerFont::ReleaseFromGarbageCollect() void ServerFont::ReleaseFromGarbageCollect()
{ {
// remove from GC list // remove from GC list
ServerFont* pPrev = mpPrevGCFont; ServerFont* pPrev = mpPrevGCFont;
ServerFont* pNext = mpNextGCFont; ServerFont* pNext = mpNextGCFont;
if( pPrev ) pPrev->mpNextGCFont = pNext; if( pPrev ) pPrev->mpNextGCFont = pNext;
...@@ -353,7 +334,6 @@ void ServerFont::ReleaseFromGarbageCollect() ...@@ -353,7 +334,6 @@ void ServerFont::ReleaseFromGarbageCollect()
mpNextGCFont = NULL; mpNextGCFont = NULL;
} }
// -----------------------------------------------------------------------
long ServerFont::Release() const long ServerFont::Release() const
{ {
...@@ -361,7 +341,6 @@ long ServerFont::Release() const ...@@ -361,7 +341,6 @@ long ServerFont::Release() const
return --mnRefCount; return --mnRefCount;
} }
// -----------------------------------------------------------------------
GlyphData& ServerFont::GetGlyphData( int nGlyphIndex ) GlyphData& ServerFont::GetGlyphData( int nGlyphIndex )
{ {
...@@ -381,7 +360,6 @@ GlyphData& ServerFont::GetGlyphData( int nGlyphIndex ) ...@@ -381,7 +360,6 @@ GlyphData& ServerFont::GetGlyphData( int nGlyphIndex )
return rGlyphData; return rGlyphData;
} }
// -----------------------------------------------------------------------
void ServerFont::GarbageCollect( long nMinLruIndex ) void ServerFont::GarbageCollect( long nMinLruIndex )
{ {
...@@ -401,7 +379,6 @@ void ServerFont::GarbageCollect( long nMinLruIndex ) ...@@ -401,7 +379,6 @@ void ServerFont::GarbageCollect( long nMinLruIndex )
} }
} }
// =======================================================================
ImplServerFontEntry::ImplServerFontEntry( FontSelectPattern& rFSD ) ImplServerFontEntry::ImplServerFontEntry( FontSelectPattern& rFSD )
: ImplFontEntry( rFSD ) : ImplFontEntry( rFSD )
...@@ -409,7 +386,6 @@ ImplServerFontEntry::ImplServerFontEntry( FontSelectPattern& rFSD ) ...@@ -409,7 +386,6 @@ ImplServerFontEntry::ImplServerFontEntry( FontSelectPattern& rFSD )
, mbGotFontOptions( false ) , mbGotFontOptions( false )
{} {}
// -----------------------------------------------------------------------
void ImplServerFontEntry::SetServerFont(ServerFont* p) void ImplServerFontEntry::SetServerFont(ServerFont* p)
{ {
...@@ -429,7 +405,6 @@ ImplServerFontEntry::~ImplServerFontEntry() ...@@ -429,7 +405,6 @@ ImplServerFontEntry::~ImplServerFontEntry()
mpServerFont->Release(); mpServerFont->Release();
} }
// =======================================================================
ExtraKernInfo::ExtraKernInfo( sal_IntPtr nFontId ) ExtraKernInfo::ExtraKernInfo( sal_IntPtr nFontId )
: mbInitialized( false ), : mbInitialized( false ),
...@@ -437,7 +412,6 @@ ExtraKernInfo::ExtraKernInfo( sal_IntPtr nFontId ) ...@@ -437,7 +412,6 @@ ExtraKernInfo::ExtraKernInfo( sal_IntPtr nFontId )
maUnicodeKernPairs( 0 ) maUnicodeKernPairs( 0 )
{} {}
//--------------------------------------------------------------------------
int ExtraKernInfo::GetUnscaledKernPairs( ImplKernPairData** ppKernPairs ) const int ExtraKernInfo::GetUnscaledKernPairs( ImplKernPairData** ppKernPairs ) const
{ {
...@@ -461,6 +435,4 @@ int ExtraKernInfo::GetUnscaledKernPairs( ImplKernPairData** ppKernPairs ) const ...@@ -461,6 +435,4 @@ int ExtraKernInfo::GetUnscaledKernPairs( ImplKernPairData** ppKernPairs ) const
return nKernCount; return nKernCount;
} }
// =======================================================================
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
using namespace basegfx; using namespace basegfx;
using namespace basebmp; using namespace basebmp;
// ===========================================================================
class SvpGlyphPeer class SvpGlyphPeer
: public GlyphCachePeer : public GlyphCachePeer
{ {
...@@ -62,8 +60,6 @@ protected: ...@@ -62,8 +60,6 @@ protected:
}; };
}; };
// ===========================================================================
class SvpGlyphCache : public GlyphCache class SvpGlyphCache : public GlyphCache
{ {
public: public:
...@@ -112,7 +108,6 @@ SvpGlyphCache& SvpGlyphCache::GetInstance() ...@@ -112,7 +108,6 @@ SvpGlyphCache& SvpGlyphCache::GetInstance()
return theGlyphCacheHolder::get().getGlyphCache(); return theGlyphCacheHolder::get().getGlyphCache();
} }
// ===========================================================================
BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont,
int nGlyphIndex, sal_uInt32 nBmpFormat, B2IPoint& rTargetPos ) int nGlyphIndex, sal_uInt32 nBmpFormat, B2IPoint& rTargetPos )
...@@ -168,14 +163,12 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, ...@@ -168,14 +163,12 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont,
return pGcpHelper->maBitmapDev; return pGcpHelper->maBitmapDev;
} }
//--------------------------------------------------------------------------
void SvpGlyphPeer::RemovingFont( ServerFont& ) void SvpGlyphPeer::RemovingFont( ServerFont& )
{ {
// nothing to do: no font resources held in SvpGlyphPeer // nothing to do: no font resources held in SvpGlyphPeer
} }
//--------------------------------------------------------------------------
void SvpGlyphPeer::RemovingGlyph( ServerFont&, GlyphData& rGlyphData, int /*nGlyphIndex*/ ) void SvpGlyphPeer::RemovingGlyph( ServerFont&, GlyphData& rGlyphData, int /*nGlyphIndex*/ )
{ {
...@@ -189,7 +182,6 @@ void SvpGlyphPeer::RemovingGlyph( ServerFont&, GlyphData& rGlyphData, int /*nGly ...@@ -189,7 +182,6 @@ void SvpGlyphPeer::RemovingGlyph( ServerFont&, GlyphData& rGlyphData, int /*nGly
} }
} }
// ===========================================================================
// PspKernInfo allows on-demand-querying of psprint provided kerning info (#i29881#) // PspKernInfo allows on-demand-querying of psprint provided kerning info (#i29881#)
class PspKernInfo : public ExtraKernInfo class PspKernInfo : public ExtraKernInfo
...@@ -200,7 +192,6 @@ protected: ...@@ -200,7 +192,6 @@ protected:
virtual void Initialize() const; virtual void Initialize() const;
}; };
//--------------------------------------------------------------------------
void PspKernInfo::Initialize() const void PspKernInfo::Initialize() const
{ {
...@@ -221,7 +212,6 @@ void PspKernInfo::Initialize() const ...@@ -221,7 +212,6 @@ void PspKernInfo::Initialize() const
} }
} }
// ===========================================================================
sal_uInt16 SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel ) sal_uInt16 SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel )
{ {
...@@ -257,7 +247,6 @@ sal_uInt16 SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel ...@@ -257,7 +247,6 @@ sal_uInt16 SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel
return SAL_SETFONT_USEDRAWTEXTARRAY; return SAL_SETFONT_USEDRAWTEXTARRAY;
} }
// ---------------------------------------------------------------------------
void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel ) void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
{ {
...@@ -271,7 +260,6 @@ void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe ...@@ -271,7 +260,6 @@ void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
} }
} }
// ---------------------------------------------------------------------------
sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ) sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs )
{ {
...@@ -289,7 +277,6 @@ sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer ...@@ -289,7 +277,6 @@ sal_uLong SvpSalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKer
return nGotPairs; return nGotPairs;
} }
// ---------------------------------------------------------------------------
const ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const const ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const
{ {
...@@ -308,7 +295,6 @@ bool SvpSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabil ...@@ -308,7 +295,6 @@ bool SvpSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabil
return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities); return m_pServerFont[0]->GetFontCapabilities(rFontCapabilities);
} }
// ---------------------------------------------------------------------------
void SvpSalGraphics::GetDevFontList( ImplDevFontList* pDevFontList ) void SvpSalGraphics::GetDevFontList( ImplDevFontList* pDevFontList )
{ {
...@@ -360,12 +346,10 @@ void SvpSalGraphics::ClearDevFontCache() ...@@ -360,12 +346,10 @@ void SvpSalGraphics::ClearDevFontCache()
rGC.ClearFontCache(); rGC.ClearFontCache();
} }
// ---------------------------------------------------------------------------
void SvpSalGraphics::GetDevFontSubstList( OutputDevice* ) void SvpSalGraphics::GetDevFontSubstList( OutputDevice* )
{} {}
// ---------------------------------------------------------------------------
bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*, bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*,
const OUString&, const OUString& ) const OUString&, const OUString& )
...@@ -373,7 +357,6 @@ bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*, ...@@ -373,7 +357,6 @@ bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*,
return false; return false;
} }
// ---------------------------------------------------------------------------
sal_Bool SvpSalGraphics::CreateFontSubset( sal_Bool SvpSalGraphics::CreateFontSubset(
const OUString& rToFile, const OUString& rToFile,
...@@ -403,7 +386,6 @@ sal_Bool SvpSalGraphics::CreateFontSubset( ...@@ -403,7 +386,6 @@ sal_Bool SvpSalGraphics::CreateFontSubset(
return bSuccess; return bSuccess;
} }
// ---------------------------------------------------------------------------
const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded ) const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded )
{ {
...@@ -416,7 +398,6 @@ const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace ...@@ -416,7 +398,6 @@ const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace
return GenPspGraphics::DoGetFontEncodingVector( aFont, pNonEncoded ); return GenPspGraphics::DoGetFontEncodingVector( aFont, pNonEncoded );
} }
// ---------------------------------------------------------------------------
const void* SvpSalGraphics::GetEmbedFontData( const void* SvpSalGraphics::GetEmbedFontData(
const PhysicalFontFace* pFont, const PhysicalFontFace* pFont,
...@@ -435,7 +416,6 @@ const void* SvpSalGraphics::GetEmbedFontData( ...@@ -435,7 +416,6 @@ const void* SvpSalGraphics::GetEmbedFontData(
return GenPspGraphics::DoGetEmbedFontData( aFont, pUnicodes, pWidths, rInfo, pDataLen ); return GenPspGraphics::DoGetEmbedFontData( aFont, pUnicodes, pWidths, rInfo, pDataLen );
} }
// ---------------------------------------------------------------------------
void SvpSalGraphics::FreeEmbedFontData( const void* pData, long nLen ) void SvpSalGraphics::FreeEmbedFontData( const void* pData, long nLen )
{ {
...@@ -456,7 +436,6 @@ void SvpSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, ...@@ -456,7 +436,6 @@ void SvpSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont,
GenPspGraphics::DoGetGlyphWidths( aFont, bVertical, rWidths, rUnicodeEnc ); GenPspGraphics::DoGetGlyphWidths( aFont, bVertical, rWidths, rUnicodeEnc );
} }
// ---------------------------------------------------------------------------
sal_Bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) sal_Bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect )
{ {
...@@ -474,7 +453,6 @@ sal_Bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& ...@@ -474,7 +453,6 @@ sal_Bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle&
return sal_True; return sal_True;
} }
// ---------------------------------------------------------------------------
sal_Bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygon& rPolyPoly ) sal_Bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygon& rPolyPoly )
{ {
...@@ -493,7 +471,6 @@ sal_Bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygo ...@@ -493,7 +471,6 @@ sal_Bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygo
return sal_False; return sal_False;
} }
// ---------------------------------------------------------------------------
SalLayout* SvpSalGraphics::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) SalLayout* SvpSalGraphics::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel )
{ {
...@@ -505,7 +482,6 @@ SalLayout* SvpSalGraphics::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) ...@@ -505,7 +482,6 @@ SalLayout* SvpSalGraphics::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel )
return pLayout; return pLayout;
} }
// ---------------------------------------------------------------------------
void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout ) void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout )
{ {
......
...@@ -26,14 +26,9 @@ ...@@ -26,14 +26,9 @@
#include <boost/optional.hpp> #include <boost/optional.hpp>
//........................................................................
namespace vcl namespace vcl
{ {
//........................................................................
//====================================================================
//= QuickSelectionEngine_Data
//====================================================================
struct QuickSelectionEngine_Data struct QuickSelectionEngine_Data
{ {
ISearchableStringList& rEntryList; ISearchableStringList& rEntryList;
...@@ -59,7 +54,6 @@ namespace vcl ...@@ -59,7 +54,6 @@ namespace vcl
DECL_LINK( SearchStringTimeout, Timer* ); DECL_LINK( SearchStringTimeout, Timer* );
}; };
//--------------------------------------------------------------------
namespace namespace
{ {
static void lcl_reset( QuickSelectionEngine_Data& _data ) static void lcl_reset( QuickSelectionEngine_Data& _data )
...@@ -70,18 +64,16 @@ namespace vcl ...@@ -70,18 +64,16 @@ namespace vcl
} }
} }
//--------------------------------------------------------------------
IMPL_LINK( QuickSelectionEngine_Data, SearchStringTimeout, Timer*, /*EMPTYARG*/ ) IMPL_LINK( QuickSelectionEngine_Data, SearchStringTimeout, Timer*, /*EMPTYARG*/ )
{ {
lcl_reset( *this ); lcl_reset( *this );
return 1; return 1;
} }
//--------------------------------------------------------------------
static StringEntryIdentifier findMatchingEntry( const OUString& _searchString, QuickSelectionEngine_Data& _engineData ) static StringEntryIdentifier findMatchingEntry( const OUString& _searchString, QuickSelectionEngine_Data& _engineData )
{ {
const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetLocaleI18nHelper(); const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetLocaleI18nHelper();
// TODO: do we really need the Window's settings here? The original code used it ... // TODO: do we really need the Window's settings here? The original code used it ...
String sEntryText; String sEntryText;
// get the "current + 1" entry // get the "current + 1" entry
...@@ -103,21 +95,15 @@ namespace vcl ...@@ -103,21 +95,15 @@ namespace vcl
return pSearchEntry; return pSearchEntry;
} }
//====================================================================
//= QuickSelectionEngine
//====================================================================
//--------------------------------------------------------------------
QuickSelectionEngine::QuickSelectionEngine( ISearchableStringList& _entryList ) QuickSelectionEngine::QuickSelectionEngine( ISearchableStringList& _entryList )
:m_pData( new QuickSelectionEngine_Data( _entryList ) ) :m_pData( new QuickSelectionEngine_Data( _entryList ) )
{ {
} }
//--------------------------------------------------------------------
QuickSelectionEngine::~QuickSelectionEngine() QuickSelectionEngine::~QuickSelectionEngine()
{ {
} }
//--------------------------------------------------------------------
bool QuickSelectionEngine::HandleKeyEvent( const KeyEvent& _keyEvent ) bool QuickSelectionEngine::HandleKeyEvent( const KeyEvent& _keyEvent )
{ {
sal_Unicode c = _keyEvent.GetCharCode(); sal_Unicode c = _keyEvent.GetCharCode();
...@@ -164,14 +150,11 @@ namespace vcl ...@@ -164,14 +150,11 @@ namespace vcl
return false; return false;
} }
//--------------------------------------------------------------------
void QuickSelectionEngine::Reset() void QuickSelectionEngine::Reset()
{ {
lcl_reset( *m_pData ); lcl_reset( *m_pData );
} }
//........................................................................
} // namespace vcl } // namespace vcl
//........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -179,25 +179,21 @@ void Throbber::initImages() ...@@ -179,25 +179,21 @@ void Throbber::initImages()
} }
} }
//----------------------------------------------------------------------------------------------------------------------
void Throbber::start() void Throbber::start()
{ {
maWaitTimer.Start(); maWaitTimer.Start();
} }
//----------------------------------------------------------------------------------------------------------------------
void Throbber::stop() void Throbber::stop()
{ {
maWaitTimer.Stop(); maWaitTimer.Stop();
} }
//----------------------------------------------------------------------------------------------------------------------
bool Throbber::isRunning() const bool Throbber::isRunning() const
{ {
return maWaitTimer.IsActive(); return maWaitTimer.IsActive();
} }
//----------------------------------------------------------------------------------------------------------------------
void Throbber::setImageList( ::std::vector< Image > const& i_images ) void Throbber::setImageList( ::std::vector< Image > const& i_images )
{ {
maImageList = i_images; maImageList = i_images;
...@@ -207,7 +203,6 @@ void Throbber::setImageList( ::std::vector< Image > const& i_images ) ...@@ -207,7 +203,6 @@ void Throbber::setImageList( ::std::vector< Image > const& i_images )
SetImage( aInitialImage ); SetImage( aInitialImage );
} }
//----------------------------------------------------------------------------------------------------------------------
void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList ) void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList )
{ {
::std::vector< Image > aImages( rImageList.getLength() ); ::std::vector< Image > aImages( rImageList.getLength() );
...@@ -219,7 +214,6 @@ void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList ...@@ -219,7 +214,6 @@ void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList
setImageList( aImages ); setImageList( aImages );
} }
//----------------------------------------------------------------------------------------------------------------------
::std::vector< OUString > Throbber::getDefaultImageURLs( const ImageSet i_imageSet ) ::std::vector< OUString > Throbber::getDefaultImageURLs( const ImageSet i_imageSet )
{ {
::std::vector< OUString > aImageURLs; ::std::vector< OUString > aImageURLs;
...@@ -257,7 +251,6 @@ void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList ...@@ -257,7 +251,6 @@ void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList
return aImageURLs; return aImageURLs;
} }
//----------------------------------------------------------------------------------------------------------------------
IMPL_LINK_NOARG(Throbber, TimeOutHdl) IMPL_LINK_NOARG(Throbber, TimeOutHdl)
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
#include <boost/bind.hpp> #include <boost/bind.hpp>
using namespace std; using namespace std;
//=========================== GDI-Array ===================================
// GDI-Array
#define EMR_HEADER 1 #define EMR_HEADER 1
#define EMR_POLYBEZIER 2 #define EMR_POLYBEZIER 2
...@@ -156,7 +157,6 @@ using namespace std; ...@@ -156,7 +157,6 @@ using namespace std;
#define EMFP_DEBUG(x) #define EMFP_DEBUG(x)
#endif #endif
//-----------------------------------------------------------------------------------
#ifdef OSL_BIGENDIAN #ifdef OSL_BIGENDIAN
// currently unused // currently unused
...@@ -264,8 +264,8 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) ...@@ -264,8 +264,8 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC)
bHaveDC = false; bHaveDC = false;
OSL_ASSERT(length >= 4); OSL_ASSERT(length >= 4);
//reduce by 32bit length itself, skip in SeekRel if // reduce by 32bit length itself, skip in SeekRel if
//impossibly unavailble // impossibly unavailble
sal_uInt32 nRemainder = length >= 4 ? length-4 : length; sal_uInt32 nRemainder = length >= 4 ? length-4 : length;
const size_t nRequiredHeaderSize = 12; const size_t nRequiredHeaderSize = 12;
...@@ -285,11 +285,11 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) ...@@ -285,11 +285,11 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC)
EMFP_DEBUG(printf ("\t\tEMF+ lock DC (device context)\n")); EMFP_DEBUG(printf ("\t\tEMF+ lock DC (device context)\n"));
} }
//Get the length of the remaining data of this record based // Get the length of the remaining data of this record based
//on the alleged size // on the alleged size
sal_uInt32 nRemainingRecordData = size >= nRequiredHeaderSize ? sal_uInt32 nRemainingRecordData = size >= nRequiredHeaderSize ?
size-nRequiredHeaderSize : 0; size-nRequiredHeaderSize : 0;
//clip to available size // clip to available size
nRemainingRecordData = std::min(nRemainingRecordData, nRemainder); nRemainingRecordData = std::min(nRemainingRecordData, nRemainder);
pWMF->SeekRel(nRemainingRecordData); pWMF->SeekRel(nRemainingRecordData);
nRemainder -= nRemainingRecordData; nRemainder -= nRemainingRecordData;
...@@ -394,13 +394,13 @@ void EnhWMFReader::ReadAndDrawPolyPolygon() ...@@ -394,13 +394,13 @@ void EnhWMFReader::ReadAndDrawPolyPolygon()
( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) && ( nPoly < SAL_MAX_UINT32 / sizeof(sal_uInt16) ) &&
( ( nPoly * sizeof( sal_uInt16 ) ) <= ( nEndPos - pWMF->Tell() ) )) ( ( nPoly * sizeof( sal_uInt16 ) ) <= ( nEndPos - pWMF->Tell() ) ))
{ {
//Get number of points in each polygon // Get number of points in each polygon
sal_uInt16 * pnPoints = new sal_uInt16[ nPoly ]; sal_uInt16 * pnPoints = new sal_uInt16[ nPoly ];
for ( i = 0; i < nPoly && pWMF->good(); i++ ) for ( i = 0; i < nPoly && pWMF->good(); i++ )
{ {
*pWMF >> nPoints; *pWMF >> nPoints;
pnPoints[ i ] = (sal_uInt16)nPoints; pnPoints[ i ] = (sal_uInt16)nPoints;
} //end for }
if ( pWMF->good() && ( nGesPoints * (sizeof(T)+sizeof(T)) ) <= ( nEndPos - pWMF->Tell() ) ) if ( pWMF->good() && ( nGesPoints * (sizeof(T)+sizeof(T)) ) <= ( nEndPos - pWMF->Tell() ) )
{ {
// Get polygon points // Get polygon points
...@@ -410,14 +410,14 @@ void EnhWMFReader::ReadAndDrawPolyPolygon() ...@@ -410,14 +410,14 @@ void EnhWMFReader::ReadAndDrawPolyPolygon()
T nX, nY; T nX, nY;
*pWMF >> nX >> nY; *pWMF >> nX >> nY;
pPtAry[ i ] = Point( nX, nY ); pPtAry[ i ] = Point( nX, nY );
} //end for }
// Create PolyPolygon Actions // Create PolyPolygon Actions
PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry ); PolyPolygon aPolyPoly( (sal_uInt16)nPoly, pnPoints, pPtAry );
pOut->DrawPolyPolygon( aPolyPoly, bRecordPath ); pOut->DrawPolyPolygon( aPolyPoly, bRecordPath );
delete[] pPtAry; delete[] pPtAry;
} //end if }
delete[] pnPoints; delete[] pnPoints;
} //end if }
} }
sal_Bool EnhWMFReader::ReadEnhWMF() sal_Bool EnhWMFReader::ReadEnhWMF()
...@@ -475,12 +475,12 @@ sal_Bool EnhWMFReader::ReadEnhWMF() ...@@ -475,12 +475,12 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
EMFP_DEBUG(printf ("\t\tbegin %c%c%c%c id: 0x%x\n", (char)(id & 0xff), (char)((id & 0xff00) >> 8), (char)((id & 0xff0000) >> 16), (char)((id & 0xff000000) >> 24), (unsigned int)id)); EMFP_DEBUG(printf ("\t\tbegin %c%c%c%c id: 0x%x\n", (char)(id & 0xff), (char)((id & 0xff00) >> 8), (char)((id & 0xff0000) >> 16), (char)((id & 0xff000000) >> 24), (unsigned int)id));
// EMF+ comment (fixme: BE?) // EMF+ comment (FIXME: BE?)
if( id == 0x2B464D45 && nRecSize >= 12 ) if( id == 0x2B464D45 && nRecSize >= 12 )
ReadEMFPlusComment( length, bHaveDC ); ReadEMFPlusComment( length, bHaveDC );
// GDIC comment, doesn't do anything useful yet // GDIC comment, doesn't do anything useful yet
else if( id == 0x43494447 && nRecSize >= 12 ) { else if( id == 0x43494447 && nRecSize >= 12 ) {
//ToDo: ReadGDIComment() // TODO: ReadGDIComment()
} else { } else {
EMFP_DEBUG(printf ("\t\tunknown id: 0x%x\n",(unsigned int) id)); EMFP_DEBUG(printf ("\t\tunknown id: 0x%x\n",(unsigned int) id));
} }
...@@ -685,7 +685,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF() ...@@ -685,7 +685,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
LineInfo aLineInfo; LineInfo aLineInfo;
sal_uInt32 nStyle; sal_uInt32 nStyle;
Size aSize; Size aSize;
//#fdo39428 Remove SvStream operator>>(long&) // #fdo39428 Remove SvStream operator>>(long&)
sal_Int32 nTmpW(0), nTmpH(0); sal_Int32 nTmpW(0), nTmpH(0);
*pWMF >> nStyle >> nTmpW >> nTmpH; *pWMF >> nStyle >> nTmpW >> nTmpH;
...@@ -1338,7 +1338,6 @@ sal_Bool EnhWMFReader::ReadEnhWMF() ...@@ -1338,7 +1338,6 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
return bStatus; return bStatus;
}; };
//-----------------------------------------------------------------------------------
sal_Bool EnhWMFReader::ReadHeader() sal_Bool EnhWMFReader::ReadHeader()
{ {
...@@ -1367,12 +1366,12 @@ sal_Bool EnhWMFReader::ReadHeader() ...@@ -1367,12 +1366,12 @@ sal_Bool EnhWMFReader::ReadHeader()
rclFrame.Right() = nRight; rclFrame.Right() = nRight;
rclFrame.Bottom() = nBottom; rclFrame.Bottom() = nBottom;
*pWMF >> nsal_uInt32; // signature *pWMF >> nsal_uInt32; // signature
if ( nsal_uInt32 != 0x464d4520 ) if ( nsal_uInt32 != 0x464d4520 )
return sal_False; return sal_False;
*pWMF >> nsal_uInt32; // nVersion *pWMF >> nsal_uInt32; // nVersion
*pWMF >> nEndPos; // size of metafile *pWMF >> nEndPos; // size of metafile
nEndPos += nStartPos; nEndPos += nStartPos;
...@@ -1401,7 +1400,6 @@ sal_Bool EnhWMFReader::ReadHeader() ...@@ -1401,7 +1400,6 @@ sal_Bool EnhWMFReader::ReadHeader()
return sal_True; return sal_True;
} }
//-----------------------------------------------------------------------------------
Rectangle EnhWMFReader::ReadRectangle( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 ) Rectangle EnhWMFReader::ReadRectangle( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32 y2 )
{ {
......
...@@ -23,15 +23,8 @@ ...@@ -23,15 +23,8 @@
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include "impimagetree.hxx" #include "impimagetree.hxx"
//........................................................................
namespace vcl namespace vcl
{ {
//........................................................................
//====================================================================
//= ImageRepository
//====================================================================
//--------------------------------------------------------------------
bool ImageRepository::loadImage( const OUString& _rName, BitmapEx& _out_rImage, bool _bSearchLanguageDependent, bool loadMissing ) bool ImageRepository::loadImage( const OUString& _rName, BitmapEx& _out_rImage, bool _bSearchLanguageDependent, bool loadMissing )
{ {
OUString sCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName(); OUString sCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
...@@ -47,8 +40,6 @@ namespace vcl ...@@ -47,8 +40,6 @@ namespace vcl
return aImplImageTree->loadDefaultImage( sCurrentSymbolsStyle,_out_rImage); return aImplImageTree->loadDefaultImage( sCurrentSymbolsStyle,_out_rImage);
} }
//........................................................................
} // namespace vcl } // namespace vcl
//........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -32,58 +32,44 @@ ...@@ -32,58 +32,44 @@
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#endif #endif
//........................................................................
namespace vcl namespace vcl
{ {
//........................................................................
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::Exception;
namespace ScriptDirection = ::com::sun::star::i18n::ScriptDirection; namespace ScriptDirection = ::com::sun::star::i18n::ScriptDirection;
//====================================================================
//= DefaultTextLayout
//====================================================================
//--------------------------------------------------------------------
DefaultTextLayout::~DefaultTextLayout() DefaultTextLayout::~DefaultTextLayout()
{ {
} }
//--------------------------------------------------------------------
long DefaultTextLayout::GetTextWidth( const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const long DefaultTextLayout::GetTextWidth( const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const
{ {
return m_rTargetDevice.GetTextWidth( _rText, _nStartIndex, _nLength ); return m_rTargetDevice.GetTextWidth( _rText, _nStartIndex, _nLength );
} }
//--------------------------------------------------------------------
void DefaultTextLayout::DrawText( const Point& _rStartPoint, const OUString& _rText, sal_Int32 _nStartIndex, void DefaultTextLayout::DrawText( const Point& _rStartPoint, const OUString& _rText, sal_Int32 _nStartIndex,
sal_Int32 _nLength, MetricVector* _pVector, OUString* _pDisplayText ) sal_Int32 _nLength, MetricVector* _pVector, OUString* _pDisplayText )
{ {
m_rTargetDevice.DrawText( _rStartPoint, _rText, _nStartIndex, _nLength, _pVector, _pDisplayText ); m_rTargetDevice.DrawText( _rStartPoint, _rText, _nStartIndex, _nLength, _pVector, _pDisplayText );
} }
//--------------------------------------------------------------------
bool DefaultTextLayout::GetCaretPositions( const OUString& _rText, sal_Int32* _pCaretXArray, bool DefaultTextLayout::GetCaretPositions( const OUString& _rText, sal_Int32* _pCaretXArray,
sal_Int32 _nStartIndex, sal_Int32 _nLength ) const sal_Int32 _nStartIndex, sal_Int32 _nLength ) const
{ {
return m_rTargetDevice.GetCaretPositions( _rText, _pCaretXArray, _nStartIndex, _nLength ); return m_rTargetDevice.GetCaretPositions( _rText, _pCaretXArray, _nStartIndex, _nLength );
} }
//--------------------------------------------------------------------
xub_StrLen DefaultTextLayout::GetTextBreak( const OUString& _rText, long _nMaxTextWidth, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const xub_StrLen DefaultTextLayout::GetTextBreak( const OUString& _rText, long _nMaxTextWidth, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const
{ {
return m_rTargetDevice.GetTextBreak( _rText, _nMaxTextWidth, _nStartIndex, _nLength ); return m_rTargetDevice.GetTextBreak( _rText, _nMaxTextWidth, _nStartIndex, _nLength );
} }
//--------------------------------------------------------------------
bool DefaultTextLayout::DecomposeTextRectAction() const bool DefaultTextLayout::DecomposeTextRectAction() const
{ {
return false; return false;
} }
//====================================================================
//= ReferenceDeviceTextLayout
//====================================================================
class ReferenceDeviceTextLayout : public ITextLayout class ReferenceDeviceTextLayout : public ITextLayout
{ {
public: public:
...@@ -122,9 +108,6 @@ namespace vcl ...@@ -122,9 +108,6 @@ namespace vcl
Rectangle m_aCompleteTextRect; Rectangle m_aCompleteTextRect;
}; };
//====================================================================
//= ControlTextRenderer
//====================================================================
ReferenceDeviceTextLayout::ReferenceDeviceTextLayout( const Control& _rControl, OutputDevice& _rTargetDevice, ReferenceDeviceTextLayout::ReferenceDeviceTextLayout( const Control& _rControl, OutputDevice& _rTargetDevice,
OutputDevice& _rReferenceDevice ) OutputDevice& _rReferenceDevice )
:m_rTargetDevice( _rTargetDevice ) :m_rTargetDevice( _rTargetDevice )
...@@ -170,17 +153,14 @@ namespace vcl ...@@ -170,17 +153,14 @@ namespace vcl
m_rReferenceDevice.SetFont( aRefFont ); m_rReferenceDevice.SetFont( aRefFont );
} }
//--------------------------------------------------------------------
ReferenceDeviceTextLayout::~ReferenceDeviceTextLayout() ReferenceDeviceTextLayout::~ReferenceDeviceTextLayout()
{ {
m_rReferenceDevice.Pop(); m_rReferenceDevice.Pop();
m_rTargetDevice.Pop(); m_rTargetDevice.Pop();
} }
//--------------------------------------------------------------------
namespace namespace
{ {
//................................................................
bool lcl_normalizeLength( const OUString& _rText, const sal_Int32 _nStartIndex, sal_Int32& _io_nLength ) bool lcl_normalizeLength( const OUString& _rText, const sal_Int32 _nStartIndex, sal_Int32& _io_nLength )
{ {
sal_Int32 nTextLength = _rText.getLength(); sal_Int32 nTextLength = _rText.getLength();
...@@ -192,7 +172,6 @@ namespace vcl ...@@ -192,7 +172,6 @@ namespace vcl
} }
} }
//--------------------------------------------------------------------
long ReferenceDeviceTextLayout::GetTextArray( const OUString& _rText, sal_Int32* _pDXAry, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const long ReferenceDeviceTextLayout::GetTextArray( const OUString& _rText, sal_Int32* _pDXAry, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const
{ {
if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) ) if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) )
...@@ -222,13 +201,11 @@ namespace vcl ...@@ -222,13 +201,11 @@ namespace vcl
return nTextWidth; return nTextWidth;
} }
//--------------------------------------------------------------------
long ReferenceDeviceTextLayout::GetTextWidth( const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const long ReferenceDeviceTextLayout::GetTextWidth( const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const
{ {
return GetTextArray( _rText, NULL, _nStartIndex, _nLength ); return GetTextArray( _rText, NULL, _nStartIndex, _nLength );
} }
//--------------------------------------------------------------------
void ReferenceDeviceTextLayout::DrawText( const Point& _rStartPoint, const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength, MetricVector* _pVector, OUString* _pDisplayText ) void ReferenceDeviceTextLayout::DrawText( const Point& _rStartPoint, const OUString& _rText, sal_Int32 _nStartIndex, sal_Int32 _nLength, MetricVector* _pVector, OUString* _pDisplayText )
{ {
if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) ) if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) )
...@@ -253,7 +230,6 @@ namespace vcl ...@@ -253,7 +230,6 @@ namespace vcl
m_aCompleteTextRect.Union( Rectangle( _rStartPoint, Size( nTextWidth, m_rTargetDevice.GetTextHeight() ) ) ); m_aCompleteTextRect.Union( Rectangle( _rStartPoint, Size( nTextWidth, m_rTargetDevice.GetTextHeight() ) ) );
} }
//--------------------------------------------------------------------
bool ReferenceDeviceTextLayout::GetCaretPositions( const OUString& _rText, sal_Int32* _pCaretXArray, bool ReferenceDeviceTextLayout::GetCaretPositions( const OUString& _rText, sal_Int32* _pCaretXArray,
sal_Int32 _nStartIndex, sal_Int32 _nLength ) const sal_Int32 _nStartIndex, sal_Int32 _nLength ) const
{ {
...@@ -267,7 +243,6 @@ namespace vcl ...@@ -267,7 +243,6 @@ namespace vcl
return true; return true;
} }
//--------------------------------------------------------------------
xub_StrLen ReferenceDeviceTextLayout::GetTextBreak( const OUString& _rText, long _nMaxTextWidth, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const xub_StrLen ReferenceDeviceTextLayout::GetTextBreak( const OUString& _rText, long _nMaxTextWidth, sal_Int32 _nStartIndex, sal_Int32 _nLength ) const
{ {
if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) ) if ( !lcl_normalizeLength( _rText, _nStartIndex, _nLength ) )
...@@ -276,13 +251,11 @@ namespace vcl ...@@ -276,13 +251,11 @@ namespace vcl
return m_rReferenceDevice.GetTextBreak( _rText, _nMaxTextWidth, _nStartIndex, _nLength ); return m_rReferenceDevice.GetTextBreak( _rText, _nMaxTextWidth, _nStartIndex, _nLength );
} }
//--------------------------------------------------------------------
bool ReferenceDeviceTextLayout::DecomposeTextRectAction() const bool ReferenceDeviceTextLayout::DecomposeTextRectAction() const
{ {
return true; return true;
} }
//--------------------------------------------------------------------
Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const OUString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, OUString* _pDisplayText ) Rectangle ReferenceDeviceTextLayout::DrawText( const Rectangle& _rRect, const OUString& _rText, sal_uInt16 _nStyle, MetricVector* _pVector, OUString* _pDisplayText )
{ {
if ( _rText.isEmpty() ) if ( _rText.isEmpty() )
...@@ -292,11 +265,10 @@ namespace vcl ...@@ -292,11 +265,10 @@ namespace vcl
sal_uLong nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_BIDI_LTR; sal_uLong nTextLayoutMode = m_bRTLEnabled ? TEXT_LAYOUT_BIDI_RTL : TEXT_LAYOUT_BIDI_LTR;
m_rReferenceDevice.SetLayoutMode( nTextLayoutMode ); m_rReferenceDevice.SetLayoutMode( nTextLayoutMode );
m_rTargetDevice.SetLayoutMode( nTextLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT ); m_rTargetDevice.SetLayoutMode( nTextLayoutMode | TEXT_LAYOUT_TEXTORIGIN_LEFT );
// TEXT_LAYOUT_TEXTORIGIN_LEFT is because when we do actually draw the text (in DrawText( Point, ... )), then
// our caller gives us the left border of the draw position, regardless of script type, text layout,
// and the like
// in our ctor, we set the map mode of the target device from pixel to twip, but our caller doesn't know this, // TEXT_LAYOUT_TEXTORIGIN_LEFT is because when we do actually draw the text (in DrawText( Point, ... )), then
// our caller gives us the left border of the draw position, regardless of script type, text layout,
// and the like in our ctor, we set the map mode of the target device from pixel to twip, but our caller doesn't know this,
// but passed pixel coordinates. So, adjust the rect. // but passed pixel coordinates. So, adjust the rect.
Rectangle aRect( m_rTargetDevice.PixelToLogic( _rRect ) ); Rectangle aRect( m_rTargetDevice.PixelToLogic( _rRect ) );
...@@ -334,29 +306,21 @@ namespace vcl ...@@ -334,29 +306,21 @@ namespace vcl
return aTextRect; return aTextRect;
} }
//====================================================================
//= ControlTextRenderer
//====================================================================
//--------------------------------------------------------------------
ControlTextRenderer::ControlTextRenderer( const Control& _rControl, OutputDevice& _rTargetDevice, OutputDevice& _rReferenceDevice ) ControlTextRenderer::ControlTextRenderer( const Control& _rControl, OutputDevice& _rTargetDevice, OutputDevice& _rReferenceDevice )
:m_pImpl( new ReferenceDeviceTextLayout( _rControl, _rTargetDevice, _rReferenceDevice ) ) :m_pImpl( new ReferenceDeviceTextLayout( _rControl, _rTargetDevice, _rReferenceDevice ) )
{ {
} }
//--------------------------------------------------------------------
ControlTextRenderer::~ControlTextRenderer() ControlTextRenderer::~ControlTextRenderer()
{ {
} }
//--------------------------------------------------------------------
Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle, Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle,
MetricVector* _pVector, OUString* _pDisplayText ) MetricVector* _pVector, OUString* _pDisplayText )
{ {
return m_pImpl->DrawText( _rRect, _rText, _nStyle, _pVector, _pDisplayText ); return m_pImpl->DrawText( _rRect, _rText, _nStyle, _pVector, _pDisplayText );
} }
//........................................................................
} // namespace vcl } // namespace vcl
//........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -218,13 +218,11 @@ namespace vcl ...@@ -218,13 +218,11 @@ namespace vcl
return ::BitmapEx(); return ::BitmapEx();
// tunnel directly for known implementation // tunnel directly for known implementation
// ----------------------------------------------------------------
VclCanvasBitmap* pImplBitmap = dynamic_cast<VclCanvasBitmap*>(xInputBitmap.get()); VclCanvasBitmap* pImplBitmap = dynamic_cast<VclCanvasBitmap*>(xInputBitmap.get());
if( pImplBitmap ) if( pImplBitmap )
return pImplBitmap->getBitmapEx(); return pImplBitmap->getBitmapEx();
// retrieve data via UNO interface // retrieve data via UNO interface
// ----------------------------------------------------------------
// volatile bitmaps are a bit more complicated to read // volatile bitmaps are a bit more complicated to read
// from.. // from..
...@@ -358,7 +356,6 @@ namespace vcl ...@@ -358,7 +356,6 @@ namespace vcl
return ::BitmapEx(); return ::BitmapEx();
} }
//---------------------------------------------------------------------------------------
geometry::RealSize2D size2DFromSize( const Size& rSize ) geometry::RealSize2D size2DFromSize( const Size& rSize )
{ {
...@@ -603,7 +600,6 @@ namespace vcl ...@@ -603,7 +600,6 @@ namespace vcl
return new StandardColorSpace(); return new StandardColorSpace();
} }
//---------------------------------------------------------------------------------------
Color stdColorSpaceSequenceToColor( const uno::Sequence< double >& rColor ) Color stdColorSpaceSequenceToColor( const uno::Sequence< double >& rColor )
{ {
...@@ -648,7 +644,6 @@ namespace vcl ...@@ -648,7 +644,6 @@ namespace vcl
toByteColor(aARGBColor.Blue) ); toByteColor(aARGBColor.Blue) );
} }
//---------------------------------------------------------------------------------------
} // namespace vcltools } // namespace vcltools
......
...@@ -23,14 +23,8 @@ ...@@ -23,14 +23,8 @@
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/event.hxx> #include <vcl/event.hxx>
//........................................................................
namespace vcl namespace vcl
{ {
//........................................................................
//====================================================================
//= MnemonicEngine_Data
//====================================================================
struct MnemonicEngine_Data struct MnemonicEngine_Data
{ {
IMnemonicEntryList& rEntryList; IMnemonicEntryList& rEntryList;
...@@ -41,7 +35,6 @@ namespace vcl ...@@ -41,7 +35,6 @@ namespace vcl
} }
}; };
//--------------------------------------------------------------------
namespace namespace
{ {
const void* lcl_getEntryForMnemonic( IMnemonicEntryList& _rEntryList, sal_Unicode _cMnemonic, bool& _rbAmbiguous ) const void* lcl_getEntryForMnemonic( IMnemonicEntryList& _rEntryList, sal_Unicode _cMnemonic, bool& _rbAmbiguous )
...@@ -80,16 +73,11 @@ namespace vcl ...@@ -80,16 +73,11 @@ namespace vcl
} }
} }
//====================================================================
//= MnemonicEngine
//====================================================================
//--------------------------------------------------------------------
MnemonicEngine::MnemonicEngine( IMnemonicEntryList& _rEntryList ) MnemonicEngine::MnemonicEngine( IMnemonicEntryList& _rEntryList )
:m_pData( new MnemonicEngine_Data( _rEntryList ) ) :m_pData( new MnemonicEngine_Data( _rEntryList ) )
{ {
} }
//--------------------------------------------------------------------
bool MnemonicEngine::HandleKeyEvent( const KeyEvent& _rKEvt ) bool MnemonicEngine::HandleKeyEvent( const KeyEvent& _rKEvt )
{ {
sal_Bool bAccelKey = _rKEvt.GetKeyCode().IsMod2(); sal_Bool bAccelKey = _rKEvt.GetKeyCode().IsMod2();
...@@ -110,13 +98,10 @@ namespace vcl ...@@ -110,13 +98,10 @@ namespace vcl
return true; return true;
} }
//--------------------------------------------------------------------
MnemonicEngine::~MnemonicEngine() MnemonicEngine::~MnemonicEngine()
{ {
} }
//........................................................................
} // namespace vcl } // namespace vcl
//........................................................................
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment