diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-05-30 07:47:48 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-05-30 07:47:48 +0000 |
commit | 3bd450291fe9d5aaa7437ffade2ca5095d8e1d6e (patch) | |
tree | 57ddcef7d58c56ba4fe49b8364d1f2af9766b293 /svtools/source/edit | |
parent | 4eb081bb5057a50c7f0a6dc22208a845576e1e4f (diff) |
INTEGRATION: CWS uaa06 (1.58.46); FILE MERGED
2008/05/14 13:12:23 obr 1.58.46.1: #i86659# new method needed for XAccessibleMultiLineText
Diffstat (limited to 'svtools/source/edit')
-rw-r--r-- | svtools/source/edit/textview.cxx | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx index d2c6662c5265..bcbe2b1b6386 100644 --- a/svtools/source/edit/textview.cxx +++ b/svtools/source/edit/textview.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: textview.cxx,v $ - * $Revision: 1.58 $ + * $Revision: 1.59 $ * * This file is part of OpenOffice.org. * @@ -200,6 +200,7 @@ struct ImpTextView BOOL mbCursorEnabled : 1; BOOL mbClickedInSelection : 1; BOOL mbSupportProtectAttribute : 1; + bool mbCursorAtEndOfLine; }; // ------------------------------------------------------------------------- @@ -223,6 +224,7 @@ TextView::TextView( TextEngine* pEng, Window* pWindow ) : mpImpl->mbCursorEnabled = TRUE; mpImpl->mbClickedInSelection = FALSE; mpImpl->mbSupportProtectAttribute = FALSE; + mpImpl->mbCursorAtEndOfLine = false; // mbInSelection = FALSE; mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW; @@ -1661,6 +1663,16 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec TextPaM aPaM( mpImpl->maSelection.GetEnd() ); Rectangle aEditCursor = mpImpl->mpTextEngine->PaMtoEditCursor( aPaM, bSpecial ); + + // Remember that we placed the cursor behind the last character of a line + mpImpl->mbCursorAtEndOfLine = false; + if( bSpecial ) + { + TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); + mpImpl->mbCursorAtEndOfLine = + pParaPortion->GetLineNumber( aPaM.GetIndex(), TRUE ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + } + if ( !IsInsertMode() && !mpImpl->maSelection.HasRange() ) { TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() ); @@ -2232,8 +2244,23 @@ Point TextView::GetWindowPos( const Point& rDocPos ) const return aPoint; } +sal_Int32 TextView::GetLineNumberOfCursorInSelection() const +{ + // PROGRESS + sal_Int32 nLineNo = -1; + if( mpImpl->mbCursorEnabled ) + { + TextPaM aPaM = GetSelection().GetEnd(); + TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() ); + nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE ); + if( mpImpl->mbCursorAtEndOfLine ) + --nLineNo; + } + return nLineNo; +} + -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TextSelFunctionSet // ------------------------------------------------------------------------- TextSelFunctionSet::TextSelFunctionSet( TextView* pView ) |