Bump for 3.6-28
[LibreOffice.git] / editeng / source / misc / txtrange.cxx
blobf2c828819286d053e205c5967071f0ae0e9fbc8a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include <editeng/txtrange.hxx>
31 #include <math.h>
32 #include <tools/poly.hxx>
33 #include <tools/debug.hxx>
34 #include <basegfx/polygon/b2dpolygon.hxx>
35 #include <basegfx/polygon/b2dpolygontools.hxx>
37 #include <vector>
39 TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon,
40 const basegfx::B2DPolyPolygon* pLinePolyPolygon,
41 sal_uInt16 nCacheSz, sal_uInt16 nLft, sal_uInt16 nRght,
42 sal_Bool bSimpl, sal_Bool bInnr, sal_Bool bVert ) :
43 pBound( NULL ),
44 nCacheSize( nCacheSz ),
45 nRight( nRght ),
46 nLeft( nLft ),
47 nUpper( 0 ),
48 nLower( 0 ),
49 nPointCount( 0 ),
50 bSimple( bSimpl ),
51 bInner( bInnr ),
52 bVertical( bVert )
54 #ifdef DBG_UTIL
55 bFlag3 = bFlag4 = bFlag5 = bFlag6 = bFlag7 = sal_False;
56 #endif
57 sal_uInt32 nCount(rPolyPolygon.count());
58 mpPolyPolygon = new PolyPolygon( (sal_uInt16)nCount );
60 for(sal_uInt32 i(0L); i < nCount; i++)
62 const basegfx::B2DPolygon aCandidate(rPolyPolygon.getB2DPolygon(i).getDefaultAdaptiveSubdivision());
63 nPointCount += aCandidate.count();
64 mpPolyPolygon->Insert( Polygon(aCandidate), (sal_uInt16)i );
67 if( pLinePolyPolygon )
69 nCount = pLinePolyPolygon->count();
70 mpLinePolyPolygon = new PolyPolygon();
72 for(sal_uInt32 i(0L); i < nCount; i++)
74 const basegfx::B2DPolygon aCandidate(pLinePolyPolygon->getB2DPolygon(i).getDefaultAdaptiveSubdivision());
75 nPointCount += aCandidate.count();
76 mpLinePolyPolygon->Insert( Polygon(aCandidate), (sal_uInt16)i );
79 else
80 mpLinePolyPolygon = NULL;
84 TextRanger::~TextRanger()
86 mRangeCache.clear();
87 delete mpPolyPolygon;
88 delete mpLinePolyPolygon;
91 /* TextRanger::SetVertical(..)
92 If there's is a change in the writing direction,
93 the cache has to be cleared.
95 void TextRanger::SetVertical( sal_Bool bNew )
97 if( IsVertical() != bNew )
99 bVertical = bNew;
100 mRangeCache.clear();
104 //! SvxBoundArgs is used to perform temporary calculations on a range array.
105 //! Temporary instances are created in TextRanger::GetTextRanges()
106 class SvxBoundArgs
108 std::vector<bool> aBoolArr;
109 LongDqPtr pLongArr;
110 TextRanger *pTextRanger;
111 long nMin;
112 long nMax;
113 long nTop;
114 long nBottom;
115 long nUpDiff;
116 long nLowDiff;
117 long nUpper;
118 long nLower;
119 long nStart;
120 long nEnd;
121 sal_uInt16 nCut;
122 sal_uInt16 nLast;
123 sal_uInt16 nNext;
124 sal_uInt8 nAct;
125 sal_uInt8 nFirst;
126 sal_Bool bClosed : 1;
127 sal_Bool bInner : 1;
128 sal_Bool bMultiple : 1;
129 sal_Bool bConcat : 1;
130 sal_Bool bRotate : 1;
131 void NoteRange( bool bToggle );
132 long Cut( long nY, const Point& rPt1, const Point& rPt2 );
133 void Add();
134 void _NoteFarPoint( long nPx, long nPyDiff, long nDiff );
135 void NoteFarPoint( long nPx, long nPyDiff, long nDiff )
136 { if( nDiff ) _NoteFarPoint( nPx, nPyDiff, nDiff ); }
137 long CalcMax( const Point& rPt1, const Point& rPt2, long nRange, long nFar );
138 void CheckCut( const Point& rLst, const Point& rNxt );
139 inline long A( const Point& rP ) const { return bRotate ? rP.Y() : rP.X(); }
140 inline long B( const Point& rP ) const { return bRotate ? rP.X() : rP.Y(); }
141 public:
142 SvxBoundArgs( TextRanger* pRanger, LongDqPtr pLong, const Range& rRange );
143 void NotePoint( const long nA ) { NoteMargin( nA - nStart, nA + nEnd ); }
144 void NoteMargin( const long nL, const long nR )
145 { if( nMin > nL ) nMin = nL; if( nMax < nR ) nMax = nR; }
146 sal_uInt16 Area( const Point& rPt );
147 void NoteUpLow( long nA, const sal_uInt8 nArea );
148 void Calc( const PolyPolygon& rPoly );
149 void Concat( const PolyPolygon* pPoly );
150 // inlines
151 void NoteLast() { if( bMultiple ) NoteRange( nAct == nFirst ); }
152 void SetClosed( const sal_Bool bNew ){ bClosed = bNew; }
153 sal_Bool IsClosed() const { return bClosed; }
154 void SetConcat( const sal_Bool bNew ){ bConcat = bNew; }
155 sal_Bool IsConcat() const { return bConcat; }
156 sal_uInt8 GetAct() const { return nAct; }
159 SvxBoundArgs::SvxBoundArgs( TextRanger* pRanger, LongDqPtr pLong,
160 const Range& rRange )
161 : pLongArr( pLong ), pTextRanger( pRanger ),
162 nTop( rRange.Min() ), nBottom( rRange.Max() ),
163 bInner( pRanger->IsInner() ), bMultiple( bInner || !pRanger->IsSimple() ),
164 bConcat( sal_False ), bRotate( pRanger->IsVertical() )
166 if( bRotate )
168 nStart = pRanger->GetUpper();
169 nEnd = pRanger->GetLower();
170 nLowDiff = pRanger->GetLeft();
171 nUpDiff = pRanger->GetRight();
173 else
175 nStart = pRanger->GetLeft();
176 nEnd = pRanger->GetRight();
177 nLowDiff = pRanger->GetUpper();
178 nUpDiff = pRanger->GetLower();
180 nUpper = nTop - nUpDiff;
181 nLower = nBottom + nLowDiff;
182 pLongArr->clear();
185 long SvxBoundArgs::CalcMax( const Point& rPt1, const Point& rPt2,
186 long nRange, long nFarRange )
188 double nDa = Cut( nRange, rPt1, rPt2 ) - Cut( nFarRange, rPt1, rPt2 );
189 double nB;
190 if( nDa < 0 )
192 nDa = -nDa;
193 nB = nEnd;
195 else
196 nB = nStart;
197 nB *= nB;
198 nB += nDa * nDa;
199 nB = nRange + nDa * ( nFarRange - nRange ) / sqrt( nB );
201 sal_Bool bNote;
202 if( nB < B(rPt2) )
203 bNote = nB > B(rPt1);
204 else
205 bNote = nB < B(rPt1);
206 if( bNote )
207 return( long( nB ) );
208 return 0;
211 void SvxBoundArgs::CheckCut( const Point& rLst, const Point& rNxt )
213 if( nCut & 1 )
214 NotePoint( Cut( nBottom, rLst, rNxt ) );
215 if( nCut & 2 )
216 NotePoint( Cut( nTop, rLst, rNxt ) );
217 if( rLst.X() != rNxt.X() && rLst.Y() != rNxt.Y() )
219 long nYps;
220 if( nLowDiff && ( ( nCut & 1 ) || nLast == 1 || nNext == 1 ) )
222 nYps = CalcMax( rLst, rNxt, nBottom, nLower );
223 if( nYps )
224 _NoteFarPoint( Cut( nYps, rLst, rNxt ), nLower-nYps, nLowDiff );
226 if( nUpDiff && ( ( nCut & 2 ) || nLast == 2 || nNext == 2 ) )
228 nYps = CalcMax( rLst, rNxt, nTop, nUpper );
229 if( nYps )
230 _NoteFarPoint( Cut( nYps, rLst, rNxt ), nYps-nUpper, nUpDiff );
235 void SvxBoundArgs::_NoteFarPoint( long nPa, long nPbDiff, long nDiff )
237 long nTmpA;
238 double nQuot = 2 * nDiff - nPbDiff;
239 nQuot *= nPbDiff;
240 nQuot = sqrt( nQuot );
241 nQuot /= nDiff;
242 nTmpA = nPa - long( nStart * nQuot );
243 nPbDiff = nPa + long( nEnd * nQuot );
244 NoteMargin( nTmpA, nPbDiff );
247 void SvxBoundArgs::NoteRange( bool bToggle )
249 DBG_ASSERT( nMax >= nMin || bInner, "NoteRange: Min > Max?");
250 if( nMax < nMin )
251 return;
252 if( !bClosed )
253 bToggle = sal_False;
254 sal_uInt16 nIdx = 0;
255 sal_uInt16 nCount = pLongArr->size();
256 DBG_ASSERT( nCount == 2 * aBoolArr.size(), "NoteRange: Incompatible Sizes" );
257 while( nIdx < nCount && (*pLongArr)[ nIdx ] < nMin )
258 ++nIdx;
259 sal_Bool bOdd = (nIdx % 2) ? sal_True : sal_False;
260 // No overlap with existing intervals?
261 if( nIdx == nCount || ( !bOdd && nMax < (*pLongArr)[ nIdx ] ) )
262 { // Then a new one is inserted ...
263 pLongArr->insert( pLongArr->begin() + nIdx, nMin );
264 pLongArr->insert( pLongArr->begin() + nIdx + 1, nMax );
265 aBoolArr.insert( aBoolArr.begin() + (nIdx/2), bToggle );
267 else
268 { // expand an existing interval ...
269 sal_uInt16 nMaxIdx = nIdx;
270 // If we end up on a left interval boundary, it must be reduced to nMin.
271 if( bOdd )
272 --nIdx;
273 else
274 (*pLongArr)[ nIdx ] = nMin;
275 while( nMaxIdx < nCount && (*pLongArr)[ nMaxIdx ] < nMax )
276 ++nMaxIdx;
277 DBG_ASSERT( nMaxIdx > nIdx || nMin == nMax, "NoteRange: Funny Situation." );
278 if( nMaxIdx )
279 --nMaxIdx;
280 if( nMaxIdx < nIdx )
281 nMaxIdx = nIdx;
282 // If we end up on a right interval boundary, it must be raised to nMax.
283 if( nMaxIdx % 2 )
284 (*pLongArr)[ nMaxIdx-- ] = nMax;
285 // Possible merge of intervals.
286 sal_uInt16 nDiff = nMaxIdx - nIdx;
287 nMaxIdx = nIdx / 2; // From here on is nMaxIdx the Index in BoolArray.
288 if( nDiff )
290 pLongArr->erase( pLongArr->begin() + nIdx + 1, pLongArr->begin() + nIdx + 1 + nDiff );
291 nDiff /= 2;
292 sal_uInt16 nStop = nMaxIdx + nDiff;
293 for( sal_uInt16 i = nMaxIdx; i < nStop; ++i )
294 bToggle ^= aBoolArr[ i ];
295 aBoolArr.erase( aBoolArr.begin() + nMaxIdx, aBoolArr.begin() + (nMaxIdx + nDiff) );
297 DBG_ASSERT( nMaxIdx < aBoolArr.size(), "NoteRange: Too much deleted" );
298 aBoolArr[ nMaxIdx ] = aBoolArr[ nMaxIdx ] ^ bToggle;
302 void SvxBoundArgs::Calc( const PolyPolygon& rPoly )
304 sal_uInt16 nCount;
305 nAct = 0;
306 for( sal_uInt16 i = 0; i < rPoly.Count(); ++i )
308 const Polygon& rPol = rPoly[ i ];
309 nCount = rPol.GetSize();
310 if( nCount )
312 const Point& rNull = rPol[ 0 ];
313 SetClosed( IsConcat() || ( rNull == rPol[ nCount - 1 ] ) );
314 nLast = Area( rNull );
315 if( nLast & 12 )
317 nFirst = 3;
318 if( bMultiple )
319 nAct = 0;
321 else
323 // The first point of the polygon is within the line.
324 if( nLast )
326 if( bMultiple || !nAct )
328 nMin = USHRT_MAX;
329 nMax = 0;
331 if( nLast & 1 )
332 NoteFarPoint( A(rNull), nLower - B(rNull), nLowDiff );
333 else
334 NoteFarPoint( A(rNull), B(rNull) - nUpper, nUpDiff );
336 else
338 if( bMultiple || !nAct )
340 nMin = A(rNull);
341 nMax = nMin + nEnd;
342 nMin -= nStart;
344 else
345 NotePoint( A(rNull) );
347 nFirst = 0; // leaving the line in which direction?
348 nAct = 3; // we are within the line at the moment.
350 if( nCount > 1 )
352 sal_uInt16 nIdx = 1;
353 while( sal_True )
355 const Point& rLast = rPol[ nIdx - 1 ];
356 if( nIdx == nCount )
357 nIdx = 0;
358 const Point& rNext = rPol[ nIdx ];
359 nNext = Area( rNext );
360 nCut = nNext ^ nLast;
361 sal_uInt16 nOldAct = nAct;
362 if( nAct )
363 CheckCut( rLast, rNext );
364 if( nCut & 4 )
366 NoteUpLow( Cut( nLower, rLast, rNext ), 2 );
367 if( nAct && nAct != nOldAct )
369 nOldAct = nAct;
370 CheckCut( rLast, rNext );
373 if( nCut & 8 )
375 NoteUpLow( Cut( nUpper, rLast, rNext ), 1 );
376 if( nAct && nAct != nOldAct )
377 CheckCut( rLast, rNext );
379 if( !nIdx )
381 if( !( nNext & 12 ) )
382 NoteLast();
383 break;
385 if( !( nNext & 12 ) )
387 if( !nNext )
388 NotePoint( A(rNext) );
389 else if( nNext & 1 )
390 NoteFarPoint( A(rNext), nLower-B(rNext), nLowDiff );
391 else
392 NoteFarPoint( A(rNext), B(rNext)-nUpper, nUpDiff );
394 nLast = nNext;
395 if( ++nIdx == nCount && !IsClosed() )
397 if( !( nNext & 12 ) )
398 NoteLast();
399 break;
403 if( bMultiple && IsConcat() )
405 Add();
406 nAct = 0;
410 if( !bMultiple )
412 DBG_ASSERT( pLongArr->empty(), "I said: Simple!" );
413 if( nAct )
415 if( bInner )
417 long nTmpMin = nMin + 2 * nStart;
418 long nTmpMax = nMax - 2 * nEnd;
419 if( nTmpMin <= nTmpMax )
421 pLongArr->push_front(nTmpMax);
422 pLongArr->push_front(nTmpMin);
425 else
427 pLongArr->push_front(nMax);
428 pLongArr->push_front(nMin);
432 else if( !IsConcat() )
433 Add();
436 void SvxBoundArgs::Add()
438 size_t nCount = aBoolArr.size();
439 if( nCount && ( !bInner || !pTextRanger->IsSimple() ) )
441 sal_Bool bDelete = aBoolArr.front();
442 if( bInner )
443 bDelete = !bDelete;
444 sal_uInt16 nLongIdx = 1;
445 for( size_t nBoolIdx = 1; nBoolIdx < nCount; ++nBoolIdx )
447 if( bDelete )
449 sal_uInt16 next = 2;
450 while( nBoolIdx < nCount && !aBoolArr[ nBoolIdx++ ] &&
451 (!bInner || nBoolIdx < nCount ) )
452 next += 2;
453 pLongArr->erase( pLongArr->begin() + nLongIdx, pLongArr->begin() + nLongIdx + next );
454 next /= 2;
455 nBoolIdx = nBoolIdx - next;
456 nCount = nCount - next;
457 aBoolArr.erase( aBoolArr.begin() + nBoolIdx, aBoolArr.begin() + (nBoolIdx + next) );
458 if( nBoolIdx )
459 aBoolArr[ nBoolIdx - 1 ] = sal_False;
460 #if OSL_DEBUG_LEVEL > 1
461 else
462 ++next;
463 #endif
465 bDelete = nBoolIdx < nCount && aBoolArr[ nBoolIdx ];
466 nLongIdx += 2;
467 DBG_ASSERT( nLongIdx == 2*nBoolIdx+1, "BoundArgs: Array-Idx Confusion" );
468 DBG_ASSERT( aBoolArr.size()*2 == pLongArr->size(),
469 "BoundArgs: Array-Count: Confusion" );
472 if( 0 != ( nCount = pLongArr->size() ) )
474 if( bInner )
476 pLongArr->pop_front();
477 pLongArr->pop_back();
479 // Here the line is held inside a large rectangle for "simple"
480 // contour wrap. Currently (April 1999) the EditEngine evaluates
481 // only the first rectangle. If it one day is able to output a line
482 // in several parts, it may be advisable to delete the following lines.
483 if( pTextRanger->IsSimple() && pLongArr->size() > 2 )
484 pLongArr->erase( pLongArr->begin() + 1, pLongArr->end() - 1 );
490 void SvxBoundArgs::Concat( const PolyPolygon* pPoly )
492 SetConcat( sal_True );
493 DBG_ASSERT( pPoly, "Nothing to do?" );
494 LongDqPtr pOld = pLongArr;
495 pLongArr = new std::deque<long>();
496 aBoolArr.clear();
497 bInner = sal_False;
498 Calc( *pPoly ); // Note that this updates pLongArr, which is why we swapped it out earlier.
499 sal_uInt16 nCount = pLongArr->size();
500 sal_uInt16 nIdx = 0;
501 sal_uInt16 i = 0;
502 sal_Bool bSubtract = pTextRanger->IsInner();
503 while( i < nCount )
505 sal_uLong nOldCount = pOld->size();
506 if( nIdx == nOldCount )
507 { // Reached the end of the old Array...
508 if( !bSubtract )
509 pOld->insert( pOld->begin() + nIdx, pLongArr->begin() + i, pLongArr->end() );
510 break;
512 long nLeft = (*pLongArr)[ i++ ];
513 long nRight = (*pLongArr)[ i++ ];
514 sal_uInt16 nLeftPos = nIdx + 1;
515 while( nLeftPos < nOldCount && nLeft > (*pOld)[ nLeftPos ] )
516 nLeftPos += 2;
517 if( nLeftPos >= nOldCount )
518 { // The current interval belongs to the end of the old array ...
519 if( !bSubtract )
520 pOld->insert( pOld->begin() + nOldCount, pLongArr->begin() + i - 2, pLongArr->end() );
521 break;
523 sal_uInt16 nRightPos = nLeftPos - 1;
524 while( nRightPos < nOldCount && nRight >= (*pOld)[ nRightPos ] )
525 nRightPos += 2;
526 if( nRightPos < nLeftPos )
527 { // The current interval belongs between two old intervals
528 if( !bSubtract )
529 pOld->insert( pOld->begin() + nRightPos, pLongArr->begin() + i - 2, pLongArr->begin() + i );
530 nIdx = nRightPos + 2;
532 else if( bSubtract ) // Subtract, if necessary separate
534 long nOld;
535 if( nLeft > ( nOld = (*pOld)[ nLeftPos - 1 ] ) )
536 { // Now we split the left part...
537 if( nLeft - 1 > nOld )
539 pOld->insert( pOld->begin() + nLeftPos - 1, nOld );
540 pOld->insert( pOld->begin() + nLeftPos, nLeft - 1 );
541 nLeftPos += 2;
542 nRightPos += 2;
545 if( nRightPos - nLeftPos > 1 )
546 pOld->erase( pOld->begin() + nLeftPos, pOld->begin() + nRightPos - 1 );
547 if( ++nRight >= ( nOld = (*pOld)[ nLeftPos ] ) )
548 pOld->erase( pOld->begin() + nLeftPos - 1, pOld->begin() + nLeftPos + 1 );
549 else
550 (*pOld)[ nLeftPos - 1 ] = nRight;
552 else // Merge
554 if( nLeft < (*pOld)[ nLeftPos - 1 ] )
555 (*pOld)[ nLeftPos - 1 ] = nLeft;
556 if( nRight > (*pOld)[ nRightPos - 1 ] )
557 (*pOld)[ nRightPos - 1 ] = nRight;
558 if( nRightPos - nLeftPos > 1 )
559 pOld->erase( pOld->begin() + nLeftPos, pOld->begin() + nRightPos - 1 );
562 nIdx = nLeftPos - 1;
564 delete pLongArr;
567 /*************************************************************************
568 * SvxBoundArgs::Area returns the area in which the point is located.
569 * 0 = within the line
570 * 1 = below, but within the upper edge
571 * 2 = above, but within the lower edge
572 * 5 = below the upper edge
573 *10 = above the lower edge
574 *************************************************************************/
576 sal_uInt16 SvxBoundArgs::Area( const Point& rPt )
578 long nB = B( rPt );
579 if( nB >= nBottom )
581 if( nB >= nLower )
582 return 5;
583 return 1;
585 if( nB <= nTop )
587 if( nB <= nUpper )
588 return 10;
589 return 2;
591 return 0;
594 /*************************************************************************
595 * lcl_Cut calculates the X-Coordinate of the distance (Pt1-Pt2) at the
596 * Y-Coordinate nY.
597 * It is assumed that the one of the points are located above and the other
598 * one below the Y-Coordinate.
599 *************************************************************************/
601 long SvxBoundArgs::Cut( long nB, const Point& rPt1, const Point& rPt2 )
603 if( pTextRanger->IsVertical() )
605 double nQuot = nB - rPt1.X();
606 nQuot /= ( rPt2.X() - rPt1.X() );
607 nQuot *= ( rPt2.Y() - rPt1.Y() );
608 return long( rPt1.Y() + nQuot );
610 double nQuot = nB - rPt1.Y();
611 nQuot /= ( rPt2.Y() - rPt1.Y() );
612 nQuot *= ( rPt2.X() - rPt1.X() );
613 return long( rPt1.X() + nQuot );
616 void SvxBoundArgs::NoteUpLow( long nA, const sal_uInt8 nArea )
618 if( nAct )
620 NoteMargin( nA, nA );
621 if( bMultiple )
623 NoteRange( nArea != nAct );
624 nAct = 0;
626 if( !nFirst )
627 nFirst = nArea;
629 else
631 nAct = nArea;
632 nMin = nA;
633 nMax = nA;
637 LongDqPtr TextRanger::GetTextRanges( const Range& rRange )
639 DBG_ASSERT( rRange.Min() || rRange.Max(), "Zero-Range not allowed, Bye Bye" );
640 //Can we find the result we need in the cache?
641 for (std::deque<RangeCache>::iterator it = mRangeCache.begin(); it != mRangeCache.end(); ++it)
643 if (it->range == rRange)
644 return &(it->results);
646 //Calculate a new result
647 RangeCache rngCache(rRange);
648 SvxBoundArgs aArg( this, &(rngCache.results), rRange );
649 aArg.Calc( *mpPolyPolygon );
650 if( mpLinePolyPolygon )
651 aArg.Concat( mpLinePolyPolygon );
652 //Add new result to the cache
653 mRangeCache.push_back(rngCache);
654 if (mRangeCache.size() > nCacheSize)
655 mRangeCache.pop_front();
656 return &(mRangeCache.back().results);
659 const Rectangle& TextRanger::_GetBoundRect()
661 DBG_ASSERT( 0 == pBound, "Don't call twice." );
662 pBound = new Rectangle( mpPolyPolygon->GetBoundRect() );
663 return *pBound;
667 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */