summaryrefslogtreecommitdiff
path: root/svx/source/unoedit
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-04-24 16:00:09 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-04-24 16:00:09 +0000
commitd6c41ff9c3dd23d355d8ec1964f6d5a933b6ce72 (patch)
treefa33ad10416f0ea760aecac05406b6842403879c /svx/source/unoedit
parent19cb55fbe26e8024fa96a636275022c3e39bcf00 (diff)
INTEGRATION: CWS uaa02 (1.22.14); FILE MERGED
2003/04/14 16:56:49 thb 1.22.14.1: #108900# Moved service descriptions from drafts, changed getCharacterBounds() behaviour and implemented TEXT_CHANGED new/old value calculations
Diffstat (limited to 'svx/source/unoedit')
-rw-r--r--svx/source/unoedit/unoforou.cxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/svx/source/unoedit/unoforou.cxx b/svx/source/unoedit/unoforou.cxx
index 65823194e993..16485452b193 100644
--- a/svx/source/unoedit/unoforou.cxx
+++ b/svx/source/unoedit/unoforou.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoforou.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: hr $ $Date: 2003-03-27 15:05:21 $
+ * last change: $Author: vg $ $Date: 2003-04-24 17:00:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -346,9 +346,25 @@ Rectangle SvxOutlinerForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) con
// don't rotate for vertical text.
Size aSize( rOutliner.CalcTextSize() );
::std::swap( aSize.Width(), aSize.Height() );
- return SvxEditSourceHelper::EEToUserSpace( rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex) ),
- aSize,
- rOutliner.IsVertical() == TRUE );
+
+ // #108900# Handle virtual position one-past-the end of the string
+ if( nIndex >= GetTextLen(nPara) )
+ {
+ Rectangle aLast(0,0,0,0);
+
+ if( nIndex )
+ aLast = rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex-1) );
+
+ aLast.Move( aLast.Right() - aLast.Left(), 0 );
+ aLast.SetSize( Size(1, aSize.Height()) );
+ return SvxEditSourceHelper::EEToUserSpace( aLast, aSize, rOutliner.IsVertical() == TRUE );
+ }
+ else
+ {
+ return SvxEditSourceHelper::EEToUserSpace( rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex) ),
+ aSize,
+ rOutliner.IsVertical() == TRUE );
+ }
}
Rectangle SvxOutlinerForwarder::GetParaBounds( USHORT nPara ) const