diff options
Diffstat (limited to 'svtools/source/edit/textdat2.hxx')
-rw-r--r-- | svtools/source/edit/textdat2.hxx | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/svtools/source/edit/textdat2.hxx b/svtools/source/edit/textdat2.hxx index eb129fc5bca1..414d4355f433 100644 --- a/svtools/source/edit/textdat2.hxx +++ b/svtools/source/edit/textdat2.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 @@ -39,53 +39,53 @@ class TextNode; class TextView; -#define PORTIONKIND_TEXT 0 +#define PORTIONKIND_TEXT 0 #define PORTIONKIND_TAB 1 -#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 DEL_LEFT 1 -#define DEL_RIGHT 2 -#define TRAVEL_X_DONTKNOW 0xFFFF -#define MAXCHARSINPARA 0x3FFF-CHARPOSGROW +#define DEL_LEFT 1 +#define DEL_RIGHT 2 +#define TRAVEL_X_DONTKNOW 0xFFFF +#define MAXCHARSINPARA 0x3FFF-CHARPOSGROW -#define LINE_SEP 0x0A +#define LINE_SEP 0x0A class TETextPortion { private: - USHORT nLen; - long nWidth; - BYTE nKind; + USHORT nLen; + long nWidth; + BYTE nKind; BYTE nRightToLeft; - TETextPortion() { nLen = 0; nKind = PORTIONKIND_TEXT; nWidth = -1; nRightToLeft = 0;} + TETextPortion() { nLen = 0; nKind = PORTIONKIND_TEXT; nWidth = -1; nRightToLeft = 0;} public: - TETextPortion( USHORT nL ) { + TETextPortion( USHORT nL ) { nLen = nL; nKind = PORTIONKIND_TEXT; nWidth= -1; nRightToLeft = 0; } - USHORT GetLen() const { return nLen; } - USHORT& GetLen() { return nLen; } + USHORT GetLen() const { return nLen; } + USHORT& GetLen() { return nLen; } - long GetWidth()const { return nWidth; } - long& GetWidth() { return nWidth; } + long GetWidth()const { return nWidth; } + long& GetWidth() { return nWidth; } - BYTE GetKind() const { return nKind; } - BYTE& GetKind() { return nKind; } + BYTE GetKind() const { return nKind; } + BYTE& GetKind() { return nKind; } - BYTE GetRightToLeft() const { return nRightToLeft; } - BYTE& GetRightToLeft() { return nRightToLeft; } + BYTE GetRightToLeft() const { return nRightToLeft; } + BYTE& GetRightToLeft() { return nRightToLeft; } BOOL IsRightToLeft() const { return (nRightToLeft&1); } - BOOL HasValidSize() const { return nWidth != (-1); } + BOOL HasValidSize() const { return nWidth != (-1); } }; @@ -99,10 +99,10 @@ public: TETextPortionList(); ~TETextPortionList(); - void Reset(); - USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE ); + void Reset(); + USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE ); USHORT GetPortionStartIndex( USHORT nPortion ); - void DeleteFromPortion( USHORT nDelFrom ); + void DeleteFromPortion( USHORT nDelFrom ); }; struct TEWritingDirectionInfo @@ -123,56 +123,56 @@ SV_DECL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo, 0, 4 ) class TextLine { private: - USHORT mnStart; - USHORT mnEnd; - USHORT mnStartPortion; - USHORT mnEndPortion; + USHORT mnStart; + USHORT mnEnd; + USHORT mnStartPortion; + USHORT mnEndPortion; - short mnStartX; + short mnStartX; - BOOL mbInvalid; // fuer geschickte Formatierung/Ausgabe + BOOL mbInvalid; // fuer geschickte Formatierung/Ausgabe public: - TextLine() { + TextLine() { mnStart = mnEnd = 0; mnStartPortion = mnEndPortion = 0; mnStartX = 0; mbInvalid = TRUE; } - BOOL IsIn( USHORT nIndex ) const + BOOL IsIn( USHORT nIndex ) const { return ( (nIndex >= mnStart ) && ( nIndex < mnEnd ) ); } - BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const + BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const { return ( ( nIndex >= mnStart ) && ( bInclEnd ? ( nIndex <= mnEnd ) : ( nIndex < mnEnd ) ) ); } - void SetStart( USHORT n ) { mnStart = n; } - USHORT GetStart() const { return mnStart; } - USHORT& GetStart() { return mnStart; } + void SetStart( USHORT n ) { mnStart = n; } + USHORT GetStart() const { return mnStart; } + USHORT& GetStart() { return mnStart; } - void SetEnd( USHORT n ) { mnEnd = n; } - USHORT GetEnd() const { return mnEnd; } - USHORT& GetEnd() { return mnEnd; } + void SetEnd( USHORT n ) { mnEnd = n; } + USHORT GetEnd() const { return mnEnd; } + USHORT& GetEnd() { return mnEnd; } - void SetStartPortion( USHORT n ) { mnStartPortion = n; } - USHORT GetStartPortion() const { return mnStartPortion; } - USHORT& GetStartPortion() { return mnStartPortion; } + void SetStartPortion( USHORT n ) { mnStartPortion = n; } + USHORT GetStartPortion() const { return mnStartPortion; } + USHORT& GetStartPortion() { return mnStartPortion; } - void SetEndPortion( USHORT n ) { mnEndPortion = n; } - USHORT GetEndPortion() const { return mnEndPortion; } - USHORT& GetEndPortion() { return mnEndPortion; } + void SetEndPortion( USHORT n ) { mnEndPortion = n; } + USHORT GetEndPortion() const { return mnEndPortion; } + USHORT& GetEndPortion() { return mnEndPortion; } - USHORT GetLen() const { return mnEnd - mnStart; } + USHORT GetLen() const { return mnEnd - mnStart; } - BOOL IsInvalid() const { return mbInvalid; } - BOOL IsValid() const { return !mbInvalid; } - void SetInvalid() { mbInvalid = TRUE; } - void SetValid() { mbInvalid = FALSE; } + BOOL IsInvalid() const { return mbInvalid; } + BOOL IsValid() const { return !mbInvalid; } + void SetInvalid() { mbInvalid = TRUE; } + void SetValid() { mbInvalid = FALSE; } - BOOL IsEmpty() const { return (mnEnd > mnStart) ? FALSE : TRUE; } + BOOL IsEmpty() const { return (mnEnd > mnStart) ? FALSE : TRUE; } - short GetStartX() const { return mnStartX; } - void SetStartX( short n ) { mnStartX = n; } + short GetStartX() const { return mnStartX; } + void SetStartX( short n ) { mnStartX = n; } inline BOOL operator == ( const TextLine& rLine ) const; inline BOOL operator != ( const TextLine& rLine ) const; @@ -183,7 +183,7 @@ typedef TextLine* TextLinePtr; inline BOOL TextLine::operator == ( const TextLine& rLine ) const { - return ( ( mnStart == rLine.mnStart ) && + return ( ( mnStart == rLine.mnStart ) && ( mnEnd == rLine.mnEnd ) && ( mnStartPortion == rLine.mnStartPortion ) && ( mnEndPortion == rLine.mnEndPortion ) ); @@ -199,18 +199,18 @@ inline BOOL TextLine::operator != ( const TextLine& rLine ) const class TEParaPortion { private: - TextNode* mpNode; + TextNode* mpNode; - TextLines maLines; + TextLines maLines; TETextPortionList maTextPortions; TEWritingDirectionInfos maWritingDirectionInfos; - USHORT mnInvalidPosStart; - short mnInvalidDiff; + USHORT mnInvalidPosStart; + short mnInvalidDiff; - BOOL mbInvalid; - BOOL mbSimple; // nur lineares Tippen + BOOL mbInvalid; + BOOL mbSimple; // nur lineares Tippen TEParaPortion( const TEParaPortion& ) {;} @@ -220,25 +220,25 @@ public: ~TEParaPortion(); - BOOL IsInvalid() const { return mbInvalid; } - BOOL IsSimpleInvalid() const { return mbSimple; } - void SetNotSimpleInvalid() { mbSimple = FALSE; } - void SetValid() { mbInvalid = FALSE; mbSimple = TRUE;} + BOOL IsInvalid() const { return mbInvalid; } + BOOL IsSimpleInvalid() const { return mbSimple; } + void SetNotSimpleInvalid() { mbSimple = FALSE; } + void SetValid() { mbInvalid = FALSE; mbSimple = TRUE;} - void MarkInvalid( USHORT nStart, short nDiff); - void MarkSelectionInvalid( USHORT nStart, USHORT nEnd ); + void MarkInvalid( USHORT nStart, short nDiff); + void MarkSelectionInvalid( USHORT nStart, USHORT nEnd ); - USHORT GetInvalidPosStart() const { return mnInvalidPosStart; } - short GetInvalidDiff() const { return mnInvalidDiff; } + USHORT GetInvalidPosStart() const { return mnInvalidPosStart; } + short GetInvalidDiff() const { return mnInvalidDiff; } - TextNode* GetNode() const { return mpNode; } - TextLines& GetLines() { return maLines; } - TETextPortionList& GetTextPortions() { return maTextPortions; } + TextNode* GetNode() const { return mpNode; } + TextLines& GetLines() { return maLines; } + TETextPortionList& GetTextPortions() { return maTextPortions; } TEWritingDirectionInfos& GetWritingDirectionInfos() { return maWritingDirectionInfos; } - USHORT GetLineNumber( USHORT nIndex, BOOL bInclEnd ); - void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ); + USHORT GetLineNumber( USHORT nIndex, BOOL bInclEnd ); + void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ); }; @@ -247,54 +247,54 @@ class TEParaPortions : public ToolsList<TEParaPortion*> public: TEParaPortions(); ~TEParaPortions(); - void Reset(); + void Reset(); }; class TextSelFunctionSet: public FunctionSet { private: - TextView* mpView; + TextView* mpView; public: TextSelFunctionSet( TextView* pView ); - virtual void BeginDrag(); + virtual void BeginDrag(); - virtual void CreateAnchor(); + virtual void CreateAnchor(); - 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 DeselectAll(); + virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ); + virtual void DeselectAll(); - virtual void DeselectAtPoint( const Point& ); - virtual void DestroyAnchor(); + virtual void DeselectAtPoint( const Point& ); + virtual void DestroyAnchor(); }; class IdleFormatter : public Timer { private: - TextView* mpView; - USHORT mnRestarts; + TextView* mpView; + USHORT mnRestarts; public: IdleFormatter(); ~IdleFormatter(); - void DoIdleFormat( TextView* pV, USHORT nMaxRestarts ); - void ForceTimeout(); - TextView* GetView() { return mpView; } + void DoIdleFormat( TextView* pV, USHORT nMaxRestarts ); + void ForceTimeout(); + TextView* GetView() { return mpView; } }; struct TextDDInfo { - Cursor maCursor; - TextPaM maDropPos; + Cursor maCursor; + TextPaM maDropPos; - BOOL mbStarterOfDD; - BOOL mbVisCursor; + BOOL mbStarterOfDD; + BOOL mbVisCursor; TextDDInfo() { |