diff options
author | jp <jp@openoffice.org> | 2000-10-23 10:58:55 +0000 |
---|---|---|
committer | jp <jp@openoffice.org> | 2000-10-23 10:58:55 +0000 |
commit | 287c954f17e1237c4b8b166de85caf006579b447 (patch) | |
tree | 11380a34c0667585e2265c3c5f0ed9b6a6b81914 | |
parent | 976d4ae701ac2b43859012eb1cd5032aae614598 (diff) |
new attributes Ruby and 2Lines
-rw-r--r-- | sw/inc/poolfmt.hrc | 8 | ||||
-rw-r--r-- | sw/inc/poolfmt.hxx | 5 | ||||
-rw-r--r-- | sw/inc/txatbase.hxx | 25 | ||||
-rw-r--r-- | sw/inc/txtatr.hxx | 52 | ||||
-rw-r--r-- | sw/source/core/bastyp/init.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/doc/poolfmt.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/txtnode/fmtatr2.cxx | 246 | ||||
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 29 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtatr2.cxx | 114 | ||||
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/utlui/attrdesc.cxx | 51 | ||||
-rw-r--r-- | sw/source/ui/utlui/poolfmt.src | 16 |
12 files changed, 545 insertions, 36 deletions
diff --git a/sw/inc/poolfmt.hrc b/sw/inc/poolfmt.hrc index 285f40e32989..b9ec3fafd53c 100644 --- a/sw/inc/poolfmt.hrc +++ b/sw/inc/poolfmt.hrc @@ -2,9 +2,9 @@ * * $RCSfile: poolfmt.hrc,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:27 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,6 +83,7 @@ #define STR_POOLCHR_IDX_MAIN_ENTRY (RC_POOLCHRFMT_BEGIN+ 12) #define STR_POOLCHR_FOOTNOTE_ANCHOR (RC_POOLCHRFMT_BEGIN+ 13) #define STR_POOLCHR_ENDNOTE_ANCHOR (RC_POOLCHRFMT_BEGIN+ 14) +#define STR_POOLCHR_RUBYTEXT (RC_POOLCHRFMT_BEGIN+ 15) #define STR_POOLCHR_HTML_EMPHASIS (RC_POOLCHRFMT_HTML_BEGIN+ 0) #define STR_POOLCHR_HTML_CITIATION (RC_POOLCHRFMT_HTML_BEGIN+ 1) @@ -109,8 +110,9 @@ #define STR_POOLCHR_PRGM_IDX_MAIN_ENTRY (RC_POOLCHRFMT_PRGM_BEGIN + 12) #define STR_POOLCHR_PRGM_FOOTNOTE_ANCHOR (RC_POOLCHRFMT_PRGM_BEGIN + 13) #define STR_POOLCHR_PRGM_ENDNOTE_ANCHOR (RC_POOLCHRFMT_PRGM_BEGIN + 14) +#define STR_POOLCHR_PRGM_RUBYTEXT (RC_POOLCHRFMT_PRGM_BEGIN + 15) -#define STR_POOLCHR_PRGM_CURRENT_END STR_POOLCHR_PRGM_ENDNOTE_ANCHOR +#define STR_POOLCHR_PRGM_CURRENT_END STR_POOLCHR_PRGM_RUBYTEXT #define STR_POOLCHR_PRGM_HTML_EMPHASIS (RC_POOLCHRFMT_PRGM_HTML_BEGIN + 0) diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx index a4b31cf51825..6402db45b788 100644 --- a/sw/inc/poolfmt.hxx +++ b/sw/inc/poolfmt.hxx @@ -2,9 +2,9 @@ * * $RCSfile: poolfmt.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:27 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -178,6 +178,7 @@ RES_POOLCHR_LINENUM, // Zeilennummerierung RES_POOLCHR_IDX_MAIN_ENTRY, // main entry in indexes RES_POOLCHR_FOOTNOTE_ANCHOR, // Fussnotenanker RES_POOLCHR_ENDNOTE_ANCHOR, // Endnotenanker +RES_POOLCHR_RUBYTEXT, // Rubytext RES_POOLCHR_NORMAL_END, diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx index 81909ed02949..e376c2a22c47 100644 --- a/sw/inc/txatbase.hxx +++ b/sw/inc/txatbase.hxx @@ -2,9 +2,9 @@ * * $RCSfile: txatbase.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:28 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,6 +95,8 @@ class SvxCrossedOutItem; class SvxColorItem; class SvxCharSetColorItem; class SvXMLAttrContainerItem; +class SwFmtRuby; +class SwFmt2Lines; class SwFmtCharFmt; class SwFmtINetFmt; @@ -183,6 +185,9 @@ public: inline const SwFmtINetFmt &GetINetFmt() const; inline const SvXMLAttrContainerItem &GetXMLAttrContainer() const; + inline const SwFmtRuby &GetRuby() const; + inline const SwFmt2Lines &Get2Lines() const; + private: SwTxtAttr( const SwTxtAttr& ); SwTxtAttr& operator=( const SwTxtAttr& ); @@ -400,9 +405,25 @@ inline const SvXMLAttrContainerItem& SwTxtAttr::GetXMLAttrContainer() const return (const SvXMLAttrContainerItem&)*pAttr; } +inline const SwFmtRuby& SwTxtAttr::GetRuby() const +{ + ASSERT( pAttr && pAttr->Which() == RES_TXTATR_CJK_RUBY, + "Falsche Abfrage" ); + return (const SwFmtRuby&)*pAttr; +} +inline const SwFmt2Lines& SwTxtAttr::Get2Lines() const +{ + ASSERT( pAttr && pAttr->Which() == RES_TXTATR_TWO_LINES, + "Falsche Abfrage" ); + return (const SwFmt2Lines&)*pAttr; +} + /************************************************************************* $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:28 hr + initial import + Revision 1.23 2000/09/18 16:03:31 willem.vandorp OpenOffice header added. diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index 732c54bb0ce5..3c622cc9255b 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -2,9 +2,9 @@ * * $RCSfile: txtatr.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ama $ $Date: 2000-09-25 12:00:00 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,11 +80,17 @@ #ifndef _TXATBASE_HXX #include <txatbase.hxx> // SwTxtAttr/SwTxtAttrEnd #endif +#ifndef _CALBCK_HXX +#include <calbck.hxx> +#endif class SwTxtNode; // fuer SwTxtFld class SvxFont; class SwCharSetCol; class SwImplPrev; +class SwFmtRuby; +class SwCharFmt; +class SwFmt2Lines; // ATT_FONT *********************************************************** @@ -419,6 +425,43 @@ public: xub_StrLen nStart, xub_StrLen nEnd ); }; +// ****************************** + +class SwTxtRuby : public SwTxtAttrEnd, public SwClient +{ + SwTxtNode* pMyTxtNd; + +public: + SwTxtRuby( const SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + virtual ~SwTxtRuby(); + TYPEINFO(); + +//?? virtual void ChgFnt(SwFont *); +//?? virtual void RstFnt(SwFont *); + + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + virtual BOOL GetInfo( SfxPoolItem& rInfo ) const; + + // erfrage und setze den TxtNode Pointer + const SwTxtNode* GetpTxtNode() const { return pMyTxtNd; } + inline const SwTxtNode& GetTxtNode() const; + void ChgTxtNode( const SwTxtNode* pNew ) { pMyTxtNd = (SwTxtNode*)pNew; } + + SwCharFmt* GetCharFmt(); + const SwCharFmt* GetCharFmt() const + { return ((SwTxtRuby*)this)->GetCharFmt(); } +}; + + +// ****************************** + +class SwTxt2Lines : public SwTxtAttrEnd +{ +public: + SwTxt2Lines( const SwFmt2Lines& rAttr, + xub_StrLen nStart, xub_StrLen nEnd ); +}; + // --------------- Inline Implementierungen ------------------------ @@ -430,6 +473,11 @@ inline const SwTxtNode& SwTxtCharFmt::GetTxtNode() const return *pMyTxtNd; } +inline const SwTxtNode& SwTxtRuby::GetTxtNode() const +{ + ASSERT( pMyTxtNd, "SwTxtRuby:: wo ist mein TextNode?" ); + return *pMyTxtNd; +} #endif diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index ed5c6956c1a3..2699101df102 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -2,9 +2,9 @@ * * $RCSfile: init.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-09-27 17:34:01 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:57:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -251,6 +251,12 @@ #ifndef _FMTFTNTX_HXX #include <fmtftntx.hxx> #endif +#ifndef _FMTRUBY_HXX +#include <fmtruby.hxx> +#endif +#ifndef _FMT2LINES_HXX +#include <fmt2lines.hxx> +#endif #ifndef _EDITSH_HXX #include <editsh.hxx> #endif @@ -682,12 +688,8 @@ void _InitCore() aAttrTab[ RES_TXTATR_TOXMARK - POOLATTR_BEGIN ] = new SwTOXMark; aAttrTab[ RES_TXTATR_CHARFMT- POOLATTR_BEGIN ] = new SwFmtCharFmt( 0 ); - aAttrTab[ RES_TXTATR_TWO_LINES - POOLATTR_BEGIN ] = -//JP 28.07.00: must be changed to the correct attributes!! - new SfxBoolItem( RES_TXTATR_TWO_LINES); - aAttrTab[ RES_TXTATR_CJK_RUBY - POOLATTR_BEGIN ] = -//JP 28.07.00: must be changed to the correct attributes!! - new SfxBoolItem( RES_TXTATR_CJK_RUBY ); + aAttrTab[ RES_TXTATR_TWO_LINES - POOLATTR_BEGIN ] = new SwFmt2Lines; + aAttrTab[ RES_TXTATR_CJK_RUBY - POOLATTR_BEGIN ] = new SwFmtRuby( aEmptyStr ); aAttrTab[ RES_TXTATR_UNKNOWN_CONTAINER - POOLATTR_BEGIN ] = new SvXMLAttrContainerItem( RES_TXTATR_UNKNOWN_CONTAINER ); diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index fd2db4294f68..57048ed159e2 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: poolfmt.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:16 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:57:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1294,6 +1294,7 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId, String* pDesc, } break; + case RES_POOLCHR_BUL_LEVEL: // Aufzaehlungszeichen { const Font& rBulletFont = SwNumRule::GetDefBulletFont(); @@ -1327,6 +1328,12 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId, String* pDesc, } break; + case RES_POOLCHR_RUBYTEXT: + { +// ??? aSet.Put( SvxEscapementItem( DFLT_ESC_AUTO_SUPER, 58 ) ); + } + break; + case RES_POOLCHR_HTML_EMPHASIS: case RES_POOLCHR_HTML_CITIATION: case RES_POOLCHR_HTML_VARIABLE: diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 77d47a269593..66f12a830070 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmtatr2.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: mib $ $Date: 2000-09-29 10:58:31 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:57:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,9 +87,22 @@ #ifndef _TXTATR_HXX //autogen #include <txtatr.hxx> #endif -#include "cmdid.h" -#include "charfmt.hxx" -#include "hints.hxx" // SwUpdateAttr +#ifndef _FMT2LINES_HXX +#include <fmt2lines.hxx> +#endif +#ifndef _FMTRUBY_HXX +#include <fmtruby.hxx> +#endif +#ifndef _CHARFMT_HXX +#include <charfmt.hxx> +#endif +#ifndef _HINTS_HXX +#include <hints.hxx> // SwUpdateAttr +#endif + +#ifndef _CMDID_H +#include <cmdid.h> +#endif #ifndef _COM_SUN_STAR_UNO_ANY_H_ #include <com/sun/star/uno/Any.h> #endif @@ -383,3 +396,226 @@ BOOL SwFmtINetFmt::PutValue( const uno::Any& rVal, BYTE nMemberId ) +/************************************************************************* +|* class SwFmt2Lines +*************************************************************************/ + +SwFmt2Lines::SwFmt2Lines( sal_Unicode nStartBracket, sal_Unicode nEndBracket ) + : SfxPoolItem( RES_TXTATR_TWO_LINES ), + cStartBracket( nStartBracket ), cEndBracket( nEndBracket ) +{ +} + +SwFmt2Lines::SwFmt2Lines( const SwFmt2Lines& rAttr ) + : SfxPoolItem( RES_TXTATR_TWO_LINES ), + cStartBracket( rAttr.cStartBracket ), cEndBracket( rAttr.cEndBracket ) +{ +} + +SwFmt2Lines::~SwFmt2Lines() +{ +} + +int SwFmt2Lines::operator==( const SfxPoolItem& rAttr ) const +{ + ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); + return cStartBracket == ((SwFmt2Lines&)rAttr).cStartBracket && + cEndBracket == ((SwFmt2Lines&)rAttr).cEndBracket; +} + +SfxPoolItem* SwFmt2Lines::Clone( SfxItemPool* ) const +{ + return new SwFmt2Lines( *this ); +} + +BOOL SwFmt2Lines::QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId ) const +{ + BOOL bRet = TRUE; + XubString sVal; + switch( nMemberId ) + { +/* case MID_URL_URL: + sVal = aURL; + break; + case MID_URL_TARGET: + sVal = aTargetFrame; + break; + case MID_URL_HYPERLINKNAME: + sVal = aName; + break; + case MID_URL_VISITED_FMT: + sVal = SwXStyleFamilies::GetProgrammaticName( aVisitedFmt, + SFX_STYLE_FAMILY_CHAR ); + break; + case MID_URL_UNVISITED_FMT: + sVal = SwXStyleFamilies::GetProgrammaticName( aINetFmt, + SFX_STYLE_FAMILY_CHAR ); + break; +*/ + default: + bRet = FALSE; + break; + } + rVal <<= OUString(sVal); + return bRet; +} + +BOOL SwFmt2Lines::PutValue( const com::sun::star::uno::Any& rVal, + BYTE nMemberId ) +{ + BOOL bRet; + if( rVal.getValueType() == ::getCppuType((rtl::OUString*)0) ) + { + bRet = TRUE; + + XubString sVal = *(rtl::OUString*)rVal.getValue(); + switch( nMemberId ) + { +/* case MID_URL_URL: + aURL = sVal; + break; + case MID_URL_TARGET: + aTargetFrame = sVal; + break; + case MID_URL_HYPERLINKNAME: + aName = sVal; + break; + case MID_URL_VISITED_FMT: + aVisitedFmt = SwXStyleFamilies::GetUIName( sVal, + SFX_STYLE_FAMILY_CHAR ); + nVisitedId = USHRT_MAX; + break; + case MID_URL_UNVISITED_FMT: + aINetFmt = SwXStyleFamilies::GetUIName( sVal, + SFX_STYLE_FAMILY_CHAR ); + nINetId = USHRT_MAX; + break; +*/ default: + bRet = FALSE; + break; + } + } + else + bRet = FALSE; + return bRet; +} + + + + + +/************************************************************************* +|* class SwFmtRuby +*************************************************************************/ + +SwFmtRuby::SwFmtRuby( const String& rRubyTxt ) + : SfxPoolItem( RES_TXTATR_CJK_RUBY ), + sRubyTxt( rRubyTxt ), + nCharFmtId( 0 ), + nPosition( 0 ), nAdjustment( 0 ), + pTxtAttr( 0 ) +{ +} + +SwFmtRuby::SwFmtRuby( const SwFmtRuby& rAttr ) + : SfxPoolItem( RES_TXTATR_CJK_RUBY ), + sRubyTxt( rAttr.sRubyTxt ), + sCharFmtName( rAttr.sCharFmtName ), + nCharFmtId( rAttr.nCharFmtId), + nPosition( rAttr.nPosition ), nAdjustment( rAttr.nAdjustment ), + pTxtAttr( 0 ) +{ +} + +SwFmtRuby::~SwFmtRuby() +{ +} + +int SwFmtRuby::operator==( const SfxPoolItem& rAttr ) const +{ + ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); + return sRubyTxt == ((SwFmtRuby&)rAttr).sRubyTxt && + sCharFmtName == ((SwFmtRuby&)rAttr).sCharFmtName && + nCharFmtId == ((SwFmtRuby&)rAttr).nCharFmtId && + nPosition == ((SwFmtRuby&)rAttr).nPosition && + nAdjustment == ((SwFmtRuby&)rAttr).nAdjustment; +} + +SfxPoolItem* SwFmtRuby::Clone( SfxItemPool* ) const +{ + return new SwFmtRuby( *this ); +} + +BOOL SwFmtRuby::QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId ) const +{ + BOOL bRet = TRUE; + XubString sVal; + switch( nMemberId ) + { +/* case MID_URL_URL: + sVal = aURL; + break; + case MID_URL_TARGET: + sVal = aTargetFrame; + break; + case MID_URL_HYPERLINKNAME: + sVal = aName; + break; + case MID_URL_VISITED_FMT: + sVal = SwXStyleFamilies::GetProgrammaticName( aVisitedFmt, + SFX_STYLE_FAMILY_CHAR ); + break; + case MID_URL_UNVISITED_FMT: + sVal = SwXStyleFamilies::GetProgrammaticName( aINetFmt, + SFX_STYLE_FAMILY_CHAR ); + break; +*/ + default: + bRet = FALSE; + break; + } + rVal <<= OUString(sVal); + return bRet; +} +BOOL SwFmtRuby::PutValue( const com::sun::star::uno::Any& rVal, + BYTE nMemberId ) +{ + BOOL bRet; + if( rVal.getValueType() == ::getCppuType((rtl::OUString*)0) ) + { + bRet = TRUE; + + XubString sVal = *(rtl::OUString*)rVal.getValue(); + switch( nMemberId ) + { +/* case MID_URL_URL: + aURL = sVal; + break; + case MID_URL_TARGET: + aTargetFrame = sVal; + break; + case MID_URL_HYPERLINKNAME: + aName = sVal; + break; + case MID_URL_VISITED_FMT: + aVisitedFmt = SwXStyleFamilies::GetUIName( sVal, + SFX_STYLE_FAMILY_CHAR ); + nVisitedId = USHRT_MAX; + break; + case MID_URL_UNVISITED_FMT: + aINetFmt = SwXStyleFamilies::GetUIName( sVal, + SFX_STYLE_FAMILY_CHAR ); + nINetId = USHRT_MAX; + break; +*/ default: + bRet = FALSE; + break; + } + } + else + bRet = FALSE; + return bRet; +} + diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index c614f8db4bdf..de3c97dfdf19 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2,9 +2,9 @@ * * $RCSfile: thints.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: os $ $Date: 2000-10-20 12:36:57 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,6 +144,12 @@ #ifndef _FTNIDX_HXX //autogen #include <ftnidx.hxx> #endif +#ifndef _FMTRUBY_HXX +#include <fmtruby.hxx> +#endif +#ifndef _FMT2LINES_HXX +#include <fmt2lines.hxx> +#endif #ifndef _DOC_HXX #include <doc.hxx> @@ -187,7 +193,9 @@ #ifndef _POOLFMT_HXX #include <poolfmt.hxx> #endif -#include "swfont.hxx" +#ifndef _SWFONT_HXX +#include <swfont.hxx> +#endif #ifndef PRODUCT @@ -327,6 +335,12 @@ SwTxtAttr* SwTxtNode::MakeTxtAttr( const SfxPoolItem& rAttr, pNew = new SwTxtXMLAttrContainer( (SvXMLAttrContainerItem&)rNew, nStt, nEnd ); break; + case RES_TXTATR_TWO_LINES: + pNew = new SwTxt2Lines( (SwFmt2Lines&)rNew, nStt, nEnd ); + break; + case RES_TXTATR_CJK_RUBY: + pNew = new SwTxtRuby( (SwFmtRuby&)rNew, nStt, nEnd ); + break; } ASSERT( pNew, "was fuer ein TextAttribut soll hier angelegt werden?" ); return pNew; @@ -1650,6 +1664,15 @@ void SwpHints::Insert( SwTxtAttr *pHint, SwTxtNode &rNode, USHORT nMode ) case RES_TXTATR_TOXMARK: ((SwTxtTOXMark*)pHint)->ChgTxtNode( &rNode ); break; + + case RES_TXTATR_CJK_RUBY: + { + ((SwTxtRuby*)pHint)->ChgTxtNode( &rNode ); + SwCharFmt* pFmt = rNode.GetDoc()->GetCharFmtFromPool( + RES_POOLCHR_RUBYTEXT ); + pFmt->Add( (SwTxtRuby*)pHint ); + } + break; } if( SETATTR_DONTEXPAND & nMode ) diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 6f07f2f8fa66..87777cb5419e 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtatr2.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ama $ $Date: 2000-09-27 08:27:14 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -138,8 +138,16 @@ #ifndef _DOC_HXX #include <doc.hxx> // SwDoc #endif +#ifndef _FMTRUBY_HXX +#include <fmtruby.hxx> +#endif +#ifndef _FMT2LINES_HXX +#include <fmt2lines.hxx> +#endif TYPEINIT1(SwTxtINetFmt,SwClient); +TYPEINIT1(SwTxtRuby,SwClient); + /************************************************************************* * class SwImplPrev @@ -656,3 +664,105 @@ SwTxtXMLAttrContainer::SwTxtXMLAttrContainer( +// ****************************** + +SwTxtRuby::SwTxtRuby( const SwFmtRuby& rAttr, + xub_StrLen nStart, xub_StrLen nEnd ) + : SwTxtAttrEnd( rAttr, nStart, nEnd ), + SwClient( 0 ), + pMyTxtNd( 0 ) +{ + ((SwFmtRuby&)rAttr).pTxtAttr = this; + +} + +SwTxtRuby::~SwTxtRuby() +{ +} + +/* +void SwTxtRuby::ChgFnt(SwFont *) +{ +} +void SwTxtRuby::RstFnt(SwFont *) +{ +} +*/ + +void SwTxtRuby::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +{ + USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; +#ifndef PRODUCT + if ( (nWhich<RES_CHRATR_BEGIN || nWhich>RES_CHRATR_END) + && (nWhich!=RES_OBJECTDYING) + && (nWhich!=RES_ATTRSET_CHG) + && (nWhich!=RES_FMT_CHG) ) + ASSERT(!this, "SwTxtCharFmt::Modify(): unbekanntes Modify!"); +#endif + + if( pMyTxtNd ) + { + SwUpdateAttr aUpdateAttr( *GetStart(), *GetEnd(), nWhich ); + pMyTxtNd->SwCntntNode::Modify( &aUpdateAttr, &aUpdateAttr ); + } +} + +BOOL SwTxtRuby::GetInfo( SfxPoolItem& rInfo ) const +{ + if( RES_AUTOFMT_DOCNODE != rInfo.Which() || !pMyTxtNd || + &pMyTxtNd->GetNodes() != ((SwAutoFmtGetDocNode&)rInfo).pNodes ) + return TRUE; + + ((SwAutoFmtGetDocNode&)rInfo).pCntntNode = pMyTxtNd; + return FALSE; +} + +SwCharFmt* SwTxtRuby::GetCharFmt() +{ + const SwFmtRuby& rFmt = SwTxtAttrEnd::GetRuby(); + SwCharFmt* pRet = 0; + + if( rFmt.GetText().Len() ) + { + const SwDoc* pDoc = GetTxtNode().GetDoc(); + const String& rStr = rFmt.GetCharFmtName(); + USHORT nId = rStr.Len() ? rFmt.GetCharFmtId() : RES_POOLCHR_RUBYTEXT; + + // JP 10.02.2000, Bug 72806: dont modify the doc for getting the + // correct charstyle. + BOOL bResetMod = !pDoc->IsModified(); + Link aOle2Lnk; + if( bResetMod ) + { + aOle2Lnk = pDoc->GetOle2Link(); + ((SwDoc*)pDoc)->SetOle2Link( Link() ); + } + + pRet = IsPoolUserFmt( nId ) + ? ((SwDoc*)pDoc)->FindCharFmtByName( rStr ) + : ((SwDoc*)pDoc)->GetCharFmtFromPool( nId ); + + if( bResetMod ) + { + ((SwDoc*)pDoc)->ResetModified(); + ((SwDoc*)pDoc)->SetOle2Link( aOle2Lnk ); + } + } + + if( pRet ) + pRet->Add( this ); + else if( GetRegisteredIn() ) + pRegisteredIn->Remove( this ); + + return pRet; +} + +// ****************************** + +SwTxt2Lines::SwTxt2Lines( const SwFmt2Lines& rAttr, + xub_StrLen nStart, xub_StrLen nEnd ) + : SwTxtAttrEnd( rAttr, nStart, nEnd ) +{ +} + + diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 1e773113d374..7855c256740d 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: view2.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jp $ $Date: 2000-10-20 13:42:03 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1254,7 +1254,7 @@ long SwView::InsertDoc( USHORT nSlotId, const String& rFileName, pMed->SetFilter( pFilter ); } else - pMed = new SfxMedium(rFileName, STREAM_READ, TRUE, pFilter, 0); + pMed = new SfxMedium(rFileName, STREAM_READ, TRUE, TRUE, pFilter, 0); } else { diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx index 730857ffc304..42d2317485a1 100644 --- a/sw/source/ui/utlui/attrdesc.cxx +++ b/sw/source/ui/utlui/attrdesc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: attrdesc.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:49 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,6 +121,12 @@ #ifndef _FMTLINE_HXX #include <fmtline.hxx> #endif +#ifndef _FMTRUBY_HXX +#include <fmtruby.hxx> +#endif +#ifndef _FMT2LINES_HXX +#include <fmt2lines.hxx> +#endif #ifndef _SWATRSET_HXX #include <swatrset.hxx> #endif @@ -263,6 +269,44 @@ SfxItemPresentation SwFmtINetFmt::GetPresentation return SFX_ITEM_PRESENTATION_NONE; } +SfxItemPresentation SwFmt2Lines::GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, + String &rText, const International* pIntl ) const +{ + switch ( ePres ) + { + case SFX_ITEM_PRESENTATION_NONE: + rText.Erase(); + break; + case SFX_ITEM_PRESENTATION_NAMELESS: + case SFX_ITEM_PRESENTATION_COMPLETE: + { + rText = aEmptyStr; + return ePres; + } + } + return SFX_ITEM_PRESENTATION_NONE; +} + +SfxItemPresentation SwFmtRuby::GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, + String &rText, const International* pIntl ) const +{ + switch ( ePres ) + { + case SFX_ITEM_PRESENTATION_NONE: + rText.Erase(); + break; + case SFX_ITEM_PRESENTATION_NAMELESS: + case SFX_ITEM_PRESENTATION_COMPLETE: + { + rText = aEmptyStr; + return ePres; + } + } + return SFX_ITEM_PRESENTATION_NONE; +} + /************************************************************************* |* class SwFmtDrop *************************************************************************/ @@ -1235,6 +1279,9 @@ SfxItemPresentation SwDrawModeGrf::GetPresentation( /************************************************************************* $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:49 hr + initial import + Revision 1.48 2000/09/18 16:06:16 willem.vandorp OpenOffice header added. diff --git a/sw/source/ui/utlui/poolfmt.src b/sw/source/ui/utlui/poolfmt.src index f93c6c7082a1..42947b1fc2cf 100644 --- a/sw/source/ui/utlui/poolfmt.src +++ b/sw/source/ui/utlui/poolfmt.src @@ -2,9 +2,9 @@ * * $RCSfile: poolfmt.src,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: nf $ $Date: 2000-09-27 21:42:33 $ + * last change: $Author: jp $ $Date: 2000-10-23 11:58:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -4954,3 +4954,15 @@ String STR_POOLNUMRULE_PRGM_BUL5 Text = "List 5" ; }; + +String STR_POOLCHR_RUBYTEXT +{ + Text = "Phonetische Symbole" ; + Text [ English ] = "Phonetic Symbols" ; +}; + +String STR_POOLCHR_PRGM_RUBYTEXT +{ + Text = "Phonetic Symbols" ; +}; + |