diff options
-rw-r--r-- | svx/source/editeng/editdoc.cxx | 42 | ||||
-rw-r--r-- | svx/source/editeng/editdoc.hxx | 6 | ||||
-rw-r--r-- | svx/source/editeng/editeng.cxx | 17 |
3 files changed, 42 insertions, 23 deletions
diff --git a/svx/source/editeng/editdoc.cxx b/svx/source/editeng/editdoc.cxx index 8904626a7b08..33b89ed80e87 100644 --- a/svx/source/editeng/editdoc.cxx +++ b/svx/source/editeng/editdoc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: editdoc.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: mt $ $Date: 2001-11-27 17:31:09 $ + * last change: $Author: mt $ $Date: 2001-11-28 11:14:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1229,44 +1229,52 @@ void EditDoc::RemoveItemsFromPool( ContentNode* pNode ) } } -void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, BOOL bSearchInParent ) +void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, BOOL bSearchInParent, short nScriptType ) { Font aPrevFont( rFont ); rFont.SetAlign( ALIGN_BASELINE ); rFont.SetTransparent( TRUE ); - if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_LANGUAGE ) == SFX_ITEM_ON ) ) - rFont.SetLanguage( ((const SvxLanguageItem&)rSet.Get( EE_CHAR_LANGUAGE )).GetLanguage() ); - if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_COLOR ) == SFX_ITEM_ON ) ) - rFont.SetColor( ((const SvxColorItem&)rSet.Get( EE_CHAR_COLOR )).GetValue() ); - if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_FONTINFO ) == SFX_ITEM_ON ) ) + USHORT nWhich_FontInfo = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ); + USHORT nWhich_Language = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); + USHORT nWhich_FontHeight = GetScriptItemId( EE_CHAR_FONTHEIGHT, nScriptType ); + USHORT nWhich_Weight = GetScriptItemId( EE_CHAR_WEIGHT, nScriptType ); + USHORT nWhich_Italic = GetScriptItemId( EE_CHAR_ITALIC, nScriptType ); + + if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontInfo ) == SFX_ITEM_ON ) ) { - const SvxFontItem& rFontItem = (const SvxFontItem&)rSet.Get( EE_CHAR_FONTINFO ); + const SvxFontItem& rFontItem = (const SvxFontItem&)rSet.Get( nWhich_FontInfo ); rFont.SetName( rFontItem.GetFamilyName() ); rFont.SetFamily( rFontItem.GetFamily() ); rFont.SetPitch( rFontItem.GetPitch() ); rFont.SetCharSet( rFontItem.GetCharSet() ); } - if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_FONTHEIGHT ) == SFX_ITEM_ON ) ) - rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem&)rSet.Get( EE_CHAR_FONTHEIGHT ) ).GetHeight() ) ); - if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_WEIGHT ) == SFX_ITEM_ON ) ) - rFont.SetWeight( ((const SvxWeightItem&)rSet.Get( EE_CHAR_WEIGHT )).GetWeight() ); + if ( bSearchInParent || ( rSet.GetItemState( nWhich_Language ) == SFX_ITEM_ON ) ) + rFont.SetLanguage( ((const SvxLanguageItem&)rSet.Get( nWhich_Language )).GetLanguage() ); + if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_COLOR ) == SFX_ITEM_ON ) ) + rFont.SetColor( ((const SvxColorItem&)rSet.Get( EE_CHAR_COLOR )).GetValue() ); + if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontHeight ) == SFX_ITEM_ON ) ) + rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem&)rSet.Get( nWhich_FontHeight ) ).GetHeight() ) ); + if ( bSearchInParent || ( rSet.GetItemState( nWhich_Weight ) == SFX_ITEM_ON ) ) + rFont.SetWeight( ((const SvxWeightItem&)rSet.Get( nWhich_Weight )).GetWeight() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_UNDERLINE ) == SFX_ITEM_ON ) ) rFont.SetUnderline( ((const SvxUnderlineItem&)rSet.Get( EE_CHAR_UNDERLINE )).GetUnderline() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_STRIKEOUT ) == SFX_ITEM_ON ) ) rFont.SetStrikeout( ((const SvxCrossedOutItem&)rSet.Get( EE_CHAR_STRIKEOUT )).GetStrikeout() ); - if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_ITALIC ) == SFX_ITEM_ON ) ) - rFont.SetItalic( ((const SvxPostureItem&)rSet.Get( EE_CHAR_ITALIC )).GetPosture() ); + if ( bSearchInParent || ( rSet.GetItemState( nWhich_Italic ) == SFX_ITEM_ON ) ) + rFont.SetItalic( ((const SvxPostureItem&)rSet.Get( nWhich_Italic )).GetPosture() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_OUTLINE ) == SFX_ITEM_ON ) ) rFont.SetOutline( ((const SvxContourItem&)rSet.Get( EE_CHAR_OUTLINE )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_SHADOW ) == SFX_ITEM_ON ) ) rFont.SetShadow( ((const SvxShadowedItem&)rSet.Get( EE_CHAR_SHADOW )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_ESCAPEMENT ) == SFX_ITEM_ON ) ) { - USHORT nProp = ((const SvxEscapementItem&)rSet.Get( EE_CHAR_ESCAPEMENT)).GetProp(); + const SvxEscapementItem& rEsc = (const SvxEscapementItem&) rSet.Get( EE_CHAR_ESCAPEMENT ); + + USHORT nProp = rEsc.GetProp(); rFont.SetPropr( (BYTE)nProp ); - short nEsc = ((const SvxEscapementItem&)rSet.Get( EE_CHAR_ESCAPEMENT)).GetEsc(); + short nEsc = rEsc.GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) nEsc = 100 - nProp; else if ( nEsc == DFLT_ESC_AUTO_SUB ) diff --git a/svx/source/editeng/editdoc.hxx b/svx/source/editeng/editdoc.hxx index 2819c6be28d6..da9bcf0d468d 100644 --- a/svx/source/editeng/editdoc.hxx +++ b/svx/source/editeng/editdoc.hxx @@ -2,9 +2,9 @@ * * $RCSfile: editdoc.hxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: mt $ $Date: 2001-11-12 13:06:40 $ + * last change: $Author: mt $ $Date: 2001-11-28 11:14:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,7 +90,7 @@ DBG_NAMEEX( EE_TextPortion ); #define CHARPOSGROW 16 #define DEFTAB 720 -void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, BOOL bSearchInParent = TRUE ); +void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, BOOL bSearchInParent = TRUE, short nScriptType = 0 ); USHORT GetScriptItemId( USHORT nItemId, short nScriptType ); BOOL IsScriptItemValid( USHORT nItemId, short nScriptType ); diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx index 85aa506a27cf..d9421ba37e8f 100644 --- a/svx/source/editeng/editeng.cxx +++ b/svx/source/editeng/editeng.cxx @@ -2,9 +2,9 @@ * * $RCSfile: editeng.cxx,v $ * - * $Revision: 1.50 $ + * $Revision: 1.51 $ * - * last change: $Author: mt $ $Date: 2001-11-16 12:29:12 $ + * last change: $Author: mt $ $Date: 2001-11-28 11:14:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -833,6 +833,9 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie if ( nCode == KEY_END ) bEndKey = sal_True; } +#ifdef DEBUG + GetLanguage( pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() ), aCurSel.Max().GetIndex() ); +#endif } break; case KEY_BACKSPACE: @@ -1391,7 +1394,7 @@ SfxItemSet EditEngine::GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, sal return pImpEditEngine->GetAttribs( nPara, nStart, nEnd, nFlags ); } - +// MT: Can be remved after 6.x? Font EditEngine::GetStandardFont( sal_uInt16 nPara ) { DBG_CHKTHIS( EditEngine, 0 ); @@ -2207,6 +2210,14 @@ void EditEngine::SetFontInfoInItemSet( SfxItemSet& rSet, const SvxFont& rFont ) rSet.Put( SvxCharReliefItem( rFont.GetRelief(), EE_CHAR_RELIEF ) ); } +Font EditEngine::CreateFontFromItemSet( const SfxItemSet& rItemSet, USHORT nScriptType ) +{ + SvxFont aFont; + CreateFont( aFont, rItemSet, nScriptType ); + return aFont; +} + +// Maybe we can remove the next two methods, check after 6.x Font EditEngine::CreateFontFromItemSet( const SfxItemSet& rItemSet ) { return CreateSvxFontFromItemSet( rItemSet ); |