summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Lohmann <pl@openoffice.org>2002-05-08 11:55:17 +0000
committerPhilipp Lohmann <pl@openoffice.org>2002-05-08 11:55:17 +0000
commit5e8afd0e1bd97ca6002d2b7860329fe89b0b9a7c (patch)
tree0bd2aa1091b777c3078a083cf069c2a5490b52ba
parent45206ce124ae06d7ef0af17fc1a48c678a18f1eb (diff)
#98573# finalized accessibility changes to DrawText
-rw-r--r--vcl/source/gdi/outdev3.cxx31
1 files changed, 17 insertions, 14 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 3e434660f736..609ec3ed941f 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev3.cxx,v $
*
- * $Revision: 1.92 $
+ * $Revision: 1.93 $
*
- * last change: $Author: hdu $ $Date: 2002-05-08 12:29:15 $
+ * last change: $Author: pl $ $Date: 2002-05-08 12:55:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -5396,18 +5396,28 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rOrigStr,
MetricVector aTmp;
GetGlyphBoundRects( rStartPt, rOrigStr, nIndex, nLen, nIndex, aTmp );
- nLen = aTmp.size();
- MetricVector::const_iterator it = aTmp.begin();
- while( nLen-- )
+ bool bInserted = false;
+ for( MetricVector::const_iterator it = aTmp.begin(); it != aTmp.end(); ++it, nIndex++ )
{
+ bool bAppend = false;
+
if( aClip.IsOver( *it ) )
+ bAppend = true;
+ else if( rOrigStr.GetChar( nIndex ) == ' ' && bInserted )
+ {
+ MetricVector::const_iterator next = it;
+ ++next;
+ if( next != aTmp.end() && aClip.IsOver( *next ) )
+ bAppend = true;
+ }
+
+ if( bAppend )
{
pVector->push_back( *it );
if( pDisplayText )
pDisplayText->Append( rOrigStr.GetChar( nIndex ) );
-
+ bInserted = true;
}
- nIndex++;
}
}
else
@@ -7007,13 +7017,6 @@ BOOL OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
if( nLen == STRING_LEN )
nLen = rStr.Len() - nIndex;
-#ifdef DEBUG
- fprintf( stderr, "GetGlyphBoundRects( (%d,%d), \"%s\", %d, %d, %d )\n",
- rOrigin.X(), rOrigin.Y(),
- OUStringToOString( rStr, RTL_TEXTENCODING_ISO_8859_1 ).getStr(),
- nIndex, nLen, nBase );
-#endif
-
for( int i = 0; i < nLen && bRet; i++ )
{
Rectangle aRect;