From 5bcff42d2ad98776d95913152799f9b41401b1dd Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 10 Aug 2001 17:02:39 +0000 Subject: #88107# convert StarMath/StarBats<->StarSymbol in binary file format --- sc/inc/patattr.hxx | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) (limited to 'sc/inc/patattr.hxx') diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index 3b00e9edbe9f..f4eb2562a6d1 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: patattr.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: nn $ $Date: 2000-11-23 20:17:08 $ + * last change: $Author: er $ $Date: 2001-08-10 18:01:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,6 +70,10 @@ #include #endif +#ifndef _SV_FONTCVT_HXX +#include +#endif + class Font; class OutputDevice; @@ -128,8 +132,24 @@ public: BOOL IsVisible() const; BOOL IsVisibleEqual( const ScPatternAttr& rOther ) const; + + /** If font is an old symbol font StarBats/StarMath + with text encoding RTL_TEXTENC_SYMBOL */ BOOL IsSymbolFont() const; + /** Create a FontToSubsFontConverter if needed for + this pattern, else return 0. + + @param nFlags is the bit mask which shall be + used for CreateFontToSubsFontConverter(). + + The converter must be destroyed by the caller + using DestroyFontToSubsFontConverter() which + should be accomplished using the + ScFontToSubsFontConverter_AutoPtr + */ + FontToSubsFontConverter GetSubsFontConverter( ULONG nFlags ) const; + ULONG GetNumberFormat( SvNumberFormatter* ) const; ULONG GetNumberFormat( SvNumberFormatter* pFormatter, const SfxItemSet* pCondSet ) const; @@ -138,4 +158,40 @@ public: BYTE GetRotateDir( const SfxItemSet* pCondSet ) const; }; + +class ScFontToSubsFontConverter_AutoPtr +{ + FontToSubsFontConverter h; + + void release() + { + if ( h ) + DestroyFontToSubsFontConverter( h ); + } + + // prevent usage + ScFontToSubsFontConverter_AutoPtr( const ScFontToSubsFontConverter_AutoPtr& ); + ScFontToSubsFontConverter_AutoPtr& operator=( const ScFontToSubsFontConverter_AutoPtr& ); + +public: + ScFontToSubsFontConverter_AutoPtr() + : h(0) + {} + ~ScFontToSubsFontConverter_AutoPtr() + { + release(); + } + + ScFontToSubsFontConverter_AutoPtr& operator=( FontToSubsFontConverter hN ) + { + release(); + h = hN; + return *this; + } + + operator FontToSubsFontConverter() const + { return h; } +}; + + #endif -- cgit