From 032e63015261e95219af2ce7ca3a282e1478f446 Mon Sep 17 00:00:00 2001 From: Dieter Loeschky Date: Fri, 24 Nov 2000 16:06:13 +0000 Subject: [PATCH] #80317#, #80319# CJK font controller --- sd/source/core/drawdoc4.cxx | 12 ++++-------- sd/source/core/stlpool.cxx | 13 +++++-------- sd/source/ui/view/drtxtob.cxx | 31 ++++++++++++++++++++++++++----- sd/source/ui/view/drtxtob1.cxx | 31 ++++++++++++++++++++++++------- 4 files changed, 59 insertions(+), 28 deletions(-) diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index df3b8ee3aa65..130578e5bf34 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drawdoc4.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: cl $ $Date: 2000-11-17 10:56:37 $ + * last change: $Author: dl $ $Date: 2000-11-24 17:03:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -317,14 +317,10 @@ void SdDrawDocument::CreateLayoutTemplates() aSvxFontItem.GetCharSet() = gsl_getSystemTextEncoding(); rISet.Put(aSvxFontItem); SvxFontItem aSvxFontItemCJK( EE_CHAR_FONTINFO_CJK ); - aSvxFontItemCJK.GetFamily() = FAMILY_ROMAN; - aSvxFontItemCJK.GetFamilyName() = UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "MS Mincho" ) ); - aSvxFontItemCJK.GetCharSet() = gsl_getSystemTextEncoding(); + aSvxFontItemCJK.GetFamilyName() = UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "Arial Unicode MS;Andale WT UI;MS PGothic;HG Mincho;MS Mincho;SimSun;Song;PmingLiU;Ming;Batang;Myeomgjo;Gulim" ) ); rISet.Put(aSvxFontItemCJK); SvxFontItem aSvxFontItemCTL( EE_CHAR_FONTINFO_CTL ); - aSvxFontItemCTL.GetFamily() = FAMILY_ROMAN; - aSvxFontItemCTL.GetFamilyName() = System::GetStandardFont(STDFONT_ROMAN).GetName(); - aSvxFontItemCTL.GetCharSet() = gsl_getSystemTextEncoding(); + aSvxFontItemCTL.GetFamilyName() = UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "Simplified Arabic;David" ) ); rISet.Put(aSvxFontItemCTL); rISet.Put( SvxFontHeightItem( 846, 100, EE_CHAR_FONTHEIGHT ) ); // 24 pt diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 568a2c0e8895..1ac1104df985 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -2,9 +2,9 @@ * * $RCSfile: stlpool.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dl $ $Date: 2000-11-16 13:54:33 $ + * last change: $Author: dl $ $Date: 2000-11-24 17:03:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -283,13 +283,10 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName) aSvxFontItem.GetFamilyName() = System::GetStandardFont(STDFONT_ROMAN).GetName(); aSvxFontItem.GetCharSet() = gsl_getSystemTextEncoding(); SvxFontItem aSvxFontItemCJK( EE_CHAR_FONTINFO_CJK ); - aSvxFontItemCJK.GetFamily() = FAMILY_ROMAN; - aSvxFontItemCJK.GetFamilyName() = UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "MS Mincho" ) ); - aSvxFontItemCJK.GetCharSet() = gsl_getSystemTextEncoding(); + aSvxFontItemCJK.GetFamilyName() = UniString::CreateFromAscii( + RTL_CONSTASCII_STRINGPARAM( "Arial Unicode MS;Andale WT UI;MS PGothic;HG Mincho;MS Mincho;SimSun;Song;PmingLiU;Ming;Batang;Myeomgjo;Gulim" ) ); SvxFontItem aSvxFontItemCTL( EE_CHAR_FONTINFO_CTL ); - aSvxFontItemCTL.GetFamily() = FAMILY_ROMAN; - aSvxFontItemCTL.GetFamilyName() = System::GetStandardFont(STDFONT_ROMAN).GetName(); - aSvxFontItemCTL.GetCharSet() = gsl_getSystemTextEncoding(); + aSvxFontItemCTL.GetFamilyName() = UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "Simplified Arabic;David" ) ); Font aBulletFont( GetBulletFont() ); diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index e198adceb290..e164e6de8003 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drtxtob.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:48:43 $ + * last change: $Author: dl $ $Date: 2000-11-24 17:01:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,6 +98,9 @@ #ifndef _SFXINTITEM_HXX //autogen #include #endif +#ifndef _SVX_SRIPTTYPEITEM_HXX //autogen +#include +#endif #pragma hdrstop @@ -202,6 +205,8 @@ void SdDrawTextObjectBar::GetAttrState( SfxItemSet& rSet ) SfxWhichIter aIter( rSet ); USHORT nWhich = aIter.FirstWhich(); BOOL bTemplate = FALSE; + SfxItemSet aAttrSet( pView->GetDoc()->GetPool() ); + pView->GetAttributes( aAttrSet ); while ( nWhich ) { @@ -211,6 +216,25 @@ void SdDrawTextObjectBar::GetAttrState( SfxItemSet& rSet ) switch ( nSlotId ) { + case SID_ATTR_CHAR_FONT: + case SID_ATTR_CHAR_FONTHEIGHT: + case SID_ATTR_CHAR_WEIGHT: + case SID_ATTR_CHAR_POSTURE: + { + SfxItemPool& rPool = GetPool(); + SvxScriptSetItem aSetItem( nSlotId, rPool ); + aSetItem.GetItemSet().Put( aAttrSet, FALSE ); + + USHORT nScriptType = pView->GetScriptType(); + const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType ); + if( pI ) + rSet.Put( *pI, nWhich ); + else + rSet.InvalidateItem( nWhich ); + } + break; + + case SID_STYLE_APPLY: case SID_STYLE_FAMILY2: { @@ -313,9 +337,6 @@ void SdDrawTextObjectBar::GetAttrState( SfxItemSet& rSet ) nWhich = aIter.NextWhich(); } - SfxItemSet aAttrSet( pView->GetDoc()->GetPool() ); - pView->GetAttributes( aAttrSet ); - rSet.Put( aAttrSet, FALSE ); // <- FALSE, damit DontCare-Status uebernommen wird /* diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index ac99299ac528..84b58ffeb18d 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drtxtob1.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ka $ $Date: 2000-09-21 16:12:20 $ + * last change: $Author: dl $ $Date: 2000-11-24 17:02:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -132,6 +132,10 @@ #ifndef _SFXINTITEM_HXX //autogen #include #endif +#ifndef _SVX_SRIPTTYPEITEM_HXX //autogen +#include +#endif + #pragma hdrstop @@ -334,12 +338,12 @@ void SdDrawTextObjectBar::Execute( SfxRequest &rReq ) default: { - if( !pArgs|| - nSlot == SID_ATTR_CHAR_WEIGHT ) // Weight besitzt Argument !? + SfxItemSet aEditAttr( pView->GetDoc()->GetPool() ); + pView->GetAttributes( aEditAttr ); + SfxItemSet aNewAttr(*(aEditAttr.GetPool()), aEditAttr.GetRanges()); + + if( !pArgs ) { - SfxItemSet aEditAttr( pView->GetDoc()->GetPool() ); - pView->GetAttributes( aEditAttr ); - SfxItemSet aNewAttr(*(aEditAttr.GetPool()), aEditAttr.GetRanges()); //aNewAttr.InvalidateAllItems(); <- Macht Probleme (#35465#) switch ( nSlot ) @@ -519,6 +523,19 @@ void SdDrawTextObjectBar::Execute( SfxRequest &rReq ) rReq.Done( aNewAttr ); pArgs = rReq.GetArgs(); } + else if ( nSlot == SID_ATTR_CHAR_FONT || + nSlot == SID_ATTR_CHAR_FONTHEIGHT || + nSlot == SID_ATTR_CHAR_POSTURE || + nSlot == SID_ATTR_CHAR_WEIGHT ) + { + USHORT nScriptType = pView->GetScriptType(); + SfxItemPool& rPool = pView->GetDoc()->GetPool(); + SvxScriptSetItem aSvxScriptSetItem( nSlot, rPool ); + aSvxScriptSetItem.PutItemForScriptType( nScriptType, pArgs->Get( rPool.GetWhich( nSlot ) ) ); + aNewAttr.Put( aSvxScriptSetItem ); + rReq.Done( aNewAttr ); + pArgs = rReq.GetArgs(); + } pView->SetAttributes(*pArgs);