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