diff options
author | Malte Timmermann <mt@openoffice.org> | 2001-04-02 13:07:17 +0000 |
---|---|---|
committer | Malte Timmermann <mt@openoffice.org> | 2001-04-02 13:07:17 +0000 |
commit | c1b112151c46d8ded7194473bacdb02abbdef7c6 (patch) | |
tree | ecffc849cdc358607f3b38ad497ed3e051bae7e6 /svx | |
parent | 866ce16444133ca52d511dc5328fc6ac76eb1ded (diff) |
#85558# Relief...
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/editeng/editattr.cxx | 19 | ||||
-rw-r--r-- | svx/source/editeng/editattr.hxx | 18 | ||||
-rw-r--r-- | svx/source/editeng/editdbg.cxx | 15 | ||||
-rw-r--r-- | svx/source/editeng/editdoc.cxx | 78 | ||||
-rw-r--r-- | svx/source/editeng/editeng.cxx | 8 | ||||
-rw-r--r-- | svx/source/editeng/eerdll.cxx | 7 | ||||
-rw-r--r-- | svx/source/editeng/impedit4.cxx | 26 |
7 files changed, 108 insertions, 63 deletions
diff --git a/svx/source/editeng/editattr.cxx b/svx/source/editeng/editattr.cxx index 543df6712170..a3b2b0c7ccb1 100644 --- a/svx/source/editeng/editattr.cxx +++ b/svx/source/editeng/editattr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: editattr.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: mt $ $Date: 2001-03-02 16:31:50 $ + * last change: $Author: mt $ $Date: 2001-04-02 14:07:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,6 +82,7 @@ #include <langitem.hxx> #include <emphitem.hxx> #include <charscaleitem.hxx> +#include <charreliefitem.hxx> #include <editattr.hxx> @@ -448,3 +449,17 @@ void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* ) { rFont.SetEmphasisMark( ((const SvxEmphasisMarkItem*)GetItem())->GetEmphasisMark() ); } + +// ------------------------------------------------------------------------- +// class EditCharAttribRelief +// ------------------------------------------------------------------------- +EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, USHORT nStart, USHORT nEnd ) + : EditCharAttrib( rAttr, nStart, nEnd ) +{ + DBG_ASSERT( rAttr.Which() == EE_CHAR_RELIEF, "Not a relief attribute!" ); +} + +void EditCharAttribRelief::SetFont( SvxFont& rFont, OutputDevice* ) +{ + rFont.SetRelief( (FontRelief)((const SvxCharReliefItem*)GetItem())->GetValue() ); +} diff --git a/svx/source/editeng/editattr.hxx b/svx/source/editeng/editattr.hxx index 27f167fe47a2..cc5ffa8809dd 100644 --- a/svx/source/editeng/editattr.hxx +++ b/svx/source/editeng/editattr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: editattr.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: mt $ $Date: 2001-03-02 16:31:50 $ + * last change: $Author: mt $ $Date: 2001-04-02 14:07:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,7 @@ class SvxWordLineModeItem; class SvxFieldItem; class SvxLanguageItem; class SvxEmphasisMarkItem; +class SvxCharReliefItem; #ifndef _SFXPOOLITEM_HXX //autogen #include <svtools/poolitem.hxx> @@ -290,7 +291,7 @@ public: virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // class EditCharAttribEmphasisMark // ------------------------------------------------------------------------- class EditCharAttribEmphasisMark : public EditCharAttrib @@ -301,6 +302,17 @@ public: virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; +// ------------------------------------------------------------------------- +// class EditCharAttribRelief +// ------------------------------------------------------------------------- +class EditCharAttribRelief : public EditCharAttrib +{ +public: + EditCharAttribRelief( const SvxCharReliefItem& rAttr, USHORT nStart, USHORT nEnd ); + + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); +}; + // ------------------------------------------------------------------------- // class EditCharAttribFontHeight // ------------------------------------------------------------------------- diff --git a/svx/source/editeng/editdbg.cxx b/svx/source/editeng/editdbg.cxx index e6a4936c2ca7..672128b844a3 100644 --- a/svx/source/editeng/editdbg.cxx +++ b/svx/source/editeng/editdbg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: editdbg.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: mt $ $Date: 2001-03-23 08:33:08 $ + * last change: $Author: mt $ $Date: 2001-04-02 14:07:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,6 +88,7 @@ #include <emphitem.hxx> #include <numitem.hxx> #include <charscaleitem.hxx> +#include <charreliefitem.hxx> #include <impedit.hxx> #include <editeng.hxx> @@ -137,9 +138,9 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) } else { - aDebStr += "Char='"; - aDebStr += pFmt->GetBulletChar(); - aDebStr += "'"; + aDebStr += "Char=["; + aDebStr += ByteString::CreateFromInt32( pFmt->GetBulletChar() ); + aDebStr += "]"; } aDebStr += ") "; } @@ -250,6 +251,10 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) aDebStr += "FontUnderline="; aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxEmphasisMarkItem&)rItem).GetEmphasisMark() ); break; + case EE_CHAR_RELIEF: + aDebStr += "FontRelief="; + aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxCharReliefItem&)rItem).GetValue() ); + break; case EE_CHAR_STRIKEOUT: aDebStr += "FontStrikeout="; aDebStr +=ByteString::CreateFromInt32( (USHORT)((SvxCrossedOutItem&)rItem).GetStrikeout() ); diff --git a/svx/source/editeng/editdoc.cxx b/svx/source/editeng/editdoc.cxx index 3c40029130b3..c6e35b83c6f5 100644 --- a/svx/source/editeng/editdoc.cxx +++ b/svx/source/editeng/editdoc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: editdoc.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: mt $ $Date: 2001-03-21 12:02:04 $ + * last change: $Author: mt $ $Date: 2001-04-02 14:07:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,6 +81,7 @@ #include <langitem.hxx> #include <emphitem.hxx> #include <charscaleitem.hxx> +#include <charreliefitem.hxx> #include <editdoc.hxx> #include <editdbg.hxx> @@ -244,7 +245,7 @@ SfxItemInfo aItemInfos[EDITITEMCOUNT] = { { SID_ATTR_CHAR_CJK_POSTURE, SFX_ITEM_POOLABLE }, { SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEM_POOLABLE }, { SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEM_POOLABLE }, - { 0, SFX_ITEM_POOLABLE }, // EE_CHAR_2LINES_DUMMY + { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE }, { 0, SFX_ITEM_POOLABLE }, // EE_CHAR_RUBI_DUMMY { 0, SFX_ITEM_POOLABLE }, // EE_CHAR_ROTATION_DUMMY { 0, SFX_ITEM_POOLABLE }, // EE_FEATURE_TAB @@ -346,6 +347,11 @@ EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, US pNew = new EditCharAttribEmphasisMark( (const SvxEmphasisMarkItem&)rNew, nS, nE ); } break; + case EE_CHAR_RELIEF: + { + pNew = new EditCharAttribRelief( (const SvxCharReliefItem&)rNew, nS, nE ); + } + break; case EE_CHAR_STRIKEOUT: { pNew = new EditCharAttribStrikeout( (const SvxCrossedOutItem&)rNew, nS, nE ); @@ -1219,68 +1225,48 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, BOOL bSearchInParent ) rFont.SetAlign( ALIGN_BASELINE ); rFont.SetTransparent( TRUE ); - if ( bSearchInParent ) - { + 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 ) ) + { const SvxFontItem& rFontItem = (const SvxFontItem&)rSet.Get( EE_CHAR_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( 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( 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 ) ) + { rFont.SetEscapement( ((const SvxEscapementItem&)rSet.Get( EE_CHAR_ESCAPEMENT)).GetEsc() ); rFont.SetPropr( ((const SvxEscapementItem&)rSet.Get( EE_CHAR_ESCAPEMENT)).GetProp() ); + } + if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_PAIRKERNING ) == SFX_ITEM_ON ) ) rFont.SetKerning( ((const SvxAutoKernItem&)rSet.Get( EE_CHAR_PAIRKERNING )).GetValue() ); + if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_KERNING ) == SFX_ITEM_ON ) ) rFont.SetFixKerning( ((const SvxKerningItem&)rSet.Get( EE_CHAR_KERNING )).GetValue() ); + if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_WLM ) == SFX_ITEM_ON ) ) rFont.SetWordLineMode( ((const SvxWordLineModeItem&)rSet.Get( EE_CHAR_WLM )).GetValue() ); - } - else - { - if ( rSet.GetItemState( EE_CHAR_LANGUAGE ) == SFX_ITEM_ON ) - rFont.SetLanguage( ((const SvxLanguageItem&)rSet.Get( EE_CHAR_LANGUAGE )).GetLanguage() ); - if ( rSet.GetItemState( EE_CHAR_COLOR ) == SFX_ITEM_ON ) - rFont.SetColor( ((const SvxColorItem&)rSet.Get( EE_CHAR_COLOR )).GetValue() ); - if ( rSet.GetItemState( EE_CHAR_FONTINFO ) == SFX_ITEM_ON ) - { - const SvxFontItem& rFontItem = (const SvxFontItem&)rSet.Get( EE_CHAR_FONTINFO ); - rFont.SetName( rFontItem.GetFamilyName() ); - rFont.SetFamily( rFontItem.GetFamily() ); - rFont.SetPitch( rFontItem.GetPitch() ); - rFont.SetCharSet( rFontItem.GetCharSet() ); - } - if ( rSet.GetItemState( EE_CHAR_FONTHEIGHT ) == SFX_ITEM_ON ) - rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem&)rSet.Get( EE_CHAR_FONTHEIGHT ) ).GetHeight() ) ); - if ( rSet.GetItemState( EE_CHAR_WEIGHT ) == SFX_ITEM_ON ) - rFont.SetWeight( ((const SvxWeightItem&)rSet.Get( EE_CHAR_WEIGHT )).GetWeight() ); - if ( rSet.GetItemState( EE_CHAR_UNDERLINE ) == SFX_ITEM_ON ) - rFont.SetUnderline( ((const SvxUnderlineItem&)rSet.Get( EE_CHAR_UNDERLINE )).GetUnderline() ); - if ( rSet.GetItemState( EE_CHAR_STRIKEOUT ) == SFX_ITEM_ON ) - rFont.SetStrikeout( ((const SvxCrossedOutItem&)rSet.Get( EE_CHAR_STRIKEOUT )).GetStrikeout() ); - if ( rSet.GetItemState( EE_CHAR_ITALIC ) == SFX_ITEM_ON ) - rFont.SetItalic( ((const SvxPostureItem&)rSet.Get( EE_CHAR_ITALIC )).GetPosture() ); - if ( rSet.GetItemState( EE_CHAR_OUTLINE ) == SFX_ITEM_ON ) - rFont.SetOutline( ((const SvxContourItem&)rSet.Get( EE_CHAR_OUTLINE )).GetValue() ); - if ( rSet.GetItemState( EE_CHAR_SHADOW ) == SFX_ITEM_ON ) - rFont.SetShadow( ((const SvxShadowedItem&)rSet.Get( EE_CHAR_SHADOW )).GetValue() ); - if ( rSet.GetItemState( EE_CHAR_ESCAPEMENT ) == SFX_ITEM_ON ) - { - rFont.SetEscapement( ((const SvxEscapementItem&)rSet.Get( EE_CHAR_ESCAPEMENT)).GetEsc() ); - rFont.SetPropr( ((const SvxEscapementItem&)rSet.Get( EE_CHAR_ESCAPEMENT)).GetProp() ); - } - if ( rSet.GetItemState( EE_CHAR_PAIRKERNING ) == SFX_ITEM_ON ) - rFont.SetKerning( ((const SvxAutoKernItem&)rSet.Get( EE_CHAR_PAIRKERNING )).GetValue() ); - if ( rSet.GetItemState( EE_CHAR_KERNING ) == SFX_ITEM_ON ) - rFont.SetFixKerning( ((const SvxKerningItem&)rSet.Get( EE_CHAR_KERNING )).GetValue() ); - if ( rSet.GetItemState( EE_CHAR_WLM ) == SFX_ITEM_ON ) - rFont.SetWordLineMode( ((const SvxWordLineModeItem&)rSet.Get( EE_CHAR_WLM )).GetValue() ); - } + if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_EMPHASISMARK ) == SFX_ITEM_ON ) ) + rFont.SetEmphasisMark( ((const SvxEmphasisMarkItem&)rSet.Get( EE_CHAR_EMPHASISMARK )).GetValue() ); + if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_RELIEF ) == SFX_ITEM_ON ) ) + rFont.SetRelief( (FontRelief)((const SvxCharReliefItem&)rSet.Get( EE_CHAR_RELIEF )).GetValue() ); + // Ob ich jetzt den ganzen Font vergleiche, oder vor jeder Aenderung // pruefe, ob der Wert sich aendert, bleibt sich relativ gleich. // So ggf ein MakeUniqFont im Font mehr, dafuer bei Aenderung schnellerer diff --git a/svx/source/editeng/editeng.cxx b/svx/source/editeng/editeng.cxx index d79ebbc2d9ed..19dd19ab867e 100644 --- a/svx/source/editeng/editeng.cxx +++ b/svx/source/editeng/editeng.cxx @@ -2,9 +2,9 @@ * * $RCSfile: editeng.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: mt $ $Date: 2001-03-23 08:33:52 $ + * last change: $Author: mt $ $Date: 2001-04-02 14:07:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,7 +99,9 @@ #include "brshitem.hxx" #include "cscoitem.hxx" #include "langitem.hxx" +#include <emphitem.hxx> #include <charscaleitem.hxx> +#include <charreliefitem.hxx> #ifndef _SV_SYSTEM_HXX @@ -2206,6 +2208,8 @@ void EditEngine::SetFontInfoInItemSet( SfxItemSet& rSet, const SvxFont& rFont ) rSet.Put( SvxAutoKernItem( rFont.IsKerning(), EE_CHAR_PAIRKERNING ) ); rSet.Put( SvxKerningItem( rFont.GetFixKerning(), EE_CHAR_KERNING ) ); rSet.Put( SvxWordLineModeItem( rFont.IsWordLineMode(), EE_CHAR_WLM ) ); + rSet.Put( SvxEmphasisMarkItem( rFont.GetEmphasisMark(), EE_CHAR_EMPHASISMARK ) ); + rSet.Put( SvxCharReliefItem( rFont.GetRelief(), EE_CHAR_RELIEF ) ); } Font EditEngine::CreateFontFromItemSet( const SfxItemSet& rItemSet ) diff --git a/svx/source/editeng/eerdll.cxx b/svx/source/editeng/eerdll.cxx index f2b1429b0f11..b1d2d84f447e 100644 --- a/svx/source/editeng/eerdll.cxx +++ b/svx/source/editeng/eerdll.cxx @@ -2,9 +2,9 @@ * * $RCSfile: eerdll.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: mt $ $Date: 2001-03-09 18:09:26 $ + * last change: $Author: mt $ $Date: 2001-04-02 14:07:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -105,6 +105,7 @@ #include <numitem.hxx> #include <langitem.hxx> #include <charscaleitem.hxx> +#include <charreliefitem.hxx> #include <forbiddencharacterstable.hxx> @@ -176,7 +177,7 @@ SfxPoolItem** GlobalEditData::GetDefItems() ppDefItems[37] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ); ppDefItems[38] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ); ppDefItems[39] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ); - ppDefItems[40] = new SfxVoidItem( EE_CHAR_2LINES_DUMMY ); + ppDefItems[40] = new SvxCharReliefItem( RELIEF_NONE, EE_CHAR_RELIEF ); ppDefItems[41] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY ); ppDefItems[42] = new SfxVoidItem( EE_CHAR_ROTATION_DUMMY ); diff --git a/svx/source/editeng/impedit4.cxx b/svx/source/editeng/impedit4.cxx index 0826199209b4..1d07e0d45859 100644 --- a/svx/source/editeng/impedit4.cxx +++ b/svx/source/editeng/impedit4.cxx @@ -2,9 +2,9 @@ * * $RCSfile: impedit4.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: mt $ $Date: 2001-03-09 13:13:53 $ + * last change: $Author: mt $ $Date: 2001-04-02 14:07:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,8 @@ #include "ulspitem.hxx" #include "wghtitem.hxx" #include "langitem.hxx" +#include <charreliefitem.hxx> +#include <emphitem.hxx> #include <rtl/tencinfo.h> @@ -857,6 +859,26 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, rOutput << '0'; } break; + case EE_CHAR_RELIEF: + { + USHORT nRelief = ((const SvxCharReliefItem&)rItem).GetValue(); + if ( nRelief == RELIEF_EMBOSSED ) + rOutput << sRTF_EMBO; + if ( nRelief == RELIEF_ENGRAVED ) + rOutput << sRTF_IMPR; + } + break; + case EE_CHAR_EMPHASISMARK: + { + USHORT nMark = ((const SvxEmphasisMarkItem&)rItem).GetValue(); + if ( nMark == EMPHASISMARK_NONE ) + rOutput << sRTF_ACCNONE; + if ( nMark == EMPHASISMARK_SIDE_DOTS ) + rOutput << sRTF_ACCCOMMA; + else + rOutput << sRTF_ACCDOT; + } + break; case EE_CHAR_SHADOW: { rOutput << sRTF_SHAD; |