diff options
Diffstat (limited to 'editeng/source/editeng')
37 files changed, 1997 insertions, 1997 deletions
diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 20f668f0dd23..8f50b3437374 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -79,10 +79,10 @@ EditAttrib::~EditAttrib() EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) : EditAttrib( rAttr ) { - nStart = nS; - nEnd = nE; - bFeature = FALSE; - bEdge = FALSE; + nStart = nS; + nEnd = nE; + bFeature = FALSE; + bEdge = FALSE; DBG_ASSERT( ( rAttr.Which() >= EE_ITEMS_START ) && ( rAttr.Which() <= EE_ITEMS_END ), "EditCharAttrib CTOR: Invalid id!" ); DBG_ASSERT( ( rAttr.Which() < EE_FEATURE_START ) || ( rAttr.Which() > EE_FEATURE_END ) || ( nE == (nS+1) ), "EditCharAttrib CTOR: Invalid feature!" ); @@ -152,7 +152,7 @@ EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) { rFont.SetUnderline( (FontUnderline)((const SvxUnderlineItem*)GetItem())->GetValue() ); - if ( pOutDev ) + if ( pOutDev ) pOutDev->SetTextLineColor( ((const SvxUnderlineItem*)GetItem())->GetColor() ); } @@ -334,7 +334,7 @@ void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* ) EditCharAttribField::EditCharAttribField( const SvxFieldItem& rAttr, USHORT nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( TRUE ); // !!! + SetFeature( TRUE ); // !!! pTxtColor = 0; pFldColor = 0; } diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx index e4f942bb8b11..27e20f32187e 100644 --- a/editeng/source/editeng/editattr.hxx +++ b/editeng/source/editeng/editattr.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -27,7 +27,7 @@ ************************************************************************/ #ifndef _EDITATTR_HXX -#define _EDITATTR_HXX +#define _EDITATTR_HXX #include <editeng/eeitem.hxx> @@ -57,13 +57,13 @@ class SvxCharReliefItem; class SfxVoidItem; -#define CH_FEATURE_OLD (BYTE) 0xFF -#define CH_FEATURE (sal_Unicode) 0x01 +#define CH_FEATURE_OLD (BYTE) 0xFF +#define CH_FEATURE (sal_Unicode) 0x01 // DEF_METRIC: Bei meinem Pool sollte immer die DefMetric bei // GetMetric( nWhich ) ankommen! // => Zum ermitteln der DefMetrik einfach ein GetMetric( 0 ) -#define DEF_METRIC 0 +#define DEF_METRIC 0 // ------------------------------------------------------------------------- // class EditAttrib @@ -75,17 +75,17 @@ private: EditAttrib( const EditAttrib & ) {;} protected: - const SfxPoolItem* pItem; + const SfxPoolItem* pItem; EditAttrib( const SfxPoolItem& rAttr ); - virtual ~EditAttrib(); + virtual ~EditAttrib(); public: // RemoveFromPool muss immer vorm DTOR Aufruf erfolgen!! - void RemoveFromPool( SfxItemPool& rPool ); + void RemoveFromPool( SfxItemPool& rPool ); - USHORT Which() const { return pItem->Which(); } - const SfxPoolItem* GetItem() const { return pItem; } + USHORT Which() const { return pItem->Which(); } + const SfxPoolItem* GetItem() const { return pItem; } }; // ------------------------------------------------------------------------- @@ -97,42 +97,42 @@ class EditCharAttrib : public EditAttrib { protected: - USHORT nStart; - USHORT nEnd; - BOOL bFeature :1; - BOOL bEdge :1; + USHORT nStart; + USHORT nEnd; + BOOL bFeature :1; + BOOL bEdge :1; public: EditCharAttrib( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd ); - USHORT& GetStart() { return nStart; } - USHORT& GetEnd() { return nEnd; } + USHORT& GetStart() { return nStart; } + USHORT& GetEnd() { return nEnd; } - USHORT GetStart() const { return nStart; } - USHORT GetEnd() const { return nEnd; } + USHORT GetStart() const { return nStart; } + USHORT GetEnd() const { return nEnd; } - inline USHORT GetLen() const; + inline USHORT GetLen() const; - inline void MoveForward( USHORT nDiff ); - inline void MoveBackward( USHORT nDiff ); + inline void MoveForward( USHORT nDiff ); + inline void MoveBackward( USHORT nDiff ); - inline void Expand( USHORT nDiff ); - inline void Collaps( USHORT nDiff ); + inline void Expand( USHORT nDiff ); + inline void Collaps( USHORT nDiff ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); - BOOL IsIn( USHORT nIndex ) + BOOL IsIn( USHORT nIndex ) { return ( ( nStart <= nIndex ) && ( nEnd >= nIndex ) ); } - BOOL IsInside( USHORT nIndex ) + BOOL IsInside( USHORT nIndex ) { return ( ( nStart < nIndex ) && ( nEnd > nIndex ) ); } - BOOL IsEmpty() + BOOL IsEmpty() { return nStart == nEnd; } - BOOL IsFeature() const { return bFeature; } - void SetFeature( BOOL b) { bFeature = b; } + BOOL IsFeature() const { return bFeature; } + void SetFeature( BOOL b) { bFeature = b; } - BOOL IsEdge() const { return bEdge; } - void SetEdge( BOOL b ) { bEdge = b; } + BOOL IsEdge() const { return bEdge; } + void SetEdge( BOOL b ) { bEdge = b; } }; inline USHORT EditCharAttrib::GetLen() const @@ -155,14 +155,14 @@ inline void EditCharAttrib::MoveBackward( USHORT nDiff ) nEnd = nEnd - nDiff; } -inline void EditCharAttrib::Expand( USHORT nDiff ) +inline void EditCharAttrib::Expand( USHORT nDiff ) { DBG_ASSERT( ( ((long)nEnd + nDiff) <= (long)0xFFFF ), "EditCharAttrib: Expand?!" ); DBG_ASSERT( !bFeature, "Bitte keine Features expandieren!" ); nEnd = nEnd + nDiff; } -inline void EditCharAttrib::Collaps( USHORT nDiff ) +inline void EditCharAttrib::Collaps( USHORT nDiff ) { DBG_ASSERT( (long)nEnd - nDiff >= (long)nStart, "EditCharAttrib: Collaps?!" ); DBG_ASSERT( !bFeature, "Bitte keine Features schrumpfen!" ); @@ -177,7 +177,7 @@ class EditCharAttribFont: public EditCharAttrib public: EditCharAttribFont( const SvxFontItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -188,7 +188,7 @@ class EditCharAttribWeight : public EditCharAttrib public: EditCharAttribWeight( const SvxWeightItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- // class EditCharAttribItalic @@ -198,7 +198,7 @@ class EditCharAttribItalic : public EditCharAttrib public: EditCharAttribItalic( const SvxPostureItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -209,7 +209,7 @@ class EditCharAttribShadow : public EditCharAttrib public: EditCharAttribShadow( const SvxShadowedItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -220,7 +220,7 @@ class EditCharAttribEscapement : public EditCharAttrib public: EditCharAttribEscapement( const SvxEscapementItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -231,7 +231,7 @@ class EditCharAttribOutline : public EditCharAttrib public: EditCharAttribOutline( const SvxContourItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -242,7 +242,7 @@ class EditCharAttribStrikeout : public EditCharAttrib public: EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -253,7 +253,7 @@ class EditCharAttribUnderline : public EditCharAttrib public: EditCharAttribUnderline( const SvxUnderlineItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -264,7 +264,7 @@ class EditCharAttribOverline : public EditCharAttrib public: EditCharAttribOverline( const SvxOverlineItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -275,7 +275,7 @@ class EditCharAttribEmphasisMark : public EditCharAttrib public: EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -286,7 +286,7 @@ class EditCharAttribRelief : public EditCharAttrib public: EditCharAttribRelief( const SvxCharReliefItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -297,7 +297,7 @@ class EditCharAttribFontHeight : public EditCharAttrib public: EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -308,7 +308,7 @@ class EditCharAttribFontWidth : public EditCharAttrib public: EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -319,7 +319,7 @@ class EditCharAttribColor : public EditCharAttrib public: EditCharAttribColor( const SvxColorItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -330,7 +330,7 @@ class EditCharAttribLanguage : public EditCharAttrib public: EditCharAttribLanguage( const SvxLanguageItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -341,7 +341,7 @@ class EditCharAttribTab : public EditCharAttrib public: EditCharAttribTab( const SfxVoidItem& rAttr, USHORT nPos ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -352,7 +352,7 @@ class EditCharAttribLineBreak : public EditCharAttrib public: EditCharAttribLineBreak( const SfxVoidItem& rAttr, USHORT nPos ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -360,9 +360,9 @@ public: // ------------------------------------------------------------------------- class EditCharAttribField: public EditCharAttrib { - XubString aFieldValue; - Color* pTxtColor; - Color* pFldColor; + XubString aFieldValue; + Color* pTxtColor; + Color* pFldColor; EditCharAttribField& operator = ( const EditCharAttribField& rAttr ) const; @@ -375,14 +375,14 @@ public: BOOL operator != ( const EditCharAttribField& rAttr ) const { return !(operator == ( rAttr ) ); } - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); - Color*& GetTxtColor() { return pTxtColor; } - Color*& GetFldColor() { return pFldColor; } + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + Color*& GetTxtColor() { return pTxtColor; } + Color*& GetFldColor() { return pFldColor; } - const XubString& GetFieldValue() const { return aFieldValue; } - XubString& GetFieldValue() { return aFieldValue; } + const XubString& GetFieldValue() const { return aFieldValue; } + XubString& GetFieldValue() { return aFieldValue; } - void Reset() + void Reset() { aFieldValue.Erase(); delete pTxtColor; pTxtColor = 0; @@ -398,7 +398,7 @@ class EditCharAttribPairKerning : public EditCharAttrib public: EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -409,7 +409,7 @@ class EditCharAttribKerning : public EditCharAttrib public: EditCharAttribKerning( const SvxKerningItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; // ------------------------------------------------------------------------- @@ -420,7 +420,7 @@ class EditCharAttribWordLineMode: public EditCharAttrib public: EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, USHORT nStart, USHORT nEnd ); - virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 08f59ff380be..1011ba13421f 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -466,7 +466,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\nMinAutoPaperSize: %li x %li", pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() ); fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() ); fprintf( fp, "\nAnzahl der Views: %i", pEE->GetViewCount() ); - for ( USHORT nView = 0; nView < pEE->GetViewCount(); nView++ ) + for ( USHORT nView = 0; nView < pEE->GetViewCount(); nView++ ) { EditView* pV = pEE->GetView( nView ); DBG_ASSERT( pV, "View nicht gefunden!" ); diff --git a/editeng/source/editeng/editdbg.hxx b/editeng/source/editeng/editdbg.hxx index 03b78ff3a0d4..45cff0d21096 100644 --- a/editeng/source/editeng/editdbg.hxx +++ b/editeng/source/editeng/editdbg.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,17 +41,17 @@ class SfxItemSet; class SfxItemPool; class SfxPoolItem; -ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ); -void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL bShowALL ); +ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ); +void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL bShowALL ); class EditDbg { public: - static void ShowEditEngineData( EditEngine* pEditEngine, BOOL bInfoBox = TRUE ); - static void ShowPortionData( ParaPortion* pPortion ); - static ByteString GetPortionInfo( ParaPortion* pPPortion ); - static ByteString GetTextPortionInfo( TextPortionList& rPortions ); - static ByteString GetUndoDebStr( EditUndoList* pUndoList ); + static void ShowEditEngineData( EditEngine* pEditEngine, BOOL bInfoBox = TRUE ); + static void ShowPortionData( ParaPortion* pPortion ); + static ByteString GetPortionInfo( ParaPortion* pPPortion ); + static ByteString GetTextPortionInfo( TextPortionList& rPortions ); + static ByteString GetUndoDebStr( EditUndoList* pUndoList ); }; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 7b4cd9408173..e9e1e49f134e 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,7 +65,7 @@ #include <tools/shl.hxx> #include <vcl/svapp.hxx> #include <com/sun/star/i18n/ScriptType.hpp> -#include <stdlib.h> // qsort +#include <stdlib.h> // qsort using namespace ::com::sun::star; @@ -75,11 +75,11 @@ using namespace ::com::sun::star; USHORT GetScriptItemId( USHORT nItemId, short nScriptType ) { USHORT nId = nItemId; - + if ( ( nScriptType == i18n::ScriptType::ASIAN ) || ( nScriptType == i18n::ScriptType::COMPLEX ) ) { - switch ( nItemId ) + switch ( nItemId ) { case EE_CHAR_LANGUAGE: nId = ( nScriptType == i18n::ScriptType::ASIAN ) ? EE_CHAR_LANGUAGE_CJK : EE_CHAR_LANGUAGE_CTL; @@ -98,15 +98,15 @@ USHORT GetScriptItemId( USHORT nItemId, short nScriptType ) break; } } - + return nId; } BOOL IsScriptItemValid( USHORT nItemId, short nScriptType ) { BOOL bValid = TRUE; - - switch ( nItemId ) + + switch ( nItemId ) { case EE_CHAR_LANGUAGE: bValid = nScriptType == i18n::ScriptType::LATIN; @@ -171,14 +171,14 @@ DBG_NAME( EE_CharAttribList ); SfxItemInfo aItemInfos[EDITITEMCOUNT] = { { SID_ATTR_FRAMEDIRECTION, SFX_ITEM_POOLABLE }, // EE_PARA_WRITINGDIR - { 0, SFX_ITEM_POOLABLE }, // EE_PARA_XMLATTRIBS - { SID_ATTR_PARA_HANGPUNCTUATION, SFX_ITEM_POOLABLE }, // EE_PARA_HANGINGPUNCTUATION + { 0, SFX_ITEM_POOLABLE }, // EE_PARA_XMLATTRIBS + { SID_ATTR_PARA_HANGPUNCTUATION, SFX_ITEM_POOLABLE }, // EE_PARA_HANGINGPUNCTUATION { SID_ATTR_PARA_FORBIDDEN_RULES, SFX_ITEM_POOLABLE }, - { SID_ATTR_PARA_SCRIPTSPACE, SFX_ITEM_POOLABLE }, // EE_PARA_ASIANCJKSPACING - { SID_ATTR_NUMBERING_RULE, SFX_ITEM_POOLABLE }, // EE_PARA_NUMBULL - { 0, SFX_ITEM_POOLABLE }, // EE_PARA_HYPHENATE - { 0, SFX_ITEM_POOLABLE }, // EE_PARA_BULLETSTATE - { 0, SFX_ITEM_POOLABLE }, // EE_PARA_OUTLLRSPACE + { SID_ATTR_PARA_SCRIPTSPACE, SFX_ITEM_POOLABLE }, // EE_PARA_ASIANCJKSPACING + { SID_ATTR_NUMBERING_RULE, SFX_ITEM_POOLABLE }, // EE_PARA_NUMBULL + { 0, SFX_ITEM_POOLABLE }, // EE_PARA_HYPHENATE + { 0, SFX_ITEM_POOLABLE }, // EE_PARA_BULLETSTATE + { 0, SFX_ITEM_POOLABLE }, // EE_PARA_OUTLLRSPACE { SID_ATTR_PARA_OUTLLEVEL, SFX_ITEM_POOLABLE }, // EE_PARA_OUTLLEVEL { SID_ATTR_PARA_BULLET, SFX_ITEM_POOLABLE }, // EE_PARA_BULLET { SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE }, // EE_PARA_LRSPACE @@ -215,12 +215,12 @@ SfxItemInfo aItemInfos[EDITITEMCOUNT] = { { SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEM_POOLABLE }, { SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEM_POOLABLE }, { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE }, - { 0, SFX_ITEM_POOLABLE }, // EE_CHAR_RUBI_DUMMY - { 0, SFX_ITEM_POOLABLE }, // EE_CHAR_XMLATTRIBS + { 0, SFX_ITEM_POOLABLE }, // EE_CHAR_RUBI_DUMMY + { 0, SFX_ITEM_POOLABLE }, // EE_CHAR_XMLATTRIBS { SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE }, - { 0, SFX_ITEM_POOLABLE }, // EE_FEATURE_TAB - { 0, SFX_ITEM_POOLABLE }, // EE_FEATURE_LINEBR - { SID_ATTR_CHAR_CHARSETCOLOR, SFX_ITEM_POOLABLE }, // EE_FEATURE_NOTCONV + { 0, SFX_ITEM_POOLABLE }, // EE_FEATURE_TAB + { 0, SFX_ITEM_POOLABLE }, // EE_FEATURE_LINEBR + { SID_ATTR_CHAR_CHARSETCOLOR, SFX_ITEM_POOLABLE }, // EE_FEATURE_NOTCONV { SID_FIELD, SFX_ITEM_POOLABLE } }; @@ -230,22 +230,22 @@ USHORT aV1Map[] = { }; USHORT aV2Map[] = { - 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, + 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4018, 4019, 4020 }; USHORT aV3Map[] = { - 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, + 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021 }; USHORT aV4Map[] = { - 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, - 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, - 4014, 4015, 4016, 4017, 4018, + 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, + 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, + 4014, 4015, 4016, 4017, 4018, /* CJK Items inserted here: EE_CHAR_LANGUAGE - EE_CHAR_XMLATTRIBS */ - 4034, 4035, 4036, 4037 + 4034, 4035, 4036, 4037 }; USHORT aV5Map[] = { @@ -382,7 +382,7 @@ EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, US break; case EE_CHAR_XMLATTRIBS: { - pNew = new EditCharAttrib( rNew, nS, nE ); // Attrib is only for holding XML information... + pNew = new EditCharAttrib( rNew, nS, nE ); // Attrib is only for holding XML information... } break; case EE_FEATURE_TAB: @@ -417,7 +417,7 @@ EditLine::EditLine() DBG_CTOR( EE_EditLine, 0 ); nStart = nEnd = 0; - nStartPortion = 0; // damit in ungueltiger Zeile ohne Portions von einer gueltigen Zeile mit der Portion Nr0 unterscieden werden kann. + nStartPortion = 0; // damit in ungueltiger Zeile ohne Portions von einer gueltigen Zeile mit der Portion Nr0 unterscieden werden kann. nEndPortion = 0; nHeight = 0; nStartPosX = 0; @@ -460,16 +460,16 @@ EditLine* EditLine::Clone() const { pL->aPositions.Insert (aPositions.GetData(), aPositions.Count(), 0); } - pL->nStartPosX = nStartPosX; - pL->nStart = nStart; - pL->nEnd = nEnd; - pL->nStartPortion = nStartPortion; - pL->nEndPortion = nEndPortion; - pL->nHeight = nHeight; - pL->nTxtWidth = nTxtWidth; - pL->nTxtHeight = nTxtHeight; - pL->nCrsrHeight = nCrsrHeight; - pL->nMaxAscent = nMaxAscent; + pL->nStartPosX = nStartPosX; + pL->nStart = nStart; + pL->nEnd = nEnd; + pL->nStartPortion = nStartPortion; + pL->nEndPortion = nEndPortion; + pL->nHeight = nHeight; + pL->nTxtWidth = nTxtWidth; + pL->nTxtHeight = nTxtHeight; + pL->nCrsrHeight = nCrsrHeight; + pL->nMaxAscent = nMaxAscent; return pL; } @@ -532,7 +532,7 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion ) } break; case PORTIONKIND_TAB: -// case PORTIONKIND_EXTRASPACE: +// case PORTIONKIND_EXTRASPACE: { aSz.Width() += pPortion->GetSize().Width(); } @@ -768,7 +768,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP // Wenn spaeter doch Ueberpruefung: // Spezialfall: Start == 0; AbsLen == 1, nNew = 1 => Expand, weil durch Absatzumbruch! // Start <= nIndex, End >= nIndex => Start=End=nIndex! -// if ( pAttrib->GetStart() == nIndex ) +// if ( pAttrib->GetStart() == nIndex ) pAttrib->Expand( nNew ); if ( pAttrib->GetStart() == 0 ) bExpandedEmptyAtIndexNull = TRUE; @@ -779,7 +779,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP // Nur expandieren, wenn kein Feature, // und wenn nicht in ExcludeListe! // Sonst geht z.B. ein UL bis zum neuen ULDB, beide expandieren -// if ( !pAttrib->IsFeature() && !rExclList.FindAttrib( pAttrib->Which() ) ) +// if ( !pAttrib->IsFeature() && !rExclList.FindAttrib( pAttrib->Which() ) ) if ( !pAttrib->IsFeature() && !aCharAttribList.FindEmptyAttrib( pAttrib->Which(), nIndex ) ) { if ( !pAttrib->IsEdge() ) @@ -902,7 +902,7 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r // Spezialfall: Attrubt deckt genau den Bereich ab // => als leeres Attribut behalten. if ( !pAttrib->IsFeature() && ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) ) - pAttrib->GetEnd() = nIndex; // leer + pAttrib->GetEnd() = nIndex; // leer else bDelAttr = TRUE; } @@ -910,10 +910,10 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) { DBG_ASSERT( !pAttrib->IsFeature(), "Collapsing Feature!" ); - if ( pAttrib->GetEnd() <= nEndChanges ) // endet drinnen + if ( pAttrib->GetEnd() <= nEndChanges ) // endet drinnen pAttrib->GetEnd() = nIndex; else - pAttrib->Collaps( nDeleted ); // endet dahinter + pAttrib->Collaps( nDeleted ); // endet dahinter } // 3. Attribut beginnt drinnen, endet dahinter... else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() > nEndChanges ) ) @@ -1001,7 +1001,7 @@ void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, else { // alle dahinter verschieben in den neuen Node (this) -// pPrevNode->GetCharAttribs().RemoveAttrib( pAttrib ); +// pPrevNode->GetCharAttribs().RemoveAttrib( pAttrib ); pPrevNode->GetCharAttribs().GetAttribs().Remove( nAttr ); aCharAttribList.InsertAttrib( pAttrib ); DBG_ASSERT( pAttrib->GetStart() >= nCut, "Start < nCut!" ); @@ -1079,7 +1079,7 @@ void ContentNode::CreateDefFont() SfxStyleSheet* pS = aContentAttribs.GetStyleSheet(); if ( pS ) CreateFont( GetCharAttribs().GetDefFont(), pS->GetItemSet() ); - + // ... dann die harte Absatzformatierung rueberbuegeln... CreateFont( GetCharAttribs().GetDefFont(), GetContentAttribs().GetItems(), pS == NULL ); @@ -1088,7 +1088,7 @@ void ContentNode::CreateDefFont() void ContentNode::SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle ) { aContentAttribs.SetStyleSheet( pS ); - + // Erst alle Informationen aus dem Style verwenden... GetCharAttribs().GetDefFont() = rFontFromStyle; // ... dann die harte Absatzformatierung rueberbuegeln... @@ -1119,10 +1119,10 @@ void ContentNode::CreateWrongList() #endif } -void ContentNode::SetWrongList( WrongList* p ) -{ +void ContentNode::SetWrongList( WrongList* p ) +{ DBG_ASSERT( !pWrongList, "WrongList existiert schon!" ); - pWrongList = p; + pWrongList = p; } // ------------------------------------------------------------------------- @@ -1203,9 +1203,9 @@ BOOL ContentAttribs::HasItem( USHORT nWhich ) -// ---------------------------------------------------------------------- -// class ItemList -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class ItemList +// ---------------------------------------------------------------------- const SfxPoolItem* ItemList::FindAttrib( USHORT nWhich ) { const SfxPoolItem* pItem = First(); @@ -1220,7 +1220,7 @@ const SfxPoolItem* ItemList::FindAttrib( USHORT nWhich ) // ------------------------------------------------------------------------- EditDoc::EditDoc( SfxItemPool* pPool ) { - if ( pPool ) + if ( pPool ) { pItemPool = pPool; bOwnerOfPool = FALSE; @@ -1230,7 +1230,7 @@ EditDoc::EditDoc( SfxItemPool* pPool ) pItemPool = new EditEngineItemPool( FALSE ); bOwnerOfPool = TRUE; } - + nDefTab = DEFTAB; bIsVertical = FALSE; bIsFixedCellHeight = FALSE; @@ -1243,7 +1243,7 @@ EditDoc::EditDoc( SfxItemPool* pPool ) EditDoc::~EditDoc() { ImplDestroyContents(); - if ( bOwnerOfPool ) + if ( bOwnerOfPool ) SfxItemPool::Free(pItemPool); } @@ -1333,7 +1333,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s // So ggf ein MakeUniqFont im Font mehr, dafuer bei Aenderung schnellerer // Abbruch der Abfrage, oder ich musste noch jedesmal ein bChanged pflegen. if ( rFont == aPrevFont ) - rFont = aPrevFont; // => Gleicher ImpPointer fuer IsSameInstance + rFont = aPrevFont; // => Gleicher ImpPointer fuer IsSameInstance } void EditDoc::CreateDefFont( BOOL bUseStyles ) @@ -1424,10 +1424,10 @@ XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT if ( pNextFeature && ( pNextFeature->GetStart() < nEnd ) ) nEnd = pNextFeature->GetStart(); else - pNextFeature = 0; // Feature interessiert unten nicht + pNextFeature = 0; // Feature interessiert unten nicht DBG_ASSERT( nEnd >= nIndex, "Ende vorm Index?" ); - //!! beware of sub string length of -1 which is also defined as STRING_LEN and + //!! beware of sub string length of -1 which is also defined as STRING_LEN and //!! thus would result in adding the whole sub string up to the end of the node !! if (nEnd > nIndex) aStr += XubString( *pNode, nIndex, nEnd - nIndex ); @@ -1436,14 +1436,14 @@ XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT { switch ( pNextFeature->GetItem()->Which() ) { - case EE_FEATURE_TAB: aStr += '\t'; + case EE_FEATURE_TAB: aStr += '\t'; break; - case EE_FEATURE_LINEBR: aStr += '\x0A'; + case EE_FEATURE_LINEBR: aStr += '\x0A'; break; - case EE_FEATURE_FIELD: if ( bResolveFields ) + case EE_FEATURE_FIELD: if ( bResolveFields ) aStr += ((EditCharAttribField*)pNextFeature)->GetFieldValue(); break; - default: DBG_ERROR( "Was fuer ein Feature ?" ); + default: DBG_ERROR( "Was fuer ein Feature ?" ); } pNextFeature = pNode->GetCharAttribs().FindFeature( ++nEnd ); } @@ -1492,8 +1492,8 @@ EditPaM EditDoc::Clear() return aPaM; } -void EditDoc::SetModified( BOOL b ) -{ +void EditDoc::SetModified( BOOL b ) +{ bModified = b; if ( bModified ) { @@ -1721,10 +1721,10 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi bChanged = TRUE; if ( pAttr->GetEnd() > nEnd ) { - pAttr->GetStart() = nEnd; // dann faengt es dahinter an + pAttr->GetStart() = nEnd; // dann faengt es dahinter an rpStarting = pAttr; if ( nWhich ) - break; // es kann kein weiteres Attrib hier liegen + break; // es kann kein weiteres Attrib hier liegen } else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { @@ -1739,7 +1739,7 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi bChanged = TRUE; if ( ( pAttr->GetStart() < nStart ) && !pAttr->IsFeature() ) { - pAttr->GetEnd() = nStart; // dann hoert es hier auf + pAttr->GetEnd() = nStart; // dann hoert es hier auf rpEnding = pAttr; } else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) @@ -1757,14 +1757,14 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi pAttr->GetStart() = nEnd; rpStarting = pAttr; if ( nWhich ) - break; // es kann weitere Attribute geben! + break; // es kann weitere Attribute geben! } else if ( pAttr->GetEnd() == nEnd ) { pAttr->GetEnd() = nStart; rpEnding = pAttr; if ( nWhich ) - break; // es kann weitere Attribute geben! + break; // es kann weitere Attribute geben! } else // Attribut muss gesplittet werden... { @@ -1773,7 +1773,7 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi rpEnding = pAttr; InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd ); if ( nWhich ) - break; // es kann weitere Attribute geben! + break; // es kann weitere Attribute geben! } } } @@ -1834,7 +1834,7 @@ void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, cons pAttr = pNode->GetCharAttribs().FindAttrib( rPoolItem.Which(), nStart ); if ( pAttr ) { - if ( pAttr->IsInside( nStart ) ) // splitten + if ( pAttr->IsInside( nStart ) ) // splitten { // ??????????????????????????????? // eigentlich noch pruefen, ob wirklich splittet, oder return ! @@ -1888,7 +1888,7 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, // Attribut beginnt hier else if ( ( pAttr->GetStart() == nStartPos ) && ( pAttr->GetEnd() > nStartPos ) ) { - if ( nStartPos == 0 ) // Sonderfall + if ( nStartPos == 0 ) // Sonderfall pItem = pAttr->GetItem(); } @@ -1912,7 +1912,7 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); } } - else // Selektion + else // Selektion { while ( pAttr && ( pAttr->GetStart() < nEndPos) ) { @@ -2156,7 +2156,7 @@ EditCharAttrib* CharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos ) return 0; } -EditCharAttrib* CharAttribList::FindFeature( USHORT nPos ) const +EditCharAttrib* CharAttribList::FindFeature( USHORT nPos ) const { USHORT nAttr = 0; diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index ad11aa6f0d93..188992bebe3e 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,8 +45,8 @@ class SvtCTLOptions; DBG_NAMEEX( EE_TextPortion ) -#define CHARPOSGROW 16 -#define DEFTAB 720 +#define CHARPOSGROW 16 +#define DEFTAB 720 void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent = true, short nScriptType = 0 ); USHORT GetScriptItemId( USHORT nItemId, short nScriptType ); @@ -62,10 +62,10 @@ struct EPaM USHORT nPara; USHORT nIndex; - EPaM() { nPara = 0; nIndex = 0; } - EPaM( USHORT nP, USHORT nI ) { nPara = nP; nIndex = nI; } - EPaM( const EPaM& r) { nPara = r.nPara; nIndex = r.nIndex; } - EPaM& operator = ( const EPaM& r ) { nPara = r.nPara; nIndex = r.nIndex; return *this; } + EPaM() { nPara = 0; nIndex = 0; } + EPaM( USHORT nP, USHORT nI ) { nPara = nP; nIndex = nI; } + EPaM( const EPaM& r) { nPara = r.nPara; nIndex = r.nIndex; } + EPaM& operator = ( const EPaM& r ) { nPara = r.nPara; nIndex = r.nIndex; return *this; } inline BOOL operator == ( const EPaM& r ) const; inline BOOL operator < ( const EPaM& r ) const; }; @@ -83,9 +83,9 @@ inline BOOL EPaM::operator == ( const EPaM& r ) const struct ScriptTypePosInfo { - short nScriptType; - USHORT nStartPos; - USHORT nEndPos; + short nScriptType; + USHORT nStartPos; + USHORT nEndPos; ScriptTypePosInfo( short _Type, USHORT _Start, USHORT _End ) { @@ -99,9 +99,9 @@ SV_DECL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo, 0, 4 ) struct WritingDirectionInfo { - BYTE nType; - USHORT nStartPos; - USHORT nEndPos; + BYTE nType; + USHORT nStartPos; + USHORT nEndPos; WritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End ) { @@ -119,24 +119,24 @@ SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0, 4 ) class ContentAttribsInfo { private: - SfxItemSet aPrevParaAttribs; - CharAttribArray aPrevCharAttribs; + SfxItemSet aPrevParaAttribs; + CharAttribArray aPrevCharAttribs; public: ContentAttribsInfo( const SfxItemSet& rParaAttribs ); - const SfxItemSet& GetPrevParaAttribs() const { return aPrevParaAttribs; } - const CharAttribArray& GetPrevCharAttribs() const { return aPrevCharAttribs; } + const SfxItemSet& GetPrevParaAttribs() const { return aPrevParaAttribs; } + const CharAttribArray& GetPrevCharAttribs() const { return aPrevCharAttribs; } - CharAttribArray& GetPrevCharAttribs() { return aPrevCharAttribs; } + CharAttribArray& GetPrevCharAttribs() { return aPrevCharAttribs; } }; typedef ContentAttribsInfo* ContentAttribsInfoPtr; SV_DECL_PTRARR( ContentInfoArray, ContentAttribsInfoPtr, 1, 1 ) -// ---------------------------------------------------------------------- -// class SvxFontTable -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class SvxFontTable +// ---------------------------------------------------------------------- DECLARE_TABLE( DummyFontTable, SvxFontItem* ) class SvxFontTable : public DummyFontTable { @@ -144,12 +144,12 @@ public: SvxFontTable(); ~SvxFontTable(); - ULONG GetId( const SvxFontItem& rFont ); + ULONG GetId( const SvxFontItem& rFont ); }; -// ---------------------------------------------------------------------- -// class SvxColorList -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class SvxColorList +// ---------------------------------------------------------------------- typedef ContentNode* ContentNodePtr; DECLARE_LIST( DummyColorList, SvxColorItem* ) class SvxColorList : public DummyColorList @@ -158,18 +158,18 @@ public: SvxColorList(); ~SvxColorList(); - ULONG GetId( const SvxColorItem& rColor ); + ULONG GetId( const SvxColorItem& rColor ); }; -// ---------------------------------------------------------------------- -// class ItemList -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class ItemList +// ---------------------------------------------------------------------- typedef const SfxPoolItem* ConstPoolItemPtr; DECLARE_LIST( DummyItemList, ConstPoolItemPtr ) class ItemList : public DummyItemList { public: - const SfxPoolItem* FindAttrib( USHORT nWhich ); + const SfxPoolItem* FindAttrib( USHORT nWhich ); }; // ------------------------------------------------------------------------- @@ -178,21 +178,21 @@ public: class ContentAttribs { private: - SfxStyleSheet* pStyle; - SfxItemSet aAttribSet; + SfxStyleSheet* pStyle; + SfxItemSet aAttribSet; public: ContentAttribs( SfxItemPool& rItemPool ); ContentAttribs( const ContentAttribs& ); - ~ContentAttribs(); // erst bei umfangreicheren Tabs + ~ContentAttribs(); // erst bei umfangreicheren Tabs - SvxTabStop FindTabStop( long nCurPos, USHORT nDefTab ); - SfxItemSet& GetItems() { return aAttribSet; } - SfxStyleSheet* GetStyleSheet() const { return pStyle; } - void SetStyleSheet( SfxStyleSheet* pS ); + SvxTabStop FindTabStop( long nCurPos, USHORT nDefTab ); + SfxItemSet& GetItems() { return aAttribSet; } + SfxStyleSheet* GetStyleSheet() const { return pStyle; } + void SetStyleSheet( SfxStyleSheet* pS ); - const SfxPoolItem& GetItem( USHORT nWhich ); - BOOL HasItem( USHORT nWhich ); + const SfxPoolItem& GetItem( USHORT nWhich ); + BOOL HasItem( USHORT nWhich ); }; // ------------------------------------------------------------------------- @@ -201,9 +201,9 @@ public: class CharAttribList { private: - CharAttribArray aAttribs; - SvxFont aDefFont; // schneller, als jedesmal vom Pool! - BOOL bHasEmptyAttribs; + CharAttribArray aAttribs; + SvxFont aDefFont; // schneller, als jedesmal vom Pool! + BOOL bHasEmptyAttribs; CharAttribList( const CharAttribList& ) {;} @@ -211,35 +211,35 @@ public: CharAttribList(); ~CharAttribList(); - void DeleteEmptyAttribs( SfxItemPool& rItemPool ); - void RemoveItemsFromPool( SfxItemPool* pItemPool ); + void DeleteEmptyAttribs( SfxItemPool& rItemPool ); + void RemoveItemsFromPool( SfxItemPool* pItemPool ); - EditCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos ); - EditCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos ) const; - EditCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos ); - EditCharAttrib* FindFeature( USHORT nPos ) const; + EditCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos ); + EditCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos ) const; + EditCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos ); + EditCharAttrib* FindFeature( USHORT nPos ) const; - void ResortAttribs(); + void ResortAttribs(); void OptimizeRanges( SfxItemPool& rItemPool ); - USHORT Count() { return aAttribs.Count(); } - void Clear() { aAttribs.Remove( 0, aAttribs.Count()); } - void InsertAttrib( EditCharAttrib* pAttrib ); + USHORT Count() { return aAttribs.Count(); } + void Clear() { aAttribs.Remove( 0, aAttribs.Count()); } + void InsertAttrib( EditCharAttrib* pAttrib ); - SvxFont& GetDefFont() { return aDefFont; } + SvxFont& GetDefFont() { return aDefFont; } - BOOL HasEmptyAttribs() const { return bHasEmptyAttribs; } - BOOL& HasEmptyAttribs() { return bHasEmptyAttribs; } - BOOL HasBoundingAttrib( USHORT nBound ); - BOOL HasAttrib( USHORT nWhich ) const; - BOOL HasAttrib( USHORT nStartPos, USHORT nEndPos ) const; + BOOL HasEmptyAttribs() const { return bHasEmptyAttribs; } + BOOL& HasEmptyAttribs() { return bHasEmptyAttribs; } + BOOL HasBoundingAttrib( USHORT nBound ); + BOOL HasAttrib( USHORT nWhich ) const; + BOOL HasAttrib( USHORT nStartPos, USHORT nEndPos ) const; - CharAttribArray& GetAttribs() { return aAttribs; } - const CharAttribArray& GetAttribs() const { return aAttribs; } + CharAttribArray& GetAttribs() { return aAttribs; } + const CharAttribArray& GetAttribs() const { return aAttribs; } // Debug: - BOOL DbgCheckAttribs(); + BOOL DbgCheckAttribs(); }; // ------------------------------------------------------------------------- @@ -248,36 +248,36 @@ public: class ContentNode : public XubString { private: - ContentAttribs aContentAttribs; - CharAttribList aCharAttribList; - WrongList* pWrongList; + ContentAttribs aContentAttribs; + CharAttribList aCharAttribList; + WrongList* pWrongList; public: ContentNode( SfxItemPool& rItemPool ); ContentNode( const XubString& rStr, const ContentAttribs& rContentAttribs ); ~ContentNode(); - ContentAttribs& GetContentAttribs() { return aContentAttribs; } - CharAttribList& GetCharAttribs() { return aCharAttribList; } + ContentAttribs& GetContentAttribs() { return aContentAttribs; } + CharAttribList& GetCharAttribs() { return aCharAttribList; } - void ExpandAttribs( USHORT nIndex, USHORT nNewChars, SfxItemPool& rItemPool ); - void CollapsAttribs( USHORT nIndex, USHORT nDelChars, SfxItemPool& rItemPool ); - void AppendAttribs( ContentNode* pNextNode ); - void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, BOOL bKeepEndingAttribs ); + void ExpandAttribs( USHORT nIndex, USHORT nNewChars, SfxItemPool& rItemPool ); + void CollapsAttribs( USHORT nIndex, USHORT nDelChars, SfxItemPool& rItemPool ); + void AppendAttribs( ContentNode* pNextNode ); + void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, BOOL bKeepEndingAttribs ); - void SetStyleSheet( SfxStyleSheet* pS, BOOL bRecalcFont = TRUE ); - void SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle ); - SfxStyleSheet* GetStyleSheet() { return aContentAttribs.GetStyleSheet(); } + void SetStyleSheet( SfxStyleSheet* pS, BOOL bRecalcFont = TRUE ); + void SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle ); + SfxStyleSheet* GetStyleSheet() { return aContentAttribs.GetStyleSheet(); } - void CreateDefFont(); + void CreateDefFont(); - WrongList* GetWrongList() { return pWrongList; } - void SetWrongList( WrongList* p ); + WrongList* GetWrongList() { return pWrongList; } + void SetWrongList( WrongList* p ); - void CreateWrongList(); - void DestroyWrongList(); + void CreateWrongList(); + void DestroyWrongList(); - BOOL IsFeature( USHORT nPos ) const { return ( GetChar( nPos ) == CH_FEATURE ); } + BOOL IsFeature( USHORT nPos ) const { return ( GetChar( nPos ) == CH_FEATURE ); } }; typedef ContentNode* ContentNodePtr; @@ -297,40 +297,40 @@ public: class EditPaM { private: - ContentNode* pNode; - USHORT nIndex; + ContentNode* pNode; + USHORT nIndex; public: - EditPaM() { pNode = NULL; nIndex = 0; } - EditPaM( ContentNode* p, USHORT n ) { pNode = p; nIndex = n; } + EditPaM() { pNode = NULL; nIndex = 0; } + EditPaM( ContentNode* p, USHORT n ) { pNode = p; nIndex = n; } - ContentNode* GetNode() const { return pNode; } - void SetNode( ContentNode* p) { pNode = p; } + ContentNode* GetNode() const { return pNode; } + void SetNode( ContentNode* p) { pNode = p; } - USHORT GetIndex() const { return nIndex; } - USHORT& GetIndex() { return nIndex; } - void SetIndex( USHORT n ) { nIndex = n; } + USHORT GetIndex() const { return nIndex; } + USHORT& GetIndex() { return nIndex; } + void SetIndex( USHORT n ) { nIndex = n; } - BOOL IsParaStart() const { return nIndex == 0; } - BOOL IsParaEnd() const { return nIndex == pNode->Len(); } + BOOL IsParaStart() const { return nIndex == 0; } + BOOL IsParaEnd() const { return nIndex == pNode->Len(); } - BOOL DbgIsBuggy( EditDoc& rDoc ); + BOOL DbgIsBuggy( EditDoc& rDoc ); - EditPaM& operator = ( const EditPaM& rPaM ); + EditPaM& operator = ( const EditPaM& rPaM ); friend BOOL operator == ( const EditPaM& r1, const EditPaM& r2 ); friend BOOL operator != ( const EditPaM& r1, const EditPaM& r2 ); }; -#define PORTIONKIND_TEXT 0 +#define PORTIONKIND_TEXT 0 #define PORTIONKIND_TAB 1 -#define PORTIONKIND_LINEBREAK 2 -#define PORTIONKIND_FIELD 3 -#define PORTIONKIND_HYPHENATOR 4 -// #define PORTIONKIND_EXTRASPACE 5 +#define PORTIONKIND_LINEBREAK 2 +#define PORTIONKIND_FIELD 3 +#define PORTIONKIND_HYPHENATOR 4 +// #define PORTIONKIND_EXTRASPACE 5 -#define DELMODE_SIMPLE 0 -#define DELMODE_RESTOFWORD 1 -#define DELMODE_RESTOFCONTENT 2 +#define DELMODE_SIMPLE 0 +#define DELMODE_RESTOFWORD 1 +#define DELMODE_RESTOFCONTENT 2 #define CHAR_NORMAL 0x00 #define CHAR_KANA 0x01 @@ -371,44 +371,44 @@ class TextPortion { private: ExtraPortionInfo* pExtraInfos; - USHORT nLen; - Size aOutSz; - BYTE nKind; + USHORT nLen; + Size aOutSz; + BYTE nKind; BYTE nRightToLeft; - sal_Unicode nExtraValue; + sal_Unicode nExtraValue; - TextPortion() { DBG_CTOR( EE_TextPortion, 0 ); + TextPortion() { DBG_CTOR( EE_TextPortion, 0 ); pExtraInfos = NULL; nLen = 0; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = FALSE;} public: TextPortion( USHORT nL ) : aOutSz( -1, -1 ) - { DBG_CTOR( EE_TextPortion, 0 ); + { DBG_CTOR( EE_TextPortion, 0 ); pExtraInfos = NULL; nLen = nL; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = FALSE;} - TextPortion( const TextPortion& r ) : aOutSz( r.aOutSz ) + TextPortion( const TextPortion& r ) : aOutSz( r.aOutSz ) { DBG_CTOR( EE_TextPortion, 0 ); pExtraInfos = NULL; nLen = r.nLen; nKind = r.nKind; nExtraValue = r.nExtraValue; nRightToLeft = r.nRightToLeft; } - ~TextPortion() { DBG_DTOR( EE_TextPortion, 0 ); delete pExtraInfos; } + ~TextPortion() { DBG_DTOR( EE_TextPortion, 0 ); delete pExtraInfos; } - USHORT GetLen() const { return nLen; } - USHORT& GetLen() { return nLen; } - void SetLen( USHORT nL ) { nLen = nL; } + USHORT GetLen() const { return nLen; } + USHORT& GetLen() { return nLen; } + void SetLen( USHORT nL ) { nLen = nL; } - Size& GetSize() { return aOutSz; } - Size GetSize() const { return aOutSz; } + Size& GetSize() { return aOutSz; } + Size GetSize() const { return aOutSz; } - BYTE& GetKind() { return nKind; } - BYTE GetKind() const { return nKind; } + BYTE& GetKind() { return nKind; } + BYTE GetKind() const { return nKind; } void SetRightToLeft( BYTE b ) { nRightToLeft = b; } BYTE GetRightToLeft() const { return nRightToLeft; } BOOL IsRightToLeft() const { return (nRightToLeft&1); } - sal_Unicode GetExtraValue() const { return nExtraValue; } - void SetExtraValue( sal_Unicode n ) { nExtraValue = n; } + sal_Unicode GetExtraValue() const { return nExtraValue; } + void SetExtraValue( sal_Unicode n ) { nExtraValue = n; } - BOOL HasValidSize() const { return aOutSz.Width() != (-1); } + BOOL HasValidSize() const { return aOutSz.Width() != (-1); } ExtraPortionInfo* GetExtraInfos() const { return pExtraInfos; } void SetExtraInfos( ExtraPortionInfo* p ) { delete pExtraInfos; pExtraInfos = p; } @@ -426,10 +426,10 @@ public: TextPortionList(); ~TextPortionList(); - void Reset(); - USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE ); + void Reset(); + USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE ); USHORT GetStartPos( USHORT nPortion ); - void DeleteFromPortion( USHORT nDelFrom ); + void DeleteFromPortion( USHORT nDelFrom ); }; class ParaPortion; @@ -442,84 +442,84 @@ SV_DECL_VARARR( CharPosArray, sal_Int32, 0, CHARPOSGROW ) class EditLine { private: - CharPosArray aPositions; + CharPosArray aPositions; long nTxtWidth; - USHORT nStartPosX; - USHORT nStart; // koennte durch nStartPortion ersetzt werden - USHORT nEnd; // koennte durch nEndPortion ersetzt werden - USHORT nStartPortion; - USHORT nEndPortion; - USHORT nHeight; // Gesamthoehe der Zeile - USHORT nTxtHeight; // Reine Texthoehe - USHORT nCrsrHeight; // Bei Konturfluss hohe Zeilen => Cursor zu groá. - USHORT nMaxAscent; - BOOL bHangingPunctuation; - BOOL bInvalid; // fuer geschickte Formatierung + USHORT nStartPosX; + USHORT nStart; // koennte durch nStartPortion ersetzt werden + USHORT nEnd; // koennte durch nEndPortion ersetzt werden + USHORT nStartPortion; + USHORT nEndPortion; + USHORT nHeight; // Gesamthoehe der Zeile + USHORT nTxtHeight; // Reine Texthoehe + USHORT nCrsrHeight; // Bei Konturfluss hohe Zeilen => Cursor zu groá. + USHORT nMaxAscent; + BOOL bHangingPunctuation; + BOOL bInvalid; // fuer geschickte Formatierung public: EditLine(); EditLine( const EditLine& ); ~EditLine(); - BOOL IsIn( USHORT nIndex ) const + BOOL IsIn( USHORT nIndex ) const { return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); } - BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const + BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const { return ( ( nIndex >= nStart ) && ( bInclEnd ? ( nIndex <= nEnd ) : ( nIndex < nEnd ) ) ); } - void SetStart( USHORT n ) { nStart = n; } - USHORT GetStart() const { return nStart; } - USHORT& GetStart() { return nStart; } + void SetStart( USHORT n ) { nStart = n; } + USHORT GetStart() const { return nStart; } + USHORT& GetStart() { return nStart; } - void SetEnd( USHORT n ) { nEnd = n; } - USHORT GetEnd() const { return nEnd; } - USHORT& GetEnd() { return nEnd; } + void SetEnd( USHORT n ) { nEnd = n; } + USHORT GetEnd() const { return nEnd; } + USHORT& GetEnd() { return nEnd; } - void SetStartPortion( USHORT n ) { nStartPortion = n; } - USHORT GetStartPortion() const { return nStartPortion; } - USHORT& GetStartPortion() { return nStartPortion; } + void SetStartPortion( USHORT n ) { nStartPortion = n; } + USHORT GetStartPortion() const { return nStartPortion; } + USHORT& GetStartPortion() { return nStartPortion; } - void SetEndPortion( USHORT n ) { nEndPortion = n; } - USHORT GetEndPortion() const { return nEndPortion; } - USHORT& GetEndPortion() { return nEndPortion; } + void SetEndPortion( USHORT n ) { nEndPortion = n; } + USHORT GetEndPortion() const { return nEndPortion; } + USHORT& GetEndPortion() { return nEndPortion; } - void SetHeight( USHORT nH, USHORT nTxtH = 0, USHORT nCrsrH = 0 ) - { nHeight = nH; + void SetHeight( USHORT nH, USHORT nTxtH = 0, USHORT nCrsrH = 0 ) + { nHeight = nH; nTxtHeight = ( nTxtH ? nTxtH : nH ); nCrsrHeight = ( nCrsrH ? nCrsrH : nTxtHeight ); } - USHORT GetHeight() const { return nHeight; } - USHORT GetTxtHeight() const { return nTxtHeight; } - USHORT GetCrsrHeight() const { return nCrsrHeight; } + USHORT GetHeight() const { return nHeight; } + USHORT GetTxtHeight() const { return nTxtHeight; } + USHORT GetCrsrHeight() const { return nCrsrHeight; } void SetTextWidth( long n ) { nTxtWidth = n; } long GetTextWidth() const { return nTxtWidth; } - void SetMaxAscent( USHORT n ) { nMaxAscent = n; } - USHORT GetMaxAscent() const { return nMaxAscent; } + void SetMaxAscent( USHORT n ) { nMaxAscent = n; } + USHORT GetMaxAscent() const { return nMaxAscent; } - void SetHangingPunctuation( BOOL b ) { bHangingPunctuation = b; } - BOOL IsHangingPunctuation() const { return bHangingPunctuation; } + void SetHangingPunctuation( BOOL b ) { bHangingPunctuation = b; } + BOOL IsHangingPunctuation() const { return bHangingPunctuation; } - USHORT GetLen() const { return nEnd - nStart; } + USHORT GetLen() const { return nEnd - nStart; } - USHORT GetStartPosX() const { return nStartPosX; } - void SetStartPosX( USHORT start ) { nStartPosX = start; } + USHORT GetStartPosX() const { return nStartPosX; } + void SetStartPosX( USHORT start ) { nStartPosX = start; } - Size CalcTextSize( ParaPortion& rParaPortion ); + Size CalcTextSize( ParaPortion& rParaPortion ); - BOOL IsInvalid() const { return bInvalid; } - BOOL IsValid() const { return !bInvalid; } - void SetInvalid() { bInvalid = TRUE; } - void SetValid() { bInvalid = FALSE; } + BOOL IsInvalid() const { return bInvalid; } + BOOL IsValid() const { return !bInvalid; } + void SetInvalid() { bInvalid = TRUE; } + void SetValid() { bInvalid = FALSE; } - BOOL IsEmpty() const { return (nEnd > nStart) ? FALSE : TRUE; } + BOOL IsEmpty() const { return (nEnd > nStart) ? FALSE : TRUE; } - CharPosArray& GetCharPosArray() { return aPositions; } + CharPosArray& GetCharPosArray() { return aPositions; } - EditLine* Clone() const; + EditLine* Clone() const; - EditLine& operator = ( const EditLine& rLine ); + EditLine& operator = ( const EditLine& rLine ); friend BOOL operator == ( const EditLine& r1, const EditLine& r2 ); friend BOOL operator != ( const EditLine& r1, const EditLine& r2 ); }; @@ -537,9 +537,9 @@ public: EditLineList(); ~EditLineList(); - void Reset(); - void DeleteFromLine( USHORT nDelFrom ); - USHORT FindLine( USHORT nChar, BOOL bInclEnd ); + void Reset(); + void DeleteFromLine( USHORT nDelFrom ); + USHORT FindLine( USHORT nChar, BOOL bInclEnd ); }; // ------------------------------------------------------------------------- @@ -547,25 +547,25 @@ public: // ------------------------------------------------------------------------- class ParaPortion { - friend class ImpEditEngine; // zum Einstellen der Hoehe + friend class ImpEditEngine; // zum Einstellen der Hoehe private: - EditLineList aLineList; - TextPortionList aTextPortionList; - ContentNode* pNode; - long nHeight; + EditLineList aLineList; + TextPortionList aTextPortionList; + ContentNode* pNode; + long nHeight; - ScriptTypePosInfos aScriptInfos; + ScriptTypePosInfos aScriptInfos; WritingDirectionInfos aWritingDirectionInfos; - USHORT nInvalidPosStart; - USHORT nFirstLineOffset; // Fuer Writer-LineSpacing-Interpretation - USHORT nBulletX; - short nInvalidDiff; + USHORT nInvalidPosStart; + USHORT nFirstLineOffset; // Fuer Writer-LineSpacing-Interpretation + USHORT nBulletX; + short nInvalidDiff; - BOOL bInvalid : 1; - BOOL bSimple : 1; // nur lineares Tippen - BOOL bVisible : 1; // MT 05/00: Gehoert an den Node!!! - BOOL bForceRepaint : 1; + BOOL bInvalid : 1; + BOOL bSimple : 1; // nur lineares Tippen + BOOL bVisible : 1; // MT 05/00: Gehoert an den Node!!! + BOOL bForceRepaint : 1; ParaPortion( const ParaPortion& ); @@ -573,39 +573,39 @@ public: ParaPortion( ContentNode* pNode ); ~ParaPortion(); - USHORT GetLineNumber( USHORT nIndex ); + USHORT GetLineNumber( USHORT nIndex ); - EditLineList& GetLines() { return aLineList; } + EditLineList& GetLines() { return aLineList; } - BOOL IsInvalid() const { return bInvalid; } - BOOL IsSimpleInvalid() const { return bSimple; } - void SetValid() { bInvalid = FALSE; bSimple = TRUE;} + BOOL IsInvalid() const { return bInvalid; } + BOOL IsSimpleInvalid() const { return bSimple; } + void SetValid() { bInvalid = FALSE; bSimple = TRUE;} - BOOL MustRepaint() const { return bForceRepaint; } - void SetMustRepaint( BOOL bRP ) { bForceRepaint = bRP; } + BOOL MustRepaint() const { return bForceRepaint; } + void SetMustRepaint( BOOL bRP ) { bForceRepaint = bRP; } - USHORT GetBulletX() const { return nBulletX; } - void SetBulletX( USHORT n ) { nBulletX = n; } + USHORT GetBulletX() const { return nBulletX; } + void SetBulletX( USHORT n ) { nBulletX = n; } - void MarkInvalid( USHORT nStart, short nDiff); - void MarkSelectionInvalid( USHORT nStart, USHORT nEnd ); + void MarkInvalid( USHORT nStart, short nDiff); + void MarkSelectionInvalid( USHORT nStart, USHORT nEnd ); - void SetVisible( BOOL bVisible ); - BOOL IsVisible() { return bVisible; } + void SetVisible( BOOL bVisible ); + BOOL IsVisible() { return bVisible; } - long GetHeight() const { return ( bVisible ? nHeight : 0 ); } - USHORT GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); } - void ResetHeight() { nHeight = 0; nFirstLineOffset = 0; } + long GetHeight() const { return ( bVisible ? nHeight : 0 ); } + USHORT GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); } + void ResetHeight() { nHeight = 0; nFirstLineOffset = 0; } - ContentNode* GetNode() const { return pNode; } - TextPortionList& GetTextPortions() { return aTextPortionList; } + ContentNode* GetNode() const { return pNode; } + TextPortionList& GetTextPortions() { return aTextPortionList; } - USHORT GetInvalidPosStart() const { return nInvalidPosStart; } - short GetInvalidDiff() const { return nInvalidDiff; } + USHORT GetInvalidPosStart() const { return nInvalidPosStart; } + short GetInvalidDiff() const { return nInvalidDiff; } - void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ); + void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ); - BOOL DbgCheckTextPortions(); + BOOL DbgCheckTextPortions(); }; typedef ParaPortion* ParaPortionPtr; @@ -621,17 +621,17 @@ public: ParaPortionList(); ~ParaPortionList(); - void Reset(); - long GetYOffset( ParaPortion* pPPortion ); - USHORT FindParagraph( long nYOffset ); + void Reset(); + long GetYOffset( ParaPortion* pPPortion ); + USHORT FindParagraph( long nYOffset ); - inline ParaPortion* SaveGetObject( USHORT nPos ) const + inline ParaPortion* SaveGetObject( USHORT nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } USHORT GetPos( const ParaPortionPtr &rPtr ) const; // temporaer: - void DbgCheck( EditDoc& rDoc ); + void DbgCheck( EditDoc& rDoc ); }; // ------------------------------------------------------------------------- @@ -640,31 +640,31 @@ public: class EditSelection { private: - EditPaM aStartPaM; - EditPaM aEndPaM; + EditPaM aStartPaM; + EditPaM aEndPaM; public: - EditSelection(); // kein CCTOR und DTOR, geht autom. richtig! + EditSelection(); // kein CCTOR und DTOR, geht autom. richtig! EditSelection( const EditPaM& rStartAndAnd ); EditSelection( const EditPaM& rStart, const EditPaM& rEnd ); - EditPaM& Min() { return aStartPaM; } - EditPaM& Max() { return aEndPaM; } + EditPaM& Min() { return aStartPaM; } + EditPaM& Max() { return aEndPaM; } - const EditPaM& Min() const { return aStartPaM; } - const EditPaM& Max() const { return aEndPaM; } + const EditPaM& Min() const { return aStartPaM; } + const EditPaM& Max() const { return aEndPaM; } - BOOL HasRange() const { return aStartPaM != aEndPaM; } + BOOL HasRange() const { return aStartPaM != aEndPaM; } BOOL IsInvalid() const; - BOOL DbgIsBuggy( EditDoc& rDoc ); + BOOL DbgIsBuggy( EditDoc& rDoc ); - BOOL Adjust( const ContentList& rNodes ); + BOOL Adjust( const ContentList& rNodes ); - EditSelection& operator = ( const EditPaM& r ); - BOOL operator == ( const EditSelection& r ) const + EditSelection& operator = ( const EditPaM& r ); + BOOL operator == ( const EditSelection& r ) const { return ( ( aStartPaM == r.aStartPaM ) && ( aEndPaM == r.aEndPaM ) ) ? TRUE : FALSE; } - BOOL operator != ( const EditSelection& r ) const { return !( r == *this ); } + BOOL operator != ( const EditSelection& r ) const { return !( r == *this ); } }; // ------------------------------------------------------------------------- @@ -673,16 +673,16 @@ public: class DeletedNodeInfo { private: - ULONG nInvalidAdressPtr; - USHORT nInvalidParagraph; + ULONG nInvalidAdressPtr; + USHORT nInvalidParagraph; public: DeletedNodeInfo( ULONG nInvAdr, USHORT nPos ) - { nInvalidAdressPtr = nInvAdr; + { nInvalidAdressPtr = nInvAdr; nInvalidParagraph = nPos; } - ULONG GetInvalidAdress() { return nInvalidAdressPtr; } - USHORT GetPosition() { return nInvalidParagraph; } + ULONG GetInvalidAdress() { return nInvalidAdressPtr; } + USHORT GetPosition() { return nInvalidParagraph; } }; typedef DeletedNodeInfo* DeletedNodeInfoPtr; @@ -694,76 +694,76 @@ SV_DECL_PTRARR( DeletedNodesList, DeletedNodeInfoPtr, 0, 4 ) class EditDoc : public ContentList { private: - SfxItemPool* pItemPool; + SfxItemPool* pItemPool; Link aModifyHdl; - SvxFont aDefFont; //schneller, als jedesmal vom Pool! - USHORT nDefTab; - BOOL bIsVertical; - BOOL bIsFixedCellHeight; + SvxFont aDefFont; //schneller, als jedesmal vom Pool! + USHORT nDefTab; + BOOL bIsVertical; + BOOL bIsFixedCellHeight; - BOOL bOwnerOfPool; - BOOL bModified; + BOOL bOwnerOfPool; + BOOL bModified; protected: - void ImplDestroyContents(); + void ImplDestroyContents(); public: EditDoc( SfxItemPool* pItemPool ); ~EditDoc(); - BOOL IsModified() const { return bModified; } - void SetModified( BOOL b ); + BOOL IsModified() const { return bModified; } + void SetModified( BOOL b ); void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; } Link GetModifyHdl() const { return aModifyHdl; } - void CreateDefFont( BOOL bUseStyles ); - const SvxFont& GetDefFont() { return aDefFont; } + void CreateDefFont( BOOL bUseStyles ); + const SvxFont& GetDefFont() { return aDefFont; } - void SetDefTab( USHORT nTab ) { nDefTab = nTab ? nTab : DEFTAB; } - USHORT GetDefTab() const { return nDefTab; } + void SetDefTab( USHORT nTab ) { nDefTab = nTab ? nTab : DEFTAB; } + USHORT GetDefTab() const { return nDefTab; } - void SetVertical( BOOL bVertical ) { bIsVertical = bVertical; } - BOOL IsVertical() const { return bIsVertical; } + void SetVertical( BOOL bVertical ) { bIsVertical = bVertical; } + BOOL IsVertical() const { return bIsVertical; } - void SetFixedCellHeight( BOOL bUseFixedCellHeight ) { bIsFixedCellHeight = bUseFixedCellHeight; } - BOOL IsFixedCellHeight() const { return bIsFixedCellHeight; } + void SetFixedCellHeight( BOOL bUseFixedCellHeight ) { bIsFixedCellHeight = bUseFixedCellHeight; } + BOOL IsFixedCellHeight() const { return bIsFixedCellHeight; } - EditPaM Clear(); - EditPaM RemoveText(); - EditPaM RemoveChars( EditPaM aPaM, USHORT nChars ); + EditPaM Clear(); + EditPaM RemoveText(); + EditPaM RemoveChars( EditPaM aPaM, USHORT nChars ); void InsertText( const EditPaM& rPaM, xub_Unicode c ); - EditPaM InsertText( EditPaM aPaM, const XubString& rStr ); - EditPaM InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ); - EditPaM InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ); - EditPaM ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ); - - String GetText( LineEnd eEnd ) const; - ULONG GetTextLen() const; + EditPaM InsertText( EditPaM aPaM, const XubString& rStr ); + EditPaM InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ); + EditPaM InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ); + EditPaM ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ); - XubString GetParaAsString( USHORT nNode ) const; - XubString GetParaAsString( ContentNode* pNode, USHORT nStartPos = 0, USHORT nEndPos = 0xFFFF, BOOL bResolveFields = TRUE ) const; + String GetText( LineEnd eEnd ) const; + ULONG GetTextLen() const; - inline EditPaM GetStartPaM() const; - inline EditPaM GetEndPaM() const; + XubString GetParaAsString( USHORT nNode ) const; + XubString GetParaAsString( ContentNode* pNode, USHORT nStartPos = 0, USHORT nEndPos = 0xFFFF, BOOL bResolveFields = TRUE ) const; - SfxItemPool& GetItemPool() { return *pItemPool; } - const SfxItemPool& GetItemPool() const { return *pItemPool; } + inline EditPaM GetStartPaM() const; + inline EditPaM GetEndPaM() const; - void RemoveItemsFromPool( ContentNode* pNode ); + SfxItemPool& GetItemPool() { return *pItemPool; } + const SfxItemPool& GetItemPool() const { return *pItemPool; } + + void RemoveItemsFromPool( ContentNode* pNode ); - void InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, USHORT nStart, USHORT nEnd ); - void InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ); - void InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ); - BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich = 0 ); - BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, USHORT nWhich = 0 ); - void FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ); + void InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, USHORT nStart, USHORT nEnd ); + void InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ); + void InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ); + BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich = 0 ); + BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, USHORT nWhich = 0 ); + void FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ); - USHORT GetPos( ContentNode* pNode ) const { return ContentList::GetPos(pNode); } - ContentNode* SaveGetObject( USHORT nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } + USHORT GetPos( ContentNode* pNode ) const { return ContentList::GetPos(pNode); } + ContentNode* SaveGetObject( USHORT nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } - static XubString GetSepStr( LineEnd eEnd ); + static XubString GetSepStr( LineEnd eEnd ); }; inline EditPaM EditDoc::GetStartPaM() const @@ -795,7 +795,7 @@ protected: virtual ~EditEngineItemPool(); public: - virtual SvStream& Store( SvStream& rStream ) const; + virtual SvStream& Store( SvStream& rStream ) const; }; #endif // _EDITDOC_HXX diff --git a/editeng/source/editeng/editdoc2.cxx b/editeng/source/editeng/editdoc2.cxx index a3b210e8d559..71077d07cea8 100644 --- a/editeng/source/editeng/editdoc2.cxx +++ b/editeng/source/editeng/editdoc2.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -63,7 +63,7 @@ #include <editeng/wrlmitem.hxx> #include <editeng/charscaleitem.hxx> -#include <vcl/svapp.hxx> // Fuer AppWindow... +#include <vcl/svapp.hxx> // Fuer AppWindow... DBG_NAME( EE_ParaPortion ) @@ -190,16 +190,16 @@ ParaPortion::ParaPortion( ContentNode* pN ) { DBG_CTOR( EE_ParaPortion, 0 ); - pNode = pN; - bInvalid = TRUE; - bVisible = TRUE; - bSimple = FALSE; - bForceRepaint = FALSE; - nInvalidPosStart = 0; - nInvalidDiff = 0; - nHeight = 0; - nFirstLineOffset = 0; - nBulletX = 0; + pNode = pN; + bInvalid = TRUE; + bVisible = TRUE; + bSimple = FALSE; + bForceRepaint = FALSE; + nInvalidPosStart = 0; + nInvalidDiff = 0; + nHeight = 0; + nFirstLineOffset = 0; + nBulletX = 0; } ParaPortion::~ParaPortion() @@ -211,7 +211,7 @@ void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) { if ( bInvalid == FALSE ) { -// nInvalidPosEnd = nStart; // ??? => CreateLines +// nInvalidPosEnd = nStart; // ??? => CreateLines nInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff ); nInvalidDiff = nDiff; } @@ -231,7 +231,7 @@ void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) } else { -// nInvalidPosEnd = pNode->Len(); +// nInvalidPosEnd = pNode->Len(); DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); nInvalidPosStart = Min( nInvalidPosStart, (USHORT) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); nInvalidDiff = 0; @@ -241,7 +241,7 @@ void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) bInvalid = TRUE; aScriptInfos.Remove( 0, aScriptInfos.Count() ); aWritingDirectionInfos.Remove( 0, aWritingDirectionInfos.Count() ); -// aExtraCharInfos.Remove( 0, aExtraCharInfos.Count() ); +// aExtraCharInfos.Remove( 0, aExtraCharInfos.Count() ); } void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) @@ -249,19 +249,19 @@ void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) if ( bInvalid == FALSE ) { nInvalidPosStart = nStart; -// nInvalidPosEnd = nEnd; +// nInvalidPosEnd = nEnd; } else { nInvalidPosStart = Min( nInvalidPosStart, nStart ); -// nInvalidPosEnd = pNode->Len(); +// nInvalidPosEnd = pNode->Len(); } nInvalidDiff = 0; bInvalid = TRUE; bSimple = FALSE; aScriptInfos.Remove( 0, aScriptInfos.Count() ); aWritingDirectionInfos.Remove( 0, aWritingDirectionInfos.Count() ); -// aExtraCharInfos.Remove( 0, aExtraCharInfos.Count() ); +// aExtraCharInfos.Remove( 0, aExtraCharInfos.Count() ); } USHORT ParaPortion::GetLineNumber( USHORT nIndex ) @@ -295,7 +295,7 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin const EditLine* pUnformatted = aLineList[ nLastFormattedLine+1 ]; short nPortionDiff = pUnformatted->GetStartPortion() - pLastFormatted->GetEndPortion(); short nTextDiff = pUnformatted->GetStart() - pLastFormatted->GetEnd(); - nTextDiff++; // LastFormatted->GetEnd() war incl. => 1 zuviel abgezogen! + nTextDiff++; // LastFormatted->GetEnd() war incl. => 1 zuviel abgezogen! // Die erste unformatierte muss genau eine Portion hinter der letzten der // formatierten beginnen: @@ -414,7 +414,7 @@ USHORT ParaPortionList::FindParagraph( long nYOffset ) if ( nY > nYOffset ) return nPortion; } - return 0xFFFF; // solte mal ueber EE_PARA_NOT_FOUND erreicht werden! + return 0xFFFF; // solte mal ueber EE_PARA_NOT_FOUND erreicht werden! } void ParaPortionList::DbgCheck( EditDoc& @@ -453,7 +453,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit SvxLRSpaceItem& rItem = (SvxLRSpaceItem&)rPoolItem; rItem.SetTxtFirstLineOfst( sal::static_int_cast< short >( OutputDevice::LogicToLogic( rItem.GetTxtFirstLineOfst(), eSourceUnit, eDestUnit ) ) ); rItem.SetTxtLeft( OutputDevice::LogicToLogic( rItem.GetTxtLeft(), eSourceUnit, eDestUnit ) ); -// rItem.SetLeft( OutputDevice::LogicToLogic( rItem.GetLeft(), eSourceUnit, eDestUnit ) ); // #96298# SetLeft manipulates nTxtLeft! +// rItem.SetLeft( OutputDevice::LogicToLogic( rItem.GetLeft(), eSourceUnit, eDestUnit ) ); // #96298# SetLeft manipulates nTxtLeft! rItem.SetRight( OutputDevice::LogicToLogic( rItem.GetRight(), eSourceUnit, eDestUnit ) ); } break; @@ -525,7 +525,7 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map if ( eSourceUnit != eDestUnit ) { SfxPoolItem* pItem = rSource.Get( nSourceWhich ).Clone(); -// pItem->SetWhich( nWhich ); +// pItem->SetWhich( nWhich ); ConvertItem( *pItem, eSourceUnit, eDestUnit ); rDest.Put( *pItem, nWhich ); delete pItem; @@ -538,7 +538,7 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map else { // MT 3.3.99: Waere so eigentlich richtig, aber schon seit Jahren nicht so... -// rDest.ClearItem( nWhich ); +// rDest.ClearItem( nWhich ); } } } diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 734b8d75ee8e..c6a446362f69 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -492,13 +492,13 @@ void EditEngine::SetPaperSize( const Size& rNewSize ) // Aendern der Breite hat bei AutoPageSize keine Wirkung, da durch // Textbreite bestimmt. // Optimierung erst nach Vobis-Auslieferung aktivieren... -// if ( !bAutoPageSize ) +// if ( !bAutoPageSize ) pImpEditEngine->FormatFullDoc(); -// else -// { -// pImpEditEngine->FormatDoc(); // PageSize, falls Aenderung -// pImpEditEngine->CheckAutoPageSize(); // Falls nichts formatiert wurde -// } +// else +// { +// pImpEditEngine->FormatDoc(); // PageSize, falls Aenderung +// pImpEditEngine->CheckAutoPageSize(); // Falls nichts formatiert wurde +// } pImpEditEngine->UpdateViews( pImpEditEngine->GetActiveView() ); @@ -710,14 +710,14 @@ sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) con pImpEditEngine->FormatDoc(); return pImpEditEngine->GetLineLen( nParagraph, nLine ); } - + void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const { DBG_CHKTHIS( EditEngine, 0 ); if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine ); -} +} USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const { @@ -725,7 +725,7 @@ USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); return pImpEditEngine->GetLineNumberAtIndex( nPara, nIndex ); -} +} sal_uInt32 EditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ) { @@ -830,10 +830,10 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie sal_Bool bDone = sal_True; - sal_Bool bModified = sal_False; - sal_Bool bMoved = sal_False; + sal_Bool bModified = sal_False; + sal_Bool bMoved = sal_False; sal_Bool bAllowIdle = sal_True; - sal_Bool bReadOnly = pEditView->IsReadOnly(); + sal_Bool bReadOnly = pEditView->IsReadOnly(); USHORT nNewCursorFlags = 0; BOOL bSetCursorFlags = TRUE; @@ -866,7 +866,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie } // break; - default: // wird dann evtl. unten bearbeitet. + default: // wird dann evtl. unten bearbeitet. eFunc = KEYFUNC_DONTKNOW; } } @@ -1026,7 +1026,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie // length may have changed as well ) pImpEditEngine->FormatAndUpdate( pImpEditEngine->GetActiveView() ); - if (bBulletIsVisible) // bullet just turned invisible... + if (bBulletIsVisible) // bullet just turned invisible... break; } @@ -1154,7 +1154,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie xub_Unicode nCharCode = rKeyEvent.GetCharCode(); pEditView->pImpEditView->DrawSelection(); // Autokorrektur ? - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect(); + SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect(); if ( ( pImpEditEngine->GetStatus().DoAutoCorrect() ) && ( SvxAutoCorrect::IsAutoCorrectChar( nCharCode ) || pAutoCorrect->HasRunNext() ) ) @@ -1363,13 +1363,13 @@ ULONG EditEngine::Write( SvStream& rOutput, EETextFormat eFormat ) return rOutput.GetError(); } -EditTextObject* EditEngine::CreateTextObject() +EditTextObject* EditEngine::CreateTextObject() { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->CreateTextObject(); } -EditTextObject* EditEngine::CreateTextObject( const ESelection& rESelection ) +EditTextObject* EditEngine::CreateTextObject( const ESelection& rESelection ) { DBG_CHKTHIS( EditEngine, 0 ); EditSelection aSel( pImpEditEngine->CreateSel( rESelection ) ); @@ -1458,7 +1458,7 @@ void EditEngine::SetEndPasteOrDropHdl( const Link& rLink ) pImpEditEngine->aEndPasteOrDropHdl = rLink; } -EditTextObject* EditEngine::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas ) +EditTextObject* EditEngine::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas ) { DBG_CHKTHIS( EditEngine, 0 ); DBG_ASSERT( nPara < pImpEditEngine->GetEditDoc().Count(), "CreateTextObject: Startpara out of Range" ); @@ -1805,7 +1805,7 @@ void EditEngine::SetControlWord( sal_uInt32 nWord ) ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n ); ParaPortion* pPortion = pImpEditEngine->GetParaPortions().GetObject( n ); sal_Bool bWrongs = ( bSpellingChanged || ( nWord & EE_CNTRL_ONLINESPELLING ) ) ? pNode->GetWrongList()->HasWrongs() : sal_False; - if ( bSpellingChanged ) // Also aus + if ( bSpellingChanged ) // Also aus pNode->DestroyWrongList(); // => vorm Paint weghaun. if ( bWrongs ) { @@ -1877,7 +1877,7 @@ Point EditEngine::GetDocPosTopLeft( sal_uInt16 nParagraph ) else { const SvxLRSpaceItem& rLRItem = pImpEditEngine->GetLRSpaceItem( pPPortion->GetNode() ); -// TL_NF_LR aPoint.X() = pImpEditEngine->GetXValue( (short)(rLRItem.GetTxtLeft() + rLRItem.GetTxtFirstLineOfst()) ); +// TL_NF_LR aPoint.X() = pImpEditEngine->GetXValue( (short)(rLRItem.GetTxtLeft() + rLRItem.GetTxtFirstLineOfst()) ); sal_Int32 nSpaceBefore = 0; pImpEditEngine->GetSpaceBeforeAndMinLabelWidth( pPPortion->GetNode(), &nSpaceBefore ); short nX = (short)(rLRItem.GetTxtLeft() @@ -2748,9 +2748,9 @@ sal_Bool EditEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) case KEYFUNC_UNDO: case KEYFUNC_REDO: case KEYFUNC_CUT: - case KEYFUNC_PASTE: bDoesChange = sal_True; + case KEYFUNC_PASTE: bDoesChange = sal_True; break; - default: // wird dann evtl. unten bearbeitet. + default: // wird dann evtl. unten bearbeitet. eFunc = KEYFUNC_DONTKNOW; } } @@ -2759,7 +2759,7 @@ sal_Bool EditEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) switch ( rKeyEvent.GetKeyCode().GetCode() ) { case KEY_DELETE: - case KEY_BACKSPACE: bDoesChange = sal_True; + case KEY_BACKSPACE: bDoesChange = sal_True; break; case KEY_RETURN: case KEY_TAB: @@ -2809,14 +2809,14 @@ void EditEngine::ImportBulletItem( SvxNumBulletItem& /*rNumBullet*/, sal_uInt16 SvxExtNumType eNumType; switch( pOldBullet->GetStyle() ) { - case BS_BMP: eNumType = SVX_NUM_BITMAP; break; - case BS_BULLET: eNumType = SVX_NUM_CHAR_SPECIAL; break; - case BS_ROMAN_BIG: eNumType = SVX_NUM_ROMAN_UPPER; break; - case BS_ROMAN_SMALL: eNumType = SVX_NUM_ROMAN_LOWER; break; - case BS_ABC_BIG: eNumType = SVX_NUM_CHARS_UPPER_LETTER; break; - case BS_ABC_SMALL: eNumType = SVX_NUM_CHARS_LOWER_LETTER; break; - case BS_123: eNumType = SVX_NUM_ARABIC; break; - default: eNumType = SVX_NUM_NUMBER_NONE; break; + case BS_BMP: eNumType = SVX_NUM_BITMAP; break; + case BS_BULLET: eNumType = SVX_NUM_CHAR_SPECIAL; break; + case BS_ROMAN_BIG: eNumType = SVX_NUM_ROMAN_UPPER; break; + case BS_ROMAN_SMALL: eNumType = SVX_NUM_ROMAN_LOWER; break; + case BS_ABC_BIG: eNumType = SVX_NUM_CHARS_UPPER_LETTER; break; + case BS_ABC_SMALL: eNumType = SVX_NUM_CHARS_LOWER_LETTER; break; + case BS_123: eNumType = SVX_NUM_ARABIC; break; + default: eNumType = SVX_NUM_NUMBER_NONE; break; } pNumberFormat->SetNumberingType( sal::static_int_cast< sal_Int16 >( eNumType ) ); @@ -2825,9 +2825,9 @@ void EditEngine::ImportBulletItem( SvxNumBulletItem& /*rNumBullet*/, sal_uInt16 SvxAdjust eAdjust; switch( pOldBullet->GetJustification() & (BJ_HRIGHT|BJ_HCENTER|BJ_HLEFT) ) { - case BJ_HRIGHT: eAdjust = SVX_ADJUST_RIGHT; break; - case BJ_HCENTER: eAdjust = SVX_ADJUST_CENTER; break; - default: eAdjust = SVX_ADJUST_LEFT; break; + case BJ_HRIGHT: eAdjust = SVX_ADJUST_RIGHT; break; + case BJ_HCENTER: eAdjust = SVX_ADJUST_CENTER; break; + default: eAdjust = SVX_ADJUST_LEFT; break; } pNumberFormat->SetNumAdjust(eAdjust); diff --git a/editeng/source/editeng/editeng.src b/editeng/source/editeng/editeng.src index b65f20c36583..7543185f24ef 100644 --- a/editeng/source/editeng/editeng.src +++ b/editeng/source/editeng/editeng.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index b5fe642df53e..5f5ced939e5c 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -169,7 +169,7 @@ XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) XEditAttribute::~XEditAttribute() { DBG_DTOR( XEditAttribute, 0 ); - pItem = 0; // Gehoert dem Pool. + pItem = 0; // Gehoert dem Pool. } XEditAttribute* XEditAttributeList::FindAttrib( USHORT _nWhich, USHORT nChar ) const @@ -242,14 +242,14 @@ ContentInfo::~ContentInfo() /* cl removed because not needed anymore since binfilter void ContentInfo::CreateLoadStoreTempInfos() { - delete pTempLoadStoreInfos; + delete pTempLoadStoreInfos; pTempLoadStoreInfos = new LoadStoreTempInfos; } void ContentInfo::DestroyLoadStoreTempInfos() { - delete pTempLoadStoreInfos; - pTempLoadStoreInfos = NULL; + delete pTempLoadStoreInfos; + pTempLoadStoreInfos = NULL; } */ @@ -267,7 +267,7 @@ bool ContentInfo::isWrongListEqual(const ContentInfo& rCompare) const bool ContentInfo::operator==( const ContentInfo& rCompare ) const { - if( (aText == rCompare.aText) && + if( (aText == rCompare.aText) && (aStyle == rCompare.aStyle ) && (aAttribs.Count() == rCompare.aAttribs.Count() ) && (eFamily == rCompare.eFamily ) && @@ -505,7 +505,7 @@ BOOL EditTextObject::Store( SvStream& rOStream ) const return rOStream.GetError() ? FALSE : TRUE; } -EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobalTextObjectPool ) +EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobalTextObjectPool ) { ULONG nStartPos = rIStream.Tell(); @@ -524,10 +524,10 @@ EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobal EditTextObject* pTxtObj = NULL; switch ( nWhich ) { - case 0x22 /*BIN300*/: pTxtObj = new BinTextObject( 0 ); + case 0x22 /*BIN300*/: pTxtObj = new BinTextObject( 0 ); ((BinTextObject*)pTxtObj)->CreateData300( rIStream ); break; - case EE_FORMAT_BIN: pTxtObj = new BinTextObject( pGlobalTextObjectPool ); + case EE_FORMAT_BIN: pTxtObj = new BinTextObject( pGlobalTextObjectPool ); pTxtObj->CreateData( rIStream ); break; default: @@ -610,7 +610,7 @@ void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool) aContents.Replace(pNew, n); delete pOrg; } - + // set local variables pPool = pNewPool; bOwnerOfPool = TRUE; @@ -643,23 +643,23 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : nUserType = 0; nObjSettings = 0; pPortionInfo = 0; - + // #i101239# ensure target is a EditEngineItemPool, else // fallback to pool ownership. This is needed to ensure that at // pool destruction time of an alien pool, the pool is still alive. // When registering would happen at an alien pool which just uses an // EditEngineItemPool as some sub-pool, that pool could already // be decoupled and deleted whcih would lead to crashes. - pPool = getEditEngineItemPool(pP); - + pPool = getEditEngineItemPool(pP); + if ( pPool ) { bOwnerOfPool = FALSE; } else { - pPool = EditEngine::CreatePool(); - bOwnerOfPool = TRUE; + pPool = EditEngine::CreatePool(); + bOwnerOfPool = TRUE; } if(!bOwnerOfPool && pPool) @@ -683,7 +683,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : nObjSettings = r.nObjSettings; bVertical = r.bVertical; nScriptType = r.nScriptType; - pPortionInfo = NULL; // PortionInfo nicht kopieren + pPortionInfo = NULL; // PortionInfo nicht kopieren bStoreUnicodeStrings = FALSE; if ( !r.bOwnerOfPool ) @@ -691,13 +691,13 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : // reuse alien pool; this must be a EditEngineItemPool // since there is no other way to construct a BinTextObject // than it's regular constructor where that is ensured - pPool = r.pPool; + pPool = r.pPool; bOwnerOfPool = FALSE; } else { - pPool = EditEngine::CreatePool(); - bOwnerOfPool = TRUE; + pPool = EditEngine::CreatePool(); + bOwnerOfPool = TRUE; } @@ -732,7 +732,7 @@ __EXPORT BinTextObject::~BinTextObject() { // Nicht mehr, wegen 1xDefItems. // siehe auch ~EditDoc(). -// pPool->ReleaseDefaults( TRUE /* bDelete */ ); +// pPool->ReleaseDefaults( TRUE /* bDelete */ ); SfxItemPool::Free(pPool); } } @@ -793,7 +793,7 @@ void BinTextObject::DeleteContents() aContents.Remove( 0, aContents.Count() ); } -EditTextObject* __EXPORT BinTextObject::Clone() const +EditTextObject* __EXPORT BinTextObject::Clone() const { return new BinTextObject( *this ); } @@ -1363,7 +1363,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) { // Es soll ein globaler Pool verwendet werden, aber dieses // Textobject hat einen eigenen. - pPool = EditEngine::CreatePool(); + pPool = EditEngine::CreatePool(); } if ( bOwnerOfPool ) @@ -1659,7 +1659,7 @@ bool BinTextObject::isWrongListEqual(const BinTextObject& rCompare) const return true; } -#define CHARSETMARKER 0x9999 +#define CHARSETMARKER 0x9999 void __EXPORT BinTextObject::CreateData300( SvStream& rIStream ) { diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 96e08ee6c629..74fa0b4c4e99 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,17 +35,17 @@ #include <unotools/fontcvt.hxx> -class SfxStyleSheetPool; +class SfxStyleSheetPool; class XEditAttribute { - friend class ContentInfo; // fuer DTOR - friend class BinTextObject; // fuer DTOR + friend class ContentInfo; // fuer DTOR + friend class BinTextObject; // fuer DTOR private: - const SfxPoolItem* pItem; - USHORT nStart; - USHORT nEnd; + const SfxPoolItem* pItem; + USHORT nStart; + USHORT nEnd; XEditAttribute(); XEditAttribute( const XEditAttribute& rCopyFrom ); @@ -56,24 +56,24 @@ public: XEditAttribute( const SfxPoolItem& rAttr ); XEditAttribute( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd ); - const SfxPoolItem* GetItem() const { return pItem; } + const SfxPoolItem* GetItem() const { return pItem; } - USHORT& GetStart() { return nStart; } - USHORT& GetEnd() { return nEnd; } + USHORT& GetStart() { return nStart; } + USHORT& GetEnd() { return nEnd; } - USHORT GetStart() const { return nStart; } - USHORT GetEnd() const { return nEnd; } + USHORT GetStart() const { return nStart; } + USHORT GetEnd() const { return nEnd; } - USHORT GetLen() const { return nEnd-nStart; } + USHORT GetLen() const { return nEnd-nStart; } - inline BOOL IsFeature(); + inline BOOL IsFeature(); - inline bool operator==( const XEditAttribute& rCompare ); + inline bool operator==( const XEditAttribute& rCompare ); }; inline bool XEditAttribute::operator==( const XEditAttribute& rCompare ) { - return (nStart == rCompare.nStart) && + return (nStart == rCompare.nStart) && (nEnd == rCompare.nEnd) && ( (pItem == rCompare.pItem) || ( pItem->Which() != rCompare.pItem->Which()) || @@ -83,7 +83,7 @@ inline bool XEditAttribute::operator==( const XEditAttribute& rCompare ) inline BOOL XEditAttribute::IsFeature() { USHORT nWhich = pItem->Which(); - return ( ( nWhich >= EE_FEATURE_START ) && + return ( ( nWhich >= EE_FEATURE_START ) && ( nWhich <= EE_FEATURE_END ) ); } @@ -98,11 +98,11 @@ public: struct XParaPortion { - long nHeight; - USHORT nFirstLineOffset; + long nHeight; + USHORT nFirstLineOffset; - EditLineList aLines; - TextPortionList aTextPortions; + EditLineList aLines; + TextPortionList aTextPortions; }; typedef XParaPortion* XParaPortionPtr; @@ -110,12 +110,12 @@ SV_DECL_PTRARR( XBaseParaPortionList, XParaPortionPtr, 0, 4 ) class XParaPortionList : public XBaseParaPortionList { - ULONG nRefDevPtr; - OutDevType eRefDevType; - MapMode aRefMapMode; - sal_uInt16 nStretchX; - sal_uInt16 nStretchY; - ULONG nPaperWidth; + ULONG nRefDevPtr; + OutDevType eRefDevType; + MapMode aRefMapMode; + sal_uInt16 nStretchX; + sal_uInt16 nStretchY; + ULONG nPaperWidth; public: @@ -128,12 +128,12 @@ public: eRefDevType = pRefDev->GetOutDevType(); } - ULONG GetRefDevPtr() const { return nRefDevPtr; } - ULONG GetPaperWidth() const { return nPaperWidth; } - OutDevType GetRefDevType() const { return eRefDevType; } - const MapMode& GetRefMapMode() const { return aRefMapMode; } - sal_uInt16 GetStretchX() const { return nStretchX; } - sal_uInt16 GetStretchY() const { return nStretchY; } + ULONG GetRefDevPtr() const { return nRefDevPtr; } + ULONG GetPaperWidth() const { return nPaperWidth; } + OutDevType GetRefDevType() const { return eRefDevType; } + const MapMode& GetRefMapMode() const { return aRefMapMode; } + sal_uInt16 GetStretchX() const { return nStretchX; } + sal_uInt16 GetStretchY() const { return nStretchY; } }; /* cl removed because not needed anymore since binfilter @@ -154,12 +154,12 @@ class ContentInfo friend class BinTextObject; private: - String aText; - String aStyle; - XEditAttributeList aAttribs; - SfxStyleFamily eFamily; - SfxItemSet aParaAttribs; - WrongList* pWrongs; + String aText; + String aStyle; + XEditAttributeList aAttribs; + SfxStyleFamily eFamily; + SfxItemSet aParaAttribs; + WrongList* pWrongs; /* cl removed because not needed anymore since binfilter LoadStoreTempInfos* pTempLoadStoreInfos; @@ -171,21 +171,21 @@ private: public: ~ContentInfo(); - const String& GetText() const { return aText; } - const String& GetStyle() const { return aStyle; } - const XEditAttributeList& GetAttribs() const { return aAttribs; } - const SfxItemSet& GetParaAttribs() const { return aParaAttribs; } - SfxStyleFamily GetFamily() const { return eFamily; } + const String& GetText() const { return aText; } + const String& GetStyle() const { return aStyle; } + const XEditAttributeList& GetAttribs() const { return aAttribs; } + const SfxItemSet& GetParaAttribs() const { return aParaAttribs; } + SfxStyleFamily GetFamily() const { return eFamily; } - String& GetText() { return aText; } - String& GetStyle() { return aStyle; } - XEditAttributeList& GetAttribs() { return aAttribs; } - SfxItemSet& GetParaAttribs() { return aParaAttribs; } - SfxStyleFamily& GetFamily() { return eFamily; } + String& GetText() { return aText; } + String& GetStyle() { return aStyle; } + XEditAttributeList& GetAttribs() { return aAttribs; } + SfxItemSet& GetParaAttribs() { return aParaAttribs; } + SfxStyleFamily& GetFamily() { return eFamily; } - WrongList* GetWrongList() const { return pWrongs; } - void SetWrongList( WrongList* p ) { pWrongs = p; } - bool operator==( const ContentInfo& rCompare ) const; + WrongList* GetWrongList() const { return pWrongs; } + void SetWrongList( WrongList* p ) { pWrongs = p; } + bool operator==( const ContentInfo& rCompare ) const; // #i102062# bool isWrongListEqual(const ContentInfo& rCompare) const; @@ -202,108 +202,108 @@ class BinTextObject : public EditTextObject, public SfxItemPoolUser using EditTextObject::isWrongListEqual; private: - ContentInfoList aContents; - SfxItemPool* pPool; - BOOL bOwnerOfPool; - XParaPortionList* pPortionInfo; - - sal_uInt32 nObjSettings; - USHORT nMetric; - USHORT nVersion; - USHORT nUserType; - USHORT nScriptType; - - BOOL bVertical; - BOOL bStoreUnicodeStrings; + ContentInfoList aContents; + SfxItemPool* pPool; + BOOL bOwnerOfPool; + XParaPortionList* pPortionInfo; + + sal_uInt32 nObjSettings; + USHORT nMetric; + USHORT nVersion; + USHORT nUserType; + USHORT nScriptType; + + BOOL bVertical; + BOOL bStoreUnicodeStrings; protected: - void DeleteContents(); - virtual void StoreData( SvStream& rOStream ) const; - virtual void CreateData( SvStream& rIStream ); - BOOL ImpChangeStyleSheets( const String& rOldName, SfxStyleFamily eOldFamily, + void DeleteContents(); + virtual void StoreData( SvStream& rOStream ) const; + virtual void CreateData( SvStream& rIStream ); + BOOL ImpChangeStyleSheets( const String& rOldName, SfxStyleFamily eOldFamily, const String& rNewName, SfxStyleFamily eNewFamily ); public: BinTextObject( SfxItemPool* pPool ); BinTextObject( const BinTextObject& ); - virtual ~BinTextObject(); + virtual ~BinTextObject(); - virtual EditTextObject* Clone() const; + virtual EditTextObject* Clone() const; - USHORT GetUserType() const; - void SetUserType( USHORT n ); + USHORT GetUserType() const; + void SetUserType( USHORT n ); - ULONG GetObjectSettings() const; - void SetObjectSettings( ULONG n ); + ULONG GetObjectSettings() const; + void SetObjectSettings( ULONG n ); - BOOL IsVertical() const; - void SetVertical( BOOL b ); + BOOL IsVertical() const; + void SetVertical( BOOL b ); - USHORT GetScriptType() const; - void SetScriptType( USHORT nType ); + USHORT GetScriptType() const; + void SetScriptType( USHORT nType ); - USHORT GetVersion() const; // Solange der Outliner keine Recordlaenge speichert + USHORT GetVersion() const; // Solange der Outliner keine Recordlaenge speichert - ContentInfo* CreateAndInsertContent(); - XEditAttribute* CreateAttrib( const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ); - void DestroyAttrib( XEditAttribute* pAttr ); + ContentInfo* CreateAndInsertContent(); + XEditAttribute* CreateAttrib( const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ); + void DestroyAttrib( XEditAttribute* pAttr ); - ContentInfoList& GetContents() { return aContents; } - const ContentInfoList& GetContents() const { return aContents; } - SfxItemPool* GetPool() const { return pPool; } - XParaPortionList* GetPortionInfo() const { return pPortionInfo; } - void SetPortionInfo( XParaPortionList* pP ) + ContentInfoList& GetContents() { return aContents; } + const ContentInfoList& GetContents() const { return aContents; } + SfxItemPool* GetPool() const { return pPool; } + XParaPortionList* GetPortionInfo() const { return pPortionInfo; } + void SetPortionInfo( XParaPortionList* pP ) { pPortionInfo = pP; } - virtual USHORT GetParagraphCount() const; - virtual String GetText( USHORT nParagraph ) const; - virtual void Insert( const EditTextObject& rObj, USHORT nPara ); - virtual EditTextObject* CreateTextObject( USHORT nPara, USHORT nParas = 1 ) const; - virtual void RemoveParagraph( USHORT nPara ); - - virtual BOOL HasPortionInfo() const; - virtual void ClearPortionInfo(); + virtual USHORT GetParagraphCount() const; + virtual String GetText( USHORT nParagraph ) const; + virtual void Insert( const EditTextObject& rObj, USHORT nPara ); + virtual EditTextObject* CreateTextObject( USHORT nPara, USHORT nParas = 1 ) const; + virtual void RemoveParagraph( USHORT nPara ); - virtual BOOL HasOnlineSpellErrors() const; + virtual BOOL HasPortionInfo() const; + virtual void ClearPortionInfo(); - virtual BOOL HasCharAttribs( USHORT nWhich = 0 ) const; - virtual void GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) const; + virtual BOOL HasOnlineSpellErrors() const; - virtual BOOL RemoveCharAttribs( USHORT nWhich = 0 ); - virtual BOOL RemoveParaAttribs( USHORT nWhich = 0 ); + virtual BOOL HasCharAttribs( USHORT nWhich = 0 ) const; + virtual void GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) const; - virtual void MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart, USHORT nEnd ); + virtual BOOL RemoveCharAttribs( USHORT nWhich = 0 ); + virtual BOOL RemoveParaAttribs( USHORT nWhich = 0 ); + + virtual void MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart, USHORT nEnd ); - virtual BOOL IsFieldObject() const; - virtual const SvxFieldItem* GetField() const; - virtual BOOL HasField( TypeId Type = NULL ) const; + virtual BOOL IsFieldObject() const; + virtual const SvxFieldItem* GetField() const; + virtual BOOL HasField( TypeId Type = NULL ) const; - SfxItemSet GetParaAttribs( USHORT nPara ) const; - void SetParaAttribs( USHORT nPara, const SfxItemSet& rAttribs ); + SfxItemSet GetParaAttribs( USHORT nPara ) const; + void SetParaAttribs( USHORT nPara, const SfxItemSet& rAttribs ); - virtual BOOL HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const; - virtual void GetStyleSheet( USHORT nPara, XubString& rName, SfxStyleFamily& eFamily ) const; - virtual void SetStyleSheet( USHORT nPara, const XubString& rName, const SfxStyleFamily& eFamily ); - virtual BOOL ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, + virtual BOOL HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const; + virtual void GetStyleSheet( USHORT nPara, XubString& rName, SfxStyleFamily& eFamily ) const; + virtual void SetStyleSheet( USHORT nPara, const XubString& rName, const SfxStyleFamily& eFamily ); + virtual BOOL ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, const String& rNewName, SfxStyleFamily eNewFamily ); - virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName ); + virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName ); - void CreateData300( SvStream& rIStream ); + void CreateData300( SvStream& rIStream ); - BOOL HasMetric() const { return nMetric != 0xFFFF; } - USHORT GetMetric() const { return nMetric; } - void SetMetric( USHORT n ) { nMetric = n; } + BOOL HasMetric() const { return nMetric != 0xFFFF; } + USHORT GetMetric() const { return nMetric; } + void SetMetric( USHORT n ) { nMetric = n; } - BOOL IsOwnerOfPool() const { return bOwnerOfPool; } - void StoreUnicodeStrings( BOOL b ) { bStoreUnicodeStrings = b; } + BOOL IsOwnerOfPool() const { return bOwnerOfPool; } + void StoreUnicodeStrings( BOOL b ) { bStoreUnicodeStrings = b; } /* cl removed because not needed anymore since binfilter - void PrepareStore( SfxStyleSheetPool* pStyleSheetPool ); - void FinishStore(); - void FinishLoad( SfxStyleSheetPool* pStyleSheetPool ); + void PrepareStore( SfxStyleSheetPool* pStyleSheetPool ); + void FinishStore(); + void FinishLoad( SfxStyleSheetPool* pStyleSheetPool ); */ - bool operator==( const BinTextObject& rCompare ) const; + bool operator==( const BinTextObject& rCompare ) const; // #i102062# bool isWrongListEqual(const BinTextObject& rCompare) const; @@ -312,6 +312,6 @@ public: virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool); }; -#endif // _EDITOBJ2_HXX +#endif // _EDITOBJ2_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/editeng/editsel.cxx b/editeng/source/editeng/editsel.cxx index 03aa2187251d..4c26189582bb 100644 --- a/editeng/source/editeng/editsel.cxx +++ b/editeng/source/editeng/editsel.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,9 +35,9 @@ #include <impedit.hxx> #include <editeng/editview.hxx> -// ---------------------------------------------------------------------- -// class EditSelFunctionSet -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class EditSelFunctionSet +// ---------------------------------------------------------------------- EditSelFunctionSet::EditSelFunctionSet() { pCurView = NULL; @@ -89,9 +89,9 @@ void __EXPORT EditSelFunctionSet::DeselectAll() pCurView->pImpEditView->DeselectAll(); } -// ---------------------------------------------------------------------- -// class EditSelectionEngine -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class EditSelectionEngine +// ---------------------------------------------------------------------- EditSelectionEngine::EditSelectionEngine() : SelectionEngine( (Window*)0 ) { // Wegen Bug OV: (1994) diff --git a/editeng/source/editeng/editsel.hxx b/editeng/source/editeng/editsel.hxx index d5a4c6f56949..78e7a118b4b3 100644 --- a/editeng/source/editeng/editsel.hxx +++ b/editeng/source/editeng/editsel.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,35 +33,35 @@ class EditView; -// ---------------------------------------------------------------------- -// class EditSelFunctionSet -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class EditSelFunctionSet +// ---------------------------------------------------------------------- class EditSelFunctionSet: public FunctionSet { private: - EditView* pCurView; + EditView* pCurView; public: EditSelFunctionSet(); - virtual void BeginDrag(); + virtual void BeginDrag(); - virtual void CreateAnchor(); - virtual void DestroyAnchor(); + virtual void CreateAnchor(); + virtual void DestroyAnchor(); - virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE ); + virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE ); - virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ); - virtual void DeselectAtPoint( const Point& rPointPixel ); - virtual void DeselectAll(); + virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ); + virtual void DeselectAtPoint( const Point& rPointPixel ); + virtual void DeselectAll(); - void SetCurView( EditView* pView ) { pCurView = pView; } - EditView* GetCurView() { return pCurView; } + void SetCurView( EditView* pView ) { pCurView = pView; } + EditView* GetCurView() { return pCurView; } }; -// ---------------------------------------------------------------------- -// class EditSelectionEngine -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class EditSelectionEngine +// ---------------------------------------------------------------------- class EditSelectionEngine : public SelectionEngine { private: @@ -69,8 +69,8 @@ private: public: EditSelectionEngine(); - void SetCurView( EditView* pNewView ); - EditView* GetCurView(); + void SetCurView( EditView* pNewView ); + EditView* GetCurView(); }; #endif // _EDITSEL_HXX diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx index 123c175e6a47..3bab4db1b819 100644 --- a/editeng/source/editeng/editstt2.hxx +++ b/editeng/source/editeng/editstt2.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,93 +37,93 @@ class InternalEditStatus : public EditStatus public: InternalEditStatus() { ; } - void TurnOnFlags( ULONG nFlags ) + void TurnOnFlags( ULONG nFlags ) { nControlBits |= nFlags; } - void TurnOffFlags( ULONG nFlags ) + void TurnOffFlags( ULONG nFlags ) { nControlBits &= ~nFlags; } - void TurnOnStatusBits( ULONG nBits ) + void TurnOnStatusBits( ULONG nBits ) { nStatusBits |= nBits; } - void TurnOffStatusBits( ULONG nBits ) + void TurnOffStatusBits( ULONG nBits ) { nStatusBits &= ~nBits; } - BOOL UseCharAttribs() const + BOOL UseCharAttribs() const { return ( ( nControlBits & EE_CNTRL_USECHARATTRIBS ) != 0 ); } - BOOL NotifyCursorMovements() const + BOOL NotifyCursorMovements() const { return ( ( nControlBits & EE_CNTRL_CRSRLEFTPARA ) != 0 ); } - BOOL UseIdleFormatter() const + BOOL UseIdleFormatter() const { return ( ( nControlBits & EE_CNTRL_DOIDLEFORMAT) != 0 ); } - BOOL AllowPasteSpecial() const + BOOL AllowPasteSpecial() const { return ( ( nControlBits & EE_CNTRL_PASTESPECIAL ) != 0 ); } - BOOL DoAutoIndenting() const + BOOL DoAutoIndenting() const { return ( ( nControlBits & EE_CNTRL_AUTOINDENTING ) != 0 ); } - BOOL DoUndoAttribs() const + BOOL DoUndoAttribs() const { return ( ( nControlBits & EE_CNTRL_UNDOATTRIBS ) != 0 ); } - BOOL OneCharPerLine() const + BOOL OneCharPerLine() const { return ( ( nControlBits & EE_CNTRL_ONECHARPERLINE ) != 0 ); } - BOOL IsOutliner() const + BOOL IsOutliner() const { return ( ( nControlBits & EE_CNTRL_OUTLINER ) != 0 ); } - BOOL IsOutliner2() const + BOOL IsOutliner2() const { return ( ( nControlBits & EE_CNTRL_OUTLINER2 ) != 0 ); } - BOOL IsAnyOutliner() const + BOOL IsAnyOutliner() const { return IsOutliner() || IsOutliner2(); } - BOOL DoNotUseColors() const + BOOL DoNotUseColors() const { return ( ( nControlBits & EE_CNTRL_NOCOLORS ) != 0 ); } - BOOL AllowBigObjects() const + BOOL AllowBigObjects() const { return ( ( nControlBits & EE_CNTRL_ALLOWBIGOBJS ) != 0 ); } - BOOL DoOnlineSpelling() const + BOOL DoOnlineSpelling() const { return ( ( nControlBits & EE_CNTRL_ONLINESPELLING ) != 0 ); } - BOOL DoStretch() const + BOOL DoStretch() const { return ( ( nControlBits & EE_CNTRL_STRETCHING ) != 0 ); } - BOOL AutoPageSize() const + BOOL AutoPageSize() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZE ) != 0 ); } - BOOL AutoPageWidth() const + BOOL AutoPageWidth() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEX ) != 0 ); } - BOOL AutoPageHeight() const + BOOL AutoPageHeight() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEY ) != 0 ); } - BOOL MarkFields() const + BOOL MarkFields() const { return ( ( nControlBits & EE_CNTRL_MARKFIELDS ) != 0 ); } - BOOL DoRestoreFont() const + BOOL DoRestoreFont() const { return ( ( nControlBits & EE_CNTRL_RESTOREFONT ) != 0 ); } - BOOL DoImportRTFStyleSheets() const + BOOL DoImportRTFStyleSheets() const { return ( ( nControlBits & EE_CNTRL_RTFSTYLESHEETS ) != 0 ); } - BOOL DoAutoCorrect() const + BOOL DoAutoCorrect() const { return ( ( nControlBits & EE_CNTRL_AUTOCORRECT ) != 0 ); } - BOOL DoAutoComplete() const + BOOL DoAutoComplete() const { return ( ( nControlBits & EE_CNTRL_AUTOCOMPLETE ) != 0 ); } - BOOL DoTabIndenting() const + BOOL DoTabIndenting() const { return ( ( nControlBits & EE_CNTRL_TABINDENTING ) != 0 ); } - BOOL DoFormat100() const + BOOL DoFormat100() const { return ( ( nControlBits & EE_CNTRL_FORMAT100 ) != 0 ); } - - BOOL ULSpaceSummation() const + + BOOL ULSpaceSummation() const { return ( ( nControlBits & EE_CNTRL_ULSPACESUMMATION ) != 0 ); } - - BOOL ULSpaceFirstParagraph() const + + BOOL ULSpaceFirstParagraph() const { return ( ( nControlBits & EE_CNTRL_ULSPACEFIRSTPARA ) != 0 ); } }; diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index 19ca7dcaf68f..79e1a6cf4fe0 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,11 +38,11 @@ DBG_NAME( EditUndo ) -#define MAX_UNDOS 100 // ab dieser Menge darf geloescht werden.... -#define MIN_UNDOS 50 // soviel muss stehen bleiben... +#define MAX_UNDOS 100 // ab dieser Menge darf geloescht werden.... +#define MIN_UNDOS 50 // soviel muss stehen bleiben... -#define NO_UNDO 0xFFFF -#define GROUP_NOTFOUND 0xFFFF +#define NO_UNDO 0xFFFF +#define GROUP_NOTFOUND 0xFFFF TYPEINIT1( EditUndo, SfxUndoAction ); TYPEINIT1( EditUndoDelContent, EditUndo ); @@ -93,7 +93,7 @@ BOOL __EXPORT EditUndoManager::Undo( USHORT nCount ) } } - pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // alte Selektion entfernen + pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // alte Selektion entfernen pImpEE->SetUndoMode( TRUE ); BOOL bDone = SfxUndoManager::Undo( nCount ); @@ -128,7 +128,7 @@ BOOL __EXPORT EditUndoManager::Redo( USHORT nCount ) } } - pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // alte Selektion entfernen + pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // alte Selektion entfernen pImpEE->SetUndoMode( TRUE ); BOOL bDone = SfxUndoManager::Redo( nCount ); @@ -203,7 +203,7 @@ void __EXPORT EditUndoDelContent::Undo() { DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); GetImpEditEngine()->InsertContent( pContentNode, nNode ); - bDelObject = FALSE; // gehoert wieder der Engine + bDelObject = FALSE; // gehoert wieder der Engine EditSelection aSel( EditPaM( pContentNode, 0 ), EditPaM( pContentNode, pContentNode->Len() ) ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aSel ); } @@ -237,7 +237,7 @@ void __EXPORT EditUndoDelContent::Redo() DBG_ASSERT( pN && ( pN != pContentNode ), "?! RemoveContent !? " ); EditPaM aPaM( pN, pN->Len() ); - bDelObject = TRUE; // gehoert wieder dem Undo + bDelObject = TRUE; // gehoert wieder dem Undo _pImpEE->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } @@ -248,12 +248,12 @@ void __EXPORT EditUndoDelContent::Redo() EditUndoConnectParas::EditUndoConnectParas( ImpEditEngine* _pImpEE, USHORT nN, USHORT nSP, const SfxItemSet& rLeftParaAttribs, const SfxItemSet& rRightParaAttribs, const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, BOOL bBkwrd ) - : EditUndo( EDITUNDO_CONNECTPARAS, _pImpEE ), + : EditUndo( EDITUNDO_CONNECTPARAS, _pImpEE ), aLeftParaAttribs( rLeftParaAttribs ), aRightParaAttribs( rRightParaAttribs ) { - nNode = nN; - nSepPos = nSP; + nNode = nN; + nSepPos = nSP; if ( pLeftStyle ) { @@ -292,7 +292,7 @@ void __EXPORT EditUndoConnectParas::Undo() if ( GetImpEditEngine()->IsCallParaInsertedOrDeleted() ) GetImpEditEngine()->GetEditEnginePtr()->ParagraphInserted( nNode+1 ); - if ( GetImpEditEngine()->GetStyleSheetPool() ) + if ( GetImpEditEngine()->GetStyleSheetPool() ) { if ( aLeftStyleName.Len() ) GetImpEditEngine()->SetStyleSheet( (USHORT)nNode, (SfxStyleSheet*)GetImpEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily ) ); @@ -317,8 +317,8 @@ void __EXPORT EditUndoConnectParas::Redo() EditUndoSplitPara::EditUndoSplitPara( ImpEditEngine* _pImpEE, USHORT nN, USHORT nSP ) : EditUndo( EDITUNDO_SPLITPARA, _pImpEE ) { - nNode = nN; - nSepPos = nSP; + nNode = nN; + nSepPos = nSP; } EditUndoSplitPara::~EditUndoSplitPara() @@ -438,7 +438,7 @@ void __EXPORT EditUndoInsertFeature::Undo() // Attribute werden dort implizit vom Dokument korrigiert... aSel.Max().GetIndex()++; EditPaM aNewPaM = GetImpEditEngine()->ImpDeleteSelection( aSel ); - aSel.Max().GetIndex()--; // Fuer Selektion + aSel.Max().GetIndex()--; // Fuer Selektion GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aSel ); } @@ -459,7 +459,7 @@ void __EXPORT EditUndoInsertFeature::Redo() // ------------------------------------------------------------------------ EditUndoMoveParagraphs::EditUndoMoveParagraphs ( ImpEditEngine* _pImpEE, const Range& rParas, USHORT n ) - : EditUndo( EDITUNDO_MOVEPARAGRAPHS, _pImpEE ), + : EditUndo( EDITUNDO_MOVEPARAGRAPHS, _pImpEE ), nParagraphs( rParas ) { nDest = n; @@ -537,7 +537,7 @@ void __EXPORT EditUndoSetStyleSheet::Redo() // EditUndoSetParaAttribs // ------------------------------------------------------------------------ EditUndoSetParaAttribs::EditUndoSetParaAttribs( ImpEditEngine* _pImpEE, USHORT nP, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems ) - : EditUndo( EDITUNDO_PARAATTRIBS, _pImpEE ), + : EditUndo( EDITUNDO_PARAATTRIBS, _pImpEE ), aPrevItems( rPrevItems ), aNewItems(rNewItems ) { @@ -566,7 +566,7 @@ void __EXPORT EditUndoSetParaAttribs::Redo() // EditUndoSetAttribs // ------------------------------------------------------------------------ EditUndoSetAttribs::EditUndoSetAttribs( ImpEditEngine* _pImpEE, const ESelection& rESel, const SfxItemSet& rNewItems ) - : EditUndo( EDITUNDO_ATTRIBS, _pImpEE ), + : EditUndo( EDITUNDO_ATTRIBS, _pImpEE ), aESel( rESel ), aNewAttribs( rNewItems ) { @@ -735,7 +735,7 @@ EditUndoMarkSelection::~EditUndoMarkSelection() void __EXPORT EditUndoMarkSelection::Undo() { DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); - if ( GetImpEditEngine()->GetActiveView() ) + if ( GetImpEditEngine()->GetActiveView() ) { if ( GetImpEditEngine()->IsFormatted() ) GetImpEditEngine()->GetActiveView()->SetSelection( aSelection ); diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx index dfea0a08d9c9..7c230eb38adf 100644 --- a/editeng/source/editeng/editundo.hxx +++ b/editeng/source/editeng/editundo.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,11 +33,11 @@ #include <editeng/editund2.hxx> #include <editeng/editdata.hxx> -#define UNDO_NOACTION 0 -#define UNDO_NEWUNDO 1 -#define UNDO_UNDOSDELETED 2 -#define UNDO_EMPTYGROUPDELETED 3 -#define UNDO_INVALIDEND 4 +#define UNDO_NOACTION 0 +#define UNDO_NEWUNDO 1 +#define UNDO_UNDOSDELETED 2 +#define UNDO_EMPTYGROUPDELETED 3 +#define UNDO_INVALIDEND 4 class ImpEditEngine; class EditView; @@ -48,9 +48,9 @@ class EditView; class EditUndoDelContent : public EditUndo { private: - BOOL bDelObject; - USHORT nNode; - ContentNode* pContentNode; // Zeigt auf das gueltige, + BOOL bDelObject; + USHORT nNode; + ContentNode* pContentNode; // Zeigt auf das gueltige, // nicht zerstoerte Objekt! public: @@ -58,8 +58,8 @@ public: EditUndoDelContent( ImpEditEngine* pImpEE, ContentNode* pNode, USHORT nPortio ); ~EditUndoDelContent(); - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -68,18 +68,18 @@ public: class EditUndoConnectParas : public EditUndo { private: - USHORT nNode; - USHORT nSepPos; - SfxItemSet aLeftParaAttribs; - SfxItemSet aRightParaAttribs; + USHORT nNode; + USHORT nSepPos; + SfxItemSet aLeftParaAttribs; + SfxItemSet aRightParaAttribs; // 2 Pointer waeren schoener, aber dann muesste es ein SfxListener sein. - String aLeftStyleName; - String aRightStyleName; - SfxStyleFamily eLeftStyleFamily; - SfxStyleFamily eRightStyleFamily; + String aLeftStyleName; + String aRightStyleName; + SfxStyleFamily eLeftStyleFamily; + SfxStyleFamily eRightStyleFamily; - BOOL bBackward; + BOOL bBackward; public: TYPEINFO(); @@ -88,8 +88,8 @@ public: const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, BOOL bBackward ); ~EditUndoConnectParas(); - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -98,16 +98,16 @@ public: class EditUndoSplitPara : public EditUndo { private: - USHORT nNode; - USHORT nSepPos; + USHORT nNode; + USHORT nSepPos; public: TYPEINFO(); EditUndoSplitPara( ImpEditEngine* pImpEE, USHORT nNode, USHORT nSepPos ); ~EditUndoSplitPara(); - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -116,20 +116,20 @@ public: class EditUndoInsertChars : public EditUndo { private: - EPaM aEPaM; - String aText; + EPaM aEPaM; + String aText; public: TYPEINFO(); EditUndoInsertChars( ImpEditEngine* pImpEE, const EPaM& rEPaM, const String& rStr ); - const EPaM& GetEPaM() { return aEPaM; } - String& GetStr() { return aText; } + const EPaM& GetEPaM() { return aEPaM; } + String& GetStr() { return aText; } - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual BOOL Merge( SfxUndoAction *pNextAction ); }; // ----------------------------------------------------------------------- @@ -138,18 +138,18 @@ public: class EditUndoRemoveChars : public EditUndo { private: - EPaM aEPaM; - String aText; + EPaM aEPaM; + String aText; public: TYPEINFO(); EditUndoRemoveChars( ImpEditEngine* pImpEE, const EPaM& rEPaM, const String& rStr ); - const EPaM& GetEPaM() { return aEPaM; } - String& GetStr() { return aText; } + const EPaM& GetEPaM() { return aEPaM; } + String& GetStr() { return aText; } - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -158,8 +158,8 @@ public: class EditUndoInsertFeature : public EditUndo { private: - EPaM aEPaM; - SfxPoolItem* pFeature; + EPaM aEPaM; + SfxPoolItem* pFeature; public: TYPEINFO(); @@ -167,8 +167,8 @@ public: const SfxPoolItem& rFeature); ~EditUndoInsertFeature(); - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -177,16 +177,16 @@ public: class EditUndoMoveParagraphs: public EditUndo { private: - Range nParagraphs; - USHORT nDest; + Range nParagraphs; + USHORT nDest; public: TYPEINFO(); EditUndoMoveParagraphs( ImpEditEngine* pImpEE, const Range& rParas, USHORT nDest ); ~EditUndoMoveParagraphs(); - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -195,24 +195,24 @@ public: class EditUndoSetStyleSheet: public EditUndo { private: - USHORT nPara; - XubString aPrevName; - XubString aNewName; - SfxStyleFamily ePrevFamily; - SfxStyleFamily eNewFamily; - SfxItemSet aPrevParaAttribs; + USHORT nPara; + XubString aPrevName; + XubString aNewName; + SfxStyleFamily ePrevFamily; + SfxStyleFamily eNewFamily; + SfxItemSet aPrevParaAttribs; public: TYPEINFO(); - + EditUndoSetStyleSheet( ImpEditEngine* pImpEE, USHORT nPara, const XubString& rPrevName, SfxStyleFamily ePrevFamily, const XubString& rNewName, SfxStyleFamily eNewFamily, const SfxItemSet& rPrevParaAttribs ); ~EditUndoSetStyleSheet(); - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -221,17 +221,17 @@ public: class EditUndoSetParaAttribs: public EditUndo { private: - USHORT nPara; - SfxItemSet aPrevItems; - SfxItemSet aNewItems; + USHORT nPara; + SfxItemSet aPrevItems; + SfxItemSet aNewItems; public: TYPEINFO(); EditUndoSetParaAttribs( ImpEditEngine* pImpEE, USHORT nPara, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems ); ~EditUndoSetParaAttribs(); - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -240,16 +240,16 @@ public: class EditUndoSetAttribs: public EditUndo { private: - ESelection aESel; - SfxItemSet aNewAttribs; - ContentInfoArray aPrevAttribs; + ESelection aESel; + SfxItemSet aNewAttribs; + ContentInfoArray aPrevAttribs; - BYTE nSpecial; - BOOL bSetIsRemove; - BOOL bRemoveParaAttribs; - USHORT nRemoveWhich; + BYTE nSpecial; + BOOL bSetIsRemove; + BOOL bRemoveParaAttribs; + USHORT nRemoveWhich; - void ImpSetSelection( EditView* pView ); + void ImpSetSelection( EditView* pView ); public: @@ -257,16 +257,16 @@ public: EditUndoSetAttribs( ImpEditEngine* pImpEE, const ESelection& rESel, const SfxItemSet& rNewItems ); ~EditUndoSetAttribs(); - ContentInfoArray& GetContentInfos() { return aPrevAttribs; } - SfxItemSet& GetNewAttribs() { return aNewAttribs; } + ContentInfoArray& GetContentInfos() { return aPrevAttribs; } + SfxItemSet& GetNewAttribs() { return aNewAttribs; } - void SetSpecial( BYTE n ) { nSpecial = n; } - void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; } - void SetRemoveParaAttribs( BOOL b ) { bRemoveParaAttribs = b; } - void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; } + void SetSpecial( BYTE n ) { nSpecial = n; } + void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; } + void SetRemoveParaAttribs( BOOL b ) { bRemoveParaAttribs = b; } + void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; } - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -275,24 +275,24 @@ public: class EditUndoTransliteration: public EditUndo { private: - ESelection aOldESel; - ESelection aNewESel; + ESelection aOldESel; + ESelection aNewESel; - sal_Int32 nMode; - EditTextObject* pTxtObj; - String aText; + sal_Int32 nMode; + EditTextObject* pTxtObj; + String aText; public: TYPEINFO(); EditUndoTransliteration( ImpEditEngine* pImpEE, const ESelection& rESel, sal_Int32 nMode ); ~EditUndoTransliteration(); - void SetText( const String& rText ) { aText = rText; } - void SetText( EditTextObject* pObj ) { pTxtObj = pObj; } - void SetNewSelection( const ESelection& rSel ) { aNewESel = rSel; } + void SetText( const String& rText ) { aText = rText; } + void SetText( EditTextObject* pObj ) { pTxtObj = pObj; } + void SetNewSelection( const ESelection& rSel ) { aNewESel = rSel; } - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; // ----------------------------------------------------------------------- @@ -301,15 +301,15 @@ public: class EditUndoMarkSelection: public EditUndo { private: - ESelection aSelection; + ESelection aSelection; public: TYPEINFO(); EditUndoMarkSelection( ImpEditEngine* pImpEE, const ESelection& rSel ); ~EditUndoMarkSelection(); - virtual void Undo(); - virtual void Redo(); + virtual void Undo(); + virtual void Redo(); }; diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 6d30e0205c06..f67de56ed73b 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -261,7 +261,7 @@ void EditView::SetSelection( const ESelection& rESel ) aNewSelection.Max() = EditPaM( pNode, pNode->Len() ); } - pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' + pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' pImpEditView->SetEditSelection( aNewSelection ); pImpEditView->DrawSelection(); sal_Bool bGotoCursor = pImpEditView->DoAutoScroll(); @@ -328,7 +328,7 @@ void EditView::SetWindow( Window* pWin ) PIMPEE->GetSelEngine().Reset(); } -Window* EditView::GetWindow() const +Window* EditView::GetWindow() const { DBG_CHKTHIS( EditView, 0 ); return pImpEditView->pOutWin; @@ -464,8 +464,8 @@ void EditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor ) DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); // Draw vertraegt die Assertion nicht, spaeter mal aktivieren -// DBG_ASSERT( pImpEditView->pEditEngine->HasView( this ), "ShowCursor - View nicht angemeldet!" ); -// DBG_ASSERT( !GetWindow()->IsInPaint(), "ShowCursor - Why in Paint ?!" ); +// DBG_ASSERT( pImpEditView->pEditEngine->HasView( this ), "ShowCursor - View nicht angemeldet!" ); +// DBG_ASSERT( !GetWindow()->IsInPaint(), "ShowCursor - Why in Paint ?!" ); if ( pImpEditView->pEditEngine->HasView( this ) ) { @@ -701,7 +701,7 @@ void EditView::UnindentBlock() PIMPEE->IndentBlock( this, sal_False ); } -EESelectionMode EditView::GetSelectionMode() const +EESelectionMode EditView::GetSelectionMode() const { DBG_CHKTHIS( EditView, 0 ); return pImpEditView->GetSelectionMode(); @@ -770,7 +770,7 @@ sal_uInt32 EditView::GetControlWord() const return pImpEditView->nControl; } -EditTextObject* EditView::CreateTextObject() +EditTextObject* EditView::CreateTextObject() { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); @@ -787,7 +787,7 @@ void EditView::InsertText( const EditTextObject& rTextObject ) EditSelection aTextSel( PIMPEE->InsertText( rTextObject, pImpEditView->GetEditSelection() ) ); PIMPEE->UndoActionEnd( EDITUNDO_INSERT ); - aTextSel.Min() = aTextSel.Max(); // Selektion nicht behalten. + aTextSel.Min() = aTextSel.Max(); // Selektion nicht behalten. pImpEditView->SetEditSelection( aTextSel ); PIMPEE->FormatAndUpdate( this ); } @@ -802,7 +802,7 @@ void EditView::InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::d EditSelection aTextSel( PIMPEE->InsertText( xDataObj, rBaseURL, pImpEditView->GetEditSelection().Max(), bUseSpecial ) ); PIMPEE->UndoActionEnd( EDITUNDO_INSERT ); - aTextSel.Min() = aTextSel.Max(); // Selektion nicht behalten. + aTextSel.Min() = aTextSel.Max(); // Selektion nicht behalten. pImpEditView->SetEditSelection( aTextSel ); PIMPEE->FormatAndUpdate( this ); } @@ -864,7 +864,7 @@ SfxStyleSheet* EditView::GetStyleSheet() const { SfxStyleSheet* pTmpStyle = PIMPEE->GetStyleSheet( n ); if ( ( n != nStartPara ) && ( pStyle != pTmpStyle ) ) - return NULL; // Nicht eindeutig. + return NULL; // Nicht eindeutig. pStyle = pTmpStyle; } return pStyle; @@ -901,7 +901,7 @@ void EditView::TransliterateText( sal_Int32 nTransliterationMode ) EditSelection aNewSel = PIMPEE->TransliterateText( pImpEditView->GetEditSelection(), nTransliterationMode ); if ( aNewSel != aOldSel ) { - pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' + pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' pImpEditView->SetEditSelection( aNewSel ); pImpEditView->DrawSelection(); } @@ -1142,7 +1142,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) aPopupMenu.InsertSeparator( nWords ); } else - aPopupMenu.RemoveItem( MN_AUTOCORR ); // Loeschen? + aPopupMenu.RemoveItem( MN_AUTOCORR ); // Loeschen? SvtLinguConfig aCfg; const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); @@ -1158,7 +1158,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) uno::Reference< linguistic2::XDictionary > xDic( SvxGetOrCreatePosDic( xDicList ) ); if (xDic.is()) xDic->setActive( sal_True ); - + aDics = xDicList->getDictionaries(); pDic = aDics.getConstArray(); sal_uInt16 nCheckedLanguage = PIMPEE->GetLanguage( aPaM2 ); @@ -1252,7 +1252,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) { // Cursor vor das Wort setzen... EditPaM aCursor = pImpEditView->GetEditSelection().Min(); - pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' + pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' pImpEditView->SetEditSelection( EditSelection( aCursor, aCursor ) ); pImpEditView->DrawSelection(); // Stuerzt ab, wenn keine SfxApp @@ -1294,12 +1294,12 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) { DBG_ASSERT(nId - MN_AUTOSTART < aAlt.getLength(), "index out of range"); String aWord = pAlt[nId - MN_AUTOSTART]; - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect(); + SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect(); if ( pAutoCorrect ) pAutoCorrect->PutText( aSelected, aWord, PIMPEE->GetLanguage( aPaM2 ) ); InsertText( aWord ); } - else if ( nId >= MN_ALTSTART ) // Replace + else if ( nId >= MN_ALTSTART ) // Replace { DBG_ASSERT(nId - MN_ALTSTART < aAlt.getLength(), "index out of range"); String aWord = pAlt[nId - MN_ALTSTART]; diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 71dcb38efa4b..0a04b042fdcf 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -109,7 +109,7 @@ void __EXPORT EditSpellWrapper::SpellStart( SvxSpellArea eArea ) } else if ( eArea == SVX_SPELL_BODY ) { - ; // Wird ueber SpellNextDocument von App gehandelt + ; // Wird ueber SpellNextDocument von App gehandelt // pSpellInfo->bSpellToEnd = sal_True; // pSpellInfo->aSpellTo = pImpEE->CreateEPaM( pImpEE->GetEditDoc().GetEndPaM() ); @@ -279,7 +279,7 @@ void WrongList::TextInserted( sal_uInt16 nPos, sal_uInt16 nNew, sal_Bool bPosIsS WrongRange aNewWrong( rWrong.nStart, nPos ); rWrong.nStart = nPos+1; Insert( aNewWrong, n ); - bRefIsValid = sal_False; // Referenz nach Insert nicht mehr gueltig, der andere wurde davor an dessen Position eingefuegt + bRefIsValid = sal_False; // Referenz nach Insert nicht mehr gueltig, der andere wurde davor an dessen Position eingefuegt n++; // Diesen nicht nochmal... } } @@ -340,7 +340,7 @@ void WrongList::TextDeleted( sal_uInt16 nPos, sal_uInt16 nDeleted ) // 2. Wrong beginnt davor, endet drinnen oder dahinter... else if ( ( rWrong.nStart <= nPos ) && ( rWrong.nEnd > nPos ) ) { - if ( rWrong.nEnd <= nEndChanges ) // endet drinnen + if ( rWrong.nEnd <= nEndChanges ) // endet drinnen rWrong.nEnd = nPos; else rWrong.nEnd = rWrong.nEnd - nDeleted; // endet dahinter @@ -418,7 +418,7 @@ void WrongList::ClearWrongs( sal_uInt16 nStart, sal_uInt16 nEnd, WrongRange& rWrong = GetObject( n ); if ( ( rWrong.nEnd > nStart ) && ( rWrong.nStart < nEnd ) ) { - if ( rWrong.nEnd > nEnd ) // // Laeuft raus + if ( rWrong.nEnd > nEnd ) // // Laeuft raus { rWrong.nStart = nEnd; // Blanks? @@ -476,7 +476,7 @@ void WrongList::MarkWrongsInvalid() MarkInvalid( GetObject( 0 ).nStart, GetObject( Count()-1 ).nEnd ); } -WrongList* WrongList::Clone() const +WrongList* WrongList::Clone() const { WrongList* pNew = new WrongList; for ( sal_uInt16 n = 0; n < Count(); n++ ) @@ -492,7 +492,7 @@ WrongList* WrongList::Clone() const bool WrongList::operator==(const WrongList& rCompare) const { // cleck direct members - if(GetInvalidStart() != rCompare.GetInvalidStart() + if(GetInvalidStart() != rCompare.GetInvalidStart() || GetInvalidEnd() != rCompare.GetInvalidEnd() || Count() != rCompare.Count()) { @@ -623,7 +623,7 @@ sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, aSet.Put( rItem ); EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) ); - aSel.Max().SetIndex( nEnd ); // ??? + aSel.Max().SetIndex( nEnd ); // ??? pImpEE->SetAttribs( aSel, aSet, ATTRSPECIAL_EDGE ); bAllowUndoAction = sal_False; } @@ -677,7 +677,7 @@ const String* EdtAutoCorrDoc::GetPrevPara( sal_Bool ) // Vorherigen Absatz zurueck geben, damit ermittel werden kann, // ob es sich beim aktuellen Wort um einen Satzanfang handelt. - bAllowUndoAction = sal_False; // Jetzt nicht mehr... + bAllowUndoAction = sal_False; // Jetzt nicht mehr... ContentList& rNodes = pImpEE->GetEditDoc(); sal_uInt16 nPos = rNodes.GetPos( pCurNode ); @@ -709,14 +709,14 @@ const String* EdtAutoCorrDoc::GetPrevPara( sal_Bool ) } sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos, - sal_uInt16 nEndPos, SvxAutoCorrect& rACorrect, + sal_uInt16 nEndPos, SvxAutoCorrect& rACorrect, const String** ppPara ) { // Absatz-Anfang oder ein Blank gefunden, suche nach dem Wort // Kuerzel im Auto - - bAllowUndoAction = sal_False; // Jetzt nicht mehr... - + + bAllowUndoAction = sal_False; // Jetzt nicht mehr... + String aShort( pCurNode->Copy( rSttPos, nEndPos - rSttPos ) ); sal_Bool bRet = sal_False; @@ -728,7 +728,7 @@ sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos, if( pFnd && pFnd->IsTextOnly() ) { // dann mal ersetzen - EditSelection aSel( EditPaM( pCurNode, rSttPos ), + EditSelection aSel( EditPaM( pCurNode, rSttPos ), EditPaM( pCurNode, nEndPos ) ); aSel = pImpEE->ImpDeleteSelection( aSel ); DBG_ASSERT( nCursor >= nEndPos, "Cursor mitten im Geschehen ?!" ); diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index 2acd7347f150..992a94f39d97 100644 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,17 +48,17 @@ class ContentNode; class EditSpellWrapper : public SvxSpellWrapper { private: - EditView* pEditView; - void CheckSpellTo(); + EditView* pEditView; + void CheckSpellTo(); protected: - virtual void SpellStart( SvxSpellArea eArea ); - virtual BOOL SpellContinue(); // Bereich pruefen - virtual void ReplaceAll( const String &rNewText, INT16 nLanguage ); - virtual void SpellEnd(); - virtual BOOL SpellMore(); - virtual BOOL HasOtherCnt(); - virtual void ScrollArea(); + virtual void SpellStart( SvxSpellArea eArea ); + virtual BOOL SpellContinue(); // Bereich pruefen + virtual void ReplaceAll( const String &rNewText, INT16 nLanguage ); + virtual void SpellEnd(); + virtual BOOL SpellMore(); + virtual BOOL HasOtherCnt(); + virtual void ScrollArea(); virtual void ChangeWord( const String& rNewWord, const USHORT nLang ); virtual void ChangeThesWord( const String& rNewWord ); virtual void AutoCorrect( const String& rOldWord, const String& rNewWord ); @@ -82,49 +82,49 @@ struct WrongRange }; SV_DECL_VARARR( WrongRanges, WrongRange, 4, 4 ) -#define NOT_INVALID 0xFFFF +#define NOT_INVALID 0xFFFF class WrongList : private WrongRanges { private: - USHORT nInvalidStart; - USHORT nInvalidEnd; + USHORT nInvalidStart; + USHORT nInvalidEnd; - BOOL DbgIsBuggy() const; + BOOL DbgIsBuggy() const; public: WrongList(); ~WrongList(); - BOOL IsInvalid() const { return nInvalidStart != NOT_INVALID; } - void SetValid() { nInvalidStart = NOT_INVALID; nInvalidEnd = 0; } - void MarkInvalid( USHORT nS, USHORT nE ); + BOOL IsInvalid() const { return nInvalidStart != NOT_INVALID; } + void SetValid() { nInvalidStart = NOT_INVALID; nInvalidEnd = 0; } + void MarkInvalid( USHORT nS, USHORT nE ); - USHORT Count() const { return WrongRanges::Count(); } + USHORT Count() const { return WrongRanges::Count(); } // Wenn man weiss was man tut: - WrongRange& GetObject( USHORT n ) const { return WrongRanges::GetObject( n ); } - void InsertWrong( const WrongRange& rWrong, USHORT nPos ); + WrongRange& GetObject( USHORT n ) const { return WrongRanges::GetObject( n ); } + void InsertWrong( const WrongRange& rWrong, USHORT nPos ); - USHORT GetInvalidStart() const { return nInvalidStart; } - USHORT& GetInvalidStart() { return nInvalidStart; } + USHORT GetInvalidStart() const { return nInvalidStart; } + USHORT& GetInvalidStart() { return nInvalidStart; } - USHORT GetInvalidEnd() const { return nInvalidEnd; } - USHORT& GetInvalidEnd() { return nInvalidEnd; } + USHORT GetInvalidEnd() const { return nInvalidEnd; } + USHORT& GetInvalidEnd() { return nInvalidEnd; } - void TextInserted( USHORT nPos, USHORT nChars, BOOL bPosIsSep ); - void TextDeleted( USHORT nPos, USHORT nChars ); + void TextInserted( USHORT nPos, USHORT nChars, BOOL bPosIsSep ); + void TextDeleted( USHORT nPos, USHORT nChars ); - void ResetRanges() { Remove( 0, Count() ); } - BOOL HasWrongs() const { return Count() != 0; } - void InsertWrong( USHORT nStart, USHORT nEnd, BOOL bClearRange ); - BOOL NextWrong( USHORT& rnStart, USHORT& rnEnd ) const; - BOOL HasWrong( USHORT nStart, USHORT nEnd ) const; - BOOL HasAnyWrong( USHORT nStart, USHORT nEnd ) const; - void ClearWrongs( USHORT nStart, USHORT nEnd, const ContentNode* pNode ); - void MarkWrongsInvalid(); + void ResetRanges() { Remove( 0, Count() ); } + BOOL HasWrongs() const { return Count() != 0; } + void InsertWrong( USHORT nStart, USHORT nEnd, BOOL bClearRange ); + BOOL NextWrong( USHORT& rnStart, USHORT& rnEnd ) const; + BOOL HasWrong( USHORT nStart, USHORT nEnd ) const; + BOOL HasAnyWrong( USHORT nStart, USHORT nEnd ) const; + void ClearWrongs( USHORT nStart, USHORT nEnd, const ContentNode* pNode ); + void MarkWrongsInvalid(); - WrongList* Clone() const; + WrongList* Clone() const; // #i102062# bool operator==(const WrongList& rCompare) const; @@ -142,40 +142,40 @@ inline void WrongList::InsertWrong( const WrongRange& rWrong, USHORT nPos ) class EdtAutoCorrDoc : public SvxAutoCorrDoc { - ImpEditEngine* pImpEE; - ContentNode* pCurNode; - USHORT nCursor; + ImpEditEngine* pImpEE; + ContentNode* pCurNode; + USHORT nCursor; - BOOL bAllowUndoAction; - BOOL bUndoAction; + BOOL bAllowUndoAction; + BOOL bUndoAction; protected: - void ImplStartUndoAction(); + void ImplStartUndoAction(); public: EdtAutoCorrDoc( ImpEditEngine* pImpEE, ContentNode* pCurNode, USHORT nCrsr, xub_Unicode cIns ); ~EdtAutoCorrDoc(); - virtual BOOL Delete( USHORT nStt, USHORT nEnd ); - virtual BOOL Insert( USHORT nPos, const String& rTxt ); - virtual BOOL Replace( USHORT nPos, const String& rTxt ); + virtual BOOL Delete( USHORT nStt, USHORT nEnd ); + virtual BOOL Insert( USHORT nPos, const String& rTxt ); + virtual BOOL Replace( USHORT nPos, const String& rTxt ); - virtual BOOL SetAttr( USHORT nStt, USHORT nEnd, USHORT nSlotId, SfxPoolItem& ); - virtual BOOL SetINetAttr( USHORT nStt, USHORT nEnd, const String& rURL ); + virtual BOOL SetAttr( USHORT nStt, USHORT nEnd, USHORT nSlotId, SfxPoolItem& ); + virtual BOOL SetINetAttr( USHORT nStt, USHORT nEnd, const String& rURL ); - virtual BOOL HasSymbolChars( USHORT nStt, USHORT nEnd ); + virtual BOOL HasSymbolChars( USHORT nStt, USHORT nEnd ); virtual const String* GetPrevPara( BOOL bAtNormalPos ); - virtual BOOL ChgAutoCorrWord( USHORT& rSttPos, USHORT nEndPos, + virtual BOOL ChgAutoCorrWord( USHORT& rSttPos, USHORT nEndPos, SvxAutoCorrect& rACorrect, const String** ppPara ); virtual LanguageType GetLanguage( USHORT nPos, BOOL bPrevPara = FALSE ) const; - USHORT GetCursor() const { return nCursor; } + USHORT GetCursor() const { return nCursor; } }; -#endif // EDTSPELL +#endif // EDTSPELL /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index 8f3bffffbd59..50a776a5a9f6 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,10 +46,10 @@ #include <svtools/htmlkywd.hxx> #include <tools/tenccvt.hxx> -#define ACTION_INSERTTEXT 1 -#define ACTION_INSERTPARABRK 2 +#define ACTION_INSERTTEXT 1 +#define ACTION_INSERTPARABRK 2 -#define STYLE_PRE 101 +#define STYLE_PRE 101 EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValueIterator* pHTTPHeaderAttrs ) : HTMLParser( rIn, true ) @@ -228,7 +228,7 @@ void EditHTMLParser::NextToken( int nToken ) break; case HTML_CENTER_ON: - case HTML_CENTER_OFF: // if ( bInPara ) + case HTML_CENTER_OFF: // if ( bInPara ) { USHORT nNode = pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() ); SfxItemSet aItems( aCurSel.Max().GetNode()->GetContentAttribs().GetItems() ); @@ -239,9 +239,9 @@ void EditHTMLParser::NextToken( int nToken ) } break; - case HTML_ANCHOR_ON: AnchorStart(); + case HTML_ANCHOR_ON: AnchorStart(); break; - case HTML_ANCHOR_OFF: AnchorEnd(); + case HTML_ANCHOR_OFF: AnchorEnd(); break; case HTML_PARABREAK_ON: @@ -299,9 +299,9 @@ void EditHTMLParser::NextToken( int nToken ) } break; - case HTML_TABLE_ON: nInTable++; + case HTML_TABLE_ON: nInTable++; break; - case HTML_TABLE_OFF: DBG_ASSERT( nInTable, "Nicht in Table, aber TABLE_OFF?" ); + case HTML_TABLE_OFF: DBG_ASSERT( nInTable, "Nicht in Table, aber TABLE_OFF?" ); nInTable--; break; @@ -339,19 +339,19 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_DD_OFF: case HTML_DT_OFF: case HTML_ORDERLIST_OFF: - case HTML_UNORDERLIST_OFF: EndPara( FALSE ); + case HTML_UNORDERLIST_OFF: EndPara( FALSE ); break; case HTML_TABLEROW_ON: - case HTML_TABLEROW_OFF: // Nur nach einem CELL ein RETURN, fuer Calc + case HTML_TABLEROW_OFF: // Nur nach einem CELL ein RETURN, fuer Calc case HTML_COL_ON: case HTML_COLGROUP_ON: case HTML_COLGROUP_OFF: break; - case HTML_FONT_ON: // ... + case HTML_FONT_ON: // ... break; - case HTML_FONT_OFF: // ... + case HTML_FONT_OFF: // ... break; @@ -383,16 +383,16 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_BANNER_OFF: case HTML_DIVISION_ON: case HTML_DIVISION_OFF: -// case HTML_LISTHEADER_ON: //! special handling -// case HTML_LISTHEADER_OFF: +// case HTML_LISTHEADER_ON: //! special handling +// case HTML_LISTHEADER_OFF: case HTML_NOTE_ON: case HTML_NOTE_OFF: // inline elements, logical markup // HTML 2.0 case HTML_ADDRESS_ON: case HTML_ADDRESS_OFF: -// case HTML_BLOCKQUOTE_ON: //! extra Behandlung -// case HTML_BLOCKQUOTE_OFF: +// case HTML_BLOCKQUOTE_ON: //! extra Behandlung +// case HTML_BLOCKQUOTE_OFF: case HTML_CITIATION_ON: case HTML_CITIATION_OFF: case HTML_CODE_ON: @@ -418,8 +418,8 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_ACRONYM_OFF: case HTML_AUTHOR_ON: case HTML_AUTHOR_OFF: -// case HTML_BLOCKQUOTE30_ON: //! extra Behandlung -// case HTML_BLOCKQUOTE30_OFF: +// case HTML_BLOCKQUOTE30_ON: //! extra Behandlung +// case HTML_BLOCKQUOTE30_OFF: case HTML_DELETEDTEXT_ON: case HTML_DELETEDTEXT_OFF: case HTML_INSERTEDTEXT_ON: @@ -461,21 +461,21 @@ void EditHTMLParser::NextToken( int nToken ) // misc case HTML_DIRLIST_ON: case HTML_DIRLIST_OFF: - case HTML_FOOTNOTE_ON: //! landen so im Text + case HTML_FOOTNOTE_ON: //! landen so im Text case HTML_FOOTNOTE_OFF: case HTML_MENULIST_ON: case HTML_MENULIST_OFF: -// case HTML_PLAINTEXT_ON: //! extra Behandlung -// case HTML_PLAINTEXT_OFF: -// case HTML_PREFORMTXT_ON: //! extra Behandlung -// case HTML_PREFORMTXT_OFF: +// case HTML_PLAINTEXT_ON: //! extra Behandlung +// case HTML_PLAINTEXT_OFF: +// case HTML_PREFORMTXT_ON: //! extra Behandlung +// case HTML_PREFORMTXT_OFF: case HTML_SPAN_ON: case HTML_SPAN_OFF: // obsolete -// case HTML_XMP_ON: //! extra Behandlung -// case HTML_XMP_OFF: -// case HTML_LISTING_ON: //! extra Behandlung -// case HTML_LISTING_OFF: +// case HTML_XMP_ON: //! extra Behandlung +// case HTML_XMP_OFF: +// case HTML_LISTING_ON: //! extra Behandlung +// case HTML_LISTING_OFF: // Netscape case HTML_BLINK_ON: case HTML_BLINK_OFF: @@ -488,8 +488,8 @@ void EditHTMLParser::NextToken( int nToken ) // Internet Explorer case HTML_MARQUEE_ON: case HTML_MARQUEE_OFF: -// case HTML_PLAINTEXT2_ON: //! extra Behandlung -// case HTML_PLAINTEXT2_OFF: +// case HTML_PLAINTEXT2_ON: //! extra Behandlung +// case HTML_PLAINTEXT2_OFF: break; default: @@ -507,7 +507,7 @@ void EditHTMLParser::NextToken( int nToken ) } } } - } // SWITCH + } // SWITCH if ( pImpEditEngine->aImportHdl.IsSet() ) { @@ -610,19 +610,19 @@ void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSe void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) { /* - nHLevel: 0: Ausschalten - 1-6: Heading - STYLE_PRE: Preformatted + nHLevel: 0: Ausschalten + 1-6: Heading + STYLE_PRE: Preformatted */ -// if ( pImpEditEngine->GetStatus().DoImportRTFStyleSheets() ) -// { -// SvxRTFStyleType* pS = GetStyleTbl().Get( rSet.StyleNo() ); -// DBG_ASSERT( pS, "Vorlage in RTF nicht definiert!" ); -// if ( pS ) -// pImpEditEngine->SetStyleSheet( EditSelection( aStartPaM, aEndPaM ), pS->sName, SFX_STYLE_FAMILY_ALL ); -// } -// else +// if ( pImpEditEngine->GetStatus().DoImportRTFStyleSheets() ) +// { +// SvxRTFStyleType* pS = GetStyleTbl().Get( rSet.StyleNo() ); +// DBG_ASSERT( pS, "Vorlage in RTF nicht definiert!" ); +// if ( pS ) +// pImpEditEngine->SetStyleSheet( EditSelection( aStartPaM, aEndPaM ), pS->sName, SFX_STYLE_FAMILY_ALL ); +// } +// else { // Harte Attribute erzeugen... // Reicht fuer Calc, bei StyleSheets muesste noch geklaert werden, @@ -630,7 +630,7 @@ void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) // fuettern in eine andere Engine auch noch da sind... USHORT nNode = pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() ); -// SfxItemSet aItems( pImpEditEngine->GetEmptyItemSet() ); +// SfxItemSet aItems( pImpEditEngine->GetEmptyItemSet() ); SfxItemSet aItems( aCurSel.Max().GetNode()->GetContentAttribs().GetItems() ); aItems.ClearItem( EE_PARA_ULSPACE ); @@ -793,8 +793,8 @@ void EditHTMLParser::EndPara( BOOL ) if ( bHasText ) ImpInsertParaBreak(); // Nur, wenn ohne Absatzabstaende gearbeitet wird... -// if ( !nInTable && bReal && (nNumberingLevel<=1) && (nBulletLevel<=1) ) -// ImpInsertParaBreak(); +// if ( !nInTable && bReal && (nNumberingLevel<=1) && (nBulletLevel<=1) ) +// ImpInsertParaBreak(); } bInPara = FALSE; } diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx index 344321998674..75dcfdae53d1 100644 --- a/editeng/source/editeng/eehtml.hxx +++ b/editeng/source/editeng/eehtml.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,62 +36,62 @@ class ImpEditEngine; -#define MAX_NUMBERLEVEL 10 +#define MAX_NUMBERLEVEL 10 struct AnchorInfo { - String aHRef; - String aText; + String aHRef; + String aText; }; class EditHTMLParser : public HTMLParser { using HTMLParser::CallParser; private: - EditSelection aCurSel; + EditSelection aCurSel; String aBaseURL; - ImpEditEngine* pImpEditEngine; - AnchorInfo* pCurAnchor; - - BOOL bInPara; - BOOL bWasInPara; // bInPara vor HeadingStart merken, weil sonst hinterher weg - BOOL bFieldsInserted; - BYTE nInTable; - BYTE nInCell; + ImpEditEngine* pImpEditEngine; + AnchorInfo* pCurAnchor; + + BOOL bInPara; + BOOL bWasInPara; // bInPara vor HeadingStart merken, weil sonst hinterher weg + BOOL bFieldsInserted; + BYTE nInTable; + BYTE nInCell; BOOL bInTitle; - BYTE nDefListLevel; - BYTE nBulletLevel; - BYTE nNumberingLevel; + BYTE nDefListLevel; + BYTE nBulletLevel; + BYTE nNumberingLevel; - BYTE nLastAction; + BYTE nLastAction; - void StartPara( BOOL bReal ); - void EndPara( BOOL bReal ); - void AnchorStart(); - void AnchorEnd(); - void HeadingStart( int nToken ); - void HeadingEnd( int nToken ); - void SkipGroup( int nEndToken ); - BOOL ThrowAwayBlank(); - BOOL HasTextInCurrentPara(); - void ProcessUnknownControl( BOOL bOn ); + void StartPara( BOOL bReal ); + void EndPara( BOOL bReal ); + void AnchorStart(); + void AnchorEnd(); + void HeadingStart( int nToken ); + void HeadingEnd( int nToken ); + void SkipGroup( int nEndToken ); + BOOL ThrowAwayBlank(); + BOOL HasTextInCurrentPara(); + void ProcessUnknownControl( BOOL bOn ); - void ImpInsertParaBreak(); - void ImpInsertText( const String& rText ); - void ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSel = 0 ); - void ImpSetStyleSheet( USHORT nHeadingLevel ); + void ImpInsertParaBreak(); + void ImpInsertText( const String& rText ); + void ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSel = 0 ); + void ImpSetStyleSheet( USHORT nHeadingLevel ); protected: - virtual void NextToken( int nToken ); + virtual void NextToken( int nToken ); public: EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValueIterator* pHTTPHeaderAttrs ); ~EditHTMLParser(); - virtual SvParserState CallParser( ImpEditEngine* pImpEE, const EditPaM& rPaM ); + virtual SvParserState CallParser( ImpEditEngine* pImpEE, const EditPaM& rPaM ); - const EditSelection& GetCurSelection() const { return aCurSel; } + const EditSelection& GetCurSelection() const { return aCurSel; } }; SV_DECL_REF( EditHTMLParser ) diff --git a/editeng/source/editeng/eeng_pch.cxx b/editeng/source/editeng/eeng_pch.cxx index 45216b37b7b9..31a3b5e37636 100644 --- a/editeng/source/editeng/eeng_pch.cxx +++ b/editeng/source/editeng/eeng_pch.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/editeng/source/editeng/eeng_pch.hxx b/editeng/source/editeng/eeng_pch.hxx index 7f80ed57005f..1ae7d8beed6a 100644 --- a/editeng/source/editeng/eeng_pch.hxx +++ b/editeng/source/editeng/eeng_pch.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx index 5228d80dccaa..34d595970904 100644 --- a/editeng/source/editeng/eeobj.cxx +++ b/editeng/source/editeng/eeobj.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,7 +49,7 @@ EditDataObject::EditDataObject() EditDataObject::~EditDataObject() { } - + // uno::XInterface uno::Any EditDataObject::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException) { diff --git a/editeng/source/editeng/eeobj.hxx b/editeng/source/editeng/eeobj.hxx index 56b95e0d23df..f6fa28f4b14c 100644 --- a/editeng/source/editeng/eeobj.hxx +++ b/editeng/source/editeng/eeobj.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,34 +34,34 @@ #include <tools/stream.hxx> -class EditDataObject : public ::com::sun::star::datatransfer::XTransferable, +class EditDataObject : public ::com::sun::star::datatransfer::XTransferable, public ::cppu::OWeakObject { private: - SvMemoryStream maBinData; - SvMemoryStream maRTFData; - String maText; + SvMemoryStream maBinData; + SvMemoryStream maRTFData; + String maText; - String maOfficeBookmark; + String maOfficeBookmark; -// String maNetscapeBookmark; -// SvMemoryStream maRTFData; +// String maNetscapeBookmark; +// SvMemoryStream maRTFData; -public: +public: EditDataObject(); ~EditDataObject(); - - SvMemoryStream& GetStream() { return maBinData; } - SvMemoryStream& GetRTFStream() { return maRTFData; } - String& GetString() { return maText; } - String& GetURL() { return maOfficeBookmark; } - - + + SvMemoryStream& GetStream() { return maBinData; } + SvMemoryStream& GetRTFStream() { return maRTFData; } + String& GetString() { return maText; } + String& GetURL() { return maOfficeBookmark; } + + // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakObject::acquire(); } - void SAL_CALL release() throw() { OWeakObject::release(); } + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } // ::com::sun::star::datatransfer::XTransferable ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw(::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); @@ -69,6 +69,6 @@ public: sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw(::com::sun::star::uno::RuntimeException); }; -#endif // _DATAOBJ_HXX +#endif // _DATAOBJ_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index c4f518982991..c1491b764389 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/editeng/source/editeng/eerdll2.hxx b/editeng/source/editeng/eerdll2.hxx index baf2a1d8c5bf..43bf536982b5 100644 --- a/editeng/source/editeng/eerdll2.hxx +++ b/editeng/source/editeng/eerdll2.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,20 +40,20 @@ class GlobalEditData private: ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > xLanguageGuesser; - SfxPoolItem** ppDefItems; - OutputDevice* pStdRefDevice; + SfxPoolItem** ppDefItems; + OutputDevice* pStdRefDevice; - rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable; + rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable; public: GlobalEditData(); ~GlobalEditData(); - SfxPoolItem** GetDefItems(); - OutputDevice* GetStdRefDevice(); + SfxPoolItem** GetDefItems(); + OutputDevice* GetStdRefDevice(); - rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable(); - void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars ) { xForbiddenCharsTable = xForbiddenChars; } + rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable(); + void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars ) { xForbiddenCharsTable = xForbiddenChars; } ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLanguageGuessing > GetLanguageGuesser(); }; diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 49967ac72df8..d92da4962c32 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,14 +46,14 @@ // alle Werte auf default; wird nach einlesen der Bitmap aufgerufen ! void SvxRTFPictureType::ResetValues() -{ // setze alle Werte RTF-Defaults +{ // setze alle Werte RTF-Defaults eStyle = RTF_BITMAP; nMode = HEX_MODE; nType = nGoalWidth = nGoalHeight = 0; nWidth = nHeight = nWidthBytes = 0; uPicLen = 0; nBitsPerPixel = nPlanes = 1; - nScalX = nScalY = 100; // Skalierung in Prozent + nScalX = nScalY = 100; // Skalierung in Prozent nCropT = nCropB = nCropL = nCropR = 0; aPropertyPairs.clear(); } @@ -61,12 +61,12 @@ void SvxRTFPictureType::ResetValues() ImportInfo::ImportInfo( ImportState eSt, SvParser* pPrsrs, const ESelection& rSel ) : aSelection( rSel ) { - pParser = pPrsrs, - eState = eSt; + pParser = pPrsrs, + eState = eSt; - nToken = 0; - nTokenValue = 0; - pAttrs = NULL; + nToken = 0; + nTokenValue = 0; + pAttrs = NULL; } ImportInfo::~ImportInfo() @@ -77,20 +77,20 @@ EditRTFParser::EditRTFParser( SvStream& rIn, EditSelection aSel, SfxItemPool& rA : SvxRTFParser( rAttrPool, rIn, 0 ), aRTFMapMode( MAP_TWIP ) { - pImpEditEngine = pImpEE; - aCurSel = aSel; - eDestCharSet = RTL_TEXTENCODING_DONTKNOW; - nDefFont = 0; - nDefTab = 0; - nLastAction = 0; - nDefFontHeight = 0; + pImpEditEngine = pImpEE; + aCurSel = aSel; + eDestCharSet = RTL_TEXTENCODING_DONTKNOW; + nDefFont = 0; + nDefTab = 0; + nLastAction = 0; + nDefFontHeight = 0; SetInsPos( EditPosition( pImpEditEngine, &aCurSel ) ); // Umwandeln der Twips-Werte... SetCalcValue( TRUE ); SetChkStyleAttr( pImpEE->GetStatus().DoImportRTFStyleSheets() ); - SetNewDoc( FALSE ); // damit die Pool-Defaults nicht + SetNewDoc( FALSE ); // damit die Pool-Defaults nicht // ueberschrieben werden... aEditMapMode = MapMode( pImpEE->GetRefDevice()->GetMapMode().GetMapUnit() ); } @@ -323,8 +323,8 @@ void __EXPORT EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) const SfxPoolItem* pItem; // #i66167# adapt font heights to destination MapUnit if necessary - const MapUnit eDestUnit = ( MapUnit )( pImpEditEngine->GetEditDoc().GetItemPool().GetMetric(0) ); - const MapUnit eSrcUnit = aRTFMapMode.GetMapUnit(); + const MapUnit eDestUnit = ( MapUnit )( pImpEditEngine->GetEditDoc().GetItemPool().GetMetric(0) ); + const MapUnit eSrcUnit = aRTFMapMode.GetMapUnit(); if (eDestUnit != eSrcUnit) { USHORT aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL }; @@ -332,7 +332,7 @@ void __EXPORT EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) { if (SFX_ITEM_SET == rSet.GetAttrSet().GetItemState( aFntHeightIems[i], FALSE, &pItem )) { - UINT32 nHeight = ((SvxFontHeightItem*)pItem)->GetHeight(); + UINT32 nHeight = ((SvxFontHeightItem*)pItem)->GetHeight(); long nNewHeight; nNewHeight = pImpEditEngine->GetRefDevice()->LogicToLogic( (long)nHeight, eSrcUnit, eDestUnit ); @@ -349,7 +349,7 @@ void __EXPORT EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) ) { - nEsc *= 10; //HalPoints => Twips wurde in RTFITEM.CXX unterschlagen! + nEsc *= 10; //HalPoints => Twips wurde in RTFITEM.CXX unterschlagen! SvxFont aFont; pImpEditEngine->SeekCursor( aStartPaM.GetNode(), aStartPaM.GetIndex()+1, aFont ); nEsc = nEsc * 100 / aFont.GetSize().Height(); @@ -427,7 +427,7 @@ void __EXPORT EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) // OutlLevel... if ( nOutlLevel != 0xff ) { - for ( USHORT n = nStartNode; n <= nEndNode; n++ ) + for ( USHORT n = nStartNode; n <= nEndNode; n++ ) { ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( n ); pNode->GetContentAttribs().GetItems().Put( SfxInt16Item( EE_PARA_OUTLLEVEL, nOutlLevel ) ); @@ -451,7 +451,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) SfxStyleSheet* pStyle = (SfxStyleSheet*)pImpEditEngine->GetStyleSheetPool()->Find( pRTFStyle->sName, SFX_STYLE_FAMILY_ALL ); if ( pStyle ) return pStyle; - + String aName( pRTFStyle->sName ); String aParent; if ( pRTFStyle->nBasedOn ) @@ -487,7 +487,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) void EditRTFParser::CreateStyleSheets() { // der SvxRTFParser hat jetzt die Vorlagen erzeugt... - if ( pImpEditEngine->GetStyleSheetPool() && pImpEditEngine->GetStatus().DoImportRTFStyleSheets() ) + if ( pImpEditEngine->GetStyleSheetPool() && pImpEditEngine->GetStatus().DoImportRTFStyleSheets() ) { SvxRTFStyleType* pRTFStyle = GetStyleTbl().First(); while ( pRTFStyle ) @@ -510,7 +510,7 @@ void __EXPORT EditRTFParser::CalcValue() void EditRTFParser::ReadField() { // Aus SwRTFParser::ReadField() - int _nOpenBrakets = 1; // die erste wurde schon vorher erkannt + int _nOpenBrakets = 1; // die erste wurde schon vorher erkannt BOOL bFldInst = FALSE; BOOL bFldRslt = FALSE; String aFldInst; @@ -531,16 +531,16 @@ void EditRTFParser::ReadField() } break; - case '{': _nOpenBrakets++; + case '{': _nOpenBrakets++; break; - case RTF_FIELD: SkipGroup(); + case RTF_FIELD: SkipGroup(); break; - case RTF_FLDINST: bFldInst = TRUE; + case RTF_FLDINST: bFldInst = TRUE; break; - case RTF_FLDRSLT: bFldRslt = TRUE; + case RTF_FLDRSLT: bFldRslt = TRUE; break; case RTF_TEXTTOKEN: @@ -561,8 +561,8 @@ void EditRTFParser::ReadField() aFldInst.Erase( 0, aHyperLinkMarker.Len() ); aFldInst.EraseLeadingChars(); aFldInst.EraseTrailingChars(); - aFldInst.Erase( 0, 1 ); // " - aFldInst.Erase( aFldInst.Len()-1, 1 ); // " + aFldInst.Erase( 0, 1 ); // " + aFldInst.Erase( aFldInst.Len()-1, 1 ); // " if ( !aFldRslt.Len() ) aFldRslt = aFldInst; @@ -574,12 +574,12 @@ void EditRTFParser::ReadField() } } - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet } void EditRTFParser::SkipGroup() { - int _nOpenBrakets = 1; // die erste wurde schon vorher erkannt + int _nOpenBrakets = 1; // die erste wurde schon vorher erkannt while( _nOpenBrakets && IsParserWorking() ) { @@ -591,7 +591,7 @@ void EditRTFParser::SkipGroup() } break; - case '{': + case '{': { _nOpenBrakets++; } @@ -599,7 +599,7 @@ void EditRTFParser::SkipGroup() } } - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet } ULONG __EXPORT EditNodeIdx::GetIdx() const diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index 63bb1a9d03f0..9656c9e8708a 100644 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,29 +38,29 @@ class EditNodeIdx : public SvxNodeIdx { private: - ContentNode* pNode; - ImpEditEngine* pImpEditEngine; + ContentNode* pNode; + ImpEditEngine* pImpEditEngine; public: EditNodeIdx( ImpEditEngine* pIEE, ContentNode* pNd = 0) { pImpEditEngine = pIEE; pNode = pNd; } - virtual ULONG GetIdx() const; + virtual ULONG GetIdx() const; virtual SvxNodeIdx* Clone() const; - ContentNode* GetNode() { return pNode; } + ContentNode* GetNode() { return pNode; } }; class EditPosition : public SvxPosition { private: - EditSelection* pCurSel; - ImpEditEngine* pImpEditEngine; + EditSelection* pCurSel; + ImpEditEngine* pImpEditEngine; public: EditPosition( ImpEditEngine* pIEE, EditSelection* pSel ) { pImpEditEngine = pIEE; pCurSel = pSel; } - virtual ULONG GetNodeIdx() const; - virtual USHORT GetCntIdx() const; + virtual ULONG GetNodeIdx() const; + virtual USHORT GetCntIdx() const; // erzeuge von sich selbst eine Kopie virtual SvxPosition* Clone() const; @@ -69,56 +69,56 @@ public: virtual SvxNodeIdx* MakeNodeIdx() const; }; -#define ACTION_INSERTTEXT 1 -#define ACTION_INSERTPARABRK 2 +#define ACTION_INSERTTEXT 1 +#define ACTION_INSERTPARABRK 2 class EditRTFParser : public SvxRTFParser { private: - EditSelection aCurSel; - ImpEditEngine* pImpEditEngine; - CharSet eDestCharSet; - MapMode aRTFMapMode; - MapMode aEditMapMode; + EditSelection aCurSel; + ImpEditEngine* pImpEditEngine; + CharSet eDestCharSet; + MapMode aRTFMapMode; + MapMode aEditMapMode; - USHORT nDefFont; - USHORT nDefTab; - USHORT nDefFontHeight; - BYTE nLastAction; + USHORT nDefFont; + USHORT nDefTab; + USHORT nDefFontHeight; + BYTE nLastAction; protected: - virtual void InsertPara(); - virtual void InsertText(); - virtual void MovePos( int bForward = TRUE ); - virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos, + virtual void InsertPara(); + virtual void InsertText(); + virtual void MovePos( int bForward = TRUE ); + virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos, USHORT& rCntPos ); - virtual void UnknownAttrToken( int nToken, SfxItemSet* pSet ); - virtual void NextToken( int nToken ); - virtual void SetAttrInDoc( SvxRTFItemStackType &rSet ); - virtual int IsEndPara( SvxNodeIdx* pNd, USHORT nCnt ) const; - virtual void CalcValue(); - void CreateStyleSheets(); - SfxStyleSheet* CreateStyleSheet( SvxRTFStyleType* pRTFStyle ); - SvxRTFStyleType* FindStyleSheet( const String& rName ); - void AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& rEnd ); - void ReadField(); - void SkipGroup(); + virtual void UnknownAttrToken( int nToken, SfxItemSet* pSet ); + virtual void NextToken( int nToken ); + virtual void SetAttrInDoc( SvxRTFItemStackType &rSet ); + virtual int IsEndPara( SvxNodeIdx* pNd, USHORT nCnt ) const; + virtual void CalcValue(); + void CreateStyleSheets(); + SfxStyleSheet* CreateStyleSheet( SvxRTFStyleType* pRTFStyle ); + SvxRTFStyleType* FindStyleSheet( const String& rName ); + void AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& rEnd ); + void ReadField(); + void SkipGroup(); public: EditRTFParser( SvStream& rIn, EditSelection aCurSel, SfxItemPool& rAttrPool, ImpEditEngine* pImpEditEngine ); ~EditRTFParser(); - virtual SvParserState CallParser(); + virtual SvParserState CallParser(); - void SetDestCharSet( CharSet eCharSet ) { eDestCharSet = eCharSet; } - CharSet GetDestCharSet() const { return eDestCharSet; } + void SetDestCharSet( CharSet eCharSet ) { eDestCharSet = eCharSet; } + CharSet GetDestCharSet() const { return eDestCharSet; } - USHORT GetDefTab() const { return nDefTab; } - Font GetDefFont() { return GetFont( nDefFont ); } + USHORT GetDefTab() const { return nDefTab; } + Font GetDefFont() { return GetFont( nDefFont ); } - EditPaM GetCurPaM() const { return aCurSel.Max(); } + EditPaM GetCurPaM() const { return aCurSel.Max(); } }; SV_DECL_REF( EditRTFParser ) @@ -126,6 +126,6 @@ SV_IMPL_REF( EditRTFParser ); #endif // !SVX_LIGH -#endif //_EERTFPAR_HXX +#endif //_EERTFPAR_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index e3d624fceced..bfb199d7ce3b 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -59,7 +59,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::linguistic2; -#define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop +#define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop inline void lcl_AllignToPixel( Point& rPoint, OutputDevice* pOutDev, short nDiffX, short nDiffY ) { @@ -73,29 +73,29 @@ inline void lcl_AllignToPixel( Point& rPoint, OutputDevice* pOutDev, short nDiff rPoint = pOutDev->PixelToLogic( rPoint ); } -// ---------------------------------------------------------------------- -// class ImpEditView -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class ImpEditView +// ---------------------------------------------------------------------- ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, Window* pWindow ) : aOutArea( Point(), pEng->GetPaperSize() ) { pEditView = pView; - pEditEngine = pEng; - pOutWin = pWindow; - pPointer = NULL; - pBackgroundColor = NULL; - nScrollDiffX = 0; + pEditEngine = pEng; + pOutWin = pWindow; + pPointer = NULL; + pBackgroundColor = NULL; + nScrollDiffX = 0; nExtraCursorFlags = 0; nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW; - pCursor = NULL; - pDragAndDropInfo = NULL; - bReadOnly = sal_False; + pCursor = NULL; + pDragAndDropInfo = NULL; + bReadOnly = sal_False; bClickedInSelection = sal_False; - eSelectionMode = EE_SELMODE_TXTONLY; - eAnchorMode = ANCHOR_TOP_LEFT; - nInvMore = 1; - nTravelXPos = TRAVEL_X_DONTKNOW; - nControl = EV_CNTRL_AUTOSCROLL | EV_CNTRL_ENABLEPASTE; + eSelectionMode = EE_SELMODE_TXTONLY; + eAnchorMode = ANCHOR_TOP_LEFT; + nInvMore = 1; + nTravelXPos = TRAVEL_X_DONTKNOW; + nControl = EV_CNTRL_AUTOSCROLL | EV_CNTRL_ENABLEPASTE; bActiveDragAndDropListener = FALSE; aEditSelection.Min() = pEng->pImpEditEngine->GetEditDoc().GetStartPaM(); @@ -408,13 +408,13 @@ Region* ImpEditView::CalcSelectedRegion() return pRegion; } -void ImpEditView::SetSelectionMode( EESelectionMode eNewMode ) +void ImpEditView::SetSelectionMode( EESelectionMode eNewMode ) { if ( eSelectionMode != eNewMode ) { - DrawSelection(); // 'Wegmalen' ... + DrawSelection(); // 'Wegmalen' ... eSelectionMode = eNewMode; - DrawSelection(); // und neu zeichnen. + DrawSelection(); // und neu zeichnen. } } @@ -724,7 +724,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US nDocDiffY = aEditCursor.Bottom() - aTmpVisArea.Bottom(); } else if ( aEditCursor.Top() < aTmpVisArea.Top() ) - { // runterscrollen, negativ + { // runterscrollen, negativ nDocDiffY = aEditCursor.Top() - aTmpVisArea.Top(); } @@ -744,7 +744,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US } } else if ( aEditCursor.Left() < aTmpVisArea.Left() ) - { // rechtsscrollen + { // rechtsscrollen // negativ: nDocDiffX = aEditCursor.Left() - aTmpVisArea.Left(); // Darfs ein bischen mehr sein? @@ -753,7 +753,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US else nDocDiffX -= aEditCursor.Left(); } - if ( aPaM.GetIndex() == 0 ) // braucht Olli fuer den Outliner + if ( aPaM.GetIndex() == 0 ) // braucht Olli fuer den Outliner { // Aber sicherstellen, dass dadurch der Cursor nicht den // sichtbaren bereich verlaesst! @@ -916,7 +916,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) { // GetTextHeight noch optimieren! long nDiff = pEditEngine->pImpEditEngine->GetTextHeight() - aNewVisArea.Bottom(); // negativ - aNewVisArea.Move( 0, nDiff ); // koennte im neg. Bereich landen... + aNewVisArea.Move( 0, nDiff ); // koennte im neg. Bereich landen... } if ( ( aNewVisArea.Top() < 0 ) && ( nRangeCheck != RGCHK_NONE ) ) aNewVisArea.Move( 0, -aNewVisArea.Top() ); @@ -934,8 +934,8 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) } if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth( FALSE ) ) ) { - long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( FALSE ) - aNewVisArea.Right(); // negativ - aNewVisArea.Move( nDiff, 0 ); // koennte im neg. Bereich landen... + long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( FALSE ) - aNewVisArea.Right(); // negativ + aNewVisArea.Move( nDiff, 0 ); // koennte im neg. Bereich landen... } if ( ( aNewVisArea.Left() < 0 ) && ( nRangeCheck != RGCHK_NONE ) ) aNewVisArea.Move( -aNewVisArea.Left(), 0 ); @@ -1071,7 +1071,7 @@ sal_Bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent ) sal_Bool ImpEditView::MouseButtonDown( const MouseEvent& rMouseEvent ) { - pEditEngine->pImpEditEngine->CheckIdleFormatter(); // Falls schnelles Tippen und MouseButtonDown + pEditEngine->pImpEditEngine->CheckIdleFormatter(); // Falls schnelles Tippen und MouseButtonDown if ( pEditEngine->pImpEditEngine->aStatus.NotifyCursorMovements() ) pEditEngine->pImpEditEngine->aStatus.GetPrevParagraph() = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( GetEditSelection().Max().GetNode() ); nTravelXPos = TRAVEL_X_DONTKNOW; @@ -1088,7 +1088,7 @@ sal_Bool ImpEditView::MouseMove( const MouseEvent& rMouseEvent ) void ImpEditView::Command( const CommandEvent& rCEvt ) { - pEditEngine->pImpEditEngine->CheckIdleFormatter(); // Falls schnelles Tippen und MouseButtonDown + pEditEngine->pImpEditEngine->CheckIdleFormatter(); // Falls schnelles Tippen und MouseButtonDown pEditEngine->pImpEditEngine->Command( rCEvt, GetEditViewPtr() ); } @@ -1112,7 +1112,7 @@ sal_Bool ImpEditView::IsWrongSpelledWord( const EditPaM& rPaM, sal_Bool bMarkIfW bIsWrong = rPaM.GetNode()->GetWrongList()->HasWrong( aSel.Min().GetIndex(), aSel.Max().GetIndex() ); if ( bIsWrong && bMarkIfWrong ) { - DrawSelection(); // alte Selektion 'weg-zeichnen' + DrawSelection(); // alte Selektion 'weg-zeichnen' SetEditSelection( aSel ); DrawSelection(); } @@ -1137,7 +1137,7 @@ String ImpEditView::SpellIgnoreOrAddWord( sal_Bool bAdd ) { aWord = pEditEngine->pImpEditEngine->GetSelected( GetEditSelection() ); // Und deselektieren - DrawSelection(); // alte Selektion 'weg-zeichnen' + DrawSelection(); // alte Selektion 'weg-zeichnen' SetEditSelection( EditSelection( aPaM, aPaM ) ); DrawSelection(); } @@ -1491,7 +1491,7 @@ void ImpEditView::ShowDDCursor( const Rectangle& rRect ) pOutWin->GetCursor()->Hide(); Color aOldFillColor = GetWindow()->GetFillColor(); - GetWindow()->SetFillColor( Color(4210752) ); // GRAY BRUSH_50, OLDSV, change to DDCursor! + GetWindow()->SetFillColor( Color(4210752) ); // GRAY BRUSH_50, OLDSV, change to DDCursor! // Hintergrund sichern... Rectangle aSaveRec( GetWindow()->LogicToPixel( rRect ) ); diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index af282a6f094d..a08ebe80a95d 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,23 +60,23 @@ DBG_NAMEEX( EditView ) DBG_NAMEEX( EditEngine ) -#define PIMPEE pImpEditView->pEditEngine->pImpEditEngine +#define PIMPEE pImpEditView->pEditEngine->pImpEditEngine -#define DEL_LEFT 1 -#define DEL_RIGHT 2 -#define TRAVEL_X_DONTKNOW 0xFFFFFFFF -#define CURSOR_BIDILEVEL_DONTKNOW 0xFFFF -#define MAXCHARSINPARA 0x3FFF-CHARPOSGROW // Max 16K, because WYSIWYG array +#define DEL_LEFT 1 +#define DEL_RIGHT 2 +#define TRAVEL_X_DONTKNOW 0xFFFFFFFF +#define CURSOR_BIDILEVEL_DONTKNOW 0xFFFF +#define MAXCHARSINPARA 0x3FFF-CHARPOSGROW // Max 16K, because WYSIWYG array -#define ATTRSPECIAL_WHOLEWORD 1 -#define ATTRSPECIAL_EDGE 2 +#define ATTRSPECIAL_WHOLEWORD 1 +#define ATTRSPECIAL_EDGE 2 -#define GETCRSR_TXTONLY 0x0001 -#define GETCRSR_STARTOFLINE 0x0002 -#define GETCRSR_ENDOFLINE 0x0004 +#define GETCRSR_TXTONLY 0x0001 +#define GETCRSR_STARTOFLINE 0x0002 +#define GETCRSR_ENDOFLINE 0x0004 #define GETCRSR_PREFERPORTIONSTART 0x0008 -#define LINE_SEP 0x0A +#define LINE_SEP 0x0A typedef EENotify* EENotifyPtr; SV_DECL_PTRARR_DEL( NotifyList, EENotifyPtr, 1, 1 ) // IMPL is in outliner.cxx, move to EE later and share declaration, or use BlockNotifications from EE directly @@ -117,19 +117,19 @@ namespace svtools { struct DragAndDropInfo { - Rectangle aCurCursor; - Rectangle aCurSavedCursor; - sal_uInt16 nSensibleRange; - sal_uInt16 nCursorWidth; + Rectangle aCurCursor; + Rectangle aCurSavedCursor; + sal_uInt16 nSensibleRange; + sal_uInt16 nCursorWidth; ESelection aBeginDragSel; - EditPaM aDropDest; + EditPaM aDropDest; USHORT nOutlinerDropDest; - ESelection aDropSel; - VirtualDevice* pBackground; - const SvxFieldItem* pField; - sal_Bool bVisCursor : 1; - sal_Bool bDroppedInMe : 1; - sal_Bool bStarterOfDD : 1; + ESelection aDropSel; + VirtualDevice* pBackground; + const SvxFieldItem* pField; + sal_Bool bVisCursor : 1; + sal_Bool bDroppedInMe : 1; + sal_Bool bStarterOfDD : 1; sal_Bool bHasValidData : 1; sal_Bool bUndoAction : 1; sal_Bool bOutlinerMode : 1; @@ -147,16 +147,16 @@ struct ImplIMEInfos { String aOldTextAfterStartPos; sal_uInt16* pAttribs; - EditPaM aPos; - sal_uInt16 nLen; - sal_Bool bCursor; - sal_Bool bWasCursorOverwrite; + EditPaM aPos; + sal_uInt16 nLen; + sal_Bool bCursor; + sal_Bool bWasCursorOverwrite; ImplIMEInfos( const EditPaM& rPos, const String& rOldTextAfterStartPos ); ~ImplIMEInfos(); - void CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL ); - void DestroyAttribs(); + void CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL ); + void DestroyAttribs(); }; // #i18881# to be able to identify the postions of changed words @@ -165,12 +165,12 @@ typedef std::vector<EditSelection> SpellContentSelections; struct SpellInfo { - EESpellState eState; - EPaM aSpellStart; - EPaM aSpellTo; - EditPaM aCurSentenceStart; - sal_Bool bSpellToEnd; - sal_Bool bMultipleDoc; + EESpellState eState; + EPaM aSpellStart; + EPaM aSpellTo; + EditPaM aCurSentenceStart; + sal_Bool bSpellToEnd; + sal_Bool bMultipleDoc; ::svx::SpellPortions aLastSpellPortions; SpellContentSelections aLastSpellContentSelections; SpellInfo() @@ -194,29 +194,29 @@ struct FormatterFontMetric sal_uInt16 nMaxAscent; sal_uInt16 nMaxDescent; - FormatterFontMetric() { nMaxAscent = 0; nMaxDescent = 0; /* nMinLeading = 0xFFFF; */ } + FormatterFontMetric() { nMaxAscent = 0; nMaxDescent = 0; /* nMinLeading = 0xFFFF; */ } sal_uInt16 GetHeight() const { return nMaxAscent+nMaxDescent; } }; class IdleFormattter : public Timer { private: - EditView* pView; - int nRestarts; + EditView* pView; + int nRestarts; public: IdleFormattter(); ~IdleFormattter(); - void DoIdleFormat( EditView* pV ); - void ForceTimeout(); - void ResetRestarts() { nRestarts = 0; } - EditView* GetView() { return pView; } + void DoIdleFormat( EditView* pV ); + void ForceTimeout(); + void ResetRestarts() { nRestarts = 0; } + EditView* GetView() { return pView; } }; -// ---------------------------------------------------------------------- -// class ImpEditView -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// class ImpEditView +// ---------------------------------------------------------------------- class ImpEditView : public vcl::unohelper::DragAndDropClient { friend class EditView; @@ -228,32 +228,32 @@ class ImpEditView : public vcl::unohelper::DragAndDropClient private: EditView* pEditView; - Cursor* pCursor; - Color* pBackgroundColor; - EditEngine* pEditEngine; - Window* pOutWin; - Pointer* pPointer; - DragAndDropInfo* pDragAndDropInfo; + Cursor* pCursor; + Color* pBackgroundColor; + EditEngine* pEditEngine; + Window* pOutWin; + Pointer* pPointer; + DragAndDropInfo* pDragAndDropInfo; ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > mxDnDListener; - long nInvMore; - ULONG nControl; - sal_uInt32 nTravelXPos; + long nInvMore; + ULONG nControl; + sal_uInt32 nTravelXPos; sal_uInt16 nExtraCursorFlags; sal_uInt16 nCursorBidiLevel; - sal_uInt16 nScrollDiffX; - sal_Bool bReadOnly; + sal_uInt16 nScrollDiffX; + sal_Bool bReadOnly; sal_Bool bClickedInSelection; sal_Bool bActiveDragAndDropListener; - Point aAnchorPoint; - Rectangle aOutArea; - Point aVisDocStartPos; - EESelectionMode eSelectionMode; - EditSelection aEditSelection; - EVAnchorMode eAnchorMode; + Point aAnchorPoint; + Rectangle aOutArea; + Point aVisDocStartPos; + EESelectionMode eSelectionMode; + EditSelection aEditSelection; + EVAnchorMode eAnchorMode; protected: @@ -276,114 +276,114 @@ public: EditView* GetEditViewPtr() { return pEditView; } - sal_uInt16 GetScrollDiffX() const { return nScrollDiffX; } - void SetScrollDiffX( sal_uInt16 n ) { nScrollDiffX = n; } + sal_uInt16 GetScrollDiffX() const { return nScrollDiffX; } + void SetScrollDiffX( sal_uInt16 n ) { nScrollDiffX = n; } sal_uInt16 GetCursorBidiLevel() const { return nCursorBidiLevel; } void SetCursorBidiLevel( sal_uInt16 n ) { nCursorBidiLevel = n; } - Point GetDocPos( const Point& rWindowPos ) const; - Point GetWindowPos( const Point& rDocPos ) const; - Rectangle GetWindowPos( const Rectangle& rDocPos ) const; + Point GetDocPos( const Point& rWindowPos ) const; + Point GetWindowPos( const Point& rDocPos ) const; + Rectangle GetWindowPos( const Rectangle& rDocPos ) const; - void SetOutputArea( const Rectangle& rRec ); - void ResetOutputArea( const Rectangle& rRec ); - const Rectangle& GetOutputArea() const { return aOutArea; } + void SetOutputArea( const Rectangle& rRec ); + void ResetOutputArea( const Rectangle& rRec ); + const Rectangle& GetOutputArea() const { return aOutArea; } - BOOL IsVertical() const; + BOOL IsVertical() const; - BOOL PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL ); + BOOL PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL ); - BOOL MouseButtonUp( const MouseEvent& rMouseEvent ); - BOOL MouseButtonDown( const MouseEvent& rMouseEvent ); - BOOL MouseMove( const MouseEvent& rMouseEvent ); - void Command( const CommandEvent& rCEvt ); + BOOL MouseButtonUp( const MouseEvent& rMouseEvent ); + BOOL MouseButtonDown( const MouseEvent& rMouseEvent ); + BOOL MouseMove( const MouseEvent& rMouseEvent ); + void Command( const CommandEvent& rCEvt ); void CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bCut ); void Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bUseSpecial = sal_False ); - void SetVisDocStartPos( const Point& rPos ) { aVisDocStartPos = rPos; } - const Point& GetVisDocStartPos() const { return aVisDocStartPos; } + void SetVisDocStartPos( const Point& rPos ) { aVisDocStartPos = rPos; } + const Point& GetVisDocStartPos() const { return aVisDocStartPos; } - long GetVisDocLeft() const { return aVisDocStartPos.X(); } - long GetVisDocTop() const { return aVisDocStartPos.Y(); } - long GetVisDocRight() const { return aVisDocStartPos.X() + ( !IsVertical() ? aOutArea.GetWidth() : aOutArea.GetHeight() ); } - long GetVisDocBottom() const { return aVisDocStartPos.Y() + ( !IsVertical() ? aOutArea.GetHeight() : aOutArea.GetWidth() ); } - Rectangle GetVisDocArea() const; + long GetVisDocLeft() const { return aVisDocStartPos.X(); } + long GetVisDocTop() const { return aVisDocStartPos.Y(); } + long GetVisDocRight() const { return aVisDocStartPos.X() + ( !IsVertical() ? aOutArea.GetWidth() : aOutArea.GetHeight() ); } + long GetVisDocBottom() const { return aVisDocStartPos.Y() + ( !IsVertical() ? aOutArea.GetHeight() : aOutArea.GetWidth() ); } + Rectangle GetVisDocArea() const; - EditSelection& GetEditSelection() { return aEditSelection; } - void SetEditSelection( const EditSelection& rEditSelection ); - sal_Bool HasSelection() const { return aEditSelection.HasRange(); } + EditSelection& GetEditSelection() { return aEditSelection; } + void SetEditSelection( const EditSelection& rEditSelection ); + sal_Bool HasSelection() const { return aEditSelection.HasRange(); } - void DrawSelection() { DrawSelection( aEditSelection ); } - void DrawSelection( EditSelection, Region* pRegion = NULL ); - Region* CalcSelectedRegion(); + void DrawSelection() { DrawSelection( aEditSelection ); } + void DrawSelection( EditSelection, Region* pRegion = NULL ); + Region* CalcSelectedRegion(); - Window* GetWindow() const { return pOutWin; } + Window* GetWindow() const { return pOutWin; } - EESelectionMode GetSelectionMode() const { return eSelectionMode; } - void SetSelectionMode( EESelectionMode eMode ); + EESelectionMode GetSelectionMode() const { return eSelectionMode; } + void SetSelectionMode( EESelectionMode eMode ); - inline void SetPointer( const Pointer& rPointer ); - inline const Pointer& GetPointer(); + inline void SetPointer( const Pointer& rPointer ); + inline const Pointer& GetPointer(); - inline void SetCursor( const Cursor& rCursor ); - inline Cursor* GetCursor(); + inline void SetCursor( const Cursor& rCursor ); + inline Cursor* GetCursor(); void AddDragAndDropListeners(); void RemoveDragAndDropListeners(); BOOL IsBulletArea( const Point& rPos, sal_uInt16* pPara ); -// Fuer die SelectionEngine... - void CreateAnchor(); - void DeselectAll(); - sal_Bool SetCursorAtPoint( const Point& rPointPixel ); - sal_Bool IsSelectionAtPoint( const Point& rPosPixel ); - sal_Bool IsInSelection( const EditPaM& rPaM ); +// Fuer die SelectionEngine... + void CreateAnchor(); + void DeselectAll(); + sal_Bool SetCursorAtPoint( const Point& rPointPixel ); + sal_Bool IsSelectionAtPoint( const Point& rPosPixel ); + sal_Bool IsInSelection( const EditPaM& rPaM ); - void SetAnchorMode( EVAnchorMode eMode ); - EVAnchorMode GetAnchorMode() const { return eAnchorMode; } - void CalcAnchorPoint(); - void RecalcOutputArea(); + void SetAnchorMode( EVAnchorMode eMode ); + EVAnchorMode GetAnchorMode() const { return eAnchorMode; } + void CalcAnchorPoint(); + void RecalcOutputArea(); - void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, BOOL test ); - void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, USHORT nShowCursorFlags = 0 ); - Pair Scroll( long ndX, long ndY, BYTE nRangeCheck = RGCHK_NEG ); + void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, BOOL test ); + void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, USHORT nShowCursorFlags = 0 ); + Pair Scroll( long ndX, long ndY, BYTE nRangeCheck = RGCHK_NEG ); - void SetInsertMode( sal_Bool bInsert ); - sal_Bool IsInsertMode() const { return ( ( nControl & EV_CNTRL_OVERWRITE ) == 0 ); } + void SetInsertMode( sal_Bool bInsert ); + sal_Bool IsInsertMode() const { return ( ( nControl & EV_CNTRL_OVERWRITE ) == 0 ); } - void EnablePaste( sal_Bool bEnable ) { SetFlags( nControl, EV_CNTRL_ENABLEPASTE, bEnable ); } - sal_Bool IsPasteEnabled() const { return ( ( nControl & EV_CNTRL_ENABLEPASTE ) != 0 ); } + void EnablePaste( sal_Bool bEnable ) { SetFlags( nControl, EV_CNTRL_ENABLEPASTE, bEnable ); } + sal_Bool IsPasteEnabled() const { return ( ( nControl & EV_CNTRL_ENABLEPASTE ) != 0 ); } - sal_Bool DoSingleLinePaste() const { return ( ( nControl & EV_CNTRL_SINGLELINEPASTE ) != 0 ); } - sal_Bool DoAutoScroll() const { return ( ( nControl & EV_CNTRL_AUTOSCROLL ) != 0 ); } - sal_Bool DoBigScroll() const { return ( ( nControl & EV_CNTRL_BIGSCROLL ) != 0 ); } - sal_Bool DoAutoSize() const { return ( ( nControl & EV_CNTRL_AUTOSIZE ) != 0 ); } - sal_Bool DoAutoWidth() const { return ( ( nControl & EV_CNTRL_AUTOSIZEX) != 0 ); } - sal_Bool DoAutoHeight() const { return ( ( nControl & EV_CNTRL_AUTOSIZEY) != 0 ); } - sal_Bool DoInvalidateMore() const { return ( ( nControl & EV_CNTRL_INVONEMORE ) != 0 ); } + sal_Bool DoSingleLinePaste() const { return ( ( nControl & EV_CNTRL_SINGLELINEPASTE ) != 0 ); } + sal_Bool DoAutoScroll() const { return ( ( nControl & EV_CNTRL_AUTOSCROLL ) != 0 ); } + sal_Bool DoBigScroll() const { return ( ( nControl & EV_CNTRL_BIGSCROLL ) != 0 ); } + sal_Bool DoAutoSize() const { return ( ( nControl & EV_CNTRL_AUTOSIZE ) != 0 ); } + sal_Bool DoAutoWidth() const { return ( ( nControl & EV_CNTRL_AUTOSIZEX) != 0 ); } + sal_Bool DoAutoHeight() const { return ( ( nControl & EV_CNTRL_AUTOSIZEY) != 0 ); } + sal_Bool DoInvalidateMore() const { return ( ( nControl & EV_CNTRL_INVONEMORE ) != 0 ); } - void SetBackgroundColor( const Color& rColor ); - const Color& GetBackgroundColor() const { + void SetBackgroundColor( const Color& rColor ); + const Color& GetBackgroundColor() const { return ( pBackgroundColor ? *pBackgroundColor : pOutWin->GetBackground().GetColor() ); } - sal_Bool IsWrongSpelledWord( const EditPaM& rPaM, sal_Bool bMarkIfWrong ); - String SpellIgnoreOrAddWord( sal_Bool bAdd ); + sal_Bool IsWrongSpelledWord( const EditPaM& rPaM, sal_Bool bMarkIfWrong ); + String SpellIgnoreOrAddWord( sal_Bool bAdd ); const SvxFieldItem* GetField( const Point& rPos, sal_uInt16* pPara, sal_uInt16* pPos ) const; void DeleteSelected(); // Ggf. mehr als OutputArea invalidieren, fuer den DrawingEngine-Textrahmen... - void SetInvalidateMore( sal_uInt16 nPixel ) { nInvMore = nPixel; } - sal_uInt16 GetInvalidateMore() const { return (sal_uInt16)nInvMore; } + void SetInvalidateMore( sal_uInt16 nPixel ) { nInvMore = nPixel; } + sal_uInt16 GetInvalidateMore() const { return (sal_uInt16)nInvMore; } }; -// ---------------------------------------------------------------------- -// ImpEditEngine -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// ImpEditEngine +// ---------------------------------------------------------------------- typedef EditView* EditViewPtr; SV_DECL_PTRARR( EditViews, EditViewPtr, 0, 1 ) @@ -402,11 +402,11 @@ class ImpEditEngine : public SfxListener friend class EditView; friend class ImpEditView; - friend class EditEngine; // Fuer Zugriff auf Imp-Methoden - friend class EditRTFParser; // Fuer Zugriff auf Imp-Methoden - friend class EditHTMLParser; // Fuer Zugriff auf Imp-Methoden - friend class EdtAutoCorrDoc; // Fuer Zugriff auf Imp-Methoden - friend class EditDbg; // DebugRoutinen + friend class EditEngine; // Fuer Zugriff auf Imp-Methoden + friend class EditRTFParser; // Fuer Zugriff auf Imp-Methoden + friend class EditHTMLParser; // Fuer Zugriff auf Imp-Methoden + friend class EdtAutoCorrDoc; // Fuer Zugriff auf Imp-Methoden + friend class EditDbg; // DebugRoutinen private: @@ -415,217 +415,217 @@ private: // ================================================================ // Dokument-Spezifische Daten... - ParaPortionList aParaPortionList; // Formatierung - Size aPaperSize; // Layout - Size aMinAutoPaperSize; // Layout ? - Size aMaxAutoPaperSize; // Layout ? - EditDoc aEditDoc; // Dokumenteninhalt + ParaPortionList aParaPortionList; // Formatierung + Size aPaperSize; // Layout + Size aMinAutoPaperSize; // Layout ? + Size aMaxAutoPaperSize; // Layout ? + EditDoc aEditDoc; // Dokumenteninhalt // Engine-Spezifische Daten.... - EditEngine* pEditEngine; - EditViews aEditViews; - EditView* pActiveView; - TextRanger* pTextRanger; + EditEngine* pEditEngine; + EditViews aEditViews; + EditView* pActiveView; + TextRanger* pTextRanger; - SfxStyleSheetPool* pStylePool; - SfxItemPool* pTextObjectPool; + SfxStyleSheetPool* pStylePool; + SfxItemPool* pTextObjectPool; - VirtualDevice* pVirtDev; - OutputDevice* pRefDev; + VirtualDevice* pVirtDev; + OutputDevice* pRefDev; svtools::ColorConfig* pColorConfig; mutable SvtCTLOptions* pCTLOptions; - SfxItemSet* pEmptyItemSet; - EditUndoManager* pUndoManager; - ESelection* pUndoMarkSelection; + SfxItemSet* pEmptyItemSet; + EditUndoManager* pUndoManager; + ESelection* pUndoMarkSelection; - ImplIMEInfos* mpIMEInfos; + ImplIMEInfos* mpIMEInfos; NotifyList aNotifyCache; - XubString aWordDelimiters; - XubString aGroupChars; + XubString aWordDelimiters; + XubString aGroupChars; - EditSelFunctionSet aSelFuncSet; - EditSelectionEngine aSelEngine; + EditSelFunctionSet aSelFuncSet; + EditSelectionEngine aSelEngine; - Color maBackgroundColor; + Color maBackgroundColor; sal_uInt32 nBlockNotifications; - sal_uInt16 nStretchX; - sal_uInt16 nStretchY; + sal_uInt16 nStretchX; + sal_uInt16 nStretchY; USHORT nAsianCompressionMode; - BOOL bKernAsianPunctuation; + BOOL bKernAsianPunctuation; BOOL bAddExtLeading; EEHorizontalTextDirection eDefaultHorizontalTextDirection; - sal_uInt16 nBigTextObjectStart; + sal_uInt16 nBigTextObjectStart; ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XSpellChecker1 > xSpeller; + ::com::sun::star::linguistic2::XSpellChecker1 > xSpeller; ::com::sun::star::uno::Reference< - ::com::sun::star::linguistic2::XHyphenator > xHyphenator; - SpellInfo* pSpellInfo; + ::com::sun::star::linguistic2::XHyphenator > xHyphenator; + SpellInfo* pSpellInfo; mutable ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > xBI; mutable ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > xISC; ConvInfo * pConvInfo; - XubString aAutoCompleteText; + XubString aAutoCompleteText; - InternalEditStatus aStatus; + InternalEditStatus aStatus; - LanguageType eDefLanguage; + LanguageType eDefLanguage; OnDemandLocaleDataWrapper xLocaleDataWrapper; OnDemandTransliterationWrapper xTransliterationWrapper; - sal_Bool bIsFormatting; - sal_Bool bFormatted; - sal_Bool bInSelection; - sal_Bool bIsInUndo; - sal_Bool bUpdate; - sal_Bool bUndoEnabled; - sal_Bool bOwnerOfRefDev; - sal_Bool bDowning; + sal_Bool bIsFormatting; + sal_Bool bFormatted; + sal_Bool bInSelection; + sal_Bool bIsInUndo; + sal_Bool bUpdate; + sal_Bool bUndoEnabled; + sal_Bool bOwnerOfRefDev; + sal_Bool bDowning; sal_Bool bUseAutoColor; sal_Bool bForceAutoColor; - sal_Bool bCallParaInsertedOrDeleted; + sal_Bool bCallParaInsertedOrDeleted; sal_Bool bImpConvertFirstCall; // specifies if ImpConvert is called the very first time after Convert was called sal_Bool bFirstWordCapitalization; // specifies if auto-correction should capitalize the first word or not // Fuer Formatierung / Update.... - DeletedNodesList aDeletedNodes; - Rectangle aInvalidRec; - sal_uInt32 nCurTextHeight; - sal_uInt16 nOnePixelInRef; + DeletedNodesList aDeletedNodes; + Rectangle aInvalidRec; + sal_uInt32 nCurTextHeight; + sal_uInt16 nOnePixelInRef; - IdleFormattter aIdleFormatter; + IdleFormattter aIdleFormatter; - Timer aOnlineSpellTimer; + Timer aOnlineSpellTimer; // Wenn an einer Stelle erkannt wird, dass der StatusHdl gerufen werden // muss, dies aber nicht sofort geschehen darf (kritischer Abschnitt): - Timer aStatusTimer; - Link aStatusHdlLink; - Link aNotifyHdl; - Link aImportHdl; + Timer aStatusTimer; + Link aStatusHdlLink; + Link aNotifyHdl; + Link aImportHdl; Link aBeginMovingParagraphsHdl; Link aEndMovingParagraphsHdl; Link aBeginPasteOrDropHdl; Link aEndPasteOrDropHdl; Link aModifyHdl; - Link maBeginDropHdl; - Link maEndDropHdl; + Link maBeginDropHdl; + Link maEndDropHdl; - rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable; + rtl::Reference<SvxForbiddenCharactersTable> xForbiddenCharsTable; // ================================================================ // Methoden... // ================================================================ - void CursorMoved( ContentNode* pPrevNode ); - void ParaAttribsChanged( ContentNode* pNode ); - void TextModified(); - void CalcHeight( ParaPortion* pPortion ); + void CursorMoved( ContentNode* pPrevNode ); + void ParaAttribsChanged( ContentNode* pNode ); + void TextModified(); + void CalcHeight( ParaPortion* pPortion ); // ggf. lieber inline, aber so einiges... - void InsertUndo( EditUndo* pUndo, sal_Bool bTryMerge = sal_False ); - void ResetUndoManager(); - sal_Bool HasUndoManager() const { return pUndoManager ? sal_True : sal_False; } + void InsertUndo( EditUndo* pUndo, sal_Bool bTryMerge = sal_False ); + void ResetUndoManager(); + sal_Bool HasUndoManager() const { return pUndoManager ? sal_True : sal_False; } EditUndoSetAttribs* CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ); - EditPaM GetPaM( Point aDocPos, sal_Bool bSmart = sal_True ); - EditPaM GetPaM( ParaPortion* pPortion, Point aPos, sal_Bool bSmart = sal_True ); - long GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT nIndex, BOOL bPreferPortionStart = FALSE ); + EditPaM GetPaM( Point aDocPos, sal_Bool bSmart = sal_True ); + EditPaM GetPaM( ParaPortion* pPortion, Point aPos, sal_Bool bSmart = sal_True ); + long GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT nIndex, BOOL bPreferPortionStart = FALSE ); long GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLine, USHORT nTextPortion ); - USHORT GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nX, BOOL bSmart = TRUE ); - Range GetInvalidYOffsets( ParaPortion* pPortion ); + USHORT GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nX, BOOL bSmart = TRUE ); + Range GetInvalidYOffsets( ParaPortion* pPortion ); Range GetLineXPosStartEnd( ParaPortion* pParaPortion, EditLine* pLine ); - void SetParaAttrib( BYTE nFunc, EditSelection aSel, sal_uInt16 nValue ); - sal_uInt16 GetParaAttrib( BYTE nFunc, EditSelection aSel ); - void SetCharAttrib( EditSelection aSel, const SfxPoolItem& rItem ); - void ParaAttribsToCharAttribs( ContentNode* pNode ); - void GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const; + void SetParaAttrib( BYTE nFunc, EditSelection aSel, sal_uInt16 nValue ); + sal_uInt16 GetParaAttrib( BYTE nFunc, EditSelection aSel ); + void SetCharAttrib( EditSelection aSel, const SfxPoolItem& rItem ); + void ParaAttribsToCharAttribs( ContentNode* pNode ); + void GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const; - EditTextObject* CreateBinTextObject( EditSelection aSelection, SfxItemPool*, sal_Bool bAllowBigObjects = sal_False, sal_uInt16 nBigObjStart = 0 ) const; - void StoreBinTextObject( SvStream& rOStream, BinTextObject& rTextObject ); - EditSelection InsertBinTextObject( BinTextObject&, EditPaM aPaM ); + EditTextObject* CreateBinTextObject( EditSelection aSelection, SfxItemPool*, sal_Bool bAllowBigObjects = sal_False, sal_uInt16 nBigObjStart = 0 ) const; + void StoreBinTextObject( SvStream& rOStream, BinTextObject& rTextObject ); + EditSelection InsertBinTextObject( BinTextObject&, EditPaM aPaM ); EditSelection InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxDataObj, const String& rBaseURL, const EditPaM& rPaM, BOOL bUseSpecial ); - EditPaM Clear(); - EditPaM RemoveText(); - EditPaM RemoveText( EditSelection aEditSelection ); - sal_Bool CreateLines( USHORT nPara, sal_uInt32 nStartPosY ); - void CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uInt32 nStartPosY ); - sal_Bool FinishCreateLines( ParaPortion* pParaPortion ); - void CalcCharPositions( ParaPortion* pParaPortion ); - void CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& rStartPos /*, sal_Bool bCreateBlockPortions */ ); - void RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nStartPos, short nNewChars ); - sal_uInt16 SplitTextPortion( ParaPortion* pParaPortion, sal_uInt16 nPos, EditLine* pCurLine = 0 ); - void SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rFont, OutputDevice* pOut = NULL, sal_uInt16 nIgnoreWhich = 0 ); - void RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics, SvxFont& rFont ); - void CheckAutoPageSize(); - - void ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion* pPortion, sal_uInt16 nPortionStart, long nRemainingWidth, sal_Bool bCanHyphenate ); - void ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, long nRemainingSpace ); - EditPaM ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, sal_Bool bBackward = sal_False ); - EditPaM ImpDeleteSelection( EditSelection aEditSelection); - EditPaM ImpInsertParaBreak( const EditPaM& rPaM, sal_Bool bKeepEndingAttribs = sal_True ); - EditPaM ImpInsertParaBreak( const EditSelection& rEditSelection, sal_Bool bKeepEndingAttribs = sal_True ); - EditPaM ImpInsertText( EditSelection aCurEditSelection, const String& rStr ); - EditPaM ImpInsertFeature( EditSelection aEditSelection, const SfxPoolItem& rItem ); - void ImpRemoveChars( const EditPaM& rPaM, sal_uInt16 nChars, EditUndoRemoveChars* pCurUndo = 0 ); - void ImpRemoveParagraph( sal_uInt16 nPara ); - EditSelection ImpMoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos ); - - EditPaM ImpFastInsertText( EditPaM aPaM, const String& rStr ); - EditPaM ImpFastInsertParagraph( sal_uInt16 nPara ); - - sal_Bool ImpCheckRefMapMode(); + EditPaM Clear(); + EditPaM RemoveText(); + EditPaM RemoveText( EditSelection aEditSelection ); + sal_Bool CreateLines( USHORT nPara, sal_uInt32 nStartPosY ); + void CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uInt32 nStartPosY ); + sal_Bool FinishCreateLines( ParaPortion* pParaPortion ); + void CalcCharPositions( ParaPortion* pParaPortion ); + void CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& rStartPos /*, sal_Bool bCreateBlockPortions */ ); + void RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nStartPos, short nNewChars ); + sal_uInt16 SplitTextPortion( ParaPortion* pParaPortion, sal_uInt16 nPos, EditLine* pCurLine = 0 ); + void SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rFont, OutputDevice* pOut = NULL, sal_uInt16 nIgnoreWhich = 0 ); + void RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics, SvxFont& rFont ); + void CheckAutoPageSize(); + + void ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion* pPortion, sal_uInt16 nPortionStart, long nRemainingWidth, sal_Bool bCanHyphenate ); + void ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, long nRemainingSpace ); + EditPaM ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, sal_Bool bBackward = sal_False ); + EditPaM ImpDeleteSelection( EditSelection aEditSelection); + EditPaM ImpInsertParaBreak( const EditPaM& rPaM, sal_Bool bKeepEndingAttribs = sal_True ); + EditPaM ImpInsertParaBreak( const EditSelection& rEditSelection, sal_Bool bKeepEndingAttribs = sal_True ); + EditPaM ImpInsertText( EditSelection aCurEditSelection, const String& rStr ); + EditPaM ImpInsertFeature( EditSelection aEditSelection, const SfxPoolItem& rItem ); + void ImpRemoveChars( const EditPaM& rPaM, sal_uInt16 nChars, EditUndoRemoveChars* pCurUndo = 0 ); + void ImpRemoveParagraph( sal_uInt16 nPara ); + EditSelection ImpMoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos ); + + EditPaM ImpFastInsertText( EditPaM aPaM, const String& rStr ); + EditPaM ImpFastInsertParagraph( sal_uInt16 nPara ); + + sal_Bool ImpCheckRefMapMode(); BOOL ImplHasText() const; void ImpFindKashidas( ContentNode* pNode, USHORT nStart, USHORT nEnd, SvUShorts& rArray ); - void InsertContent( ContentNode* pNode, sal_uInt16 nPos ); - EditPaM SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos ); - EditPaM ConnectContents( sal_uInt16 nLeftNode, sal_Bool bBackward ); - - void ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow ); - sal_Bool IsParagraphVisible( sal_uInt16 nParagraph ); - - EditPaM PageUp( const EditPaM& rPaM, EditView* pView); - EditPaM PageDown( const EditPaM& rPaM, EditView* pView); - EditPaM CursorUp( const EditPaM& rPaM, EditView* pEditView ); - EditPaM CursorDown( const EditPaM& rPaM, EditView* pEditView ); - EditPaM CursorLeft( const EditPaM& rPaM, USHORT nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); - EditPaM CursorRight( const EditPaM& rPaM, USHORT nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); - EditPaM CursorStartOfLine( const EditPaM& rPaM ); - EditPaM CursorEndOfLine( const EditPaM& rPaM ); - EditPaM CursorStartOfParagraph( const EditPaM& rPaM ); - EditPaM CursorEndOfParagraph( const EditPaM& rPaM ); - EditPaM CursorStartOfDoc(); - EditPaM CursorEndOfDoc(); - EditPaM WordLeft( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - EditPaM WordRight( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - EditPaM StartOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - EditPaM EndOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, BOOL bAcceptStartOfWord = TRUE ); + void InsertContent( ContentNode* pNode, sal_uInt16 nPos ); + EditPaM SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos ); + EditPaM ConnectContents( sal_uInt16 nLeftNode, sal_Bool bBackward ); + + void ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow ); + sal_Bool IsParagraphVisible( sal_uInt16 nParagraph ); + + EditPaM PageUp( const EditPaM& rPaM, EditView* pView); + EditPaM PageDown( const EditPaM& rPaM, EditView* pView); + EditPaM CursorUp( const EditPaM& rPaM, EditView* pEditView ); + EditPaM CursorDown( const EditPaM& rPaM, EditView* pEditView ); + EditPaM CursorLeft( const EditPaM& rPaM, USHORT nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); + EditPaM CursorRight( const EditPaM& rPaM, USHORT nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); + EditPaM CursorStartOfLine( const EditPaM& rPaM ); + EditPaM CursorEndOfLine( const EditPaM& rPaM ); + EditPaM CursorStartOfParagraph( const EditPaM& rPaM ); + EditPaM CursorEndOfParagraph( const EditPaM& rPaM ); + EditPaM CursorStartOfDoc(); + EditPaM CursorEndOfDoc(); + EditPaM WordLeft( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); + EditPaM WordRight( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); + EditPaM StartOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); + EditPaM EndOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); + EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, BOOL bAcceptStartOfWord = TRUE ); EditSelection SelectSentence( const EditSelection& rCurSel ); EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, USHORT nCharacterIteratorMode, BOOL bToLeft ); EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, BOOL bStart ); - void InitScriptTypes( USHORT nPara ); - USHORT GetScriptType( const EditPaM& rPaM, USHORT* pEndPos = NULL ) const; - USHORT GetScriptType( const EditSelection& rSel ) const; - BOOL IsScriptChange( const EditPaM& rPaM ) const; + void InitScriptTypes( USHORT nPara ); + USHORT GetScriptType( const EditPaM& rPaM, USHORT* pEndPos = NULL ) const; + USHORT GetScriptType( const EditSelection& rSel ) const; + BOOL IsScriptChange( const EditPaM& rPaM ) const; BOOL HasScriptType( USHORT nPara, USHORT nType ) const; BOOL ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, USHORT nStartPos, sal_Int32* pDXArray, USHORT n100thPercentFromMax, BOOL bManipulateDXArray ); @@ -634,62 +634,62 @@ private: void ImplInitLayoutMode( OutputDevice* pOutDev, USHORT nPara, USHORT nIndex ); void ImplInitDigitMode( OutputDevice* pOutDev, String* pString, xub_StrLen nStt, xub_StrLen nLen, LanguageType eLang ); - EditPaM ReadText( SvStream& rInput, EditSelection aSel ); - EditPaM ReadRTF( SvStream& rInput, EditSelection aSel ); - EditPaM ReadXML( SvStream& rInput, EditSelection aSel ); + EditPaM ReadText( SvStream& rInput, EditSelection aSel ); + EditPaM ReadRTF( SvStream& rInput, EditSelection aSel ); + EditPaM ReadXML( SvStream& rInput, EditSelection aSel ); EditPaM ReadHTML( SvStream& rInput, const String& rBaseURL, EditSelection aSel, SvKeyValueIterator* pHTTPHeaderAttrs ); - EditPaM ReadBin( SvStream& rInput, EditSelection aSel ); - sal_uInt32 WriteText( SvStream& rOutput, EditSelection aSel ); - sal_uInt32 WriteRTF( SvStream& rOutput, EditSelection aSel ); - sal_uInt32 WriteXML( SvStream& rOutput, EditSelection aSel ); - sal_uInt32 WriteHTML( SvStream& rOutput, EditSelection aSel ); - sal_uInt32 WriteBin( SvStream& rOutput, EditSelection aSel, BOOL bStoreUnicode = FALSE ) const; - - void WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos, + EditPaM ReadBin( SvStream& rInput, EditSelection aSel ); + sal_uInt32 WriteText( SvStream& rOutput, EditSelection aSel ); + sal_uInt32 WriteRTF( SvStream& rOutput, EditSelection aSel ); + sal_uInt32 WriteXML( SvStream& rOutput, EditSelection aSel ); + sal_uInt32 WriteHTML( SvStream& rOutput, EditSelection aSel ); + sal_uInt32 WriteBin( SvStream& rOutput, EditSelection aSel, BOOL bStoreUnicode = FALSE ) const; + + void WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos, SvxFontTable& rFontTable, SvxColorList& rColorList ); - sal_Bool WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos, + sal_Bool WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos, SvxFontTable& rFontTable, SvxColorList& rColorList ); - long LogicToTwips( long n ); + long LogicToTwips( long n ); - inline short GetXValue( short nXValue ) const; - inline sal_uInt16 GetXValue( sal_uInt16 nXValue ) const; - inline long GetXValue( long nXValue ) const; + inline short GetXValue( short nXValue ) const; + inline sal_uInt16 GetXValue( sal_uInt16 nXValue ) const; + inline long GetXValue( long nXValue ) const; - inline short GetYValue( short nYValue ) const; - inline sal_uInt16 GetYValue( sal_uInt16 nYValue ) const; + inline short GetYValue( short nYValue ) const; + inline sal_uInt16 GetYValue( sal_uInt16 nYValue ) const; - ContentNode* GetPrevVisNode( ContentNode* pCurNode ); - ContentNode* GetNextVisNode( ContentNode* pCurNode ); + ContentNode* GetPrevVisNode( ContentNode* pCurNode ); + ContentNode* GetNextVisNode( ContentNode* pCurNode ); - ParaPortion* GetPrevVisPortion( ParaPortion* pCurPortion ); - ParaPortion* GetNextVisPortion( ParaPortion* pCurPortion ); + ParaPortion* GetPrevVisPortion( ParaPortion* pCurPortion ); + ParaPortion* GetNextVisPortion( ParaPortion* pCurPortion ); - void SetBackgroundColor( const Color& rColor ) { maBackgroundColor = rColor; } - Color GetBackgroundColor() const { return maBackgroundColor; } + void SetBackgroundColor( const Color& rColor ) { maBackgroundColor = rColor; } + Color GetBackgroundColor() const { return maBackgroundColor; } long CalcVertLineSpacing(Point& rStartPos) const; - Color GetAutoColor() const; + Color GetAutoColor() const; void EnableAutoColor( BOOL b ) { bUseAutoColor = b; } BOOL IsAutoColorEnabled() const { return bUseAutoColor; } void ForceAutoColor( BOOL b ) { bForceAutoColor = b; } BOOL IsForceAutoColor() const { return bForceAutoColor; } - inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, ULONG nDrawMode ); - inline void EraseVirtualDevice(); + inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, ULONG nDrawMode ); + inline void EraseVirtualDevice(); DECL_LINK( StatusTimerHdl, Timer * ); DECL_LINK( IdleFormatHdl, Timer * ); DECL_LINK( OnlineSpellHdl, Timer * ); DECL_LINK( DocModified, void* ); - void CheckIdleFormatter(); + void CheckIdleFormatter(); - inline ParaPortion* FindParaPortion( ContentNode* pNode ) const; + inline ParaPortion* FindParaPortion( ContentNode* pNode ) const; ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CreateTransferable( const EditSelection& rSelection ) const; - void SetValidPaperSize( const Size& rSz ); + void SetValidPaperSize( const Size& rSz ); ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator() const; ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > ImplGetInputSequenceChecker() const; @@ -707,233 +707,233 @@ private: SpellInfo * CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs ); protected: - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); public: ImpEditEngine( EditEngine* pEditEngine, SfxItemPool* pPool ); ~ImpEditEngine(); - void InitDoc( BOOL bKeepParaAttribs ); - EditDoc& GetEditDoc() { return aEditDoc; } - const EditDoc& GetEditDoc() const { return aEditDoc; } + void InitDoc( BOOL bKeepParaAttribs ); + EditDoc& GetEditDoc() { return aEditDoc; } + const EditDoc& GetEditDoc() const { return aEditDoc; } - inline EditUndoManager& GetUndoManager(); + inline EditUndoManager& GetUndoManager(); - void SetUpdateMode( sal_Bool bUp, EditView* pCurView = 0, sal_Bool bForceUpdate = sal_False ); - sal_Bool GetUpdateMode() const { return bUpdate; } + void SetUpdateMode( sal_Bool bUp, EditView* pCurView = 0, sal_Bool bForceUpdate = sal_False ); + sal_Bool GetUpdateMode() const { return bUpdate; } - const ParaPortionList& GetParaPortions() const { return aParaPortionList; } - ParaPortionList& GetParaPortions() { return aParaPortionList; } - EditViews& GetEditViews() { return aEditViews; } + const ParaPortionList& GetParaPortions() const { return aParaPortionList; } + ParaPortionList& GetParaPortions() { return aParaPortionList; } + EditViews& GetEditViews() { return aEditViews; } - const Size& GetPaperSize() const { return aPaperSize; } - void SetPaperSize( const Size& rSz ) { aPaperSize = rSz; } + const Size& GetPaperSize() const { return aPaperSize; } + void SetPaperSize( const Size& rSz ) { aPaperSize = rSz; } - void SetVertical( BOOL bVertical ); - BOOL IsVertical() const { return GetEditDoc().IsVertical(); } + void SetVertical( BOOL bVertical ); + BOOL IsVertical() const { return GetEditDoc().IsVertical(); } - void SetFixedCellHeight( BOOL bUseFixedCellHeight ); - BOOL IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } + void SetFixedCellHeight( BOOL bUseFixedCellHeight ); + BOOL IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir ) { eDefaultHorizontalTextDirection = eHTextDir; } EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const { return eDefaultHorizontalTextDirection; } - void InitWritingDirections( USHORT nPara ); + void InitWritingDirections( USHORT nPara ); BOOL IsRightToLeft( USHORT nPara ) const; BYTE GetRightToLeft( USHORT nPara, USHORT nChar, USHORT* pStart = NULL, USHORT* pEnd = NULL ); BOOL HasDifferentRTLLevels( const ContentNode* pNode ); - void SetTextRanger( TextRanger* pRanger ); - TextRanger* GetTextRanger() const { return pTextRanger; } + void SetTextRanger( TextRanger* pRanger ); + TextRanger* GetTextRanger() const { return pTextRanger; } - const Size& GetMinAutoPaperSize() const { return aMinAutoPaperSize; } - void SetMinAutoPaperSize( const Size& rSz ) { aMinAutoPaperSize = rSz; } + const Size& GetMinAutoPaperSize() const { return aMinAutoPaperSize; } + void SetMinAutoPaperSize( const Size& rSz ) { aMinAutoPaperSize = rSz; } - const Size& GetMaxAutoPaperSize() const { return aMaxAutoPaperSize; } - void SetMaxAutoPaperSize( const Size& rSz ) { aMaxAutoPaperSize = rSz; } + const Size& GetMaxAutoPaperSize() const { return aMaxAutoPaperSize; } + void SetMaxAutoPaperSize( const Size& rSz ) { aMaxAutoPaperSize = rSz; } - void FormatDoc(); - void FormatFullDoc(); - void UpdateViews( EditView* pCurView = 0 ); - void Paint( ImpEditView* pView, const Rectangle& rRect, sal_Bool bUseVirtDev = sal_False ); - void Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aStartPos, sal_Bool bStripOnly = sal_False, short nOrientation = 0 ); + void FormatDoc(); + void FormatFullDoc(); + void UpdateViews( EditView* pCurView = 0 ); + void Paint( ImpEditView* pView, const Rectangle& rRect, sal_Bool bUseVirtDev = sal_False ); + void Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aStartPos, sal_Bool bStripOnly = sal_False, short nOrientation = 0 ); - sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent, EditView* pView ); - sal_Bool MouseButtonDown( const MouseEvent& rMouseEvent, EditView* pView ); - sal_Bool MouseMove( const MouseEvent& rMouseEvent, EditView* pView ); - void Command( const CommandEvent& rCEvt, EditView* pView ); + sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent, EditView* pView ); + sal_Bool MouseButtonDown( const MouseEvent& rMouseEvent, EditView* pView ); + sal_Bool MouseMove( const MouseEvent& rMouseEvent, EditView* pView ); + void Command( const CommandEvent& rCEvt, EditView* pView ); - EditSelectionEngine& GetSelEngine() { return aSelEngine; } - XubString GetSelected( const EditSelection& rSel, const LineEnd eParaSep = LINEEND_LF ) const; + EditSelectionEngine& GetSelEngine() { return aSelEngine; } + XubString GetSelected( const EditSelection& rSel, const LineEnd eParaSep = LINEEND_LF ) const; - const SfxItemSet& GetEmptyItemSet(); + const SfxItemSet& GetEmptyItemSet(); - void UpdateSelections(); + void UpdateSelections(); - void EnableUndo( sal_Bool bEnable ); - sal_Bool IsUndoEnabled() { return bUndoEnabled; } - void SetUndoMode( sal_Bool b ) { bIsInUndo = b; } - sal_Bool IsInUndo() { return bIsInUndo; } + void EnableUndo( sal_Bool bEnable ); + sal_Bool IsUndoEnabled() { return bUndoEnabled; } + void SetUndoMode( sal_Bool b ) { bIsInUndo = b; } + sal_Bool IsInUndo() { return bIsInUndo; } - void SetCallParaInsertedOrDeleted( sal_Bool b ) { bCallParaInsertedOrDeleted = b; } - sal_Bool IsCallParaInsertedOrDeleted() const { return bCallParaInsertedOrDeleted; } + void SetCallParaInsertedOrDeleted( sal_Bool b ) { bCallParaInsertedOrDeleted = b; } + sal_Bool IsCallParaInsertedOrDeleted() const { return bCallParaInsertedOrDeleted; } - sal_Bool IsFormatted() const { return bFormatted; } - sal_Bool IsFormatting() const { return bIsFormatting; } + sal_Bool IsFormatted() const { return bFormatted; } + sal_Bool IsFormatting() const { return bIsFormatting; } - void SetText( const String& rText ); - EditPaM DeleteSelected( EditSelection aEditSelection); + void SetText( const String& rText ); + EditPaM DeleteSelected( EditSelection aEditSelection); EditPaM InsertText( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite, sal_Bool bIsUserInput = sal_False ); - EditPaM InsertText( EditSelection aCurEditSelection, const String& rStr ); - EditPaM AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, bool bOverwrite, Window* pFrameWin = NULL ); - EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, BYTE nMode, BYTE nDelMode = DELMODE_SIMPLE ); - EditPaM InsertParaBreak( EditSelection aEditSelection ); - EditPaM InsertLineBreak( EditSelection aEditSelection ); - EditPaM InsertTab( EditSelection aEditSelection ); - EditPaM InsertField( EditSelection aEditSelection, const SvxFieldItem& rFld ); - sal_Bool UpdateFields(); + EditPaM InsertText( EditSelection aCurEditSelection, const String& rStr ); + EditPaM AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, bool bOverwrite, Window* pFrameWin = NULL ); + EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, BYTE nMode, BYTE nDelMode = DELMODE_SIMPLE ); + EditPaM InsertParaBreak( EditSelection aEditSelection ); + EditPaM InsertLineBreak( EditSelection aEditSelection ); + EditPaM InsertTab( EditSelection aEditSelection ); + EditPaM InsertField( EditSelection aEditSelection, const SvxFieldItem& rFld ); + sal_Bool UpdateFields(); EditPaM Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, EditSelection aSel, SvKeyValueIterator* pHTTPHeaderAttrs = NULL ); - void Write( SvStream& rOutput, EETextFormat eFormat, EditSelection aSel ); + void Write( SvStream& rOutput, EETextFormat eFormat, EditSelection aSel ); - EditTextObject* CreateTextObject(); - EditTextObject* CreateTextObject( EditSelection aSel ); - void SetText( const EditTextObject& rTextObject ); - EditSelection InsertText( const EditTextObject& rTextObject, EditSelection aSel ); + EditTextObject* CreateTextObject(); + EditTextObject* CreateTextObject( EditSelection aSel ); + void SetText( const EditTextObject& rTextObject ); + EditSelection InsertText( const EditTextObject& rTextObject, EditSelection aSel ); - EditSelection MoveCursor( const KeyEvent& rKeyEvent, EditView* pEditView ); + EditSelection MoveCursor( const KeyEvent& rKeyEvent, EditView* pEditView ); - EditSelection MoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos, EditView* pCurView ); + EditSelection MoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos, EditView* pCurView ); - sal_uInt32 CalcTextHeight(); - sal_uInt32 GetTextHeight() const; - sal_uInt32 CalcTextWidth( BOOL bIgnoreExtraSpace ); - sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace ); - sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const; + sal_uInt32 CalcTextHeight(); + sal_uInt32 GetTextHeight() const; + sal_uInt32 CalcTextWidth( BOOL bIgnoreExtraSpace ); + sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace ); + sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const; sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const; void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const; USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; - sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ); - sal_uInt32 GetParaHeight( sal_uInt16 nParagraph ); + sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ); + sal_uInt32 GetParaHeight( sal_uInt16 nParagraph ); SfxItemSet GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, sal_uInt8 nFlags = 0xFF ) const; - SfxItemSet GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib = FALSE ); - void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE nSpecial = 0 ); - void RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich = 0 ); - void RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0, sal_Bool bRemoveFeatures = sal_False ); - void SetFlatMode( sal_Bool bFlat ); + SfxItemSet GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib = FALSE ); + void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE nSpecial = 0 ); + void RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich = 0 ); + void RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0, sal_Bool bRemoveFeatures = sal_False ); + void SetFlatMode( sal_Bool bFlat ); - void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); - const SfxItemSet& GetParaAttribs( sal_uInt16 nPara ) const; + void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); + const SfxItemSet& GetParaAttribs( sal_uInt16 nPara ) const; - sal_Bool HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const; - const SfxPoolItem& GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const; + sal_Bool HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const; + const SfxPoolItem& GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const; - Rectangle PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags = 0 ); - Rectangle GetEditCursor( ParaPortion* pPortion, sal_uInt16 nIndex, sal_uInt16 nFlags = 0 ); + Rectangle PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags = 0 ); + Rectangle GetEditCursor( ParaPortion* pPortion, sal_uInt16 nIndex, sal_uInt16 nFlags = 0 ); - sal_Bool IsModified() const { return aEditDoc.IsModified(); } - void SetModifyFlag( sal_Bool b ) { aEditDoc.SetModified( b ); } + sal_Bool IsModified() const { return aEditDoc.IsModified(); } + void SetModifyFlag( sal_Bool b ) { aEditDoc.SetModified( b ); } void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; } Link GetModifyHdl() const { return aModifyHdl; } - sal_Bool IsInSelectionMode() { return bInSelection; } - void StopSelectionMode(); + sal_Bool IsInSelectionMode() { return bInSelection; } + void StopSelectionMode(); - void IndentBlock( EditView* pView, sal_Bool bRight ); + void IndentBlock( EditView* pView, sal_Bool bRight ); -// Fuer Undo/Redo - sal_Bool Undo( EditView* pView ); - sal_Bool Redo( EditView* pView ); - sal_Bool Repeat( EditView* pView ); +// Fuer Undo/Redo + sal_Bool Undo( EditView* pView ); + sal_Bool Redo( EditView* pView ); + sal_Bool Repeat( EditView* pView ); -// OV-Special - void InvalidateFromParagraph( sal_uInt16 nFirstInvPara ); - EditPaM InsertParagraph( sal_uInt16 nPara ); - EditSelection* SelectParagraph( sal_uInt16 nPara ); +// OV-Special + void InvalidateFromParagraph( sal_uInt16 nFirstInvPara ); + EditPaM InsertParagraph( sal_uInt16 nPara ); + EditSelection* SelectParagraph( sal_uInt16 nPara ); - void SetStatusEventHdl( const Link& rLink ) { aStatusHdlLink = rLink; } - Link GetStatusEventHdl() const { return aStatusHdlLink; } + void SetStatusEventHdl( const Link& rLink ) { aStatusHdlLink = rLink; } + Link GetStatusEventHdl() const { return aStatusHdlLink; } - void SetNotifyHdl( const Link& rLink ) { aNotifyHdl = rLink; } - Link GetNotifyHdl() const { return aNotifyHdl; } + void SetNotifyHdl( const Link& rLink ) { aNotifyHdl = rLink; } + Link GetNotifyHdl() const { return aNotifyHdl; } - void FormatAndUpdate( EditView* pCurView = 0 ); - inline void IdleFormatAndUpdate( EditView* pCurView = 0 ); + void FormatAndUpdate( EditView* pCurView = 0 ); + inline void IdleFormatAndUpdate( EditView* pCurView = 0 ); svtools::ColorConfig& GetColorConfig(); BOOL IsVisualCursorTravelingEnabled(); BOOL DoVisualCursorTraveling( const ContentNode* pNode ); - EditSelection ConvertSelection( sal_uInt16 nStartPara, sal_uInt16 nStartPos, sal_uInt16 nEndPara, sal_uInt16 nEndPos ) const; - inline EPaM CreateEPaM( const EditPaM& rPaM ); - inline EditPaM CreateEditPaM( const EPaM& rEPaM ); - inline ESelection CreateESel( const EditSelection& rSel ); - inline EditSelection CreateSel( const ESelection& rSel ); + EditSelection ConvertSelection( sal_uInt16 nStartPara, sal_uInt16 nStartPos, sal_uInt16 nEndPara, sal_uInt16 nEndPos ) const; + inline EPaM CreateEPaM( const EditPaM& rPaM ); + inline EditPaM CreateEditPaM( const EPaM& rEPaM ); + inline ESelection CreateESel( const EditSelection& rSel ); + inline EditSelection CreateSel( const ESelection& rSel ); - void SetStyleSheetPool( SfxStyleSheetPool* pSPool ); - SfxStyleSheetPool* GetStyleSheetPool() const { return pStylePool; } + void SetStyleSheetPool( SfxStyleSheetPool* pSPool ); + SfxStyleSheetPool* GetStyleSheetPool() const { return pStylePool; } - void SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle ); - void SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle ); - SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const; + void SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle ); + void SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle ); + SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const; - void UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle ); - void RemoveStyleFromParagraphs( SfxStyleSheet* pStyle ); + void UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle ); + void RemoveStyleFromParagraphs( SfxStyleSheet* pStyle ); - OutputDevice* GetRefDevice() const { return pRefDev; } - void SetRefDevice( OutputDevice* pRefDef ); + OutputDevice* GetRefDevice() const { return pRefDev; } + void SetRefDevice( OutputDevice* pRefDef ); - const MapMode& GetRefMapMode() { return pRefDev->GetMapMode(); } - void SetRefMapMode( const MapMode& rMapMode ); + const MapMode& GetRefMapMode() { return pRefDev->GetMapMode(); } + void SetRefMapMode( const MapMode& rMapMode ); - InternalEditStatus& GetStatus() { return aStatus; } - void CallStatusHdl(); - void DelayedCallStatusHdl() { aStatusTimer.Start(); } + InternalEditStatus& GetStatus() { return aStatus; } + void CallStatusHdl(); + void DelayedCallStatusHdl() { aStatusTimer.Start(); } void CallNotify( EENotify& rNotify ); void EnterBlockNotifications(); void LeaveBlockNotifications(); - EditSelection MatchGroup( const EditSelection& rSel ); + EditSelection MatchGroup( const EditSelection& rSel ); - void UndoActionStart( sal_uInt16 nId ); - void UndoActionStart( sal_uInt16 nId, const ESelection& rSel ); - void UndoActionEnd( sal_uInt16 nId ); + void UndoActionStart( sal_uInt16 nId ); + void UndoActionStart( sal_uInt16 nId, const ESelection& rSel ); + void UndoActionEnd( sal_uInt16 nId ); - EditView* GetActiveView() const { return pActiveView; } - void SetActiveView( EditView* pView ); + EditView* GetActiveView() const { return pActiveView; } + void SetActiveView( EditView* pView ); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > GetSpeller(); - void SetSpeller( ::com::sun::star::uno::Reference< + void SetSpeller( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xSpl ) { xSpeller = xSpl; } ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > GetHyphenator() const { return xHyphenator; } - void SetHyphenator( ::com::sun::star::uno::Reference< + void SetHyphenator( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > &xHyph ) { xHyphenator = xHyph; } - SpellInfo* GetSpellInfo() const { return pSpellInfo; } + SpellInfo* GetSpellInfo() const { return pSpellInfo; } - void SetDefaultLanguage( LanguageType eLang ) { eDefLanguage = eLang; } - LanguageType GetDefaultLanguage() const { return eDefLanguage; } + void SetDefaultLanguage( LanguageType eLang ) { eDefLanguage = eLang; } + LanguageType GetDefaultLanguage() const { return eDefLanguage; } LanguageType GetLanguage( const EditSelection rSelection ) const; - LanguageType GetLanguage( const EditPaM& rPaM, USHORT* pEndPos = NULL ) const; + LanguageType GetLanguage( const EditPaM& rPaM, USHORT* pEndPos = NULL ) const; ::com::sun::star::lang::Locale GetLocale( const EditPaM& rPaM ) const; - void DoOnlineSpelling( ContentNode* pThisNodeOnly = 0, sal_Bool bSpellAtCursorPos = sal_False, sal_Bool bInteruptable = sal_True ); - EESpellState Spell( EditView* pEditView, sal_Bool bMultipleDoc ); - EESpellState HasSpellErrors(); - EESpellState StartThesaurus( EditView* pEditView ); + void DoOnlineSpelling( ContentNode* pThisNodeOnly = 0, sal_Bool bSpellAtCursorPos = sal_False, sal_Bool bInteruptable = sal_True ); + EESpellState Spell( EditView* pEditView, sal_Bool bMultipleDoc ); + EESpellState HasSpellErrors(); + EESpellState StartThesaurus( EditView* pEditView ); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives > ImpSpell( EditView* pEditView ); @@ -979,37 +979,37 @@ public: bool bIsField ); sal_Bool Search( const SvxSearchItem& rSearchItem, EditView* pView ); - sal_Bool ImpSearch( const SvxSearchItem& rSearchItem, const EditSelection& rSearchSelection, const EditPaM& rStartPos, EditSelection& rFoundSel ); - sal_uInt16 StartSearchAndReplace( EditView* pEditView, const SvxSearchItem& rSearchItem ); - sal_Bool HasText( const SvxSearchItem& rSearchItem ); + sal_Bool ImpSearch( const SvxSearchItem& rSearchItem, const EditSelection& rSearchSelection, const EditPaM& rStartPos, EditSelection& rFoundSel ); + sal_uInt16 StartSearchAndReplace( EditView* pEditView, const SvxSearchItem& rSearchItem ); + sal_Bool HasText( const SvxSearchItem& rSearchItem ); - void SetEditTextObjectPool( SfxItemPool* pP ) { pTextObjectPool = pP; } - SfxItemPool* GetEditTextObjectPool() const { return pTextObjectPool; } + void SetEditTextObjectPool( SfxItemPool* pP ) { pTextObjectPool = pP; } + SfxItemPool* GetEditTextObjectPool() const { return pTextObjectPool; } const SvxNumberFormat * GetNumberFormat( const ContentNode* pNode ) const; sal_Int32 GetSpaceBeforeAndMinLabelWidth( const ContentNode *pNode, sal_Int32 *pnSpaceBefore = 0, sal_Int32 *pnMinLabelWidth = 0 ) const; - const SvxLRSpaceItem& GetLRSpaceItem( ContentNode* pNode ); + const SvxLRSpaceItem& GetLRSpaceItem( ContentNode* pNode ); SvxAdjust GetJustification( USHORT nPara ) const; SvxCellJustifyMethod GetJustifyMethod( USHORT nPara ) const; SvxCellVerJustify GetVerJustification( USHORT nPara ) const; - void SetCharStretching( sal_uInt16 nX, sal_uInt16 nY ); - inline void GetCharStretching( sal_uInt16& rX, sal_uInt16& rY ); - void DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ); + void SetCharStretching( sal_uInt16 nX, sal_uInt16 nY ); + inline void GetCharStretching( sal_uInt16& rX, sal_uInt16& rY ); + void DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ); - void SetBigTextObjectStart( sal_uInt16 nStartAtPortionCount ) { nBigTextObjectStart = nStartAtPortionCount; } - sal_uInt16 GetBigTextObjectStart() const { return nBigTextObjectStart; } + void SetBigTextObjectStart( sal_uInt16 nStartAtPortionCount ) { nBigTextObjectStart = nStartAtPortionCount; } + sal_uInt16 GetBigTextObjectStart() const { return nBigTextObjectStart; } - inline EditEngine* GetEditEnginePtr() const { return pEditEngine; } + inline EditEngine* GetEditEnginePtr() const { return pEditEngine; } - void StartOnlineSpellTimer() { aOnlineSpellTimer.Start(); } - void StopOnlineSpellTimer() { aOnlineSpellTimer.Stop(); } + void StartOnlineSpellTimer() { aOnlineSpellTimer.Start(); } + void StopOnlineSpellTimer() { aOnlineSpellTimer.Stop(); } - const XubString& GetAutoCompleteText() const { return aAutoCompleteText; } - void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow ); + const XubString& GetAutoCompleteText() const { return aAutoCompleteText; } + void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow ); - EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ); + EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ); short ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets ); @@ -1017,23 +1017,23 @@ public: USHORT GetAsianCompressionMode() const { return nAsianCompressionMode; } void SetKernAsianPunctuation( BOOL b ); - BOOL IsKernAsianPunctuation() const { return bKernAsianPunctuation; } + BOOL IsKernAsianPunctuation() const { return bKernAsianPunctuation; } void SetAddExtLeading( BOOL b ); BOOL IsAddExtLeading() const { return bAddExtLeading; } - rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable( BOOL bGetInternal = TRUE ) const; - void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars ); + rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable( BOOL bGetInternal = TRUE ) const; + void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars ); - BOOL mbLastTryMerge; + BOOL mbLastTryMerge; /** sets a link that is called at the beginning of a drag operation at an edit view */ - void SetBeginDropHdl( const Link& rLink ) { maBeginDropHdl = rLink; } - Link GetBeginDropHdl() const { return maBeginDropHdl; } + void SetBeginDropHdl( const Link& rLink ) { maBeginDropHdl = rLink; } + Link GetBeginDropHdl() const { return maBeginDropHdl; } /** sets a link that is called at the end of a drag operation at an edit view */ - void SetEndDropHdl( const Link& rLink ) { maEndDropHdl = rLink; } - Link GetEndDropHdl() const { return maEndDropHdl; } + void SetEndDropHdl( const Link& rLink ) { maEndDropHdl = rLink; } + Link GetEndDropHdl() const { return maEndDropHdl; } /// specifies if auto-correction should capitalize the first word or not (default is on) void SetFirstWordCapitalization( BOOL bCapitalize ) { bFirstWordCapitalization = bCapitalize; } @@ -1109,7 +1109,7 @@ inline void ImpEditEngine::IdleFormatAndUpdate( EditView* pCurView ) } #ifndef SVX_LIGHT -inline EditUndoManager& ImpEditEngine::GetUndoManager() +inline EditUndoManager& ImpEditEngine::GetUndoManager() { if ( !pUndoManager ) pUndoManager = new EditUndoManager( this ); @@ -1117,14 +1117,14 @@ inline EditUndoManager& ImpEditEngine::GetUndoManager() } #endif -inline ParaPortion* ImpEditEngine::FindParaPortion( ContentNode* pNode ) const +inline ParaPortion* ImpEditEngine::FindParaPortion( ContentNode* pNode ) const { sal_uInt16 nPos = aEditDoc.GetPos( pNode ); DBG_ASSERT( nPos < GetParaPortions().Count(), "Portionloser Node?" ); return GetParaPortions()[ nPos ]; } -inline void ImpEditEngine::GetCharStretching( sal_uInt16& rX, sal_uInt16& rY ) +inline void ImpEditEngine::GetCharStretching( sal_uInt16& rX, sal_uInt16& rY ) { rX = nStretchX; rY = nStretchY; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 57d087766371..d610c68dcb54 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -87,7 +87,7 @@ USHORT lcl_CalcExtraSpace( ParaPortion*, const SvxLineSpacingItem& rLSItem ) ULONG nH = pPortion->GetLines().GetObject( 0 )->GetHeight(); long n = nH * rLSItem.GetPropLineSpace(); n /= 100; - n -= nH; // nur den Abstand + n -= nH; // nur den Abstand if ( n > 0 ) nExtra = (USHORT)n; } @@ -101,8 +101,8 @@ USHORT lcl_CalcExtraSpace( ParaPortion*, const SvxLineSpacingItem& rLSItem ) } // ---------------------------------------------------------------------- -// class ImpEditEngine -// ---------------------------------------------------------------------- +// class ImpEditEngine +// ---------------------------------------------------------------------- ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : aPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ), @@ -112,46 +112,46 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : aWordDelimiters( RTL_CONSTASCII_USTRINGPARAM( " .,;:-'`'?!_=\"{}()[]\0xFF" ) ), aGroupChars( RTL_CONSTASCII_USTRINGPARAM( "{}()[]" ) ) { - pEditEngine = pEE; - pRefDev = NULL; - pVirtDev = NULL; - pEmptyItemSet = NULL; - pActiveView = NULL; - pSpellInfo = NULL; + pEditEngine = pEE; + pRefDev = NULL; + pVirtDev = NULL; + pEmptyItemSet = NULL; + pActiveView = NULL; + pSpellInfo = NULL; pConvInfo = NULL; - pTextObjectPool = NULL; - mpIMEInfos = NULL; - pStylePool = NULL; - pUndoManager = NULL; - pUndoMarkSelection = NULL; - pTextRanger = NULL; + pTextObjectPool = NULL; + mpIMEInfos = NULL; + pStylePool = NULL; + pUndoManager = NULL; + pUndoMarkSelection = NULL; + pTextRanger = NULL; pColorConfig = NULL; pCTLOptions = NULL; - nCurTextHeight = 0; + nCurTextHeight = 0; nBlockNotifications = 0; - nBigTextObjectStart = 20; - - nStretchX = 100; - nStretchY = 100; - - bInSelection = FALSE; - bOwnerOfRefDev = FALSE; - bDowning = FALSE; - bIsInUndo = FALSE; - bIsFormatting = FALSE; - bFormatted = FALSE; - bUpdate = TRUE; + nBigTextObjectStart = 20; + + nStretchX = 100; + nStretchY = 100; + + bInSelection = FALSE; + bOwnerOfRefDev = FALSE; + bDowning = FALSE; + bIsInUndo = FALSE; + bIsFormatting = FALSE; + bFormatted = FALSE; + bUpdate = TRUE; bUseAutoColor = TRUE; bForceAutoColor = FALSE; bAddExtLeading = FALSE; - bUndoEnabled = TRUE; + bUndoEnabled = TRUE; bCallParaInsertedOrDeleted = FALSE; bImpConvertFirstCall= FALSE; bFirstWordCapitalization = TRUE; - eDefLanguage = LANGUAGE_DONTKNOW; - maBackgroundColor = COL_AUTO; + eDefLanguage = LANGUAGE_DONTKNOW; + maBackgroundColor = COL_AUTO; nAsianCompressionMode = text::CharacterCompressionType::NONE; bKernAsianPunctuation = FALSE; @@ -159,7 +159,7 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : eDefaultHorizontalTextDirection = EE_HTEXTDIR_DEFAULT; - aStatus.GetControlWord() = EE_CNTRL_USECHARATTRIBS | EE_CNTRL_DOIDLEFORMAT | + aStatus.GetControlWord() = EE_CNTRL_USECHARATTRIBS | EE_CNTRL_DOIDLEFORMAT | EE_CNTRL_PASTESPECIAL | EE_CNTRL_UNDOATTRIBS | EE_CNTRL_ALLOWBIGOBJS | EE_CNTRL_RTFSTYLESHEETS | EE_CNTRL_FORMAT100; @@ -175,7 +175,7 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : aOnlineSpellTimer.SetTimeout( 100 ); aOnlineSpellTimer.SetTimeoutHdl( LINK( this, ImpEditEngine, OnlineSpellHdl ) ); - pRefDev = EE_DLL()->GetGlobalData()->GetStdRefDevice(); + pRefDev = EE_DLL()->GetGlobalData()->GetStdRefDevice(); // Ab hier wird schon auf Daten zugegriffen! SetRefDevice( pRefDev ); @@ -312,7 +312,7 @@ XubString ImpEditEngine::GetSelected( const EditSelection& rSel, const LineEnd e DBG_ASSERT( nStartNode <= nEndNode, "Selektion nicht sortiert ?" ); // ueber die Absaetze iterieren... - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node nicht gefunden: GetSelected" ); ContentNode* pNode = aEditDoc.GetObject( nNode ); @@ -700,8 +700,8 @@ BOOL ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) BOOL ImpEditEngine::MouseMove( const MouseEvent& rMEvt, EditView* pView ) { // MouseMove wird sofort nach ShowQuickHelp() gerufen! -// if ( GetAutoCompleteText().Len() ) -// SetAutoCompleteText( String(), TRUE ); +// if ( GetAutoCompleteText().Len() ) +// SetAutoCompleteText( String(), TRUE ); GetSelEngine().SetCurView( pView ); GetSelEngine().SelMouseMove( rMEvt ); return TRUE; @@ -779,7 +779,7 @@ void ImpEditEngine::SetText( const XubString& rText ) pView->GetWindow()->Invalidate( aTmpRec ); } } - if( !rText.Len() ) // sonst muss spaeter noch invalidiert werden, !bFormatted reicht. + if( !rText.Len() ) // sonst muss spaeter noch invalidiert werden, !bFormatted reicht. nCurTextHeight = 0; EnableUndo( bUndoCurrentlyEnabled ); #ifndef SVX_LIGHT @@ -801,9 +801,9 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet() return *pEmptyItemSet; } -// ---------------------------------------------------------------------- -// MISC -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// MISC +// ---------------------------------------------------------------------- void ImpEditEngine::CursorMoved( ContentNode* pPrevNode ) { // Leere Attribute loeschen, aber nur, wenn Absatz nicht leer! @@ -844,9 +844,9 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode* pNode ) CalcHeight( pNextPortion ); } -// ---------------------------------------------------------------------- -// Cursorbewegungen -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// Cursorbewegungen +// ---------------------------------------------------------------------- EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pEditView ) { @@ -888,21 +888,21 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE bool bKeyModifySelection = aTranslatedKeyEvent.GetKeyCode().IsShift(); switch ( nCode ) { - case KEY_UP: aPaM = CursorUp( aPaM, pEditView ); + case KEY_UP: aPaM = CursorUp( aPaM, pEditView ); break; - case KEY_DOWN: aPaM = CursorDown( aPaM, pEditView ); + case KEY_DOWN: aPaM = CursorDown( aPaM, pEditView ); break; - case KEY_LEFT: aPaM = bCtrl ? WordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? i18n::CharacterIteratorMode::SKIPCHARACTER : i18n::CharacterIteratorMode::SKIPCELL ); + case KEY_LEFT: aPaM = bCtrl ? WordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? i18n::CharacterIteratorMode::SKIPCHARACTER : i18n::CharacterIteratorMode::SKIPCELL ); break; - case KEY_RIGHT: aPaM = bCtrl ? WordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? i18n::CharacterIteratorMode::SKIPCHARACTER : i18n::CharacterIteratorMode::SKIPCELL ); + case KEY_RIGHT: aPaM = bCtrl ? WordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? i18n::CharacterIteratorMode::SKIPCHARACTER : i18n::CharacterIteratorMode::SKIPCELL ); break; - case KEY_HOME: aPaM = bCtrl ? CursorStartOfDoc() : CursorStartOfLine( aPaM ); + case KEY_HOME: aPaM = bCtrl ? CursorStartOfDoc() : CursorStartOfLine( aPaM ); break; - case KEY_END: aPaM = bCtrl ? CursorEndOfDoc() : CursorEndOfLine( aPaM ); + case KEY_END: aPaM = bCtrl ? CursorEndOfDoc() : CursorEndOfLine( aPaM ); break; - case KEY_PAGEUP: aPaM = bCtrl ? CursorStartOfDoc() : PageUp( aPaM, pEditView ); + case KEY_PAGEUP: aPaM = bCtrl ? CursorStartOfDoc() : PageUp( aPaM, pEditView ); break; - case KEY_PAGEDOWN: aPaM = bCtrl ? CursorEndOfDoc() : PageDown( aPaM, pEditView ); + case KEY_PAGEDOWN: aPaM = bCtrl ? CursorEndOfDoc() : PageDown( aPaM, pEditView ); break; case com::sun::star::awt::Key::MOVE_TO_BEGIN_OF_LINE: aPaM = CursorStartOfLine( aPaM ); @@ -1051,7 +1051,7 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& UBiDi* pBidi = ubidi_openSized( aLine.Len(), 0, &nError ); const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/; - ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW + ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW USHORT nVisPos = bStart ? 0 : aLine.Len()-1; USHORT nLogPos = (USHORT)ubidi_getLogicalIndex( pBidi, nVisPos, &nError ); @@ -1173,7 +1173,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM UBiDi* pBidi = ubidi_openSized( aLine.Len(), 0, &nError ); const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/; - ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW + ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW if ( !pEditView->IsInsertMode() ) { @@ -1349,7 +1349,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView* pView ) nX = pView->pImpEditView->nTravelXPos; EditPaM aNewPaM( rPaM ); - if ( nLine ) // gleicher Absatz + if ( nLine ) // gleicher Absatz { EditLine* pPrevLine = pPPortion->GetLines().GetObject(nLine-1); aNewPaM.SetIndex( GetChar( pPPortion, pPrevLine, nX ) ); @@ -1359,7 +1359,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView* pView ) if ( aNewPaM.GetIndex() && ( aNewPaM.GetIndex() == pLine->GetStart() ) ) aNewPaM = CursorLeft( aNewPaM ); } - else // vorheriger Absatz + else // vorheriger Absatz { ParaPortion* pPrevPortion = GetPrevVisPortion( pPPortion ); if ( pPrevPortion ) @@ -1401,7 +1401,7 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, EditView* pView ) if ( ( aNewPaM.GetIndex() == pNextLine->GetEnd() ) && ( aNewPaM.GetIndex() > pNextLine->GetStart() ) && ( aNewPaM.GetIndex() < pPPortion->GetNode()->Len() ) ) aNewPaM = CursorLeft( aNewPaM ); } - else // naechster Absatz + else // naechster Absatz { ParaPortion* pNextPortion = GetNextVisPortion( pPPortion ); if ( pNextPortion ) @@ -1445,7 +1445,7 @@ EditPaM ImpEditEngine::CursorEndOfLine( const EditPaM& rPaM ) aNewPaM.SetIndex( pLine->GetEnd() ); if ( pLine->GetEnd() > pLine->GetStart() ) { -// xub_Unicode cLastChar = aNewPaM.GetNode()->GetChar( aNewPaM.GetIndex()-1 ); +// xub_Unicode cLastChar = aNewPaM.GetNode()->GetChar( aNewPaM.GetIndex()-1 ); if ( aNewPaM.GetNode()->IsFeature( aNewPaM.GetIndex() - 1 ) ) { // Bei einem weichen Umbruch muss ich davor stehen! @@ -1723,7 +1723,7 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara ) ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; rTypes.Remove( 0, rTypes.Count() ); -// pParaPortion->aExtraCharInfos.Remove( 0, pParaPortion->aExtraCharInfos.Count() ); +// pParaPortion->aExtraCharInfos.Remove( 0, pParaPortion->aExtraCharInfos.Count() ); ContentNode* pNode = pParaPortion->GetNode(); if ( pNode->Len() ) @@ -2013,7 +2013,7 @@ void ImpEditEngine::InitWritingDirections( USHORT nPara ) UBiDi* pBidi = ubidi_openSized( aText.Len(), 0, &nError ); nError = U_ZERO_ERROR; - ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aText.GetBuffer()), aText.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW + ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aText.GetBuffer()), aText.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW nError = U_ZERO_ERROR; long nCount = ubidi_countRuns( pBidi, &nError ); @@ -2153,9 +2153,9 @@ SvxCellVerJustify ImpEditEngine::GetVerJustification( USHORT nPara ) const } -// ---------------------------------------------------------------------- -// Textaenderung -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// Textaenderung +// ---------------------------------------------------------------------- void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, USHORT nChars, EditUndoRemoveChars* pCurUndo ) { @@ -2167,7 +2167,7 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, USHORT nChars, EditUndo USHORT nStart = rPaM.GetIndex(); USHORT nEnd = nStart + nChars; CharAttribArray& rAttribs = rPaM.GetNode()->GetCharAttribs().GetAttribs(); -// USHORT nAttrs = rAttribs.Count(); +// USHORT nAttrs = rAttribs.Count(); for ( USHORT nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = rAttribs[nAttr]; @@ -2179,7 +2179,7 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, USHORT nChars, EditUndo EditUndoSetAttribs* pAttrUndo = CreateAttribUndo( aSel, GetEmptyItemSet() ); InsertUndo( pAttrUndo ); #endif - break; // for + break; // for } } if ( pCurUndo && ( CreateEditPaM( pCurUndo->GetEPaM() ) == rPaM ) ) @@ -2220,7 +2220,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew ParaPortion* pRecalc3 = NULL; ParaPortion* pRecalc4 = NULL; - if ( nNewPos == 0 ) // Move to Start + if ( nNewPos == 0 ) // Move to Start { pRecalc1 = GetParaPortions().GetObject( 0 ); pRecalc2 = GetParaPortions().GetObject( (USHORT)aOldPositions.Min() ); @@ -2232,7 +2232,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew pRecalc2 = GetParaPortions().GetObject( (USHORT)aOldPositions.Max() ); } - if ( aOldPositions.Min() == 0 ) // Move from Start + if ( aOldPositions.Min() == 0 ) // Move from Start { pRecalc3 = GetParaPortions().GetObject( 0 ); pRecalc4 = GetParaPortions().GetObject( @@ -2305,7 +2305,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew if ( pRecalc4 ) CalcHeight( pRecalc4 ); - aTmpPortionList.Remove( 0, aTmpPortionList.Count() ); // wichtig ! + aTmpPortionList.Remove( 0, aTmpPortionList.Count() ); // wichtig ! #ifdef EDITDEBUG GetParaPortions().DbgCheck(aEditDoc); @@ -2357,14 +2357,14 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR { xub_StrLen nEnd = pLeft->Len(); xub_StrLen nInv = nEnd ? nEnd-1 : nEnd; - pLeft->GetWrongList()->ClearWrongs( nInv, 0xFFFF, pLeft ); // Evtl. einen wegnehmen + pLeft->GetWrongList()->ClearWrongs( nInv, 0xFFFF, pLeft ); // Evtl. einen wegnehmen pLeft->GetWrongList()->MarkInvalid( nInv, nEnd+1 ); // Falschgeschriebene Woerter ruebernehmen: USHORT nRWrongs = pRight->GetWrongList()->Count(); for ( USHORT nW = 0; nW < nRWrongs; nW++ ) { WrongRange aWrong = pRight->GetWrongList()->GetObject( nW ); - if ( aWrong.nStart != 0 ) // Nicht ein anschliessender + if ( aWrong.nStart != 0 ) // Nicht ein anschliessender { aWrong.nStart = aWrong.nStart + nEnd; aWrong.nEnd = aWrong.nEnd + nEnd; @@ -2407,7 +2407,7 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, { DBG_ASSERT( !EditSelection( rSel ).DbgIsBuggy( aEditDoc ), "Index im Wald in DeleteLeftOrRight" ); - if ( rSel.HasRange() ) // dann nur Sel. loeschen + if ( rSel.HasRange() ) // dann nur Sel. loeschen return ImpDeleteSelection( rSel ); const EditPaM aCurPos( rSel.Max() ); @@ -2425,7 +2425,7 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, if ( aDelStart.GetIndex() == aCurPos.GetIndex() ) aDelStart = WordLeft( aCurPos ); } - else // DELMODE_RESTOFCONTENT + else // DELMODE_RESTOFCONTENT { aDelStart.SetIndex( 0 ); if ( aDelStart == aCurPos ) @@ -2461,7 +2461,7 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, } } } - else // DELMODE_RESTOFCONTENT + else // DELMODE_RESTOFCONTENT { aDelEnd.SetIndex( aCurPos.GetNode()->Len() ); if ( aDelEnd == aCurPos ) @@ -2498,7 +2498,7 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) EditPaM aEndPaM( aSel.Max() ); CursorMoved( aStartPaM.GetNode() ); // nur damit neu eingestellte Attribute verschwinden... - CursorMoved( aEndPaM.GetNode() ); // nur damit neu eingestellte Attribute verschwinden... + CursorMoved( aEndPaM.GetNode() ); // nur damit neu eingestellte Attribute verschwinden... DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index im Wald in ImpDeleteSelection" ); DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index im Wald in ImpDeleteSelection" ); @@ -2597,7 +2597,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, { EditSelection aSel( rCurSel ); #ifndef SVX_LIGHT - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect(); + SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect(); if ( pAutoCorrect ) { if ( aSel.HasRange() ) @@ -2612,7 +2612,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, ESelection aESel( CreateESel(aSel) ); EditSelection aFirstWordSel; EditSelection aSecondWordSel; - if (aESel.nEndPara == 0) // is this the first para? + if (aESel.nEndPara == 0) // is this the first para? { // select first word... // start by checking if para starts with word. @@ -2770,10 +2770,10 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS else aPaM = aCurSel.Max(); - EditPaM aCurPaM( aPaM ); // fuers Invalidieren + EditPaM aCurPaM( aPaM ); // fuers Invalidieren // get word boundaries in order to clear possible WrongList entries - // and invalidate all the necessary text (everything after and including the + // and invalidate all the necessary text (everything after and including the // start of the word) EditSelection aCurWord( SelectWord( aCurPaM, i18n::WordType::DICTIONARY_WORD ) ); @@ -2790,7 +2790,7 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS { USHORT nEnd = aText.Search( LINE_SEP, nStart ); if ( nEnd == STRING_NOTFOUND ) - nEnd = aText.Len(); // nicht dereferenzieren! + nEnd = aText.Len(); // nicht dereferenzieren! // Start == End => Leerzeile if ( nEnd > nStart ) @@ -2800,7 +2800,7 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS if ( nChars > MAXCHARSINPARA ) { USHORT nMaxNewChars = MAXCHARSINPARA-aPaM.GetNode()->Len(); - nEnd -= ( aLine.Len() - nMaxNewChars ); // Dann landen die Zeichen im naechsten Absatz. + nEnd -= ( aLine.Len() - nMaxNewChars ); // Dann landen die Zeichen im naechsten Absatz. aLine.Erase( nMaxNewChars ); // Del Rest... } #ifndef SVX_LIGHT @@ -2817,7 +2817,7 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS { USHORT nEnd2 = aLine.Search( '\t', nStart2 ); if ( nEnd2 == STRING_NOTFOUND ) - nEnd2 = aLine.Len(); // nicht dereferenzieren! + nEnd2 = aLine.Len(); // nicht dereferenzieren! if ( nEnd2 > nStart2 ) aPaM = aEditDoc.InsertText( aPaM, XubString( aLine, nStart2, nEnd2-nStart2 ) ); @@ -2956,7 +2956,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding else pLWrongs->SetValid(); pRWrongs->SetValid(); // sonst 0 - 0xFFFF - pRWrongs->MarkInvalid( 0, 1 ); // Nur das erste Wort testen + pRWrongs->MarkInvalid( 0, 1 ); // Nur das erste Wort testen } #endif // !SVX_LIGHT @@ -2974,7 +2974,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphInserted( nPos+1 ); - CursorMoved( rPaM.GetNode() ); // falls leeres Attribut entstanden. + CursorMoved( rPaM.GetNode() ); // falls leeres Attribut entstanden. TextModified(); return aPaM; } @@ -3058,7 +3058,7 @@ BOOL ImpEditEngine::UpdateFields() ContentNode* pNode = GetEditDoc().GetObject( nPara ); DBG_ASSERT( pNode, "NULL-Pointer im Doc" ); CharAttribArray& rAttribs = pNode->GetCharAttribs().GetAttribs(); -// USHORT nAttrs = rAttribs.Count(); +// USHORT nAttrs = rAttribs.Count(); for ( USHORT nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = rAttribs[nAttr]; @@ -3101,9 +3101,9 @@ EditPaM ImpEditEngine::InsertLineBreak( EditSelection aCurSel ) return aPaM; } -// ---------------------------------------------------------------------- -// Hilfsfunktionen -// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// Hilfsfunktionen +// ---------------------------------------------------------------------- Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, USHORT nFlags ) { DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: PaMtoEditCursor" ); @@ -3142,7 +3142,7 @@ EditPaM ImpEditEngine::GetPaM( Point aDocPos, BOOL bSmart ) for ( nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) { ParaPortion* pPortion = GetParaPortions().GetObject(nPortion); - nTmpHeight = pPortion->GetHeight(); // sollte auch bei !bVisible richtig sein! + nTmpHeight = pPortion->GetHeight(); // sollte auch bei !bVisible richtig sein! nY += nTmpHeight; if ( nY > aDocPos.Y() ) { @@ -3194,8 +3194,8 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) // Ueber alle Absaetze... // -------------------------------------------------- USHORT nParas = GetParaPortions().Count(); -// USHORT nBiggestPara = 0; -// USHORT nBiggestLine = 0; +// USHORT nBiggestPara = 0; +// USHORT nBiggestLine = 0; for ( USHORT nPara = 0; nPara < nParas; nPara++ ) { ParaPortion* pPortion = GetParaPortions().GetObject( nPara ); @@ -3224,7 +3224,7 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) nCurWidth -= nFI; if ( pPortion->GetBulletX() > nCurWidth ) { - nCurWidth += nFI; // LI? + nCurWidth += nFI; // LI? if ( pPortion->GetBulletX() > nCurWidth ) nCurWidth = pPortion->GetBulletX(); } @@ -3345,7 +3345,7 @@ void ImpEditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEn rStart = pLine->GetStart(); rEnd = pLine->GetEnd(); } -} +} USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const { @@ -3369,11 +3369,11 @@ USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const if (nStart <= nIndex && nIndex < nEnd) nLineNo = i; } - } + } } return nLineNo; } - + USHORT ImpEditEngine::GetLineHeight( USHORT nParagraph, USHORT nLine ) { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); @@ -3447,7 +3447,7 @@ void ImpEditEngine::UpdateSelections() EditSelection aTmpSelection( EditPaM( pParaPortion->GetNode(), 0 ) ); pView->pImpEditView->SetEditSelection( aTmpSelection ); bChanged=TRUE; - break; // for-Schleife + break; // for-Schleife } } if ( !bChanged ) @@ -3516,7 +3516,7 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) EditSelection aMatchSel; EditSelection aTmpSel( rSel ); aTmpSel.Adjust( GetEditDoc() ); - if ( ( aTmpSel.Min().GetNode() != aTmpSel.Max().GetNode() ) || + if ( ( aTmpSel.Min().GetNode() != aTmpSel.Max().GetNode() ) || ( ( aTmpSel.Max().GetIndex() - aTmpSel.Min().GetIndex() ) > 1 ) ) { return aMatchSel; @@ -3551,7 +3551,7 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) { nLevel--; if ( !nLevel ) - break; // while nCur... + break; // while nCur... } nCur++; } @@ -3563,7 +3563,7 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) nCur = 0; } } - if ( nLevel == 0 ) // gefunden + if ( nLevel == 0 ) // gefunden { aMatchSel.Min() = aTmpSel.Min(); aMatchSel.Max() = EditPaM( pNode, nCur+1 ); @@ -3588,7 +3588,7 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) { nLevel--; if ( !nLevel ) - break; // while nCur... + break; // while nCur... } else if ( rStr.GetChar( nCur ) == nEC ) nLevel++; @@ -3601,14 +3601,14 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) { pNode = nNode ? aEditDoc.GetObject( --nNode ) : 0; if ( pNode ) - nCur = pNode->Len()-1; // egal ob negativ, weil if Len() + nCur = pNode->Len()-1; // egal ob negativ, weil if Len() } } - if ( nLevel == 0 ) // gefunden + if ( nLevel == 0 ) // gefunden { aMatchSel.Min() = aTmpSel.Min(); - aMatchSel.Min().GetIndex()++; // hinter das Zeichen + aMatchSel.Min().GetIndex()++; // hinter das Zeichen aMatchSel.Max() = EditPaM( pNode, nCur ); } } @@ -3620,7 +3620,7 @@ void ImpEditEngine::StopSelectionMode() { if ( ( IsInSelectionMode() || aSelEngine.IsInSelection() ) && pActiveView ) { - pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... + pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... EditSelection aSel( pActiveView->pImpEditView->GetEditSelection() ); aSel.Min() = aSel.Max(); pActiveView->pImpEditView->SetEditSelection( aSel ); @@ -3639,20 +3639,20 @@ void ImpEditEngine::SetActiveView( EditView* pView ) return; if ( pActiveView && pActiveView->HasSelection() ) - pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... + pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... pActiveView = pView; if ( pActiveView && pActiveView->HasSelection() ) - pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... + pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... - // NN: Quick fix for #78668#: - // When editing of a cell in Calc is ended, the edit engine is not deleted, - // only the edit views are removed. If mpIMEInfos is still set in that case, - // mpIMEInfos->aPos points to an invalid selection. - // -> reset mpIMEInfos now - // (probably something like this is necessary whenever the content is modified - // from the outside) + // NN: Quick fix for #78668#: + // When editing of a cell in Calc is ended, the edit engine is not deleted, + // only the edit views are removed. If mpIMEInfos is still set in that case, + // mpIMEInfos->aPos points to an invalid selection. + // -> reset mpIMEInfos now + // (probably something like this is necessary whenever the content is modified + // from the outside) if ( !pView && mpIMEInfos ) { @@ -3672,7 +3672,7 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( xDataObj = pDataObj; XubString aText( GetSelected( aSelection ) ); - aText.ConvertLineEnd(); // Systemspezifisch + aText.ConvertLineEnd(); // Systemspezifisch pDataObj->GetString() = aText; SvxFontItem::EnableStoreUnicodeNames( TRUE ); @@ -3692,7 +3692,7 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( ( pAttr->GetStart() == aSelection.Min().GetIndex() ) && ( pAttr->Which() == EE_FEATURE_FIELD ) ) { - const SvxFieldItem* pField = (const SvxFieldItem*)pAttr->GetItem(); + const SvxFieldItem* pField = (const SvxFieldItem*)pAttr->GetItem(); const SvxFieldData* pFld = pField->GetField(); if ( pFld && pFld->ISA( SvxURLField ) ) { @@ -3833,7 +3833,7 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) nFirstInvalid = nLine; break; } - if ( nLine && !aStatus.IsOutliner() ) // nicht die erste Zeile + if ( nLine && !aStatus.IsOutliner() ) // nicht die erste Zeile aRange.Min() += nSBL; aRange.Min() += pL->GetHeight(); } @@ -3843,7 +3843,7 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) // Abgleichen und weiter... aRange.Max() = aRange.Min(); aRange.Max() += pPortion->GetFirstLineOffset(); - if ( nFirstInvalid != 0 ) // Nur wenn nicht die erste Zeile ungueltig + if ( nFirstInvalid != 0 ) // Nur wenn nicht die erste Zeile ungueltig aRange.Min() = aRange.Max(); USHORT nLastInvalid = pPortion->GetLines().Count()-1; @@ -3902,10 +3902,10 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, BOOL bSmart nY += pTmpLine->GetHeight(); if ( !aStatus.IsOutliner() ) nY += nSBL; - if ( nY > aDocPos.Y() ) // das war 'se + if ( nY > aDocPos.Y() ) // das war 'se { pLine = pTmpLine; - break; // richtige Y-Position intressiert nicht + break; // richtige Y-Position intressiert nicht } nCurIndex = nCurIndex + pTmpLine->GetLen(); @@ -4077,7 +4077,7 @@ long ImpEditEngine::GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLin case PORTIONKIND_TEXT: case PORTIONKIND_HYPHENATOR: case PORTIONKIND_TAB: -// case PORTIONKIND_EXTRASPACE: +// case PORTIONKIND_EXTRASPACE: { nX += pPortion->GetSize().Width(); } @@ -4321,7 +4321,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) if ( ( nPortion != (GetParaPortions().Count()-1) ) ) { - pPortion->nHeight += GetYValue( rULItem.GetLower() ); // nicht in letzter + pPortion->nHeight += GetYValue( rULItem.GetLower() ); // nicht in letzter } @@ -4393,7 +4393,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, USHORT nIndex, US /* GETCRSR_ENDOFLINE: Wenn hinter dem letzten Zeichen einer umgebrochenen Zeile, am Ende der Zeile bleiben, nicht am Anfang der naechsten. - Zweck: - END => wirklich hinter das letzte Zeichen + Zweck: - END => wirklich hinter das letzte Zeichen - Selektion.... */ @@ -4503,7 +4503,7 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, BOOL bRight ) if ( aESel.nEndPos == 0 ) { - aESel.nEndPara--; // dann diesen Absatz nicht... + aESel.nEndPara--; // dann diesen Absatz nicht... aNewSel.nEndPos = 0; } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 8894a2949d9e..0bfb819c4a50 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -92,23 +92,23 @@ using namespace ::com::sun::star::linguistic2; SV_DECL_VARARR_SORT( SortedPositions, sal_uInt32, 16, 8 ) SV_IMPL_VARARR_SORT( SortedPositions, sal_uInt32 ); -#define CH_HYPH '-' +#define CH_HYPH '-' -#define RESDIFF 10 +#define RESDIFF 10 -#define WRONG_SHOW_MIN 5 -#define WRONG_SHOW_SMALL 11 -#define WRONG_SHOW_MEDIUM 15 +#define WRONG_SHOW_MIN 5 +#define WRONG_SHOW_SMALL 11 +#define WRONG_SHOW_MEDIUM 15 struct TabInfo { - BOOL bValid; + BOOL bValid; - SvxTabStop aTabStop; - xub_StrLen nCharPos; - USHORT nTabPortion; - long nStartPosX; - long nTabPos; + SvxTabStop aTabStop; + xub_StrLen nCharPos; + USHORT nTabPortion; + long nStartPosX; + long nTabPos; TabInfo() { bValid = FALSE; } }; @@ -159,16 +159,16 @@ BYTE GetCharTypeForCompression( xub_Unicode cChar ) } } -void lcl_DrawRedLines( - OutputDevice* pOutDev, - long nFontHeight, - const Point& rPnt, - sal_uInt16 nIndex, - sal_uInt16 nMaxEnd, - const sal_Int32* pDXArray, - WrongList* pWrongs, - short nOrientation, - const Point& rOrigin, +void lcl_DrawRedLines( + OutputDevice* pOutDev, + long nFontHeight, + const Point& rPnt, + sal_uInt16 nIndex, + sal_uInt16 nMaxEnd, + const sal_Int32* pDXArray, + WrongList* pWrongs, + short nOrientation, + const Point& rOrigin, BOOL bVertical, BOOL bIsRightToLeft ) { @@ -192,7 +192,7 @@ void lcl_DrawRedLines( if ( nStart >= nMaxEnd ) break; - if ( nStart < nIndex ) // Wurde korrigiert + if ( nStart < nIndex ) // Wurde korrigiert nStart = nIndex; if ( nEnd > nMaxEnd ) nEnd = nMaxEnd; @@ -286,8 +286,8 @@ sal_Bool lcl_ConnectToPrev( xub_Unicode cCh, xub_Unicode cPrevCh ) // For Kashi // ---------------------------------------------------------------------- -// class ImpEditEngine -// ---------------------------------------------------------------------- +// class ImpEditEngine +// ---------------------------------------------------------------------- void ImpEditEngine::UpdateViews( EditView* pCurView ) { if ( !GetUpdateMode() || IsFormatting() || aInvalidRec.IsEmpty() ) @@ -344,7 +344,7 @@ IMPL_LINK_INLINE_START( ImpEditEngine, IdleFormatHdl, Timer *, EMPTYARG ) // #i97146# check if that view is still available // else probably the idle format timer fired while we're already // downing - EditView* pView = aIdleFormatter.GetView(); + EditView* pView = aIdleFormatter.GetView(); for( sal_uInt16 nView = 0; nView < aEditViews.Count(); nView++ ) { if( aEditViews[nView] == pView ) @@ -393,7 +393,7 @@ void ImpEditEngine::FormatDoc() // Hier schon, damit nicht jedesmal in CreateLines... sal_Bool bMapChanged = ImpCheckRefMapMode(); - aInvalidRec = Rectangle(); // leermachen + aInvalidRec = Rectangle(); // leermachen for ( sal_uInt16 nPara = 0; nPara < GetParaPortions().Count(); nPara++ ) { ParaPortion* pParaPortion = GetParaPortions().GetObject( nPara ); @@ -411,7 +411,7 @@ void ImpEditEngine::FormatDoc() // bei MustRepaint() sollte keine Formatierung noetig sein! // 23.1.95: Evtl. ist sie durch eine andere Aktion aber doch // ungueltig geworden! -// if ( pParaPortion->MustRepaint() || CreateLines( nPara ) ) +// if ( pParaPortion->MustRepaint() || CreateLines( nPara ) ) if ( ( pParaPortion->MustRepaint() && !pParaPortion->IsInvalid() ) || CreateLines( nPara, nY ) ) { @@ -455,7 +455,7 @@ void ImpEditEngine::FormatDoc() // Man kann auch durch UpdateMode An=>AUS=>AN in die Formatierung gelangen... // Optimierung erst nach Vobis-Auslieferung aktivieren... -// if ( !aInvalidRec.IsEmpty() ) +// if ( !aInvalidRec.IsEmpty() ) { sal_uInt32 nNewHeight = CalcTextHeight(); long nDiff = nNewHeight - nCurTextHeight; @@ -505,7 +505,7 @@ void ImpEditEngine::FormatDoc() if ( bMapChanged ) GetRefDevice()->Pop(); - CallStatusHdl(); // Falls Modified... + CallStatusHdl(); // Falls Modified... LeaveBlockNotifications(); } @@ -543,7 +543,7 @@ void ImpEditEngine::CheckAutoPageSize() if ( GetStatus().AutoPageHeight() ) aPaperSize.Height() = (long) !IsVertical() ? GetTextHeight() : CalcTextWidth( TRUE ); - SetValidPaperSize( aPaperSize ); //Min, Max beruecksichtigen + SetValidPaperSize( aPaperSize ); //Min, Max beruecksichtigen if ( aPaperSize != aPrevPaperSize ) { @@ -563,7 +563,7 @@ void ImpEditEngine::CheckAutoPageSize() if ( eJustification != SVX_ADJUST_LEFT ) { pParaPortion->MarkSelectionInvalid( 0, pNode->Len() ); - CreateLines( nPara, 0 ); // 0: Bei AutoPageSize kein TextRange! + CreateLines( nPara, 0 ); // 0: Bei AutoPageSize kein TextRange! } } } @@ -593,7 +593,7 @@ void ImpEditEngine::CheckAutoPageSize() static sal_Int32 ImplCalculateFontIndependentLineSpacing( const sal_Int32 nFontHeight ) { - return ( nFontHeight * 12 ) / 10; // + 20% + return ( nFontHeight * 12 ) / 10; // + 20% } sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) @@ -651,9 +651,9 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&) pNode->GetContentAttribs().GetItem( EE_PARA_SBL ); const BOOL bScriptSpace = ((const SvxScriptSpaceItem&) pNode->GetContentAttribs().GetItem( EE_PARA_ASIANCJKSPACING )).GetValue(); -// const sal_uInt16 nInvalidEnd = ( pParaPortion->GetInvalidDiff() > 0 ) -// ? pParaPortion->GetInvalidPosStart() + pParaPortion->GetInvalidDiff() -// : pNode->Len(); +// const sal_uInt16 nInvalidEnd = ( pParaPortion->GetInvalidDiff() > 0 ) +// ? pParaPortion->GetInvalidPosStart() + pParaPortion->GetInvalidDiff() +// : pNode->Len(); const short nInvalidDiff = pParaPortion->GetInvalidDiff(); const sal_uInt16 nInvalidStart = pParaPortion->GetInvalidPosStart(); const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); @@ -669,7 +669,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) else if ( ( pParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) ) { // pruefen, ob loeschen ueber Portiongrenzen erfolgte... - sal_uInt16 nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!! + sal_uInt16 nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!! sal_uInt16 nEnd = nStart - nInvalidDiff; // neg. bQuickFormat = sal_True; sal_uInt16 nPos = 0; @@ -710,7 +710,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) // schnellere Methode: RecalcTextPortion( pParaPortion, nInvalidStart, nInvalidDiff ); } - else // nRealInvalidStart kann vor InvalidStart liegen, weil Portions geloescht.... + else // nRealInvalidStart kann vor InvalidStart liegen, weil Portions geloescht.... { CreateTextPortions( pParaPortion, nRealInvalidStart ); } @@ -725,7 +725,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) for ( sal_uInt16 nL = 0; nL <= nLine; nL++ ) { EditLine* pLine = pParaPortion->GetLines().GetObject( nL ); - if ( pLine->GetEnd() > nRealInvalidStart ) // nicht nInvalidStart! + if ( pLine->GetEnd() > nRealInvalidStart ) // nicht nInvalidStart! { nLine = nL; break; @@ -763,7 +763,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) sal_Bool bCalcCharPositions = sal_True; sal_Int32* pBuf = new sal_Int32[ pNode->Len() ]; - sal_Bool bSameLineAgain = sal_False; // Fuer TextRanger, wenn sich die Hoehe aendert. + sal_Bool bSameLineAgain = sal_False; // Fuer TextRanger, wenn sich die Hoehe aendert. TabInfo aCurrentTab; BOOL bForceOneRun = bEmptyNodeWithPolygon; @@ -786,8 +786,8 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( !nLine && ( pParaPortion->GetBulletX() > nStartX ) ) { -// TL_NFLR nStartX += nFI; // Vielleicht reicht der LI? -// TL_NFLR if ( pParaPortion->GetBulletX() > nStartX ) +// TL_NFLR nStartX += nFI; // Vielleicht reicht der LI? +// TL_NFLR if ( pParaPortion->GetBulletX() > nStartX ) nStartX = pParaPortion->GetBulletX(); } } @@ -823,7 +823,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) sal_uInt16 nTmpPortion = pLine->GetStartPortion(); long nTmpWidth = 0; long nXWidth = nMaxLineWidth; - if ( nXWidth <= nTmpWidth ) // while muss 1x durchlaufen werden + if ( nXWidth <= nTmpWidth ) // while muss 1x durchlaufen werden nXWidth = nTmpWidth+1; SvLongsPtr pTextRanges = 0; @@ -872,7 +872,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) // Den breitesten Bereich verwenden... // Der breiteste Bereich koennte etwas verwirren, also // generell den ersten. Am besten mal richtig mit Luecken. -// for ( sal_uInt16 n = 0; n < pTextRanges->Count(); ) +// for ( sal_uInt16 n = 0; n < pTextRanges->Count(); ) if ( pTextRanges->Count() ) { sal_uInt16 n = 0; @@ -897,7 +897,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( ( nTextY + nTextExtraYOffset ) > GetTextRanger()->GetBoundRect().Bottom() ) { nXWidth = !IsVertical() ? GetPaperSize().Width() : GetPaperSize().Height(); - if ( !nXWidth ) // AutoPaperSize + if ( !nXWidth ) // AutoPaperSize nXWidth = 0x7FFFFFFF; } } @@ -945,7 +945,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) // Tab-Pos suchen... long nCurPos = nTmpWidth+nStartX; -// nCurPos -= rLRItem.GetTxtLeft(); // Tabs relativ zu LI +// nCurPos -= rLRItem.GetTxtLeft(); // Tabs relativ zu LI // Skalierung rausrechnen if ( aStatus.DoStretch() && ( nStretchX != 100 ) ) nCurPos = nCurPos*100/nStretchX; @@ -1016,9 +1016,9 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) break; case EE_FEATURE_FIELD: { -// long nCurWidth = nTmpWidth; +// long nCurWidth = nTmpWidth; SeekCursor( pNode, nTmpPos+1, aTmpFont ); - sal_Unicode cChar = 0; // later: NBS? + sal_Unicode cChar = 0; // later: NBS? aTmpFont.SetPhysFont( GetRefDevice() ); ImplInitDigitMode( GetRefDevice(), 0, 0, 0, aTmpFont.GetLanguage() ); @@ -1047,7 +1047,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) bCompressedChars = FALSE; } break; - default: DBG_ERROR( "Was fuer ein Feature ?" ); + default: DBG_ERROR( "Was fuer ein Feature ?" ); } pNextFeature = pNode->GetCharAttribs().FindFeature( pNextFeature->GetStart() + 1 ); } @@ -1113,10 +1113,10 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) TextPortion* pTP = pParaPortion->GetTextPortions().GetObject( n ); nWidthAfterTab += pTP->GetSize().Width(); } - long nW = nWidthAfterTab; // Length before tab position + long nW = nWidthAfterTab; // Length before tab position if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_RIGHT ) { -// nW = nWidthAfterTab; +// nW = nWidthAfterTab; } else if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_CENTER ) { @@ -1124,7 +1124,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } else if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL ) { -// nW = nWidthAfterTab; +// nW = nWidthAfterTab; String aText = GetSelected( EditSelection( EditPaM( pParaPortion->GetNode(), nTmpPos ), EditPaM( pParaPortion->GetNode(), nTmpPos + pPortion->GetLen() ) ) ); USHORT nDecPos = aText.Search( aCurrentTab.aTabStop.GetDecimal() ); @@ -1353,17 +1353,17 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) // #80582# - Bullet should not influence line height -// if ( !nLine ) -// { -// long nBulletHeight = aBulletArea.GetHeight(); -// if ( nBulletHeight > (long)pLine->GetHeight() ) -// { -// long nDiff = nBulletHeight - (long)pLine->GetHeight(); -// // nDiff auf oben und unten verteilen. -// pLine->SetMaxAscent( (sal_uInt16)(pLine->GetMaxAscent() + nDiff/2) ); -// pLine->SetHeight( (sal_uInt16)nBulletHeight ); -// } -// } +// if ( !nLine ) +// { +// long nBulletHeight = aBulletArea.GetHeight(); +// if ( nBulletHeight > (long)pLine->GetHeight() ) +// { +// long nDiff = nBulletHeight - (long)pLine->GetHeight(); +// // nDiff auf oben und unten verteilen. +// pLine->SetMaxAscent( (sal_uInt16)(pLine->GetMaxAscent() + nDiff/2) ); +// pLine->SetHeight( (sal_uInt16)nBulletHeight ); +// } +// } if ( ( !IsVertical() && aStatus.AutoPageWidth() ) || ( IsVertical() && aStatus.AutoPageHeight() ) ) @@ -1523,7 +1523,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( !bSameLineAgain ) { - nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende + nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende // weil nEnd hinter das letzte Zeichen zeigt! sal_uInt16 nEndPortion = pLine->GetEndPortion(); @@ -1565,7 +1565,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) pLine->SetEndPortion( nEndPortion+1 ); } } - } // while ( Index < Len ) + } // while ( Index < Len ) if ( nDelFromLine != 0xFFFF ) pParaPortion->GetLines().DeleteFromLine( nDelFromLine ); @@ -1716,8 +1716,8 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn DBG_ASSERT( pLastLine, "Weicher Umbruch, keine Zeile ?!" ); DBG_ASSERT( pLastLine->GetEnd() == pParaPortion->GetNode()->Len(), "Doch anders?" ); #endif -// pTmpLine->SetStart( pLastLine->GetEnd() ); -// pTmpLine->SetEnd( pLastLine->GetEnd() ); +// pTmpLine->SetStart( pLastLine->GetEnd() ); +// pTmpLine->SetEnd( pLastLine->GetEnd() ); sal_uInt16 nPos = (sal_uInt16) pParaPortion->GetTextPortions().Count() - 1 ; pTmpLine->SetStartPortion( nPos ); pTmpLine->SetEndPortion( nPos ); @@ -1726,12 +1726,12 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn sal_Bool ImpEditEngine::FinishCreateLines( ParaPortion* pParaPortion ) { -// CalcCharPositions( pParaPortion ); +// CalcCharPositions( pParaPortion ); pParaPortion->SetValid(); long nOldHeight = pParaPortion->GetHeight(); -// sal_uInt16 nPos = GetParaPortions().GetPos( pParaPortion ); -// DBG_ASSERT( nPos != USHRT_MAX, "FinishCreateLines: Portion nicht in Liste!" ); -// ParaPortion* pPrev = nPos ? GetParaPortions().GetObject( nPos-1 ) : 0; +// sal_uInt16 nPos = GetParaPortions().GetPos( pParaPortion ); +// DBG_ASSERT( nPos != USHRT_MAX, "FinishCreateLines: Portion nicht in Liste!" ); +// ParaPortion* pPrev = nPos ? GetParaPortions().GetObject( nPos-1 ) : 0; CalcHeight( pParaPortion ); DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "FinishCreateLines: Keine Text-Portion?" ); @@ -1813,7 +1813,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te nBreakPos = nMaxBreakPos; // BUG in I18N - the japanese dot is in the next line! - // !!! Testen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // !!! Testen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if ( (nBreakPos + ( aUserOptions.allowPunctuationOutsideMargin ? 0 : 1 ) ) <= nMaxBreakPos ) { sal_Unicode cFirstInNextLine = ( (nBreakPos+1) < pNode->Len() ) ? pNode->GetChar( nBreakPos ) : 0; @@ -1834,8 +1834,8 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te if ( !bHangingPunctuation && bCanHyphenate && GetHyphenator().is() ) { i18n::Boundary aBoundary = _xBI->getWordBoundary( *pNode, nBreakPos, GetLocale( EditPaM( pNode, nBreakPos ) ), ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True ); -// sal_uInt16 nWordStart = nBreakPos; -// sal_uInt16 nBreakPos_OLD = nBreakPos; +// sal_uInt16 nWordStart = nBreakPos; +// sal_uInt16 nBreakPos_OLD = nBreakPos; sal_uInt16 nWordStart = nBreakPos; sal_uInt16 nWordEnd = (USHORT) aBoundary.endPos; DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" ); @@ -1846,7 +1846,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te // #104415# May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD // DBG_ASSERT( nWordEnd >= nMaxBreakPos, "Hyph: Break?" ); String aWord( *pNode, nWordStart, nWordLen ); - sal_uInt16 nMinTrail = nWordEnd-nMaxBreakPos+1; //+1: Vor dem angeknacksten Buchstaben + sal_uInt16 nMinTrail = nWordEnd-nMaxBreakPos+1; //+1: Vor dem angeknacksten Buchstaben Reference< XHyphenatedWord > xHyphWord; if (xHyphenator.is()) xHyphWord = xHyphenator->hyphenate( aWord, aLocale, aWord.Len() - nMinTrail, Sequence< PropertyValue >() ); @@ -1928,7 +1928,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te nBreakPos = nMaxBreakPos; // MT: I18N nextCharacters !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if ( nBreakPos <= pLine->GetStart() ) - nBreakPos = pLine->GetStart() + 1; // Sonst Endlosschleife! + nBreakPos = pLine->GetStart() + 1; // Sonst Endlosschleife! } } @@ -1999,7 +1999,7 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, return ; const USHORT nFirstChar = pLine->GetStart(); - const USHORT nLastChar = pLine->GetEnd() -1; // Last zeigt dahinter + const USHORT nLastChar = pLine->GetEnd() -1; // Last zeigt dahinter ContentNode* pNode = pParaPortion->GetNode(); DBG_ASSERT( nLastChar < pNode->Len(), "AdjustBlocks: Out of range!" ); @@ -2249,11 +2249,11 @@ sal_uInt16 ImpEditEngine::SplitTextPortion( ParaPortion* pPortion, sal_uInt16 nP nTmpPos = nTmpPos + pTP->GetLen(); if ( nTmpPos >= nPos ) { - if ( nTmpPos == nPos ) // dann braucht nichts geteilt werden + if ( nTmpPos == nPos ) // dann braucht nichts geteilt werden { // Skip Portions with ExtraSpace -// while ( ( (nSplitPortion+1) < nPortions ) && (pPortion->GetTextPortions().GetObject(nSplitPortion+1)->GetKind() == PORTIONKIND_EXTRASPACE ) ) -// nSplitPortion++; +// while ( ( (nSplitPortion+1) < nPortions ) && (pPortion->GetTextPortions().GetObject(nSplitPortion+1)->GetKind() == PORTIONKIND_EXTRASPACE ) ) +// nSplitPortion++; return nSplitPortion; } @@ -2698,12 +2698,12 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF => Nicht das Kerning verdoppelt, also die Buchstaben weiter zusammenziehen --------------------------- - Kern StretchX =>Kern + Kern StretchX =>Kern --------------------------- - >0 <100 < (Proportional) - <0 <100 < (Proportional) - >0 >100 > (Proportional) - <0 >100 < (Der Betrag, also Antiprop) + >0 <100 < (Proportional) + <0 <100 < (Proportional) + >0 >100 > (Proportional) + <0 >100 < (Der Betrag, also Antiprop) */ if ( ( nKerning < 0 ) && ( nStretchX > 100 ) ) { @@ -2803,7 +2803,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics if ( IsFixedCellHeight() ) { -/* creating correct proportional ascent and descent values lead to problems if different fonts are used +/* creating correct proportional ascent and descent values lead to problems if different fonts are used in the same portion, it results in a bigger linespacing. sal_Int32 f = nAscent + nDescent; if ( f ) @@ -2833,11 +2833,11 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics // 4/96: Kommt bei HP Laserjet 4V auch nicht hin // => Werte komplett vom Bildschirm holen. - // sal_uInt16 nTmpLeading = (sal_uInt16)aMetric.GetLeading(); - // nAscent += nTmpLeading; + // sal_uInt16 nTmpLeading = (sal_uInt16)aMetric.GetLeading(); + // nAscent += nTmpLeading; nAscent = (sal_uInt16)aMetric.GetAscent(); nDescent = (sal_uInt16)aMetric.GetDescent(); - // nLeading = (sal_uInt16)aMetric.GetLeading(); + // nLeading = (sal_uInt16)aMetric.GetLeading(); } } if ( nAscent > rCurMetrics.nMaxAscent ) @@ -2856,7 +2856,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics if ( nAscent > rCurMetrics.nMaxAscent ) rCurMetrics.nMaxAscent = nAscent; } - else // muss < 0 sein + else // muss < 0 sein { nDescent = (sal_uInt16) (((long)nDescent)*nPropr/100 - nDiff); if ( nDescent > rCurMetrics.nMaxDescent ) @@ -2903,9 +2903,9 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta const bool bMetafileValid( pMtf != NULL ); // Fuer OnlineSpelling: -// EditPaM aCursorPos; -// if( GetStatus().DoOnlineSpelling() && pActiveView ) -// aCurPos = pActiveView->pImpEditView->GetEditSelections().Max(); +// EditPaM aCursorPos; +// if( GetStatus().DoOnlineSpelling() && pActiveView ) +// aCurPos = pActiveView->pImpEditView->GetEditSelections().Max(); long nVertLineSpacing = CalcVertLineSpacing(aStartPos); @@ -2997,23 +2997,23 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta { aTmpPos.X() = aStartPos.X() + nPortionXOffset; if ( aTmpPos.X() > aClipRec.Right() ) - break; // Keine weitere Ausgabe in Zeile noetig + break; // Keine weitere Ausgabe in Zeile noetig } else { aTmpPos.Y() = aStartPos.Y() + nPortionXOffset; if ( aTmpPos.Y() > aClipRec.Bottom() ) - break; // Keine weitere Ausgabe in Zeile noetig + break; // Keine weitere Ausgabe in Zeile noetig } // R2L replaces with obove... // New position after processing R2L text... // R2L if ( nR2LWidth && !pTextPortion->GetRightToLeft() ) // R2L { -// R2L if ( !IsVertical() ) -// R2L aTmpPos.X() += nR2LWidth; -// R2L else -// R2L aTmpPos.Y() += nR2LWidth; +// R2L if ( !IsVertical() ) +// R2L aTmpPos.X() += nR2LWidth; +// R2L else +// R2L aTmpPos.Y() += nR2LWidth; // R2L // R2L nR2LWidth = 0; // R2L } @@ -3228,12 +3228,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta //L2R sal_uInt16 nNextPortion = y+1; //L2R while ( nNextPortion <= pLine->GetEndPortion() ) //L2R { -//L2R TextPortion* pNextTextPortion = pPortion->GetTextPortions().GetObject( nNextPortion ); +//L2R TextPortion* pNextTextPortion = pPortion->GetTextPortions().GetObject( nNextPortion ); //L2R if ( pNextTextPortion->GetRightToLeft() ) //L2R { -//L2R if ( !IsVertical() ) +//L2R if ( !IsVertical() ) //L2R aOutPos.X() += pNextTextPortion->GetSize().Width(); -//L2R else +//L2R else //L2R aOutPos.Y() += pNextTextPortion->GetSize().Width(); //L2R } //L2R else @@ -3452,8 +3452,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta { Point aTopLeft( aTmpPos ); aTopLeft.Y() -= pLine->GetMaxAscent(); -// if ( nOrientation ) -// aTopLeft = lcl_ImplCalcRotatedPos( aTopLeft, aOrigin, nSin, nCos ); +// if ( nOrientation ) +// aTopLeft = lcl_ImplCalcRotatedPos( aTopLeft, aOrigin, nSin, nCos ); Rectangle aRect( aTopLeft, pTextPortion->GetSize() ); vcl::PDFExtOutDevBookmarkEntry aBookmark; @@ -3502,10 +3502,10 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta // R2L if ( !pTextPortion->GetRightToLeft() ) // R2L { -// R2L if ( !IsVertical() ) -// R2L aTmpPos.X() += nTxtWidth; -// R2L else -// R2L aTmpPos.Y() += nTxtWidth; +// R2L if ( !IsVertical() ) +// R2L aTmpPos.X() += nTxtWidth; +// R2L else +// R2L aTmpPos.Y() += nTxtWidth; // R2L } // R2L else // R2L { @@ -3535,7 +3535,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta } break; -// case PORTIONKIND_EXTRASPACE: +// case PORTIONKIND_EXTRASPACE: case PORTIONKIND_TAB: { if ( pTextPortion->GetExtraValue() && ( pTextPortion->GetExtraValue() != ' ' ) ) @@ -3549,9 +3549,9 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta if( nCharWidth ) nChars = pTextPortion->GetSize().Width() / nCharWidth; if ( nChars < 2 ) - nChars = 2; // wird durch DrawStretchText gestaucht. + nChars = 2; // wird durch DrawStretchText gestaucht. else if ( nChars == 2 ) - nChars = 3; // sieht besser aus + nChars = 3; // sieht besser aus String aText; aText.Fill( (USHORT)nChars, pTextPortion->GetExtraValue() ); @@ -3693,8 +3693,8 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b sal_Bool bVDevValid = sal_True; Size aOutSz( pVDev->GetOutputSizePixel() ); - if ( ( aOutSz.Width() < aClipRecPixel.GetWidth() ) || - ( aOutSz.Height() < aClipRecPixel.GetHeight() ) ) + if ( ( aOutSz.Width() < aClipRecPixel.GetWidth() ) || + ( aOutSz.Height() < aClipRecPixel.GetHeight() ) ) { bVDevValid = pVDev->SetOutputSizePixel( aClipRecPixel.GetSize() ); } @@ -3748,7 +3748,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b if ( GetTextRanger() ) { // Some problems here with push/pop, why?! -// pOutWin->Push( PUSH_CLIPREGION|PUSH_MAPMODE ); +// pOutWin->Push( PUSH_CLIPREGION|PUSH_MAPMODE ); bClipRegion = pOutWin->IsClipRegion(); aOldRegion = pOutWin->GetClipRegion(); // Wie bekomme ich das Polygon an die richtige Stelle???? @@ -3770,7 +3770,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b if ( GetTextRanger() ) { -// pOutWin->Pop(); +// pOutWin->Pop(); if ( bClipRegion ) pOutWin->SetClipRegion( aOldRegion ); else @@ -3864,14 +3864,14 @@ void ImpEditEngine::SetUpdateMode( sal_Bool bUp, EditView* pCurView, sal_Bool bF // => Wegmalen // Umgekehrt waren alle unsichtbar => malen -// DrawAllSelections(); sieht im Outliner schlecht aus ! -// EditView* pView = aEditViewList.First(); -// while ( pView ) -// { -// DBG_CHKOBJ( pView, EditView, 0 ); -// pView->pImpEditView->DrawSelection(); -// pView = aEditViewList.Next(); -// } +// DrawAllSelections(); sieht im Outliner schlecht aus ! +// EditView* pView = aEditViewList.First(); +// while ( pView ) +// { +// DBG_CHKOBJ( pView, EditView, 0 ); +// pView->pImpEditView->DrawSelection(); +// pView = aEditViewList.Next(); +// } // Wenn !bFormatted, also z.B. nach SetText, braucht bei UpdateMode sal_True // nicht sofort formatiert werden, weil warscheinlich noch Text kommt. @@ -3900,7 +3900,7 @@ void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow ) // Dann kriege ich den unteren Bereich nicht invalidiert, // wenn UpdateMode = sal_False! // Wenn doch, dann vor SetVisible auf sal_False merken! -// nCurTextHeight -= pPPortion->GetHeight(); +// nCurTextHeight -= pPPortion->GetHeight(); } if ( bShow && ( pPPortion->IsInvalid() || !pPPortion->nHeight ) ) @@ -3910,7 +3910,7 @@ void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow ) if ( pPPortion->IsInvalid() ) { Font aOldFont( GetRefDevice()->GetFont() ); - CreateLines( nParagraph, 0 ); // 0: Kein TextRanger + CreateLines( nParagraph, 0 ); // 0: Kein TextRanger if ( aStatus.DoRestoreFont() ) GetRefDevice()->SetFont( aOldFont ); } @@ -3929,7 +3929,7 @@ void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow ) pPPortion->SetMustRepaint( sal_True ); if ( GetUpdateMode() && !IsInUndo() && !GetTextRanger() ) { - aInvalidRec = Rectangle( Point( 0, GetParaPortions().GetYOffset( pPPortion ) ), + aInvalidRec = Rectangle( Point( 0, GetParaPortions().GetYOffset( pPPortion ) ), Point( GetPaperSize().Width(), nCurTextHeight ) ); UpdateViews( GetActiveView() ); } @@ -3970,7 +3970,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe ParaPortion* pUpperPortion = GetParaPortions().SaveGetObject( nFirstPortion ); ParaPortion* pLowerPortion = GetParaPortions().SaveGetObject( nLastPortion ); - aInvalidRec = Rectangle(); // leermachen + aInvalidRec = Rectangle(); // leermachen aInvalidRec.Left() = 0; aInvalidRec.Right() = aPaperSize.Width(); aInvalidRec.Top() = GetParaPortions().GetYOffset( pUpperPortion ); @@ -4022,7 +4022,7 @@ void ImpEditEngine::CallStatusHdl() EditStatus aTmpStatus( aStatus ); aStatus.Clear(); aStatusHdlLink.Call( &aTmpStatus ); - aStatusTimer.Stop(); // Falls von Hand gerufen... + aStatusTimer.Stop(); // Falls von Hand gerufen... } } @@ -4217,7 +4217,7 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) { // Fontbreite SvxCharScaleWidthItem* pNewWidth = (SvxCharScaleWidthItem*) pNode->GetContentAttribs().GetItem( EE_CHAR_FONTWIDTH ).Clone(); - sal_uInt32 nProp = pNewWidth->GetValue(); // sal_uInt32, kann temporaer gross werden + sal_uInt32 nProp = pNewWidth->GetValue(); // sal_uInt32, kann temporaer gross werden nProp *= nX; nProp /= 100; pNewWidth->SetValue( (sal_uInt16)nProp ); @@ -4291,7 +4291,7 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) SetParaAttribs( nPara, aTmpSet ); // harte Attribute: - sal_uInt16 nLastEnd = 0; // damit nach entfernen und neu nicht nochmal + sal_uInt16 nLastEnd = 0; // damit nach entfernen und neu nicht nochmal CharAttribArray& rAttribs = pNode->GetCharAttribs().GetAttribs(); sal_uInt16 nAttribs = rAttribs.Count(); for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) @@ -4446,7 +4446,7 @@ void ImpEditEngine::ImplInitDigitMode( OutputDevice* pOutDev, String* pString, x break; case LANGUAGE_URDU & LANGUAGE_MASK_PRIMARY: case LANGUAGE_PUNJABI & LANGUAGE_MASK_PRIMARY: //??? - case LANGUAGE_SINDHI & LANGUAGE_MASK_PRIMARY: + case LANGUAGE_SINDHI & LANGUAGE_MASK_PRIMARY: nOffset = 0x06F0 - '0'; // eastern arabic-indic digits break; } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index d4ba71348c4b..c56809c3801e 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -121,7 +121,7 @@ EditPaM ImpEditEngine::Read( SvStream& rInput, const String& rBaseURL, EETextFor DBG_ERROR( "Read: Unbekanntes Format" ); } - FormatFullDoc(); // reicht vielleicht auch ein einfaches Format? + FormatFullDoc(); // reicht vielleicht auch ein einfaches Format? SetUpdateMode( _bUpdate ); return aPaM; @@ -174,8 +174,8 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel ) if ( aSel.HasRange() ) aSel = ImpDeleteSelection( aSel ); -// sal_Bool bCharsBeforeInsertPos = ( aSel.Min().GetIndex() ) ? sal_True : sal_False; -// sal_Bool bCharsBehindInsertPos = ( aSel.Min().GetIndex() < aSel.Min().GetNode()->Len() ) ? sal_True : sal_False; +// sal_Bool bCharsBeforeInsertPos = ( aSel.Min().GetIndex() ) ? sal_True : sal_False; +// sal_Bool bCharsBehindInsertPos = ( aSel.Min().GetIndex() < aSel.Min().GetNode()->Len() ) ? sal_True : sal_False; // Der SvRTF-Parser erwartet, dass das Which-Mapping am uebergebenen Pool, // nicht an einem Secondary haengt. @@ -207,8 +207,8 @@ EditPaM ImpEditEngine::ReadHTML( SvStream& rInput, const String& rBaseURL, EditS if ( aSel.HasRange() ) aSel = ImpDeleteSelection( aSel ); -// sal_Bool bCharsBeforeInsertPos = ( aSel.Min().GetIndex() ) ? sal_True : sal_False; -// sal_Bool bCharsBehindInsertPos = ( aSel.Min().GetIndex() < aSel.Min().GetNode()->Len() ) ? sal_True : sal_False; +// sal_Bool bCharsBeforeInsertPos = ( aSel.Min().GetIndex() ) ? sal_True : sal_False; +// sal_Bool bCharsBehindInsertPos = ( aSel.Min().GetIndex() < aSel.Min().GetNode()->Len() ) ? sal_True : sal_False; EditHTMLParserRef xPrsr = new EditHTMLParser( rInput, rBaseURL, pHTTPHeaderAttrs ); SvParserState eState = xPrsr->CallParser( this, aSel.Max() ); @@ -426,17 +426,17 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput.WriteNumber( j ); switch ( pFontItem->GetFamily() ) { - case FAMILY_DONTKNOW: rOutput << OOO_STRING_SVTOOLS_RTF_FNIL; + case FAMILY_DONTKNOW: rOutput << OOO_STRING_SVTOOLS_RTF_FNIL; break; - case FAMILY_DECORATIVE: rOutput << OOO_STRING_SVTOOLS_RTF_FDECOR; + case FAMILY_DECORATIVE: rOutput << OOO_STRING_SVTOOLS_RTF_FDECOR; break; - case FAMILY_MODERN: rOutput << OOO_STRING_SVTOOLS_RTF_FMODERN; + case FAMILY_MODERN: rOutput << OOO_STRING_SVTOOLS_RTF_FMODERN; break; - case FAMILY_ROMAN: rOutput << OOO_STRING_SVTOOLS_RTF_FROMAN; + case FAMILY_ROMAN: rOutput << OOO_STRING_SVTOOLS_RTF_FROMAN; break; - case FAMILY_SCRIPT: rOutput << OOO_STRING_SVTOOLS_RTF_FSCRIPT; + case FAMILY_SCRIPT: rOutput << OOO_STRING_SVTOOLS_RTF_FSCRIPT; break; - case FAMILY_SWISS: rOutput << OOO_STRING_SVTOOLS_RTF_FSWISS; + case FAMILY_SWISS: rOutput << OOO_STRING_SVTOOLS_RTF_FSWISS; break; default: break; @@ -445,8 +445,8 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) sal_uInt16 nVal = 0; switch( pFontItem->GetPitch() ) { - case PITCH_FIXED: nVal = 1; break; - case PITCH_VARIABLE: nVal = 2; break; + case PITCH_FIXED: nVal = 1; break; + case PITCH_VARIABLE: nVal = 2; break; default: break; } @@ -612,7 +612,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) for ( sal_uInt16 nParAttr = EE_PARA_START; nParAttr <= EE_CHAR_END; nParAttr++ ) { -// const SfxPoolItem& rItem = pNode->GetContentAttribs().GetItem( nParAttr ); +// const SfxPoolItem& rItem = pNode->GetContentAttribs().GetItem( nParAttr ); // Jetzt, wo StyleSheet-Verarbeitung, nur noch harte Absatzattribute! if ( pNode->GetContentAttribs().GetItems().GetItemState( nParAttr ) == SFX_ITEM_ON ) { @@ -622,7 +622,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) } } if ( bAttr ) - rOutput << ' '; // Separator + rOutput << ' '; // Separator ItemList aAttribItems; ParaPortion* pParaPortion = FindParaPortion( pNode ); @@ -722,7 +722,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput << endl; } // RTF-Nachspann... - rOutput << "}}"; // 1xKlammerung Absaetze, 1x Klammerung RTF-Dokument + rOutput << "}}"; // 1xKlammerung Absaetze, 1x Klammerung RTF-Dokument rOutput.Flush(); #if defined (EDITDEBUG) && !defined( UNX ) @@ -821,11 +821,11 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, SvxAdjust eJustification = ((const SvxAdjustItem&)rItem).GetAdjust(); switch ( eJustification ) { - case SVX_ADJUST_CENTER: rOutput << OOO_STRING_SVTOOLS_RTF_QC; + case SVX_ADJUST_CENTER: rOutput << OOO_STRING_SVTOOLS_RTF_QC; break; - case SVX_ADJUST_RIGHT: rOutput << OOO_STRING_SVTOOLS_RTF_QR; + case SVX_ADJUST_RIGHT: rOutput << OOO_STRING_SVTOOLS_RTF_QR; break; - default: rOutput << OOO_STRING_SVTOOLS_RTF_QL; + default: rOutput << OOO_STRING_SVTOOLS_RTF_QL; break; } } @@ -876,8 +876,8 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, FontWeight e = ((const SvxWeightItem&)rItem).GetWeight(); switch ( e ) { - case WEIGHT_BOLD: rOutput << OOO_STRING_SVTOOLS_RTF_B; break; - default: rOutput << OOO_STRING_SVTOOLS_RTF_B << '0'; break; + case WEIGHT_BOLD: rOutput << OOO_STRING_SVTOOLS_RTF_B; break; + default: rOutput << OOO_STRING_SVTOOLS_RTF_B << '0'; break; } } break; @@ -888,10 +888,10 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, FontUnderline e = ((const SvxUnderlineItem&)rItem).GetLineStyle(); switch ( e ) { - case UNDERLINE_NONE: rOutput << OOO_STRING_SVTOOLS_RTF_ULNONE; break; - case UNDERLINE_SINGLE: rOutput << OOO_STRING_SVTOOLS_RTF_UL; break; - case UNDERLINE_DOUBLE: rOutput << OOO_STRING_SVTOOLS_RTF_ULDB; break; - case UNDERLINE_DOTTED: rOutput << OOO_STRING_SVTOOLS_RTF_ULD; break; + case UNDERLINE_NONE: rOutput << OOO_STRING_SVTOOLS_RTF_ULNONE; break; + case UNDERLINE_SINGLE: rOutput << OOO_STRING_SVTOOLS_RTF_UL; break; + case UNDERLINE_DOUBLE: rOutput << OOO_STRING_SVTOOLS_RTF_ULDB; break; + case UNDERLINE_DOTTED: rOutput << OOO_STRING_SVTOOLS_RTF_ULD; break; default: break; } @@ -902,10 +902,10 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, FontUnderline e = ((const SvxOverlineItem&)rItem).GetLineStyle(); switch ( e ) { - case UNDERLINE_NONE: rOutput << OOO_STRING_SVTOOLS_RTF_OLNONE; break; - case UNDERLINE_SINGLE: rOutput << OOO_STRING_SVTOOLS_RTF_OL; break; - case UNDERLINE_DOUBLE: rOutput << OOO_STRING_SVTOOLS_RTF_OLDB; break; - case UNDERLINE_DOTTED: rOutput << OOO_STRING_SVTOOLS_RTF_OLD; break; + case UNDERLINE_NONE: rOutput << OOO_STRING_SVTOOLS_RTF_OLNONE; break; + case UNDERLINE_SINGLE: rOutput << OOO_STRING_SVTOOLS_RTF_OL; break; + case UNDERLINE_DOUBLE: rOutput << OOO_STRING_SVTOOLS_RTF_OLDB; break; + case UNDERLINE_DOTTED: rOutput << OOO_STRING_SVTOOLS_RTF_OLD; break; default: break; } @@ -917,8 +917,8 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, switch ( e ) { case STRIKEOUT_SINGLE: - case STRIKEOUT_DOUBLE: rOutput << OOO_STRING_SVTOOLS_RTF_STRIKE; break; - case STRIKEOUT_NONE: rOutput << OOO_STRING_SVTOOLS_RTF_STRIKE << '0'; break; + case STRIKEOUT_DOUBLE: rOutput << OOO_STRING_SVTOOLS_RTF_STRIKE; break; + case STRIKEOUT_NONE: rOutput << OOO_STRING_SVTOOLS_RTF_STRIKE << '0'; break; default: break; } @@ -932,8 +932,8 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, switch ( e ) { case ITALIC_OBLIQUE: - case ITALIC_NORMAL: rOutput << OOO_STRING_SVTOOLS_RTF_I; break; - case ITALIC_NONE: rOutput << OOO_STRING_SVTOOLS_RTF_I << '0'; break; + case ITALIC_NORMAL: rOutput << OOO_STRING_SVTOOLS_RTF_I; break; + case ITALIC_NONE: rOutput << OOO_STRING_SVTOOLS_RTF_I << '0'; break; default: break; } @@ -1004,14 +1004,14 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, MapMode aPntMode( MAP_POINT ); long nFontHeight = GetRefDevice()->LogicToLogic( aFont.GetSize(), &GetRefMapMode(), &aPntMode ).Height(); - nFontHeight *=2; // HalfPoints + nFontHeight *=2; // HalfPoints sal_uInt16 nProp = ((const SvxEscapementItem&)rItem).GetProp(); - sal_uInt16 nProp100 = nProp*100; // Fuer SWG-Token Prop in 100tel Prozent. + sal_uInt16 nProp100 = nProp*100; // Fuer SWG-Token Prop in 100tel Prozent. short nEsc = ((const SvxEscapementItem&)rItem).GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) { nEsc = 100 - nProp; - nProp100++; // Eine 1 hinten bedeutet 'automatisch'. + nProp100++; // Eine 1 hinten bedeutet 'automatisch'. } else if ( nEsc == DFLT_ESC_AUTO_SUB ) { @@ -1038,7 +1038,7 @@ sal_uInt32 ImpEditEngine::WriteHTML( SvStream&, EditSelection ) } -EditTextObject* ImpEditEngine::CreateTextObject() +EditTextObject* ImpEditEngine::CreateTextObject() { EditSelection aCompleteSelection; aCompleteSelection.Min() = aEditDoc.GetStartPaM(); @@ -1047,12 +1047,12 @@ EditTextObject* ImpEditEngine::CreateTextObject() return CreateTextObject( aCompleteSelection ); } -EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel ) +EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel ) { return CreateBinTextObject( aSel, GetEditTextObjectPool(), aStatus.AllowBigObjects(), nBigTextObjectStart ); } -EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemPool* pPool, sal_Bool bAllowBigObjects, sal_uInt16 nBigObjectStart ) const +EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemPool* pPool, sal_Bool bAllowBigObjects, sal_uInt16 nBigObjectStart ) const { BinTextObject* pTxtObj = new BinTextObject( pPool ); pTxtObj->SetVertical( IsVertical() ); @@ -1247,7 +1247,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selektion kaput!(1)" ); sal_Bool bUsePortionInfo = sal_False; -// sal_Bool bFields = sal_False; +// sal_Bool bFields = sal_False; XParaPortionList* pPortionInfo = rTextObject.GetPortionInfo(); if ( pPortionInfo && ( (long)pPortionInfo->GetPaperWidth() == aPaperSize.Width() ) @@ -1371,7 +1371,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed pParaPortion->nHeight = pXP->nHeight; pParaPortion->nFirstLineOffset = pXP->nFirstLineOffset; pParaPortion->bForceRepaint = sal_True; - pParaPortion->SetValid(); // Nicht formatieren + pParaPortion->SetValid(); // Nicht formatieren // Die TextPortions pParaPortion->GetTextPortions().Reset(); @@ -1390,7 +1390,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed { EditLine* pLine = pXP->aLines[m]; EditLine* pNew = pLine->Clone(); - pNew->SetInvalid(); // neu Painten! + pNew->SetInvalid(); // neu Painten! pParaPortion->GetLines().Insert( pNew, m ); } #ifdef DBG_UTIL @@ -1414,7 +1414,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed #ifndef SVX_LIGHT if ( bNewContent && GetStatus().DoOnlineSpelling() && pC->GetWrongList() ) { - aPaM.GetNode()->DestroyWrongList(); // otherwise MLK, if list exists... + aPaM.GetNode()->DestroyWrongList(); // otherwise MLK, if list exists... aPaM.GetNode()->SetWrongList( pC->GetWrongList()->Clone() ); } #endif // !SVX_LIGHT @@ -1436,10 +1436,10 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed LanguageType ImpEditEngine::GetLanguage( const EditPaM& rPaM, USHORT* pEndPos ) const { - short nScriptType = GetScriptType( rPaM, pEndPos ); // pEndPos will be valid now, pointing to ScriptChange or NodeLen + short nScriptType = GetScriptType( rPaM, pEndPos ); // pEndPos will be valid now, pointing to ScriptChange or NodeLen USHORT nLangId = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); const SvxLanguageItem* pLangItem = &(const SvxLanguageItem&)rPaM.GetNode()->GetContentAttribs().GetItem( nLangId ); - EditCharAttrib* pAttr = rPaM.GetNode()->GetCharAttribs().FindAttrib( nLangId, rPaM.GetIndex() ); + EditCharAttrib* pAttr = rPaM.GetNode()->GetCharAttribs().FindAttrib( nLangId, rPaM.GetIndex() ); if ( pAttr ) pLangItem = (const SvxLanguageItem*)pAttr->GetItem(); @@ -1476,7 +1476,7 @@ SpellInfo * ImpEditEngine::CreateSpellInfo( const EditSelection &rSel, bool bMul // pSpellInfo->aSpellStart = CreateEPaM( aSentenceSel.Min() ); // pSpellInfo->aSpellTo = CreateEPaM( rSel.HasRange()? aSentenceSel.Max() : aSentenceSel.Min() ); // always spell draw objects completely, startting at the top. - // (spelling in only a selection or not starting with the top requires + // (spelling in only a selection or not starting with the top requires // further changes elsewehe to work properly) pSpellInfo->aSpellStart = EPaM(); pSpellInfo->aSpellTo = EPaM( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND ); @@ -1508,7 +1508,7 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc ) sal_Bool bIsStart = sal_False; if ( bMultipleDoc ) - bIsStart = sal_True; // Immer von Vorne bzw. von hinten... + bIsStart = sal_True; // Immer von Vorne bzw. von hinten... else if ( ( CreateEPaM( aEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart ) ) bIsStart = sal_True; @@ -1555,7 +1555,7 @@ sal_Bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) // if the paragraph is not empty we need to increase the index // by one since the attribute of the character left to the // specified position is evaluated. - if (nEnd > nStart) // empty para? + if (nEnd > nStart) // empty para? ++nStart; LanguageType nLangFound = pEditEngine->GetLanguage( k, nStart ); #ifdef DEBUG @@ -1604,7 +1604,7 @@ void ImpEditEngine::Convert( EditView* pEditView, // the start of the word we use that though. if (!aCurSel.HasRange() && ImplGetBreakIterator().is()) { - EditPaM aWordStartPaM( SelectWord( aCurSel, i18n::WordType::DICTIONARY_WORD ).Min() ); + EditPaM aWordStartPaM( SelectWord( aCurSel, i18n::WordType::DICTIONARY_WORD ).Min() ); // since #118246 / #117803 still occurs if the cursor is placed // between the two chinese characters to be converted (because both @@ -1644,7 +1644,7 @@ void ImpEditEngine::Convert( EditView* pEditView, // disallow formatting, updating the view, ... while // non-interactively converting the document. (saves time) //if (!bIsInteractive) - // SetUpdateMode( FALSE ); + // SetUpdateMode( FALSE ); aWrp.Convert(); @@ -1755,15 +1755,15 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL } */ - USHORT nAttribStart = USHRT_MAX; - USHORT nAttribEnd = USHRT_MAX; - USHORT nCurPos = USHRT_MAX; + USHORT nAttribStart = USHRT_MAX; + USHORT nAttribEnd = USHRT_MAX; + USHORT nCurPos = USHRT_MAX; EPaM aCurStart = CreateEPaM( aCurSel.Min() ); SvUShorts aPortions; pEditEngine->GetPortions( (USHORT)aCurStart.nPara, aPortions ); for ( USHORT nPos = 0; nPos < aPortions.Count(); ++nPos ) { - USHORT nEnd = aPortions.GetObject( nPos ); + USHORT nEnd = aPortions.GetObject( nPos ); USHORT nStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; // the language attribute is obtained from the left character @@ -2027,8 +2027,8 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& r /*-- 13.10.2003 16:43:27--------------------------------------------------- -----------------------------------------------------------------------*/ -bool ImpEditEngine::SpellSentence(EditView& rEditView, - ::svx::SpellPortions& rToFill, +bool ImpEditEngine::SpellSentence(EditView& rEditView, + ::svx::SpellPortions& rToFill, bool /*bIsGrammarChecking*/ ) { #ifdef SVX_LIGHT @@ -2196,8 +2196,8 @@ void ImpEditEngine::AddPortionIterated( /*-- 13.10.2003 16:43:33--------------------------------------------------- -----------------------------------------------------------------------*/ -void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, - const ::svx::SpellPortions& rNewPortions, +void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, + const ::svx::SpellPortions& rNewPortions, bool bRecheck ) { #ifdef SVX_LIGHT @@ -2320,7 +2320,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, aNext = EditPaM( aOldSel.Max().GetNode(), nEndOfSentence ); } rEditView.pImpEditView->SetEditSelection( aNext ); - + FormatAndUpdate(); aEditDoc.SetModified(TRUE); } @@ -2337,7 +2337,7 @@ void ImpEditEngine::PutSpellingToSentenceStart( EditView& rEditView ) { rEditView.pImpEditView->SetEditSelection( pSpellInfo->aLastSpellContentSelections.begin()->Min() ); } - + #endif } @@ -2352,7 +2352,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel Es werden alle Woerter im invalidierten Bereich geprueft. Ist ein Wort falsch, aber noch nicht in der WrongList, oder umgekehrt, wird der Bereich des Wortes invalidiert - ( kein Invalidate, sondern wenn nur Uebergaenge von richtig=>falsch, + ( kein Invalidate, sondern wenn nur Uebergaenge von richtig=>falsch, einfaches Paint, bei Uebergaengen von falsch=>richtig mit VDev ueberplaetten ) */ @@ -2384,8 +2384,8 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel sal_uInt16 nInvStart = pWrongList->GetInvalidStart(); sal_uInt16 nInvEnd = pWrongList->GetInvalidEnd(); - sal_uInt16 nWrongs = 0; // Auch im Absatz mal die Kontrolle abgeben... -// sal_Bool bStop = sal_False; + sal_uInt16 nWrongs = 0; // Auch im Absatz mal die Kontrolle abgeben... +// sal_Bool bStop = sal_False; sal_uInt16 nPaintFrom = 0xFFFF, nPaintTo = 0; sal_Bool bSimpleRepaint = sal_True; @@ -2398,7 +2398,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel { if ( ( aSel.Min().GetIndex() > nInvEnd ) || ( ( aSel.Max().GetNode() == pLastNode ) && ( aSel.Max().GetIndex() >= pLastNode->Len() ) ) ) - break; // Dokument- oder Ungueltigkeitsbereich-Ende + break; // Dokument- oder Ungueltigkeitsbereich-Ende aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD ); String aWord( GetSelected( aSel ) ); @@ -2427,11 +2427,11 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel // Pruefen, ob schon richtig markiert... nWrongs++; // Nur bei SimpleRepaint stoppen, sonst zu oft VDev - // if ( ( nWrongs > 8 ) && bSimpleRepaint ) - // { - // bStop = sal_True; - // pWrongList->MarkInvalid( aSel.Max().GetIndex(), nInvEnd ); - // } + // if ( ( nWrongs > 8 ) && bSimpleRepaint ) + // { + // bStop = sal_True; + // pWrongList->MarkInvalid( aSel.Max().GetIndex(), nInvEnd ); + // } sal_uInt16 nXEnd = bDottAdded ? nWEnd -1 : nWEnd; if ( !pWrongList->HasWrong( nWStart, nXEnd ) ) { @@ -2698,7 +2698,7 @@ BOOL ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditVie EditSelection aFoundSel; BOOL bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel ); - if ( bFound && ( aFoundSel == aSel ) ) // Bei Rueckwaetssuche + if ( bFound && ( aFoundSel == aSel ) ) // Bei Rueckwaetssuche { aStartPaM = aSel.Min(); bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel ); @@ -2854,7 +2854,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, utl::TransliterationWrapper aTranslitarationWrapper( ::comphelper::getProcessServiceFactory(), nTransliterationMode ); BOOL bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); xub_StrLen nStartPos = 0; @@ -2869,17 +2869,17 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_uInt16 nLanguage = LANGUAGE_SYSTEM; // since we don't use Hiragana/Katakana or half-width/full-width transliterations here - // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will + // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will // occasionaly miss words in consecutive sentences). Also with ANYWORD_IGNOREWHITESPACES // text like 'just-in-time' will be converted to 'Just-In-Time' which seems to be the // proper thing to do. const sal_Int16 nWordType = i18n::WordType::ANYWORD_IGNOREWHITESPACES; //! In order to have less trouble with changing text size, e.g. because - //! of ligatures or � (German small sz) being resolved, we need to process - //! the text replacements from end to start. - //! This way the offsets for the yet to be changed words will be - //! left unchanged by the already replaced text. + //! of ligatures or � (German small sz) being resolved, we need to process + //! the text replacements from end to start. + //! This way the offsets for the yet to be changed words will be + //! left unchanged by the already replaced text. //! For this we temporarily save the changes to be done in this vector std::vector< TransliterationChgData > aChanges; TransliterationChgData aChgData; @@ -2892,11 +2892,11 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, i18n::Boundary aEndBndry; aSttBndry = _xBI->getWordBoundary( *pNode, nStartPos, - SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ), + SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ), nWordType, TRUE /*prefer forward direction*/); aEndBndry = _xBI->getWordBoundary( *pNode, nEndPos, - SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ), + SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ), nWordType, FALSE /*prefer backward direction*/); // prevent backtracking to the previous word if selection is at word boundary @@ -2928,8 +2928,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, #endif Sequence< sal_Int32 > aOffsets; - String aNewText( aTranslitarationWrapper.transliterate( *pNode, - GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), + String aNewText( aTranslitarationWrapper.transliterate( *pNode, + GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), nCurrentStart, nLen, &aOffsets )); if (!pNode->Equals( aNewText, nCurrentStart, nLen )) @@ -2946,8 +2946,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, (void) aSelTxt; #endif - aCurWordBndry = _xBI->nextWord( *pNode, nCurrentEnd, - SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), + aCurWordBndry = _xBI->nextWord( *pNode, nCurrentEnd, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), nWordType); } DBG_ASSERT( nCurrentEnd >= aEndBndry.endPos, "failed to reach end of transliteration" ); @@ -2956,19 +2956,19 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, { // for 'sentence case' we need to iterate sentence by sentence - sal_Int32 nLastStart = _xBI->beginOfSentence( - *pNode, nEndPos, + sal_Int32 nLastStart = _xBI->beginOfSentence( + *pNode, nEndPos, SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ) ); - sal_Int32 nLastEnd = _xBI->endOfSentence( - *pNode, nLastStart, + sal_Int32 nLastEnd = _xBI->endOfSentence( + *pNode, nLastStart, SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ) ); - + // extend nCurrentStart, nCurrentEnd to the current sentence boundaries - nCurrentStart = _xBI->beginOfSentence( - *pNode, nStartPos, + nCurrentStart = _xBI->beginOfSentence( + *pNode, nStartPos, SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ) ); - nCurrentEnd = _xBI->endOfSentence( - *pNode, nCurrentStart, + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); // prevent backtracking to the previous sentence if selection starts at end of a sentence @@ -2976,18 +2976,18 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, { // now nCurrentStart is probably located on a non-letter word. (unless we // are in Asian text with no spaces...) - // Thus to get the real sentence start we should locate the next real word, + // Thus to get the real sentence start we should locate the next real word, // that is one found by DICTIONARY_WORD - i18n::Boundary aBndry = _xBI->nextWord( *pNode, nCurrentEnd, - SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), + i18n::Boundary aBndry = _xBI->nextWord( *pNode, nCurrentEnd, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), i18n::WordType::DICTIONARY_WORD); // now get new current sentence boundaries - nCurrentStart = _xBI->beginOfSentence( - *pNode, aBndry.startPos, + nCurrentStart = _xBI->beginOfSentence( + *pNode, aBndry.startPos, SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) ); - nCurrentEnd = _xBI->endOfSentence( - *pNode, nCurrentStart, + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); } // prevent advancing to the next sentence if selection ends at start of a sentence @@ -2995,13 +2995,13 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, { // now nCurrentStart is probably located on a non-letter word. (unless we // are in Asian text with no spaces...) - // Thus to get the real sentence start we should locate the previous real word, + // Thus to get the real sentence start we should locate the previous real word, // that is one found by DICTIONARY_WORD - i18n::Boundary aBndry = _xBI->previousWord( *pNode, nLastStart, - SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ), + i18n::Boundary aBndry = _xBI->previousWord( *pNode, nLastStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ), i18n::WordType::DICTIONARY_WORD); - nLastEnd = _xBI->endOfSentence( - *pNode, aBndry.startPos, + nLastEnd = _xBI->endOfSentence( + *pNode, aBndry.startPos, SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) ); if (nCurrentEnd > nLastEnd) nCurrentEnd = nLastEnd; @@ -3016,8 +3016,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, #endif Sequence< sal_Int32 > aOffsets; - String aNewText( aTranslitarationWrapper.transliterate( *pNode, - GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), + String aNewText( aTranslitarationWrapper.transliterate( *pNode, + GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), nCurrentStart, nLen, &aOffsets )); if (!pNode->Equals( aNewText, nCurrentStart, nLen )) @@ -3036,8 +3036,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), nWordType); nCurrentStart = aFirstWordBndry.startPos; - nCurrentEnd = _xBI->endOfSentence( - *pNode, nCurrentStart, + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); } DBG_ASSERT( nCurrentEnd >= nLastEnd, "failed to reach end of transliteration" ); @@ -3123,8 +3123,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, USHORT nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() ); ParaPortion* pParaPortion = GetParaPortions()[nSelNode]; - pParaPortion->MarkSelectionInvalid( rData.nStart, - std::max< USHORT >( rData.nStart + rData.nLen, + pParaPortion->MarkSelectionInvalid( rData.nStart, + std::max< USHORT >( rData.nStart + rData.nLen, rData.nStart + rData.aNewText.Len() ) ); } } // if (aChanges.size() > 0) @@ -3152,7 +3152,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, } -short ImpEditEngine::ReplaceTextOnly( +short ImpEditEngine::ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rNewText, diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 08451cfe6b2c..8709b197c188 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,13 +44,13 @@ void ImpEditEngine::SetStyleSheetPool( SfxStyleSheetPool* pSPool ) { if ( pStylePool != pSPool ) { -// if ( pStylePool ) -// EndListening( *pStylePool, TRUE ); +// if ( pStylePool ) +// EndListening( *pStylePool, TRUE ); pStylePool = pSPool; -// if ( pStylePool ) -// StartListening( *pStylePool, TRUE ); +// if ( pStylePool ) +// StartListening( *pStylePool, TRUE ); } } @@ -191,10 +191,10 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) // ULONG nStyles = pMyStylePool->GetStyles().Count(); // for ( ULONG nStyle = 0; nStyle < nStyles; nStyle++ ) // { - // EditStyleSheet* pES = (EditStyleSheet*)pMyStylePool->GetStyles().GetObject( nStyle ); - // DBG_ASSERT( pES, "NULL-Pointer im StyleSheetPool!" ); - // if ( pES->IsUsed() && pES->HasStyleAsAnyParent( *pStyle ) ) - // UpdateParagraphsWithStyleSheet( pES ); + // EditStyleSheet* pES = (EditStyleSheet*)pMyStylePool->GetStyles().GetObject( nStyle ); + // DBG_ASSERT( pES, "NULL-Pointer im StyleSheetPool!" ); + // if ( pES->IsUsed() && pES->HasStyleAsAnyParent( *pStyle ) ) + // UpdateParagraphsWithStyleSheet( pES ); // } } } @@ -356,7 +356,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); // ueber die Absaetze iterieren... - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node nicht gefunden: GetAttrib" ); @@ -415,7 +415,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) // => Lieber nicht invalidieren, UMSTELLEN! // Besser waere, Absatzweise ein ItemSet zu fuellen // und dieses mit dem gesmten vergleichen. - // aCurSet.InvalidateItem( nWhich ); + // aCurSet.InvalidateItem( nWhich ); if ( nWhich <= EE_PARA_END ) aCurSet.InvalidateItem( nWhich ); } @@ -558,7 +558,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE } // ueber die Absaetze iterieren... - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { BOOL bParaAttribFound = FALSE; BOOL bCharAttribFound = FALSE; @@ -578,13 +578,13 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE // ueber die Items iterieren... #ifdef EDITDEBUG -// FILE* fp = fopen( "d:\\debug.log", "a" ); -// if ( fp ) -// { -// fprintf( fp, "\n\n=> Zeichen-Attribute: Absatz %i, %i-%i\n", nNode, nStartPos, nEndPos ); -// DbgOutItemSet( fp, rSet, TRUE, FALSE ); -// fclose( fp ); -// } +// FILE* fp = fopen( "d:\\debug.log", "a" ); +// if ( fp ) +// { +// fprintf( fp, "\n\n=> Zeichen-Attribute: Absatz %i, %i-%i\n", nNode, nStartPos, nEndPos ); +// DbgOutItemSet( fp, rSet, TRUE, FALSE ); +// fclose( fp ); +// } #endif for ( USHORT nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) @@ -659,7 +659,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri } // ueber die Absaetze iterieren... - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); ParaPortion* pPortion = GetParaPortions().GetObject( nNode ); @@ -678,7 +678,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri BOOL bChanged = aEditDoc.RemoveAttribs( pNode, nStartPos, nEndPos, nWhich ); if ( bRemoveParaAttribs ) { - SetParaAttribs( nNode, *_pEmptyItemSet ); // Invalidiert + SetParaAttribs( nNode, *_pEmptyItemSet ); // Invalidiert } else { @@ -744,13 +744,13 @@ void ImpEditEngine::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) return; #ifdef EDITDEBUG -// FILE* fp = fopen( "d:\\debug.log", "a" ); -// if ( fp ) -// { -// fprintf( fp, "\n\n=> Absatz-Attribute: Absatz %i\n", nPara ); -// DbgOutItemSet( fp, rSet, TRUE, FALSE ); -// fclose( fp ); -// } +// FILE* fp = fopen( "d:\\debug.log", "a" ); +// if ( fp ) +// { +// fprintf( fp, "\n\n=> Absatz-Attribute: Absatz %i\n", nPara ); +// DbgOutItemSet( fp, rSet, TRUE, FALSE ); +// fclose( fp ); +// } #endif if ( !( pNode->GetContentAttribs().GetItems() == rSet ) ) diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index 4202c30dba13..b37e767a6fac 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -241,9 +241,9 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) if (aConvSel.HasRange()) { // user selection: convert to end of selection - pConvInfo->aConvTo.nPara = aConvSel.nEndPara; - pConvInfo->aConvTo.nIndex = aConvSel.nEndPos; - pConvInfo->bConvToEnd = sal_False; + pConvInfo->aConvTo.nPara = aConvSel.nEndPara; + pConvInfo->aConvTo.nIndex = aConvSel.nEndPos; + pConvInfo->bConvToEnd = sal_False; } else { @@ -267,7 +267,7 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) } -void TextConvWrapper::ConvEnd_impl() +void TextConvWrapper::ConvEnd_impl() { } @@ -318,15 +318,15 @@ void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel, } -void TextConvWrapper::SelectNewUnit_impl( - const sal_Int32 nUnitStart, +void TextConvWrapper::SelectNewUnit_impl( + const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd ) { BOOL bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; DBG_ASSERT( bOK, "invalid arguments" ); if (!bOK) return; - + ESelection aSelection = pEditView->GetSelection(); DBG_ASSERT( aSelection.nStartPara == aSelection.nEndPara, "paragraph mismatch in selection" ); @@ -336,13 +336,13 @@ void TextConvWrapper::SelectNewUnit_impl( } -void TextConvWrapper::GetNextPortion( +void TextConvWrapper::GetNextPortion( ::rtl::OUString& /* [out] */ rNextPortion, LanguageType& /* [out] */ rLangOfPortion, sal_Bool /* [in] */ _bAllowImplicitChangesForNotConvertibleText ) { bAllowChange = _bAllowImplicitChangesForNotConvertibleText; - + FindConvText_impl(); rNextPortion = aConvText; rLangOfPortion = nConvTextLang; @@ -357,8 +357,8 @@ void TextConvWrapper::GetNextPortion( } -void TextConvWrapper::HandleNewUnit( - const sal_Int32 nUnitStart, +void TextConvWrapper::HandleNewUnit( + const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd ) { SelectNewUnit_impl( nUnitStart, nUnitEnd ); @@ -368,7 +368,7 @@ void TextConvWrapper::HandleNewUnit( void TextConvWrapper::ReplaceUnit( const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd, const ::rtl::OUString& rOrigText, - const ::rtl::OUString& rReplaceWith, + const ::rtl::OUString& rReplaceWith, const ::com::sun::star::uno::Sequence< sal_Int32 > &rOffsets, ReplacementAction eAction, LanguageType *pNewUnitLanguage ) @@ -408,14 +408,14 @@ void TextConvWrapper::ReplaceUnit( } nUnitOffset = sal::static_int_cast< USHORT >( nUnitOffset + nUnitStart + aNewTxt.getLength()); - + // remember current original language for kater use ImpEditEngine *pImpEditEng = pEditView->GetImpEditEngine(); - ESelection _aOldSel = pEditView->GetSelection(); + ESelection _aOldSel = pEditView->GetSelection(); //EditSelection aOldEditSel = pEditView->GetImpEditView()->GetEditSelection(); - + #ifdef DBG_UTIL - LanguageType nOldLang = pImpEditEng->GetLanguage( pImpEditEng->CreateSel( _aOldSel ).Min() ); + LanguageType nOldLang = pImpEditEng->GetLanguage( pImpEditEng->CreateSel( _aOldSel ).Min() ); #endif pImpEditEng->UndoActionStart( EDITUNDO_INSERT ); @@ -432,18 +432,18 @@ void TextConvWrapper::ReplaceUnit( // change language and font if necessary if (bIsChineseConversion) { - DBG_ASSERT( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL, + DBG_ASSERT( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL, "TextConvWrapper::ReplaceUnit : unexpected target language" ); - + ESelection aOldSel = pEditView->GetSelection(); ESelection aNewSel( aOldSel ); aNewSel.nStartPos = sal::static_int_cast< xub_StrLen >( aNewSel.nStartPos - aNewTxt.getLength()); -// DBG_ASSERT( aOldSel.nEndPos >= 0, "error while building selection" ); +// DBG_ASSERT( aOldSel.nEndPos >= 0, "error while building selection" ); if (pNewUnitLanguage) { - DBG_ASSERT(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ), + DBG_ASSERT(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ), "similar language should not be changed!"); SetLanguageAndFont( aNewSel, *pNewUnitLanguage, EE_CHAR_LANGUAGE_CJK, GetTargetFont(), EE_CHAR_FONTINFO_CJK ); @@ -472,7 +472,7 @@ void TextConvWrapper::ReplaceUnit( } -void TextConvWrapper::ChangeText( const String &rNewText, +void TextConvWrapper::ChangeText( const String &rNewText, const OUString& rOrigText, const uno::Sequence< sal_Int32 > *pOffsets, ESelection *pESelection ) @@ -486,7 +486,7 @@ void TextConvWrapper::ChangeText( const String &rNewText, if (pOffsets && pESelection) // try to keep as much attributation as possible ? { pESelection->Adjust(); - + // remember cursor start position for later setting of the cursor const xub_StrLen nStartIndex = pESelection->nStartPos; @@ -498,15 +498,15 @@ void TextConvWrapper::ChangeText( const String &rNewText, xub_StrLen nChgLen = 0; xub_StrLen nConvChgPos = STRING_NOTFOUND; xub_StrLen nConvChgLen = 0; - - // offset to calculate the position in the text taking into + + // offset to calculate the position in the text taking into // account that text may have been replaced with new text of // different length. Negative values allowed! long nCorrectionOffset = 0; - - DBG_ASSERT(nIndices == 0 || nIndices == nConvTextLen, + + DBG_ASSERT(nIndices == 0 || nIndices == nConvTextLen, "mismatch between string length and sequence length!" ); - + // find all substrings that need to be replaced (and only those) while (sal_True) { @@ -542,8 +542,8 @@ void TextConvWrapper::ChangeText( const String &rNewText, #ifdef DEBUG String aSelTxt1( pEditView->GetSelected() ); #endif - - // replace selected sub string with the corresponding + + // replace selected sub string with the corresponding // sub string from the new text while keeping as // much from the attributes as possible ChangeText_impl( aInNew, sal_True ); @@ -569,7 +569,7 @@ void TextConvWrapper::ChangeText( const String &rNewText, } // set cursor to the end of the inserted text - // (as it would happen after ChangeText_impl (Delete and Insert) + // (as it would happen after ChangeText_impl (Delete and Insert) // of the whole text in the 'else' branch below) pESelection->nStartPos = pESelection->nEndPos = nStartIndex + nConvTextLen; } @@ -585,8 +585,8 @@ void TextConvWrapper::ChangeText_impl( const String &rNewText, sal_Bool bKeepAtt if (bKeepAttributes) { // save attributes to be restored - SfxItemSet aSet( pEditView->GetAttribs() ); - + SfxItemSet aSet( pEditView->GetAttribs() ); + #ifdef DEBUG String aSelTxt1( pEditView->GetSelected() ); #endif @@ -598,8 +598,8 @@ void TextConvWrapper::ChangeText_impl( const String &rNewText, sal_Bool bKeepAtt // since 'SetAttribs' below function like merging with the attributes // from the itemset with any existing ones we have to get rid of all - // all attributes now. (Those attributes that may take effect left - // to the position where the new text gets inserted after the old text + // all attributes now. (Those attributes that may take effect left + // to the position where the new text gets inserted after the old text // was deleted) pEditView->RemoveAttribs(); // apply saved attributes to new inserted text diff --git a/editeng/source/editeng/textconv.hxx b/editeng/source/editeng/textconv.hxx index 770fcd92ba64..e8d17075d7d6 100644 --- a/editeng/source/editeng/textconv.hxx +++ b/editeng/source/editeng/textconv.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ class EditView; class ImpEditEngine; class ContentNode; -class TextConvWrapper : public editeng::HangulHanjaConversion +class TextConvWrapper : public editeng::HangulHanjaConversion { rtl::OUString aConvText; // convertible text part found last time LanguageType nConvTextLang; // language of aConvText @@ -70,10 +70,10 @@ class TextConvWrapper : public editeng::HangulHanjaConversion void ConvEnd_impl(); // former SpellEnd sal_Bool ConvContinue_impl(); // former SpellContinue - void SelectNewUnit_impl( const sal_Int32 nUnitStart, + void SelectNewUnit_impl( const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd ); - void ChangeText( const String &rNewText, + void ChangeText( const String &rNewText, const ::rtl::OUString& rOrigText, const ::com::sun::star::uno::Sequence< sal_Int32 > *pOffsets, ESelection *pESelection ); @@ -84,19 +84,19 @@ class TextConvWrapper : public editeng::HangulHanjaConversion TextConvWrapper & operator= (const TextConvWrapper &); protected: - virtual void GetNextPortion( ::rtl::OUString& /* [out] */ rNextPortion, - LanguageType& /* [out] */ rLangOfPortion, + virtual void GetNextPortion( ::rtl::OUString& /* [out] */ rNextPortion, + LanguageType& /* [out] */ rLangOfPortion, sal_Bool /* [in] */ _bAllowImplicitChangesForNotConvertibleText ); - virtual void HandleNewUnit( const sal_Int32 nUnitStart, + virtual void HandleNewUnit( const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd ); virtual void ReplaceUnit( const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd, const ::rtl::OUString& rOrigText, - const ::rtl::OUString& rReplaceWith, + const ::rtl::OUString& rReplaceWith, const ::com::sun::star::uno::Sequence< sal_Int32 > &rOffsets, - ReplacementAction eAction, + ReplacementAction eAction, LanguageType *pNewUnitLanguage ); - + virtual sal_Bool HasRubySupport() const; void SetLanguageAndFont( const ESelection &rESel, |