diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-04-24 15:59:57 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-04-24 15:59:57 +0000 |
commit | 19cb55fbe26e8024fa96a636275022c3e39bcf00 (patch) | |
tree | efb87097f75871d2b36e8e2f5618580029517d55 | |
parent | c0e028a338b8eb4772293e51dbf3943ff38f233a (diff) |
INTEGRATION: CWS uaa02 (1.19.174); FILE MERGED
2003/04/14 16:56:49 thb 1.19.174.1: #108900# Moved service descriptions from drafts, changed getCharacterBounds() behaviour and implemented TEXT_CHANGED new/old value calculations
-rw-r--r-- | svx/source/unoedit/unofored.cxx | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/svx/source/unoedit/unofored.cxx b/svx/source/unoedit/unofored.cxx index f366c275399f..b42c41169d87 100644 --- a/svx/source/unoedit/unofored.cxx +++ b/svx/source/unoedit/unofored.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unofored.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: thb $ $Date: 2002-09-13 14:31:57 $ + * last change: $Author: vg $ $Date: 2003-04-24 16:59:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -374,9 +374,25 @@ Rectangle SvxEditEngineForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) c // don't rotate for vertical text. Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() ); ::std::swap( aSize.Width(), aSize.Height() ); - return SvxEditSourceHelper::EEToUserSpace( rEditEngine.GetCharacterBounds( EPosition(nPara, nIndex) ), - aSize, - rEditEngine.IsVertical() == TRUE ); + + // #108900# Handle virtual position one-past-the end of the string + if( nIndex >= rEditEngine.GetTextLen(nPara) ) + { + Rectangle aLast(0,0,0,0); + + if( nIndex ) + aLast = rEditEngine.GetCharacterBounds( EPosition(nPara, nIndex-1) ); + + aLast.Move( aLast.Right() - aLast.Left(), 0 ); + aLast.SetSize( Size(1, rEditEngine.GetTextHeight()) ); + return SvxEditSourceHelper::EEToUserSpace( aLast, aSize, rEditEngine.IsVertical() == TRUE ); + } + else + { + return SvxEditSourceHelper::EEToUserSpace( rEditEngine.GetCharacterBounds( EPosition(nPara, nIndex) ), + aSize, + rEditEngine.IsVertical() == TRUE ); + } } Rectangle SvxEditEngineForwarder::GetParaBounds( USHORT nPara ) const |