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