diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-10-04 21:55:58 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-10-06 00:13:38 +0000 |
commit | 9177329a425cf70b515d1f266132838894fe54c6 (patch) | |
tree | dd064e9b56019046faa0966d0147c19a7fa2ca3e /include | |
parent | 36e1d19af8585bc2f36322ba32acbed46e58c4de (diff) |
vcl: FontCharMap to use intrusive_ptr ImplFontCharMap
ImplFontCharMap was using it's own reference counting mechanism,
however we can use intrusive_ptr more effectively.
Added a unit test around FontCharMap.
Change-Id: Ifab6ce002fd1df8feb7e017dea3012ff9ea7f18a
Reviewed-on: https://gerrit.libreoffice.org/11804
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/metric.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx index c22c553e374e..0bc977a408a9 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -24,10 +24,13 @@ #include <vcl/font.hxx> #include <vcl/outdev.hxx> +#include <boost/intrusive_ptr.hpp> + class ImplFontMetric; class ImplFontCharMap; typedef sal_uInt32 sal_UCS4; +typedef boost::intrusive_ptr< ImplFontCharMap > ImplFontCharMapPtr; namespace vcl { @@ -94,7 +97,7 @@ inline std::basic_ostream<charT, traits> & operator <<( class VCL_DLLPUBLIC FontCharMap { private: - const ImplFontCharMap* mpImpl; + ImplFontCharMapPtr mpImplFontCharMap; public: FontCharMap(); @@ -106,6 +109,7 @@ public: int GetCharCount( void ) const; sal_UCS4 GetFirstChar() const; + sal_UCS4 GetLastChar() const; sal_UCS4 GetNextChar( sal_UCS4 ) const; sal_UCS4 GetPrevChar( sal_UCS4 ) const; @@ -116,7 +120,7 @@ public: private: friend class ::OutputDevice; - void Reset( const ImplFontCharMap* pNewMap = NULL ); + void Reset( const ImplFontCharMapPtr pNewMap = NULL ); // prevent assignment and copy construction FontCharMap( const FontCharMap& ); |