diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-04-24 15:55:35 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-04-24 15:55:35 +0000 |
commit | ea162107764c3a1b4dee3ad3538e451f1fa4fd1d (patch) | |
tree | 28137a05bc68c76c9a42c4a8714c1ccaf8626882 /svx/source/accessibility | |
parent | 9f2212f1d2db072b56e3649132db320311dc2b1b (diff) |
INTEGRATION: CWS uaa02 (1.2.18); FILE MERGED
2003/04/22 09:19:49 thb 1.2.18.1: #108900# Added leftover from 1.11-1.12 merge of unoedit/unoedprx.cxx
Diffstat (limited to 'svx/source/accessibility')
-rw-r--r-- | svx/source/accessibility/AccessibleStringWrap.cxx | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/svx/source/accessibility/AccessibleStringWrap.cxx b/svx/source/accessibility/AccessibleStringWrap.cxx index ccbd2eb0e437..163a3eca68e6 100644 --- a/svx/source/accessibility/AccessibleStringWrap.cxx +++ b/svx/source/accessibility/AccessibleStringWrap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleStringWrap.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: hr $ $Date: 2003-04-04 16:56:21 $ + * last change: $Author: vg $ $Date: 2003-04-24 16:55:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -89,16 +89,28 @@ AccessibleStringWrap::AccessibleStringWrap( OutputDevice& rDev, SvxFont& rFont, sal_Bool AccessibleStringWrap::GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRect ) { DBG_ASSERT(nIndex >= 0 && nIndex <= USHRT_MAX, - "AccessibleStringWrap::GetCharacterBounds: index value overflow"); + "SvxAccessibleStringWrap::GetCharacterBounds: index value overflow"); mrFont.SetPhysFont( &mrDev ); - long aXArray[2]; - mrDev.GetCaretPositions( maText, aXArray, static_cast< USHORT >(nIndex), 1 ); - rRect.Left() = 0; - rRect.Right() = 0; - rRect.SetSize( Size(mrDev.GetTextHeight(), labs(aXArray[0] - aXArray[1])) ); - rRect.Move( ::std::min(aXArray[0], aXArray[1]), 0 ); + // #108900# Handle virtual position one-past-the end of the string + if( nIndex >= maText.Len() ) + { + // create a caret bounding rect that has the height of the + // current font and is one pixel wide. + rRect.Left() = mrDev.GetTextWidth(maText); + rRect.Top() = 0; + rRect.SetSize( Size(mrDev.GetTextHeight(), 1) ); + } + else + { + long aXArray[2]; + mrDev.GetCaretPositions( maText, aXArray, static_cast< USHORT >(nIndex), 1 ); + rRect.Left() = 0; + rRect.Top() = 0; + rRect.SetSize( Size(mrDev.GetTextHeight(), labs(aXArray[0] - aXArray[1])) ); + rRect.Move( ::std::min(aXArray[0], aXArray[1]), 0 ); + } if( mrFont.IsVertical() ) { |