1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <config_features.h>
22 #include <sal/config.h>
31 #include <tools/debug.hxx>
32 #include <tools/lineend.hxx>
33 #include "sal/log.hxx"
35 #include "vcl/svapp.hxx"
36 #include "vcl/event.hxx"
37 #include "vcl/lstbox.hxx"
38 #include "vcl/button.hxx"
39 #include "vcl/edit.hxx"
40 #include "vcl/fixed.hxx"
41 #include "vcl/group.hxx"
42 #include "vcl/field.hxx"
43 #include "vcl/layout.hxx"
44 #include "vcl/settings.hxx"
45 #include "vcl/wrkwin.hxx"
46 #include "vcl/threadex.hxx"
51 #include "vcl/unohelp.hxx"
52 #include "vcl/unohelp2.hxx"
54 #include "salinst.hxx"
57 #include "com/sun/star/i18n/XCharacterClassification.hpp"
60 #include <boost/scoped_array.hpp>
62 using namespace ::com::sun::star
;
64 static const sal_Char
* pDbgHelpText
[] =
67 "------------------------------------------\n",
72 "When a function is passed with macros, it will be called.\n",
75 "This- and Func-Test will also run when exiting the function.\n",
78 "\nOther tests and macros\n",
79 "------------------------------------------\n",
82 "In case of resource errors an error dialog is produced before the "
83 "exception handler is called.\n",
86 "FixedTexts, CheckBoxes, TriStateBoxes and RadioButtons are equipped with "
87 "a different background color to determine the size of the controls. This "
88 "test also shows whether controls overlap, whether the tab order is correct "
89 "and whether the mnemonic characters are correctly assigned. With dialogs "
90 "it is indicated when no default button or no OK/CancelButton is present. "
91 "These tests are not 100% correct (e.g. too many warnings are given) and "
92 "do not form any guarantee that all problematic cases are covered. For "
93 "example only initial and only visible controls are tested. No errors are "
94 "found which will occur during the use of a dialog.\n",
97 "The application font is set to bold to see if the position of texts is "
98 "sufficient for other systems or other system settings. With very narrow "
99 "fonts the dialogs are made wider because they otherwise appear too narrow.\n",
103 "------------------------------------------\n",
105 "You can indicate where the data will be output:\n",
108 "Output is suppressed.\n",
111 "Outputi n debug file. Filename can be entered in the Editfield.\n",
114 "Output to a small debug window. The window size is stored if the debug "
115 "dialog is closed with OK and if the window is visible. Each assertion text can "
116 "be copied to the clipboard via the context menu of the respective entry.\n",
119 "Output to a debug system (Windows debug window) when available or under "
120 "Unix in the shell window. Otherwise the same as Window.\n",
123 "Output to a MessageBox. In this case you can select whether the program "
124 "must be continued, terminated (Application::Abort) or interrupted with "
125 "CoreDump. Additionally on some systems you get a \"Copy\" button pressing which "
126 "copies the text of the MessageBox to the clipboard. Because a MessageBox allows "
127 "further event processing other errors caused by Paint, Activate/Deactivate, "
128 "GetFocus/LoseFocus can cause more errors or incorrect errors and messages. "
129 "Therefore the message should also be directed to a file/debugger in case of "
130 "problems in order to produce the (right) error messages.\n",
133 "When the TestTool runs messages will be redirected inside the TestTool.\n",
136 "Attempt to activate the debugger and produce the message there, in order to "
137 "always obtain the corresponding stack trace in the debugger.\n",
140 "Aborts the application\n",
143 "Reroute osl messages - Checkbox\n",
144 "OSL_ASSERT and similar messages can be intercepted by the general DBG GUI\n",
145 "or handled system specific as per normal handling in the sal library.\n",
146 "default is to reroute osl assertions\n",
150 "------------------------------------------\n",
152 "Where by default the INI file is read and written the following "
155 "WIN/WNT (WIN.INI, Group SV, Default: dbgsv.ini):\n",
158 "OS2 (OS2.INI, Application SV, Default: dbgsv.ini):\n",
161 "UNIX (Environment variable, Default: .dbgsv.init):\n",
164 "MAC (Default: dbgsv.ini):\n",
165 "INI: not possible\n",
167 "The path and file name must always be specified.\n",
171 "------------------------------------------\n",
175 "const sal_Char* DbgCheckString( const void* pString )\n",
177 " String* p = (String*)pString;\n",
179 " if ( p->mpData->maStr[p->mpData->mnLen] != 0 )\n",
180 " return \"String damaged: aStr[nLen] != 0\";\n",
186 "String::String()\n",
191 "String::~String()\n",
196 "char& String::operator [] ( sal_uInt16 nIndex )\n",
198 " DBG_ASSERT( nIndex <= pData->nLen, \"String::[] : nIndex > Len\" );\n",
207 class DbgInfoDialog
: public ModalDialog
210 VclPtr
<ListBox
> maListBox
;
211 VclPtr
<OKButton
> maOKButton
;
215 DbgInfoDialog( vcl::Window
* pParent
, bool bHelpText
= false );
217 void SetInfoText( const OUString
& rStr
);
219 virtual void dispose() SAL_OVERRIDE
;
220 virtual ~DbgInfoDialog() { disposeOnce(); }
223 class DbgDialog
: public ModalDialog
226 VclPtr
<CheckBox
> maRes
;
227 VclPtr
<CheckBox
> maDialog
;
228 VclPtr
<CheckBox
> maBoldAppFont
;
229 VclPtr
<GroupBox
> maBox3
;
231 VclPtr
<OKButton
> maOKButton
;
232 VclPtr
<CancelButton
> maCancelButton
;
233 VclPtr
<HelpButton
> maHelpButton
;
238 DECL_LINK( ClickHdl
, Button
* );
239 void RequestHelp( const HelpEvent
& rHEvt
) SAL_OVERRIDE
;
241 virtual void dispose() SAL_OVERRIDE
;
242 virtual ~DbgDialog() { disposeOnce(); }
245 DbgDialog::DbgDialog() :
246 ModalDialog( NULL
, WB_STDMODAL
| WB_SYSTEMWINDOW
),
247 maRes(VclPtr
<CheckBox
>::Create(this)),
248 maDialog(VclPtr
<CheckBox
>::Create(this)),
249 maBoldAppFont(VclPtr
<CheckBox
>::Create(this)),
250 maBox3(VclPtr
<GroupBox
>::Create(this)),
251 maOKButton(VclPtr
<OKButton
>::Create(this, WB_DEFBUTTON
)),
252 maCancelButton(VclPtr
<CancelButton
>::Create(this)),
253 maHelpButton(VclPtr
<HelpButton
>::Create(this))
255 DbgData
* pData
= DbgGetData();
256 MapMode
aAppMap( MAP_APPFONT
);
257 Size aButtonSize
= LogicToPixel( Size( 60, 12 ), aAppMap
);
261 maRes
->SetText("~Resourcen");
262 if ( pData
->nTestFlags
& DBG_TEST_RESOURCE
)
263 maRes
->Check( true );
264 maRes
->SetPosSizePixel( LogicToPixel( Point( 75, 95 ), aAppMap
),
270 maDialog
->SetText("~Dialog");
271 if ( pData
->nTestFlags
& DBG_TEST_DIALOG
)
272 maDialog
->Check( true );
273 maDialog
->SetPosSizePixel( LogicToPixel( Point( 140, 95 ), aAppMap
),
278 maBoldAppFont
->Show();
279 maBoldAppFont
->SetText("~Bold AppFont");
280 if ( pData
->nTestFlags
& DBG_TEST_BOLDAPPFONT
)
281 maBoldAppFont
->Check( true );
282 maBoldAppFont
->SetPosSizePixel( LogicToPixel( Point( 205, 95 ), aAppMap
),
284 maBoldAppFont
->SaveValue();
289 maBox3
->SetText("Test Options");
290 maBox3
->SetPosSizePixel( LogicToPixel( Point( 5, 85 ), aAppMap
),
291 LogicToPixel( Size( 330, 30 ), aAppMap
) );
296 maOKButton
->SetClickHdl( LINK( this, DbgDialog
, ClickHdl
) );
297 maOKButton
->SetPosSizePixel( LogicToPixel( Point( 10, 260 ), aAppMap
),
298 LogicToPixel( Size( 50, 15 ), aAppMap
) );
301 maCancelButton
->Show();
302 maCancelButton
->SetPosSizePixel( LogicToPixel( Point( 70, 260 ), aAppMap
),
303 LogicToPixel( Size( 50, 15 ), aAppMap
) );
306 maHelpButton
->Show();
307 maHelpButton
->SetPosSizePixel( LogicToPixel( Point( 190, 260 ), aAppMap
),
308 LogicToPixel( Size( 50, 15 ), aAppMap
) );
312 SetText("VCL Debug Options");
313 SetOutputSizePixel( LogicToPixel( Size( 340, 280 ), aAppMap
) );
317 IMPL_LINK( DbgDialog
, ClickHdl
, Button
*, pButton
)
319 if ( pButton
== maOKButton
)
323 memcpy( &aData
, DbgGetData(), sizeof( DbgData
) );
324 aData
.nTestFlags
= 0;
326 if ( maRes
->IsChecked() )
327 aData
.nTestFlags
|= DBG_TEST_RESOURCE
;
329 if ( maDialog
->IsChecked() )
330 aData
.nTestFlags
|= DBG_TEST_DIALOG
;
332 if ( maBoldAppFont
->IsChecked() )
333 aData
.nTestFlags
|= DBG_TEST_BOLDAPPFONT
;
336 DbgSaveData( aData
);
338 DbgData
* pData
= DbgGetData();
339 #define IMMEDIATE_FLAGS (DBG_TEST_RESOURCE | DBG_TEST_DIALOG | DBG_TEST_BOLDAPPFONT)
340 pData
->nTestFlags
&= ~IMMEDIATE_FLAGS
;
341 pData
->nTestFlags
|= aData
.nTestFlags
& IMMEDIATE_FLAGS
;
342 if ( maBoldAppFont
->IsValueChangedFromSaved() )
344 AllSettings aSettings
= Application::GetSettings();
345 StyleSettings aStyleSettings
= aSettings
.GetStyleSettings();
346 vcl::Font aFont
= aStyleSettings
.GetAppFont();
347 if ( maBoldAppFont
->IsChecked() )
348 aFont
.SetWeight( WEIGHT_BOLD
);
350 aFont
.SetWeight( WEIGHT_NORMAL
);
351 aStyleSettings
.SetAppFont( aFont
);
352 aSettings
.SetStyleSettings( aStyleSettings
);
353 Application::SetSettings( aSettings
);
355 if( (aData
.nTestFlags
& ~IMMEDIATE_FLAGS
) != (pData
->nTestFlags
& ~IMMEDIATE_FLAGS
) )
357 ScopedVclPtrInstance
<MessageDialog
> aBox(this, OUString(
358 "Some of the changed settings will only be active after "
359 "restarting the process"), VCL_MESSAGE_INFO
);
368 void DbgDialog::RequestHelp( const HelpEvent
& rHEvt
)
370 if ( rHEvt
.GetMode() & HelpEventMode::CONTEXT
)
372 ScopedVclPtrInstance
< DbgInfoDialog
> aInfoDialog( this, true );
374 const sal_Char
** pHelpStrs
= pDbgHelpText
;
377 aHelpText
+= OUString::createFromAscii(*pHelpStrs
);
380 aInfoDialog
->SetText( "Debug Hilfe" );
381 aInfoDialog
->SetInfoText( aHelpText
);
382 aInfoDialog
->Execute();
386 void DbgDialog::dispose()
388 maRes
.disposeAndClear();
389 maDialog
.disposeAndClear();
390 maBoldAppFont
.disposeAndClear();
391 maBox3
.disposeAndClear();
392 maOKButton
.disposeAndClear();
393 maCancelButton
.disposeAndClear();
394 maHelpButton
.disposeAndClear();
395 ModalDialog::dispose();
398 DbgInfoDialog::DbgInfoDialog( vcl::Window
* pParent
, bool bHelpText
) :
399 ModalDialog( pParent
, WB_STDMODAL
),
400 maListBox(VclPtr
<ListBox
>::Create( this, WB_BORDER
| WB_AUTOHSCROLL
)),
401 maOKButton(VclPtr
<OKButton
>::Create(this, WB_DEFBUTTON
))
403 mbHelpText
= bHelpText
;
407 vcl::Font aFont
= GetDefaultFont( DefaultFontType::FIXED
, LANGUAGE_ENGLISH_US
, GetDefaultFontFlags::NONE
);
408 aFont
.SetHeight( 8 );
409 aFont
.SetPitch( PITCH_FIXED
);
410 maListBox
->SetControlFont( aFont
);
412 maListBox
->SetPosSizePixel( Point( 5, 5 ), Size( 630, 380 ) );
415 maOKButton
->SetPosSizePixel( Point( 290, 390 ), Size( 60, 25 ) );
418 SetOutputSizePixel( Size( 640, 420 ) );
421 void DbgInfoDialog::SetInfoText( const OUString
& rStr
)
423 maListBox
->SetUpdateMode( false );
425 OUString aStr
= convertLineEnd(rStr
, LINEEND_LF
);
426 sal_Int32 nStrIndex
= 0;
427 sal_Int32 nFoundIndex
;
430 nFoundIndex
= aStr
.indexOf( '\n', nStrIndex
);
431 OUString aTextParagraph
= aStr
.copy( nStrIndex
, nFoundIndex
-nStrIndex
);
434 long nMaxWidth
= maListBox
->GetOutputSizePixel().Width()-30;
435 sal_Int32 nLastIndex
= 0;
436 sal_Int32 nIndex
= aTextParagraph
.indexOf( ' ' );
437 while ( nIndex
!= -1 )
439 if ( maListBox
->GetTextWidth( aTextParagraph
, 0, nIndex
) > nMaxWidth
)
442 nLastIndex
= nIndex
+1;
443 OUString aTempStr
= aTextParagraph
.copy( 0, nLastIndex
);
444 aTextParagraph
= aTextParagraph
.replaceAt( 0, nLastIndex
, "" );
445 maListBox
->InsertEntry( aTempStr
);
449 nLastIndex
= nIndex
+1;
450 nIndex
= aTextParagraph
.indexOf( ' ', nLastIndex
);
453 if ( maListBox
->GetTextWidth( aTextParagraph
, 0, nIndex
) > nMaxWidth
)
456 nLastIndex
= nIndex
+1;
457 OUString aTempStr
= aTextParagraph
.copy( 0, nLastIndex
);
458 aTextParagraph
= aTextParagraph
.replaceAt( 0, nLastIndex
, "" );
459 maListBox
->InsertEntry( aTempStr
);
462 maListBox
->InsertEntry( aTextParagraph
);
463 nStrIndex
= nFoundIndex
+1;
465 while ( nFoundIndex
!= -1 );
466 maListBox
->SetUpdateMode( true );
469 void DbgInfoDialog::dispose()
471 maListBox
.disposeAndClear();
472 maOKButton
.disposeAndClear();
473 ModalDialog::dispose();
476 void DbgDialogTest( vcl::Window
* pWindow
)
478 bool aAccelBuf
[65536] = {false};
479 sal_uInt16 nChildCount
= pWindow
->GetChildCount();
480 vcl::Window
* pGetChild
= pWindow
->GetWindow( GetWindowType::FirstChild
);
487 boost::scoped_array
<Rectangle
> pRectAry(reinterpret_cast<Rectangle
*>(new long[(sizeof(Rectangle
)*nChildCount
)/sizeof(long)]));
488 memset( pRectAry
.get(), 0, sizeof(Rectangle
)*nChildCount
);
490 if ( pWindow
->IsDialog() )
492 bool bOKCancelButton
= false;
493 bool bDefPushButton
= false;
494 bool bButton
= false;
495 pGetChild
= pWindow
->GetWindow( GetWindowType::FirstChild
);
498 pChild
= pGetChild
->ImplGetWindow();
500 if ( pChild
->ImplIsPushButton() )
503 if ( (pChild
->GetType() == WINDOW_OKBUTTON
) || (pChild
->GetType() == WINDOW_CANCELBUTTON
) )
504 bOKCancelButton
= true;
505 if ( pChild
->GetStyle() & WB_DEFBUTTON
)
506 bDefPushButton
= true;
509 pGetChild
= pGetChild
->GetWindow( GetWindowType::Next
);
515 !bOKCancelButton
, "vcl",
516 "Dialogs should have a OK- or CancelButton");
518 !bDefPushButton
, "vcl",
519 "Dialogs should have a Button with WB_DEFBUTTON");
524 pGetChild
= pWindow
->GetWindow( GetWindowType::FirstChild
);
527 pChild
= pGetChild
->ImplGetWindow();
529 if ( (pChild
->GetType() != WINDOW_TABCONTROL
) &&
530 (pChild
->GetType() != WINDOW_TABPAGE
) &&
531 (pChild
->GetType() != WINDOW_GROUPBOX
) )
533 OUString aText
= pChild
->GetText();
534 OUString aErrorText
= aText
;
535 sal_Int32 nAccelPos
= -1;
536 sal_Unicode cAccel
= 0;
537 if ( aErrorText
.getLength() > 128 )
539 aErrorText
= aErrorText
.replaceAt( 128, aErrorText
.getLength()-128, "" );
542 if ( !aText
.isEmpty() && (aText
.getLength() < 1024) )
544 nAccelPos
= aText
.indexOf( '~' );
545 if ( nAccelPos
!= -1 )
547 const ::com::sun::star::lang::Locale
& rLocale
= Application::GetSettings().GetLanguageTag().getLocale();
548 uno::Reference
< i18n::XCharacterClassification
> xCharClass
= vcl::unohelper::CreateCharacterClassification();
549 OUString aUpperText
= xCharClass
->toUpper( aText
, 0, aText
.getLength(), rLocale
);
550 cAccel
= aUpperText
[nAccelPos
+1];
551 if ( pChild
->IsVisible() )
553 if ( aAccelBuf
[cAccel
] )
555 "vcl.app", "Double mnemonic char: " << cAccel
);
557 aAccelBuf
[cAccel
] = true;
562 if ( (pChild
->GetType() == WINDOW_RADIOBUTTON
) ||
563 (pChild
->GetType() == WINDOW_CHECKBOX
) ||
564 (pChild
->GetType() == WINDOW_TRISTATEBOX
) ||
565 (pChild
->GetType() == WINDOW_PUSHBUTTON
) )
567 if ( !aText
.isEmpty() && aText
!= "..." )
570 if ( pChild
->GetType() == WINDOW_RADIOBUTTON
)
571 pClass
= "RadioButton";
572 else if ( pChild
->GetType() == WINDOW_CHECKBOX
)
574 else if ( pChild
->GetType() == WINDOW_TRISTATEBOX
)
575 pClass
= "TriStateBox";
576 else if ( pChild
->GetType() == WINDOW_PUSHBUTTON
)
577 pClass
= "PushButton";
582 pClass
<< " should have a mnemonic char (~): "
587 switch( pChild
->GetType() )
589 case WINDOW_RADIOBUTTON
:
590 aWidth
= static_cast<RadioButton
*>(pChild
)->CalcMinimumSize(0).Width();
592 case WINDOW_CHECKBOX
:
593 case WINDOW_TRISTATEBOX
:
594 aWidth
= static_cast<CheckBox
*>(pChild
)->CalcMinimumSize(0).Width();
596 case WINDOW_PUSHBUTTON
:
597 aWidth
= static_cast<PushButton
*>(pChild
)->CalcMinimumSize(0).Width();
602 pChild
->IsVisible() && pChild
->GetSizePixel().Width() < aWidth
,
604 pClass
<< " exceeds window width: " << aErrorText
);
609 (pChild
->GetType() == WINDOW_FIXEDLINE
610 && pChild
->GetSizePixel().Width() < pChild
->GetTextWidth( aText
)),
611 "vcl.app", "FixedLine exceeds window width: " << aErrorText
);
613 if ( pChild
->GetType() == WINDOW_FIXEDTEXT
)
616 (pChild
->GetSizePixel().Height() >= pChild
->GetTextHeight()*2) && !(pChild
->GetStyle() & WB_WORDBREAK
),
618 "FixedText greater than one line, but WordBreak is not set: "
621 if ( pChild
->IsVisible() )
624 if( nAccelPos
!= -1 )
626 aWidth
= pChild
->GetTextWidth( aText
, 0, nAccelPos
) +
627 pChild
->GetTextWidth( aText
, nAccelPos
+1, aText
.getLength() - nAccelPos
- 1);
630 aWidth
= pChild
->GetTextWidth( aText
);
633 pChild
->GetSizePixel().Width() < aWidth
&& !(pChild
->GetStyle() & WB_WORDBREAK
),
635 "FixedText exceeds window width: " << aErrorText
);
638 if ( (i
+1 < nChildCount
) && !aText
.isEmpty() )
640 vcl::Window
* pTempChild
= pGetChild
->GetWindow( GetWindowType::Next
)->ImplGetWindow();
641 if ( (pTempChild
->GetType() == WINDOW_EDIT
) ||
642 (pTempChild
->GetType() == WINDOW_MULTILINEEDIT
) ||
643 (pTempChild
->GetType() == WINDOW_SPINFIELD
) ||
644 (pTempChild
->GetType() == WINDOW_PATTERNFIELD
) ||
645 (pTempChild
->GetType() == WINDOW_NUMERICFIELD
) ||
646 (pTempChild
->GetType() == WINDOW_METRICFIELD
) ||
647 (pTempChild
->GetType() == WINDOW_CURRENCYFIELD
) ||
648 (pTempChild
->GetType() == WINDOW_DATEFIELD
) ||
649 (pTempChild
->GetType() == WINDOW_TIMEFIELD
) ||
650 (pTempChild
->GetType() == WINDOW_LISTBOX
) ||
651 (pTempChild
->GetType() == WINDOW_MULTILISTBOX
) ||
652 (pTempChild
->GetType() == WINDOW_COMBOBOX
) ||
653 (pTempChild
->GetType() == WINDOW_PATTERNBOX
) ||
654 (pTempChild
->GetType() == WINDOW_NUMERICBOX
) ||
655 (pTempChild
->GetType() == WINDOW_METRICBOX
) ||
656 (pTempChild
->GetType() == WINDOW_CURRENCYBOX
) ||
657 (pTempChild
->GetType() == WINDOW_DATEBOX
) ||
658 (pTempChild
->GetType() == WINDOW_TIMEBOX
) )
662 "Labels before Fields (Edit,ListBox,...) should have a mnemonic char (~): "
665 !pTempChild
->IsEnabled() && pChild
->IsEnabled(),
667 "Labels before Fields (Edit,ListBox,...) should be disabled, when the field is disabled: "
674 (pChild
->GetType() == WINDOW_MULTILINEEDIT
675 && (pChild
->GetStyle() & (WB_IGNORETAB
| WB_READONLY
)) == 0),
677 ("editable MultiLineEdits in Dialogs should have the Style"
680 if ( (pChild
->GetType() == WINDOW_RADIOBUTTON
) ||
681 (pChild
->GetType() == WINDOW_CHECKBOX
) ||
682 (pChild
->GetType() == WINDOW_TRISTATEBOX
) ||
683 (pChild
->GetType() == WINDOW_FIXEDTEXT
) )
685 pChild
->SetBackground( Wallpaper( Color( COL_LIGHTGREEN
) ) );
688 if ( pChild
->IsVisible() )
690 bool bMaxWarning
= false;
691 if ( pChild
->GetType() == WINDOW_NUMERICFIELD
)
693 NumericField
* pField
= static_cast<NumericField
*>(pChild
);
694 if ( pField
->GetMax() == LONG_MAX
)
697 else if ( pChild
->GetType() == WINDOW_METRICFIELD
)
699 MetricField
* pField
= static_cast<MetricField
*>(pChild
);
700 if ( pField
->GetMax() == LONG_MAX
)
703 else if ( pChild
->GetType() == WINDOW_CURRENCYFIELD
)
705 CurrencyField
* pField
= static_cast<CurrencyField
*>(pChild
);
706 if ( pField
->GetMax() == LONG_MAX
)
709 else if ( pChild
->GetType() == WINDOW_TIMEFIELD
)
711 TimeField
* pField
= static_cast<TimeField
*>(pChild
);
712 if ( pField
->GetMax() == tools::Time( 23, 59, 59, 99 ) )
715 else if ( pChild
->GetType() == WINDOW_DATEFIELD
)
717 DateField
* pField
= static_cast<DateField
*>(pChild
);
718 if ( pField
->GetMax() == Date( 31, 12, 9999 ) )
721 else if ( pChild
->GetType() == WINDOW_NUMERICBOX
)
723 NumericBox
* pBox
= static_cast<NumericBox
*>(pChild
);
724 if ( pBox
->GetMax() == LONG_MAX
)
727 else if ( pChild
->GetType() == WINDOW_METRICBOX
)
729 MetricBox
* pBox
= static_cast<MetricBox
*>(pChild
);
730 if ( pBox
->GetMax() == LONG_MAX
)
733 else if ( pChild
->GetType() == WINDOW_CURRENCYBOX
)
735 CurrencyBox
* pBox
= static_cast<CurrencyBox
*>(pChild
);
736 if ( pBox
->GetMax() == LONG_MAX
)
739 else if ( pChild
->GetType() == WINDOW_TIMEBOX
)
741 TimeBox
* pBox
= static_cast<TimeBox
*>(pChild
);
742 if ( pBox
->GetMax() == tools::Time( 23, 59, 59, 99 ) )
745 else if ( pChild
->GetType() == WINDOW_DATEBOX
)
747 DateBox
* pBox
= static_cast<DateBox
*>(pChild
);
748 if ( pBox
->GetMax() == Date( 31, 12, 9999 ) )
752 bMaxWarning
, "vcl.app",
753 "No Max-Value is set: " << aErrorText
);
755 if ( (pChild
->GetType() == WINDOW_RADIOBUTTON
) ||
756 (pChild
->GetType() == WINDOW_CHECKBOX
) ||
757 (pChild
->GetType() == WINDOW_TRISTATEBOX
) ||
758 (pChild
->GetType() == WINDOW_PUSHBUTTON
) ||
759 (pChild
->GetType() == WINDOW_OKBUTTON
) ||
760 (pChild
->GetType() == WINDOW_CANCELBUTTON
) ||
761 (pChild
->GetType() == WINDOW_HELPBUTTON
) ||
762 (pChild
->GetType() == WINDOW_IMAGEBUTTON
) ||
763 (pChild
->GetType() == WINDOW_FIXEDTEXT
) ||
764 (pChild
->GetType() == WINDOW_EDIT
) ||
765 (pChild
->GetType() == WINDOW_MULTILINEEDIT
) ||
766 (pChild
->GetType() == WINDOW_SPINFIELD
) ||
767 (pChild
->GetType() == WINDOW_PATTERNFIELD
) ||
768 (pChild
->GetType() == WINDOW_NUMERICFIELD
) ||
769 (pChild
->GetType() == WINDOW_METRICFIELD
) ||
770 (pChild
->GetType() == WINDOW_CURRENCYFIELD
) ||
771 (pChild
->GetType() == WINDOW_DATEFIELD
) ||
772 (pChild
->GetType() == WINDOW_TIMEFIELD
) ||
773 (pChild
->GetType() == WINDOW_LISTBOX
) ||
774 (pChild
->GetType() == WINDOW_MULTILISTBOX
) ||
775 (pChild
->GetType() == WINDOW_COMBOBOX
) ||
776 (pChild
->GetType() == WINDOW_PATTERNBOX
) ||
777 (pChild
->GetType() == WINDOW_NUMERICBOX
) ||
778 (pChild
->GetType() == WINDOW_METRICBOX
) ||
779 (pChild
->GetType() == WINDOW_CURRENCYBOX
) ||
780 (pChild
->GetType() == WINDOW_DATEBOX
) ||
781 (pChild
->GetType() == WINDOW_TIMEBOX
) )
783 Point aNewPos
= pChild
->GetPosPixel();
784 Rectangle
aChildRect( aNewPos
, pChild
->GetSizePixel() );
786 if ( cAccel
|| (pChild
->GetStyle() & WB_TABSTOP
) ||
787 (pChild
->GetType() == WINDOW_RADIOBUTTON
) )
790 (aNewPos
.X() <= aTabPos
.X()) && (aNewPos
.Y() <= aTabPos
.Y()),
792 "Possible wrong childorder for dialogcontrol: "
797 for ( sal_uInt16 j
= 0; j
< i
; j
++ )
800 ((pRectAry
[j
].Right() != 0) || (pRectAry
[j
].Bottom() != 0)) && aChildRect
.IsOver( pRectAry
[j
] ),
802 "Window overlaps with sibling window: "
805 pRectAry
[i
] = aChildRect
;
810 pGetChild
= pGetChild
->GetWindow( GetWindowType::Next
);
815 void ImplDbgTestSolarMutex()
817 assert(ImplGetSVData()->mpDefInst
->CheckYieldMutex() && "SolarMutex not locked");
820 void DbgGUIInitSolarMutexCheck()
822 DbgSetTestSolarMutex( ImplDbgTestSolarMutex
);
825 void DbgGUIDeInitSolarMutexCheck()
827 DbgSetTestSolarMutex( NULL
);
832 DbgData
* pData
= DbgGetData();
836 ScopedVclPtrInstance
< DbgDialog
> xDialog
;
837 // we switch off dialog tests for the debug dialog
838 sal_uLong nOldFlags
= pData
->nTestFlags
;
839 pData
->nTestFlags
&= ~DBG_TEST_DIALOG
;
840 if (!xDialog
->Execute())
841 pData
->nTestFlags
|= (nOldFlags
& DBG_TEST_DIALOG
);
845 ScopedVclPtrInstance
<MessageDialog
>::Create(nullptr, OUString("TOOLS Library has no Debug-Routines"))->Execute();
851 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */