summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-06-12 20:11:20 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-17 06:38:57 +0000
commit9c79945ca62b18213728cdd23d9f390304aee1de (patch)
tree94bb9cc30cbb5bb5508875d80fcf975b673fe0ac /vcl/source/window
parent29e91d5eedd2bf20504ce9ada625d33fec19dc9e (diff)
convert DBG_ASSERT in vcl
Change-Id: I732fb1a789f90ca7a7f393cc41a6afe84fecf3d3 Reviewed-on: https://gerrit.libreoffice.org/26200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/accel.cxx2
-rw-r--r--vcl/source/window/accessibility.cxx6
-rw-r--r--vcl/source/window/dialog.cxx6
-rw-r--r--vcl/source/window/dlgctrl.cxx4
-rw-r--r--vcl/source/window/dockmgr.cxx4
-rw-r--r--vcl/source/window/dockwin.cxx2
-rw-r--r--vcl/source/window/event.cxx4
-rw-r--r--vcl/source/window/floatwin.cxx4
-rw-r--r--vcl/source/window/menu.cxx20
-rw-r--r--vcl/source/window/menubarwindow.cxx4
-rw-r--r--vcl/source/window/menufloatingwindow.cxx12
-rw-r--r--vcl/source/window/paint.cxx6
-rw-r--r--vcl/source/window/printdlg.cxx4
-rw-r--r--vcl/source/window/scrwnd.cxx2
-rw-r--r--vcl/source/window/seleng.cxx2
-rw-r--r--vcl/source/window/splitwin.cxx6
-rw-r--r--vcl/source/window/stacking.cxx14
-rw-r--r--vcl/source/window/status.cxx10
-rw-r--r--vcl/source/window/syswin.cxx2
-rw-r--r--vcl/source/window/toolbox2.cxx26
-rw-r--r--vcl/source/window/window.cxx12
-rw-r--r--vcl/source/window/winproc.cxx6
-rw-r--r--vcl/source/window/wrkwin.cxx6
23 files changed, 82 insertions, 82 deletions
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index bf72b66c1d8e..57c1da27cb64 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -176,7 +176,7 @@ void Accelerator::ImplDeleteData()
void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode,
bool bEnable, Accelerator* pAutoAccel )
{
- DBG_ASSERT( nItemId, "Accelerator::InsertItem(): ItemId == 0" );
+ SAL_WARN_IF( !nItemId, "vcl", "Accelerator::InsertItem(): ItemId == 0" );
if ( rKeyCode.IsFunction() )
{
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index f4b6a24b99d6..2b42c13e27b7 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -269,7 +269,7 @@ vcl::Window* Window::GetAccessibleChildWindow( sal_uInt16 n )
if( GetType() == WINDOW_BORDERWINDOW && pChild && pChild->GetType() == WINDOW_MENUBARWINDOW )
{
do pChild = pChild->mpWindowImpl->mpNext; while( pChild && ! pChild->IsVisible() );
- DBG_ASSERT( pChild, "GetAccessibleChildWindow(): wrong index in border window");
+ SAL_WARN_IF( !pChild, "vcl", "GetAccessibleChildWindow(): wrong index in border window");
}
if ( pChild && ( pChild->GetType() == WINDOW_BORDERWINDOW ) && ( pChild->GetChildCount() == 1 ) )
@@ -284,7 +284,7 @@ void Window::SetAccessibleRole( sal_uInt16 nRole )
if ( !mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
- DBG_ASSERT( mpWindowImpl->mpAccessibleInfos->nAccessibleRole == 0xFFFF, "AccessibleRole already set!" );
+ SAL_WARN_IF( mpWindowImpl->mpAccessibleInfos->nAccessibleRole != 0xFFFF, "vcl", "AccessibleRole already set!" );
mpWindowImpl->mpAccessibleInfos->nAccessibleRole = nRole;
}
@@ -516,7 +516,7 @@ void Window::SetAccessibleDescription( const OUString& rDescription )
if ( ! mpWindowImpl->mpAccessibleInfos )
mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
- DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleDescription, "AccessibleDescription already set!" );
+ SAL_WARN_IF( mpWindowImpl->mpAccessibleInfos->pAccessibleDescription, "vcl", "AccessibleDescription already set!" );
delete mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
mpWindowImpl->mpAccessibleInfos->pAccessibleDescription = new OUString( rDescription );
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index f8f67342b78d..0946b0d7fe79 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -820,11 +820,11 @@ bool Dialog::ImplStartExecuteModal()
if ( pParent )
{
pParent = pParent->ImplGetFirstOverlapWindow();
- DBG_ASSERT( pParent->IsReallyVisible(),
+ SAL_WARN_IF( !pParent->IsReallyVisible(), "vcl",
"Dialog::StartExecuteModal() - Parent not visible" );
- DBG_ASSERT( pParent->IsInputEnabled(),
+ SAL_WARN_IF( !pParent->IsInputEnabled(), "vcl",
"Dialog::StartExecuteModal() - Parent input disabled, use another parent to ensure modality!" );
- DBG_ASSERT( ! pParent->IsInModalMode(),
+ SAL_WARN_IF( pParent->IsInModalMode(), "vcl",
"Dialog::StartExecuteModal() - Parent already modally disabled, use another parent to ensure modality!" );
}
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 2dbda7fdfb32..6e5b18a84995 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -186,7 +186,7 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType
sal_uInt16 nFormStart, sal_uInt16 nFormEnd,
sal_uInt16* pIndex )
{
- DBG_ASSERT( (nIndex >= nFormStart) && (nIndex <= nFormEnd),
+ SAL_WARN_IF( (nIndex < nFormStart) || (nIndex > nFormEnd), "vcl",
"Window::ImplGetDlgWindow() - nIndex not in Form" );
vcl::Window* pWindow = nullptr;
@@ -383,7 +383,7 @@ vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pParent, vcl::Window* pWindow,
vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_Unicode cCharCode,
sal_uInt16 nFormStart, sal_uInt16 nFormEnd, bool bCheckEnable )
{
- DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd),
+ SAL_WARN_IF( (rIndex < nFormStart) || (rIndex > nFormEnd), "vcl",
"Window::ImplFindAccelWindow() - rIndex not in Form" );
sal_Unicode cCompareChar;
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 1b8ef138bc6a..107450a434d6 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -110,7 +110,7 @@ void ImplDockFloatWin2::dispose()
IMPL_LINK_NOARG_TYPED(ImplDockFloatWin2, DockTimerHdl, Idle *, void)
{
- DBG_ASSERT( mpDockWin->IsFloatingMode(), "docktimer called but not floating" );
+ SAL_WARN_IF( !mpDockWin->IsFloatingMode(), "vcl", "docktimer called but not floating" );
maDockIdle.Stop();
PointerState aState = GetPointerState();
@@ -136,7 +136,7 @@ IMPL_LINK_NOARG_TYPED(ImplDockFloatWin2, DockTimerHdl, Idle *, void)
IMPL_LINK_NOARG_TYPED(ImplDockFloatWin2, EndDockTimerHdl, Idle *, void)
{
- DBG_ASSERT( mpDockWin->IsFloatingMode(), "enddocktimer called but not floating" );
+ SAL_WARN_IF( !mpDockWin->IsFloatingMode(), "vcl", "enddocktimer called but not floating" );
maEndDockIdle.Stop();
PointerState aState = GetPointerState();
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index a42bca14c5a0..236844686a1b 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -128,7 +128,7 @@ void ImplDockFloatWin::dispose()
IMPL_LINK_NOARG_TYPED(ImplDockFloatWin, DockTimerHdl, Idle *, void)
{
- DBG_ASSERT( mpDockWin->IsFloatingMode(), "docktimer called but not floating" );
+ SAL_WARN_IF( !mpDockWin->IsFloatingMode(), "vcl", "docktimer called but not floating" );
maDockIdle.Stop();
PointerState aState = GetPointerState();
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index aa09c101068c..050b07948f34 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -343,9 +343,9 @@ ImplSVEvent * Window::PostUserEvent( const Link<void*,void>& rLink, void* pCalle
void Window::RemoveUserEvent( ImplSVEvent * nUserEvent )
{
- DBG_ASSERT( nUserEvent->mpWindow.get() == this,
+ SAL_WARN_IF( nUserEvent->mpWindow.get() != this, "vcl",
"Window::RemoveUserEvent(): Event doesn't send to this window or is already removed" );
- DBG_ASSERT( nUserEvent->mbCall,
+ SAL_WARN_IF( !nUserEvent->mbCall, "vcl",
"Window::RemoveUserEvent(): Event is already removed" );
if ( nUserEvent->mpWindow )
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 20b1579b0ad3..2362f13cdf2f 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -65,12 +65,12 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle )
mbInCleanUp = false;
mbGrabFocus = false;
- DBG_ASSERT(pParent, "FloatWindow::FloatingWindow(): - pParent == NULL!");
+ SAL_WARN_IF(!pParent, "vcl", "FloatWindow::FloatingWindow(): - pParent == NULL!");
if (!pParent)
pParent = ImplGetSVData()->maWinData.mpAppWin;
- DBG_ASSERT(pParent, "FloatWindow::FloatingWindow(): - pParent == NULL and no AppWindow exists");
+ SAL_WARN_IF(!pParent, "vcl", "FloatWindow::FloatingWindow(): - pParent == NULL and no AppWindow exists");
// no Border, then we don't need a border window
if (!nStyle)
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index ae832f256a29..f40a5b4e90df 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -383,8 +383,8 @@ MenuItemData* Menu::NbcInsertItem(sal_uInt16 nId, MenuItemBits nBits,
void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nItemBits,
const OString &rIdent, sal_uInt16 nPos)
{
- DBG_ASSERT( nItemId, "Menu::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == MENU_ITEM_NOTFOUND,
+ SAL_WARN_IF( !nItemId, "vcl", "Menu::InsertItem(): ItemId == 0" );
+ SAL_WARN_IF( GetItemPos( nItemId ) != MENU_ITEM_NOTFOUND, "vcl",
"Menu::InsertItem(): ItemId already exists" );
// if Position > ItemCount, append
@@ -597,7 +597,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 n
{
sal_uInt16 nId = rMenu.GetItemId( nPos );
- DBG_ASSERT( pThis->GetItemPos( nId ) == MENU_ITEM_NOTFOUND,
+ SAL_WARN_IF( pThis->GetItemPos( nId ) != MENU_ITEM_NOTFOUND, "vcl",
"Menu::CopyItem(): ItemId already exists" );
MenuItemData* pData = rMenu.GetItemList()->GetData( nId );
@@ -965,7 +965,7 @@ void Menu::EnableItem( sal_uInt16 nItemId, bool bEnable )
vcl::Window* pWin = ImplGetWindow();
if ( pWin && pWin->IsVisible() )
{
- DBG_ASSERT(IsMenuBar(), "Menu::EnableItem - Popup visible!" );
+ SAL_WARN_IF(!IsMenuBar(), "vcl", "Menu::EnableItem - Popup visible!" );
long nX = 0;
size_t nCount = pItemList->size();
for ( size_t n = 0; n < nCount; n++ )
@@ -1003,7 +1003,7 @@ void Menu::ShowItem( sal_uInt16 nItemId, bool bVisible )
size_t nPos;
MenuItemData* pData = pItemList->GetData( nItemId, nPos );
- DBG_ASSERT(!IsMenuBar(), "Menu::ShowItem - ignored for menu bar entries!");
+ SAL_WARN_IF(IsMenuBar(), "vcl", "Menu::ShowItem - ignored for menu bar entries!");
if (!IsMenuBar()&& pData && (pData->bVisible != bVisible))
{
vcl::Window* pWin = ImplGetWindow();
@@ -1413,7 +1413,7 @@ bool Menu::ImplGetNativeSubmenuArrowSize(vcl::RenderContext& rRenderContext, Siz
void Menu::ImplAddDel( ImplMenuDelData& rDel )
{
- DBG_ASSERT( !rDel.mpMenu, "Menu::ImplAddDel(): cannot add ImplMenuDelData twice !" );
+ SAL_WARN_IF( rDel.mpMenu, "vcl", "Menu::ImplAddDel(): cannot add ImplMenuDelData twice !" );
if( !rDel.mpMenu )
{
rDel.mpMenu = this;
@@ -1435,7 +1435,7 @@ void Menu::ImplRemoveDel( ImplMenuDelData& rDel )
while ( pData && (pData->mpNext != &rDel) )
pData = pData->mpNext;
- DBG_ASSERT( pData, "Menu::ImplRemoveDel(): ImplMenuDelData not registered !" );
+ SAL_WARN_IF( !pData, "vcl", "Menu::ImplRemoveDel(): ImplMenuDelData not registered !" );
if( pData )
pData->mpNext = rDel.mpNext;
}
@@ -1499,7 +1499,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
// Separator
if (!IsMenuBar()&& (pData->eType == MenuItemType::SEPARATOR))
{
- //Useless: DBG_ASSERT( !IsMenuBar(), "Separator in MenuBar ?! " );
+ //Useless: SAL_WARN_IF( IsMenuBar(), "vcl", "Separator in MenuBar ?! " );
pData->aSz.Height() = 4;
}
@@ -2899,7 +2899,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const Rectangl
pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
}
- DBG_ASSERT( !ImplGetWindow(), "Win?!" );
+ SAL_WARN_IF( ImplGetWindow(), "vcl", "Win?!" );
Rectangle aRect( rRect );
aRect.SetPos( pW->OutputToScreenPixel( aRect.TopLeft() ) );
@@ -3074,7 +3074,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const Rectangl
pWin->Execute();
- DBG_ASSERT( ! pW->IsDisposed(), "window for popup died, modal count incorrect !" );
+ SAL_WARN_IF( pW->IsDisposed(), "vcl", "window for popup died, modal count incorrect !" );
if( ! pW->IsDisposed() )
pW->ImplDecModalCount();
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 0ff19712f5c9..d849a1d83359 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -509,7 +509,7 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool bSelectEntry, bool b
}
nHighlightedItem = (sal_uInt16)n;
- DBG_ASSERT( ( nHighlightedItem == ITEMPOS_INVALID ) || pMenu->ImplIsVisible( nHighlightedItem ), "ChangeHighlightItem: Not visible!" );
+ SAL_WARN_IF( ( nHighlightedItem != ITEMPOS_INVALID ) && !pMenu->ImplIsVisible( nHighlightedItem ), "vcl", "ChangeHighlightItem: Not visible!" );
if ( nHighlightedItem != ITEMPOS_INVALID )
Invalidate(); //HighlightItem( nHighlightedItem, true );
else if ( nRolloveredItem != ITEMPOS_INVALID )
@@ -1103,7 +1103,7 @@ sal_uInt16 MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link<Me
nId++;
it = m_aAddButtons.find( nId );
} while( it != m_aAddButtons.end() && nId < 128 );
- DBG_ASSERT( nId < 128, "too many addbuttons in menubar" );
+ SAL_WARN_IF( nId >= 128, "vcl", "too many addbuttons in menubar" );
AddButtonEntry& rNewEntry = m_aAddButtons[nId];
rNewEntry.m_nId = nId;
rNewEntry.m_aSelectLink = i_rLink;
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 93ad9879d638..847d1ce16d5a 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -272,7 +272,7 @@ IMPL_LINK_NOARG_TYPED(MenuFloatingWindow, PopupEnd, FloatingWindow*, void)
{
if ( pActivePopup )
{
- //DBG_ASSERT( !pActivePopup->ImplGetWindow(), "PopupEnd, obwohl pActivePopup MIT Window!" );
+ //SAL_WARN_IF( pActivePopup->ImplGetWindow(), "vcl", "PopupEnd, obwohl pActivePopup MIT Window!" );
KillActivePopup(); // should be ok to just remove it
//pActivePopup->bCanceled = true;
}
@@ -585,7 +585,7 @@ void MenuFloatingWindow::ImplScroll( bool bUp )
if ( bScrollUp && bUp )
{
nFirstEntry = pMenu->ImplGetPrevVisible( nFirstEntry );
- DBG_ASSERT( nFirstEntry != ITEMPOS_INVALID, "Scroll?!" );
+ SAL_WARN_IF( nFirstEntry == ITEMPOS_INVALID, "vcl", "Scroll?!" );
long nScrollEntryHeight = pMenu->GetItemList()->GetDataFromPos( nFirstEntry )->aSz.Height();
@@ -608,7 +608,7 @@ void MenuFloatingWindow::ImplScroll( bool bUp )
long nScrollEntryHeight = pMenu->GetItemList()->GetDataFromPos( nFirstEntry )->aSz.Height();
nFirstEntry = pMenu->ImplGetNextVisible( nFirstEntry );
- DBG_ASSERT( nFirstEntry != ITEMPOS_INVALID, "Scroll?!" );
+ SAL_WARN_IF( nFirstEntry == ITEMPOS_INVALID, "vcl", "Scroll?!" );
if ( !bScrollUp )
{
@@ -688,7 +688,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, bool bStartPopupTime
}
nHighlightedItem = (sal_uInt16)n;
- DBG_ASSERT( pMenu->ImplIsVisible( nHighlightedItem ) || nHighlightedItem == ITEMPOS_INVALID, "ChangeHighlightItem: Not visible!" );
+ SAL_WARN_IF( !pMenu->ImplIsVisible( nHighlightedItem ) && nHighlightedItem != ITEMPOS_INVALID, "vcl", "ChangeHighlightItem: Not visible!" );
if( nHighlightedItem != ITEMPOS_INVALID )
{
if (pMenu->pStartedFrom && !pMenu->pStartedFrom->IsMenuBar())
@@ -785,7 +785,7 @@ void MenuFloatingWindow::RenderHighlightItem(vcl::RenderContext& rRenderContext,
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if (n == nPos)
{
- DBG_ASSERT(pMenu->ImplIsVisible(n), "Highlight: Item not visible!");
+ SAL_WARN_IF(!pMenu->ImplIsVisible(n), "vcl", "Highlight: Item not visible!");
if (pData->eType != MenuItemType::SEPARATOR)
{
bool bRestoreLineColor = false;
@@ -869,7 +869,7 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos )
MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n );
if ( n == nPos )
{
- DBG_ASSERT( pMenu->ImplIsVisible( n ), "ImplGetItemRect: Item not visible!" );
+ SAL_WARN_IF( !pMenu->ImplIsVisible( n ), "vcl", "ImplGetItemRect: Item not visible!" );
if ( pData->eType != MenuItemType::SEPARATOR )
{
aRect = Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) );
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 96477e3d8167..b8905bbe618f 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1340,7 +1340,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
bool bOutput = IsOutputEnabled();
EnableOutput();
- DBG_ASSERT( GetMapMode().GetMapUnit() == MAP_PIXEL, "MapMode must be PIXEL based" );
+ SAL_WARN_IF( GetMapMode().GetMapUnit() != MAP_PIXEL, "vcl", "MapMode must be PIXEL based" );
if ( GetMapMode().GetMapUnit() != MAP_PIXEL )
return;
@@ -1453,8 +1453,8 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /
{
// FIXME: scaling: currently this is for pixel copying only
- DBG_ASSERT( ! pDev->HasMirroredGraphics(), "PaintToDevice to mirroring graphics" );
- DBG_ASSERT( ! pDev->IsRTLEnabled(), "PaintToDevice to mirroring device" );
+ SAL_WARN_IF( pDev->HasMirroredGraphics(), "vcl", "PaintToDevice to mirroring graphics" );
+ SAL_WARN_IF( pDev->IsRTLEnabled(), "vcl", "PaintToDevice to mirroring device" );
vcl::Window* pRealParent = nullptr;
if( ! mpWindowImpl->mbVisible )
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index e8cda0ce8c23..f62c9109d12e 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1685,7 +1685,7 @@ PropertyValue* PrintDialog::getValueForWindow( vcl::Window* i_pWindow ) const
if( it != maControlToPropertyMap.end() )
{
pVal = maPController->getValue( it->second );
- DBG_ASSERT( pVal, "property value not found" );
+ SAL_WARN_IF( !pVal, "vcl", "property value not found" );
}
else
{
@@ -1737,7 +1737,7 @@ void PrintDialog::updateWindowFromProperty( const OUString& i_rProperty )
else if( nVal >= 0 && nVal < sal_Int32(rWindows.size() ) )
{
RadioButton* pBtn = dynamic_cast< RadioButton* >( rWindows[nVal].get() );
- DBG_ASSERT( pBtn, "unexpected control for property" );
+ SAL_WARN_IF( !pBtn, "vcl", "unexpected control for property" );
if( pBtn )
pBtn->Check();
}
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index 60355ee5b817..528659ec9162 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -46,7 +46,7 @@ ImplWheelWindow::ImplWheelWindow( vcl::Window* pParent ) :
mnActDeltaY ( 0L )
{
// we need a parent
- DBG_ASSERT( pParent, "ImplWheelWindow::ImplWheelWindow(): Parent not set!" );
+ SAL_WARN_IF( !pParent, "vcl", "ImplWheelWindow::ImplWheelWindow(): Parent not set!" );
const Size aSize( pParent->GetOutputSizePixel() );
const StartAutoScrollFlags nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 952dc8b1f777..05899554205d 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -352,7 +352,7 @@ void SelectionEngine::Command( const CommandEvent& rCEvt )
{
if ( nFlags & SelectionEngineFlags::DRG_ENAB )
{
- DBG_ASSERT( rCEvt.IsMouseEvent(), "STARTDRAG: Not a MouseEvent" );
+ SAL_WARN_IF( !rCEvt.IsMouseEvent(), "vcl", "STARTDRAG: Not a MouseEvent" );
if ( pFunctionSet->IsSelectionAtPoint( rCEvt.GetMousePosPixel() ) )
{
aLastMove = MouseEvent( rCEvt.GetMousePosPixel(),
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 21dfa64a0379..8986f99db13f 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -2652,7 +2652,7 @@ void SplitWindow::InsertItem( sal_uInt16 nId, vcl::Window* pWindow, long nSize,
{
#ifdef DBG_UTIL
sal_uInt16 nDbgDummy;
- DBG_ASSERT( !ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::InsertItem() - Id already exists" );
+ SAL_WARN_IF( ImplFindItem( mpMainSet, nId, nDbgDummy ), "vcl", "SplitWindow::InsertItem() - Id already exists" );
#endif
// Size has to be at least 1.
@@ -2661,7 +2661,7 @@ void SplitWindow::InsertItem( sal_uInt16 nId, vcl::Window* pWindow, long nSize,
ImplSplitSet* pSet = ImplFindSet( mpMainSet, nIntoSetId );
#ifdef DBG_UTIL
- DBG_ASSERT( pSet, "SplitWindow::InsertItem() - Set not exists" );
+ SAL_WARN_IF( !pSet, "vcl", "SplitWindow::InsertItem() - Set not exists" );
#endif
if(!pSet)
{
@@ -2718,7 +2718,7 @@ void SplitWindow::RemoveItem( sal_uInt16 nId )
{
#ifdef DBG_UTIL
sal_uInt16 nDbgDummy;
- DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::RemoveItem() - Id not found" );
+ SAL_WARN_IF( !ImplFindItem( mpMainSet, nId, nDbgDummy ), "vcl", "SplitWindow::RemoveItem() - Id not found" );
#endif
// search set
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index b9bab21e9392..b1c54e502fe0 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -211,7 +211,7 @@ void Window::ImplToBottomChild()
void Window::ImplCalcToTop( ImplCalcToTopData* pPrevData )
{
- DBG_ASSERT( ImplIsOverlapWindow(), "Window::ImplCalcToTop(): Is not a OverlapWindow" );
+ SAL_WARN_IF( !ImplIsOverlapWindow(), "vcl", "Window::ImplCalcToTop(): Is not a OverlapWindow" );
if ( !mpWindowImpl->mbFrame )
{
@@ -238,7 +238,7 @@ void Window::ImplCalcToTop( ImplCalcToTopData* pPrevData )
void Window::ImplToTop( ToTopFlags nFlags )
{
- DBG_ASSERT( ImplIsOverlapWindow(), "Window::ImplToTop(): Is not a OverlapWindow" );
+ SAL_WARN_IF( !ImplIsOverlapWindow(), "vcl", "Window::ImplToTop(): Is not a OverlapWindow" );
if ( mpWindowImpl->mbFrame )
{
@@ -463,7 +463,7 @@ void Window::SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags )
if (!pRefWindow || pRefWindow == this || mpWindowImpl->mbFrame)
return;
- DBG_ASSERT( pRefWindow->mpWindowImpl->mpParent == mpWindowImpl->mpParent, "Window::SetZOrder() - pRefWindow has other parent" );
+ SAL_WARN_IF( pRefWindow->mpWindowImpl->mpParent != mpWindowImpl->mpParent, "vcl", "Window::SetZOrder() - pRefWindow has other parent" );
if ( nFlags & ZOrderFlags::Before )
{
if ( pRefWindow->mpWindowImpl->mpPrev.get() == this )
@@ -842,8 +842,8 @@ static SystemWindow *ImplGetLastSystemWindow( vcl::Window *pWin )
void Window::SetParent( vcl::Window* pNewParent )
{
- DBG_ASSERT( pNewParent, "Window::SetParent(): pParent == NULL" );
- DBG_ASSERT( pNewParent != this, "someone tried to reparent a window to itself" );
+ SAL_WARN_IF( !pNewParent, "vcl", "Window::SetParent(): pParent == NULL" );
+ SAL_WARN_IF( pNewParent == this, "vcl", "someone tried to reparent a window to itself" );
if( pNewParent == this )
return;
@@ -1164,8 +1164,8 @@ void Window::ImplSetFrameParent( const vcl::Window* pParent )
// and reparent them
if( ImplIsRealParentPath( pFrameWindow ) )
{
- DBG_ASSERT( mpWindowImpl->mpFrame != pFrameWindow->mpWindowImpl->mpFrame, "SetFrameParent to own" );
- DBG_ASSERT( mpWindowImpl->mpFrame, "no frame" );
+ SAL_WARN_IF( mpWindowImpl->mpFrame == pFrameWindow->mpWindowImpl->mpFrame, "vcl", "SetFrameParent to own" );
+ SAL_WARN_IF( !mpWindowImpl->mpFrame, "vcl", "no frame" );
SalFrame* pParentFrame = pParent ? pParent->mpWindowImpl->mpFrame : nullptr;
pFrameWindow->mpWindowImpl->mpFrame->SetParent( pParentFrame );
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index e02f427ee5e9..6736e1c54380 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -900,8 +900,8 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
StatusBarItemBits nBits,
long nOffset, sal_uInt16 nPos )
{
- DBG_ASSERT( nItemId, "StatusBar::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == STATUSBAR_ITEM_NOTFOUND,
+ SAL_WARN_IF( !nItemId, "vcl", "StatusBar::InsertItem(): ItemId == 0" );
+ SAL_WARN_IF( GetItemPos( nItemId ) != STATUSBAR_ITEM_NOTFOUND, "vcl",
"StatusBar::InsertItem(): ItemId already exists" );
// default: IN and CENTER
@@ -1334,7 +1334,7 @@ OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const
void StatusBar::StartProgressMode( const OUString& rText )
{
- DBG_ASSERT( !mbProgressMode, "StatusBar::StartProgressMode(): progress mode is active" );
+ SAL_WARN_IF( mbProgressMode, "vcl", "StatusBar::StartProgressMode(): progress mode is active" );
mbProgressMode = true;
mnPercent = 0;
@@ -1354,7 +1354,7 @@ void StatusBar::StartProgressMode( const OUString& rText )
void StatusBar::SetProgressValue( sal_uInt16 nNewPercent )
{
- DBG_ASSERT( mbProgressMode, "StatusBar::SetProgressValue(): no progress mode" );
+ SAL_WARN_IF( !mbProgressMode, "vcl", "StatusBar::SetProgressValue(): no progress mode" );
SAL_WARN_IF( nNewPercent > 100, "vcl", "StatusBar::SetProgressValue(): nPercent > 100" );
if ( mbProgressMode
@@ -1370,7 +1370,7 @@ void StatusBar::SetProgressValue( sal_uInt16 nNewPercent )
void StatusBar::EndProgressMode()
{
- DBG_ASSERT( mbProgressMode, "StatusBar::EndProgressMode(): no progress mode" );
+ SAL_WARN_IF( !mbProgressMode, "vcl", "StatusBar::EndProgressMode(): no progress mode" );
mbProgressMode = false;
maPrgsTxt.clear();
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 660328b99825..80523b4a67e4 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -895,7 +895,7 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar)
}
if ( pMenuBar )
{
- DBG_ASSERT( !pMenuBar->pWindow, "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" );
+ SAL_WARN_IF( pMenuBar->pWindow, "vcl", "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" );
pNewWindow = MenuBar::ImplCreate(mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar);
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow(pNewWindow);
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index c1de5eb21c39..6265289e9a91 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -506,8 +506,8 @@ void ToolBox::InsertItem( const ResId& rResId )
{
bNewCalc = true;
- DBG_ASSERT( aItem.mnId, "ToolBox::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( aItem.mnId ) == TOOLBOX_ITEM_NOTFOUND, "ToolBox::InsertItem(): ItemId already exists" );
+ SAL_WARN_IF( !aItem.mnId, "vcl", "ToolBox::InsertItem(): ItemId == 0" );
+ SAL_WARN_IF( GetItemPos( aItem.mnId ) != TOOLBOX_ITEM_NOTFOUND, "vcl", "ToolBox::InsertItem(): ItemId already exists" );
}
// create item and add to list
@@ -524,8 +524,8 @@ void ToolBox::InsertItem( const ResId& rResId )
void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, ToolBoxItemBits nBits, sal_uInt16 nPos )
{
- DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
+ SAL_WARN_IF( !nItemId, "vcl", "ToolBox::InsertItem(): ItemId == 0" );
+ SAL_WARN_IF( GetItemPos( nItemId ) != TOOLBOX_ITEM_NOTFOUND, "vcl",
"ToolBox::InsertItem(): ItemId already exists" );
// create item and add to list
@@ -544,8 +544,8 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, ToolBoxItemBi
void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, const OUString& rText, ToolBoxItemBits nBits,
sal_uInt16 nPos )
{
- DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
+ SAL_WARN_IF( !nItemId, "vcl", "ToolBox::InsertItem(): ItemId == 0" );
+ SAL_WARN_IF( GetItemPos( nItemId ) != TOOLBOX_ITEM_NOTFOUND, "vcl",
"ToolBox::InsertItem(): ItemId already exists" );
// create item and add to list
@@ -563,8 +563,8 @@ void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, const OUStrin
void ToolBox::InsertItem( sal_uInt16 nItemId, const OUString& rText, ToolBoxItemBits nBits, sal_uInt16 nPos )
{
- DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
+ SAL_WARN_IF( !nItemId, "vcl", "ToolBox::InsertItem(): ItemId == 0" );
+ SAL_WARN_IF( GetItemPos( nItemId ) != TOOLBOX_ITEM_NOTFOUND, "vcl",
"ToolBox::InsertItem(): ItemId already exists" );
// create item and add to list
@@ -601,8 +601,8 @@ void ToolBox::InsertItem(const OUString& rCommand, const css::uno::Reference<css
void ToolBox::InsertWindow( sal_uInt16 nItemId, vcl::Window* pWindow,
ToolBoxItemBits nBits, sal_uInt16 nPos )
{
- DBG_ASSERT( nItemId, "ToolBox::InsertWindow(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
+ SAL_WARN_IF( !nItemId, "vcl", "ToolBox::InsertWindow(): ItemId == 0" );
+ SAL_WARN_IF( GetItemPos( nItemId ) != TOOLBOX_ITEM_NOTFOUND, "vcl",
"ToolBox::InsertWindow(): ItemId already exists" );
// create item and add to list
@@ -708,7 +708,7 @@ void ToolBox::RemoveItem( sal_uInt16 nPos )
void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId )
{
- DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND,
+ SAL_WARN_IF( GetItemPos( nItemId ) != TOOLBOX_ITEM_NOTFOUND, "vcl",
"ToolBox::CopyItem(): ItemId already exists" );
sal_uInt16 nPos = rToolBox.GetItemPos( nItemId );
@@ -1943,8 +1943,8 @@ void ToolBox::ExecuteCustomMenu()
// checks override first, useful during calculation of sizes
bool ToolBox::ImplIsFloatingMode() const
{
- DBG_ASSERT( !(mpData->mbAssumeDocked && mpData->mbAssumeFloating),
- "ToolBox::ImplIsFloatingMode(): cannot assume docked and floating" );
+ SAL_WARN_IF( mpData->mbAssumeDocked && mpData->mbAssumeFloating, "vcl",
+ "cannot assume docked and floating" );
if( mpData->mbAssumeDocked )
return false;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index e70cdc6d99f3..63df1d3a21ec 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -245,9 +245,9 @@ void Window::dispose()
if ( pSVData->maHelpData.mpHelpWin && (pSVData->maHelpData.mpHelpWin->GetParent() == this) )
ImplDestroyHelpWindow( true );
- DBG_ASSERT( pSVData->maWinData.mpTrackWin.get() != this,
+ SAL_WARN_IF( pSVData->maWinData.mpTrackWin.get() == this, "vcl",
"Window::~Window(): Window is in TrackingMode" );
- DBG_ASSERT(!IsMouseCaptured(),
+ SAL_WARN_IF(IsMouseCaptured(), "vcl",
"Window::~Window(): Window has the mouse captured");
// due to old compatibility
@@ -523,7 +523,7 @@ void Window::dispose()
auto myPos = ::std::find( pParentWinData->maTopWindowChildren.begin(),
pParentWinData->maTopWindowChildren.end(), VclPtr<vcl::Window>(this) );
- DBG_ASSERT( myPos != pParentWinData->maTopWindowChildren.end(), "Window::~Window: inconsistency in top window chain!" );
+ SAL_WARN_IF( myPos == pParentWinData->maTopWindowChildren.end(), "vcl", "Window::~Window: inconsistency in top window chain!" );
if ( myPos != pParentWinData->maTopWindowChildren.end() )
pParentWinData->maTopWindowChildren.erase( myPos );
}
@@ -894,7 +894,7 @@ static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData )
{
- DBG_ASSERT( mpWindowImpl->mbFrame || pParent || GetType() == WINDOW_FIXEDIMAGE,
+ SAL_WARN_IF( !mpWindowImpl->mbFrame && !pParent && GetType() != WINDOW_FIXEDIMAGE, "vcl",
"Window::Window(): pParent == NULL" );
ImplSVData* pSVData = ImplGetSVData();
@@ -2359,7 +2359,7 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
pSVData->mpIntroWindow->Hide();
}
- //DBG_ASSERT( !mpWindowImpl->mbSuppressAccessibilityEvents, "Window::Show() - Frame reactivated");
+ //SAL_WARN_IF( mpWindowImpl->mbSuppressAccessibilityEvents, "vcl", "Window::Show() - Frame reactivated");
mpWindowImpl->mbSuppressAccessibilityEvents = false;
mpWindowImpl->mbPaintFrame = true;
@@ -3189,7 +3189,7 @@ Reference< css::awt::XWindowPeer > Window::GetComponentInterface( bool bCreate )
void Window::SetComponentInterface( Reference< css::awt::XWindowPeer > xIFace )
{
UnoWrapperBase* pWrapper = Application::GetUnoWrapper();
- DBG_ASSERT( pWrapper, "SetComponentInterface: No Wrapper!" );
+ SAL_WARN_IF( !pWrapper, "vcl", "SetComponentInterface: No Wrapper!" );
if ( pWrapper )
pWrapper->SetWindowInterface( this, xIFace );
}
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 86871b7fd7f4..733361278d4f 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -332,7 +332,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
{
pChild = pSVData->maWinData.mpCaptureWin;
- DBG_ASSERT( xWindow == pChild->ImplGetFrameWindow(),
+ SAL_WARN_IF( xWindow != pChild->ImplGetFrameWindow(), "vcl",
"ImplHandleMouseEvent: mouse event is not sent to capture window" );
// java client cannot capture mouse correctly
@@ -601,7 +601,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
pSVData->maAppData.mnLastInputTime = tools::Time::GetSystemTicks();
}
- DBG_ASSERT( pChild, "ImplHandleMouseEvent: pChild == NULL" );
+ SAL_WARN_IF( !pChild, "vcl", "ImplHandleMouseEvent: pChild == NULL" );
if (!pChild)
return false;
@@ -631,7 +631,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
// call handler
bool bDrag = false;
bool bCallHelpRequest = true;
- DBG_ASSERT( pChild, "ImplHandleMouseEvent: pChild is NULL" );
+ SAL_WARN_IF( !pChild, "vcl", "ImplHandleMouseEvent: pChild is NULL" );
if (!pChild)
return false;
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index ecd580f73a72..cacdfa0857b4 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -60,7 +60,7 @@ void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentDat
if ( nStyle & WB_APP )
{
ImplSVData* pSVData = ImplGetSVData();
- DBG_ASSERT( !pSVData->maWinData.mpAppWin, "WorkWindow::WorkWindow(): More than one window with style WB_APP" );
+ SAL_WARN_IF( pSVData->maWinData.mpAppWin, "vcl", "WorkWindow::WorkWindow(): More than one window with style WB_APP" );
pSVData->maWinData.mpAppWin = this;
}
@@ -74,7 +74,7 @@ void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, const css::uno:
css::uno::Sequence< sal_Int8 > aSeq;
aSystemWorkWindowToken >>= aSeq;
SystemParentData* pData = reinterpret_cast<SystemParentData*>(aSeq.getArray());
- DBG_ASSERT( aSeq.getLength() == sizeof( SystemParentData ) && pData->nSize == sizeof( SystemParentData ), "WorkWindow::WorkWindow( vcl::Window*, const Any&, WinBits ) called with invalid Any" );
+ SAL_WARN_IF( aSeq.getLength() != sizeof( SystemParentData ) || pData->nSize != sizeof( SystemParentData ), "vcl", "WorkWindow::WorkWindow( vcl::Window*, const Any&, WinBits ) called with invalid Any" );
// init with style 0 as does WorkWindow::WorkWindow( SystemParentData* );
ImplInit( pParent, 0, pData );
}
@@ -216,7 +216,7 @@ bool WorkWindow::IsMinimized() const
bool WorkWindow::SetPluginParent( SystemParentData* pParent )
{
- DBG_ASSERT( ! mbPresentationMode && ! mbFullScreenMode, "SetPluginParent in fullscreen or presentation mode !" );
+ SAL_WARN_IF( mbPresentationMode || mbFullScreenMode, "vcl", "SetPluginParent in fullscreen or presentation mode !" );
bool bWasDnd = Window::ImplStopDnd();