summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-23 17:13:46 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-23 17:13:46 +0100
commitba6f8af8a73c21b94c99e33c933bb8e689384d6f (patch)
treefe0c13c24684fe7801bed94b6323138cd1580e93 /vcl
parent932fb7b958f8e7204275cb709965b30e390c76ad (diff)
parentf8de01dde2707bcfd4bccf3cb0dc5b26bde851e9 (diff)
Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/libs-gui
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/glyphcache.hxx8
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx6
-rw-r--r--vcl/source/glyphs/gcach_ftyp.hxx6
-rw-r--r--vcl/source/glyphs/glyphcache.cxx2
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx8
5 files changed, 15 insertions, 15 deletions
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx
index b346f55273ef..dc11ba1637d8 100644
--- a/vcl/inc/vcl/glyphcache.hxx
+++ b/vcl/inc/vcl/glyphcache.hxx
@@ -45,6 +45,7 @@ class ImplFontOptions;
#include <tools/gen.hxx>
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
+#include <boost/shared_ptr.hpp>
namespace basegfx { class B2DPolyPolygon; }
@@ -186,8 +187,9 @@ public:
virtual bool TestFont() const { return true; }
virtual void* GetFtFace() const { return 0; }
virtual int GetLoadFlags() const { return 0; }
- virtual void SetFontOptions( const ImplFontOptions*) {}
- virtual const ImplFontOptions* GetFontOptions() const { return 0; }
+ virtual void SetFontOptions( boost::shared_ptr<ImplFontOptions> ) {}
+ virtual boost::shared_ptr<ImplFontOptions> GetFontOptions() const
+ { return boost::shared_ptr<ImplFontOptions>(); }
virtual bool NeedsArtificialBold() const { return false; }
virtual bool NeedsArtificialItalic() const { return false; }
@@ -266,7 +268,7 @@ class VCL_PLUGIN_PUBLIC ImplServerFontEntry : public ImplFontEntry
{
private:
ServerFont* mpServerFont;
- ImplFontOptions* mpFontOptions;
+ boost::shared_ptr<ImplFontOptions> mpFontOptions;
bool mbGotFontOptions;
public:
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 52c80febe64b..82fa925097ee 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -572,6 +572,7 @@ FreetypeManager::FreetypeManager()
nDefaultPrioAutoHint = pEnv[0] - '0';
InitGammaTable();
+ vclFontFileList::get();
}
// -----------------------------------------------------------------------
@@ -769,7 +770,6 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
mpFontInfo( pFI ),
maFaceFT( NULL ),
maSizeFT( NULL ),
- mpFontOptions( NULL ),
mbFaceOk( false ),
maRecodeConverter( NULL ),
mpLayoutEngine( NULL )
@@ -915,7 +915,7 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
mnLoadFlags |= FT_LOAD_NO_BITMAP;
}
-void FreetypeServerFont::SetFontOptions( const ImplFontOptions* pFontOptions)
+void FreetypeServerFont::SetFontOptions( boost::shared_ptr<ImplFontOptions> pFontOptions)
{
mpFontOptions = pFontOptions;
@@ -970,7 +970,7 @@ void FreetypeServerFont::SetFontOptions( const ImplFontOptions* pFontOptions)
mnLoadFlags |= FT_LOAD_NO_BITMAP;
}
-const ImplFontOptions* FreetypeServerFont::GetFontOptions() const
+boost::shared_ptr<ImplFontOptions> FreetypeServerFont::GetFontOptions() const
{
return mpFontOptions;
}
diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx
index caf8bfab1f9c..6b461fe59143 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -191,8 +191,8 @@ public:
virtual int GetFontFaceNum() const { return mpFontInfo->GetFaceNum(); }
virtual bool TestFont() const;
virtual void* GetFtFace() const;
- virtual void SetFontOptions( const ImplFontOptions*);
- virtual const ImplFontOptions* GetFontOptions() const;
+ virtual void SetFontOptions( boost::shared_ptr<ImplFontOptions> );
+ virtual boost::shared_ptr<ImplFontOptions> GetFontOptions() const;
virtual int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
virtual bool NeedsArtificialBold() const { return mbArtBold; }
virtual bool NeedsArtificialItalic() const { return mbArtItalic; }
@@ -239,7 +239,7 @@ private:
FT_FaceRec_* maFaceFT;
FT_SizeRec_* maSizeFT;
- const ImplFontOptions* mpFontOptions;
+ boost::shared_ptr<ImplFontOptions> mpFontOptions;
bool mbFaceOk;
bool mbArtItalic;
diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx
index deef658c0c56..ab56853dcf65 100644
--- a/vcl/source/glyphs/glyphcache.cxx
+++ b/vcl/source/glyphs/glyphcache.cxx
@@ -534,7 +534,6 @@ bool ServerFont::IsGlyphInvisible( int nGlyphIndex )
ImplServerFontEntry::ImplServerFontEntry( ImplFontSelectData& rFSD )
: ImplFontEntry( rFSD )
, mpServerFont( NULL )
-, mpFontOptions( NULL )
, mbGotFontOptions( false )
{}
@@ -543,7 +542,6 @@ ImplServerFontEntry::ImplServerFontEntry( ImplFontSelectData& rFSD )
ImplServerFontEntry::~ImplServerFontEntry()
{
// TODO: remove the ServerFont here instead of in the GlyphCache
- delete mpFontOptions;
}
// =======================================================================
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 6ce4656dc815..8f3c89a78c24 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -236,8 +236,8 @@ void ImplServerFontEntry::HandleFontOptions( void )
{
// get and cache the font options
mbGotFontOptions = true;
- mpFontOptions = GetFCFontOptions( *maFontSelData.mpFontData,
- maFontSelData.mnHeight );
+ mpFontOptions.reset(GetFCFontOptions( *maFontSelData.mpFontData,
+ maFontSelData.mnHeight ));
}
// apply the font options
mpServerFont->SetFontOptions( mpFontOptions );
@@ -536,12 +536,12 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
void* pFace = rFont.GetFtFace();
CairoFontsCache::CacheId aId;
aId.mpFace = pFace;
- aId.mpOptions = rFont.GetFontOptions();
+ aId.mpOptions = rFont.GetFontOptions().get();
aId.mbEmbolden = rFont.NeedsArtificialBold();
font_face = (cairo_font_face_t*)m_aCairoFontsCache.FindCachedFont(aId);
if (!font_face)
{
- const ImplFontOptions *pOptions = rFont.GetFontOptions();
+ const ImplFontOptions *pOptions = rFont.GetFontOptions().get();
void *pPattern = pOptions ? pOptions->GetPattern(pFace, aId.mbEmbolden) : NULL;
if (pPattern)
font_face = rCairo.ft_font_face_create_for_pattern(pPattern);