summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2009-09-25 12:00:20 +0000
committerFrank Schönheit <fs@openoffice.org>2009-09-25 12:00:20 +0000
commit0a4c38a2a2f8c4c78cfff7d2e097be9155f666cc (patch)
tree0c0b4de87df70e4cacd75ccce9cdeceb0e32e946 /vcl/source
parenteac04e74383c70e2ce67b3676a81b0b2b9847cf3 (diff)
diagnostics
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/ctrl.cxx33
1 files changed, 30 insertions, 3 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index ec7fb3504efc..521d3d6844d7 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -551,13 +551,40 @@ void Control::ImplInitSettings( const BOOL _bFont, const BOOL _bForeground )
void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRect, const XubString& _rStr,
USHORT _nStyle, MetricVector* _pVector, String* _pDisplayText ) const
{
+#ifdef FS_DEBUG
+ if ( !_pVector )
+ {
+ static MetricVector aCharRects;
+ static String sDisplayText;
+ aCharRects.clear();
+ sDisplayText = String();
+ _pVector = &aCharRects;
+ _pDisplayText = &sDisplayText;
+ }
+#endif
+
if ( !mpControlData->mpReferenceDevice )
{
_io_rRect = _rTargetDevice.GetTextRect( _io_rRect, _rStr, _nStyle );
_rTargetDevice.DrawText( _io_rRect, _rStr, _nStyle, _pVector, _pDisplayText );
- return;
+ }
+ else
+ {
+ ControlTextRenderer aRenderer( *this, _rTargetDevice, *mpControlData->mpReferenceDevice );
+ _io_rRect = aRenderer.DrawText( _io_rRect, _rStr, _nStyle, _pVector, _pDisplayText );
}
- ControlTextRenderer aRenderer( *this, _rTargetDevice, *mpControlData->mpReferenceDevice );
- _io_rRect = aRenderer.DrawText( _io_rRect, _rStr, _nStyle, _pVector, _pDisplayText );
+#ifdef FS_DEBUG
+ _rTargetDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ _rTargetDevice.SetLineColor( COL_LIGHTRED );
+ _rTargetDevice.SetFillColor();
+ for ( MetricVector::const_iterator cr = _pVector->begin();
+ cr != _pVector->end();
+ ++cr
+ )
+ {
+ _rTargetDevice.DrawRect( *cr );
+ }
+ _rTargetDevice.Pop();
+#endif
}