diff options
45 files changed, 145 insertions, 234 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 468cb9ffffbf..8671417131c0 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -94,6 +94,8 @@ using namespace com::sun::star::uno; #include <direct.h> #include <io.h> #include <postwin.h> +#else +#include <unistd.h> #endif #if HAVE_FEATURE_SCRIPTING diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 3c772f2e7aad..7d59ee9f4570 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -445,7 +445,7 @@ IMPL_LINK_NOARG_TYPED(SvxCharacterMap, FontSelectHdl, ListBox&, void) bool bNeedSubset = (aFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL); if( bNeedSubset ) { - FontCharMapPtr xFontCharMap( new FontCharMap() ); + FontCharMapRef xFontCharMap( new FontCharMap() ); m_pShowSet->GetFontCharMap( xFontCharMap ); pSubsetMap = new SubsetMap( xFontCharMap ); @@ -586,7 +586,7 @@ void SvxCharacterMap::selectCharByCode(Radix radix) // Convert the code back to a character using the appropriate radix sal_UCS4 cChar = aCodeString.toUInt32(static_cast<sal_Int16> (radix)); // Use FontCharMap::HasChar(sal_UCS4 cChar) to see if the desired character is in the font - FontCharMapPtr xFontCharMap(new FontCharMap()); + FontCharMapRef xFontCharMap(new FontCharMap()); m_pShowSet->GetFontCharMap(xFontCharMap); if (xFontCharMap->HasChar(cChar)) // Select the corresponding character diff --git a/filter/source/svg/svgfontexport.hxx b/filter/source/svg/svgfontexport.hxx index 576e813696e2..589262c01835 100644 --- a/filter/source/svg/svgfontexport.hxx +++ b/filter/source/svg/svgfontexport.hxx @@ -36,6 +36,9 @@ class SVGExport; namespace vcl { class Font; } class OutputDevice; +#ifdef _MSC_VER +#pragma warning (disable : 4503) // FontNameMap gives decorated name length exceeded +#endif class SVGFontExport { diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx index fbdf77c24041..d748f37fe14c 100644 --- a/include/svx/charmap.hxx +++ b/include/svx/charmap.hxx @@ -107,7 +107,7 @@ private: sal_Int32 nSelectedIndex; - FontCharMapPtr mxFontCharMap; + FontCharMapRef mxFontCharMap; Size maFontSize; VclPtr<ScrollBar> aVscrollSB; diff --git a/include/svx/ucsubset.hxx b/include/svx/ucsubset.hxx index a640805ab367..61837fcb3589 100644 --- a/include/svx/ucsubset.hxx +++ b/include/svx/ucsubset.hxx @@ -59,7 +59,7 @@ typedef ::std::list<Subset> SubsetList; class SVX_DLLPUBLIC SubsetMap : private Resource { public: - SubsetMap( const FontCharMapPtr& ); + SubsetMap( const FontCharMapRef& ); const Subset* GetSubsetByUnicode( sal_UCS4 ) const; const Subset* GetNextSubset( bool bFirst ) const; @@ -69,7 +69,7 @@ private: mutable SubsetList::const_iterator maSubsetIterator; SVX_DLLPRIVATE void InitList(); - SVX_DLLPRIVATE void ApplyCharMap( const FontCharMapPtr& ); + SVX_DLLPRIVATE void ApplyCharMap( const FontCharMapRef& ); }; #endif diff --git a/include/vcl/doxygen_dummy.hxx b/include/vcl/doxygen_dummy.hxx deleted file mode 100644 index b10c81fdf0b2..000000000000 --- a/include/vcl/doxygen_dummy.hxx +++ /dev/null @@ -1,8 +0,0 @@ -// Do NOT include this file anywhere! This is merely used to make Doxygen see -// boost intrusive_ptr's - otherwise it doesn't build the collaboration diagram -// correctly -#ifdef DOXYGENONLY - -namespace boost { template<class T> class intrusive_ptr { T *ptr; }; } - -#endif diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx index a690973d8c31..e27f17e232be 100644 --- a/include/vcl/fontcharmap.hxx +++ b/include/vcl/fontcharmap.hxx @@ -24,30 +24,28 @@ #include <vcl/font.hxx> #include <vcl/outdev.hxx> -#include <boost/intrusive_ptr.hpp> - class ImplFontCharMap; class CmapResult; typedef sal_uInt32 sal_UCS4; -typedef boost::intrusive_ptr< ImplFontCharMap > ImplFontCharMapPtr; -typedef boost::intrusive_ptr< FontCharMap > FontCharMapPtr; +typedef tools::SvRef<ImplFontCharMap> ImplFontCharMapRef; +typedef tools::SvRef<FontCharMap> FontCharMapRef; -class VCL_DLLPUBLIC FontCharMap +class VCL_DLLPUBLIC FontCharMap : public SvRefBase { public: /** A new FontCharMap is created based on a "default" map, which includes all codepoints in the Unicode BMP range, including surrogates. **/ - FontCharMap(); - FontCharMap( const CmapResult& rCR ); - ~FontCharMap(); + FontCharMap(); + FontCharMap( const CmapResult& rCR ); + virtual ~FontCharMap(); /** Get the default font character map @returns the default font character map. */ - static FontCharMapPtr GetDefaultMap( bool bSymbols ); + static FontCharMapRef GetDefaultMap( bool bSymbols ); /** Determines if the font character map is the "default". The default map includes all codepoints in the Unicode BMP range, including surrogates. @@ -136,35 +134,19 @@ public: int GetGlyphIndex( sal_UCS4 ) const; private: - ImplFontCharMapPtr mpImplFontCharMap; + ImplFontCharMapRef mpImplFontCharMap; friend class ::OutputDevice; - friend void intrusive_ptr_release(FontCharMap* pFontCharMap); - friend void intrusive_ptr_add_ref(FontCharMap* pFontCharMap); int findRangeIndex( sal_uInt32 ) const; - FontCharMap( ImplFontCharMapPtr const & pIFCMap ); - - sal_uInt32 mnRefCount; + FontCharMap( ImplFontCharMapRef const & pIFCMap ); // prevent assignment and copy construction FontCharMap( const FontCharMap& ) = delete; void operator=( const FontCharMap& ) = delete; }; -inline void intrusive_ptr_add_ref(FontCharMap* pFontCharMap) -{ - ++pFontCharMap->mnRefCount; -} - -inline void intrusive_ptr_release(FontCharMap* pFontCharMap) -{ - if (--pFontCharMap->mnRefCount == 0) - delete pFontCharMap; -} - - // CmapResult is a normalized version of the many CMAP formats class VCL_PLUGIN_PUBLIC CmapResult { diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx index 5e079d106959..d4eb7ec6c0aa 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -24,15 +24,12 @@ #include <vcl/font.hxx> #include <vcl/outdev.hxx> -#include <boost/intrusive_ptr.hpp> - class ImplFontMetric; class ImplFontCharMap; class CmapResult; typedef sal_uInt32 sal_UCS4; -typedef boost::intrusive_ptr< ImplFontCharMap > ImplFontCharMapPtr; -typedef boost::intrusive_ptr< FontCharMap > FontCharMapPtr; +typedef tools::SvRef<FontCharMap> FontCharMapRef; class VCL_DLLPUBLIC FontMetric : public vcl::Font { @@ -72,7 +69,7 @@ public: bool operator!=( const FontMetric& rMetric ) const { return !operator==( rMetric ); } protected: - boost::intrusive_ptr<ImplFontMetric> mpImplMetric; // Implementation + tools::SvRef<ImplFontMetric> mxImplMetric; // Implementation }; template< typename charT, typename traits > diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index bdc832d58ff2..9f63f136cbf1 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -48,12 +48,6 @@ #include <unotools/fontdefs.hxx> -#ifdef check -# //some problem with MacOSX and a check define -# undef check -#endif -#include <boost/intrusive_ptr.hpp> - #include <com/sun/star/drawing/LineCap.hpp> #include <com/sun/star/uno/Reference.h> @@ -308,7 +302,7 @@ enum OutDevViewType { OUTDEV_VIEWTYPE_DONTKNOW, OUTDEV_VIEWTYPE_PRINTPREVIEW, OU // OutputDevice -typedef boost::intrusive_ptr< FontCharMap > FontCharMapPtr; +typedef tools::SvRef<FontCharMap> FontCharMapRef; BmpMirrorFlags AdjustTwoRect( SalTwoRect& rTwoRect, const Size& rSizePix ); void AdjustTwoRect( SalTwoRect& rTwoRect, const Rectangle& rValidSrcRect ); @@ -1229,7 +1223,7 @@ public: FontMetric GetFontMetric() const; FontMetric GetFontMetric( const vcl::Font& rFont ) const; - bool GetFontCharMap( FontCharMapPtr& rxFontCharMap ) const; + bool GetFontCharMap( FontCharMapRef& rxFontCharMap ) const; bool GetFontCapabilities( vcl::FontCapabilities& rFontCapabilities ) const; /** Retrieve detailed font information in platform independent structure diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index e25745873439..c0a4bb5cc9c8 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -462,7 +462,7 @@ void XclImpFont::GuessScriptType() if( OutputDevice* pPrinter = GetPrinter() ) { vcl::Font aFont( maData.maName, Size( 0, 10 ) ); - FontCharMapPtr xFontCharMap; + FontCharMapRef xFontCharMap; pPrinter->SetFont( aFont ); if( pPrinter->GetFontCharMap( xFontCharMap ) ) diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index c1540c91bb5d..4b999962aff7 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -2293,7 +2293,7 @@ void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyl pSymbolDisplay->SetFont(aFontMetric); // update subset listbox for new font's unicode subsets - FontCharMapPtr xFontCharMap; + FontCharMapRef xFontCharMap; pCharsetDisplay->GetFontCharMap( xFontCharMap ); pSubsetMap.reset(new SubsetMap( xFontCharMap )); diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx index 2cbb18345073..75014b031cfb 100644 --- a/svtools/source/misc/sampletext.cxx +++ b/svtools/source/misc/sampletext.cxx @@ -165,7 +165,7 @@ OUString makeShortRepresentativeSymbolTextForSelectedFont(OutputDevice &rDevice) if (!bOpenSymbol) { - FontCharMapPtr xFontCharMap; + FontCharMapRef xFontCharMap; bool bHasCharMap = rDevice.GetFontCharMap(xFontCharMap); if( bHasCharMap ) { diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index f214b0ddc070..710a77ad728b 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -755,7 +755,7 @@ FactoryFunction SvxShowCharSet::GetUITestFactory() const // TODO: should be moved into Font Attributes stuff // we let it mature here though because it is currently the only use -SubsetMap::SubsetMap( const FontCharMapPtr& rxFontCharMap ) +SubsetMap::SubsetMap( const FontCharMapRef& rxFontCharMap ) : Resource( SVX_RES(RID_SUBSETMAP) ) { InitList(); @@ -1619,7 +1619,7 @@ void SubsetMap::InitList() maSubsets = aAllSubsets; } -void SubsetMap::ApplyCharMap( const FontCharMapPtr& rxFontCharMap ) +void SubsetMap::ApplyCharMap( const FontCharMapRef& rxFontCharMap ) { if( !rxFontCharMap ) return; diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index ac7d3dcb2f45..5202109bad3e 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -29,12 +29,12 @@ void SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel ) m_aTextRenderImpl.SetFont(pIFSD, nFallbackLevel); } -void SvpSalGraphics::GetFontMetric( ImplFontMetricDataPtr& xFontMetric, int nFallbackLevel ) +void SvpSalGraphics::GetFontMetric( ImplFontMetricDataRef& xFontMetric, int nFallbackLevel ) { m_aTextRenderImpl.GetFontMetric(xFontMetric, nFallbackLevel); } -const FontCharMapPtr SvpSalGraphics::GetFontCharMap() const +const FontCharMapRef SvpSalGraphics::GetFontCharMap() const { return m_aTextRenderImpl.GetFontCharMap(); } diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx index 7bc5a7345cc5..0158e972a990 100644 --- a/vcl/inc/fontinstance.hxx +++ b/vcl/inc/fontinstance.hxx @@ -39,7 +39,7 @@ public: public: // TODO: make data members private ImplFontCache * mpFontCache; FontSelectPattern maFontSelData; // FontSelectionData - ImplFontMetricDataPtr mxFontMetric; // Font attributes + ImplFontMetricDataRef mxFontMetric; // Font attributes const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol long mnLineHeight; diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 76e446064b18..a22b84fca9ed 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -137,8 +137,8 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override; - virtual const FontCharMapPtr GetFontCharMap() const override; + virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; + virtual const FontCharMapRef GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; virtual void ClearDevFontCache() override; diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index 0f5d3f3c16c6..7584dda707b1 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -26,8 +26,6 @@ #include "fontinstance.hxx" -#include <boost/intrusive_ptr.hpp> - /* The following class is extraordinarily similar to FontAttributes. */ class ImplFont diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index 82f65a86360f..dd01e95491d7 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -20,14 +20,12 @@ #ifndef INCLUDED_VCL_INC_IMPFONTCHARMAP_HXX #define INCLUDED_VCL_INC_IMPFONTCHARMAP_HXX -#include <boost/intrusive_ptr.hpp> - class ImplFontCharMap; -typedef boost::intrusive_ptr< ImplFontCharMap > ImplFontCharMapPtr; +typedef tools::SvRef<ImplFontCharMap> ImplFontCharMapRef; class CmapResult; -class VCL_PLUGIN_PUBLIC ImplFontCharMap +class VCL_PLUGIN_PUBLIC ImplFontCharMap : public SvRefBase { public: explicit ImplFontCharMap( const CmapResult& ); @@ -35,13 +33,11 @@ public: private: friend class FontCharMap; - friend void intrusive_ptr_add_ref(ImplFontCharMap* pImplFontCharMap); - friend void intrusive_ptr_release(ImplFontCharMap* pImplFontCharMap); ImplFontCharMap( const ImplFontCharMap& ) = delete; void operator=( const ImplFontCharMap& ) = delete; - static ImplFontCharMapPtr const & getDefaultMap( bool bSymbols=false); + static ImplFontCharMapRef const & getDefaultMap( bool bSymbols=false); bool isDefaultMap() const; private: @@ -50,20 +46,8 @@ private: const sal_uInt16* mpGlyphIds; // individual glyphid mappings int mnRangeCount; int mnCharCount; // covered codepoints - mutable sal_uInt32 mnRefCount; }; -inline void intrusive_ptr_add_ref(ImplFontCharMap* pImplFontCharMap) -{ - ++pImplFontCharMap->mnRefCount; -} - -inline void intrusive_ptr_release(ImplFontCharMap* pImplFontCharMap) -{ - if (--pImplFontCharMap->mnRefCount == 0) - delete pImplFontCharMap; -} - bool ParseCMAP( const unsigned char* pRawData, int nRawLength, CmapResult& ); #endif // INCLUDED_VCL_INC_IMPFONTCHARMAP_HXX diff --git a/vcl/inc/impfontmetric.hxx b/vcl/inc/impfontmetric.hxx index 5c0c8235a7a3..c0d7c60a4d5b 100644 --- a/vcl/inc/impfontmetric.hxx +++ b/vcl/inc/impfontmetric.hxx @@ -20,12 +20,10 @@ #ifndef INCLUDED_VCL_INC_IMPFONTMETRIC_HXX #define INCLUDED_VCL_INC_IMPFONTMETRIC_HXX -#include <boost/intrusive_ptr.hpp> - class ImplFontCharMap; -typedef boost::intrusive_ptr< ImplFontCharMap > ImplFontCharMapPtr; +typedef tools::SvRef<ImplFontCharMap> ImplFontCharMapRef; -class ImplFontMetric +class ImplFontMetric : public SvRefBase { public: explicit ImplFontMetric(); @@ -58,8 +56,6 @@ public: private: friend class FontMetric; - friend void intrusive_ptr_add_ref(ImplFontMetric* pImplFontMetric); - friend void intrusive_ptr_release(ImplFontMetric* pImplFontMetric); long mnAscent; // Ascent long mnDescent; // Descent @@ -68,7 +64,6 @@ private: long mnLineHeight; // Ascent+Descent+EmphasisMark long mnSlant; // Slant long mnBulletOffset; // Offset for non-printing character - sal_uInt32 mnRefCount; // Reference Counter bool mbScalableFont; bool mbFullstopCentered; @@ -76,17 +71,6 @@ private: }; -inline void intrusive_ptr_add_ref(ImplFontMetric* pImplFontMetric) -{ - ++pImplFontMetric->mnRefCount; -} - -inline void intrusive_ptr_release(ImplFontMetric* pImplFontMetric) -{ - if (--pImplFontMetric->mnRefCount == 0) - delete pImplFontMetric; -} - #endif // INCLUDED_VCL_INC_IMPFONTMETRIC_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx index 7a59fd774771..7251778c8a5c 100644 --- a/vcl/inc/impfontmetricdata.hxx +++ b/vcl/inc/impfontmetricdata.hxx @@ -21,18 +21,16 @@ #define INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX #include <vcl/dllapi.h> - +#include <tools/ref.hxx> #include "fontattributes.hxx" -#include <boost/intrusive_ptr.hpp> - class ImplFontMetricData; -typedef boost::intrusive_ptr< ImplFontMetricData > ImplFontMetricDataPtr; +typedef tools::SvRef<ImplFontMetricData> ImplFontMetricDataRef; class OutputDevice; class FontSelectPattern; -class ImplFontMetricData : public FontAttributes +class ImplFontMetricData : public FontAttributes, public SvRefBase { public: explicit ImplFontMetricData( const FontSelectPattern& ); @@ -102,11 +100,6 @@ public: void ImplInitAboveTextLineSize(); private: - friend void intrusive_ptr_add_ref(ImplFontMetricData* pImplFontMetricData); - friend void intrusive_ptr_release(ImplFontMetricData* pImplFontMetricData); - - long mnRefCount; - // font instance attributes from the font request long mnWidth; // Reference Width short mnOrientation; // Rotation in 1/10 degrees @@ -155,17 +148,6 @@ private: }; -inline void intrusive_ptr_add_ref(ImplFontMetricData* pImplFontMetricData) -{ - ++pImplFontMetricData->mnRefCount; -} - -inline void intrusive_ptr_release(ImplFontMetricData* pImplFontMetricData) -{ - if (--pImplFontMetricData->mnRefCount == 0) - delete pImplFontMetricData; -} - #endif // INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index 06dc155709ee..e283e036bc45 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -53,7 +53,6 @@ #include <vector> #include <window.h> #include <boost/functional/hash.hpp> -#include <boost/intrusive_ptr.hpp> #include <boost/math/special_functions/sinc.hpp> #include <boost/multi_array.hpp> #include <boost/optional.hpp> diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 3cf501d2d4d5..738bed345680 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -66,7 +66,7 @@ public: int GetFontTable( const char pTagName[5], unsigned char* ) const; - const FontCharMapPtr GetFontCharMap() const; + const FontCharMapRef GetFontCharMap() const; bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; bool HasChar( sal_uInt32 cChar ) const; @@ -78,7 +78,7 @@ protected: private: const sal_IntPtr mnFontId; - mutable FontCharMapPtr mxCharMap; + mutable FontCharMapRef mxCharMap; mutable vcl::FontCapabilities maFontCapabilities; mutable bool mbOs2Read; // true if OS2-table related info is valid mutable bool mbHasOs2Table; @@ -94,7 +94,7 @@ public: SalLayout* GetTextLayout( void ) const; - void GetFontMetric( ImplFontMetricDataPtr& ) const; + void GetFontMetric( ImplFontMetricDataRef& ) const; bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const; bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const; @@ -337,9 +337,9 @@ public: // set the font virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override; // get the current font's metrics - virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override; + virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; // get the repertoire of the current font - virtual const FontCharMapPtr GetFontCharMap() const override; + virtual const FontCharMapRef GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; // graphics must fill supplied font list virtual void GetDevFontList( PhysicalFontCollection* ) override; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index c8f9a1cc5a1e..1760760ad04d 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -131,10 +131,10 @@ public: void ReleaseFonts() { SetFont( nullptr, 0 ); } // get the current font's metrics - virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) = 0; + virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) = 0; // get the repertoire of the current font - virtual const FontCharMapPtr GetFontCharMap() const = 0; + virtual const FontCharMapRef GetFontCharMap() const = 0; // get the layout capabilities of the current font virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0; diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 29559aa00b4b..70fc9d2d688c 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -37,8 +37,8 @@ public: virtual void SetTextColor( SalColor nSalColor ) = 0; virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) = 0; - virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) = 0; - virtual const FontCharMapPtr GetFontCharMap() const = 0; + virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) = 0; + virtual const FontCharMapRef GetFontCharMap() const = 0; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0; virtual void GetDevFontList( PhysicalFontCollection* ) = 0; virtual void ClearDevFontCache() = 0; diff --git a/vcl/inc/unx/cairotextrender.hxx b/vcl/inc/unx/cairotextrender.hxx index 8c678135535e..5cb39d3994a6 100644 --- a/vcl/inc/unx/cairotextrender.hxx +++ b/vcl/inc/unx/cairotextrender.hxx @@ -54,8 +54,8 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override; - virtual const FontCharMapPtr GetFontCharMap() const override; + virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; + virtual const FontCharMapRef GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; virtual void ClearDevFontCache() override; diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx index 0a8cfbe14f31..26ed1798fcb7 100644 --- a/vcl/inc/unx/freetype_glyphcache.hxx +++ b/vcl/inc/unx/freetype_glyphcache.hxx @@ -82,7 +82,7 @@ public: void CacheGlyphIndex( sal_UCS4 cChar, int nGI ) const; bool GetFontCodeRanges( CmapResult& ) const; - const FontCharMapPtr& GetFontCharMap(); + const FontCharMapRef& GetFontCharMap(); private: FT_FaceRec_* maFaceFT; @@ -96,7 +96,7 @@ private: sal_IntPtr mnFontId; FontAttributes maDevFontAttributes; - FontCharMapPtr mxFontCharMap; + FontCharMapRef mxFontCharMap; // cache unicode->glyphid mapping because looking it up is expensive // TODO: change to std::unordered_multimap when a use case requires a m:n mapping diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h index f38dc0e5b9f7..6451a7362900 100644 --- a/vcl/inc/unx/genpspgraphics.h +++ b/vcl/inc/unx/genpspgraphics.h @@ -93,8 +93,8 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override; - virtual const FontCharMapPtr GetFontCharMap() const override; + virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; + virtual const FontCharMapRef GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; // graphics must drop any cached font info diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx index 04723cbd75ed..f3754a3067d5 100644 --- a/vcl/inc/unx/glyphcache.hxx +++ b/vcl/inc/unx/glyphcache.hxx @@ -161,11 +161,11 @@ public: const FontSelectPattern& GetFontSelData() const { return maFontSelData; } - void GetFontMetric( ImplFontMetricDataPtr&, long& rFactor ) const; + void GetFontMetric( ImplFontMetricDataRef&, long& rFactor ) const; const unsigned char* GetTable( const char* pName, sal_uLong* pLength ); int GetEmUnits() const { return maFaceFT->units_per_EM;} double GetStretch() { return mfStretch; } - const FontCharMapPtr GetFontCharMap() const; + const FontCharMapRef GetFontCharMap() const; bool GetFontCapabilities(vcl::FontCapabilities &) const; GlyphData& GetGlyphData( sal_GlyphId ); diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index a9c91ed0e114..73f22b7e7816 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -117,8 +117,8 @@ public: virtual void SetTextColor( SalColor nSalColor ) override; virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override; - virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override; - virtual const FontCharMapPtr GetFontCharMap() const override; + virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; + virtual const FontCharMapRef GetFontCharMap() const override; virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override; virtual void GetDevFontList( PhysicalFontCollection* ) override; virtual void ClearDevFontCache() override; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index d87cbbd2d635..931c25b9ca55 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -102,7 +102,7 @@ public: const gr_face* GraphiteFace() const; #endif - FontCharMapPtr GetFontCharMap() const; + FontCharMapRef GetFontCharMap() const; bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; const Ucs2SIntMap* GetEncodingVector() const { return mpEncodingVector; } void SetEncodingVector( const Ucs2SIntMap* pNewVec ) const @@ -122,7 +122,7 @@ private: #endif mutable bool mbHasArabicSupport; mutable bool mbFontCapabilitiesRead; - mutable FontCharMapPtr mxUnicodeMap; + mutable FontCharMapRef mxUnicodeMap; mutable const Ucs2SIntMap* mpEncodingVector; mutable vcl::FontCapabilities maFontCapabilities; @@ -384,9 +384,9 @@ public: // set the font virtual void SetFont( FontSelectPattern*, int nFallbackLevel ) override; // get the current font's metrics - virtual void GetFontMetric( ImplFontMetricDataPtr&, int nFallbackLevel ) override; + virtual void GetFontMetric( ImplFontMetricDataRef&, int nFallbackLevel ) override; // get the repertoire of the current font - virtual const FontCharMapPtr GetFontCharMap() const override; + virtual const FontCharMapRef GetFontCharMap() const override; // get the layout capabilities of the current font virtual bool GetFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const override; // graphics must fill supplied font list diff --git a/vcl/qa/cppunit/fontcharmap.cxx b/vcl/qa/cppunit/fontcharmap.cxx index 157b56a21ff4..fce8bc47b41b 100644 --- a/vcl/qa/cppunit/fontcharmap.cxx +++ b/vcl/qa/cppunit/fontcharmap.cxx @@ -28,7 +28,7 @@ public: void VclFontCharMapTest::testDefaultFontCharMap() { - FontCharMapPtr xfcmap( new FontCharMap() ); // gets default map + FontCharMapRef xfcmap( new FontCharMap() ); // gets default map CPPUNIT_ASSERT( xfcmap->IsDefaultMap() ); diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 5bd6e7ba2a18..bd2ab4f87482 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -117,7 +117,7 @@ CoreTextStyle::~CoreTextStyle() CFRelease( mpStyleDict ); } -void CoreTextStyle::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric ) const +void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef& rxFontMetric ) const { // get the matching CoreText font handle // TODO: is it worth it to cache the CTFontRef in SetFont() and reuse it here? diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index c28290a99828..0d39e962e70e 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -90,14 +90,14 @@ sal_IntPtr CoreTextFontFace::GetFontId() const static unsigned GetUShort( const unsigned char* p ){return((p[0]<<8)+p[1]);} -const FontCharMapPtr CoreTextFontFace::GetFontCharMap() const +const FontCharMapRef CoreTextFontFace::GetFontCharMap() const { // return the cached charmap if( mxCharMap ) return mxCharMap; // set the default charmap - FontCharMapPtr pCharMap( new FontCharMap() ); + FontCharMapRef pCharMap( new FontCharMap() ); mxCharMap = pCharMap; // get the CMAP byte size @@ -120,7 +120,7 @@ const FontCharMapPtr CoreTextFontFace::GetFontCharMap() const CmapResult aCmapResult; if( ParseCMAP( &aBuffer[0], nRawLength, aCmapResult ) ) { - FontCharMapPtr xDefFontCharMap( new FontCharMap(aCmapResult) ); + FontCharMapRef xDefFontCharMap( new FontCharMap(aCmapResult) ); // create the matching charmap mxCharMap = xDefFontCharMap; } @@ -307,7 +307,7 @@ void AquaSalGraphics::SetTextColor( SalColor nSalColor ) // SAL_ DEBUG(std::hex << nSalColor << std::dec << "={" << maTextColor.GetRed() << ", " << maTextColor.GetGreen() << ", " << maTextColor.GetBlue() << ", " << maTextColor.GetAlpha() << "}"); } -void AquaSalGraphics::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric, int /*nFallbackLevel*/ ) +void AquaSalGraphics::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int /*nFallbackLevel*/ ) { mpTextStyle->GetFontMetric( rxFontMetric ); } @@ -454,11 +454,11 @@ SalLayout* AquaSalGraphics::GetTextLayout( ImplLayoutArgs& /*rArgs*/, int /*nFal return pSalLayout; } -const FontCharMapPtr AquaSalGraphics::GetFontCharMap() const +const FontCharMapRef AquaSalGraphics::GetFontCharMap() const { if( !mpFontData ) { - FontCharMapPtr xFontCharMap( new FontCharMap() ); + FontCharMapRef xFontCharMap( new FontCharMap() ); return xFontCharMap; } @@ -740,7 +740,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV free( const_cast<TTSimpleGlyphMetrics *>(pGlyphMetrics) ); } - FontCharMapPtr xFCMap = mpFontData->GetFontCharMap(); + FontCharMapRef xFCMap = mpFontData->GetFontCharMap(); SAL_WARN_IF( !xFCMap || !xFCMap->GetCharCount(), "vcl", "no charmap" ); // get unicode<->glyph encoding diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index f89b1f5e3673..68e7c9f1ca74 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -954,7 +954,7 @@ void WMFWriter::SetAllAttr() pVirDev->SetFont(aSrcFont); if ( aDstFont.GetFamilyName() != aSrcFont.GetFamilyName() ) { - FontCharMapPtr xFontCharMap; + FontCharMapRef xFontCharMap; if ( pVirDev->GetFontCharMap( xFontCharMap ) ) { if ( ( xFontCharMap->GetFirstChar() & 0xff00 ) == 0xf000 ) diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 6f3130dd2841..c1055928641f 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -33,7 +33,7 @@ CmapResult::CmapResult( bool bSymbolic, , mbRecoded( false) {} -static ImplFontCharMapPtr pDefaultImplFontCharMap; +static ImplFontCharMapRef xDefaultImplFontCharMap; static const sal_UCS4 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0}; static const sal_UCS4 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100}; @@ -52,7 +52,6 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR ) , mpGlyphIds( rCR.mpGlyphIds ) , mnRangeCount( rCR.mnRangeCount ) , mnCharCount( 0 ) -, mnRefCount( 0 ) { const sal_UCS4* pRangePtr = mpRangeCodes; for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 ) @@ -63,7 +62,7 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR ) } } -ImplFontCharMapPtr const & ImplFontCharMap::getDefaultMap( bool bSymbols ) +ImplFontCharMapRef const & ImplFontCharMap::getDefaultMap( bool bSymbols ) { const sal_UCS4* pRangeCodes = aDefaultUnicodeRanges; int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes); @@ -74,9 +73,9 @@ ImplFontCharMapPtr const & ImplFontCharMap::getDefaultMap( bool bSymbols ) } CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 ); - pDefaultImplFontCharMap.reset( new ImplFontCharMap( aDefaultCR ) ); + xDefaultImplFontCharMap = ImplFontCharMapRef(new ImplFontCharMap(aDefaultCR)); - return pDefaultImplFontCharMap; + return xDefaultImplFontCharMap; } bool ImplFontCharMap::isDefaultMap() const @@ -385,19 +384,17 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) FontCharMap::FontCharMap() : mpImplFontCharMap( ImplFontCharMap::getDefaultMap() ) - , mnRefCount(0) -{} +{ +} -FontCharMap::FontCharMap( ImplFontCharMapPtr const & pIFCMap ) +FontCharMap::FontCharMap( ImplFontCharMapRef const & pIFCMap ) : mpImplFontCharMap( pIFCMap ) - , mnRefCount(0) -{} +{ +} FontCharMap::FontCharMap( const CmapResult& rCR ) - : mnRefCount(0) + : mpImplFontCharMap(new ImplFontCharMap(rCR)) { - ImplFontCharMapPtr pImplFontCharMap( new ImplFontCharMap(rCR) ); - mpImplFontCharMap = pImplFontCharMap; } FontCharMap::~FontCharMap() @@ -405,10 +402,10 @@ FontCharMap::~FontCharMap() mpImplFontCharMap = nullptr; } -FontCharMapPtr FontCharMap::GetDefaultMap( bool bSymbol ) +FontCharMapRef FontCharMap::GetDefaultMap( bool bSymbol ) { - FontCharMapPtr pFontCharMap( new FontCharMap( ImplFontCharMap::getDefaultMap( bSymbol ) ) ); - return pFontCharMap; + FontCharMapRef xFontCharMap( new FontCharMap( ImplFontCharMap::getDefaultMap( bSymbol ) ) ); + return xFontCharMap; } bool FontCharMap::IsDefaultMap() const diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx index 1269333702b0..28b506fde130 100644 --- a/vcl/source/font/fontmetric.cxx +++ b/vcl/source/font/fontmetric.cxx @@ -35,26 +35,26 @@ using namespace ::rtl; using namespace ::utl; FontMetric::FontMetric() -: mpImplMetric( new ImplFontMetric() ) +: mxImplMetric( new ImplFontMetric() ) {} FontMetric::FontMetric( const FontMetric& rFontMetric ) : Font( rFontMetric ) - , mpImplMetric( rFontMetric.mpImplMetric ) + , mxImplMetric( rFontMetric.mxImplMetric ) {} FontMetric::~FontMetric() { - mpImplMetric = nullptr; + mxImplMetric = nullptr; } FontMetric& FontMetric::operator=( const FontMetric& rFontMetric ) { Font::operator=( rFontMetric ); - if( mpImplMetric != rFontMetric.mpImplMetric ) + if( mxImplMetric != rFontMetric.mxImplMetric ) { - mpImplMetric = rFontMetric.mpImplMetric; + mxImplMetric = rFontMetric.mxImplMetric; } return *this; @@ -64,116 +64,116 @@ bool FontMetric::operator==( const FontMetric& rFontMetric ) const { if( !Font::operator==( rFontMetric ) ) return false; - if( mpImplMetric == rFontMetric.mpImplMetric ) + if( mxImplMetric == rFontMetric.mxImplMetric ) return true; - if( *mpImplMetric == *rFontMetric.mpImplMetric ) + if( *mxImplMetric == *rFontMetric.mxImplMetric ) return true; return false; } FontType FontMetric::GetType() const { - return (mpImplMetric->IsScalable() ? TYPE_SCALABLE : TYPE_RASTER); + return (mxImplMetric->IsScalable() ? TYPE_SCALABLE : TYPE_RASTER); } long FontMetric::GetAscent() const { - return mpImplMetric->GetAscent(); + return mxImplMetric->GetAscent(); } void FontMetric::SetAscent( long nAscent ) { - mpImplMetric->SetAscent( nAscent ); + mxImplMetric->SetAscent( nAscent ); } long FontMetric::GetDescent() const { - return mpImplMetric->GetDescent(); + return mxImplMetric->GetDescent(); } void FontMetric::SetDescent( long nDescent ) { - mpImplMetric->SetDescent( nDescent ); + mxImplMetric->SetDescent( nDescent ); } long FontMetric::GetInternalLeading() const { - return mpImplMetric->GetInternalLeading(); + return mxImplMetric->GetInternalLeading(); } void FontMetric::SetInternalLeading( long nLeading ) { - mpImplMetric->SetInternalLeading( nLeading ); + mxImplMetric->SetInternalLeading( nLeading ); } long FontMetric::GetExternalLeading() const { - return mpImplMetric->GetExternalLeading(); + return mxImplMetric->GetExternalLeading(); } void FontMetric::SetExternalLeading( long nLeading ) { - mpImplMetric->SetExternalLeading( nLeading ); + mxImplMetric->SetExternalLeading( nLeading ); } long FontMetric::GetLineHeight() const { - return mpImplMetric->GetLineHeight(); + return mxImplMetric->GetLineHeight(); } void FontMetric::SetLineHeight( long nHeight ) { - mpImplMetric->SetLineHeight( nHeight ); + mxImplMetric->SetLineHeight( nHeight ); } long FontMetric::GetSlant() const { - return mpImplMetric->GetSlant(); + return mxImplMetric->GetSlant(); } void FontMetric::SetSlant( long nSlant ) { - mpImplMetric->SetSlant( nSlant ); + mxImplMetric->SetSlant( nSlant ); } long FontMetric::GetBulletOffset() const { - return mpImplMetric->GetBulletOffset(); + return mxImplMetric->GetBulletOffset(); } void FontMetric::SetBulletOffset( long nOffset ) { - mpImplMetric->SetBulletOffset( nOffset ); + mxImplMetric->SetBulletOffset( nOffset ); } bool FontMetric::IsScalable() const { - return mpImplMetric->IsScalable(); + return mxImplMetric->IsScalable(); } void FontMetric::SetScalableFlag(bool bScalable) { - mpImplMetric->SetScalableFlag( bScalable ); + mxImplMetric->SetScalableFlag( bScalable ); } bool FontMetric::IsFullstopCentered() const { - return mpImplMetric->IsFullstopCentered(); + return mxImplMetric->IsFullstopCentered(); } void FontMetric::SetFullstopCenteredFlag(bool bScalable) { - mpImplMetric->SetFullstopCenteredFlag( bScalable ); + mxImplMetric->SetFullstopCenteredFlag( bScalable ); } bool FontMetric::IsBuiltInFont() const { - return mpImplMetric->IsBuiltInFont(); + return mxImplMetric->IsBuiltInFont(); } void FontMetric::SetBuiltInFontFlag( bool bIsBuiltInFont ) { - mpImplMetric->SetBuiltInFontFlag( bIsBuiltInFont ); + mxImplMetric->SetBuiltInFontFlag( bIsBuiltInFont ); } @@ -185,7 +185,6 @@ ImplFontMetric::ImplFontMetric() mnLineHeight( 0 ), mnSlant( 0 ), mnBulletOffset( 0 ), - mnRefCount( 0 ), mbScalableFont( false ), mbFullstopCentered( false ), mbDevice( false ) @@ -213,7 +212,6 @@ bool ImplFontMetric::operator==( const ImplFontMetric& r ) const ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData ) : FontAttributes( rFontSelData ) - , mnRefCount ( 0 ) , mnWidth ( rFontSelData.mnWidth ) , mnOrientation( (short)(rFontSelData.mnOrientation) ) , mnAscent( 0 ) diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 520999f32a57..8f7fea70cd1a 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -179,7 +179,7 @@ FontMetric OutputDevice::GetFontMetric() const return aMetric; LogicalFontInstance* pFontInstance = mpFontInstance; - ImplFontMetricDataPtr xFontMetric = pFontInstance->mxFontMetric; + ImplFontMetricDataRef xFontMetric = pFontInstance->mxFontMetric; // prepare metric aMetric.Font::operator=( maFont ); @@ -236,7 +236,7 @@ FontMetric OutputDevice::GetFontMetric( const vcl::Font& rFont ) const return aMetric; } -bool OutputDevice::GetFontCharMap( FontCharMapPtr& rxFontCharMap ) const +bool OutputDevice::GetFontCharMap( FontCharMapRef& rxFontCharMap ) const { // we need a graphics if( !mpGraphics && !AcquireGraphics() ) @@ -249,10 +249,10 @@ bool OutputDevice::GetFontCharMap( FontCharMapPtr& rxFontCharMap ) const if( !mpFontInstance ) return false; - FontCharMapPtr xFontCharMap ( mpGraphics->GetFontCharMap() ); + FontCharMapRef xFontCharMap ( mpGraphics->GetFontCharMap() ); if (!xFontCharMap) { - FontCharMapPtr xDefaultMap( new FontCharMap() ); + FontCharMapRef xDefaultMap( new FontCharMap() ); rxFontCharMap = xDefaultMap; } else @@ -1530,7 +1530,7 @@ sal_Int32 OutputDevice::HasGlyphs( const vcl::Font& rTempFont, const OUString& r // to get the map temporarily set font const vcl::Font aOrigFont = GetFont(); const_cast<OutputDevice&>(*this).SetFont( rTempFont ); - FontCharMapPtr xFontCharMap ( new FontCharMap() ); + FontCharMapRef xFontCharMap ( new FontCharMap() ); bool bRet = GetFontCharMap( xFontCharMap ); const_cast<OutputDevice&>(*this).SetFont( aOrigFont ); diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index a88f179fc34b..488e675e9b82 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -2109,7 +2109,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont, CmapResult aCmapResult; if( ParseCMAP( pCmapData, nCmapSize, aCmapResult ) ) { - FontCharMapPtr xFontCharMap( new FontCharMap(aCmapResult) ); + FontCharMapRef xFontCharMap( new FontCharMap(aCmapResult) ); for( sal_uInt32 cOld = 0;;) { // get next unicode covered by font diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index d86539354fb4..f697a0c84528 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -364,12 +364,12 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout ) releaseCairoContext(cr); } -const FontCharMapPtr CairoTextRender::GetFontCharMap() const +const FontCharMapRef CairoTextRender::GetFontCharMap() const { if( !mpServerFont[0] ) return nullptr; - const FontCharMapPtr xFCMap = mpServerFont[0]->GetFontCharMap(); + const FontCharMapRef xFCMap = mpServerFont[0]->GetFontCharMap(); return xFCMap; } @@ -465,7 +465,7 @@ FontConfigFontOptions* GetFCFontOptions( const FontAttributes& rFontAttributes, } void -CairoTextRender::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric, int nFallbackLevel ) +CairoTextRender::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int nFallbackLevel ) { if( nFallbackLevel >= MAX_FALLBACK ) return; diff --git a/vcl/unx/generic/gdi/font.cxx b/vcl/unx/generic/gdi/font.cxx index 3cc651064d06..36c7ecba8456 100644 --- a/vcl/unx/generic/gdi/font.cxx +++ b/vcl/unx/generic/gdi/font.cxx @@ -57,7 +57,7 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) mxTextRenderImpl->DrawServerFontLayout(rLayout); } -const FontCharMapPtr X11SalGraphics::GetFontCharMap() const +const FontCharMapRef X11SalGraphics::GetFontCharMap() const { return mxTextRenderImpl->GetFontCharMap(); } @@ -100,7 +100,7 @@ void X11SalGraphics::GetDevFontList( PhysicalFontCollection* pFontCollection ) } void -X11SalGraphics::GetFontMetric( ImplFontMetricDataPtr &rxFontMetric, int nFallbackLevel ) +X11SalGraphics::GetFontMetric( ImplFontMetricDataRef &rxFontMetric, int nFallbackLevel ) { mxTextRenderImpl->GetFontMetric(rxFontMetric, nFallbackLevel); } diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx index 79744b2353df..1ad75c4c3fbb 100644 --- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx +++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx @@ -614,7 +614,7 @@ ServerFont::~ServerFont() } -void ServerFont::GetFontMetric( ImplFontMetricDataPtr& rxTo, long& rFactor ) const +void ServerFont::GetFontMetric( ImplFontMetricDataRef& rxTo, long& rFactor ) const { rxTo->FontAttributes::operator =(mpFontInfo->GetFontAttributes()); @@ -971,13 +971,13 @@ bool ServerFont::GetAntialiasAdvice() const // determine unicode ranges in font -const FontCharMapPtr ServerFont::GetFontCharMap() const +const FontCharMapRef ServerFont::GetFontCharMap() const { - const FontCharMapPtr xFCMap = mpFontInfo->GetFontCharMap(); + const FontCharMapRef xFCMap = mpFontInfo->GetFontCharMap(); return xFCMap; } -const FontCharMapPtr& FreetypeFontInfo::GetFontCharMap() +const FontCharMapRef& FreetypeFontInfo::GetFontCharMap() { // check if the charmap is already cached if( mxFontCharMap ) @@ -988,12 +988,12 @@ const FontCharMapPtr& FreetypeFontInfo::GetFontCharMap() bool bOK = GetFontCodeRanges( aCmapResult ); if( bOK ) { - FontCharMapPtr xFontCharMap( new FontCharMap ( aCmapResult ) ); + FontCharMapRef xFontCharMap( new FontCharMap ( aCmapResult ) ); mxFontCharMap = xFontCharMap; } else { - FontCharMapPtr xFontCharMap( new FontCharMap() ); + FontCharMapRef xFontCharMap( new FontCharMap() ); mxFontCharMap = xFontCharMap; } // mxFontCharMap on either branch now has a refcount of 1 diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index 51dfdc863c79..4df3ab349c50 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -767,12 +767,12 @@ void GenPspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) DrawPrinterLayout( rLayout, *m_pPrinterGfx, true ); } -const FontCharMapPtr GenPspGraphics::GetFontCharMap() const +const FontCharMapRef GenPspGraphics::GetFontCharMap() const { if( !m_pServerFont[0] ) return nullptr; - const FontCharMapPtr xFCMap = m_pServerFont[0]->GetFontCharMap(); + const FontCharMapRef xFCMap = m_pServerFont[0]->GetFontCharMap(); return xFCMap; } @@ -915,7 +915,7 @@ void GenPspGraphics::ClearDevFontCache() GlyphCache::GetInstance().ClearFontCache(); } -void GenPspGraphics::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric, int ) +void GenPspGraphics::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int ) { const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); psp::PrintFontInfo aInfo; diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 331f51996dd4..f7ad89a3e043 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -446,7 +446,7 @@ void ImplGetLogFontFromFontSelect( HDC, const FontSelectPattern*, bool WinGlyphFallbackSubstititution::HasMissingChars( PhysicalFontFace* pFace, const OUString& rMissingChars ) const { WinFontFace* pWinFont = static_cast< WinFontFace* >(pFace); - FontCharMapPtr xFontCharMap = pWinFont->GetFontCharMap(); + FontCharMapRef xFontCharMap = pWinFont->GetFontCharMap(); if( !xFontCharMap ) { // construct a Size structure as the parameter of constructor of class FontSelectPattern @@ -1118,10 +1118,8 @@ bool WinFontFace::IsGSUBstituted( sal_UCS4 cChar ) const return( maGsubTable.find( cChar ) != maGsubTable.end() ); } -FontCharMapPtr WinFontFace::GetFontCharMap() const +FontCharMapRef WinFontFace::GetFontCharMap() const { - if( !mxUnicodeMap ) - return NULL; return mxUnicodeMap; } @@ -1192,7 +1190,7 @@ void WinFontFace::ReadCmapTable( HDC hDC ) const aResult.mbSymbolic = bIsSymbolFont; if( aResult.mnRangeCount > 0 ) { - FontCharMapPtr pUnicodeMap(new FontCharMap(aResult)); + FontCharMapRef pUnicodeMap(new FontCharMap(aResult)); mxUnicodeMap = pUnicodeMap; } } @@ -1511,7 +1509,7 @@ void WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel ) } } -void WinSalGraphics::GetFontMetric( ImplFontMetricDataPtr& rxFontMetric, int nFallbackLevel ) +void WinSalGraphics::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int nFallbackLevel ) { // temporarily change the HDC to the font in the fallback level HFONT hOldFont = SelectFont( getHDC(), mhFonts[nFallbackLevel] ); @@ -1617,11 +1615,11 @@ sal_uLong WinSalGraphics::GetKernPairs() return mnFontKernPairCount; } -const FontCharMapPtr WinSalGraphics::GetFontCharMap() const +const FontCharMapRef WinSalGraphics::GetFontCharMap() const { if( !mpWinFontData[0] ) { - FontCharMapPtr xDefFontCharMap( new FontCharMap() ); + FontCharMapRef xDefFontCharMap( new FontCharMap() ); return xDefFontCharMap; } return mpWinFontData[0]->GetFontCharMap(); @@ -2313,7 +2311,7 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, if( aRawCffData.get() ) { pWinFontData->UpdateFromHDC( getHDC() ); - FontCharMapPtr xFontCharMap = pWinFontData->GetFontCharMap(); + FontCharMapRef xFontCharMap = pWinFontData->GetFontCharMap(); sal_GlyphId aRealGlyphIds[ 256 ]; for( int i = 0; i < nGlyphCount; ++i ) @@ -2563,7 +2561,7 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, rUnicodeEnc.clear(); } const WinFontFace* pWinFont = static_cast<const WinFontFace*>(pFont); - FontCharMapPtr xFCMap = pWinFont->GetFontCharMap(); + FontCharMapRef xFCMap = pWinFont->GetFontCharMap(); SAL_WARN_IF( !xFCMap || !xFCMap->GetCharCount(), "vcl", "no map" ); int nCharCount = xFCMap->GetCharCount(); diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx index c5542e917ea0..624547ad54f1 100644 --- a/vcl/workben/fftester.cxx +++ b/vcl/workben/fftester.cxx @@ -50,6 +50,7 @@ #include <vcl/wrkwin.hxx> #include <vcl/fltcall.hxx> #include <osl/file.hxx> +#include <unistd.h> #include <signal.h> #include <../source/filter/igif/gifread.hxx> diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index da9a4f1ff778..81df47ab87f3 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -2121,7 +2121,7 @@ namespace { FontMetric aMetric = xDevice->GetFontMetric(aFont); - FontCharMapPtr xMap; + FontCharMapRef xMap; if (xDevice->GetFontCharMap(xMap)) { ... iterate through glyphs ... |