From 84a3db80b4fd66c6854b3135b5f69b61fd828e62 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 18 Sep 2000 23:08:29 +0000 Subject: initial import --- sw/source/core/txtnode/swfont.cxx | 1103 +++++++++++++++++++++++++++++++++++++ 1 file changed, 1103 insertions(+) create mode 100644 sw/source/core/txtnode/swfont.cxx (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx new file mode 100644 index 000000000000..b312f85167e5 --- /dev/null +++ b/sw/source/core/txtnode/swfont.cxx @@ -0,0 +1,1103 @@ +/************************************************************************* + * + * $RCSfile: swfont.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-19 00:08:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifdef PRECOMPILED +#include "core_pch.hxx" +#endif + +#pragma hdrstop + +#include "hintids.hxx" + +#ifndef _SYSTEM_HXX //autogen +#include +#endif +#ifndef _SVX_BRSHITEM_HXX //autogen +#include +#endif +#ifndef _SVX_WRLMITEM_HXX //autogen +#include +#endif +#ifndef _SVX_BLNKITEM_HXX //autogen +#include +#endif +#ifndef _SVX_NHYPITEM_HXX //autogen +#include +#endif +#ifndef _SVX_KERNITEM_HXX //autogen +#include +#endif +#ifndef _SVX_CMAPITEM_HXX //autogen +#include +#endif +#ifndef _SVX_LANGITEM_HXX //autogen +#include +#endif +#ifndef _SVX_ESCPITEM_HXX //autogen +#include +#endif +#ifndef _SVX_AKRNITEM_HXX //autogen +#include +#endif +#ifndef _SVX_SHDDITEM_HXX //autogen +#include +#endif +#ifndef _SVX_CNTRITEM_HXX //autogen +#include +#endif +#ifndef _SVX_COLRITEM_HXX //autogen +#include +#endif +#ifndef _SVX_CSCOITEM_HXX //autogen +#include +#endif +#ifndef _SVX_CRSDITEM_HXX //autogen +#include +#endif +#ifndef _SVX_UDLNITEM_HXX //autogen +#include +#endif +#ifndef _SVX_WGHTITEM_HXX //autogen +#include +#endif +#ifndef _SVX_POSTITEM_HXX //autogen +#include +#endif +#ifndef _SVX_FHGTITEM_HXX //autogen +#include +#endif +#ifndef _SVX_FONTITEM_HXX //autogen +#include +#endif +#ifndef _CHARATR_HXX +#include +#endif +#ifndef _SWATRSET_HXX //autogen +#include +#endif +#ifndef _APP_HXX //autogen +#include +#endif +#ifndef _OUTDEV_HXX //autogen +#include +#endif + + +#include "viewsh.hxx" // Bildschirmabgleich +#include "swfont.hxx" +#include "fntcache.hxx" // FontCache +#include "drawfont.hxx" // SwDrawTextInfo + +#if defined(WIN) || defined(WNT) || defined(PM2) +#define FNT_LEADING_HACK +#endif + +#if defined(WIN) || defined(WNT) +#define FNT_ATM_HACK +#endif + +#ifndef PRODUCT +// globale Variable +SvStatistics aSvStat; +#endif + +/************************************************************************ + * Hintergrundbrush setzen, z.B. bei Zeichenvorlagen + ***********************************************************************/ + +void SwFont::SetBackColor( Color* pNewColor ) +{ + delete pBackColor; + pBackColor = pNewColor; + bFntChg = TRUE; + aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; +} + +/************************************************************************ + * Hintergrundbrush setzen, + * die alte Brush wird _nicht_ destruiert, sondern ist der Rueckgabewert. + ***********************************************************************/ + +Color* SwFont::XChgBackColor( Color* pNewColor ) +{ + Color* pRet = pBackColor; + pBackColor = pNewColor; + bFntChg = TRUE; + aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; + return pRet; +} + +/************************************************************************* + Escapement: + frEsc: Fraction, Grad des Escapements + Esc = resultierendes Escapement + A1 = Original-Ascent (nOrgAscent) + A2 = verkleinerter Ascent (nEscAscent) + Ax = resultierender Ascent (GetAscent()) + H1 = Original-Hoehe (nOrgHeight) + H2 = verkleinerter Hoehe (nEscHeight) + Hx = resultierender Hoehe (GetHeight()) + Bx = resultierende Baseline fuer die Textausgabe (CalcPos()) + (Vorsicht: Y - A1!) + + Escapement: + Esc = H1 * frEsc; + + Hochstellung: + Ax = A2 + Esc; + Hx = H2 + Esc; + Bx = A1 - Esc; + + Tiefstellung: + Ax = A1; + Hx = A1 + Esc + (H2 - A2); + Bx = A1 + Esc; + +*************************************************************************/ + +/************************************************************************* + * SwSubFont::CalcEscAscent( const USHORT nOldAscent ) + *************************************************************************/ + +// nEsc ist der Prozentwert +USHORT SwSubFont::CalcEscAscent( const USHORT nOldAscent ) const +{ + if( DFLT_ESC_AUTO_SUPER != GetEscapement() && + DFLT_ESC_AUTO_SUB != GetEscapement() ) + { + const long nAscent = nOldAscent + + ( (long) nOrgHeight * GetEscapement() ) / 100L; + if ( nAscent>0 ) + return ( Max( USHORT (nAscent), nOrgAscent )); + } + return nOrgAscent; +} + +/************************************************************************* + * SwSubFont::SetFnt() + *************************************************************************/ + +void SwSubFont::SetFnt( const SvxFont &rFont ) +{ + *((SvxFont*)this) = rFont; + if ( 100 == GetPropr() ) + aSize = Font::GetSize(); + else + aSize = Size( (long) Font::GetSize().Width() * 100L / GetPropr(), + (long) Font::GetSize().Height() * 100L / GetPropr() ); + pMagic = 0; + ASSERT( IsTransparent(), "SwSubFont: Transparent revolution" ); +} + +/************************************************************************* + * SwFont::SetFnt() + *************************************************************************/ + +void SwFont::SetFnt( const SwAttrSet *pAttrSet ) +{ + if( pAttrSet ) + { + { // Latin + const SvxFontItem& rFont = pAttrSet->GetFont(); + aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); + aSub[SW_LATIN].Font::SetName( rFont.GetFamilyName() ); + aSub[SW_LATIN].Font::SetStyleName( rFont.GetStyleName() ); + aSub[SW_LATIN].Font::SetPitch( rFont.GetPitch() ); + aSub[SW_LATIN].Font::SetCharSet( rFont.GetCharSet() ); + aSub[SW_LATIN].SvxFont::SetPropr( 100 ); + aSub[SW_LATIN].aSize = aSub[SW_LATIN].Font::GetSize(); + Size aTmpSize = aSub[SW_LATIN].aSize; + aTmpSize.Height() = pAttrSet->GetSize().GetHeight(); + aSub[SW_LATIN].SetSize( aTmpSize ); + aSub[SW_LATIN].Font::SetItalic( pAttrSet->GetPosture().GetPosture() ); + aSub[SW_LATIN].Font::SetWeight( pAttrSet->GetWeight().GetWeight() ); + aSub[SW_LATIN].SetLanguage( pAttrSet->GetLanguage().GetLanguage() ); + } + { // CJK + const SvxFontItem& rFont = pAttrSet->GetCJKFont(); + aSub[SW_CJK].SetFamily( rFont.GetFamily() ); + aSub[SW_CJK].Font::SetName( rFont.GetFamilyName() ); + aSub[SW_CJK].Font::SetStyleName( rFont.GetStyleName() ); + aSub[SW_CJK].Font::SetPitch( rFont.GetPitch() ); + aSub[SW_CJK].Font::SetCharSet( rFont.GetCharSet() ); + aSub[SW_CJK].SvxFont::SetPropr( 100 ); + aSub[SW_CJK].aSize = aSub[SW_CJK].Font::GetSize(); + Size aTmpSize = aSub[SW_CJK].aSize; + aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); + aSub[SW_CJK].SetSize( aTmpSize ); + aSub[SW_CJK].Font::SetItalic( pAttrSet->GetCJKPosture().GetPosture() ); + aSub[SW_CJK].Font::SetWeight( pAttrSet->GetCJKWeight().GetWeight() ); + aSub[SW_CJK].SetLanguage( pAttrSet->GetCJKLanguage().GetLanguage() ); + } + { // CTL + const SvxFontItem& rFont = pAttrSet->GetCTLFont(); + aSub[SW_CTL].SetFamily( rFont.GetFamily() ); + aSub[SW_CTL].Font::SetName( rFont.GetFamilyName() ); + aSub[SW_CTL].Font::SetStyleName( rFont.GetStyleName() ); + aSub[SW_CTL].Font::SetPitch( rFont.GetPitch() ); + aSub[SW_CTL].Font::SetCharSet( rFont.GetCharSet() ); + aSub[SW_CTL].SvxFont::SetPropr( 100 ); + aSub[SW_CTL].aSize = aSub[SW_CTL].Font::GetSize(); + Size aTmpSize = aSub[SW_CTL].aSize; + aTmpSize.Height() = pAttrSet->GetCTLSize().GetHeight(); + aSub[SW_CTL].SetSize( aTmpSize ); + aSub[SW_CTL].Font::SetItalic( pAttrSet->GetCTLPosture().GetPosture() ); + aSub[SW_CTL].Font::SetWeight( pAttrSet->GetCTLWeight().GetWeight() ); + aSub[SW_CTL].SetLanguage( pAttrSet->GetCTLLanguage().GetLanguage() ); + } + SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); + SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); + SetColor( pAttrSet->GetColor().GetValue() ); + SetTransparent( TRUE ); + SetAlign( ALIGN_BASELINE ); + SetOutline( pAttrSet->GetContour().GetValue() ); + SetShadow( pAttrSet->GetShadowed().GetValue() ); + SetAutoKern( pAttrSet->GetAutoKern().GetValue() ); + SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); + const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); + SetEscapement( rEsc.GetEsc() ); + if( aSub[SW_LATIN].IsEsc() ) + SetProportion( rEsc.GetProp() ); + SetCaseMap( pAttrSet->GetCaseMap().GetCaseMap() ); + SetFixKerning( pAttrSet->GetKerning().GetValue() ); + bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); + bBlink = pAttrSet->GetBlink().GetValue(); + } + else + { + aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; + Invalidate(); + bNoHyph = FALSE; + bBlink = FALSE; + } + bPaintBlank = FALSE; + bPaintWrong = FALSE; + bURL = bGreyWave = bNoColReplace = FALSE; + ASSERT( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" ); +} + +/************************************************************************* + * SwFont::SetFnt() + *************************************************************************/ + +void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) +{ + if( pAttrSet ) + { + const SfxPoolItem* pItem; + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_FONT, + TRUE, &pItem )) + { + const SvxFontItem *pFont = (const SvxFontItem *)pItem; + aSub[SW_LATIN].SetFamily( pFont->GetFamily() ); + aSub[SW_LATIN].Font::SetName( pFont->GetFamilyName() ); + aSub[SW_LATIN].Font::SetStyleName( pFont->GetStyleName() ); + aSub[SW_LATIN].Font::SetPitch( pFont->GetPitch() ); + aSub[SW_LATIN].Font::SetCharSet( pFont->GetCharSet() ); + } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_FONTSIZE, + TRUE, &pItem )) + { + const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; + aSub[SW_LATIN].SvxFont::SetPropr( 100 ); + aSub[SW_LATIN].aSize = aSub[SW_LATIN].Font::GetSize(); + Size aTmpSize = aSub[SW_LATIN].aSize; + aTmpSize.Height() = pHeight->GetHeight(); + aSub[SW_LATIN].SetSize( aTmpSize ); + } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_POSTURE, + TRUE, &pItem )) + aSub[SW_LATIN].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_WEIGHT, + TRUE, &pItem )) + aSub[SW_LATIN].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_LANGUAGE, + TRUE, &pItem )) + aSub[SW_LATIN].SetLanguage( ((SvxLanguageItem*)pItem)->GetLanguage() ); + + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_FONT, + TRUE, &pItem )) + { + const SvxFontItem *pFont = (const SvxFontItem *)pItem; + aSub[SW_CJK].SetFamily( pFont->GetFamily() ); + aSub[SW_CJK].Font::SetName( pFont->GetFamilyName() ); + aSub[SW_CJK].Font::SetStyleName( pFont->GetStyleName() ); + aSub[SW_CJK].Font::SetPitch( pFont->GetPitch() ); + aSub[SW_CJK].Font::SetCharSet( pFont->GetCharSet() ); + } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_FONTSIZE, + TRUE, &pItem )) + { + const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; + aSub[SW_CJK].SvxFont::SetPropr( 100 ); + aSub[SW_CJK].aSize = aSub[SW_CJK].Font::GetSize(); + Size aTmpSize = aSub[SW_CJK].aSize; + aTmpSize.Height() = pHeight->GetHeight(); + aSub[SW_CJK].SetSize( aTmpSize ); + } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_POSTURE, + TRUE, &pItem )) + aSub[SW_CJK].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_WEIGHT, + TRUE, &pItem )) + aSub[SW_CJK].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_LANGUAGE, + TRUE, &pItem )) + aSub[SW_CJK].SetLanguage( ((SvxLanguageItem*)pItem)->GetLanguage() ); + + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONT, + TRUE, &pItem )) + { + const SvxFontItem *pFont = (const SvxFontItem *)pItem; + aSub[SW_CTL].SetFamily( pFont->GetFamily() ); + aSub[SW_CTL].Font::SetName( pFont->GetFamilyName() ); + aSub[SW_CTL].Font::SetStyleName( pFont->GetStyleName() ); + aSub[SW_CTL].Font::SetPitch( pFont->GetPitch() ); + aSub[SW_CTL].Font::SetCharSet( pFont->GetCharSet() ); + } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONTSIZE, + TRUE, &pItem )) + { + const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; + aSub[SW_CTL].SvxFont::SetPropr( 100 ); + aSub[SW_CTL].aSize = aSub[SW_CTL].Font::GetSize(); + Size aTmpSize = aSub[SW_CTL].aSize; + aTmpSize.Height() = pHeight->GetHeight(); + aSub[SW_CTL].SetSize( aTmpSize ); + } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_POSTURE, + TRUE, &pItem )) + aSub[SW_CTL].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_WEIGHT, + TRUE, &pItem )) + aSub[SW_CTL].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_LANGUAGE, + TRUE, &pItem )) + aSub[SW_CTL].SetLanguage( ((SvxLanguageItem*)pItem)->GetLanguage() ); + + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_UNDERLINE, + TRUE, &pItem )) + SetUnderline( ((SvxUnderlineItem*)pItem)->GetUnderline() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CROSSEDOUT, + TRUE, &pItem )) + SetStrikeout( ((SvxCrossedOutItem*)pItem)->GetStrikeout() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_COLOR, + TRUE, &pItem )) + SetColor( ((SvxColorItem*)pItem)->GetValue() ); + SetTransparent( TRUE ); + SetAlign( ALIGN_BASELINE ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CONTOUR, + TRUE, &pItem )) + SetOutline( ((SvxContourItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, + TRUE, &pItem )) + SetShadow( ((SvxShadowedItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_AUTOKERN, + TRUE, &pItem )) + SetAutoKern( ((SvxAutoKernItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_WORDLINEMODE, + TRUE, &pItem )) + SetWordLineMode( ((SvxWordLineModeItem*)pItem)->GetValue() ); + + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_ESCAPEMENT, + TRUE, &pItem )) + { + const SvxEscapementItem *pEsc = (const SvxEscapementItem *)pItem; + SetEscapement( pEsc->GetEsc() ); + if( aSub[SW_LATIN].IsEsc() ) + SetProportion( pEsc->GetProp() ); + } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CASEMAP, + TRUE, &pItem )) + SetCaseMap( ((SvxCaseMapItem*)pItem)->GetCaseMap() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_KERNING, + TRUE, &pItem )) + SetFixKerning( ((SvxKerningItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_NOHYPHEN, + TRUE, &pItem )) + SetNoHyph( ((SvxNoHyphenItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BLINK, + TRUE, &pItem )) + SetBlink( ((SvxBlinkItem*)pItem)->GetValue() ); + } + else + { + Invalidate(); + bNoHyph = FALSE; + bBlink = FALSE; + } + bPaintBlank = FALSE; + bPaintWrong = FALSE; + ASSERT( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" ); +} + +/************************************************************************* + * class SwFont + *************************************************************************/ + +SwFont::SwFont( const SwFont &rFont ) +{ + aSub[SW_LATIN] = rFont.aSub[SW_LATIN]; + aSub[SW_CJK] = rFont.aSub[SW_CJK]; + aSub[SW_CTL] = rFont.aSub[SW_CTL]; + nActual = rFont.nActual; + pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL; + nToxCnt = nRefCnt = 0; + bFntChg = rFont.bFntChg; + bOrgChg = rFont.bOrgChg; + bPaintBlank = rFont.bPaintBlank; + bPaintWrong = FALSE; + bURL = rFont.bURL; + bGreyWave = rFont.bGreyWave; + bNoColReplace = rFont.bNoColReplace; + bNoHyph = rFont.bNoHyph; + bBlink = rFont.bBlink; +} + +SwFont::SwFont( const SwAttrSet* pAttrSet ) +{ + nActual = SW_LATIN; + nToxCnt = nRefCnt = 0; + bPaintBlank = FALSE; + bPaintWrong = FALSE; + bURL = FALSE; + bGreyWave = FALSE; + bNoColReplace = FALSE; + bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); + bBlink = pAttrSet->GetBlink().GetValue(); + { + const SvxFontItem& rFont = pAttrSet->GetFont(); + aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); + aSub[SW_LATIN].SetName( rFont.GetFamilyName() ); + aSub[SW_LATIN].SetStyleName( rFont.GetStyleName() ); + aSub[SW_LATIN].SetPitch( rFont.GetPitch() ); + aSub[SW_LATIN].SetCharSet( rFont.GetCharSet() ); + aSub[SW_LATIN].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_LATIN].aSize; + aTmpSize.Height() = pAttrSet->GetSize().GetHeight(); + aSub[SW_LATIN].SetSize( aTmpSize ); + aSub[SW_LATIN].SetItalic( pAttrSet->GetPosture().GetPosture() ); + aSub[SW_LATIN].SetWeight( pAttrSet->GetWeight().GetWeight() ); + aSub[SW_LATIN].SetLanguage( pAttrSet->GetLanguage().GetLanguage() ); + } + + { + const SvxFontItem& rFont = pAttrSet->GetCJKFont(); + aSub[SW_CJK].SetFamily( rFont.GetFamily() ); + aSub[SW_CJK].SetName( rFont.GetFamilyName() ); + aSub[SW_CJK].SetStyleName( rFont.GetStyleName() ); + aSub[SW_CJK].SetPitch( rFont.GetPitch() ); + aSub[SW_CJK].SetCharSet( rFont.GetCharSet() ); + aSub[SW_CJK].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_CJK].aSize; + aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); + aSub[SW_CJK].SetSize( aTmpSize ); + aSub[SW_CJK].SetItalic( pAttrSet->GetCJKPosture().GetPosture() ); + aSub[SW_CJK].SetWeight( pAttrSet->GetCJKWeight().GetWeight() ); + aSub[SW_CJK].SetLanguage( pAttrSet->GetCJKLanguage().GetLanguage() ); + } + + { + const SvxFontItem& rFont = pAttrSet->GetCJKFont(); + aSub[SW_CTL].SetFamily( rFont.GetFamily() ); + aSub[SW_CTL].SetName( rFont.GetFamilyName() ); + aSub[SW_CTL].SetStyleName( rFont.GetStyleName() ); + aSub[SW_CTL].SetPitch( rFont.GetPitch() ); + aSub[SW_CTL].SetCharSet( rFont.GetCharSet() ); + aSub[SW_CTL].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_CTL].aSize; + aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); + aSub[SW_CTL].SetSize( aTmpSize ); + aSub[SW_CTL].SetItalic( pAttrSet->GetCJKPosture().GetPosture() ); + aSub[SW_CTL].SetWeight( pAttrSet->GetCJKWeight().GetWeight() ); + aSub[SW_CTL].SetLanguage( pAttrSet->GetCJKLanguage().GetLanguage() ); + } + + SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); + SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); + SetColor( pAttrSet->GetColor().GetValue() ); + SetTransparent( TRUE ); + SetAlign( ALIGN_BASELINE ); + SetOutline( pAttrSet->GetContour().GetValue() ); + SetShadow( pAttrSet->GetShadowed().GetValue() ); + SetAutoKern( pAttrSet->GetAutoKern().GetValue() ); + SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); + const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); + SetEscapement( rEsc.GetEsc() ); + if( aSub[SW_LATIN].IsEsc() ) + SetProportion( rEsc.GetProp() ); + SetCaseMap( pAttrSet->GetCaseMap().GetCaseMap() ); + SetFixKerning( pAttrSet->GetKerning().GetValue() ); + const SfxPoolItem* pItem; + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND, + TRUE, &pItem )) + pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() ); + else + pBackColor = NULL; +} + +SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) +{ + SvxFont::operator=( rFont ); + pMagic = rFont.pMagic; + nFntIndex = rFont.nFntIndex; + nOrgHeight = rFont.nOrgHeight; + nOrgAscent = rFont.nOrgAscent; + aSize = rFont.aSize; + return *this; +} + +SwFont& SwFont::operator=( const SwFont &rFont ) +{ + aSub[SW_LATIN] = rFont.aSub[SW_LATIN]; + aSub[SW_CJK] = rFont.aSub[SW_CJK]; + aSub[SW_CTL] = rFont.aSub[SW_CTL]; + nActual = rFont.nActual; + delete pBackColor; + pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL; + nToxCnt = nRefCnt = 0; + bFntChg = rFont.bFntChg; + bOrgChg = rFont.bOrgChg; + bPaintBlank = rFont.bPaintBlank; + bPaintWrong = FALSE; + bURL = rFont.bURL; + bGreyWave = rFont.bGreyWave; + bNoColReplace = rFont.bNoColReplace; + bNoHyph = rFont.bNoHyph; + bBlink = rFont.bBlink; + return *this; +} + +/************************************************************************* + * SwFont::GoMagic() + *************************************************************************/ + +void SwFont::GoMagic( ViewShell *pSh, BYTE nWhich ) +{ + SwFntAccess aFntAccess( aSub[nWhich].pMagic, aSub[nWhich].nFntIndex, + &aSub[nWhich], pSh, TRUE ); +} + +/************************************************************************* + * SwSubFont::IsSymbol() + *************************************************************************/ + +BOOL SwSubFont::IsSymbol( ViewShell *pSh ) +{ + SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, FALSE ); + return aFntAccess.Get()->IsSymbol(); +} + +/************************************************************************* + * SwFont::SetSystemLang() + *************************************************************************/ + +LanguageType GetSystemLang( ) +{ + // Hier wird bei LANGUAGE_SYSTEM die Sprache ermittelt. + // 1.Versuch: Was sagt die Applikation? + LanguageType eTmp = GetpApp()->GetAppInternational().GetLanguage(); + if ( ( eTmp == LANGUAGE_SYSTEM ) && + // Was sagt die Systemumgebung? + ( (eTmp = ::GetSystemLanguage()) == LANGUAGE_SYSTEM ) ) + eTmp = LANGUAGE_DONTKNOW; // also unbekannt + return eTmp; +} + +/************************************************************************* + * SwSubFont::ChgFnt() + *************************************************************************/ + +BOOL SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice *pOut ) +{ + if ( pLastFont ) + pLastFont->Unlock(); + SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, TRUE ); + SV_STAT( nChangeFont ); + + pLastFont = aFntAccess.Get(); + + pLastFont->SetDevFont( pSh, pOut ); + + pLastFont->Lock(); + return UNDERLINE_NONE != GetUnderline() || STRIKEOUT_NONE != GetStrikeout(); +} + +/************************************************************************* + * SwFont::ChgPhysFnt() + *************************************************************************/ + +void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice *pOut ) +{ + ASSERT( pOut, "SwFont:;ChgPhysFnt, not OutDev." ); + + if( bOrgChg && aSub[nActual].IsEsc() ) + { + const BYTE nOldProp = aSub[nActual].GetPropr(); + SetProportion( 100 ); + ChgFnt( pSh, pOut ); + SwFntAccess aFntAccess( aSub[nActual].pMagic, aSub[nActual].nFntIndex, + &aSub[nActual], pSh ); + aSub[nActual].nOrgHeight = aFntAccess.Get()->GetHeight( pSh, pOut ); + aSub[nActual].nOrgAscent = aFntAccess.Get()->GetAscent( pSh, pOut ); + SetProportion( nOldProp ); + bOrgChg = FALSE; + } + + if( bFntChg ) + { + ChgFnt( pSh, pOut ); + bFntChg = bOrgChg; + } +} + +/************************************************************************* + * SwFont::CalcEscHeight() + * Height = MaxAscent + MaxDescent + * MaxAscent = Max (T1_ascent, T2_ascent + (Esc * T1_height) ); + * MaxDescent = Max (T1_height-T1_ascent, + * T2_height-T2_ascent - (Esc * T1_height) + *************************************************************************/ + +USHORT SwSubFont::CalcEscHeight( const USHORT nOldHeight, + const USHORT nOldAscent ) const +{ + if( DFLT_ESC_AUTO_SUPER != GetEscapement() && + DFLT_ESC_AUTO_SUB != GetEscapement() ) + { + long nDescent = nOldHeight - nOldAscent - + ( (long) nOrgHeight * GetEscapement() ) / 100L; + const USHORT nDesc = ( nDescent>0 ) ? Max ( USHORT(nDescent), + USHORT(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent; + return ( nDesc + CalcEscAscent( nOldAscent ) ); + } + return nOrgHeight; +} + +short SwSubFont::_CheckKerning( ) +{ +#ifdef DEBUG + static nTst = 6; + short nKernx = - short( Font::GetSize().Height() / nTst ); +#else + short nKernx = - short( Font::GetSize().Height() / 6 ); +#endif + if ( nKernx < GetFixKerning() ) + return GetFixKerning(); + return nKernx; +} + +/************************************************************************* + * SwFont::GetLeading() + *************************************************************************/ + +USHORT SwFont::GetLeading( ViewShell *pSh, const OutputDevice *pOut ) +{ + if( OUTDEV_PRINTER != pOut->GetOutDevType() ) + return 0; + else + { + SwFntAccess aFntAccess( aSub[nActual].pMagic, aSub[nActual].nFntIndex, + &aSub[nActual], pSh ); + return aFntAccess.Get()->GetLeading(); + } +} + +/************************************************************************* + * SwSubFont::GetAscent() + *************************************************************************/ + +USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice *pOut ) +{ + register USHORT nAscent; + SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh ); + nAscent = aFntAccess.Get()->GetAscent( pSh, pOut ); + if( GetEscapement() ) + nAscent = CalcEscAscent( nAscent ); + return nAscent; +} + +/************************************************************************* + * SwSubFont::GetHeight() + *************************************************************************/ + +USHORT SwSubFont::GetHeight( ViewShell *pSh, const OutputDevice *pOut ) +{ + SV_STAT( nGetTextSize ); + SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh ); + const USHORT nHeight = aFntAccess.Get()->GetHeight( pSh, pOut ); + if ( GetEscapement() ) + { + const USHORT nAscent = aFntAccess.Get()->GetAscent( pSh, pOut ); + return CalcEscHeight( nHeight, nAscent ); // + nLeading; + } + return nHeight; // + nLeading; +} + +/************************************************************************* + * SwSubFont::_GetTxtSize() + *************************************************************************/ + +Size SwSubFont::_GetTxtSize( ViewShell *pSh, + const OutputDevice *pOut, const XubString &rTxt, + const xub_StrLen nIdx, const xub_StrLen nLen ) +{ + // Robust: Eigentlich sollte der Font bereits eingestellt sein, aber + // sicher ist sicher ... + if ( !pLastFont || pLastFont->GetOwner()!=pMagic || + !IsSameInstance( pOut->GetFont() ) ) + ChgFnt( pSh, (OutputDevice *)pOut ); + + Size aTxtSize; + xub_StrLen nLn = ( nLen==STRING_LEN ? rTxt.Len() : nLen ); + if( IsCapital() && nLn ) + aTxtSize = GetCapitalSize( pSh, pOut, rTxt, nIdx, nLn ); + else + { + SV_STAT( nGetTextSize ); + if ( !IsCaseMap() ) + aTxtSize = pLastFont->GetTextSize( pSh, pOut, rTxt, + nIdx, nLn, CheckKerning() ); + else + aTxtSize = pLastFont->GetTextSize( pSh, pOut, CalcCaseMap( rTxt ), + nIdx, nLn, CheckKerning() ); + // 15142: Ein Wort laenger als eine Zeile, beim Zeilenumbruch + // hochgestellt, muss seine effektive Hoehe melden. + if( GetEscapement() ) + { + const USHORT nAscent = pLastFont->GetAscent( pSh, pOut ); + aTxtSize.Height() = + (long)CalcEscHeight( (USHORT)aTxtSize.Height(), nAscent); + } + } + return aTxtSize; +} + +/************************************************************************* + * SwFont::GetTxtBreak() + *************************************************************************/ + +xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, + const XubString &rTxt, long nTextWidth, + const xub_StrLen nIdx, const xub_StrLen nLen ) +{ + ChgFnt( pSh, (OutputDevice *)pOut ); + + USHORT nTxtBreak = 0; + + USHORT nLn = ( nLen == STRING_LEN ? rTxt.Len() : nLen ); + if( aSub[nActual].IsCapital() && nLn ) + nTxtBreak = GetCapitalBreak( pSh, pOut, rTxt, nTextWidth, 0, nIdx, nLn ); + else + { + if ( !aSub[nActual].IsCaseMap() ) + nTxtBreak = pOut->GetTextBreak( rTxt, nTextWidth, + nIdx, nLn, CheckKerning() ); + else + nTxtBreak = pOut->GetTextBreak( aSub[nActual].CalcCaseMap( rTxt ), + nTextWidth, nIdx, nLn, CheckKerning() ); + } + return nTxtBreak; +} + +/************************************************************************* + * SwFont::GetTxtBreak() + *************************************************************************/ + +xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, + const OutputDevice *pOut, const XubString &rTxt, long nTextWidth, + xub_StrLen& rExtraCharPos, const xub_StrLen nIdx, const xub_StrLen nLen) +{ + // Robust ... + if ( !pLastFont || pLastFont->GetOwner()!= aSub[nActual].pMagic ) + ChgFnt( pSh, (OutputDevice *)pOut ); + + xub_StrLen nTxtBreak = 0; + + xub_StrLen nLn = ( nLen == STRING_LEN ? rTxt.Len() : nLen ); + if( aSub[nActual].IsCapital() && nLn ) + nTxtBreak = GetCapitalBreak( pSh, pOut, rTxt, nTextWidth, + &rExtraCharPos, nIdx, nLn ); + else + { + if ( !aSub[nActual].IsCaseMap() ) + nTxtBreak = pOut->GetTextBreak( rTxt, nTextWidth, + '-', rExtraCharPos, nIdx, nLn, CheckKerning() ); + else + nTxtBreak = pOut->GetTextBreak( aSub[nActual].CalcCaseMap( rTxt ), + nTextWidth, '-', rExtraCharPos, nIdx, nLn, CheckKerning() ); + } + return nTxtBreak; +} + +/************************************************************************* + * SwSubFont::_DrawText() + *************************************************************************/ + +void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) +{ + rInf.SetGreyWave( bGrey ); + xub_StrLen nLn = rInf.GetText().Len(); + if( !rInf.GetLen() || !nLn ) + return; + if( STRING_LEN == rInf.GetLen() ) + rInf.SetLen( nLn ); + + FontUnderline nOldUnder; + + if( rInf.GetSpecialUnderline() ) + { + nOldUnder = GetUnderline(); + SetUnderline( UNDERLINE_NONE ); + } + + if( !pLastFont || pLastFont->GetOwner()!=pMagic ) + ChgFnt( rInf.GetShell(), rInf.GetpOut() ); + + Point aPos( rInf.GetPos() ); + const Point &rOld = rInf.GetPos(); + rInf.SetPos( aPos ); + + if( GetEscapement() ) + { + if( DFLT_ESC_AUTO_SUB == GetEscapement() ) + aPos.Y() += nOrgHeight - nOrgAscent - + pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + + pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); + else if( DFLT_ESC_AUTO_SUPER == GetEscapement() ) + { + aPos.Y() += pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); + aPos.Y() -= nOrgAscent; + } + else + aPos.Y() -= short( ((long)nOrgHeight * GetEscapement()) / 100L ); + } + rInf.SetKern( CheckKerning() + rInf.GetSperren() ); + + if( IsCapital() ) + DrawCapital( rInf ); + else + { + SV_STAT( nDrawText ); + if ( !IsCaseMap() ) + pLastFont->DrawText( rInf ); + else + { + XubString aString( CalcCaseMap( rInf.GetText() ) ); + const XubString &rOldStr = rInf.GetText(); + rInf.SetText( aString ); + pLastFont->DrawText( rInf ); + rInf.SetText( rOldStr ); + } + } + rInf.SetPos( rOld ); + + if( rInf.GetSpecialUnderline() ) + { +static sal_Char __READONLY_DATA sDoubleSpace[] = " "; + Size aSize = _GetTxtSize( rInf.GetShell(), rInf.GetpOut(), rInf.GetText(), + rInf.GetIdx(), rInf.GetLen() ); + const XubString &rOldStr = rInf.GetText(); + XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ); + short nOldEsc = GetEscapement(); + BYTE nOldProp = GetPropr(); + BOOL bOldWord = IsWordLineMode(); + SetWordLineMode( FALSE ); + xub_StrLen nOldIdx = rInf.GetIdx(); + xub_StrLen nOldLen = rInf.GetLen(); + long nSpace = 0; + if( rInf.GetSpace() ) + { + xub_StrLen nTmpEnd = nOldIdx + nOldLen; + if( nTmpEnd > rOldStr.Len() ) + nTmpEnd = rOldStr.Len(); + for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) + if( CH_BLANK == rOldStr.GetChar( nTmp ) ) + ++nSpace; + nSpace *= rInf.GetSpace(); + } + rInf.SetText( aStr ); + rInf.SetIdx( 0 ); + rInf.SetLen( 2 ); + SetProportion( 100 ); + SetEscapement( 0 ); + SetUnderline( nOldUnder ); + rInf.SetWidth( USHORT(aSize.Width() + nSpace) ); + rInf.SetSpecialUnderline( FALSE ); + _DrawStretchText( rInf ); + rInf.SetSpecialUnderline( TRUE ); + rInf.SetText( rOldStr ); + SetProportion( nOldProp ); + SetEscapement( nOldEsc ); + rInf.SetIdx( nOldIdx ); + rInf.SetLen( nOldLen ); + SetWordLineMode( bOldWord ); + } +} + +void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) +{ + if( !rInf.GetLen() || !rInf.GetText().Len() ) + return; + + FontUnderline nOldUnder; + + if( rInf.GetSpecialUnderline() ) + { + nOldUnder = GetUnderline(); + SetUnderline( UNDERLINE_NONE ); + } + + if ( !pLastFont || pLastFont->GetOwner() != pMagic ) + ChgFnt( rInf.GetShell(), rInf.GetpOut() ); + + Point aPos( rInf.GetPos() ); + + if( GetEscapement() ) + { + if( DFLT_ESC_AUTO_SUB == GetEscapement() ) + aPos.Y() += nOrgHeight - nOrgAscent - + pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + + pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); + else if( DFLT_ESC_AUTO_SUPER == GetEscapement() ) + aPos.Y() += pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut())- + nOrgAscent; + else + aPos.Y() -= short( ((long)nOrgHeight * GetEscapement()) / 100L ); + } + rInf.SetKern( CheckKerning() + rInf.GetSperren() ); + + if( IsCapital() ) + { + const Point &rOld = rInf.GetPos(); + rInf.SetPos( aPos ); + DrawStretchCapital( rInf ); + rInf.SetPos( rOld ); + } + else + { + SV_STAT( nDrawStretchText ); + if ( !IsCaseMap() ) + rInf.GetOut().DrawStretchText( aPos, rInf.GetWidth(), + rInf.GetText(), rInf.GetIdx(), rInf.GetLen() ); + else + rInf.GetOut().DrawStretchText( aPos, rInf.GetWidth(), CalcCaseMap( + rInf.GetText() ), rInf.GetIdx(), rInf.GetLen() ); + } + + if( rInf.GetSpecialUnderline() ) + { +static sal_Char __READONLY_DATA sDoubleSpace[] = " "; + const XubString &rOldStr = rInf.GetText(); + XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ); + short nOldEsc = GetEscapement(); + BYTE nOldProp = GetPropr(); + BOOL bOldWord = IsWordLineMode(); + SetWordLineMode( FALSE ); + xub_StrLen nOldIdx = rInf.GetIdx(); + xub_StrLen nOldLen = rInf.GetLen(); + rInf.SetText( aStr ); + rInf.SetIdx( 0 ); + rInf.SetLen( 2 ); + SetProportion( 100 ); + SetEscapement( 0 ); + SetUnderline( nOldUnder ); + rInf.SetSpecialUnderline( FALSE ); + _DrawStretchText( rInf ); + rInf.SetSpecialUnderline( TRUE ); + rInf.SetText( rOldStr ); + SetProportion( nOldProp ); + SetEscapement( nOldEsc ); + rInf.SetIdx( nOldIdx ); + rInf.SetLen( nOldLen ); + SetWordLineMode( bOldWord ); + } +} + +/************************************************************************* + * SwSubFont::_GetCrsrOfst() + *************************************************************************/ + +xub_StrLen SwSubFont::_GetCrsrOfst( ViewShell *pSh, + OutputDevice *pOut, const XubString &rTxt, + const USHORT nOfst, const xub_StrLen nIdx, + const xub_StrLen nLen, const short nSpaceAdd ) +{ + if ( !pLastFont || pLastFont->GetOwner()!=pMagic ) + ChgFnt( pSh, pOut ); + + xub_StrLen nLn = ( nLen==STRING_LEN ? rTxt.Len() : nLen ); + xub_StrLen nCrsr = 0; + if( IsCapital() && nLn ) + nCrsr = GetCapitalCrsrOfst( pSh, pOut, rTxt, nOfst, nIdx, nLn, nSpaceAdd ); + else + { + SV_STAT( nGetTextSize ); + if ( !IsCaseMap() ) + nCrsr = pLastFont->GetCrsrOfst( pOut, rTxt, nOfst, + nIdx, nLn, CheckKerning(), nSpaceAdd ); + else + nCrsr = pLastFont->GetCrsrOfst( pOut, CalcCaseMap( rTxt ), nOfst, + nIdx, nLn, CheckKerning(), nSpaceAdd ); + } + return nCrsr; +} + -- cgit From 55db9cd721d46ea1ac95531088a564cf64272404 Mon Sep 17 00:00:00 2001 From: jp Date: Mon, 30 Oct 2000 11:51:04 +0000 Subject: new: EmphasisItem --- sw/source/core/txtnode/swfont.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index b312f85167e5..07afce254a25 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:27 $ + * last change: $Author: jp $ $Date: 2000-10-30 12:50:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -127,6 +127,9 @@ #ifndef _SVX_FONTITEM_HXX //autogen #include #endif +#ifndef _SVX_EMPHITEM_HXX //autogen +#include +#endif #ifndef _CHARATR_HXX #include #endif @@ -304,6 +307,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) aSub[SW_CTL].SetLanguage( pAttrSet->GetCTLLanguage().GetLanguage() ); } SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); + SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() ); SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); SetColor( pAttrSet->GetColor().GetValue() ); SetTransparent( TRUE ); @@ -442,6 +446,10 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_COLOR, TRUE, &pItem )) SetColor( ((SvxColorItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_EMPHASIS_MARK, + TRUE, &pItem )) + SetEmphasisMark( ((SvxEmphasisMarkItem*)pItem)->GetEmphasisMark() ); + SetTransparent( TRUE ); SetAlign( ALIGN_BASELINE ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CONTOUR, @@ -572,6 +580,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) } SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); + SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() ); SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); SetColor( pAttrSet->GetColor().GetValue() ); SetTransparent( TRUE ); -- cgit From 8aa553e1fff677455a2d7c76396a6ccb61d74376 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Thu, 9 Nov 2000 10:16:38 +0000 Subject: Fix: Don't forget the background brush --- sw/source/core/txtnode/swfont.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 07afce254a25..7f592340cb0b 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-10-30 12:50:47 $ + * last change: $Author: ama $ $Date: 2000-11-09 11:16:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -256,6 +256,8 @@ void SwSubFont::SetFnt( const SvxFont &rFont ) void SwFont::SetFnt( const SwAttrSet *pAttrSet ) { + delete pBackColor; + pBackColor = NULL; if( pAttrSet ) { { // Latin @@ -324,6 +326,10 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) SetFixKerning( pAttrSet->GetKerning().GetValue() ); bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); bBlink = pAttrSet->GetBlink().GetValue(); + const SfxPoolItem* pItem; + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND, + TRUE, &pItem )) + pBackColor = new Color( ((const SvxBrushItem*)pItem)->GetColor() ); } else { -- cgit From ed94ad6b32bcd746cc4ac6f5c85075ade2a67a2c Mon Sep 17 00:00:00 2001 From: jp Date: Mon, 20 Nov 2000 08:16:31 +0000 Subject: should change: use LocaleDataWrapper --- sw/source/core/txtnode/swfont.cxx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 7f592340cb0b..c535ac7dd98e 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ama $ $Date: 2000-11-09 11:16:38 $ + * last change: $Author: jp $ $Date: 2000-11-20 09:14:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,6 +70,16 @@ #ifndef _SYSTEM_HXX //autogen #include #endif +#ifndef _OUTDEV_HXX //autogen +#include +#endif +#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX +#include +#endif +#ifndef _UNO_LINGU_HXX +#include +#endif + #ifndef _SVX_BRSHITEM_HXX //autogen #include #endif @@ -136,12 +146,6 @@ #ifndef _SWATRSET_HXX //autogen #include #endif -#ifndef _APP_HXX //autogen -#include -#endif -#ifndef _OUTDEV_HXX //autogen -#include -#endif #include "viewsh.hxx" // Bildschirmabgleich @@ -669,7 +673,7 @@ LanguageType GetSystemLang( ) { // Hier wird bei LANGUAGE_SYSTEM die Sprache ermittelt. // 1.Versuch: Was sagt die Applikation? - LanguageType eTmp = GetpApp()->GetAppInternational().GetLanguage(); + LanguageType eTmp = SvxLocaleToLanguage( GetAppLocaleData().getLocale() ); if ( ( eTmp == LANGUAGE_SYSTEM ) && // Was sagt die Systemumgebung? ( (eTmp = ::GetSystemLanguage()) == LANGUAGE_SYSTEM ) ) -- cgit From eab7cbef0ddc235848a64b8e73fd66ab121190cd Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Fri, 24 Nov 2000 14:56:32 +0000 Subject: #80425#: Different color for the underlining --- sw/source/core/txtnode/swfont.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index c535ac7dd98e..504f6bf090c8 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jp $ $Date: 2000-11-20 09:14:07 $ + * last change: $Author: ama $ $Date: 2000-11-24 15:56:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -313,6 +313,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) aSub[SW_CTL].SetLanguage( pAttrSet->GetCTLLanguage().GetLanguage() ); } SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); + SetUnderColor( pAttrSet->GetUnderline().GetColor() ); SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() ); SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); SetColor( pAttrSet->GetColor().GetValue() ); @@ -449,7 +450,10 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_UNDERLINE, TRUE, &pItem )) + { SetUnderline( ((SvxUnderlineItem*)pItem)->GetUnderline() ); + SetUnderColor( ((SvxUnderlineItem*)pItem)->GetColor() ); + } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CROSSEDOUT, TRUE, &pItem )) SetStrikeout( ((SvxCrossedOutItem*)pItem)->GetStrikeout() ); @@ -518,6 +522,7 @@ SwFont::SwFont( const SwFont &rFont ) aSub[SW_CTL] = rFont.aSub[SW_CTL]; nActual = rFont.nActual; pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL; + aUnderColor = rFont.GetUnderColor(); nToxCnt = nRefCnt = 0; bFntChg = rFont.bFntChg; bOrgChg = rFont.bOrgChg; @@ -590,6 +595,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) } SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); + SetUnderColor( pAttrSet->GetUnderline().GetColor() ); SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() ); SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); SetColor( pAttrSet->GetColor().GetValue() ); @@ -632,6 +638,7 @@ SwFont& SwFont::operator=( const SwFont &rFont ) nActual = rFont.nActual; delete pBackColor; pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL; + aUnderColor = rFont.GetUnderColor(); nToxCnt = nRefCnt = 0; bFntChg = rFont.bFntChg; bOrgChg = rFont.bOrgChg; @@ -726,6 +733,8 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice *pOut ) ChgFnt( pSh, pOut ); bFntChg = bOrgChg; } + if( pOut->GetTextLineColor() != aUnderColor ) + pOut->SetTextLineColor( aUnderColor ); } /************************************************************************* -- cgit From 355850d06a489a6fdb251a70edd9294e6bdf7f30 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Tue, 12 Dec 2000 14:16:19 +0000 Subject: Fix: Use the CTL attribute for CTL fonts --- sw/source/core/txtnode/swfont.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 504f6bf090c8..16423f674919 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: ama $ $Date: 2000-11-24 15:56:32 $ + * last change: $Author: ama $ $Date: 2000-12-12 15:16:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -589,9 +589,9 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) Size aTmpSize = aSub[SW_CTL].aSize; aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); aSub[SW_CTL].SetSize( aTmpSize ); - aSub[SW_CTL].SetItalic( pAttrSet->GetCJKPosture().GetPosture() ); - aSub[SW_CTL].SetWeight( pAttrSet->GetCJKWeight().GetWeight() ); - aSub[SW_CTL].SetLanguage( pAttrSet->GetCJKLanguage().GetLanguage() ); + aSub[SW_CTL].SetItalic( pAttrSet->GetCTLPosture().GetPosture() ); + aSub[SW_CTL].SetWeight( pAttrSet->GetCTLWeight().GetWeight() ); + aSub[SW_CTL].SetLanguage( pAttrSet->GetCTLLanguage().GetLanguage() ); } SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); -- cgit From 50667125978ca1f976f6969325f6bcdb1fce5d96 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Mon, 15 Jan 2001 13:02:57 +0000 Subject: Fix: CTL instead of CJK, of course. Thanks to FME. --- sw/source/core/txtnode/swfont.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 16423f674919..bd0cad441a8d 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: ama $ $Date: 2000-12-12 15:16:19 $ + * last change: $Author: ama $ $Date: 2001-01-15 14:02:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -579,7 +579,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) } { - const SvxFontItem& rFont = pAttrSet->GetCJKFont(); + const SvxFontItem& rFont = pAttrSet->GetCTLFont(); aSub[SW_CTL].SetFamily( rFont.GetFamily() ); aSub[SW_CTL].SetName( rFont.GetFamilyName() ); aSub[SW_CTL].SetStyleName( rFont.GetStyleName() ); -- cgit From ad355e2b2449421786c0abe8f9ee740e9153eae3 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Tue, 13 Feb 2001 07:56:40 +0000 Subject: New: Proportional font width --- sw/source/core/txtnode/swfont.cxx | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index bd0cad441a8d..d0d904385036 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: ama $ $Date: 2001-01-15 14:02:57 $ + * last change: $Author: ama $ $Date: 2001-02-13 08:56:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -272,6 +272,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) aSub[SW_LATIN].Font::SetPitch( rFont.GetPitch() ); aSub[SW_LATIN].Font::SetCharSet( rFont.GetCharSet() ); aSub[SW_LATIN].SvxFont::SetPropr( 100 ); + aSub[SW_LATIN].SetPropWidth( 100 ); aSub[SW_LATIN].aSize = aSub[SW_LATIN].Font::GetSize(); Size aTmpSize = aSub[SW_LATIN].aSize; aTmpSize.Height() = pAttrSet->GetSize().GetHeight(); @@ -288,6 +289,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) aSub[SW_CJK].Font::SetPitch( rFont.GetPitch() ); aSub[SW_CJK].Font::SetCharSet( rFont.GetCharSet() ); aSub[SW_CJK].SvxFont::SetPropr( 100 ); + aSub[SW_CJK].SetPropWidth( 100 ); aSub[SW_CJK].aSize = aSub[SW_CJK].Font::GetSize(); Size aTmpSize = aSub[SW_CJK].aSize; aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); @@ -304,6 +306,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) aSub[SW_CTL].Font::SetPitch( rFont.GetPitch() ); aSub[SW_CTL].Font::SetCharSet( rFont.GetCharSet() ); aSub[SW_CTL].SvxFont::SetPropr( 100 ); + aSub[SW_CTL].SetPropWidth( 100 ); aSub[SW_CTL].aSize = aSub[SW_CTL].Font::GetSize(); Size aTmpSize = aSub[SW_CTL].aSize; aTmpSize.Height() = pAttrSet->GetCTLSize().GetHeight(); @@ -321,6 +324,11 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) SetAlign( ALIGN_BASELINE ); SetOutline( pAttrSet->GetContour().GetValue() ); SetShadow( pAttrSet->GetShadowed().GetValue() ); +#ifdef TEST_PROPWIDTH + //SetPropWidth( pAttrSet->GetPropWidth() ); + if( pAttrSet->GetShadowed().GetValue() ) + SetPropWidth(50); +#endif SetAutoKern( pAttrSet->GetAutoKern().GetValue() ); SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); @@ -472,6 +480,16 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, TRUE, &pItem )) SetShadow( ((SvxShadowedItem*)pItem)->GetValue() ); +#ifdef TEST_PROPWIDTH +/* + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_PROPWIDTH, + TRUE, &pItem )) + SetPropWidth( ((SvxPropWidthItem*)pItem)->getValue() ); + */ + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, + TRUE, &pItem )) + SetPropWidth(((SvxShadowedItem*)pItem)->GetValue() ? 50 : 100 ); +#endif if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_AUTOKERN, TRUE, &pItem )) SetAutoKern( ((SvxAutoKernItem*)pItem)->GetValue() ); @@ -603,6 +621,11 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) SetAlign( ALIGN_BASELINE ); SetOutline( pAttrSet->GetContour().GetValue() ); SetShadow( pAttrSet->GetShadowed().GetValue() ); +#ifdef TEST_PROPWIDTH +// SetPropWidth( pAttrSet->GetPropWidth().GetValue() ) + if( pAttrSet->GetShadowed().GetValue() ) + SetPropWidth(50); +#endif SetAutoKern( pAttrSet->GetAutoKern().GetValue() ); SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); @@ -626,6 +649,7 @@ SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) nFntIndex = rFont.nFntIndex; nOrgHeight = rFont.nOrgHeight; nOrgAscent = rFont.nOrgAscent; + nPropWidth = rFont.nPropWidth; aSize = rFont.aSize; return *this; } -- cgit From 51fd6cf62d64f3c4689073a9fb460e4906891c00 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Mon, 5 Mar 2001 11:54:15 +0000 Subject: New: SwAttrStack handles attribute changes --- sw/source/core/txtnode/swfont.cxx | 137 +++++++++++++++++++++++++++++++++----- 1 file changed, 122 insertions(+), 15 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index d0d904385036..1f106b950992 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: ama $ $Date: 2001-02-13 08:56:40 $ + * last change: $Author: ama $ $Date: 2001-03-05 12:54:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -146,7 +146,11 @@ #ifndef _SWATRSET_HXX //autogen #include #endif - +#ifndef OLD_ATTR_HANDLING +#ifndef _ATRSTCK_HXX +#include +#endif +#endif #include "viewsh.hxx" // Bildschirmabgleich #include "swfont.hxx" @@ -480,16 +484,9 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, TRUE, &pItem )) SetShadow( ((SvxShadowedItem*)pItem)->GetValue() ); -#ifdef TEST_PROPWIDTH -/* - if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_PROPWIDTH, - TRUE, &pItem )) - SetPropWidth( ((SvxPropWidthItem*)pItem)->getValue() ); - */ if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, TRUE, &pItem )) SetPropWidth(((SvxShadowedItem*)pItem)->GetValue() ? 50 : 100 ); -#endif if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_AUTOKERN, TRUE, &pItem )) SetAutoKern( ((SvxAutoKernItem*)pItem)->GetValue() ); @@ -621,11 +618,6 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) SetAlign( ALIGN_BASELINE ); SetOutline( pAttrSet->GetContour().GetValue() ); SetShadow( pAttrSet->GetShadowed().GetValue() ); -#ifdef TEST_PROPWIDTH -// SetPropWidth( pAttrSet->GetPropWidth().GetValue() ) - if( pAttrSet->GetShadowed().GetValue() ) - SetPropWidth(50); -#endif SetAutoKern( pAttrSet->GetAutoKern().GetValue() ); SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); @@ -642,6 +634,121 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) pBackColor = NULL; } +#ifndef OLD_ATTR_HANDLING +SwFont::SwFont( const SwAttrHandler& rAttrHandler ) +{ + nActual = SW_LATIN; + nToxCnt = nRefCnt = 0; + bPaintBlank = FALSE; + bPaintWrong = FALSE; + bURL = FALSE; + bGreyWave = FALSE; + bNoColReplace = FALSE; + bNoHyph = ( (SvxNoHyphenItem&) + rAttrHandler.GetDefault( RES_CHRATR_NOHYPHEN ) ).GetValue(); + bBlink = ( (SvxBlinkItem&) + rAttrHandler.GetDefault( RES_CHRATR_BLINK ) ).GetValue(); + { + const SvxFontItem& rFont = (SvxFontItem&) + rAttrHandler.GetDefault( RES_CHRATR_FONT ); + aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); + aSub[SW_LATIN].SetName( rFont.GetFamilyName() ); + aSub[SW_LATIN].SetStyleName( rFont.GetStyleName() ); + aSub[SW_LATIN].SetPitch( rFont.GetPitch() ); + aSub[SW_LATIN].SetCharSet( rFont.GetCharSet() ); + aSub[SW_LATIN].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_LATIN].aSize; + aTmpSize.Height() = ( (SvxFontHeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_FONTSIZE ) ).GetHeight(); + aSub[SW_LATIN].SetSize( aTmpSize ); + aSub[SW_LATIN].SetItalic( ( (SvxPostureItem&) + rAttrHandler.GetDefault( RES_CHRATR_POSTURE ) ).GetPosture() ); + aSub[SW_LATIN].SetWeight( ( (SvxWeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_WEIGHT ) ).GetWeight() ); + aSub[SW_LATIN].SetLanguage( ( (SvxLanguageItem&) + rAttrHandler.GetDefault( RES_CHRATR_LANGUAGE ) ).GetLanguage() ); + } + + { + const SvxFontItem& rFont = (SvxFontItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_FONT ); + aSub[SW_CJK].SetFamily( rFont.GetFamily() ); + aSub[SW_CJK].SetName( rFont.GetFamilyName() ); + aSub[SW_CJK].SetStyleName( rFont.GetStyleName() ); + aSub[SW_CJK].SetPitch( rFont.GetPitch() ); + aSub[SW_CJK].SetCharSet( rFont.GetCharSet() ); + aSub[SW_CJK].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_CJK].aSize; + aTmpSize.Height() = ( (SvxFontHeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_FONTSIZE ) ).GetHeight(); + aSub[SW_CJK].SetSize( aTmpSize ); + aSub[SW_CJK].SetItalic( ( (SvxPostureItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_POSTURE ) ).GetPosture() ); + aSub[SW_CJK].SetWeight( ( (SvxWeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_WEIGHT ) ).GetWeight() ); + aSub[SW_CJK].SetLanguage( ( (SvxLanguageItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_LANGUAGE ) ).GetLanguage() ); + } + + { + const SvxFontItem& rFont = (SvxFontItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_FONT ); + aSub[SW_CTL].SetFamily( rFont.GetFamily() ); + aSub[SW_CTL].SetName( rFont.GetFamilyName() ); + aSub[SW_CTL].SetStyleName( rFont.GetStyleName() ); + aSub[SW_CTL].SetPitch( rFont.GetPitch() ); + aSub[SW_CTL].SetCharSet( rFont.GetCharSet() ); + aSub[SW_CTL].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_CTL].aSize; + aTmpSize.Height() = ( (SvxFontHeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_FONTSIZE ) ).GetHeight(); + aSub[SW_CTL].SetSize( aTmpSize ); + aSub[SW_CTL].SetItalic( ( (SvxPostureItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_POSTURE ) ).GetPosture() ); + aSub[SW_CTL].SetWeight( ( (SvxWeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_WEIGHT ) ).GetWeight() ); + aSub[SW_CTL].SetLanguage( ( (SvxLanguageItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_LANGUAGE ) ).GetLanguage() ); + } + + SetUnderline( ( (SvxUnderlineItem&) + rAttrHandler.GetDefault( RES_CHRATR_UNDERLINE ) ).GetUnderline() ); + SetUnderColor( ( (SvxUnderlineItem&) + rAttrHandler.GetDefault( RES_CHRATR_UNDERLINE ) ).GetColor() ); + SetEmphasisMark( ( (SvxEmphasisMarkItem&) + rAttrHandler.GetDefault( RES_CHRATR_EMPHASIS_MARK ) ).GetEmphasisMark() ); + SetStrikeout( ( (SvxCrossedOutItem&) + rAttrHandler.GetDefault( RES_CHRATR_CROSSEDOUT ) ).GetStrikeout() ); + SetColor( ( (SvxColorItem&) + rAttrHandler.GetDefault( RES_CHRATR_COLOR ) ).GetValue() ); + SetTransparent( TRUE ); + SetAlign( ALIGN_BASELINE ); + SetOutline( ( (SvxContourItem&) + rAttrHandler.GetDefault( RES_CHRATR_CONTOUR ) ).GetValue() ); + SetShadow( ( (SvxShadowedItem&) + rAttrHandler.GetDefault( RES_CHRATR_SHADOWED ) ).GetValue() ); + SetAutoKern( ( (SvxAutoKernItem&) + rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ); + SetWordLineMode( ( (SvxWordLineModeItem&) + rAttrHandler.GetDefault( RES_CHRATR_WORDLINEMODE ) ).GetValue() ); + const SvxEscapementItem &rEsc = + (SvxEscapementItem&)rAttrHandler.GetDefault( RES_CHRATR_ESCAPEMENT ); + SetEscapement( rEsc.GetEsc() ); + if( aSub[SW_LATIN].IsEsc() ) + SetProportion( rEsc.GetProp() ); + SetCaseMap( ( (SvxCaseMapItem&) + rAttrHandler.GetDefault( RES_CHRATR_CASEMAP ) ).GetCaseMap() ); + SetFixKerning( ( (SvxKerningItem&) + rAttrHandler.GetDefault( RES_CHRATR_KERNING ) ).GetValue() ); + if( SFX_ITEM_SET == rAttrHandler.GetAttrSet()->GetItemState( + RES_CHRATR_BACKGROUND, TRUE ) ) + pBackColor = new Color( ( (SvxBrushItem&) + rAttrHandler.GetDefault( RES_CHRATR_BACKGROUND ) ).GetColor() ); + else + pBackColor = NULL; +} +#endif + SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) { SvxFont::operator=( rFont ); -- cgit From 0b02f94c0a4e8e08b693fc8f21f8decc997e3ec1 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Tue, 6 Mar 2001 12:14:20 +0000 Subject: New: Automatic font color, depending on background --- sw/source/core/txtnode/swfont.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 1f106b950992..1a0f9e855162 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: ama $ $Date: 2001-03-05 12:54:15 $ + * last change: $Author: ama $ $Date: 2001-03-06 13:13:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -343,6 +343,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) SetFixKerning( pAttrSet->GetKerning().GetValue() ); bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); bBlink = pAttrSet->GetBlink().GetValue(); + bAutomaticCol = FALSE; //pAttrSet->Get???().GetValue(); const SfxPoolItem* pItem; if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND, TRUE, &pItem )) @@ -354,6 +355,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) Invalidate(); bNoHyph = FALSE; bBlink = FALSE; + bAutomaticCol = FALSE; } bPaintBlank = FALSE; bPaintWrong = FALSE; @@ -514,12 +516,16 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BLINK, TRUE, &pItem )) SetBlink( ((SvxBlinkItem*)pItem)->GetValue() ); + //if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_???, + // TRUE, &pItem )) + SetAutomaticCol( FALSE /*((Svx???Item*)pItem)->GetValue()*/ ); } else { Invalidate(); bNoHyph = FALSE; bBlink = FALSE; + bAutomaticCol = FALSE; } bPaintBlank = FALSE; bPaintWrong = FALSE; @@ -548,6 +554,7 @@ SwFont::SwFont( const SwFont &rFont ) bNoColReplace = rFont.bNoColReplace; bNoHyph = rFont.bNoHyph; bBlink = rFont.bBlink; + bAutomaticCol = rFont.bAutomaticCol; } SwFont::SwFont( const SwAttrSet* pAttrSet ) @@ -561,6 +568,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) bNoColReplace = FALSE; bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); bBlink = pAttrSet->GetBlink().GetValue(); + bAutomaticCol = FALSE; // pAttrSet->Get???().GetValue(); { const SvxFontItem& rFont = pAttrSet->GetFont(); aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); @@ -648,6 +656,7 @@ SwFont::SwFont( const SwAttrHandler& rAttrHandler ) rAttrHandler.GetDefault( RES_CHRATR_NOHYPHEN ) ).GetValue(); bBlink = ( (SvxBlinkItem&) rAttrHandler.GetDefault( RES_CHRATR_BLINK ) ).GetValue(); + bAutomaticCol = FALSE; // ( (Svx???Item&)rAttrHandler.GetDefault( ??? ) ).GetValue(); { const SvxFontItem& rFont = (SvxFontItem&) rAttrHandler.GetDefault( RES_CHRATR_FONT ); @@ -780,6 +789,7 @@ SwFont& SwFont::operator=( const SwFont &rFont ) bNoColReplace = rFont.bNoColReplace; bNoHyph = rFont.bNoHyph; bBlink = rFont.bBlink; + bAutomaticCol = rFont.bAutomaticCol; return *this; } -- cgit From e5f31b246bc26bd3f8adbcea6a8dc2936e7ccfb5 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Tue, 6 Mar 2001 14:06:18 +0000 Subject: New: CJKContext for latin- and complex-scripts --- sw/source/core/txtnode/swfont.cxx | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 1a0f9e855162..6c06cea37923 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: ama $ $Date: 2001-03-06 13:13:06 $ + * last change: $Author: ama $ $Date: 2001-03-06 15:05:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -300,7 +300,11 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) aSub[SW_CJK].SetSize( aTmpSize ); aSub[SW_CJK].Font::SetItalic( pAttrSet->GetCJKPosture().GetPosture() ); aSub[SW_CJK].Font::SetWeight( pAttrSet->GetCJKWeight().GetWeight() ); - aSub[SW_CJK].SetLanguage( pAttrSet->GetCJKLanguage().GetLanguage() ); + LanguageType eNewLang = pAttrSet->GetCJKLanguage().GetLanguage(); + aSub[SW_CJK].SetLanguage( eNewLang ); + aSub[SW_LATIN].SetCJKContextLanguage( eNewLang ); + aSub[SW_CJK].SetCJKContextLanguage( eNewLang ); + aSub[SW_CTL].SetCJKContextLanguage( eNewLang ); } { // CTL const SvxFontItem& rFont = pAttrSet->GetCTLFont(); @@ -430,7 +434,13 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) aSub[SW_CJK].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_LANGUAGE, TRUE, &pItem )) - aSub[SW_CJK].SetLanguage( ((SvxLanguageItem*)pItem)->GetLanguage() ); + { + LanguageType eNewLang = ((SvxLanguageItem*)pItem)->GetLanguage(); + aSub[SW_CJK].SetLanguage( eNewLang ); + aSub[SW_LATIN].SetCJKContextLanguage( eNewLang ); + aSub[SW_CJK].SetCJKContextLanguage( eNewLang ); + aSub[SW_CTL].SetCJKContextLanguage( eNewLang ); + } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONT, TRUE, &pItem )) @@ -598,7 +608,11 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) aSub[SW_CJK].SetSize( aTmpSize ); aSub[SW_CJK].SetItalic( pAttrSet->GetCJKPosture().GetPosture() ); aSub[SW_CJK].SetWeight( pAttrSet->GetCJKWeight().GetWeight() ); - aSub[SW_CJK].SetLanguage( pAttrSet->GetCJKLanguage().GetLanguage() ); + LanguageType eNewLang = pAttrSet->GetCJKLanguage().GetLanguage(); + aSub[SW_CJK].SetLanguage( eNewLang ); + aSub[SW_LATIN].SetCJKContextLanguage( eNewLang ); + aSub[SW_CJK].SetCJKContextLanguage( eNewLang ); + aSub[SW_CTL].SetCJKContextLanguage( eNewLang ); } { @@ -695,8 +709,12 @@ SwFont::SwFont( const SwAttrHandler& rAttrHandler ) rAttrHandler.GetDefault( RES_CHRATR_CJK_POSTURE ) ).GetPosture() ); aSub[SW_CJK].SetWeight( ( (SvxWeightItem&) rAttrHandler.GetDefault( RES_CHRATR_CJK_WEIGHT ) ).GetWeight() ); - aSub[SW_CJK].SetLanguage( ( (SvxLanguageItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_LANGUAGE ) ).GetLanguage() ); + LanguageType eNewLang = ( (SvxLanguageItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_LANGUAGE ) ).GetLanguage(); + aSub[SW_CJK].SetLanguage( eNewLang ); + aSub[SW_LATIN].SetCJKContextLanguage( eNewLang ); + aSub[SW_CJK].SetCJKContextLanguage( eNewLang ); + aSub[SW_CTL].SetCJKContextLanguage( eNewLang ); } { -- cgit From ab524bca9dd3dcce12af46c19be8160ddd03488d Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Tue, 6 Mar 2001 15:25:03 +0000 Subject: Fix: Don't use upper case for filenames --- sw/source/core/txtnode/swfont.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 6c06cea37923..24f894da84c1 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: ama $ $Date: 2001-03-06 15:05:47 $ + * last change: $Author: ama $ $Date: 2001-03-06 16:25:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,8 +147,8 @@ #include #endif #ifndef OLD_ATTR_HANDLING -#ifndef _ATRSTCK_HXX -#include +#ifndef _ATRHNDL_HXX +#include #endif #endif -- cgit From 7c30e09f6c980bf0b4e550bd64b9d7f5ae4ebb3a Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Mon, 12 Mar 2001 09:01:09 +0000 Subject: New: Fontattribute relief --- sw/source/core/txtnode/swfont.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 24f894da84c1..8667a16d424e 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ama $ $Date: 2001-03-06 16:25:03 $ + * last change: $Author: ama $ $Date: 2001-03-12 09:58:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,6 +110,9 @@ #ifndef _SVX_SHDDITEM_HXX //autogen #include #endif +#ifndef _SVX_CHARRELIEFITEM_HXX +#include +#endif #ifndef _SVX_CNTRITEM_HXX //autogen #include #endif @@ -332,6 +335,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) SetAlign( ALIGN_BASELINE ); SetOutline( pAttrSet->GetContour().GetValue() ); SetShadow( pAttrSet->GetShadowed().GetValue() ); + SetRelief( (FontRelief)pAttrSet->GetCharRelief().GetValue() ); #ifdef TEST_PROPWIDTH //SetPropWidth( pAttrSet->GetPropWidth() ); if( pAttrSet->GetShadowed().GetValue() ) @@ -496,6 +500,9 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, TRUE, &pItem )) SetShadow( ((SvxShadowedItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_RELIEF, + TRUE, &pItem )) + SetRelief( (FontRelief)((SvxCharReliefItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, TRUE, &pItem )) SetPropWidth(((SvxShadowedItem*)pItem)->GetValue() ? 50 : 100 ); @@ -640,6 +647,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) SetAlign( ALIGN_BASELINE ); SetOutline( pAttrSet->GetContour().GetValue() ); SetShadow( pAttrSet->GetShadowed().GetValue() ); + SetRelief( (FontRelief)pAttrSet->GetCharRelief().GetValue() ); SetAutoKern( pAttrSet->GetAutoKern().GetValue() ); SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); @@ -754,6 +762,8 @@ SwFont::SwFont( const SwAttrHandler& rAttrHandler ) rAttrHandler.GetDefault( RES_CHRATR_CONTOUR ) ).GetValue() ); SetShadow( ( (SvxShadowedItem&) rAttrHandler.GetDefault( RES_CHRATR_SHADOWED ) ).GetValue() ); + SetRelief( (FontRelief)( (SvxCharReliefItem&) + rAttrHandler.GetDefault( RES_CHRATR_RELIEF ) ).GetValue() ); SetAutoKern( ( (SvxAutoKernItem&) rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ); SetWordLineMode( ( (SvxWordLineModeItem&) -- cgit From 491687eb578f3a0a01ef012adede9f95fb251734 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Tue, 13 Mar 2001 08:43:31 +0000 Subject: Opt.: fonts with automatic color, depending on background --- sw/source/core/txtnode/swfont.cxx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 8667a16d424e..f7dd4a1682c7 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: ama $ $Date: 2001-03-12 09:58:19 $ + * last change: $Author: ama $ $Date: 2001-03-13 09:39:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -351,7 +351,6 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) SetFixKerning( pAttrSet->GetKerning().GetValue() ); bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); bBlink = pAttrSet->GetBlink().GetValue(); - bAutomaticCol = FALSE; //pAttrSet->Get???().GetValue(); const SfxPoolItem* pItem; if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND, TRUE, &pItem )) @@ -363,7 +362,6 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) Invalidate(); bNoHyph = FALSE; bBlink = FALSE; - bAutomaticCol = FALSE; } bPaintBlank = FALSE; bPaintWrong = FALSE; @@ -533,16 +531,12 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BLINK, TRUE, &pItem )) SetBlink( ((SvxBlinkItem*)pItem)->GetValue() ); - //if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_???, - // TRUE, &pItem )) - SetAutomaticCol( FALSE /*((Svx???Item*)pItem)->GetValue()*/ ); } else { Invalidate(); bNoHyph = FALSE; bBlink = FALSE; - bAutomaticCol = FALSE; } bPaintBlank = FALSE; bPaintWrong = FALSE; @@ -571,7 +565,6 @@ SwFont::SwFont( const SwFont &rFont ) bNoColReplace = rFont.bNoColReplace; bNoHyph = rFont.bNoHyph; bBlink = rFont.bBlink; - bAutomaticCol = rFont.bAutomaticCol; } SwFont::SwFont( const SwAttrSet* pAttrSet ) @@ -585,7 +578,6 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) bNoColReplace = FALSE; bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); bBlink = pAttrSet->GetBlink().GetValue(); - bAutomaticCol = FALSE; // pAttrSet->Get???().GetValue(); { const SvxFontItem& rFont = pAttrSet->GetFont(); aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); @@ -678,7 +670,6 @@ SwFont::SwFont( const SwAttrHandler& rAttrHandler ) rAttrHandler.GetDefault( RES_CHRATR_NOHYPHEN ) ).GetValue(); bBlink = ( (SvxBlinkItem&) rAttrHandler.GetDefault( RES_CHRATR_BLINK ) ).GetValue(); - bAutomaticCol = FALSE; // ( (Svx???Item&)rAttrHandler.GetDefault( ??? ) ).GetValue(); { const SvxFontItem& rFont = (SvxFontItem&) rAttrHandler.GetDefault( RES_CHRATR_FONT ); @@ -817,7 +808,6 @@ SwFont& SwFont::operator=( const SwFont &rFont ) bNoColReplace = rFont.bNoColReplace; bNoHyph = rFont.bNoHyph; bBlink = rFont.bBlink; - bAutomaticCol = rFont.bAutomaticCol; return *this; } -- cgit From da7671e4f7482110ecd0cfbfd7dbd9e0b873c81c Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Thu, 15 Mar 2001 14:59:12 +0000 Subject: Opt.(FME): The new attribute handler makes a lot of code superfluous --- sw/source/core/txtnode/swfont.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index f7dd4a1682c7..02e1663c3655 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: ama $ $Date: 2001-03-13 09:39:30 $ + * last change: $Author: ama $ $Date: 2001-03-15 15:51:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -149,11 +149,9 @@ #ifndef _SWATRSET_HXX //autogen #include #endif -#ifndef OLD_ATTR_HANDLING #ifndef _ATRHNDL_HXX #include #endif -#endif #include "viewsh.hxx" // Bildschirmabgleich #include "swfont.hxx" @@ -656,7 +654,6 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) pBackColor = NULL; } -#ifndef OLD_ATTR_HANDLING SwFont::SwFont( const SwAttrHandler& rAttrHandler ) { nActual = SW_LATIN; @@ -775,7 +772,6 @@ SwFont::SwFont( const SwAttrHandler& rAttrHandler ) else pBackColor = NULL; } -#endif SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) { -- cgit From 3e92ccda17e22a954424c1a5336dbf3a81463dc0 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Mon, 19 Mar 2001 14:58:50 +0000 Subject: Opt(FME): Rotate, doubleline and Ruby handling --- sw/source/core/txtnode/swfont.cxx | 235 +++++++++++++++++++++++--------------- 1 file changed, 140 insertions(+), 95 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 02e1663c3655..1aa6fe4883c6 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: ama $ $Date: 2001-03-15 15:51:05 $ + * last change: $Author: ama $ $Date: 2001-03-19 15:53:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -79,7 +79,6 @@ #ifndef _UNO_LINGU_HXX #include #endif - #ifndef _SVX_BRSHITEM_HXX //autogen #include #endif @@ -143,6 +142,13 @@ #ifndef _SVX_EMPHITEM_HXX //autogen #include #endif +#ifndef _SVX_CHARROTATEITEM_HXX +#include +#endif +#ifndef _SVX_TWOLINESITEM_HXX +#include +#endif + #ifndef _CHARATR_HXX #include #endif @@ -263,104 +269,123 @@ void SwSubFont::SetFnt( const SvxFont &rFont ) * SwFont::SetFnt() *************************************************************************/ -void SwFont::SetFnt( const SwAttrSet *pAttrSet ) +void SwFont::SetFnt( const SwAttrHandler& rAttrHandler ) { delete pBackColor; pBackColor = NULL; - if( pAttrSet ) + { - { // Latin - const SvxFontItem& rFont = pAttrSet->GetFont(); - aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); - aSub[SW_LATIN].Font::SetName( rFont.GetFamilyName() ); - aSub[SW_LATIN].Font::SetStyleName( rFont.GetStyleName() ); - aSub[SW_LATIN].Font::SetPitch( rFont.GetPitch() ); - aSub[SW_LATIN].Font::SetCharSet( rFont.GetCharSet() ); - aSub[SW_LATIN].SvxFont::SetPropr( 100 ); - aSub[SW_LATIN].SetPropWidth( 100 ); - aSub[SW_LATIN].aSize = aSub[SW_LATIN].Font::GetSize(); - Size aTmpSize = aSub[SW_LATIN].aSize; - aTmpSize.Height() = pAttrSet->GetSize().GetHeight(); - aSub[SW_LATIN].SetSize( aTmpSize ); - aSub[SW_LATIN].Font::SetItalic( pAttrSet->GetPosture().GetPosture() ); - aSub[SW_LATIN].Font::SetWeight( pAttrSet->GetWeight().GetWeight() ); - aSub[SW_LATIN].SetLanguage( pAttrSet->GetLanguage().GetLanguage() ); - } - { // CJK - const SvxFontItem& rFont = pAttrSet->GetCJKFont(); - aSub[SW_CJK].SetFamily( rFont.GetFamily() ); - aSub[SW_CJK].Font::SetName( rFont.GetFamilyName() ); - aSub[SW_CJK].Font::SetStyleName( rFont.GetStyleName() ); - aSub[SW_CJK].Font::SetPitch( rFont.GetPitch() ); - aSub[SW_CJK].Font::SetCharSet( rFont.GetCharSet() ); - aSub[SW_CJK].SvxFont::SetPropr( 100 ); - aSub[SW_CJK].SetPropWidth( 100 ); - aSub[SW_CJK].aSize = aSub[SW_CJK].Font::GetSize(); - Size aTmpSize = aSub[SW_CJK].aSize; - aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); - aSub[SW_CJK].SetSize( aTmpSize ); - aSub[SW_CJK].Font::SetItalic( pAttrSet->GetCJKPosture().GetPosture() ); - aSub[SW_CJK].Font::SetWeight( pAttrSet->GetCJKWeight().GetWeight() ); - LanguageType eNewLang = pAttrSet->GetCJKLanguage().GetLanguage(); - aSub[SW_CJK].SetLanguage( eNewLang ); - aSub[SW_LATIN].SetCJKContextLanguage( eNewLang ); - aSub[SW_CJK].SetCJKContextLanguage( eNewLang ); - aSub[SW_CTL].SetCJKContextLanguage( eNewLang ); - } - { // CTL - const SvxFontItem& rFont = pAttrSet->GetCTLFont(); - aSub[SW_CTL].SetFamily( rFont.GetFamily() ); - aSub[SW_CTL].Font::SetName( rFont.GetFamilyName() ); - aSub[SW_CTL].Font::SetStyleName( rFont.GetStyleName() ); - aSub[SW_CTL].Font::SetPitch( rFont.GetPitch() ); - aSub[SW_CTL].Font::SetCharSet( rFont.GetCharSet() ); - aSub[SW_CTL].SvxFont::SetPropr( 100 ); - aSub[SW_CTL].SetPropWidth( 100 ); - aSub[SW_CTL].aSize = aSub[SW_CTL].Font::GetSize(); - Size aTmpSize = aSub[SW_CTL].aSize; - aTmpSize.Height() = pAttrSet->GetCTLSize().GetHeight(); - aSub[SW_CTL].SetSize( aTmpSize ); - aSub[SW_CTL].Font::SetItalic( pAttrSet->GetCTLPosture().GetPosture() ); - aSub[SW_CTL].Font::SetWeight( pAttrSet->GetCTLWeight().GetWeight() ); - aSub[SW_CTL].SetLanguage( pAttrSet->GetCTLLanguage().GetLanguage() ); - } - SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); - SetUnderColor( pAttrSet->GetUnderline().GetColor() ); - SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() ); - SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); - SetColor( pAttrSet->GetColor().GetValue() ); - SetTransparent( TRUE ); - SetAlign( ALIGN_BASELINE ); - SetOutline( pAttrSet->GetContour().GetValue() ); - SetShadow( pAttrSet->GetShadowed().GetValue() ); - SetRelief( (FontRelief)pAttrSet->GetCharRelief().GetValue() ); -#ifdef TEST_PROPWIDTH - //SetPropWidth( pAttrSet->GetPropWidth() ); - if( pAttrSet->GetShadowed().GetValue() ) - SetPropWidth(50); -#endif - SetAutoKern( pAttrSet->GetAutoKern().GetValue() ); - SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); - const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); - SetEscapement( rEsc.GetEsc() ); - if( aSub[SW_LATIN].IsEsc() ) - SetProportion( rEsc.GetProp() ); - SetCaseMap( pAttrSet->GetCaseMap().GetCaseMap() ); - SetFixKerning( pAttrSet->GetKerning().GetValue() ); - bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); - bBlink = pAttrSet->GetBlink().GetValue(); - const SfxPoolItem* pItem; - if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND, - TRUE, &pItem )) - pBackColor = new Color( ((const SvxBrushItem*)pItem)->GetColor() ); + const SvxFontItem& rFont = (SvxFontItem&) + rAttrHandler.GetDefault( RES_CHRATR_FONT ); + aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); + aSub[SW_LATIN].SetName( rFont.GetFamilyName() ); + aSub[SW_LATIN].SetStyleName( rFont.GetStyleName() ); + aSub[SW_LATIN].SetPitch( rFont.GetPitch() ); + aSub[SW_LATIN].SetCharSet( rFont.GetCharSet() ); + aSub[SW_LATIN].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_LATIN].aSize; + aTmpSize.Height() = ( (SvxFontHeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_FONTSIZE ) ).GetHeight(); + aSub[SW_LATIN].SetSize( aTmpSize ); + aSub[SW_LATIN].SetItalic( ( (SvxPostureItem&) + rAttrHandler.GetDefault( RES_CHRATR_POSTURE ) ).GetPosture() ); + aSub[SW_LATIN].SetWeight( ( (SvxWeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_WEIGHT ) ).GetWeight() ); + aSub[SW_LATIN].SetLanguage( ( (SvxLanguageItem&) + rAttrHandler.GetDefault( RES_CHRATR_LANGUAGE ) ).GetLanguage() ); } - else + { - aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; - Invalidate(); - bNoHyph = FALSE; - bBlink = FALSE; + const SvxFontItem& rFont = (SvxFontItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_FONT ); + aSub[SW_CJK].SetFamily( rFont.GetFamily() ); + aSub[SW_CJK].SetName( rFont.GetFamilyName() ); + aSub[SW_CJK].SetStyleName( rFont.GetStyleName() ); + aSub[SW_CJK].SetPitch( rFont.GetPitch() ); + aSub[SW_CJK].SetCharSet( rFont.GetCharSet() ); + aSub[SW_CJK].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_CJK].aSize; + aTmpSize.Height() = ( (SvxFontHeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_FONTSIZE ) ).GetHeight(); + aSub[SW_CJK].SetSize( aTmpSize ); + aSub[SW_CJK].SetItalic( ( (SvxPostureItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_POSTURE ) ).GetPosture() ); + aSub[SW_CJK].SetWeight( ( (SvxWeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_WEIGHT ) ).GetWeight() ); + LanguageType eNewLang = ( (SvxLanguageItem&) + rAttrHandler.GetDefault( RES_CHRATR_CJK_LANGUAGE ) ).GetLanguage(); + aSub[SW_CJK].SetLanguage( eNewLang ); + aSub[SW_LATIN].SetCJKContextLanguage( eNewLang ); + aSub[SW_CJK].SetCJKContextLanguage( eNewLang ); + aSub[SW_CTL].SetCJKContextLanguage( eNewLang ); } + + { + const SvxFontItem& rFont = (SvxFontItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_FONT ); + aSub[SW_CTL].SetFamily( rFont.GetFamily() ); + aSub[SW_CTL].SetName( rFont.GetFamilyName() ); + aSub[SW_CTL].SetStyleName( rFont.GetStyleName() ); + aSub[SW_CTL].SetPitch( rFont.GetPitch() ); + aSub[SW_CTL].SetCharSet( rFont.GetCharSet() ); + aSub[SW_CTL].SvxFont::SetPropr( 100 ); // 100% der FontSize + Size aTmpSize = aSub[SW_CTL].aSize; + aTmpSize.Height() = ( (SvxFontHeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_FONTSIZE ) ).GetHeight(); + aSub[SW_CTL].SetSize( aTmpSize ); + aSub[SW_CTL].SetItalic( ( (SvxPostureItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_POSTURE ) ).GetPosture() ); + aSub[SW_CTL].SetWeight( ( (SvxWeightItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_WEIGHT ) ).GetWeight() ); + aSub[SW_CTL].SetLanguage( ( (SvxLanguageItem&) + rAttrHandler.GetDefault( RES_CHRATR_CTL_LANGUAGE ) ).GetLanguage() ); + } + + SetUnderline( ( (SvxUnderlineItem&) + rAttrHandler.GetDefault( RES_CHRATR_UNDERLINE ) ).GetUnderline() ); + SetUnderColor( ( (SvxUnderlineItem&) + rAttrHandler.GetDefault( RES_CHRATR_UNDERLINE ) ).GetColor() ); + SetEmphasisMark( ( (SvxEmphasisMarkItem&) + rAttrHandler.GetDefault( RES_CHRATR_EMPHASIS_MARK ) ).GetEmphasisMark() ); + SetStrikeout( ( (SvxCrossedOutItem&) + rAttrHandler.GetDefault( RES_CHRATR_CROSSEDOUT ) ).GetStrikeout() ); + SetColor( ( (SvxColorItem&) + rAttrHandler.GetDefault( RES_CHRATR_COLOR ) ).GetValue() ); + SetTransparent( TRUE ); + SetAlign( ALIGN_BASELINE ); + SetOutline( ( (SvxContourItem&) + rAttrHandler.GetDefault( RES_CHRATR_CONTOUR ) ).GetValue() ); + SetShadow( ( (SvxShadowedItem&) + rAttrHandler.GetDefault( RES_CHRATR_SHADOWED ) ).GetValue() ); + SetRelief( (FontRelief)( (SvxCharReliefItem&) + rAttrHandler.GetDefault( RES_CHRATR_RELIEF ) ).GetValue() ); + SetAutoKern( ( (SvxAutoKernItem&) + rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ); + SetWordLineMode( ( (SvxWordLineModeItem&) + rAttrHandler.GetDefault( RES_CHRATR_WORDLINEMODE ) ).GetValue() ); + const SvxEscapementItem &rEsc = + (SvxEscapementItem&)rAttrHandler.GetDefault( RES_CHRATR_ESCAPEMENT ); + SetEscapement( rEsc.GetEsc() ); + if( aSub[SW_LATIN].IsEsc() ) + SetProportion( rEsc.GetProp() ); + SetCaseMap( ( (SvxCaseMapItem&) + rAttrHandler.GetDefault( RES_CHRATR_CASEMAP ) ).GetCaseMap() ); + SetFixKerning( ( (SvxKerningItem&) + rAttrHandler.GetDefault( RES_CHRATR_KERNING ) ).GetValue() ); + bNoHyph = FALSE; + bBlink = ( (SvxBlinkItem&)rAttrHandler.GetDefault( RES_CHRATR_BLINK ) ).GetValue(); + if( SFX_ITEM_SET == rAttrHandler.GetAttrSet()->GetItemState( + RES_CHRATR_BACKGROUND, TRUE ) ) + pBackColor = new Color( ( (const SvxBrushItem&) + rAttrHandler.GetDefault( RES_CHRATR_BACKGROUND ) ).GetColor() ); + const SvxTwoLinesItem& rTwoLinesItem = + (const SvxTwoLinesItem&)rAttrHandler.GetDefault( RES_CHRATR_TWO_LINES ); + if (! rTwoLinesItem.GetValue() ) + SetVertical( ( (SvxCharRotateItem&) + rAttrHandler.GetDefault( RES_CHRATR_ROTATE ) ).GetValue() ); + else + SetVertical( 0 ); + bPaintBlank = FALSE; bPaintWrong = FALSE; bURL = bGreyWave = bNoColReplace = FALSE; @@ -368,7 +393,7 @@ void SwFont::SetFnt( const SwAttrSet *pAttrSet ) } /************************************************************************* - * SwFont::SetFnt() + * SwFont::SetDiffFnt() *************************************************************************/ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) @@ -529,6 +554,14 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BLINK, TRUE, &pItem )) SetBlink( ((SvxBlinkItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_ROTATE, + TRUE, &pItem )) + SetVertical( ((SvxCharRotateItem*)pItem)->GetValue() ); + const SfxPoolItem* pTwoLinesItem = 0; + if( SFX_ITEM_SET == + pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, TRUE, &pTwoLinesItem )) + if ( ((SvxTwoLinesItem*)pTwoLinesItem)->GetValue() ) + SetVertical( 0 ); } else { @@ -652,6 +685,11 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() ); else pBackColor = NULL; + const SvxTwoLinesItem& rTwoLinesItem = pAttrSet->Get2Lines(); + if ( ! rTwoLinesItem.GetValue() ) + SetVertical( pAttrSet->GetCharRotate().GetValue() ); + else + SetVertical( 0 ); } SwFont::SwFont( const SwAttrHandler& rAttrHandler ) @@ -771,6 +809,13 @@ SwFont::SwFont( const SwAttrHandler& rAttrHandler ) rAttrHandler.GetDefault( RES_CHRATR_BACKGROUND ) ).GetColor() ); else pBackColor = NULL; + const SvxTwoLinesItem& rTwoLinesItem = + (SvxTwoLinesItem&)rAttrHandler.GetDefault( RES_CHRATR_TWO_LINES ); + if (! rTwoLinesItem.GetValue() ) + SetVertical( ( (SvxCharRotateItem&) + rAttrHandler.GetDefault( RES_CHRATR_ROTATE ) ).GetValue() ); + else + SetVertical( 0 ); } SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) -- cgit From 74dde9a111d619a3e88655235bbd7ee28a92e2aa Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Mon, 9 Apr 2001 09:44:17 +0000 Subject: New feature: Kana compression --- sw/source/core/txtnode/swfont.cxx | 82 +++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 34 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 1aa6fe4883c6..4f7c566a4437 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: ama $ $Date: 2001-03-19 15:53:35 $ + * last change: $Author: fme $ $Date: 2001-04-09 10:44:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1023,39 +1023,47 @@ USHORT SwSubFont::GetHeight( ViewShell *pSh, const OutputDevice *pOut ) /************************************************************************* * SwSubFont::_GetTxtSize() *************************************************************************/ - -Size SwSubFont::_GetTxtSize( ViewShell *pSh, - const OutputDevice *pOut, const XubString &rTxt, - const xub_StrLen nIdx, const xub_StrLen nLen ) +Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) { // Robust: Eigentlich sollte der Font bereits eingestellt sein, aber // sicher ist sicher ... if ( !pLastFont || pLastFont->GetOwner()!=pMagic || - !IsSameInstance( pOut->GetFont() ) ) - ChgFnt( pSh, (OutputDevice *)pOut ); + !IsSameInstance( rInf.GetpOut()->GetFont() ) ) + ChgFnt( rInf.GetShell(), rInf.GetpOut() ); Size aTxtSize; - xub_StrLen nLn = ( nLen==STRING_LEN ? rTxt.Len() : nLen ); + xub_StrLen nLn = ( rInf.GetLen() == STRING_LEN ? rInf.GetText().Len() + : rInf.GetLen() ); + rInf.SetLen( nLn ); if( IsCapital() && nLn ) - aTxtSize = GetCapitalSize( pSh, pOut, rTxt, nIdx, nLn ); + aTxtSize = GetCapitalSize( rInf ); else { SV_STAT( nGetTextSize ); + short nOldKern = rInf.GetKern(); + const XubString &rOldTxt = rInf.GetText(); + rInf.SetKern( CheckKerning() ); if ( !IsCaseMap() ) - aTxtSize = pLastFont->GetTextSize( pSh, pOut, rTxt, - nIdx, nLn, CheckKerning() ); + aTxtSize = pLastFont->GetTextSize( rInf ); else - aTxtSize = pLastFont->GetTextSize( pSh, pOut, CalcCaseMap( rTxt ), - nIdx, nLn, CheckKerning() ); + { + String aTmp = CalcCaseMap( rInf.GetText() ); + rInf.SetText( aTmp ); + aTxtSize = pLastFont->GetTextSize( rInf ); + } + rInf.SetKern( nOldKern ); + rInf.SetText( rOldTxt ); // 15142: Ein Wort laenger als eine Zeile, beim Zeilenumbruch // hochgestellt, muss seine effektive Hoehe melden. if( GetEscapement() ) { - const USHORT nAscent = pLastFont->GetAscent( pSh, pOut ); + const USHORT nAscent = pLastFont->GetAscent( rInf.GetShell(), + rInf.GetpOut() ); aTxtSize.Height() = (long)CalcEscHeight( (USHORT)aTxtSize.Height(), nAscent); } } + return aTxtSize; } @@ -1064,7 +1072,7 @@ Size SwSubFont::_GetTxtSize( ViewShell *pSh, *************************************************************************/ xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, - const XubString &rTxt, long nTextWidth, + const SwScriptInfo* pScript, const XubString &rTxt, long nTextWidth, const xub_StrLen nIdx, const xub_StrLen nLen ) { ChgFnt( pSh, (OutputDevice *)pOut ); @@ -1073,7 +1081,8 @@ xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, USHORT nLn = ( nLen == STRING_LEN ? rTxt.Len() : nLen ); if( aSub[nActual].IsCapital() && nLn ) - nTxtBreak = GetCapitalBreak( pSh, pOut, rTxt, nTextWidth, 0, nIdx, nLn ); + nTxtBreak = GetCapitalBreak( pSh, pOut, pScript, rTxt, nTextWidth, + 0, nIdx, nLn ); else { if ( !aSub[nActual].IsCaseMap() ) @@ -1090,9 +1099,9 @@ xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, * SwFont::GetTxtBreak() *************************************************************************/ -xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, - const OutputDevice *pOut, const XubString &rTxt, long nTextWidth, - xub_StrLen& rExtraCharPos, const xub_StrLen nIdx, const xub_StrLen nLen) +xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, + const SwScriptInfo* pScript, const XubString &rTxt, long nTextWidth, + xub_StrLen& rExtraCharPos, const xub_StrLen nIdx, const xub_StrLen nLen ) { // Robust ... if ( !pLastFont || pLastFont->GetOwner()!= aSub[nActual].pMagic ) @@ -1102,7 +1111,7 @@ xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, xub_StrLen nLn = ( nLen == STRING_LEN ? rTxt.Len() : nLen ); if( aSub[nActual].IsCapital() && nLn ) - nTxtBreak = GetCapitalBreak( pSh, pOut, rTxt, nTextWidth, + nTxtBreak = GetCapitalBreak( pSh, pOut, pScript, rTxt, nTextWidth, &rExtraCharPos, nIdx, nLn ); else { @@ -1181,8 +1190,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) if( rInf.GetSpecialUnderline() ) { static sal_Char __READONLY_DATA sDoubleSpace[] = " "; - Size aSize = _GetTxtSize( rInf.GetShell(), rInf.GetpOut(), rInf.GetText(), - rInf.GetIdx(), rInf.GetLen() ); + Size aSize = _GetTxtSize( rInf ); const XubString &rOldStr = rInf.GetText(); XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ); short nOldEsc = GetEscapement(); @@ -1304,27 +1312,33 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; * SwSubFont::_GetCrsrOfst() *************************************************************************/ -xub_StrLen SwSubFont::_GetCrsrOfst( ViewShell *pSh, - OutputDevice *pOut, const XubString &rTxt, - const USHORT nOfst, const xub_StrLen nIdx, - const xub_StrLen nLen, const short nSpaceAdd ) +xub_StrLen SwSubFont::_GetCrsrOfst( SwDrawTextInfo& rInf ) { if ( !pLastFont || pLastFont->GetOwner()!=pMagic ) - ChgFnt( pSh, pOut ); + ChgFnt( rInf.GetShell(), rInf.GetpOut() ); - xub_StrLen nLn = ( nLen==STRING_LEN ? rTxt.Len() : nLen ); + xub_StrLen nLn = rInf.GetLen() == STRING_LEN ? rInf.GetText().Len() + : rInf.GetLen(); + rInf.SetLen( nLn ); xub_StrLen nCrsr = 0; if( IsCapital() && nLn ) - nCrsr = GetCapitalCrsrOfst( pSh, pOut, rTxt, nOfst, nIdx, nLn, nSpaceAdd ); + nCrsr = GetCapitalCrsrOfst( rInf ); else { + const XubString &rOldTxt = rInf.GetText(); + short nOldKern = rInf.GetKern(); + rInf.SetKern( CheckKerning() ); SV_STAT( nGetTextSize ); if ( !IsCaseMap() ) - nCrsr = pLastFont->GetCrsrOfst( pOut, rTxt, nOfst, - nIdx, nLn, CheckKerning(), nSpaceAdd ); + nCrsr = pLastFont->GetCrsrOfst( rInf ); else - nCrsr = pLastFont->GetCrsrOfst( pOut, CalcCaseMap( rTxt ), nOfst, - nIdx, nLn, CheckKerning(), nSpaceAdd ); + { + String aTmp = CalcCaseMap( rInf.GetText() ); + rInf.SetText( aTmp ); + nCrsr = pLastFont->GetCrsrOfst( rInf ); + } + rInf.SetKern( nOldKern ); + rInf.SetText( rOldTxt ); } return nCrsr; } -- cgit From d64c79f405c241c193717a2e9feba510e7702b09 Mon Sep 17 00:00:00 2001 From: Andreas Martens Date: Tue, 10 Apr 2001 13:24:56 +0000 Subject: New: Asian punctuation kerning --- sw/source/core/txtnode/swfont.cxx | 43 ++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 4f7c566a4437..563bdf5804df 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: fme $ $Date: 2001-04-09 10:44:17 $ + * last change: $Author: ama $ $Date: 2001-04-10 14:24:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -148,6 +148,9 @@ #ifndef _SVX_TWOLINESITEM_HXX #include #endif +#ifndef _DOC_HXX +#include +#endif #ifndef _CHARATR_HXX #include @@ -359,8 +362,13 @@ void SwFont::SetFnt( const SwAttrHandler& rAttrHandler ) rAttrHandler.GetDefault( RES_CHRATR_SHADOWED ) ).GetValue() ); SetRelief( (FontRelief)( (SvxCharReliefItem&) rAttrHandler.GetDefault( RES_CHRATR_RELIEF ) ).GetValue() ); - SetAutoKern( ( (SvxAutoKernItem&) - rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ); + if( ((SvxAutoKernItem&) + rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ) + SetAutoKern( ( !rAttrHandler.GetDoc() || + !rAttrHandler.GetDoc()->IsKernAsianPunctuation() ) ? + KERNING_FONTSPECIFIC : KERNING_ASIAN ); + else + SetAutoKern( 0 ); SetWordLineMode( ( (SvxWordLineModeItem&) rAttrHandler.GetDefault( RES_CHRATR_WORDLINEMODE ) ).GetValue() ); const SvxEscapementItem &rEsc = @@ -396,7 +404,7 @@ void SwFont::SetFnt( const SwAttrHandler& rAttrHandler ) * SwFont::SetDiffFnt() *************************************************************************/ -void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) +void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, const SwDoc *pDoc ) { if( pAttrSet ) { @@ -529,7 +537,13 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet ) SetPropWidth(((SvxShadowedItem*)pItem)->GetValue() ? 50 : 100 ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_AUTOKERN, TRUE, &pItem )) - SetAutoKern( ((SvxAutoKernItem*)pItem)->GetValue() ); + { + if( ((SvxAutoKernItem*)pItem)->GetValue() ) + SetAutoKern( ( !pDoc || !pDoc->IsKernAsianPunctuation() ) ? + KERNING_FONTSPECIFIC : KERNING_ASIAN ); + else + SetAutoKern( 0 ); + } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_WORDLINEMODE, TRUE, &pItem )) SetWordLineMode( ((SvxWordLineModeItem*)pItem)->GetValue() ); @@ -598,7 +612,7 @@ SwFont::SwFont( const SwFont &rFont ) bBlink = rFont.bBlink; } -SwFont::SwFont( const SwAttrSet* pAttrSet ) +SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) { nActual = SW_LATIN; nToxCnt = nRefCnt = 0; @@ -671,7 +685,11 @@ SwFont::SwFont( const SwAttrSet* pAttrSet ) SetOutline( pAttrSet->GetContour().GetValue() ); SetShadow( pAttrSet->GetShadowed().GetValue() ); SetRelief( (FontRelief)pAttrSet->GetCharRelief().GetValue() ); - SetAutoKern( pAttrSet->GetAutoKern().GetValue() ); + if( pAttrSet->GetAutoKern().GetValue() ) + SetAutoKern( ( !pDoc || !pDoc->IsKernAsianPunctuation() ) ? + KERNING_FONTSPECIFIC : KERNING_ASIAN ); + else + SetAutoKern( 0 ); SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); SetEscapement( rEsc.GetEsc() ); @@ -790,8 +808,13 @@ SwFont::SwFont( const SwAttrHandler& rAttrHandler ) rAttrHandler.GetDefault( RES_CHRATR_SHADOWED ) ).GetValue() ); SetRelief( (FontRelief)( (SvxCharReliefItem&) rAttrHandler.GetDefault( RES_CHRATR_RELIEF ) ).GetValue() ); - SetAutoKern( ( (SvxAutoKernItem&) - rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ); + if( ((SvxAutoKernItem&) + rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ) + SetAutoKern( ( !rAttrHandler.GetDoc() || + !rAttrHandler.GetDoc()->IsKernAsianPunctuation() ) ? + KERNING_FONTSPECIFIC : KERNING_ASIAN ); + else + SetAutoKern( 0 ); SetWordLineMode( ( (SvxWordLineModeItem&) rAttrHandler.GetDefault( RES_CHRATR_WORDLINEMODE ) ).GetValue() ); const SvxEscapementItem &rEsc = -- cgit From c2326c54451b0255ec8371eada74bdd77770e098 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Wed, 18 Apr 2001 11:23:54 +0000 Subject: Fix: Escapements in rotated portions --- sw/source/core/txtnode/swfont.cxx | 98 ++++++++++++++++++++++++++++----------- 1 file changed, 72 insertions(+), 26 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 563bdf5804df..393391ee2a4e 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: ama $ $Date: 2001-04-10 14:24:56 $ + * last change: $Author: fme $ $Date: 2001-04-18 12:23:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1177,19 +1177,8 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) rInf.SetPos( aPos ); if( GetEscapement() ) - { - if( DFLT_ESC_AUTO_SUB == GetEscapement() ) - aPos.Y() += nOrgHeight - nOrgAscent - - pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + - pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); - else if( DFLT_ESC_AUTO_SUPER == GetEscapement() ) - { - aPos.Y() += pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); - aPos.Y() -= nOrgAscent; - } - else - aPos.Y() -= short( ((long)nOrgHeight * GetEscapement()) / 100L ); - } + CalcEsc( rInf, aPos ); + rInf.SetKern( CheckKerning() + rInf.GetSperren() ); if( IsCapital() ) @@ -1271,17 +1260,8 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) Point aPos( rInf.GetPos() ); if( GetEscapement() ) - { - if( DFLT_ESC_AUTO_SUB == GetEscapement() ) - aPos.Y() += nOrgHeight - nOrgAscent - - pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + - pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); - else if( DFLT_ESC_AUTO_SUPER == GetEscapement() ) - aPos.Y() += pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut())- - nOrgAscent; - else - aPos.Y() -= short( ((long)nOrgHeight * GetEscapement()) / 100L ); - } + CalcEsc( rInf, aPos ); + rInf.SetKern( CheckKerning() + rInf.GetSperren() ); if( IsCapital() ) @@ -1366,3 +1346,69 @@ xub_StrLen SwSubFont::_GetCrsrOfst( SwDrawTextInfo& rInf ) return nCrsr; } +/************************************************************************* + * SwSubFont::CalcEsc() + *************************************************************************/ + +void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) +{ + const USHORT nOrientation = GetOrientation(); + const USHORT nEscapement = GetEscapement(); + long nOfst; + + switch ( nEscapement ) + { + case DFLT_ESC_AUTO_SUB : + nOfst = nOrgHeight - nOrgAscent - + pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + + pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); + + switch ( nOrientation ) + { + case 0 : + rPos.Y() += nOfst; + break; + case 900 : + rPos.X() += nOfst; + break; + case 2700 : + rPos.X() -= nOfst; + break; + } + + break; + case DFLT_ESC_AUTO_SUPER : + nOfst = pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ) - + nOrgAscent; + + switch ( nOrientation ) + { + case 0 : + rPos.Y() += nOfst; + break; + case 900 : + rPos.X() += nOfst; + break; + case 2700 : + rPos.X() -= nOfst; + break; + } + + break; + default : + nOfst = ((long)nOrgHeight * GetEscapement()) / 100L; + + switch ( nOrientation ) + { + case 0 : + rPos.Y() -= nOfst; + break; + case 900 : + rPos.X() -= nOfst; + break; + case 2700 : + rPos.X() += nOfst; + break; + } + } +} -- cgit From b2e8c957501d518113303fb8afa86848b8a928f7 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 19 Apr 2001 11:53:59 +0000 Subject: Fix: Escapement positioning --- sw/source/core/txtnode/swfont.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 393391ee2a4e..3a9b1391df34 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: fme $ $Date: 2001-04-18 12:23:54 $ + * last change: $Author: fme $ $Date: 2001-04-19 12:53:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1352,18 +1352,16 @@ xub_StrLen SwSubFont::_GetCrsrOfst( SwDrawTextInfo& rInf ) void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) { - const USHORT nOrientation = GetOrientation(); - const USHORT nEscapement = GetEscapement(); long nOfst; - switch ( nEscapement ) + switch ( GetEscapement() ) { case DFLT_ESC_AUTO_SUB : nOfst = nOrgHeight - nOrgAscent - pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); - switch ( nOrientation ) + switch ( GetOrientation() ) { case 0 : rPos.Y() += nOfst; @@ -1381,7 +1379,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) nOfst = pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ) - nOrgAscent; - switch ( nOrientation ) + switch ( GetOrientation() ) { case 0 : rPos.Y() += nOfst; @@ -1398,7 +1396,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) default : nOfst = ((long)nOrgHeight * GetEscapement()) / 100L; - switch ( nOrientation ) + switch ( GetOrientation() ) { case 0 : rPos.Y() -= nOfst; -- cgit From 9b7aa8071c97a67821078b45b10aea4e9431330f Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Fri, 6 Jul 2001 14:20:58 +0000 Subject: Fix #89331#: Attributes for numbering/bullet font --- sw/source/core/txtnode/swfont.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 3a9b1391df34..7b770ff05096 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: fme $ $Date: 2001-04-19 12:53:59 $ + * last change: $Author: fme $ $Date: 2001-07-06 15:20:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -406,6 +406,10 @@ void SwFont::SetFnt( const SwAttrHandler& rAttrHandler ) void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, const SwDoc *pDoc ) { + delete pBackColor; + pBackColor = NULL; + + if( pAttrSet ) { const SfxPoolItem* pItem; @@ -571,6 +575,11 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, const SwDoc *pDoc ) if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_ROTATE, TRUE, &pItem )) SetVertical( ((SvxCharRotateItem*)pItem)->GetValue() ); + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND, + TRUE, &pItem )) + pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() ); + else + pBackColor = NULL; const SfxPoolItem* pTwoLinesItem = 0; if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, TRUE, &pTwoLinesItem )) -- cgit From 3702c559bb6b23732b24dcc7994ae2333f1c4544 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 12 Jul 2001 10:21:31 +0000 Subject: Opt #89492#: Store the default font for the paragraph --- sw/source/core/txtnode/swfont.cxx | 286 +------------------------------------- 1 file changed, 2 insertions(+), 284 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 7b770ff05096..c4df79ca6c1b 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: fme $ $Date: 2001-07-06 15:20:58 $ + * last change: $Author: fme $ $Date: 2001-07-12 11:21:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -158,9 +158,6 @@ #ifndef _SWATRSET_HXX //autogen #include #endif -#ifndef _ATRHNDL_HXX -#include -#endif #include "viewsh.hxx" // Bildschirmabgleich #include "swfont.hxx" @@ -252,154 +249,6 @@ USHORT SwSubFont::CalcEscAscent( const USHORT nOldAscent ) const return nOrgAscent; } -/************************************************************************* - * SwSubFont::SetFnt() - *************************************************************************/ - -void SwSubFont::SetFnt( const SvxFont &rFont ) -{ - *((SvxFont*)this) = rFont; - if ( 100 == GetPropr() ) - aSize = Font::GetSize(); - else - aSize = Size( (long) Font::GetSize().Width() * 100L / GetPropr(), - (long) Font::GetSize().Height() * 100L / GetPropr() ); - pMagic = 0; - ASSERT( IsTransparent(), "SwSubFont: Transparent revolution" ); -} - -/************************************************************************* - * SwFont::SetFnt() - *************************************************************************/ - -void SwFont::SetFnt( const SwAttrHandler& rAttrHandler ) -{ - delete pBackColor; - pBackColor = NULL; - - { - const SvxFontItem& rFont = (SvxFontItem&) - rAttrHandler.GetDefault( RES_CHRATR_FONT ); - aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); - aSub[SW_LATIN].SetName( rFont.GetFamilyName() ); - aSub[SW_LATIN].SetStyleName( rFont.GetStyleName() ); - aSub[SW_LATIN].SetPitch( rFont.GetPitch() ); - aSub[SW_LATIN].SetCharSet( rFont.GetCharSet() ); - aSub[SW_LATIN].SvxFont::SetPropr( 100 ); // 100% der FontSize - Size aTmpSize = aSub[SW_LATIN].aSize; - aTmpSize.Height() = ( (SvxFontHeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_FONTSIZE ) ).GetHeight(); - aSub[SW_LATIN].SetSize( aTmpSize ); - aSub[SW_LATIN].SetItalic( ( (SvxPostureItem&) - rAttrHandler.GetDefault( RES_CHRATR_POSTURE ) ).GetPosture() ); - aSub[SW_LATIN].SetWeight( ( (SvxWeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_WEIGHT ) ).GetWeight() ); - aSub[SW_LATIN].SetLanguage( ( (SvxLanguageItem&) - rAttrHandler.GetDefault( RES_CHRATR_LANGUAGE ) ).GetLanguage() ); - } - - { - const SvxFontItem& rFont = (SvxFontItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_FONT ); - aSub[SW_CJK].SetFamily( rFont.GetFamily() ); - aSub[SW_CJK].SetName( rFont.GetFamilyName() ); - aSub[SW_CJK].SetStyleName( rFont.GetStyleName() ); - aSub[SW_CJK].SetPitch( rFont.GetPitch() ); - aSub[SW_CJK].SetCharSet( rFont.GetCharSet() ); - aSub[SW_CJK].SvxFont::SetPropr( 100 ); // 100% der FontSize - Size aTmpSize = aSub[SW_CJK].aSize; - aTmpSize.Height() = ( (SvxFontHeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_FONTSIZE ) ).GetHeight(); - aSub[SW_CJK].SetSize( aTmpSize ); - aSub[SW_CJK].SetItalic( ( (SvxPostureItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_POSTURE ) ).GetPosture() ); - aSub[SW_CJK].SetWeight( ( (SvxWeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_WEIGHT ) ).GetWeight() ); - LanguageType eNewLang = ( (SvxLanguageItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_LANGUAGE ) ).GetLanguage(); - aSub[SW_CJK].SetLanguage( eNewLang ); - aSub[SW_LATIN].SetCJKContextLanguage( eNewLang ); - aSub[SW_CJK].SetCJKContextLanguage( eNewLang ); - aSub[SW_CTL].SetCJKContextLanguage( eNewLang ); - } - - { - const SvxFontItem& rFont = (SvxFontItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_FONT ); - aSub[SW_CTL].SetFamily( rFont.GetFamily() ); - aSub[SW_CTL].SetName( rFont.GetFamilyName() ); - aSub[SW_CTL].SetStyleName( rFont.GetStyleName() ); - aSub[SW_CTL].SetPitch( rFont.GetPitch() ); - aSub[SW_CTL].SetCharSet( rFont.GetCharSet() ); - aSub[SW_CTL].SvxFont::SetPropr( 100 ); // 100% der FontSize - Size aTmpSize = aSub[SW_CTL].aSize; - aTmpSize.Height() = ( (SvxFontHeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_FONTSIZE ) ).GetHeight(); - aSub[SW_CTL].SetSize( aTmpSize ); - aSub[SW_CTL].SetItalic( ( (SvxPostureItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_POSTURE ) ).GetPosture() ); - aSub[SW_CTL].SetWeight( ( (SvxWeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_WEIGHT ) ).GetWeight() ); - aSub[SW_CTL].SetLanguage( ( (SvxLanguageItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_LANGUAGE ) ).GetLanguage() ); - } - - SetUnderline( ( (SvxUnderlineItem&) - rAttrHandler.GetDefault( RES_CHRATR_UNDERLINE ) ).GetUnderline() ); - SetUnderColor( ( (SvxUnderlineItem&) - rAttrHandler.GetDefault( RES_CHRATR_UNDERLINE ) ).GetColor() ); - SetEmphasisMark( ( (SvxEmphasisMarkItem&) - rAttrHandler.GetDefault( RES_CHRATR_EMPHASIS_MARK ) ).GetEmphasisMark() ); - SetStrikeout( ( (SvxCrossedOutItem&) - rAttrHandler.GetDefault( RES_CHRATR_CROSSEDOUT ) ).GetStrikeout() ); - SetColor( ( (SvxColorItem&) - rAttrHandler.GetDefault( RES_CHRATR_COLOR ) ).GetValue() ); - SetTransparent( TRUE ); - SetAlign( ALIGN_BASELINE ); - SetOutline( ( (SvxContourItem&) - rAttrHandler.GetDefault( RES_CHRATR_CONTOUR ) ).GetValue() ); - SetShadow( ( (SvxShadowedItem&) - rAttrHandler.GetDefault( RES_CHRATR_SHADOWED ) ).GetValue() ); - SetRelief( (FontRelief)( (SvxCharReliefItem&) - rAttrHandler.GetDefault( RES_CHRATR_RELIEF ) ).GetValue() ); - if( ((SvxAutoKernItem&) - rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ) - SetAutoKern( ( !rAttrHandler.GetDoc() || - !rAttrHandler.GetDoc()->IsKernAsianPunctuation() ) ? - KERNING_FONTSPECIFIC : KERNING_ASIAN ); - else - SetAutoKern( 0 ); - SetWordLineMode( ( (SvxWordLineModeItem&) - rAttrHandler.GetDefault( RES_CHRATR_WORDLINEMODE ) ).GetValue() ); - const SvxEscapementItem &rEsc = - (SvxEscapementItem&)rAttrHandler.GetDefault( RES_CHRATR_ESCAPEMENT ); - SetEscapement( rEsc.GetEsc() ); - if( aSub[SW_LATIN].IsEsc() ) - SetProportion( rEsc.GetProp() ); - SetCaseMap( ( (SvxCaseMapItem&) - rAttrHandler.GetDefault( RES_CHRATR_CASEMAP ) ).GetCaseMap() ); - SetFixKerning( ( (SvxKerningItem&) - rAttrHandler.GetDefault( RES_CHRATR_KERNING ) ).GetValue() ); - bNoHyph = FALSE; - bBlink = ( (SvxBlinkItem&)rAttrHandler.GetDefault( RES_CHRATR_BLINK ) ).GetValue(); - if( SFX_ITEM_SET == rAttrHandler.GetAttrSet()->GetItemState( - RES_CHRATR_BACKGROUND, TRUE ) ) - pBackColor = new Color( ( (const SvxBrushItem&) - rAttrHandler.GetDefault( RES_CHRATR_BACKGROUND ) ).GetColor() ); - const SvxTwoLinesItem& rTwoLinesItem = - (const SvxTwoLinesItem&)rAttrHandler.GetDefault( RES_CHRATR_TWO_LINES ); - if (! rTwoLinesItem.GetValue() ) - SetVertical( ( (SvxCharRotateItem&) - rAttrHandler.GetDefault( RES_CHRATR_ROTATE ) ).GetValue() ); - else - SetVertical( 0 ); - - bPaintBlank = FALSE; - bPaintWrong = FALSE; - bURL = bGreyWave = bNoColReplace = FALSE; - ASSERT( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" ); -} - /************************************************************************* * SwFont::SetDiffFnt() *************************************************************************/ @@ -719,137 +568,6 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) SetVertical( 0 ); } -SwFont::SwFont( const SwAttrHandler& rAttrHandler ) -{ - nActual = SW_LATIN; - nToxCnt = nRefCnt = 0; - bPaintBlank = FALSE; - bPaintWrong = FALSE; - bURL = FALSE; - bGreyWave = FALSE; - bNoColReplace = FALSE; - bNoHyph = ( (SvxNoHyphenItem&) - rAttrHandler.GetDefault( RES_CHRATR_NOHYPHEN ) ).GetValue(); - bBlink = ( (SvxBlinkItem&) - rAttrHandler.GetDefault( RES_CHRATR_BLINK ) ).GetValue(); - { - const SvxFontItem& rFont = (SvxFontItem&) - rAttrHandler.GetDefault( RES_CHRATR_FONT ); - aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); - aSub[SW_LATIN].SetName( rFont.GetFamilyName() ); - aSub[SW_LATIN].SetStyleName( rFont.GetStyleName() ); - aSub[SW_LATIN].SetPitch( rFont.GetPitch() ); - aSub[SW_LATIN].SetCharSet( rFont.GetCharSet() ); - aSub[SW_LATIN].SvxFont::SetPropr( 100 ); // 100% der FontSize - Size aTmpSize = aSub[SW_LATIN].aSize; - aTmpSize.Height() = ( (SvxFontHeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_FONTSIZE ) ).GetHeight(); - aSub[SW_LATIN].SetSize( aTmpSize ); - aSub[SW_LATIN].SetItalic( ( (SvxPostureItem&) - rAttrHandler.GetDefault( RES_CHRATR_POSTURE ) ).GetPosture() ); - aSub[SW_LATIN].SetWeight( ( (SvxWeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_WEIGHT ) ).GetWeight() ); - aSub[SW_LATIN].SetLanguage( ( (SvxLanguageItem&) - rAttrHandler.GetDefault( RES_CHRATR_LANGUAGE ) ).GetLanguage() ); - } - - { - const SvxFontItem& rFont = (SvxFontItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_FONT ); - aSub[SW_CJK].SetFamily( rFont.GetFamily() ); - aSub[SW_CJK].SetName( rFont.GetFamilyName() ); - aSub[SW_CJK].SetStyleName( rFont.GetStyleName() ); - aSub[SW_CJK].SetPitch( rFont.GetPitch() ); - aSub[SW_CJK].SetCharSet( rFont.GetCharSet() ); - aSub[SW_CJK].SvxFont::SetPropr( 100 ); // 100% der FontSize - Size aTmpSize = aSub[SW_CJK].aSize; - aTmpSize.Height() = ( (SvxFontHeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_FONTSIZE ) ).GetHeight(); - aSub[SW_CJK].SetSize( aTmpSize ); - aSub[SW_CJK].SetItalic( ( (SvxPostureItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_POSTURE ) ).GetPosture() ); - aSub[SW_CJK].SetWeight( ( (SvxWeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_WEIGHT ) ).GetWeight() ); - LanguageType eNewLang = ( (SvxLanguageItem&) - rAttrHandler.GetDefault( RES_CHRATR_CJK_LANGUAGE ) ).GetLanguage(); - aSub[SW_CJK].SetLanguage( eNewLang ); - aSub[SW_LATIN].SetCJKContextLanguage( eNewLang ); - aSub[SW_CJK].SetCJKContextLanguage( eNewLang ); - aSub[SW_CTL].SetCJKContextLanguage( eNewLang ); - } - - { - const SvxFontItem& rFont = (SvxFontItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_FONT ); - aSub[SW_CTL].SetFamily( rFont.GetFamily() ); - aSub[SW_CTL].SetName( rFont.GetFamilyName() ); - aSub[SW_CTL].SetStyleName( rFont.GetStyleName() ); - aSub[SW_CTL].SetPitch( rFont.GetPitch() ); - aSub[SW_CTL].SetCharSet( rFont.GetCharSet() ); - aSub[SW_CTL].SvxFont::SetPropr( 100 ); // 100% der FontSize - Size aTmpSize = aSub[SW_CTL].aSize; - aTmpSize.Height() = ( (SvxFontHeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_FONTSIZE ) ).GetHeight(); - aSub[SW_CTL].SetSize( aTmpSize ); - aSub[SW_CTL].SetItalic( ( (SvxPostureItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_POSTURE ) ).GetPosture() ); - aSub[SW_CTL].SetWeight( ( (SvxWeightItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_WEIGHT ) ).GetWeight() ); - aSub[SW_CTL].SetLanguage( ( (SvxLanguageItem&) - rAttrHandler.GetDefault( RES_CHRATR_CTL_LANGUAGE ) ).GetLanguage() ); - } - - SetUnderline( ( (SvxUnderlineItem&) - rAttrHandler.GetDefault( RES_CHRATR_UNDERLINE ) ).GetUnderline() ); - SetUnderColor( ( (SvxUnderlineItem&) - rAttrHandler.GetDefault( RES_CHRATR_UNDERLINE ) ).GetColor() ); - SetEmphasisMark( ( (SvxEmphasisMarkItem&) - rAttrHandler.GetDefault( RES_CHRATR_EMPHASIS_MARK ) ).GetEmphasisMark() ); - SetStrikeout( ( (SvxCrossedOutItem&) - rAttrHandler.GetDefault( RES_CHRATR_CROSSEDOUT ) ).GetStrikeout() ); - SetColor( ( (SvxColorItem&) - rAttrHandler.GetDefault( RES_CHRATR_COLOR ) ).GetValue() ); - SetTransparent( TRUE ); - SetAlign( ALIGN_BASELINE ); - SetOutline( ( (SvxContourItem&) - rAttrHandler.GetDefault( RES_CHRATR_CONTOUR ) ).GetValue() ); - SetShadow( ( (SvxShadowedItem&) - rAttrHandler.GetDefault( RES_CHRATR_SHADOWED ) ).GetValue() ); - SetRelief( (FontRelief)( (SvxCharReliefItem&) - rAttrHandler.GetDefault( RES_CHRATR_RELIEF ) ).GetValue() ); - if( ((SvxAutoKernItem&) - rAttrHandler.GetDefault( RES_CHRATR_AUTOKERN ) ).GetValue() ) - SetAutoKern( ( !rAttrHandler.GetDoc() || - !rAttrHandler.GetDoc()->IsKernAsianPunctuation() ) ? - KERNING_FONTSPECIFIC : KERNING_ASIAN ); - else - SetAutoKern( 0 ); - SetWordLineMode( ( (SvxWordLineModeItem&) - rAttrHandler.GetDefault( RES_CHRATR_WORDLINEMODE ) ).GetValue() ); - const SvxEscapementItem &rEsc = - (SvxEscapementItem&)rAttrHandler.GetDefault( RES_CHRATR_ESCAPEMENT ); - SetEscapement( rEsc.GetEsc() ); - if( aSub[SW_LATIN].IsEsc() ) - SetProportion( rEsc.GetProp() ); - SetCaseMap( ( (SvxCaseMapItem&) - rAttrHandler.GetDefault( RES_CHRATR_CASEMAP ) ).GetCaseMap() ); - SetFixKerning( ( (SvxKerningItem&) - rAttrHandler.GetDefault( RES_CHRATR_KERNING ) ).GetValue() ); - if( SFX_ITEM_SET == rAttrHandler.GetAttrSet()->GetItemState( - RES_CHRATR_BACKGROUND, TRUE ) ) - pBackColor = new Color( ( (SvxBrushItem&) - rAttrHandler.GetDefault( RES_CHRATR_BACKGROUND ) ).GetColor() ); - else - pBackColor = NULL; - const SvxTwoLinesItem& rTwoLinesItem = - (SvxTwoLinesItem&)rAttrHandler.GetDefault( RES_CHRATR_TWO_LINES ); - if (! rTwoLinesItem.GetValue() ) - SetVertical( ( (SvxCharRotateItem&) - rAttrHandler.GetDefault( RES_CHRATR_ROTATE ) ).GetValue() ); - else - SetVertical( 0 ); -} - SwSubFont& SwSubFont::operator=( const SwSubFont &rFont ) { SvxFont::operator=( rFont ); -- cgit From 86d39652e7d54c99dbf1f0609c5c8df2263d72b1 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Fri, 31 Aug 2001 05:22:48 +0000 Subject: New: Vertical text formatting --- sw/source/core/txtnode/swfont.cxx | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index c4df79ca6c1b..0e6f9fed5b51 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: fme $ $Date: 2001-07-12 11:21:31 $ + * last change: $Author: fme $ $Date: 2001-08-31 06:22:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -203,6 +203,34 @@ Color* SwFont::XChgBackColor( Color* pNewColor ) return pRet; } +#ifdef VERTICAL_LAYOUT +void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) +{ + // map direction if frame has vertical layout + if ( bVertFormat ) + { + switch ( nDir ) + { + case 0 : + nDir = 2700; + break; + case 900 : + case 2700 : + nDir = 0; + break; + } + } + + if( nDir != aSub[0].GetOrientation() ) + { + bFntChg = TRUE; + aSub[0].SetVertical( nDir ); + aSub[1].SetVertical( nDir ); + aSub[2].SetVertical( nDir ); + } +} +#endif + /************************************************************************* Escapement: frEsc: Fraction, Grad des Escapements -- cgit From de51626380a31fe0c90b1e7bc1fd5b1d1c5e214b Mon Sep 17 00:00:00 2001 From: jp Date: Thu, 27 Sep 2001 16:23:38 +0000 Subject: Task #91873#: remove usage of GetSystemLanguage and other system realted methods --- sw/source/core/txtnode/swfont.cxx | 44 +++++++++++++++------------------------ 1 file changed, 17 insertions(+), 27 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 0e6f9fed5b51..eddd2b96c853 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: fme $ $Date: 2001-08-31 06:22:48 $ + * last change: $Author: jp $ $Date: 2001-09-27 17:15:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,11 +65,10 @@ #pragma hdrstop -#include "hintids.hxx" - -#ifndef _SYSTEM_HXX //autogen -#include +#ifndef _HINTIDS_HXX +#include #endif + #ifndef _OUTDEV_HXX //autogen #include #endif @@ -158,11 +157,18 @@ #ifndef _SWATRSET_HXX //autogen #include #endif - -#include "viewsh.hxx" // Bildschirmabgleich -#include "swfont.hxx" -#include "fntcache.hxx" // FontCache -#include "drawfont.hxx" // SwDrawTextInfo +#ifndef _VIEWSH_HXX +#include // Bildschirmabgleich +#endif +#ifndef _SWFONT_HXX +#include +#endif +#ifndef _FNTCACHE_HXX +#include // FontCache +#endif +#ifndef _DRAWFONT_HXX +#include // SwDrawTextInfo +#endif #if defined(WIN) || defined(WNT) || defined(PM2) #define FNT_LEADING_HACK @@ -650,22 +656,6 @@ BOOL SwSubFont::IsSymbol( ViewShell *pSh ) return aFntAccess.Get()->IsSymbol(); } -/************************************************************************* - * SwFont::SetSystemLang() - *************************************************************************/ - -LanguageType GetSystemLang( ) -{ - // Hier wird bei LANGUAGE_SYSTEM die Sprache ermittelt. - // 1.Versuch: Was sagt die Applikation? - LanguageType eTmp = SvxLocaleToLanguage( GetAppLocaleData().getLocale() ); - if ( ( eTmp == LANGUAGE_SYSTEM ) && - // Was sagt die Systemumgebung? - ( (eTmp = ::GetSystemLanguage()) == LANGUAGE_SYSTEM ) ) - eTmp = LANGUAGE_DONTKNOW; // also unbekannt - return eTmp; -} - /************************************************************************* * SwSubFont::ChgFnt() *************************************************************************/ -- cgit From 65fe6f6a46264fb2f94e04b02e810fbf281db497 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Tue, 2 Oct 2001 12:51:59 +0000 Subject: Fix #91787#: Smooth underlining for portions with different font sizes --- sw/source/core/txtnode/swfont.cxx | 75 +++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 30 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index eddd2b96c853..553f97026ad1 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: jp $ $Date: 2001-09-27 17:15:37 $ + * last change: $Author: fme $ $Date: 2001-10-02 13:51:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -150,6 +150,9 @@ #ifndef _DOC_HXX #include #endif +#ifndef _WINDOW_HXX //autogen +#include +#endif #ifndef _CHARATR_HXX #include @@ -907,11 +910,33 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) rInf.SetLen( nLn ); FontUnderline nOldUnder; + SwFont* pUnderFnt = 0; - if( rInf.GetSpecialUnderline() ) + if( rInf.GetUnderFnt() ) { nOldUnder = GetUnderline(); SetUnderline( UNDERLINE_NONE ); + pUnderFnt = rInf.GetUnderFnt(); + + // !!! In case the font color and the underline color are both + // COL_AUTO, we set the color + if( COL_AUTO == GetColor().GetColor() ) + { + ViewShell* pSh = rInf.GetShell(); + ColorData nNewColor; + if( pSh && pSh->GetWin() ) + { + const StyleSettings& rS = pSh->GetWin()->GetSettings().GetStyleSettings(); + nNewColor = rInf.GetDarkBack() + ? COL_WHITE : rS.GetWindowTextColor().GetColor(); + } + else + nNewColor = rInf.GetDarkBack() ? COL_WHITE : COL_BLACK; + + pUnderFnt->SetColor( Color( nNewColor ) ); + } + else + pUnderFnt->SetColor( GetColor() ); } if( !pLastFont || pLastFont->GetOwner()!=pMagic ) @@ -944,16 +969,13 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) } rInf.SetPos( rOld ); - if( rInf.GetSpecialUnderline() ) + if( rInf.GetUnderFnt() && nOldUnder != UNDERLINE_NONE ) { static sal_Char __READONLY_DATA sDoubleSpace[] = " "; Size aSize = _GetTxtSize( rInf ); const XubString &rOldStr = rInf.GetText(); XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ); - short nOldEsc = GetEscapement(); - BYTE nOldProp = GetPropr(); - BOOL bOldWord = IsWordLineMode(); - SetWordLineMode( FALSE ); + xub_StrLen nOldIdx = rInf.GetIdx(); xub_StrLen nOldLen = rInf.GetLen(); long nSpace = 0; @@ -970,19 +992,16 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; rInf.SetText( aStr ); rInf.SetIdx( 0 ); rInf.SetLen( 2 ); - SetProportion( 100 ); - SetEscapement( 0 ); SetUnderline( nOldUnder ); rInf.SetWidth( USHORT(aSize.Width() + nSpace) ); - rInf.SetSpecialUnderline( FALSE ); - _DrawStretchText( rInf ); - rInf.SetSpecialUnderline( TRUE ); + rInf.SetUnderFnt( 0 ); + + pUnderFnt->_DrawStretchText( rInf ); + + rInf.SetUnderFnt( pUnderFnt ); rInf.SetText( rOldStr ); - SetProportion( nOldProp ); - SetEscapement( nOldEsc ); rInf.SetIdx( nOldIdx ); rInf.SetLen( nOldLen ); - SetWordLineMode( bOldWord ); } } @@ -992,11 +1011,13 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) return; FontUnderline nOldUnder; + SwFont* pUnderFnt = 0; - if( rInf.GetSpecialUnderline() ) + if( rInf.GetUnderFnt() ) { nOldUnder = GetUnderline(); SetUnderline( UNDERLINE_NONE ); + pUnderFnt = rInf.GetUnderFnt(); } if ( !pLastFont || pLastFont->GetOwner() != pMagic ) @@ -1027,32 +1048,25 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) rInf.GetText() ), rInf.GetIdx(), rInf.GetLen() ); } - if( rInf.GetSpecialUnderline() ) + if( rInf.GetUnderFnt() && nOldUnder != UNDERLINE_NONE ) { static sal_Char __READONLY_DATA sDoubleSpace[] = " "; const XubString &rOldStr = rInf.GetText(); XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ); - short nOldEsc = GetEscapement(); - BYTE nOldProp = GetPropr(); - BOOL bOldWord = IsWordLineMode(); - SetWordLineMode( FALSE ); xub_StrLen nOldIdx = rInf.GetIdx(); xub_StrLen nOldLen = rInf.GetLen(); rInf.SetText( aStr ); rInf.SetIdx( 0 ); rInf.SetLen( 2 ); - SetProportion( 100 ); - SetEscapement( 0 ); SetUnderline( nOldUnder ); - rInf.SetSpecialUnderline( FALSE ); - _DrawStretchText( rInf ); - rInf.SetSpecialUnderline( TRUE ); + rInf.SetUnderFnt( 0 ); + + pUnderFnt->_DrawStretchText( rInf ); + + rInf.SetUnderFnt( pUnderFnt ); rInf.SetText( rOldStr ); - SetProportion( nOldProp ); - SetEscapement( nOldEsc ); rInf.SetIdx( nOldIdx ); rInf.SetLen( nOldLen ); - SetWordLineMode( bOldWord ); } } @@ -1155,3 +1169,4 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) } } } + -- cgit From 8509df8d033b0780e883be2eaca778267901688f Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Mon, 29 Oct 2001 10:23:31 +0000 Subject: Chg: Vertical Formatting - Red wave lines --- sw/source/core/txtnode/swfont.cxx | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 553f97026ad1..4abc24d9b804 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: fme $ $Date: 2001-10-02 13:51:59 $ + * last change: $Author: fme $ $Date: 2001-10-29 11:23:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -172,6 +172,11 @@ #ifndef _DRAWFONT_HXX #include // SwDrawTextInfo #endif +#ifdef VERTICAL_LAYOUT +#ifndef _TXTFRM_HXX +#include // SwTxtFrm +#endif +#endif #if defined(WIN) || defined(WNT) || defined(PM2) #define FNT_LEADING_HACK @@ -213,9 +218,9 @@ Color* SwFont::XChgBackColor( Color* pNewColor ) } #ifdef VERTICAL_LAYOUT -void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) + +USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) { - // map direction if frame has vertical layout if ( bVertFormat ) { switch ( nDir ) @@ -229,6 +234,13 @@ void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) break; } } + return nDir; +} + +void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) +{ + // map direction if frame has vertical layout + nDir = MapDirection( nDir, bVertFormat ); if( nDir != aSub[0].GetOrientation() ) { @@ -1040,12 +1052,24 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) else { SV_STAT( nDrawStretchText ); + +#ifdef VERTICAL_LAYOUT + const Point &rOld = rInf.GetPos(); + rInf.SetPos( aPos ); + if ( rInf.GetFrm() && rInf.GetFrm()->IsVertical() ) + rInf.GetFrm()->SwitchHorizontalToVertical( aPos ); +#endif + if ( !IsCaseMap() ) rInf.GetOut().DrawStretchText( aPos, rInf.GetWidth(), rInf.GetText(), rInf.GetIdx(), rInf.GetLen() ); else rInf.GetOut().DrawStretchText( aPos, rInf.GetWidth(), CalcCaseMap( rInf.GetText() ), rInf.GetIdx(), rInf.GetLen() ); + +#ifdef VERTICAL_LAYOUT + rInf.SetPos( rOld ); +#endif } if( rInf.GetUnderFnt() && nOldUnder != UNDERLINE_NONE ) -- cgit From 15c62dd4739423e329e34aad3e7b217e45098e08 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Mon, 29 Oct 2001 15:45:52 +0000 Subject: Chg: Vertical Formatting - Rotated Portions --- sw/source/core/txtnode/swfont.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 4abc24d9b804..847f01fae45f 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: fme $ $Date: 2001-10-29 11:23:31 $ + * last change: $Author: fme $ $Date: 2001-10-29 16:45:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -229,9 +229,16 @@ USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) nDir = 2700; break; case 900 : - case 2700 : nDir = 0; break; + case 2700 : + nDir = 1800; + break; +#ifdef DEBUG + default : + ASSERT( sal_False, "Unsupported direction" ); + break; +#endif } } return nDir; -- cgit From 2efbf843bd3bc16e45e9ebf0b8370279f07b47c7 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Tue, 30 Oct 2001 08:37:25 +0000 Subject: Chg: Vertical Formatting - Map directions in vertical environment --- sw/source/core/txtnode/swfont.cxx | 50 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 847f01fae45f..e6e16e6a3322 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: fme $ $Date: 2001-10-29 16:45:52 $ + * last change: $Author: fme $ $Date: 2001-10-30 09:37:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -219,6 +219,7 @@ Color* SwFont::XChgBackColor( Color* pNewColor ) #ifdef VERTICAL_LAYOUT +// maps directions for vertical layout USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) { if ( bVertFormat ) @@ -244,6 +245,33 @@ USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) return nDir; } +// maps the absolute direction set at the font to its logical conterpart +// in the rotated environment +USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat ) +{ + if ( bVertFormat ) + { + switch ( nDir ) + { + case 0 : + nDir = 900; + break; + case 1800 : + nDir = 2700; + break; + case 2700 : + nDir = 0; + break; +#ifdef DEBUG + default : + ASSERT( sal_False, "Unsupported direction" ); + break; +#endif + } + } + return nDir; +} + void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) { // map direction if frame has vertical layout @@ -1144,6 +1172,11 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) { long nOfst; +#ifdef VERTICAL_LAYOUT + USHORT nDir = UnMapDirection( + GetOrientation(), rInf.GetFrm() && rInf.GetFrm()->IsVertical() ); +#endif + switch ( GetEscapement() ) { case DFLT_ESC_AUTO_SUB : @@ -1151,7 +1184,11 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); +#ifdef VERTICAL_LAYOUT + switch ( nDir ) +#else switch ( GetOrientation() ) +#endif { case 0 : rPos.Y() += nOfst; @@ -1169,7 +1206,12 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) nOfst = pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ) - nOrgAscent; + +#ifdef VERTICAL_LAYOUT + switch ( nDir ) +#else switch ( GetOrientation() ) +#endif { case 0 : rPos.Y() += nOfst; @@ -1186,7 +1228,11 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) default : nOfst = ((long)nOrgHeight * GetEscapement()) / 100L; +#ifdef VERTICAL_LAYOUT + switch ( nDir ) +#else switch ( GetOrientation() ) +#endif { case 0 : rPos.Y() -= nOfst; -- cgit From c72579863eec8a310ce9292c1c5103f6fbbe6de5 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Wed, 12 Dec 2001 11:47:19 +0000 Subject: Chg: Vertical Formatting - Justification considers ASIAN characters --- sw/source/core/txtnode/swfont.cxx | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index e6e16e6a3322..8590f9dcc531 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.28 $ + * $Revision: 1.29 $ * - * last change: $Author: fme $ $Date: 2001-10-30 09:37:17 $ + * last change: $Author: fme $ $Date: 2001-12-12 12:47:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,6 +69,11 @@ #include #endif +#ifdef VERTICAL_LAYOUT +#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ +#include +#endif +#endif #ifndef _OUTDEV_HXX //autogen #include #endif @@ -191,6 +196,10 @@ SvStatistics aSvStat; #endif +#ifdef VERTICAL_LAYOUT +using namespace ::com::sun::star::i18n::ScriptType; +#endif + /************************************************************************ * Hintergrundbrush setzen, z.B. bei Zeichenvorlagen ***********************************************************************/ @@ -1031,9 +1040,32 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; xub_StrLen nTmpEnd = nOldIdx + nOldLen; if( nTmpEnd > rOldStr.Len() ) nTmpEnd = rOldStr.Len(); + +#ifdef VERTICAL_LAYOUT + const SwScriptInfo* pSI = rInf.GetScriptInfo(); + ASSERT( pSI, "No script info available" ) +#endif + +#ifdef VERTICAL_LAYOUT + const sal_Bool bAsianFont = + ( rInf.GetFont() && SW_CJK == rInf.GetFont()->GetActual() ); + for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) + if( CH_BLANK == rOldStr.GetChar( nTmp ) || bAsianFont || + ( nTmp + 1 < rOldStr.Len() && + ASIAN == pSI->ScriptType( nTmp + 1 ) ) ) +#else for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) if( CH_BLANK == rOldStr.GetChar( nTmp ) ) +#endif ++nSpace; + +#ifdef VERTICAL_LAYOUT + // if next portion if a hole portion we do not consider any + // extra space added because the last character was ASIAN + if ( nSpace && rInf.IsSpaceStop() && bAsianFont ) + --nSpace; +#endif + nSpace *= rInf.GetSpace(); } rInf.SetText( aStr ); -- cgit From b09713c1db6c1975111d2618fb20f60c41eee552 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 21 Mar 2002 09:46:39 +0000 Subject: #98281# Bidi - Initial changes --- sw/source/core/txtnode/swfont.cxx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 8590f9dcc531..b78a4b772a98 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.29 $ + * $Revision: 1.30 $ * - * last change: $Author: fme $ $Date: 2001-12-12 12:47:19 $ + * last change: $Author: fme $ $Date: 2002-03-21 10:46:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -619,7 +619,11 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) aSub[SW_CTL].SetCharSet( rFont.GetCharSet() ); aSub[SW_CTL].SvxFont::SetPropr( 100 ); // 100% der FontSize Size aTmpSize = aSub[SW_CTL].aSize; +#ifdef BIDI + aTmpSize.Height() = pAttrSet->GetCTLSize().GetHeight(); +#else aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); +#endif aSub[SW_CTL].SetSize( aTmpSize ); aSub[SW_CTL].SetItalic( pAttrSet->GetCTLPosture().GetPosture() ); aSub[SW_CTL].SetWeight( pAttrSet->GetCTLWeight().GetWeight() ); @@ -1123,8 +1127,17 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) #ifdef VERTICAL_LAYOUT const Point &rOld = rInf.GetPos(); rInf.SetPos( aPos ); - if ( rInf.GetFrm() && rInf.GetFrm()->IsVertical() ) - rInf.GetFrm()->SwitchHorizontalToVertical( aPos ); + + if ( rInf.GetFrm() ) + { +#ifdef BIDI + if ( rInf.GetFrm()->IsRightToLeft() ) + rInf.GetFrm()->SwitchLTRtoRTL( aPos ); +#endif + + if ( rInf.GetFrm()->IsVertical() ) + rInf.GetFrm()->SwitchHorizontalToVertical( aPos ); + } #endif if ( !IsCaseMap() ) -- cgit From 4808fecbef04c8cb4278d04700e355927be930f2 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Tue, 21 May 2002 07:36:33 +0000 Subject: Fix #99282# CTL - Choose correct font size for CTL font --- sw/source/core/txtnode/swfont.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index b78a4b772a98..3569069e105f 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: fme $ $Date: 2002-03-21 10:46:39 $ + * last change: $Author: fme $ $Date: 2002-05-21 08:36:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -619,11 +619,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) aSub[SW_CTL].SetCharSet( rFont.GetCharSet() ); aSub[SW_CTL].SvxFont::SetPropr( 100 ); // 100% der FontSize Size aTmpSize = aSub[SW_CTL].aSize; -#ifdef BIDI aTmpSize.Height() = pAttrSet->GetCTLSize().GetHeight(); -#else - aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); -#endif aSub[SW_CTL].SetSize( aTmpSize ); aSub[SW_CTL].SetItalic( pAttrSet->GetCTLPosture().GetPosture() ); aSub[SW_CTL].SetWeight( pAttrSet->GetCTLWeight().GetWeight() ); -- cgit From 1959edce62e90d449c3614efb7b86ae56bca9e91 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Fri, 7 Jun 2002 13:19:05 +0000 Subject: Fix #99962# DrawStretchText must consider COL_AUTO --- sw/source/core/txtnode/swfont.cxx | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 3569069e105f..625725456f91 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.32 $ * - * last change: $Author: fme $ $Date: 2002-05-21 08:36:33 $ + * last change: $Author: fme $ $Date: 2002-06-07 14:18:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -973,26 +973,6 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) nOldUnder = GetUnderline(); SetUnderline( UNDERLINE_NONE ); pUnderFnt = rInf.GetUnderFnt(); - - // !!! In case the font color and the underline color are both - // COL_AUTO, we set the color - if( COL_AUTO == GetColor().GetColor() ) - { - ViewShell* pSh = rInf.GetShell(); - ColorData nNewColor; - if( pSh && pSh->GetWin() ) - { - const StyleSettings& rS = pSh->GetWin()->GetSettings().GetStyleSettings(); - nNewColor = rInf.GetDarkBack() - ? COL_WHITE : rS.GetWindowTextColor().GetColor(); - } - else - nNewColor = rInf.GetDarkBack() ? COL_WHITE : COL_BLACK; - - pUnderFnt->SetColor( Color( nNewColor ) ); - } - else - pUnderFnt->SetColor( GetColor() ); } if( !pLastFont || pLastFont->GetOwner()!=pMagic ) @@ -1102,6 +1082,8 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) if ( !pLastFont || pLastFont->GetOwner() != pMagic ) ChgFnt( rInf.GetShell(), rInf.GetpOut() ); + rInf.ApplyAutoColor(); + Point aPos( rInf.GetPos() ); if( GetEscapement() ) -- cgit From 6107b10b1603f176a34854ac4fb104506a701c74 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Wed, 14 Aug 2002 05:43:49 +0000 Subject: #102266# SvxCharScaleWidthItem was not applied to font --- sw/source/core/txtnode/swfont.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 625725456f91..d79e6a18fb0d 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: fme $ $Date: 2002-06-07 14:18:17 $ + * last change: $Author: fme $ $Date: 2002-08-14 06:43:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -146,6 +146,9 @@ #ifndef _SVX_EMPHITEM_HXX //autogen #include #endif +#ifndef _SVX_CHARSCALEITEM_HXX +#include +#endif #ifndef _SVX_CHARROTATEITEM_HXX #include #endif @@ -635,6 +638,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) SetAlign( ALIGN_BASELINE ); SetOutline( pAttrSet->GetContour().GetValue() ); SetShadow( pAttrSet->GetShadowed().GetValue() ); + SetPropWidth( pAttrSet->GetCharScaleW().GetValue() ); SetRelief( (FontRelief)pAttrSet->GetCharRelief().GetValue() ); if( pAttrSet->GetAutoKern().GetValue() ) SetAutoKern( ( !pDoc || !pDoc->IsKernAsianPunctuation() ) ? -- cgit From 97e1df93aa9cec8f82eff2eed16c56240cdaff85 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Tue, 22 Oct 2002 06:00:48 +0000 Subject: #103476# Script info is not available for field portions --- sw/source/core/txtnode/swfont.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index d79e6a18fb0d..b81047d2fda5 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.34 $ * - * last change: $Author: fme $ $Date: 2002-08-14 06:43:49 $ + * last change: $Author: fme $ $Date: 2002-10-22 07:00:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1027,28 +1027,24 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; #ifdef VERTICAL_LAYOUT const SwScriptInfo* pSI = rInf.GetScriptInfo(); - ASSERT( pSI, "No script info available" ) -#endif -#ifdef VERTICAL_LAYOUT const sal_Bool bAsianFont = ( rInf.GetFont() && SW_CJK == rInf.GetFont()->GetActual() ); for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) if( CH_BLANK == rOldStr.GetChar( nTmp ) || bAsianFont || - ( nTmp + 1 < rOldStr.Len() && + ( nTmp + 1 < rOldStr.Len() && pSI && ASIAN == pSI->ScriptType( nTmp + 1 ) ) ) -#else - for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) - if( CH_BLANK == rOldStr.GetChar( nTmp ) ) -#endif - ++nSpace; -#ifdef VERTICAL_LAYOUT // if next portion if a hole portion we do not consider any // extra space added because the last character was ASIAN if ( nSpace && rInf.IsSpaceStop() && bAsianFont ) --nSpace; + +#else + for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) + if( CH_BLANK == rOldStr.GetChar( nTmp ) ) #endif + ++nSpace; nSpace *= rInf.GetSpace(); } -- cgit From 53231d9a61f1b4c63602f8efd39c97baeb623de4 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 24 Oct 2002 05:01:16 +0000 Subject: #103476# Script info is not available for field portions - correction --- sw/source/core/txtnode/swfont.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index b81047d2fda5..708720ff5b92 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: fme $ $Date: 2002-10-22 07:00:48 $ + * last change: $Author: fme $ $Date: 2002-10-24 06:01:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1025,7 +1025,6 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; if( nTmpEnd > rOldStr.Len() ) nTmpEnd = rOldStr.Len(); -#ifdef VERTICAL_LAYOUT const SwScriptInfo* pSI = rInf.GetScriptInfo(); const sal_Bool bAsianFont = @@ -1034,18 +1033,13 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; if( CH_BLANK == rOldStr.GetChar( nTmp ) || bAsianFont || ( nTmp + 1 < rOldStr.Len() && pSI && ASIAN == pSI->ScriptType( nTmp + 1 ) ) ) + ++nSpace; // if next portion if a hole portion we do not consider any // extra space added because the last character was ASIAN if ( nSpace && rInf.IsSpaceStop() && bAsianFont ) --nSpace; -#else - for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) - if( CH_BLANK == rOldStr.GetChar( nTmp ) ) -#endif - ++nSpace; - nSpace *= rInf.GetSpace(); } rInf.SetText( aStr ); -- cgit From 967634f7afda8139423df5056d7231c59410af9b Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 24 Oct 2002 05:32:01 +0000 Subject: #95433# Ignore rotation attribute for drop caps --- sw/source/core/txtnode/swfont.cxx | 70 +++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 28 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 708720ff5b92..598805f18a36 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.35 $ + * $Revision: 1.36 $ * - * last change: $Author: fme $ $Date: 2002-10-24 06:01:16 $ + * last change: $Author: fme $ $Date: 2002-10-24 06:31:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,11 +69,9 @@ #include #endif -#ifdef VERTICAL_LAYOUT #ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include #endif -#endif #ifndef _OUTDEV_HXX //autogen #include #endif @@ -180,11 +178,9 @@ #ifndef _DRAWFONT_HXX #include // SwDrawTextInfo #endif -#ifdef VERTICAL_LAYOUT #ifndef _TXTFRM_HXX #include // SwTxtFrm #endif -#endif #if defined(WIN) || defined(WNT) || defined(PM2) #define FNT_LEADING_HACK @@ -199,9 +195,7 @@ SvStatistics aSvStat; #endif -#ifdef VERTICAL_LAYOUT using namespace ::com::sun::star::i18n::ScriptType; -#endif /************************************************************************ * Hintergrundbrush setzen, z.B. bei Zeichenvorlagen @@ -229,7 +223,6 @@ Color* SwFont::XChgBackColor( Color* pNewColor ) return pRet; } -#ifdef VERTICAL_LAYOUT // maps directions for vertical layout USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) @@ -284,6 +277,11 @@ USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat ) return nDir; } +USHORT SwFont::GetOrientation( const BOOL bVertFormat ) const +{ + return UnMapDirection( aSub[nActual].GetOrientation(), bVertFormat ); +} + void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) { // map direction if frame has vertical layout @@ -297,7 +295,6 @@ void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) aSub[2].SetVertical( nDir ); } } -#endif /************************************************************************* Escapement: @@ -1096,7 +1093,6 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) { SV_STAT( nDrawStretchText ); -#ifdef VERTICAL_LAYOUT const Point &rOld = rInf.GetPos(); rInf.SetPos( aPos ); @@ -1110,7 +1106,6 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) if ( rInf.GetFrm()->IsVertical() ) rInf.GetFrm()->SwitchHorizontalToVertical( aPos ); } -#endif if ( !IsCaseMap() ) rInf.GetOut().DrawStretchText( aPos, rInf.GetWidth(), @@ -1119,9 +1114,7 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) rInf.GetOut().DrawStretchText( aPos, rInf.GetWidth(), CalcCaseMap( rInf.GetText() ), rInf.GetIdx(), rInf.GetLen() ); -#ifdef VERTICAL_LAYOUT rInf.SetPos( rOld ); -#endif } if( rInf.GetUnderFnt() && nOldUnder != UNDERLINE_NONE ) @@ -1189,10 +1182,8 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) { long nOfst; -#ifdef VERTICAL_LAYOUT USHORT nDir = UnMapDirection( GetOrientation(), rInf.GetFrm() && rInf.GetFrm()->IsVertical() ); -#endif switch ( GetEscapement() ) { @@ -1201,11 +1192,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); -#ifdef VERTICAL_LAYOUT switch ( nDir ) -#else - switch ( GetOrientation() ) -#endif { case 0 : rPos.Y() += nOfst; @@ -1224,11 +1211,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) nOrgAscent; -#ifdef VERTICAL_LAYOUT switch ( nDir ) -#else - switch ( GetOrientation() ) -#endif { case 0 : rPos.Y() += nOfst; @@ -1245,11 +1228,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) default : nOfst = ((long)nOrgHeight * GetEscapement()) / 100L; -#ifdef VERTICAL_LAYOUT switch ( nDir ) -#else - switch ( GetOrientation() ) -#endif { case 0 : rPos.Y() -= nOfst; @@ -1264,3 +1243,38 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) } } +// used during painting of small capitals +void SwDrawTextInfo::Shift( USHORT nDir ) +{ + ASSERT( bPos, "DrawTextInfo: Undefined Position" ); + ASSERT( bSize, "DrawTextInfo: Undefined Width" ); + +#ifdef BIDI + const BOOL bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) == + ( TEXT_LAYOUT_BIDI_STRONG == GetpOut()->GetLayoutMode() ); + + nDir = bBidiPor ? + 1800 : + UnMapDirection( nDir, GetFrm() && GetFrm()->IsVertical() ); +#else + nDir = UnMapDirection( nDir, GetFrm() && GetFrm()->IsVertical() ); +#endif + + switch ( nDir ) + { + case 0 : + ((Point*)pPos)->X() += GetSize().Width(); + break; + case 900 : + ASSERT( ((Point*)pPos)->Y() >= GetSize().Width(), "Going underground" ); + ((Point*)pPos)->Y() -= GetSize().Width(); + break; + case 1800 : + ((Point*)pPos)->X() -= GetSize().Width(); + break; + case 2700 : + ((Point*)pPos)->Y() += GetSize().Width(); + break; + } +} + -- cgit From b9fcf15d98cd78c15294c9628728777b7fad57f2 Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Thu, 14 Nov 2002 07:55:47 +0000 Subject: #104565# Continuous underline featrue for non-baseline aligned paragraphs --- sw/source/core/txtnode/swfont.cxx | 58 +++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 20 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 598805f18a36..d5a5500423ba 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.36 $ + * $Revision: 1.37 $ * - * last change: $Author: fme $ $Date: 2002-10-24 06:31:04 $ + * last change: $Author: fme $ $Date: 2002-11-14 08:55:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -967,7 +967,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) rInf.SetLen( nLn ); FontUnderline nOldUnder; - SwFont* pUnderFnt = 0; + SwUnderlineFont* pUnderFnt = 0; if( rInf.GetUnderFnt() ) { @@ -1004,9 +1004,8 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) rInf.SetText( rOldStr ); } } - rInf.SetPos( rOld ); - if( rInf.GetUnderFnt() && nOldUnder != UNDERLINE_NONE ) + if( pUnderFnt && nOldUnder != UNDERLINE_NONE ) { static sal_Char __READONLY_DATA sDoubleSpace[] = " "; Size aSize = _GetTxtSize( rInf ); @@ -1039,20 +1038,26 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; nSpace *= rInf.GetSpace(); } + + rInf.SetWidth( USHORT(aSize.Width() + nSpace) ); rInf.SetText( aStr ); rInf.SetIdx( 0 ); rInf.SetLen( 2 ); SetUnderline( nOldUnder ); - rInf.SetWidth( USHORT(aSize.Width() + nSpace) ); rInf.SetUnderFnt( 0 ); - pUnderFnt->_DrawStretchText( rInf ); + // set position for underline font + rInf.SetPos( pUnderFnt->GetPos() ); + + pUnderFnt->GetFont()._DrawStretchText( rInf ); rInf.SetUnderFnt( pUnderFnt ); rInf.SetText( rOldStr ); rInf.SetIdx( nOldIdx ); rInf.SetLen( nOldLen ); } + + rInf.SetPos( rOld ); } void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) @@ -1061,7 +1066,7 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) return; FontUnderline nOldUnder; - SwFont* pUnderFnt = 0; + SwUnderlineFont* pUnderFnt = 0; if( rInf.GetUnderFnt() ) { @@ -1081,21 +1086,15 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) CalcEsc( rInf, aPos ); rInf.SetKern( CheckKerning() + rInf.GetSperren() ); + const Point &rOld = rInf.GetPos(); + rInf.SetPos( aPos ); if( IsCapital() ) - { - const Point &rOld = rInf.GetPos(); - rInf.SetPos( aPos ); DrawStretchCapital( rInf ); - rInf.SetPos( rOld ); - } else { SV_STAT( nDrawStretchText ); - const Point &rOld = rInf.GetPos(); - rInf.SetPos( aPos ); - if ( rInf.GetFrm() ) { #ifdef BIDI @@ -1113,11 +1112,9 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) else rInf.GetOut().DrawStretchText( aPos, rInf.GetWidth(), CalcCaseMap( rInf.GetText() ), rInf.GetIdx(), rInf.GetLen() ); - - rInf.SetPos( rOld ); } - if( rInf.GetUnderFnt() && nOldUnder != UNDERLINE_NONE ) + if( pUnderFnt && nOldUnder != UNDERLINE_NONE ) { static sal_Char __READONLY_DATA sDoubleSpace[] = " "; const XubString &rOldStr = rInf.GetText(); @@ -1130,13 +1127,18 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; SetUnderline( nOldUnder ); rInf.SetUnderFnt( 0 ); - pUnderFnt->_DrawStretchText( rInf ); + // set position for underline font + rInf.SetPos( pUnderFnt->GetPos() ); + + pUnderFnt->GetFont()._DrawStretchText( rInf ); rInf.SetUnderFnt( pUnderFnt ); rInf.SetText( rOldStr ); rInf.SetIdx( nOldIdx ); rInf.SetLen( nOldLen ); } + + rInf.SetPos( rOld ); } /************************************************************************* @@ -1278,3 +1280,19 @@ void SwDrawTextInfo::Shift( USHORT nDir ) } } +/************************************************************************* + * SwUnderlineFont::~SwUnderlineFont + * + * Used for the "continuous underline" feature. + *************************************************************************/ + +SwUnderlineFont::SwUnderlineFont( SwFont& rFnt, const Point& rPoint ) + : pFnt( &rFnt ), aPos( rPoint ) +{ +}; + +SwUnderlineFont::~SwUnderlineFont() +{ + delete pFnt; +} + -- cgit From 227cbb59647d762eb3ddd99a3bad8df7f5c6f98e Mon Sep 17 00:00:00 2001 From: Frank Meies Date: Tue, 3 Dec 2002 10:42:50 +0000 Subject: #105886# Calculation whether portion is BidiPortion changes --- sw/source/core/txtnode/swfont.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index d5a5500423ba..a73968fd623e 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.37 $ + * $Revision: 1.38 $ * - * last change: $Author: fme $ $Date: 2002-11-14 08:55:47 $ + * last change: $Author: fme $ $Date: 2002-12-03 11:42:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1252,8 +1252,8 @@ void SwDrawTextInfo::Shift( USHORT nDir ) ASSERT( bSize, "DrawTextInfo: Undefined Width" ); #ifdef BIDI - const BOOL bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) == - ( TEXT_LAYOUT_BIDI_STRONG == GetpOut()->GetLayoutMode() ); + const BOOL bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) != + ( 0 != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) ); nDir = bBidiPor ? 1800 : -- cgit From 259e600274401873fa55151fa11c62c451b21153 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 10 Dec 2002 08:42:08 +0000 Subject: #105285# Provide way for filters to determine default real line height from SwAttrSet --- sw/source/core/txtnode/swfont.cxx | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index a73968fd623e..c431f90abbc0 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.38 $ + * $Revision: 1.39 $ * - * last change: $Author: fme $ $Date: 2002-12-03 11:42:50 $ + * last change: $Author: cmc $ $Date: 2002-12-10 09:42:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1296,3 +1296,33 @@ SwUnderlineFont::~SwUnderlineFont() delete pFnt; } +//Helper for filters to find true lineheight of a font +long AttrSetToLineHeight(const SwDoc &rDoc, const SwAttrSet &rSet, + const OutputDevice &rOut, sal_Int16 nScript) +{ + SwFont aFont(&rSet, &rDoc); + BYTE nActual; + switch (nScript) + { + default: + case com::sun::star::i18n::ScriptType::LATIN: + nActual = SW_LATIN; + break; + case com::sun::star::i18n::ScriptType::ASIAN: + nActual = SW_CJK; + break; + case com::sun::star::i18n::ScriptType::COMPLEX: + nActual = SW_CTL; + break; + } + aFont.SetActual(nActual); + + OutputDevice &rMutableOut = const_cast(rOut); + const Font aOldFont(rMutableOut.GetFont()); + + rMutableOut.SetFont(aFont.GetActualFont()); + long nHeight = rMutableOut.GetTextHeight(); + + rMutableOut.SetFont(aOldFont); + return nHeight; +} -- cgit From 70de0c38fd177b3c95837118c5fb35e380c87e90 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Thu, 27 Mar 2003 14:45:43 +0000 Subject: MWS_SRX644: migrate branch mws_srx644 -> HEAD --- sw/source/core/txtnode/swfont.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index c431f90abbc0..46541b9f3ee7 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.39 $ + * $Revision: 1.40 $ * - * last change: $Author: cmc $ $Date: 2002-12-10 09:42:08 $ + * last change: $Author: hr $ $Date: 2003-03-27 15:41:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -290,9 +290,9 @@ void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) if( nDir != aSub[0].GetOrientation() ) { bFntChg = TRUE; - aSub[0].SetVertical( nDir ); - aSub[1].SetVertical( nDir ); - aSub[2].SetVertical( nDir ); + aSub[0].SetVertical( nDir, bVertFormat ); + aSub[1].SetVertical( nDir, bVertFormat || nDir > 1000 ); + aSub[2].SetVertical( nDir, bVertFormat ); } } -- cgit From 9d76663db49c5b907103a3d7cd6a24d6e520758a Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 1 Apr 2003 08:59:06 +0000 Subject: INTEGRATION: CWS fme02 (1.39.2.1.22); FILE MERGED 2003/03/03 11:13:03 fme 1.39.2.1.22.1: #105712# Feature - Printer independent text formatting --- sw/source/core/txtnode/swfont.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 46541b9f3ee7..048c90bf0900 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.40 $ + * $Revision: 1.41 $ * - * last change: $Author: hr $ $Date: 2003-03-27 15:41:16 $ + * last change: $Author: vg $ $Date: 2003-04-01 09:59:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -807,7 +807,7 @@ short SwSubFont::_CheckKerning( ) USHORT SwFont::GetLeading( ViewShell *pSh, const OutputDevice *pOut ) { - if( OUTDEV_PRINTER != pOut->GetOutDevType() ) + if( pSh && pSh->GetWin() ) return 0; else { -- cgit From 139b621ec1903bf5d497a08517b526f2372bd5bd Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Tue, 8 Apr 2003 14:32:36 +0000 Subject: INTEGRATION: CWS draw8 (1.39.2.1.42); FILE MERGED 2003/03/13 17:02:04 aw 1.39.2.1.42.1: #108203# If the length of the original string and the CaseMapped one are different, it is necessary to handle the given text part as a single snippet since itÄs size may differ, too. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sw/source/core/txtnode/swfont.cxx | 68 +++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 7 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 048c90bf0900..8f2ffb8d1f66 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.41 $ + * $Revision: 1.42 $ * - * last change: $Author: vg $ $Date: 2003-04-01 09:59:06 $ + * last change: $Author: rt $ $Date: 2003-04-08 15:32:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -876,8 +876,36 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) else { String aTmp = CalcCaseMap( rInf.GetText() ); - rInf.SetText( aTmp ); - aTxtSize = pLastFont->GetTextSize( rInf ); + const XubString &rOldStr = rInf.GetText(); + sal_Bool bCaseMapLengthDiffers(aTmp.Len() != rOldStr.Len()); + + if(bCaseMapLengthDiffers && rInf.GetLen()) + { + // #108203# + // If the length of the original string and the CaseMapped one + // are different, it is necessary to handle the given text part as + // a single snippet since itÄs size may differ, too. + xub_StrLen nOldIdx(rInf.GetIdx()); + xub_StrLen nOldLen(rInf.GetLen()); + const XubString aSnippet(rOldStr, nOldIdx, nOldLen); + XubString aNewText(CalcCaseMap(aSnippet)); + + rInf.SetText( aNewText ); + rInf.SetIdx( 0 ); + rInf.SetLen( aNewText.Len() ); + + aTxtSize = pLastFont->GetTextSize( rInf ); + + rInf.SetIdx( nOldIdx ); + rInf.SetLen( nOldLen ); + } + else + { + rInf.SetText( aTmp ); + aTxtSize = pLastFont->GetTextSize( rInf ); + } + + rInf.SetText( rOldStr ); } rInf.SetKern( nOldKern ); rInf.SetText( rOldTxt ); @@ -997,10 +1025,36 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) pLastFont->DrawText( rInf ); else { - XubString aString( CalcCaseMap( rInf.GetText() ) ); const XubString &rOldStr = rInf.GetText(); - rInf.SetText( aString ); - pLastFont->DrawText( rInf ); + XubString aString( CalcCaseMap( rOldStr ) ); + sal_Bool bCaseMapLengthDiffers(aString.Len() != rOldStr.Len()); + + if(bCaseMapLengthDiffers && rInf.GetLen()) + { + // #108203# + // If the length of the original string and the CaseMapped one + // are different, it is necessary to handle the given text part as + // a single snippet since itÄs size may differ, too. + xub_StrLen nOldIdx(rInf.GetIdx()); + xub_StrLen nOldLen(rInf.GetLen()); + const XubString aSnippet(rOldStr, nOldIdx, nOldLen); + XubString aNewText = CalcCaseMap(aSnippet); + + rInf.SetText( aNewText ); + rInf.SetIdx( 0 ); + rInf.SetLen( aNewText.Len() ); + + pLastFont->DrawText( rInf ); + + rInf.SetIdx( nOldIdx ); + rInf.SetLen( nOldLen ); + } + else + { + rInf.SetText( aString ); + pLastFont->DrawText( rInf ); + } + rInf.SetText( rOldStr ); } } -- cgit From 6352be89204607dd6a8300ffe082c85c84b1cc77 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 15 Apr 2003 15:57:25 +0000 Subject: INTEGRATION: CWS dbgmacros1 (1.39.2.1.46); FILE MERGED 2003/04/11 08:04:36 kso 1.39.2.1.46.2: RESYNC: (1.39.2.1-1.41); FILE MERGED 2003/04/10 09:01:38 kso 1.39.2.1.46.1: #108413# - debug macro unification. --- sw/source/core/txtnode/swfont.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 8f2ffb8d1f66..721809c97246 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.42 $ + * $Revision: 1.43 $ * - * last change: $Author: rt $ $Date: 2003-04-08 15:32:36 $ + * last change: $Author: vg $ $Date: 2003-04-15 16:57:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -240,7 +240,7 @@ USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) case 2700 : nDir = 1800; break; -#ifdef DEBUG +#if OSL_DEBUG_LEVEL > 1 default : ASSERT( sal_False, "Unsupported direction" ); break; @@ -267,7 +267,7 @@ USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat ) case 2700 : nDir = 0; break; -#ifdef DEBUG +#if OSL_DEBUG_LEVEL > 1 default : ASSERT( sal_False, "Unsupported direction" ); break; @@ -790,7 +790,7 @@ USHORT SwSubFont::CalcEscHeight( const USHORT nOldHeight, short SwSubFont::_CheckKerning( ) { -#ifdef DEBUG +#if OSL_DEBUG_LEVEL > 1 static nTst = 6; short nKernx = - short( Font::GetSize().Height() / nTst ); #else -- cgit From ce5950a752e7b22c2e0b6e626d5f62c2605296d1 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Thu, 17 Apr 2003 13:35:46 +0000 Subject: INTEGRATION: CWS os8 (1.39.2.1.58); FILE MERGED 2003/04/07 22:10:06 os 1.39.2.1.58.2: RESYNC: (1.39.2.1-1.41); FILE MERGED 2003/04/03 07:11:58 os 1.39.2.1.58.1: #108583# precompiled headers removed --- sw/source/core/txtnode/swfont.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 721809c97246..cfd5ce02b932 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.43 $ + * $Revision: 1.44 $ * - * last change: $Author: vg $ $Date: 2003-04-15 16:57:25 $ + * last change: $Author: vg $ $Date: 2003-04-17 14:35:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,9 +59,6 @@ * ************************************************************************/ -#ifdef PRECOMPILED -#include "core_pch.hxx" -#endif #pragma hdrstop -- cgit From 3c4eb37b1a2d066c4a5c64adb81c9a3b63a1c705 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Wed, 15 Oct 2003 08:58:49 +0000 Subject: INTEGRATION: CWS extleading (1.44.92); FILE MERGED 2003/07/04 14:03:37 fme 1.44.92.1: #110641# Feature - External leading --- sw/source/core/txtnode/swfont.cxx | 62 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 32 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index cfd5ce02b932..5190e8147573 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.44 $ + * $Revision: 1.45 $ * - * last change: $Author: vg $ $Date: 2003-04-17 14:35:46 $ + * last change: $Author: kz $ $Date: 2003-10-15 09:58:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -717,7 +717,7 @@ BOOL SwSubFont::IsSymbol( ViewShell *pSh ) * SwSubFont::ChgFnt() *************************************************************************/ -BOOL SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice *pOut ) +BOOL SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice& rOut ) { if ( pLastFont ) pLastFont->Unlock(); @@ -726,7 +726,7 @@ BOOL SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice *pOut ) pLastFont = aFntAccess.Get(); - pLastFont->SetDevFont( pSh, pOut ); + pLastFont->SetDevFont( pSh, rOut ); pLastFont->Lock(); return UNDERLINE_NONE != GetUnderline() || STRIKEOUT_NONE != GetStrikeout(); @@ -736,30 +736,28 @@ BOOL SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice *pOut ) * SwFont::ChgPhysFnt() *************************************************************************/ -void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice *pOut ) +void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice& rOut ) { - ASSERT( pOut, "SwFont:;ChgPhysFnt, not OutDev." ); - if( bOrgChg && aSub[nActual].IsEsc() ) { const BYTE nOldProp = aSub[nActual].GetPropr(); SetProportion( 100 ); - ChgFnt( pSh, pOut ); + ChgFnt( pSh, rOut ); SwFntAccess aFntAccess( aSub[nActual].pMagic, aSub[nActual].nFntIndex, &aSub[nActual], pSh ); - aSub[nActual].nOrgHeight = aFntAccess.Get()->GetHeight( pSh, pOut ); - aSub[nActual].nOrgAscent = aFntAccess.Get()->GetAscent( pSh, pOut ); + aSub[nActual].nOrgHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut ); + aSub[nActual].nOrgAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); SetProportion( nOldProp ); bOrgChg = FALSE; } if( bFntChg ) { - ChgFnt( pSh, pOut ); + ChgFnt( pSh, rOut ); bFntChg = bOrgChg; } - if( pOut->GetTextLineColor() != aUnderColor ) - pOut->SetTextLineColor( aUnderColor ); + if( rOut.GetTextLineColor() != aUnderColor ) + rOut.SetTextLineColor( aUnderColor ); } /************************************************************************* @@ -799,10 +797,10 @@ short SwSubFont::_CheckKerning( ) } /************************************************************************* - * SwFont::GetLeading() + * SwFont::GetGuessedLeading() *************************************************************************/ -USHORT SwFont::GetLeading( ViewShell *pSh, const OutputDevice *pOut ) +USHORT SwFont::GetGuessedLeading( ViewShell *pSh, const OutputDevice& rOut ) { if( pSh && pSh->GetWin() ) return 0; @@ -810,7 +808,7 @@ USHORT SwFont::GetLeading( ViewShell *pSh, const OutputDevice *pOut ) { SwFntAccess aFntAccess( aSub[nActual].pMagic, aSub[nActual].nFntIndex, &aSub[nActual], pSh ); - return aFntAccess.Get()->GetLeading(); + return aFntAccess.Get()->GetGuessedLeading(); } } @@ -818,11 +816,11 @@ USHORT SwFont::GetLeading( ViewShell *pSh, const OutputDevice *pOut ) * SwSubFont::GetAscent() *************************************************************************/ -USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice *pOut ) +USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice& rOut ) { register USHORT nAscent; SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh ); - nAscent = aFntAccess.Get()->GetAscent( pSh, pOut ); + nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); if( GetEscapement() ) nAscent = CalcEscAscent( nAscent ); return nAscent; @@ -832,14 +830,14 @@ USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice *pOut ) * SwSubFont::GetHeight() *************************************************************************/ -USHORT SwSubFont::GetHeight( ViewShell *pSh, const OutputDevice *pOut ) +USHORT SwSubFont::GetHeight( ViewShell *pSh, const OutputDevice& rOut ) { SV_STAT( nGetTextSize ); SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh ); - const USHORT nHeight = aFntAccess.Get()->GetHeight( pSh, pOut ); + const USHORT nHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut ); if ( GetEscapement() ) { - const USHORT nAscent = aFntAccess.Get()->GetAscent( pSh, pOut ); + const USHORT nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); return CalcEscHeight( nHeight, nAscent ); // + nLeading; } return nHeight; // + nLeading; @@ -854,7 +852,7 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) // sicher ist sicher ... if ( !pLastFont || pLastFont->GetOwner()!=pMagic || !IsSameInstance( rInf.GetpOut()->GetFont() ) ) - ChgFnt( rInf.GetShell(), rInf.GetpOut() ); + ChgFnt( rInf.GetShell(), rInf.GetOut() ); Size aTxtSize; xub_StrLen nLn = ( rInf.GetLen() == STRING_LEN ? rInf.GetText().Len() @@ -910,8 +908,8 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) // hochgestellt, muss seine effektive Hoehe melden. if( GetEscapement() ) { - const USHORT nAscent = pLastFont->GetAscent( rInf.GetShell(), - rInf.GetpOut() ); + const USHORT nAscent = pLastFont->GetFontAscent( rInf.GetShell(), + rInf.GetOut() ); aTxtSize.Height() = (long)CalcEscHeight( (USHORT)aTxtSize.Height(), nAscent); } @@ -928,7 +926,7 @@ xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, const SwScriptInfo* pScript, const XubString &rTxt, long nTextWidth, const xub_StrLen nIdx, const xub_StrLen nLen ) { - ChgFnt( pSh, (OutputDevice *)pOut ); + ChgFnt( pSh, (OutputDevice&)*pOut ); USHORT nTxtBreak = 0; @@ -958,7 +956,7 @@ xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, { // Robust ... if ( !pLastFont || pLastFont->GetOwner()!= aSub[nActual].pMagic ) - ChgFnt( pSh, (OutputDevice *)pOut ); + ChgFnt( pSh, (OutputDevice&)*pOut ); xub_StrLen nTxtBreak = 0; @@ -1002,7 +1000,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) } if( !pLastFont || pLastFont->GetOwner()!=pMagic ) - ChgFnt( rInf.GetShell(), rInf.GetpOut() ); + ChgFnt( rInf.GetShell(), rInf.GetOut() ); Point aPos( rInf.GetPos() ); const Point &rOld = rInf.GetPos(); @@ -1127,7 +1125,7 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) } if ( !pLastFont || pLastFont->GetOwner() != pMagic ) - ChgFnt( rInf.GetShell(), rInf.GetpOut() ); + ChgFnt( rInf.GetShell(), rInf.GetOut() ); rInf.ApplyAutoColor(); @@ -1199,7 +1197,7 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; xub_StrLen SwSubFont::_GetCrsrOfst( SwDrawTextInfo& rInf ) { if ( !pLastFont || pLastFont->GetOwner()!=pMagic ) - ChgFnt( rInf.GetShell(), rInf.GetpOut() ); + ChgFnt( rInf.GetShell(), rInf.GetOut() ); xub_StrLen nLn = rInf.GetLen() == STRING_LEN ? rInf.GetText().Len() : rInf.GetLen(); @@ -1242,8 +1240,8 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) { case DFLT_ESC_AUTO_SUB : nOfst = nOrgHeight - nOrgAscent - - pLastFont->GetHeight( rInf.GetShell(), rInf.GetpOut() ) + - pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ); + pLastFont->GetFontHeight( rInf.GetShell(), rInf.GetOut() ) + + pLastFont->GetFontAscent( rInf.GetShell(), rInf.GetOut() ); switch ( nDir ) { @@ -1260,7 +1258,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) break; case DFLT_ESC_AUTO_SUPER : - nOfst = pLastFont->GetAscent( rInf.GetShell(), rInf.GetpOut() ) - + nOfst = pLastFont->GetFontAscent( rInf.GetShell(), rInf.GetOut() ) - nOrgAscent; -- cgit From fa5e743a4dafa8943709eb3ce994857294efd7ae Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Thu, 30 Oct 2003 09:21:39 +0000 Subject: INTEGRATION: CWS writerteamqbugs (1.44.164); FILE MERGED 2003/08/25 07:51:59 fme 1.44.164.1: #110852# Set correct font for line numbering --- sw/source/core/txtnode/swfont.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 5190e8147573..1e3714d5c0b0 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.46 $ * - * last change: $Author: kz $ $Date: 2003-10-15 09:58:49 $ + * last change: $Author: rt $ $Date: 2003-10-30 10:21:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -172,12 +172,12 @@ #ifndef _FNTCACHE_HXX #include // FontCache #endif -#ifndef _DRAWFONT_HXX -#include // SwDrawTextInfo -#endif #ifndef _TXTFRM_HXX #include // SwTxtFrm #endif +#ifndef _SCRIPTINFO_HXX +#include +#endif #if defined(WIN) || defined(WNT) || defined(PM2) #define FNT_LEADING_HACK -- cgit From fc51799590748e627e058893c8b5629d4e0b5090 Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Tue, 25 Nov 2003 09:38:20 +0000 Subject: INTEGRATION: CWS valgrind01 (1.45.22); FILE MERGED 2003/11/12 16:51:33 hr 1.45.22.2: RESYNC: (1.45-1.46); FILE MERGED 2003/11/03 18:52:44 hr 1.45.22.1: #i20184#: initialize bOrgChg in all SwFont ctors --- sw/source/core/txtnode/swfont.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 1e3714d5c0b0..343c18bccd95 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.46 $ + * $Revision: 1.47 $ * - * last change: $Author: rt $ $Date: 2003-10-30 10:21:39 $ + * last change: $Author: rt $ $Date: 2003-11-25 10:38:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -571,6 +571,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) bNoColReplace = FALSE; bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); bBlink = pAttrSet->GetBlink().GetValue(); + bOrgChg = TRUE; { const SvxFontItem& rFont = pAttrSet->GetFont(); aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); -- cgit From f01fd08dc21bb61da3ba98a15f53d3446503397e Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Wed, 4 Feb 2004 13:08:55 +0000 Subject: INTEGRATION: CWS ooo20031216 (1.47.32); FILE MERGED 2003/12/20 13:35:54 waratah 1.47.32.1: #i23464# remove code that is duplicated and fails permissive anyway --- sw/source/core/txtnode/swfont.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 343c18bccd95..dcc5b455d83e 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.47 $ + * $Revision: 1.48 $ * - * last change: $Author: rt $ $Date: 2003-11-25 10:38:20 $ + * last change: $Author: hr $ $Date: 2004-02-04 14:08:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -786,12 +786,8 @@ USHORT SwSubFont::CalcEscHeight( const USHORT nOldHeight, short SwSubFont::_CheckKerning( ) { -#if OSL_DEBUG_LEVEL > 1 - static nTst = 6; - short nKernx = - short( Font::GetSize().Height() / nTst ); -#else short nKernx = - short( Font::GetSize().Height() / 6 ); -#endif + if ( nKernx < GetFixKerning() ) return GetFixKerning(); return nKernx; -- cgit From b1e6171698756b822d9efb32d80c5306a4a6145d Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Thu, 26 Feb 2004 14:34:35 +0000 Subject: INTEGRATION: CWS hiddentext (1.47.18); FILE MERGED 2004/02/16 08:47:41 fme 1.47.18.3: RESYNC: (1.47-1.48); FILE MERGED 2004/01/08 15:47:45 fme 1.47.18.2: #i23660# Feature - Hidden text attribute 2004/01/05 14:39:13 fme 1.47.18.1: #i23660# Feature - Hidden character attribute --- sw/source/core/txtnode/swfont.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index dcc5b455d83e..73ae3fb4283f 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.48 $ + * $Revision: 1.49 $ * - * last change: $Author: hr $ $Date: 2004-02-04 14:08:55 $ + * last change: $Author: kz $ $Date: 2004-02-26 15:34:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -150,6 +150,9 @@ #ifndef _SVX_TWOLINESITEM_HXX #include #endif +#ifndef _SVX_CHARHIDDENITEM_HXX +#include +#endif #ifndef _DOC_HXX #include #endif @@ -624,7 +627,11 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) aSub[SW_CTL].SetLanguage( pAttrSet->GetCTLLanguage().GetLanguage() ); } - SetUnderline( pAttrSet->GetUnderline().GetUnderline() ); + const FontUnderline eUnderline = pAttrSet->GetUnderline().GetUnderline(); + if ( pAttrSet->GetCharHidden().GetValue() ) + SetUnderline( UNDERLINE_DOTTED ); + else + SetUnderline( eUnderline ); SetUnderColor( pAttrSet->GetUnderline().GetColor() ); SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() ); SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); -- cgit From 4547254ab20d8fe545fa9bad36704b26dd9ff74a Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Thu, 12 Aug 2004 11:40:31 +0000 Subject: INTEGRATION: CWS tune05 (1.49.170); FILE MERGED 2004/07/22 08:27:13 cmc 1.49.170.2: #i30554# SwFont::XChgBackColor unused 2004/07/21 07:23:34 cmc 1.49.170.1: #i30554# SwFont::GetGuessLeading now unused (checked with fme) --- sw/source/core/txtnode/swfont.cxx | 93 +-------------------------------------- 1 file changed, 2 insertions(+), 91 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 73ae3fb4283f..91bfb02dc484 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.49 $ + * $Revision: 1.50 $ * - * last change: $Author: kz $ $Date: 2004-02-26 15:34:35 $ + * last change: $Author: obo $ $Date: 2004-08-12 12:40:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -209,21 +209,6 @@ void SwFont::SetBackColor( Color* pNewColor ) aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; } -/************************************************************************ - * Hintergrundbrush setzen, - * die alte Brush wird _nicht_ destruiert, sondern ist der Rueckgabewert. - ***********************************************************************/ - -Color* SwFont::XChgBackColor( Color* pNewColor ) -{ - Color* pRet = pBackColor; - pBackColor = pNewColor; - bFntChg = TRUE; - aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; - return pRet; -} - - // maps directions for vertical layout USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) { @@ -800,22 +785,6 @@ short SwSubFont::_CheckKerning( ) return nKernx; } -/************************************************************************* - * SwFont::GetGuessedLeading() - *************************************************************************/ - -USHORT SwFont::GetGuessedLeading( ViewShell *pSh, const OutputDevice& rOut ) -{ - if( pSh && pSh->GetWin() ) - return 0; - else - { - SwFntAccess aFntAccess( aSub[nActual].pMagic, aSub[nActual].nFntIndex, - &aSub[nActual], pSh ); - return aFntAccess.Get()->GetGuessedLeading(); - } -} - /************************************************************************* * SwSubFont::GetAscent() *************************************************************************/ @@ -922,64 +891,6 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) return aTxtSize; } -/************************************************************************* - * SwFont::GetTxtBreak() - *************************************************************************/ - -xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, - const SwScriptInfo* pScript, const XubString &rTxt, long nTextWidth, - const xub_StrLen nIdx, const xub_StrLen nLen ) -{ - ChgFnt( pSh, (OutputDevice&)*pOut ); - - USHORT nTxtBreak = 0; - - USHORT nLn = ( nLen == STRING_LEN ? rTxt.Len() : nLen ); - if( aSub[nActual].IsCapital() && nLn ) - nTxtBreak = GetCapitalBreak( pSh, pOut, pScript, rTxt, nTextWidth, - 0, nIdx, nLn ); - else - { - if ( !aSub[nActual].IsCaseMap() ) - nTxtBreak = pOut->GetTextBreak( rTxt, nTextWidth, - nIdx, nLn, CheckKerning() ); - else - nTxtBreak = pOut->GetTextBreak( aSub[nActual].CalcCaseMap( rTxt ), - nTextWidth, nIdx, nLn, CheckKerning() ); - } - return nTxtBreak; -} - -/************************************************************************* - * SwFont::GetTxtBreak() - *************************************************************************/ - -xub_StrLen SwFont::GetTxtBreak( ViewShell *pSh, const OutputDevice *pOut, - const SwScriptInfo* pScript, const XubString &rTxt, long nTextWidth, - xub_StrLen& rExtraCharPos, const xub_StrLen nIdx, const xub_StrLen nLen ) -{ - // Robust ... - if ( !pLastFont || pLastFont->GetOwner()!= aSub[nActual].pMagic ) - ChgFnt( pSh, (OutputDevice&)*pOut ); - - xub_StrLen nTxtBreak = 0; - - xub_StrLen nLn = ( nLen == STRING_LEN ? rTxt.Len() : nLen ); - if( aSub[nActual].IsCapital() && nLn ) - nTxtBreak = GetCapitalBreak( pSh, pOut, pScript, rTxt, nTextWidth, - &rExtraCharPos, nIdx, nLn ); - else - { - if ( !aSub[nActual].IsCaseMap() ) - nTxtBreak = pOut->GetTextBreak( rTxt, nTextWidth, - '-', rExtraCharPos, nIdx, nLn, CheckKerning() ); - else - nTxtBreak = pOut->GetTextBreak( aSub[nActual].CalcCaseMap( rTxt ), - nTextWidth, '-', rExtraCharPos, nIdx, nLn, CheckKerning() ); - } - return nTxtBreak; -} - /************************************************************************* * SwSubFont::_DrawText() *************************************************************************/ -- cgit From e5a7490b3a895667316953a371532bf22c49e9a3 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Mon, 18 Apr 2005 13:41:30 +0000 Subject: INTEGRATION: CWS thaiblocksatz (1.50.380); FILE MERGED 2005/04/06 06:30:32 fme 1.50.380.1: #i41860# Thai justified alignment needs some more precision to prevent rounding errors --- sw/source/core/txtnode/swfont.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 91bfb02dc484..1eb994de57cb 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.50 $ + * $Revision: 1.51 $ * - * last change: $Author: obo $ $Date: 2004-08-12 12:40:31 $ + * last change: $Author: obo $ $Date: 2005-04-18 14:41:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -836,7 +836,7 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) else { SV_STAT( nGetTextSize ); - short nOldKern = rInf.GetKern(); + long nOldKern = rInf.GetKern(); const XubString &rOldTxt = rInf.GetText(); rInf.SetKern( CheckKerning() ); if ( !IsCaseMap() ) @@ -924,7 +924,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) if( GetEscapement() ) CalcEsc( rInf, aPos ); - rInf.SetKern( CheckKerning() + rInf.GetSperren() ); + rInf.SetKern( CheckKerning() + rInf.GetSperren() / SPACING_PRECISION_FACTOR ); if( IsCapital() ) DrawCapital( rInf ); @@ -990,17 +990,19 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; const sal_Bool bAsianFont = ( rInf.GetFont() && SW_CJK == rInf.GetFont()->GetActual() ); for( xub_StrLen nTmp = nOldIdx; nTmp < nTmpEnd; ++nTmp ) + { if( CH_BLANK == rOldStr.GetChar( nTmp ) || bAsianFont || ( nTmp + 1 < rOldStr.Len() && pSI && ASIAN == pSI->ScriptType( nTmp + 1 ) ) ) ++nSpace; + } // if next portion if a hole portion we do not consider any // extra space added because the last character was ASIAN if ( nSpace && rInf.IsSpaceStop() && bAsianFont ) --nSpace; - nSpace *= rInf.GetSpace(); + nSpace *= rInf.GetSpace() / SPACING_PRECISION_FACTOR; } rInf.SetWidth( USHORT(aSize.Width() + nSpace) ); @@ -1049,7 +1051,7 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) if( GetEscapement() ) CalcEsc( rInf, aPos ); - rInf.SetKern( CheckKerning() + rInf.GetSperren() ); + rInf.SetKern( CheckKerning() + rInf.GetSperren() / SPACING_PRECISION_FACTOR ); const Point &rOld = rInf.GetPos(); rInf.SetPos( aPos ); @@ -1123,7 +1125,7 @@ xub_StrLen SwSubFont::_GetCrsrOfst( SwDrawTextInfo& rInf ) else { const XubString &rOldTxt = rInf.GetText(); - short nOldKern = rInf.GetKern(); + long nOldKern = rInf.GetKern(); rInf.SetKern( CheckKerning() ); SV_STAT( nGetTextSize ); if ( !IsCaseMap() ) -- cgit From a4d2c09da4cb71551dfee0c643de20906aee1c87 Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Fri, 9 Sep 2005 04:14:00 +0000 Subject: INTEGRATION: CWS ooo19126 (1.51.186); FILE MERGED 2005/09/05 13:41:18 rt 1.51.186.1: #i54170# Change license header: remove SISSL --- sw/source/core/txtnode/swfont.cxx | 68 ++++++++++++--------------------------- 1 file changed, 21 insertions(+), 47 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 1eb994de57cb..57a03bb819c6 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -1,61 +1,35 @@ /************************************************************************* * - * $RCSfile: swfont.cxx,v $ - * - * $Revision: 1.51 $ - * - * last change: $Author: obo $ $Date: 2005-04-18 14:41:30 $ - * - * The Contents of this file are made available subject to the terms of - * either of the following licenses - * - * - GNU Lesser General Public License Version 2.1 - * - Sun Industry Standards Source License Version 1.1 + * OpenOffice.org - a multi-platform office productivity suite * - * Sun Microsystems Inc., October, 2000 - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2000 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * $RCSfile: swfont.cxx,v $ * + * $Revision: 1.52 $ * - * Sun Industry Standards Source License Version 1.1 - * ================================================= - * The contents of this file are subject to the Sun Industry Standards - * Source License Version 1.1 (the "License"); You may not use this file - * except in compliance with the License. You may obtain a copy of the - * License at http://www.openoffice.org/license.html. + * last change: $Author: rt $ $Date: 2005-09-09 05:13:59 $ * - * Software provided under this License is provided on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, - * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. - * See the License for the specific provisions governing your rights and - * obligations concerning the Software. + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. * - * The Initial Developer of the Original Code is: Sun Microsystems, Inc. * - * Copyright: 2000 by Sun Microsystems, Inc. + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA * - * All Rights Reserved. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. * - * Contributor(s): _______________________________________ + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA * ************************************************************************/ -- cgit From 2104326e28e9e1450b98b5af69487a637346886e Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 14 Aug 2006 15:47:31 +0000 Subject: INTEGRATION: CWS writercorehandoff (1.51.48); FILE MERGED 2005/09/13 14:46:36 tra 1.51.48.4: RESYNC: (1.51-1.52); FILE MERGED 2005/06/24 11:43:42 fme 1.51.48.3: #i50348# Make SwDoc accessible via interfaces 2005/06/07 14:14:30 fme 1.51.48.2: #i50348# General cleanup - removed unused header files, functions, members, declarations etc. 2005/06/06 09:28:12 tra 1.51.48.1: Unnecessary includes removed #i50348# --- sw/source/core/txtnode/swfont.cxx | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 57a03bb819c6..895772ce1784 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -4,9 +4,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.52 $ + * $Revision: 1.53 $ * - * last change: $Author: rt $ $Date: 2005-09-09 05:13:59 $ + * last change: $Author: hr $ $Date: 2006-08-14 16:47:31 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,7 +33,6 @@ * ************************************************************************/ - #pragma hdrstop #ifndef _HINTIDS_HXX @@ -127,8 +126,8 @@ #ifndef _SVX_CHARHIDDENITEM_HXX #include #endif -#ifndef _DOC_HXX -#include +#ifndef IDOCUMENTSETTINGACCESS_HXX_INCLUDED +#include #endif #ifndef _WINDOW_HXX //autogen #include @@ -137,9 +136,6 @@ #ifndef _CHARATR_HXX #include #endif -#ifndef _SWATRSET_HXX //autogen -#include -#endif #ifndef _VIEWSH_HXX #include // Bildschirmabgleich #endif @@ -305,12 +301,12 @@ USHORT SwSubFont::CalcEscAscent( const USHORT nOldAscent ) const * SwFont::SetDiffFnt() *************************************************************************/ -void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, const SwDoc *pDoc ) +void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, + const IDocumentSettingAccess *pIDocumentSettingAccess ) { delete pBackColor; pBackColor = NULL; - if( pAttrSet ) { const SfxPoolItem* pItem; @@ -444,8 +440,12 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, const SwDoc *pDoc ) TRUE, &pItem )) { if( ((SvxAutoKernItem*)pItem)->GetValue() ) - SetAutoKern( ( !pDoc || !pDoc->IsKernAsianPunctuation() ) ? - KERNING_FONTSPECIFIC : KERNING_ASIAN ); + { + SetAutoKern( ( !pIDocumentSettingAccess || + !pIDocumentSettingAccess->get(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION) ) ? + KERNING_FONTSPECIFIC : + KERNING_ASIAN ); + } else SetAutoKern( 0 ); } @@ -522,7 +522,8 @@ SwFont::SwFont( const SwFont &rFont ) bBlink = rFont.bBlink; } -SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) +SwFont::SwFont( const SwAttrSet* pAttrSet, + const IDocumentSettingAccess* pIDocumentSettingAccess ) { nActual = SW_LATIN; nToxCnt = nRefCnt = 0; @@ -602,8 +603,12 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, const SwDoc *pDoc ) SetPropWidth( pAttrSet->GetCharScaleW().GetValue() ); SetRelief( (FontRelief)pAttrSet->GetCharRelief().GetValue() ); if( pAttrSet->GetAutoKern().GetValue() ) - SetAutoKern( ( !pDoc || !pDoc->IsKernAsianPunctuation() ) ? - KERNING_FONTSPECIFIC : KERNING_ASIAN ); + { + SetAutoKern( ( !pIDocumentSettingAccess || + !pIDocumentSettingAccess->get(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION) ) ? + KERNING_FONTSPECIFIC : + KERNING_ASIAN ); + } else SetAutoKern( 0 ); SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); @@ -1037,10 +1042,8 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) if ( rInf.GetFrm() ) { -#ifdef BIDI if ( rInf.GetFrm()->IsRightToLeft() ) rInf.GetFrm()->SwitchLTRtoRTL( aPos ); -#endif if ( rInf.GetFrm()->IsVertical() ) rInf.GetFrm()->SwitchHorizontalToVertical( aPos ); @@ -1191,16 +1194,12 @@ void SwDrawTextInfo::Shift( USHORT nDir ) ASSERT( bPos, "DrawTextInfo: Undefined Position" ); ASSERT( bSize, "DrawTextInfo: Undefined Width" ); -#ifdef BIDI const BOOL bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) != ( 0 != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) ); nDir = bBidiPor ? 1800 : UnMapDirection( nDir, GetFrm() && GetFrm()->IsVertical() ); -#else - nDir = UnMapDirection( nDir, GetFrm() && GetFrm()->IsVertical() ); -#endif switch ( nDir ) { @@ -1237,10 +1236,11 @@ SwUnderlineFont::~SwUnderlineFont() } //Helper for filters to find true lineheight of a font -long AttrSetToLineHeight(const SwDoc &rDoc, const SwAttrSet &rSet, - const OutputDevice &rOut, sal_Int16 nScript) +long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess, + const SwAttrSet &rSet, + const OutputDevice &rOut, sal_Int16 nScript) { - SwFont aFont(&rSet, &rDoc); + SwFont aFont(&rSet, &rIDocumentSettingAccess); BYTE nActual; switch (nScript) { -- cgit From ae3539687bbe445b9eb949084f9dcf7afd428bcd Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Sat, 16 Sep 2006 20:47:04 +0000 Subject: INTEGRATION: CWS pchfix02 (1.53.2); FILE MERGED 2006/09/01 17:52:12 kaib 1.53.2.1: #i68856# Added header markers and pch files --- sw/source/core/txtnode/swfont.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 895772ce1784..6a3d829241fc 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -4,9 +4,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.53 $ + * $Revision: 1.54 $ * - * last change: $Author: hr $ $Date: 2006-08-14 16:47:31 $ + * last change: $Author: obo $ $Date: 2006-09-16 21:47:04 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -33,7 +33,9 @@ * ************************************************************************/ -#pragma hdrstop +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sw.hxx" + #ifndef _HINTIDS_HXX #include -- cgit From 02a4c1a9d32c4aeb3b257b6c28dcdc89980398a7 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Fri, 9 Mar 2007 12:15:24 +0000 Subject: INTEGRATION: CWS hb02 (1.54.148); FILE MERGED 2007/02/05 19:50:52 fme 1.54.148.2: #i73306# Wrong cws 2007/01/11 09:10:50 fme 1.54.148.1: #i73306# Initialize veriable for valgrind --- sw/source/core/txtnode/swfont.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 6a3d829241fc..283034a8b585 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -4,9 +4,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.54 $ + * $Revision: 1.55 $ * - * last change: $Author: obo $ $Date: 2006-09-16 21:47:04 $ + * last change: $Author: obo $ $Date: 2007-03-09 13:15:24 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. -- cgit From ff4d1521253b6226ac8c237461166ebbe173ca59 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Wed, 14 Mar 2007 07:07:23 +0000 Subject: INTEGRATION: CWS fmepatches (1.54.192); FILE MERGED 2007/02/05 19:54:10 fme 1.54.192.1: #i73306# Initialize variable for valgrind --- sw/source/core/txtnode/swfont.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 283034a8b585..4e4fc84631f6 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -4,9 +4,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.55 $ + * $Revision: 1.56 $ * - * last change: $Author: obo $ $Date: 2007-03-09 13:15:24 $ + * last change: $Author: obo $ $Date: 2007-03-14 08:07:23 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -885,7 +885,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) if( STRING_LEN == rInf.GetLen() ) rInf.SetLen( nLn ); - FontUnderline nOldUnder; + FontUnderline nOldUnder( UNDERLINE_NONE ); SwUnderlineFont* pUnderFnt = 0; if( rInf.GetUnderFnt() ) -- cgit From 4a059528db6064c3b766722a34d6e072023b51d1 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Thu, 27 Sep 2007 08:27:11 +0000 Subject: INTEGRATION: CWS swwarnings (1.54.222); FILE MERGED 2007/04/11 07:02:55 tl 1.54.222.3: #i69287# warning-free code 2007/04/03 13:00:21 tl 1.54.222.2: #i69287# warning-free code 2007/03/08 09:51:32 fme 1.54.222.1: #i69287# Warning free code --- sw/source/core/txtnode/swfont.cxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 4e4fc84631f6..880378a6badb 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -4,9 +4,9 @@ * * $RCSfile: swfont.cxx,v $ * - * $Revision: 1.56 $ + * $Revision: 1.57 $ * - * last change: $Author: obo $ $Date: 2007-03-14 08:07:23 $ + * last change: $Author: hr $ $Date: 2007-09-27 09:27:11 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -167,7 +167,7 @@ SvStatistics aSvStat; #endif -using namespace ::com::sun::star::i18n::ScriptType; +using namespace ::com::sun::star; /************************************************************************ * Hintergrundbrush setzen, z.B. bei Zeichenvorlagen @@ -772,7 +772,7 @@ short SwSubFont::_CheckKerning( ) USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice& rOut ) { - register USHORT nAscent; + USHORT nAscent; SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh ); nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); if( GetEscapement() ) @@ -833,7 +833,7 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) // #108203# // If the length of the original string and the CaseMapped one // are different, it is necessary to handle the given text part as - // a single snippet since itÄs size may differ, too. + // a single snippet since it�s size may differ, too. xub_StrLen nOldIdx(rInf.GetIdx()); xub_StrLen nOldLen(rInf.GetLen()); const XubString aSnippet(rOldStr, nOldIdx, nOldLen); @@ -885,7 +885,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) if( STRING_LEN == rInf.GetLen() ) rInf.SetLen( nLn ); - FontUnderline nOldUnder( UNDERLINE_NONE ); + FontUnderline nOldUnder = UNDERLINE_NONE; SwUnderlineFont* pUnderFnt = 0; if( rInf.GetUnderFnt() ) @@ -925,7 +925,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) // #108203# // If the length of the original string and the CaseMapped one // are different, it is necessary to handle the given text part as - // a single snippet since itÄs size may differ, too. + // a single snippet since it�s size may differ, too. xub_StrLen nOldIdx(rInf.GetIdx()); xub_StrLen nOldLen(rInf.GetLen()); const XubString aSnippet(rOldStr, nOldIdx, nOldLen); @@ -953,7 +953,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) if( pUnderFnt && nOldUnder != UNDERLINE_NONE ) { static sal_Char __READONLY_DATA sDoubleSpace[] = " "; - Size aSize = _GetTxtSize( rInf ); + Size aFontSize = _GetTxtSize( rInf ); const XubString &rOldStr = rInf.GetText(); XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ); @@ -974,7 +974,7 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; { if( CH_BLANK == rOldStr.GetChar( nTmp ) || bAsianFont || ( nTmp + 1 < rOldStr.Len() && pSI && - ASIAN == pSI->ScriptType( nTmp + 1 ) ) ) + i18n::ScriptType::ASIAN == pSI->ScriptType( nTmp + 1 ) ) ) ++nSpace; } @@ -986,7 +986,7 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; nSpace *= rInf.GetSpace() / SPACING_PRECISION_FACTOR; } - rInf.SetWidth( USHORT(aSize.Width() + nSpace) ); + rInf.SetWidth( USHORT(aFontSize.Width() + nSpace) ); rInf.SetText( aStr ); rInf.SetIdx( 0 ); rInf.SetLen( 2 ); @@ -1012,7 +1012,7 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) if( !rInf.GetLen() || !rInf.GetText().Len() ) return; - FontUnderline nOldUnder; + FontUnderline nOldUnder = UNDERLINE_NONE; SwUnderlineFont* pUnderFnt = 0; if( rInf.GetUnderFnt() ) @@ -1228,7 +1228,7 @@ void SwDrawTextInfo::Shift( USHORT nDir ) *************************************************************************/ SwUnderlineFont::SwUnderlineFont( SwFont& rFnt, const Point& rPoint ) - : pFnt( &rFnt ), aPos( rPoint ) + : aPos( rPoint ), pFnt( &rFnt ) { }; @@ -1247,13 +1247,13 @@ long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess, switch (nScript) { default: - case com::sun::star::i18n::ScriptType::LATIN: + case i18n::ScriptType::LATIN: nActual = SW_LATIN; break; - case com::sun::star::i18n::ScriptType::ASIAN: + case i18n::ScriptType::ASIAN: nActual = SW_CJK; break; - case com::sun::star::i18n::ScriptType::COMPLEX: + case i18n::ScriptType::COMPLEX: nActual = SW_CTL; break; } -- cgit From 5ef8a076b8bc8dbcd756cd4a69dda8bbbfd6712d Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Thu, 10 Apr 2008 14:56:56 +0000 Subject: INTEGRATION: CWS changefileheader (1.57.242); FILE MERGED 2008/04/01 15:57:31 thb 1.57.242.3: #i85898# Stripping all external header guards 2008/04/01 12:54:29 thb 1.57.242.2: #i85898# Stripping all external header guards 2008/03/31 16:54:59 rt 1.57.242.1: #i87441# Change license header to LPGL v3. --- sw/source/core/txtnode/swfont.cxx | 110 +++++++------------------------------- 1 file changed, 18 insertions(+), 92 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 880378a6badb..d922b03f8790 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -1,35 +1,30 @@ /************************************************************************* * - * OpenOffice.org - a multi-platform office productivity suite + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * $RCSfile: swfont.cxx,v $ + * Copyright 2008 by Sun Microsystems, Inc. * - * $Revision: 1.57 $ + * OpenOffice.org - a multi-platform office productivity suite * - * last change: $Author: hr $ $Date: 2007-09-27 09:27:11 $ + * $RCSfile: swfont.cxx,v $ + * $Revision: 1.58 $ * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. + * This file is part of OpenOffice.org. * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. * ************************************************************************/ @@ -37,9 +32,7 @@ #include "precompiled_sw.hxx" -#ifndef _HINTIDS_HXX #include -#endif #ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include @@ -47,112 +40,45 @@ #ifndef _OUTDEV_HXX //autogen #include #endif -#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX #include -#endif -#ifndef _UNO_LINGU_HXX #include -#endif -#ifndef _SVX_BRSHITEM_HXX //autogen #include -#endif -#ifndef _SVX_WRLMITEM_HXX //autogen #include -#endif -#ifndef _SVX_BLNKITEM_HXX //autogen #include -#endif -#ifndef _SVX_NHYPITEM_HXX //autogen #include -#endif -#ifndef _SVX_KERNITEM_HXX //autogen #include -#endif -#ifndef _SVX_CMAPITEM_HXX //autogen #include -#endif -#ifndef _SVX_LANGITEM_HXX //autogen #include -#endif -#ifndef _SVX_ESCPITEM_HXX //autogen #include -#endif -#ifndef _SVX_AKRNITEM_HXX //autogen #include -#endif -#ifndef _SVX_SHDDITEM_HXX //autogen #include -#endif -#ifndef _SVX_CHARRELIEFITEM_HXX #include -#endif #ifndef _SVX_CNTRITEM_HXX //autogen #include #endif -#ifndef _SVX_COLRITEM_HXX //autogen #include -#endif -#ifndef _SVX_CSCOITEM_HXX //autogen #include -#endif -#ifndef _SVX_CRSDITEM_HXX //autogen #include -#endif -#ifndef _SVX_UDLNITEM_HXX //autogen #include -#endif -#ifndef _SVX_WGHTITEM_HXX //autogen #include -#endif -#ifndef _SVX_POSTITEM_HXX //autogen #include -#endif -#ifndef _SVX_FHGTITEM_HXX //autogen #include -#endif -#ifndef _SVX_FONTITEM_HXX //autogen #include -#endif #ifndef _SVX_EMPHITEM_HXX //autogen #include #endif -#ifndef _SVX_CHARSCALEITEM_HXX #include -#endif -#ifndef _SVX_CHARROTATEITEM_HXX #include -#endif -#ifndef _SVX_TWOLINESITEM_HXX #include -#endif -#ifndef _SVX_CHARHIDDENITEM_HXX #include -#endif -#ifndef IDOCUMENTSETTINGACCESS_HXX_INCLUDED #include -#endif -#ifndef _WINDOW_HXX //autogen #include -#endif - -#ifndef _CHARATR_HXX #include -#endif -#ifndef _VIEWSH_HXX #include // Bildschirmabgleich -#endif -#ifndef _SWFONT_HXX #include -#endif -#ifndef _FNTCACHE_HXX #include // FontCache -#endif -#ifndef _TXTFRM_HXX #include // SwTxtFrm -#endif -#ifndef _SCRIPTINFO_HXX #include -#endif #if defined(WIN) || defined(WNT) || defined(PM2) #define FNT_LEADING_HACK -- cgit From 4126104867709da30b1a8391b4345688084eace7 Mon Sep 17 00:00:00 2001 From: Rüdiger Timm Date: Thu, 4 Sep 2008 09:22:32 +0000 Subject: INTEGRATION: CWS swenhancedfields2 (1.57.232); FILE MERGED 2008/08/07 11:51:12 b_michaelsen 1.57.232.3: fixed formatting in trvlfrm.cxx portxt.cxx portxt.hxx swfont.cxx unobkm.cxx unocoll.cxx amd unoportenum.cxx 2008/08/04 14:17:02 b_michaelsen 1.57.232.2: RESYNC: (1.57-1.58); FILE MERGED 2008/04/23 14:29:19 ama 1.57.232.1: #i33737#: Enhanced fields --- sw/source/core/txtnode/swfont.cxx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index d922b03f8790..8efc0795a6b9 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: swfont.cxx,v $ - * $Revision: 1.58 $ + * $Revision: 1.59 $ * * This file is part of OpenOffice.org. * @@ -795,6 +795,31 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) } } + if (1==rInf.GetLen() && CH_TXT_ATR_FIELDSTART==rInf.GetText().GetChar(rInf.GetIdx())) + { + xub_StrLen nOldIdx(rInf.GetIdx()); + xub_StrLen nOldLen(rInf.GetLen()); + String aNewText=String::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDSTART); + rInf.SetText( aNewText ); + rInf.SetIdx( 0 ); + rInf.SetLen( aNewText.Len() ); + aTxtSize = pLastFont->GetTextSize( rInf ); + rInf.SetIdx( nOldIdx ); + rInf.SetLen( nOldLen ); + } + else if (1==rInf.GetLen() && CH_TXT_ATR_FIELDEND==rInf.GetText().GetChar(rInf.GetIdx())) + { + xub_StrLen nOldIdx(rInf.GetIdx()); + xub_StrLen nOldLen(rInf.GetLen()); + String aNewText=String::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDEND); + rInf.SetText( aNewText ); + rInf.SetIdx( 0 ); + rInf.SetLen( aNewText.Len() ); + aTxtSize = pLastFont->GetTextSize( rInf ); + rInf.SetIdx( nOldIdx ); + rInf.SetLen( nOldLen ); + } + return aTxtSize; } -- cgit From 6ecc856f8cc90bd18b29523460570e9358792d34 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 5 Jan 2009 15:33:41 +0000 Subject: CWS-TOOLING: integrate CWS kashidafix 2008-12-15 15:31:40 +0100 hde r265507 : #i97098# 2008-12-15 15:30:52 +0100 hde r265506 : #i97098# 2008-12-10 14:08:07 +0100 fredrikh r265184 : i97098 2008-11-27 15:07:01 +0100 hdu r264493 : #i60594# only determine GetNextGlyphs() charpos if requested+available 2008-11-27 14:09:42 +0100 hdu r264487 : #i60594# simplify RTL-glyph-injection also for manual-cell-aligned cases 2008-11-26 13:25:08 +0100 fme r264379 : #i60594# Kashida fixes - syntax error 2008-11-26 13:16:22 +0100 hdu r264374 : #i60594# allow glyph injection even if there is not enough room if they can overlap 2008-11-25 16:40:20 +0100 hdu r264314 : #i60594# fix glyph-injection for PDF-export for usp>=1.6 2008-11-24 16:17:11 +0100 hdu r264254 : #i71804# adjust glyph-fallback usp-methods for new glyph-injection infrastructure 2008-11-24 16:15:30 +0100 hdu r264253 : #i71804# disable glyph-injection for glyph-fallback mixing 2008-11-20 08:29:15 +0100 fme r264027 : #i60594# Fix correction 2008-11-14 10:10:54 +0100 fme r263666 : CWS-TOOLING: rebase CWS kashidafix to trunk@263288 (milestone: DEV300:m35) 2008-10-30 16:35:30 +0100 fme r262834 : #i60594# migrate cws kashidafix to SVN. --- sw/source/core/txtnode/swfont.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 8efc0795a6b9..fc73941ad58f 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: swfont.cxx,v $ - * $Revision: 1.59 $ + * $Revision: 1.59.24.1 $ * * This file is part of OpenOffice.org. * @@ -734,6 +734,8 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) !IsSameInstance( rInf.GetpOut()->GetFont() ) ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); + SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), rInf.GetFont()->GetLanguage() ); + Size aTxtSize; xub_StrLen nLn = ( rInf.GetLen() == STRING_LEN ? rInf.GetText().Len() : rInf.GetLen() ); @@ -849,6 +851,8 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) if( !pLastFont || pLastFont->GetOwner()!=pMagic ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); + SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), rInf.GetFont()->GetLanguage() ); + Point aPos( rInf.GetPos() ); const Point &rOld = rInf.GetPos(); rInf.SetPos( aPos ); @@ -976,6 +980,8 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) if ( !pLastFont || pLastFont->GetOwner() != pMagic ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); + SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), rInf.GetFont()->GetLanguage() ); + rInf.ApplyAutoColor(); Point aPos( rInf.GetPos() ); @@ -1046,6 +1052,8 @@ xub_StrLen SwSubFont::_GetCrsrOfst( SwDrawTextInfo& rInf ) if ( !pLastFont || pLastFont->GetOwner()!=pMagic ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); + SwDigitModeModifier aDigitModeModifier( rInf.GetOut(), rInf.GetFont()->GetLanguage() ); + xub_StrLen nLn = rInf.GetLen() == STRING_LEN ? rInf.GetText().Len() : rInf.GetLen(); rInf.SetLen( nLn ); -- cgit From 478f9ad06412c910d0264f76962a6d5e1a01aaa2 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 5 Jan 2009 17:49:45 +0000 Subject: CWS-TOOLING: integrate CWS overline3 2008-12-11 15:24:46 +0100 fredrikh r265314 : i97099 2008-12-11 15:20:37 +0100 fredrikh r265313 : i97099 2008-12-11 15:18:00 +0100 fredrikh r265312 : i97099 2008-12-11 15:17:00 +0100 fredrikh r265311 : i97099 2008-12-11 15:13:20 +0100 fredrikh r265309 : i97144 2008-12-11 15:06:24 +0100 fredrikh r265306 : i97099 2008-11-24 10:41:42 +0100 fme r264213 : #i5991# Overline support 2008-11-24 10:39:53 +0100 fme r264212 : #i5991# Overline support 2008-11-24 10:02:13 +0100 fme r264209 : #5991# Overline support 2008-11-24 10:01:26 +0100 fme r264208 : #5991# Overline support 2008-11-24 09:59:11 +0100 fme r264207 : #5991# Overline support 2008-11-24 09:57:11 +0100 fme r264206 : #5991# Overline support 2008-11-14 10:36:44 +0100 fme r263667 : CWS-TOOLING: rebase CWS overline3 to trunk@263288 (milestone: DEV300:m35) 2008-11-13 16:12:13 +0100 fme r263649 : #i5991# migrate CWS overline3 to SVN. --- sw/source/core/txtnode/swfont.cxx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index fc73941ad58f..c70d8aaa4a14 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -337,9 +337,15 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_UNDERLINE, TRUE, &pItem )) { - SetUnderline( ((SvxUnderlineItem*)pItem)->GetUnderline() ); + SetUnderline( ((SvxUnderlineItem*)pItem)->GetLineStyle() ); SetUnderColor( ((SvxUnderlineItem*)pItem)->GetColor() ); } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_OVERLINE, + TRUE, &pItem )) + { + SetOverline( ((SvxOverlineItem*)pItem)->GetLineStyle() ); + SetOverColor( ((SvxOverlineItem*)pItem)->GetColor() ); + } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CROSSEDOUT, TRUE, &pItem )) SetStrikeout( ((SvxCrossedOutItem*)pItem)->GetStrikeout() ); @@ -438,6 +444,7 @@ SwFont::SwFont( const SwFont &rFont ) nActual = rFont.nActual; pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL; aUnderColor = rFont.GetUnderColor(); + aOverColor = rFont.GetOverColor(); nToxCnt = nRefCnt = 0; bFntChg = rFont.bFntChg; bOrgChg = rFont.bOrgChg; @@ -515,12 +522,14 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, aSub[SW_CTL].SetLanguage( pAttrSet->GetCTLLanguage().GetLanguage() ); } - const FontUnderline eUnderline = pAttrSet->GetUnderline().GetUnderline(); + const FontUnderline eUnderline = pAttrSet->GetUnderline().GetLineStyle(); if ( pAttrSet->GetCharHidden().GetValue() ) SetUnderline( UNDERLINE_DOTTED ); else SetUnderline( eUnderline ); SetUnderColor( pAttrSet->GetUnderline().GetColor() ); + SetOverline( pAttrSet->GetOverline().GetLineStyle() ); + SetOverColor( pAttrSet->GetOverline().GetColor() ); SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() ); SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); SetColor( pAttrSet->GetColor().GetValue() ); @@ -580,6 +589,7 @@ SwFont& SwFont::operator=( const SwFont &rFont ) delete pBackColor; pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL; aUnderColor = rFont.GetUnderColor(); + aOverColor = rFont.GetOverColor(); nToxCnt = nRefCnt = 0; bFntChg = rFont.bFntChg; bOrgChg = rFont.bOrgChg; @@ -629,7 +639,9 @@ BOOL SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice& rOut ) pLastFont->SetDevFont( pSh, rOut ); pLastFont->Lock(); - return UNDERLINE_NONE != GetUnderline() || STRIKEOUT_NONE != GetStrikeout(); + return UNDERLINE_NONE != GetUnderline() || + UNDERLINE_NONE != GetOverline() || + STRIKEOUT_NONE != GetStrikeout(); } /************************************************************************* @@ -658,6 +670,8 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice& rOut ) } if( rOut.GetTextLineColor() != aUnderColor ) rOut.SetTextLineColor( aUnderColor ); + if( rOut.GetOverlineColor() != aOverColor ) + rOut.SetOverlineColor( aOverColor ); } /************************************************************************* -- cgit From b2bebad78498c79c2a55ae5cf4ee947070c1e21b Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 10 Jul 2009 14:03:42 +0200 Subject: #i103452#: replace PRODUCT by !DBG_UTIL; replace assert by OSL_ASSERT where possible --- sw/source/core/txtnode/swfont.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index c70d8aaa4a14..b7489a8f23ef 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -88,7 +88,7 @@ #define FNT_ATM_HACK #endif -#ifndef PRODUCT +#ifdef DBG_UTIL // globale Variable SvStatistics aSvStat; #endif -- cgit From b01573861cdcb32619c7745055e14823b865a12d Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 11 Sep 2009 14:29:45 +0000 Subject: CWS-TOOLING: integrate CWS odfmetadata3 2009-09-11 Michael Stahl merge DEV300_m58 2009-09-07 Michael Stahl SwFmtFld::Modify(): do nothing on RES_OBJECTDYING 2009-08-27 Michael Stahl #i91565#, #i91566#: TextPortionEnumerationTest.java: add test document 2009-08-27 Michael Stahl #i91565#, #i91566#: add complex test: TextPortionEnumerationTest.java 2009-08-27 Michael Stahl CLiteral::initialize(): zero-length literals probably not an error 2009-08-27 Michael Stahl #i91565#, #i91566#: offapi: new InContentMetadata and MetadataField services adapt TextPortion for InContentMetadata 2009-08-27 Michael Stahl #i91564#: xmloff: load/store xml:id and RDFa for text:bookmark(-start). 2009-08-27 Michael Stahl #i91564#: sw core: add support for xml:id at bookmarks: sw::mark::Bookmark: derive from Metadatable. SwHistoryBookmark, SaveBookmark: store a MetadatableUndo. ndcopy.cxx: lcl_CopyBookmarks(): copy the xml:id. SwXBookmark: derive from MetadatableMixin. 2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: refactor ruby import so nested meta(-field) works: remove XMLRubyHint_Impl. XMLImpRubyContext_Impl::~XMLImpRubyContext_Impl(): insert ruby directly. 2009-08-27 Michael Stahl #i91565#, #i91566#: xmloff: fix text:meta(-field) import/export: new XMLTextParagraphExport::exportTextField() overload for XTextField. CreateAndInsertMark(): set xml:id after insertion. fix meta(-field) service names, bugs etc. 2009-08-27 Michael Stahl #i91565#, #i91566#: sw text formatting: paint background of meta(-field) body: SwFont: add member m_nMetaCount. txttypes.hxx: add POR_META. atrstck.cxx: handle RES_TXTATR_META(FIELD). itrform2.cxx: SwTxtFormatter::WhichTxtPor(): create new class SwMetaPortion. 2009-08-27 Michael Stahl #i91566#: sw text formatting: display meta-field prefix and suffix: SwAttrIter::GetAttr(): replace with call to GetTxtAttrForCharAt(). SwTxtFormatter::NewExtraPortion(): handle meta-field prefix. SwTxtFormatter: new member m_nHintEndIndex. SwTxtFormatter::WhichFirstPortion(): call TryNewNoLengthPortion(). SwTxtFormatter::TryNewNoLengthPortion(): new; handle suffix of meta-field. SwTxtFormatter::UnderFlow(): UGLY HACK: decrement m_nHintEndIndex. SwFldPortion: add flag m_bNoLength: portion has zero length (for suffix). 2009-08-27 Michael Stahl #i91565#, #i91566#: extend text:meta(-field) uno wrapper with XText interface: unoobj.hxx: new CursorType CURSOR_META. unoobj2.cxx: refactor SwXText implementation to ensure that when the SwXText belongs to a SwXMeta, content is always inserted inside the meta(-field). unoobj.cxx: new SwXTextCursor::ForceIntoMeta(): cursor stays in meta(-field). unometa.hxx: SwXMeta implements XText, forwarding to a member SwXMetaText. DocInsertStringSplitCR(), SwX*::attachToRange(), SwX*::DeleteAndInsert(): use FORCEHINTEXPAND hack to ensure insert into the meta(-field) at the end. 2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) uno wrapper to sw: fmtmeta.hxx, fmtatr2.cxx: new class sw::MetaField, new sw::MetaFieldManager. doc.hxx, docnew.cxx: new SwDoc::GetMetaFieldManager(). unocoll.hxx,.cxx: new SW_SERVICE_FIELDTYPE_METAFIELD, SW_SERVICE_TYPE_META. unomap.hxx,.cxx: new PROPERTY_MAP_METAFIELD. unoprnms.hxx: new UNO_NAME_META. unoport.hxx: new PORTION_META; add "InContentMetadata" prop to SwXTextPortion. new unometa.hxx: new class SwXMeta and SwXMetaField. unofield.cxx: SwXFieldEnumeration: include meta-fields. unoportenum.cxx: handle RES_TXTATR_META(FIELD) by using a portion list stack. unotext.cxx: SwXText::insertTextContent(): handle meta(-field) as attribute. 2009-08-27 Michael Stahl #i91565#, #i91566#: ndhints.cxx: remove sort number from SwTxtAttrNesting 2009-08-27 Michael Stahl #i91565#, #i91566#: add support for hints with end and CH_TXTATR to sw core: doc.hxx, docedt.cxx: replace SwDoc::Delete(), DeleteAndJoin(), ReplaceRange() with wrappers that split at left-overlapped end+CH_TXTATR hints. txatbase.hxx: new member SwTxtAttr::m_bHasDummyChar. ndtxt.hxx: rename SwTxtNode::GetTxtAttr() to GetTxtAttrForCharAt(). ndtxt.cxx: SwTxtNode::CopyText(): copy end+CH_TXTATR hints iff copy CH_TXTATR. txtatr2.cxx, thints.cxx: SwTxtMeta gets a CH_TXTATR. 2009-08-27 Michael Stahl #i91565#, #i91566#: add text:meta(-field) to sw core: txatbase.hxx: new member SwTxtAttr::m_bNesting. hintids.hxx: new ids RES_TXTATR_META, RES_TXTATR_METAFIELD. txtatr.hxx: new base class SwTxtAttrNesting. new hint SwTxtMeta. SwTxtRuby derives from SwTxtAttrNesting. txtinet.hxx: SwTxtINetFmt derives from SwTxtAttrNesting. new header fmtmeta.hxx: new pool item SwFmtMeta. new class sw::Meta. ndhints.hxx, thints.cxx: new method SwpHints::TryInsertNesting(). thints.cxx: refactoring: BuildPortions() no longer handles Ruby/Hyperlink, but TryInsertNesting(), which also handles meta(-field). SwTxtNode::InsertItem(): check if the hint is actually inserted. ndhints.cxx: sort nesting hints based on sort number. ndtxt.cxx: lcl_CopyHint(): handle copy of meta/meta-field. 2009-08-27 Michael Stahl enable expanding hints with m_bLockExpandFlag set: add new InsertFlag: INS_FORCEHINTEXPAND. add new SetAttrMode: SETATTR_FORCEHINTEXPAND. rename SwEditShell::Insert() to Insert2() because changed signature fails to compile when SwWrtShell tries to overwrite these non-virtual members... SwWrtShell::Insert() sets FOCEHINTEXPAND if range was selected/deleted. adapt SwUndoInsert to store flags. 2009-08-27 Michael Stahl change formal parameters of item insertion methods to type SetAttrMode 2009-08-27 Michael Stahl fix incorrect resetting of text attributes in SwUndoInsSection, SwUndoInserts 2009-08-27 Michael Stahl clean up SwTxtNode::CutImpl() and lcl_CopyHint() 2009-08-27 Michael Stahl rename SwDoc::Copy() to CopyRange(), and _Copy() to CopyImpl() 2009-08-27 Michael Stahl rename SwNodes::Move() to MoveRange(), and remove unused parameter 2009-08-27 Michael Stahl rename SwDoc::Move() to MoveRange()/MoveNodeRange() 2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertString(), and remove sal_Unicode variant 2009-08-27 Michael Stahl rename SwDoc::Insert() to InsertPoolItem()/InsertItemSet()/InsertSwSection() 2009-08-27 Michael Stahl rename SwDoc::Replace() to ReplaceRange() 2009-08-27 Michael Stahl remove SwDoc::Overwrite() sal_Unicode variant 2009-08-27 Michael Stahl split up SwDoc::DeleteAndJoin(): factor out DeleteAndJoinWithRedline() 2009-08-27 Michael Stahl rename overloaded SwDoc::Delete() to DeleteRange()/DeleteTOXMark() 2009-08-27 Michael Stahl rename SwTxtNode::Copy() to CopyText() 2009-08-27 Michael Stahl rename SwTxtNode::Cut() to CutText(), and _Cut() to CutImpl() 2009-08-27 Michael Stahl rename SwTxtNode::Delete() to DeleteAttribute()/DeleteAttributes() 2009-08-27 Michael Stahl rename SwTxtNode::Replace() to ReplaceText(), and remove the xub_Unicode variant 2009-08-27 Michael Stahl rename SwTxtNode::Erase() to EraseText() 2009-08-27 Michael Stahl rename SwTxtNode::Insert() to InsertText(), and remove the xub_Unicode variant 2009-08-27 Michael Stahl clean up SwTxtNode::Update() 2009-08-27 Michael Stahl remove SwTxtAttr::RemoveFromPool() and make destructor non-public, to be invoked by new method SwTxtAttr::Destroy() 2009-08-27 Michael Stahl ensure that SwDoc::Insert() for item (set) returns success indicator: replace SwRegHistory constructor with method InsertItems(), returning bool. refactor InsAttr() so that it checks if InsertItems() succeeds. 2009-08-27 Michael Stahl move SwXTextPortionEnumeration from unoobj.hxx to unoport.hxx 2009-08-27 Michael Stahl add missing SolarMutex in SwXTextPortion methods 2009-08-27 Michael Stahl SwXTextPortion: new member m_xTextField (so the TextField property need not be returned indirectly via SwUnoCursorHelper). factor out function CreateSwXTextField(). 2009-08-27 Michael Stahl SwXTextPortion: remove PORTION_CONTROL_CHAR and implementation of XTextField 2009-08-27 Michael Stahl remove obsolete hint SwTxtHardBlank and formats SwFmtHardBlank/SwFmtSoftHyph 2009-08-27 Michael Stahl clean up SwTxtAttr and friends: remove many accessor methods for obsolete (due to autofmt) char format items. remove unused flag SwTxtAttr::m_bDontMergeAttr. MakeRedlineTxtAttr() now dedicated function, no longer calls MakeTxtAttr(). 2009-08-27 Michael Stahl remove obsolete attribute SwTxt2Lines 2009-08-27 Michael Stahl SwXTextPortionEnumeration: finish refactoring CreatePortions change ExportHints so it always returns a text portion for hint w/ CH_TXTATR. remove special case for handling end of paragraph. unfortunately had to refactor the fieldmarks export as well (got in the way). 2009-08-27 Michael Stahl SwXTextPortionEnumeration: refactor CreatePortions: frames export extract function ExportFrames() from CreatePortions(). remove (un)dead code that calls evil MovePara(fnParaCurr, fnParaEnd) 2009-08-27 Michael Stahl clean up SwXParaFrameEnumeration 2009-08-27 Michael Stahl CollectFrameAtNode: replace SwDependArr with STL based FrameDependList_t 2009-08-27 Michael Stahl SwXTextPortionEnumeration: tweak refmark/toxmark export so ExportHints returns the portion for point marks 2009-08-27 Michael Stahl clean up SwXTextPortionEnumeration: prefix members, remove casts, replace SvWeirdArray with STL, etc. make CreatePortions() method a function, and remove lots of members. extract fieldmarks function from CreatePortions. 2009-08-27 Michael Stahl remove FOREACHUNOPAM_START/END macros 2009-08-27 Michael Stahl clean up SwXTextPortion: prefix members, remove casts, etc. remove SwXRubyPortion: replace it with another SwXTextPortion constructor 2009-08-27 Michael Stahl #i102541# SwXReferenceMark::InsertRefMark(): use flag SETATTR_DONTEXPAND 2009-08-27 Michael Stahl rename SwTxtNode::Insert to SwTxtNode::InsertHint, and fix constness in SwTxtNode::InsertItem 2009-08-27 Michael Stahl turn SwTxtNode::MakeTxtAttr() methods into global functions in ndhints.hxx 2009-08-27 Michael Stahl remove obsolete sw/inc/bookmrk.hxx 2009-08-27 Michael Stahl pam.cxx: fix ComparePosition functions (returned wrong result in one case) 2009-08-27 Michael Stahl #i103613# only import RDF metadata on normal open of a document 2009-09-11 kz CWS-TOOLING: integrate CWS impress176 2009-09-08 20:18:24 +0200 sj r275957 : fixed warning (shadowed variable) 2009-09-08 18:02:05 +0200 cl r275948 : #i104315# added missing tab pages 2009-09-08 17:35:18 +0200 cl r275947 : #i104866# fixed angle import 2009-09-08 17:32:53 +0200 cl r275946 : #i104841# fixed angle import 2009-09-08 17:01:25 +0200 cl r275943 : #i103935# fixed the SID_EVENTCONFIG mess 2009-09-08 14:32:57 +0200 sj r275928 : #i104685# only comments 2009-09-07 12:37:36 +0200 sj r275886 : #i104683# fixed import of bold/italic attributes for normal text shapes 2009-09-04 15:07:46 +0200 sj r275808 : #104689# fixed bullet color problem 2009-09-03 15:25:07 +0200 sj r275753 : #160200# added vertical alignment of table cells 2009-09-11 kz CWS-TOOLING: integrate CWS dv14 2009-09-10 15:16:32 +0200 sg r276035 : #160513# updated wfs scheme to accept ports 2009-09-10 07:41:47 +0200 dv r276019 : #i104942# Better renaming algorithmen 2009-08-31 13:41:11 +0200 dv r275604 : #160505# Setting APP1PRODUCTNAME must not overwrite APP1PRODUCTDEF 2009-09-11 kz CWS-TOOLING: integrate CWS jl131 2009-09-02 16:42:40 +0200 jl r275720 : #i97896# 2009-08-31 13:01:53 +0200 jl r275599 : CWS-TOOLING: rebase CWS jl131 to trunk@275331 (milestone: DEV300:m56) 2009-07-31 14:35:30 +0200 jl r274531 : CWS-TOOLING: rebase CWS jl131 to trunk@274203 (milestone: DEV300:m53) 2009-07-23 14:20:32 +0200 jl r274272 : #i79839# better error text when trying to modify shared layer without having write permission, eg. unopkg add --shared, unopkg remove --shared, unopkg reinstall --shared 2009-07-22 16:38:02 +0200 jl r274252 : #i97896# localize error message for lock file 2009-07-22 16:37:22 +0200 jl r274251 : #i80462# unprecise wording in updatedialog 2009-07-22 16:36:06 +0200 jl r274250 : #i97896# localize error message for lock file 2009-07-22 16:35:20 +0200 jl r274249 : #i97896# localize error message for lock file 2009-07-22 15:07:30 +0200 jl r274242 : #i98873# minimum java version is 1.5 since OOo 3.0 2009-09-11 kz CWS-TOOLING: integrate CWS changehc 2009-08-31 19:38:50 +0200 pl r275633 : remove dbug printf 2009-08-31 17:41:50 +0200 pl r275623 : CWS-TOOLING: rebase CWS changehc to trunk@275331 (milestone: DEV300:m56) 2009-07-15 19:45:46 +0200 pl r274028 : #i35482# use HC flag to decide high contrast mode 2009-07-15 17:40:52 +0200 pl r274020 : #i35482# use HC flag to decide high contrast mode 2009-07-15 17:39:50 +0200 pl r274019 : #i35482# update autohc correctly in MergeSystemSettings 2009-07-15 17:38:57 +0200 pl r274018 : #i35482# update autohc correctly in MergeSystemSettings 2009-09-11 kz CWS-TOOLING: integrate CWS notes10 2009-08-24 07:25:57 +0200 mod r275287 : 2009-07-26 02:38:32 +0200 mod r274343 : #i#i103645# 2009-07-26 02:01:53 +0200 mod r274342 : #i103645# 2009-07-26 01:52:42 +0200 mod r274341 : #i103490# 2009-07-22 08:31:48 +0200 mod r274215 : #i103373# 2009-07-15 00:55:11 +0200 mod r273987 : #i101419# 2009-07-14 07:07:55 +0200 mod r273956 : #i101419# 2009-07-14 07:07:43 +0200 mod r273955 : #i101419# 2009-07-14 07:02:10 +0200 mod r273954 : changes from notes9 2009-07-14 06:14:25 +0200 mod r273953 : #i103476# 2009-09-11 kz CWS-TOOLING: integrate CWS ab70 2009-09-10 15:12:54 +0200 jsk r276034 : #i85434# - mandatory automatic update test 2009-09-10 15:11:06 +0200 jsk r276033 : #i85434# - mandatory automatic update test 2009-09-02 09:49:24 +0200 ab r275698 : #i85434# Dialog Import 2009-09-11 kz CWS-TOOLING: integrate CWS hb32bugs02 2009-09-02 Henning Brinkmann #i102420# revert changes 2009-08-26 Henning Brinkmann merged DEV300_m56 2009-08-19 Henning Brinkmann merged DEV300_m55 2009-08-14 Henning Brinkmann merged changes from wntmsci12 2009-08-12 Henning Brinkmann Implemented NoSpaceEdit constructor and destructor in .cxx to allow compile with debug on wntmsci12. 2009-08-12 Henning Brinkmann Added some SW_DLLPUBLIC to make compilable on wntmsci12. 2009-08-11 Henning Brinkmann #i102420# dbg_out: surround output for SwNodes with . 2009-08-10 Henning Brinkmann #i102420# rewritten debug output for SwNodes. 2009-08-07 Henning Brinkmann #i102420# debug _MoveNodes: output the destination, too. Break after two iterations. 2009-08-07 Henning Brinkmann #i102420# _MoveNodes: Additionally check if destination index is inside source => false Check if current range was already handled => loop Debug output current range 2009-08-06 Henning Brinkmann merged DEV300_m54 2009-08-06 Henning Brinkmann added master fix 2009-08-06 Henning Brinkmann debug output for SwNodeRange 2009-08-04 Henning Brinkmann #i102844# robustness: check for NULL pointer to prevent crash 2009-08-03 Henning Brinkmann #i103475# applied patch and verified 2009-08-03 Henning Brinkmann Removed code preventing build of sw with DEBUG. 2009-09-11 convert-repo update tags 2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300 2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree. 2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23 2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite 2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix 2009-09-10 kz CWS-TOOLING: integrate CWS mh232 2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch 2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD 2009-08-26 03:11:20 +0200 mh r275383 : #i39230 2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field 2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name 2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl 2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam 2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613# 2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3 2009-09-10 kz CWS-TOOLING: integrate CWS tkr24 2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT 2009-09-10 releng #i10000# change KeyMapping to SingletonRef 2009-09-11 convert-repo update tags 2009-09-10 kz CWS-TOOLING: integrate CWS os2port06dev300 2009-09-05 22:49:00 +0200 ydario r275858 : #i99588# applied os2port06 diff to DEV300 tree. 2009-09-10 kz CWS-TOOLING: integrate CWS mingwport23 2009-08-29 07:07:53 +0200 tono r275555 : i#104522: mingw port graphite 2009-08-29 07:07:26 +0200 tono r275554 : i#104522: mingw port printf format fix 2009-09-10 kz CWS-TOOLING: integrate CWS mh232 2009-08-26 03:52:57 +0200 mh r275385 : #i102182# FreeBSD patch 2009-08-26 03:43:20 +0200 mh r275384 : #i101333# patch for FreeBSD 2009-08-26 03:11:20 +0200 mh r275383 : #i39230 2009-08-26 03:07:51 +0200 mh r275382 : #i39230# more space for initials field 2009-08-26 02:41:19 +0200 mh r275380 : #i39230# use vos::osecurity for reading the user name 2009-08-18 22:06:00 +0200 mh r275130 : #i104243#, line ending problem with newer perl 2009-08-18 21:53:21 +0200 mh r275129 : #i39230# read initials via getpwnam 2009-08-18 21:34:05 +0200 mh r275128 : enable CAIROCANVAS for Linux and Mac, #i88613# 2009-08-17 18:02:59 +0200 mh r275067 : #i95498# make compile with gcc3 2009-09-10 kz CWS-TOOLING: integrate CWS tkr24 2009-09-07 14:31:06 +0200 is r275898 : #160081# adding NO_LICENSE_INTO_COPYRIGHT 2009-09-10 releng #i10000# change KeyMapping to SingletonRef --- sw/source/core/txtnode/swfont.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index c70d8aaa4a14..3c2a643099cb 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -445,7 +445,9 @@ SwFont::SwFont( const SwFont &rFont ) pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL; aUnderColor = rFont.GetUnderColor(); aOverColor = rFont.GetOverColor(); - nToxCnt = nRefCnt = 0; + nToxCnt = 0; + nRefCnt = 0; + m_nMetaCount = 0; bFntChg = rFont.bFntChg; bOrgChg = rFont.bOrgChg; bPaintBlank = rFont.bPaintBlank; @@ -461,7 +463,9 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, const IDocumentSettingAccess* pIDocumentSettingAccess ) { nActual = SW_LATIN; - nToxCnt = nRefCnt = 0; + nToxCnt = 0; + nRefCnt = 0; + m_nMetaCount = 0; bPaintBlank = FALSE; bPaintWrong = FALSE; bURL = FALSE; @@ -590,7 +594,9 @@ SwFont& SwFont::operator=( const SwFont &rFont ) pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL; aUnderColor = rFont.GetUnderColor(); aOverColor = rFont.GetOverColor(); - nToxCnt = nRefCnt = 0; + nToxCnt = 0; + nRefCnt = 0; + m_nMetaCount = 0; bFntChg = rFont.bFntChg; bOrgChg = rFont.bOrgChg; bPaintBlank = rFont.bPaintBlank; -- cgit From 55f1f483cfa4cde111593782f17c514a0056d7f0 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 8 Jan 2010 18:32:51 +0100 Subject: #i107450#: build all other modules with new editeng lib --- sw/source/core/txtnode/swfont.cxx | 52 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 7213c1e60efd..f487fbbe153c 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -41,36 +41,36 @@ #include #endif #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifndef _SVX_CNTRITEM_HXX //autogen -#include +#include #endif -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #ifndef _SVX_EMPHITEM_HXX //autogen -#include +#include #endif -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include -- cgit From 1a359bd2a8d7621574942287703e7df69ebffa16 Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Fri, 12 Feb 2010 15:01:35 +0100 Subject: changefileheader2: #i109125#: change source file copyright notice from Sun Microsystems to Oracle; remove CVS style keywords (RCSfile, Revision) --- sw/source/core/txtnode/swfont.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 7213c1e60efd..067416a26421 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: swfont.cxx,v $ - * $Revision: 1.59.24.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify -- cgit From f62a5373f066336cad6be2a15071fc073d8b8dc4 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Fri, 25 Jun 2010 13:15:03 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for WIN,W30,W31 --- sw/source/core/txtnode/swfont.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 49e111e9053f..02c21242a220 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -77,11 +77,11 @@ #include // SwTxtFrm #include -#if defined(WIN) || defined(WNT) || defined(PM2) +#if defined(WNT) || defined(PM2) #define FNT_LEADING_HACK #endif -#if defined(WIN) || defined(WNT) +#if defined(WNT) #define FNT_ATM_HACK #endif -- cgit From a4781ea4a180171d837bbffec5dc16b7f2bc7138 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Mon, 4 Oct 2010 17:00:08 +0200 Subject: remove include guards using fixguard.py --- sw/source/core/txtnode/swfont.cxx | 6 ------ 1 file changed, 6 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 49e111e9053f..c1b8b62ea234 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -34,9 +34,7 @@ #ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include #endif -#ifndef _OUTDEV_HXX //autogen #include -#endif #include #include #include @@ -50,9 +48,7 @@ #include #include #include -#ifndef _SVX_CNTRITEM_HXX //autogen #include -#endif #include #include #include @@ -61,9 +57,7 @@ #include #include #include -#ifndef _SVX_EMPHITEM_HXX //autogen #include -#endif #include #include #include -- cgit From aa42876a0e79444577cdf9a4ca4297b6dd7bf792 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 5 Oct 2010 15:55:31 +0200 Subject: more removed include guards using fixguard.py --- sw/source/core/txtnode/swfont.cxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index c1b8b62ea234..5808d1ddefc9 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -31,9 +31,7 @@ #include -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include -#endif #include #include #include -- cgit From 61355e51b855157f62ff814184f0ea3c5b68f1d7 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 14 Oct 2010 08:30:41 +0200 Subject: Add vim/emacs modelines to all source files Fixes #fdo30794 Based on bin/add-modelines script (originally posted in mail 1286706307.1871.1399280959@webmail.messagingengine.com) Signed-off-by: Sebastian Spaeth --- sw/source/core/txtnode/swfont.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 5808d1ddefc9..1c56676eadb7 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.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. @@ -1236,3 +1237,5 @@ long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess, rMutableOut.SetFont(aOldFont); return nHeight; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit From c16ba8a04fd4599e439e7e039705e41691c43acb Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Thu, 25 Nov 2010 17:08:45 +0100 Subject: Removed DBG_UTIL from sw * Fixed the different dbglevel builds * This needed to change all the sw local ASSERT to OSL_ENSURE... --- sw/source/core/txtnode/swfont.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 1c56676eadb7..28f483a3f6ae 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -78,7 +78,7 @@ #define FNT_ATM_HACK #endif -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 // globale Variable SvStatistics aSvStat; #endif @@ -115,7 +115,7 @@ USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) break; #if OSL_DEBUG_LEVEL > 1 default : - ASSERT( sal_False, "Unsupported direction" ); + OSL_ENSURE( sal_False, "Unsupported direction" ); break; #endif } @@ -142,7 +142,7 @@ USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat ) break; #if OSL_DEBUG_LEVEL > 1 default : - ASSERT( sal_False, "Unsupported direction" ); + OSL_ENSURE( sal_False, "Unsupported direction" ); break; #endif } @@ -419,7 +419,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, } bPaintBlank = FALSE; bPaintWrong = FALSE; - ASSERT( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" ); + OSL_ENSURE( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" ); } /************************************************************************* @@ -1162,8 +1162,10 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) // used during painting of small capitals void SwDrawTextInfo::Shift( USHORT nDir ) { - ASSERT( bPos, "DrawTextInfo: Undefined Position" ); - ASSERT( bSize, "DrawTextInfo: Undefined Width" ); +#if OSL_DEBUG_LEVEL > 1 + OSL_ENSURE( bPos, "DrawTextInfo: Undefined Position" ); + OSL_ENSURE( bSize, "DrawTextInfo: Undefined Width" ); +#endif const BOOL bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) != ( 0 != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) ); @@ -1178,7 +1180,7 @@ void SwDrawTextInfo::Shift( USHORT nDir ) ((Point*)pPos)->X() += GetSize().Width(); break; case 900 : - ASSERT( ((Point*)pPos)->Y() >= GetSize().Width(), "Going underground" ); + OSL_ENSURE( ((Point*)pPos)->Y() >= GetSize().Width(), "Going underground" ); ((Point*)pPos)->Y() -= GetSize().Width(); break; case 1800 : -- cgit From b343ca0dfbae0731ac0ce89d14bc9c8fc667825d Mon Sep 17 00:00:00 2001 From: Gert Faller Date: Sun, 12 Dec 2010 10:15:19 +0100 Subject: change of __READONLY_DATA define to const --- sw/source/core/txtnode/swfont.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 28f483a3f6ae..981a4e621376 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -917,7 +917,7 @@ void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) if( pUnderFnt && nOldUnder != UNDERLINE_NONE ) { -static sal_Char __READONLY_DATA sDoubleSpace[] = " "; +static sal_Char const sDoubleSpace[] = " "; Size aFontSize = _GetTxtSize( rInf ); const XubString &rOldStr = rInf.GetText(); XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ); @@ -1028,7 +1028,7 @@ void SwSubFont::_DrawStretchText( SwDrawTextInfo &rInf ) if( pUnderFnt && nOldUnder != UNDERLINE_NONE ) { -static sal_Char __READONLY_DATA sDoubleSpace[] = " "; +static sal_Char const sDoubleSpace[] = " "; const XubString &rOldStr = rInf.GetText(); XubString aStr( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ); xub_StrLen nOldIdx = rInf.GetIdx(); -- cgit From 7f33ed417b2e29e5470724ea76967f64699a2662 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 17 Jan 2011 15:06:54 +0100 Subject: removetooltypes01: #i112600# Remove tools types from sw --- sw/source/core/txtnode/swfont.cxx | 166 +++++++++++++++++++------------------- 1 file changed, 83 insertions(+), 83 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 02c21242a220..24f5c097f7d4 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -100,12 +100,12 @@ void SwFont::SetBackColor( Color* pNewColor ) { delete pBackColor; pBackColor = pNewColor; - bFntChg = TRUE; + bFntChg = sal_True; aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; } // maps directions for vertical layout -USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) +sal_uInt16 MapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat ) { if ( bVertFormat ) { @@ -132,7 +132,7 @@ USHORT MapDirection( USHORT nDir, const BOOL bVertFormat ) // maps the absolute direction set at the font to its logical conterpart // in the rotated environment -USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat ) +sal_uInt16 UnMapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat ) { if ( bVertFormat ) { @@ -157,19 +157,19 @@ USHORT UnMapDirection( USHORT nDir, const BOOL bVertFormat ) return nDir; } -USHORT SwFont::GetOrientation( const BOOL bVertFormat ) const +sal_uInt16 SwFont::GetOrientation( const sal_Bool bVertFormat ) const { return UnMapDirection( aSub[nActual].GetOrientation(), bVertFormat ); } -void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) +void SwFont::SetVertical( sal_uInt16 nDir, const sal_Bool bVertFormat ) { // map direction if frame has vertical layout nDir = MapDirection( nDir, bVertFormat ); if( nDir != aSub[0].GetOrientation() ) { - bFntChg = TRUE; + bFntChg = sal_True; aSub[0].SetVertical( nDir, bVertFormat ); aSub[1].SetVertical( nDir, bVertFormat || nDir > 1000 ); aSub[2].SetVertical( nDir, bVertFormat ); @@ -205,11 +205,11 @@ void SwFont::SetVertical( USHORT nDir, const BOOL bVertFormat ) *************************************************************************/ /************************************************************************* - * SwSubFont::CalcEscAscent( const USHORT nOldAscent ) + * SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) *************************************************************************/ // nEsc ist der Prozentwert -USHORT SwSubFont::CalcEscAscent( const USHORT nOldAscent ) const +sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const { if( DFLT_ESC_AUTO_SUPER != GetEscapement() && DFLT_ESC_AUTO_SUB != GetEscapement() ) @@ -217,7 +217,7 @@ USHORT SwSubFont::CalcEscAscent( const USHORT nOldAscent ) const const long nAscent = nOldAscent + ( (long) nOrgHeight * GetEscapement() ) / 100L; if ( nAscent>0 ) - return ( Max( USHORT (nAscent), nOrgAscent )); + return ( Max( sal_uInt16 (nAscent), nOrgAscent )); } return nOrgAscent; } @@ -236,7 +236,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, { const SfxPoolItem* pItem; if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_FONT, - TRUE, &pItem )) + sal_True, &pItem )) { const SvxFontItem *pFont = (const SvxFontItem *)pItem; aSub[SW_LATIN].SetFamily( pFont->GetFamily() ); @@ -246,7 +246,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, aSub[SW_LATIN].Font::SetCharSet( pFont->GetCharSet() ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_FONTSIZE, - TRUE, &pItem )) + sal_True, &pItem )) { const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; aSub[SW_LATIN].SvxFont::SetPropr( 100 ); @@ -256,17 +256,17 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, aSub[SW_LATIN].SetSize( aTmpSize ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_POSTURE, - TRUE, &pItem )) + sal_True, &pItem )) aSub[SW_LATIN].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_WEIGHT, - TRUE, &pItem )) + sal_True, &pItem )) aSub[SW_LATIN].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_LANGUAGE, - TRUE, &pItem )) + sal_True, &pItem )) aSub[SW_LATIN].SetLanguage( ((SvxLanguageItem*)pItem)->GetLanguage() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_FONT, - TRUE, &pItem )) + sal_True, &pItem )) { const SvxFontItem *pFont = (const SvxFontItem *)pItem; aSub[SW_CJK].SetFamily( pFont->GetFamily() ); @@ -276,7 +276,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, aSub[SW_CJK].Font::SetCharSet( pFont->GetCharSet() ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_FONTSIZE, - TRUE, &pItem )) + sal_True, &pItem )) { const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; aSub[SW_CJK].SvxFont::SetPropr( 100 ); @@ -286,13 +286,13 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, aSub[SW_CJK].SetSize( aTmpSize ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_POSTURE, - TRUE, &pItem )) + sal_True, &pItem )) aSub[SW_CJK].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_WEIGHT, - TRUE, &pItem )) + sal_True, &pItem )) aSub[SW_CJK].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CJK_LANGUAGE, - TRUE, &pItem )) + sal_True, &pItem )) { LanguageType eNewLang = ((SvxLanguageItem*)pItem)->GetLanguage(); aSub[SW_CJK].SetLanguage( eNewLang ); @@ -302,7 +302,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONT, - TRUE, &pItem )) + sal_True, &pItem )) { const SvxFontItem *pFont = (const SvxFontItem *)pItem; aSub[SW_CTL].SetFamily( pFont->GetFamily() ); @@ -312,7 +312,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, aSub[SW_CTL].Font::SetCharSet( pFont->GetCharSet() ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_FONTSIZE, - TRUE, &pItem )) + sal_True, &pItem )) { const SvxFontHeightItem *pHeight = (const SvxFontHeightItem *)pItem; aSub[SW_CTL].SvxFont::SetPropr( 100 ); @@ -322,53 +322,53 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, aSub[SW_CTL].SetSize( aTmpSize ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_POSTURE, - TRUE, &pItem )) + sal_True, &pItem )) aSub[SW_CTL].Font::SetItalic( ((SvxPostureItem*)pItem)->GetPosture() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_WEIGHT, - TRUE, &pItem )) + sal_True, &pItem )) aSub[SW_CTL].Font::SetWeight( ((SvxWeightItem*)pItem)->GetWeight() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CTL_LANGUAGE, - TRUE, &pItem )) + sal_True, &pItem )) aSub[SW_CTL].SetLanguage( ((SvxLanguageItem*)pItem)->GetLanguage() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_UNDERLINE, - TRUE, &pItem )) + sal_True, &pItem )) { SetUnderline( ((SvxUnderlineItem*)pItem)->GetLineStyle() ); SetUnderColor( ((SvxUnderlineItem*)pItem)->GetColor() ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_OVERLINE, - TRUE, &pItem )) + sal_True, &pItem )) { SetOverline( ((SvxOverlineItem*)pItem)->GetLineStyle() ); SetOverColor( ((SvxOverlineItem*)pItem)->GetColor() ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CROSSEDOUT, - TRUE, &pItem )) + sal_True, &pItem )) SetStrikeout( ((SvxCrossedOutItem*)pItem)->GetStrikeout() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_COLOR, - TRUE, &pItem )) + sal_True, &pItem )) SetColor( ((SvxColorItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_EMPHASIS_MARK, - TRUE, &pItem )) + sal_True, &pItem )) SetEmphasisMark( ((SvxEmphasisMarkItem*)pItem)->GetEmphasisMark() ); - SetTransparent( TRUE ); + SetTransparent( sal_True ); SetAlign( ALIGN_BASELINE ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CONTOUR, - TRUE, &pItem )) + sal_True, &pItem )) SetOutline( ((SvxContourItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, - TRUE, &pItem )) + sal_True, &pItem )) SetShadow( ((SvxShadowedItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_RELIEF, - TRUE, &pItem )) + sal_True, &pItem )) SetRelief( (FontRelief)((SvxCharReliefItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOWED, - TRUE, &pItem )) + sal_True, &pItem )) SetPropWidth(((SvxShadowedItem*)pItem)->GetValue() ? 50 : 100 ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_AUTOKERN, - TRUE, &pItem )) + sal_True, &pItem )) { if( ((SvxAutoKernItem*)pItem)->GetValue() ) { @@ -381,11 +381,11 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, SetAutoKern( 0 ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_WORDLINEMODE, - TRUE, &pItem )) + sal_True, &pItem )) SetWordLineMode( ((SvxWordLineModeItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_ESCAPEMENT, - TRUE, &pItem )) + sal_True, &pItem )) { const SvxEscapementItem *pEsc = (const SvxEscapementItem *)pItem; SetEscapement( pEsc->GetEsc() ); @@ -393,39 +393,39 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, SetProportion( pEsc->GetProp() ); } if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_CASEMAP, - TRUE, &pItem )) + sal_True, &pItem )) SetCaseMap( ((SvxCaseMapItem*)pItem)->GetCaseMap() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_KERNING, - TRUE, &pItem )) + sal_True, &pItem )) SetFixKerning( ((SvxKerningItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_NOHYPHEN, - TRUE, &pItem )) + sal_True, &pItem )) SetNoHyph( ((SvxNoHyphenItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BLINK, - TRUE, &pItem )) + sal_True, &pItem )) SetBlink( ((SvxBlinkItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_ROTATE, - TRUE, &pItem )) + sal_True, &pItem )) SetVertical( ((SvxCharRotateItem*)pItem)->GetValue() ); if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND, - TRUE, &pItem )) + sal_True, &pItem )) pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() ); else pBackColor = NULL; const SfxPoolItem* pTwoLinesItem = 0; if( SFX_ITEM_SET == - pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, TRUE, &pTwoLinesItem )) + pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, sal_True, &pTwoLinesItem )) if ( ((SvxTwoLinesItem*)pTwoLinesItem)->GetValue() ) SetVertical( 0 ); } else { Invalidate(); - bNoHyph = FALSE; - bBlink = FALSE; + bNoHyph = sal_False; + bBlink = sal_False; } - bPaintBlank = FALSE; - bPaintWrong = FALSE; + bPaintBlank = sal_False; + bPaintWrong = sal_False; ASSERT( aSub[SW_LATIN].IsTransparent(), "SwFont: Transparent revolution" ); } @@ -448,7 +448,7 @@ SwFont::SwFont( const SwFont &rFont ) bFntChg = rFont.bFntChg; bOrgChg = rFont.bOrgChg; bPaintBlank = rFont.bPaintBlank; - bPaintWrong = FALSE; + bPaintWrong = sal_False; bURL = rFont.bURL; bGreyWave = rFont.bGreyWave; bNoColReplace = rFont.bNoColReplace; @@ -463,14 +463,14 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, nToxCnt = 0; nRefCnt = 0; m_nMetaCount = 0; - bPaintBlank = FALSE; - bPaintWrong = FALSE; - bURL = FALSE; - bGreyWave = FALSE; - bNoColReplace = FALSE; + bPaintBlank = sal_False; + bPaintWrong = sal_False; + bURL = sal_False; + bGreyWave = sal_False; + bNoColReplace = sal_False; bNoHyph = pAttrSet->GetNoHyphenHere().GetValue(); bBlink = pAttrSet->GetBlink().GetValue(); - bOrgChg = TRUE; + bOrgChg = sal_True; { const SvxFontItem& rFont = pAttrSet->GetFont(); aSub[SW_LATIN].SetFamily( rFont.GetFamily() ); @@ -534,7 +534,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, SetEmphasisMark( pAttrSet->GetEmphasisMark().GetEmphasisMark() ); SetStrikeout( pAttrSet->GetCrossedOut().GetStrikeout() ); SetColor( pAttrSet->GetColor().GetValue() ); - SetTransparent( TRUE ); + SetTransparent( sal_True ); SetAlign( ALIGN_BASELINE ); SetOutline( pAttrSet->GetContour().GetValue() ); SetShadow( pAttrSet->GetShadowed().GetValue() ); @@ -558,7 +558,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, SetFixKerning( pAttrSet->GetKerning().GetValue() ); const SfxPoolItem* pItem; if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND, - TRUE, &pItem )) + sal_True, &pItem )) pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() ); else pBackColor = NULL; @@ -597,7 +597,7 @@ SwFont& SwFont::operator=( const SwFont &rFont ) bFntChg = rFont.bFntChg; bOrgChg = rFont.bOrgChg; bPaintBlank = rFont.bPaintBlank; - bPaintWrong = FALSE; + bPaintWrong = sal_False; bURL = rFont.bURL; bGreyWave = rFont.bGreyWave; bNoColReplace = rFont.bNoColReplace; @@ -610,19 +610,19 @@ SwFont& SwFont::operator=( const SwFont &rFont ) * SwFont::GoMagic() *************************************************************************/ -void SwFont::GoMagic( ViewShell *pSh, BYTE nWhich ) +void SwFont::GoMagic( ViewShell *pSh, sal_uInt8 nWhich ) { SwFntAccess aFntAccess( aSub[nWhich].pMagic, aSub[nWhich].nFntIndex, - &aSub[nWhich], pSh, TRUE ); + &aSub[nWhich], pSh, sal_True ); } /************************************************************************* * SwSubFont::IsSymbol() *************************************************************************/ -BOOL SwSubFont::IsSymbol( ViewShell *pSh ) +sal_Bool SwSubFont::IsSymbol( ViewShell *pSh ) { - SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, FALSE ); + SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, sal_False ); return aFntAccess.Get()->IsSymbol(); } @@ -630,11 +630,11 @@ BOOL SwSubFont::IsSymbol( ViewShell *pSh ) * SwSubFont::ChgFnt() *************************************************************************/ -BOOL SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice& rOut ) +sal_Bool SwSubFont::ChgFnt( ViewShell *pSh, OutputDevice& rOut ) { if ( pLastFont ) pLastFont->Unlock(); - SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, TRUE ); + SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh, sal_True ); SV_STAT( nChangeFont ); pLastFont = aFntAccess.Get(); @@ -655,7 +655,7 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice& rOut ) { if( bOrgChg && aSub[nActual].IsEsc() ) { - const BYTE nOldProp = aSub[nActual].GetPropr(); + const sal_uInt8 nOldProp = aSub[nActual].GetPropr(); SetProportion( 100 ); ChgFnt( pSh, rOut ); SwFntAccess aFntAccess( aSub[nActual].pMagic, aSub[nActual].nFntIndex, @@ -663,7 +663,7 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice& rOut ) aSub[nActual].nOrgHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut ); aSub[nActual].nOrgAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); SetProportion( nOldProp ); - bOrgChg = FALSE; + bOrgChg = sal_False; } if( bFntChg ) @@ -685,16 +685,16 @@ void SwFont::ChgPhysFnt( ViewShell *pSh, OutputDevice& rOut ) * T2_height-T2_ascent - (Esc * T1_height) *************************************************************************/ -USHORT SwSubFont::CalcEscHeight( const USHORT nOldHeight, - const USHORT nOldAscent ) const +sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight, + const sal_uInt16 nOldAscent ) const { if( DFLT_ESC_AUTO_SUPER != GetEscapement() && DFLT_ESC_AUTO_SUB != GetEscapement() ) { long nDescent = nOldHeight - nOldAscent - ( (long) nOrgHeight * GetEscapement() ) / 100L; - const USHORT nDesc = ( nDescent>0 ) ? Max ( USHORT(nDescent), - USHORT(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent; + const sal_uInt16 nDesc = ( nDescent>0 ) ? Max ( sal_uInt16(nDescent), + sal_uInt16(nOrgHeight - nOrgAscent) ) : nOrgHeight - nOrgAscent; return ( nDesc + CalcEscAscent( nOldAscent ) ); } return nOrgHeight; @@ -713,9 +713,9 @@ short SwSubFont::_CheckKerning( ) * SwSubFont::GetAscent() *************************************************************************/ -USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice& rOut ) +sal_uInt16 SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice& rOut ) { - USHORT nAscent; + sal_uInt16 nAscent; SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh ); nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); if( GetEscapement() ) @@ -727,14 +727,14 @@ USHORT SwSubFont::GetAscent( ViewShell *pSh, const OutputDevice& rOut ) * SwSubFont::GetHeight() *************************************************************************/ -USHORT SwSubFont::GetHeight( ViewShell *pSh, const OutputDevice& rOut ) +sal_uInt16 SwSubFont::GetHeight( ViewShell *pSh, const OutputDevice& rOut ) { SV_STAT( nGetTextSize ); SwFntAccess aFntAccess( pMagic, nFntIndex, this, pSh ); - const USHORT nHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut ); + const sal_uInt16 nHeight = aFntAccess.Get()->GetFontHeight( pSh, rOut ); if ( GetEscapement() ) { - const USHORT nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); + const sal_uInt16 nAscent = aFntAccess.Get()->GetFontAscent( pSh, rOut ); return CalcEscHeight( nHeight, nAscent ); // + nLeading; } return nHeight; // + nLeading; @@ -807,10 +807,10 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) // hochgestellt, muss seine effektive Hoehe melden. if( GetEscapement() ) { - const USHORT nAscent = pLastFont->GetFontAscent( rInf.GetShell(), + const sal_uInt16 nAscent = pLastFont->GetFontAscent( rInf.GetShell(), rInf.GetOut() ); aTxtSize.Height() = - (long)CalcEscHeight( (USHORT)aTxtSize.Height(), nAscent); + (long)CalcEscHeight( (sal_uInt16)aTxtSize.Height(), nAscent); } } @@ -846,7 +846,7 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) * SwSubFont::_DrawText() *************************************************************************/ -void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const BOOL bGrey ) +void SwSubFont::_DrawText( SwDrawTextInfo &rInf, const sal_Bool bGrey ) { rInf.SetGreyWave( bGrey ); xub_StrLen nLn = rInf.GetText().Len(); @@ -958,7 +958,7 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; nSpace *= rInf.GetSpace() / SPACING_PRECISION_FACTOR; } - rInf.SetWidth( USHORT(aFontSize.Width() + nSpace) ); + rInf.SetWidth( sal_uInt16(aFontSize.Width() + nSpace) ); rInf.SetText( aStr ); rInf.SetIdx( 0 ); rInf.SetLen( 2 ); @@ -1105,7 +1105,7 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) { long nOfst; - USHORT nDir = UnMapDirection( + sal_uInt16 nDir = UnMapDirection( GetOrientation(), rInf.GetFrm() && rInf.GetFrm()->IsVertical() ); switch ( GetEscapement() ) @@ -1167,12 +1167,12 @@ void SwSubFont::CalcEsc( SwDrawTextInfo& rInf, Point& rPos ) } // used during painting of small capitals -void SwDrawTextInfo::Shift( USHORT nDir ) +void SwDrawTextInfo::Shift( sal_uInt16 nDir ) { ASSERT( bPos, "DrawTextInfo: Undefined Position" ); ASSERT( bSize, "DrawTextInfo: Undefined Width" ); - const BOOL bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) != + const sal_Bool bBidiPor = ( GetFrm() && GetFrm()->IsRightToLeft() ) != ( 0 != ( TEXT_LAYOUT_BIDI_RTL & GetpOut()->GetLayoutMode() ) ); nDir = bBidiPor ? @@ -1219,7 +1219,7 @@ long AttrSetToLineHeight( const IDocumentSettingAccess& rIDocumentSettingAccess, const OutputDevice &rOut, sal_Int16 nScript) { SwFont aFont(&rSet, &rIDocumentSettingAccess); - BYTE nActual; + sal_uInt8 nActual; switch (nScript) { default: -- cgit From 25af48a8840696770162f41912b0609478f5132d Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 19 Mar 2011 14:13:18 +0100 Subject: Move OSL_ENSURE(sal_False,...) to OSL_FAIL(...) --- sw/source/core/txtnode/swfont.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw/source/core/txtnode/swfont.cxx') diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 4578eac81f76..cfa8036ecdce 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -115,7 +115,7 @@ sal_uInt16 MapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat ) break; #if OSL_DEBUG_LEVEL > 1 default : - OSL_ENSURE( sal_False, "Unsupported direction" ); + OSL_FAIL( "Unsupported direction" ); break; #endif } @@ -142,7 +142,7 @@ sal_uInt16 UnMapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat ) break; #if OSL_DEBUG_LEVEL > 1 default : - OSL_ENSURE( sal_False, "Unsupported direction" ); + OSL_FAIL( "Unsupported direction" ); break; #endif } -- cgit