diff options
Diffstat (limited to 'sw/source/core/txtnode/fntcap.cxx')
-rw-r--r-- | sw/source/core/txtnode/fntcap.cxx | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 69426bcffa34..8a40614a3d93 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,21 +32,13 @@ #include <hintids.hxx> #include <editeng/cmapitem.hxx> +#include <editeng/svxfont.hxx> -#ifndef _OUTDEV_HXX //autogen #include <vcl/outdev.hxx> -#endif -#ifndef _COM_SUN_STAR_I18N_CHARTYPE_HDL #include <com/sun/star/i18n/CharType.hdl> -#endif -#ifndef _COM_SUN_STAR_I18N_WORDTYPE_HDL #include <com/sun/star/i18n/WordType.hdl> -#endif -#ifndef _PRINT_HXX //autogen #include <vcl/print.hxx> -#endif -#include <errhdl.hxx> #include <fntcache.hxx> #include <swfont.hxx> #include <breakit.hxx> @@ -54,9 +47,6 @@ using namespace ::com::sun::star::i18n; - -#define KAPITAELCHENPROP 66 - /************************************************************************* * class SwCapitalInfo * @@ -95,7 +85,7 @@ xub_StrLen lcl_CalcCaseMap( const SwFont& rFnt, { int j = 0; const xub_StrLen nEnd = nOfst + nLen; - ASSERT( nEnd <= rOrigString.Len(), "lcl_CalcCaseMap: Wrong parameters" ) + OSL_ENSURE( nEnd <= rOrigString.Len(), "lcl_CalcCaseMap: Wrong parameters" ); // special case for title case: const bool bTitle = SVX_CASEMAP_TITEL == rFnt.GetCaseMap() && @@ -298,7 +288,7 @@ protected: SwFntObj *pLowerFnt; public: SwDoDrawCapital( SwDrawTextInfo &rInfo ) : - SwDoCapitals( rInfo ) + SwDoCapitals( rInfo ), pUpperFnt(0), pLowerFnt(0) { } virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont ); virtual void Do(); @@ -326,7 +316,7 @@ void SwDoDrawCapital::Do() rInf.SetBullet( bOldBullet ); } - ASSERT( pUpperFnt, "No upper font, dying soon!"); + OSL_ENSURE( pUpperFnt, "No upper font, dying soon!"); rInf.Shift( pUpperFnt->GetFont()->GetOrientation() ); rInf.SetWidth( nOrgWidth ); } @@ -337,7 +327,7 @@ void SwDoDrawCapital::Do() void SwDoDrawCapital::DrawSpace( Point &rPos ) { - static sal_Char __READONLY_DATA sDoubleSpace[] = " "; + static sal_Char const sDoubleSpace[] = " "; long nDiff = rInf.GetPos().X() - rPos.X(); @@ -396,7 +386,7 @@ protected: sal_uInt16 nOfst; public: SwDoCapitalCrsrOfst( SwDrawTextInfo &rInfo, const sal_uInt16 nOfs ) : - SwDoCapitals( rInfo ), nCrsr( 0 ), nOfst( nOfs ) + SwDoCapitals( rInfo ), pUpperFnt(0), pLowerFnt(0), nCrsr( 0 ), nOfst( nOfs ) { } virtual void Init( SwFntObj *pUpperFont, SwFntObj *pLowerFont ); virtual void Do(); @@ -564,7 +554,7 @@ void SwSubFont::DrawStretchCapital( SwDrawTextInfo &rInf ) void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) { - ASSERT( pLastFont, "SwFont::DoOnCapitals: No LastFont?!" ); + OSL_ENSURE( pLastFont, "SwFont::DoOnCapitals: No LastFont?!" ); Size aPartSize; long nKana = 0; @@ -633,7 +623,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) pBigFont = pLastFont; // Hier entsteht der Kleinbuchstabenfont: - aFont.SetProportion( sal_uInt8( (aFont.GetPropr()*KAPITAELCHENPROP) / 100L) ); + aFont.SetProportion( sal_uInt8 (aFont.GetPropr() * SMALL_CAPS_PERCENTAGE ) / 100L); pMagic2 = NULL; nIndex2 = 0; SwFntAccess *pSmallFontAccess = new SwFntAccess( pMagic2, nIndex2, &aFont, @@ -703,8 +693,8 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) pBreakIt->GetLocale( eLng ), CharType::LOWERCASE_LETTER); if( nPos == STRING_LEN || nPos > nMaxPos ) nPos = nMaxPos; - ASSERT( nPos, "nextCharBlock not implemented?" ); -#ifdef DBG_UTIL + OSL_ENSURE( nPos, "nextCharBlock not implemented?" ); +#if OSL_DEBUG_LEVEL > 1 if( !nPos ) nPos = nMaxPos; #endif @@ -817,8 +807,8 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) pBreakIt->GetLocale( eLng ), CharType::LOWERCASE_LETTER); if( nPos == STRING_LEN || nPos > nMaxPos ) nPos = nMaxPos; - ASSERT( nPos, "endOfCharBlock not implemented?" ); -#ifdef DBG_UTIL + OSL_ENSURE( nPos, "endOfCharBlock not implemented?" ); +#if OSL_DEBUG_LEVEL > 1 if( !nPos ) nPos = nMaxPos; #endif @@ -853,3 +843,4 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |