diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-05-28 13:33:32 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-05-28 13:33:32 +0000 |
commit | 06d91e61346aee420c1621e7414b8793bdfcf999 (patch) | |
tree | 9781b3304774f2f487bc222ac5287a334029c729 /basctl | |
parent | e7385170b269628124ccfdc5ed1fcbf2948b6809 (diff) |
INTEGRATION: CWS ab08fixes (1.36.32); FILE MERGED
2004/05/05 15:02:34 ab 1.36.32.1: #i16341# Fixed EOL handling for syntax highlighter
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 0f3dc0d2ef5d..5eca7963e5e1 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -2,9 +2,9 @@ * * $RCSfile: baside2b.cxx,v $ * - * $Revision: 1.36 $ + * $Revision: 1.37 $ * - * last change: $Author: obo $ $Date: 2004-03-17 13:05:57 $ + * last change: $Author: obo $ $Date: 2004-05-28 14:33:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -759,6 +759,25 @@ BOOL EditorWindow::SetSourceInBasic( BOOL bQuiet ) } +// Returns the position of the last character of any of the following +// EOL char combinations: CR, CR/LF, LF, return -1 if no EOL is found +sal_Int32 searchEOL( const ::rtl::OUString& rStr, sal_Int32 fromIndex ) +{ + sal_Int32 iRetPos = -1; + + sal_Int32 iLF = rStr.indexOf( LINE_SEP, fromIndex ); + if( iLF != -1 ) + { + iRetPos = iLF; + } + else + { + iRetPos = rStr.indexOf( LINE_SEP_CR, fromIndex ); + } + return iRetPos; +} + + void EditorWindow::CreateEditEngine() { if ( pEditEngine ) @@ -787,7 +806,7 @@ void EditorWindow::CreateEditEngine() do { nLines++; - nIndex = aOUSource.indexOf( LINE_SEP, nIndex+1 ); + nIndex = searchEOL( aOUSource, nIndex+1 ); } while ( nIndex >= 0 ); |