diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-11-24 00:52:07 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-11-24 00:52:07 +0100 |
commit | 9ace8bebd88ff41d65eeaa87a6d1f1dfd8875b6d (patch) | |
tree | aa0104d77acfc11fdf73f4705fba205443cf5750 /sw/source/ui | |
parent | e70c28c4f4f589edf2a74d21648acc212eb80485 (diff) |
sw: enable more debug code:
Whole bunch of code is #if OSL_DEBUG_LEVEL > 1, reduce that to > 0 so more
assertions are active when building --enable-debug or --enable-dbgutil.
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/app/apphdl.cxx | 6 | ||||
-rwxr-xr-x | sw/source/ui/app/docsh2.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/app/docshini.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 7 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/envelp/labprt.cxx | 7 | ||||
-rw-r--r-- | sw/source/ui/misc/docfnote.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/misc/numberingtypelistbox.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/shells/basesh.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/txtattr.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/uiview/pview.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 2 |
13 files changed, 15 insertions, 40 deletions
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index 0183d955ea18..0893ad498315 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -420,16 +420,10 @@ void SwMailMergeWizardExecutor::ExecuteWizard() LINK( this, SwMailMergeWizardExecutor, EndDialogHdl ) ); } -#if OSL_DEBUG_LEVEL > 1 IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, pDialog ) -#else -IMPL_LINK( SwMailMergeWizardExecutor, EndDialogHdl, AbstractMailMergeWizard*, EMPTYARG ) -#endif { -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( pDialog == m_pWizard, "wrong dialog passed to EndDialogHdl!" ); (void) pDialog; -#endif long nRet = m_pWizard->GetResult(); sal_uInt16 nRestartPage = m_pWizard->GetRestartPage(); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 71827e6f860d..1c649e1ef7c1 100755 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -923,12 +923,10 @@ void SwDocShell::Execute(SfxRequest& rReq) break; } } -#if OSL_DEBUG_LEVEL > 1 - { - sal_Bool bWeb = 0 != dynamic_cast<SwWebDocShell*>(this); - OSL_ENSURE(bWeb == sal_True, "SourceView only in WebDocShell"); - } -#endif + + OSL_ENSURE(dynamic_cast<SwWebDocShell*>(this), + "SourceView only in WebDocShell"); + // the SourceView is not the 1 for SwWebDocShell sal_uInt16 nSlot = SID_VIEWSHELL1; sal_Bool bSetModified = sal_False; diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 350cf749c54b..d8a5fb254566 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -612,7 +612,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); } } -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_ENSURE( !this, "it won't do without Sw3Reader" ); #endif diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index f829db963e21..bd58608a7855 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1178,11 +1178,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, } catch (const Exception& rExcept) { -#if OSL_DEBUG_LEVEL > 1 OSL_FAIL(rtl::OUStringToOString(rExcept.Message, osl_getThreadTextEncoding()).getStr()); -#else (void)rExcept; -#endif } } diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index a01bc6ef7f90..a80ff4a3c27d 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -596,15 +596,10 @@ long AbstractMailMergeWizard_Impl::GetResult() return pDlg->GetResult(); } -#if OSL_DEBUG_LEVEL > 1 IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, pDialog ) -#else -IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, EMPTYARG ) -#endif { -#if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( pDialog == pDlg, "wrong dialog passed to EndDialogHdl!" ); -#endif + (void) pDialog; // unused in non-debug aEndDlgHdl.Call( this ); aEndDlgHdl = Link(); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index d3b5e0aaabe0..d2f977baa3bc 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -4909,7 +4909,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default: OSL_ENSURE( !this, "unknown speech command." ); #endif @@ -5177,7 +5177,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } } break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default: OSL_ENSURE( !this, "unknown command." ); #endif diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index b4b7348d60f6..13e054610021 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -113,12 +113,11 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) aRowField.Enable(bEnable); aSynchronCB.Enable(!bEnable); + OSL_ENSURE(!bEnable || pButton == &aPageButton, "NewButton?" ); if ( bEnable ) + { aColField.GrabFocus(); -#if OSL_DEBUG_LEVEL > 1 - else - OSL_ENSURE( pButton == &aPageButton, "NewButton?" ); -#endif + } return 0; } diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index fee905ac8119..3b7a909c9469 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -299,7 +299,7 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum) case FTNNUM_CHAPTER: sSelect = aNumChapter; break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default: OSL_FAIL("Which numbering type?"); #endif diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx index 3421f3c58788..202ead362a41 100644 --- a/sw/source/ui/misc/numberingtypelistbox.cxx +++ b/sw/source/ui/misc/numberingtypelistbox.cxx @@ -148,7 +148,7 @@ sal_Int16 SwNumberingTypeListBox::GetSelectedNumberingType() sal_uInt16 nSelPos = GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nSelPos) nRet = (sal_Int16)(sal_uLong)GetEntryData(nSelPos); -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 else OSL_FAIL("SwNumberingTypeListBox not selected"); #endif diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 0235915e5a9d..38816bab6cea 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -1406,13 +1406,9 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) } else rSh.GetCurAttr( aSet ); -#if OSL_DEBUG_LEVEL > 1 const SvxShadowItem& rShItem = (const SvxShadowItem&)aSet.Get(nWhich); rSet.Put(rShItem); -#else - rSet.Put((const SvxShadowItem&)aSet.Get(nWhich)); -#endif } break; case SID_IMAP: diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx index 8732d0dbe84b..0cb186535b2e 100644 --- a/sw/source/ui/shells/txtattr.cxx +++ b/sw/source/ui/shells/txtattr.cxx @@ -722,12 +722,8 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) { SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT); rSh.GetCurAttr(aSet); -#if OSL_DEBUG_LEVEL > 1 const SfxPoolItem& rItem = aSet.Get(RES_TXTATR_INETFMT, sal_True); rSet.Put(rItem); -#else - rSet.Put(aSet.Get( RES_TXTATR_INETFMT, sal_True)); -#endif nSlot = 0; } break; diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 269e57c12b59..d453e0304274 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1730,7 +1730,7 @@ sal_uInt16 SwPagePreView::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, SID_ATTR_LONG_ULSPACE, SID_ATTR_LONG_LRSPACE, SID_RULER_BORDERS, SID_RULER_PAGE_POS, 0 }; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 { const sal_uInt16* pPtr = aInval + 1; do { diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 53e047cd462a..b55cc3f4f463 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -3817,7 +3817,7 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich) xDrawDefaults = (cppu::OWeakObject*)new SwSvxUnoDrawPool(m_pDoc); xRet = xDrawDefaults; break; -#if OSL_DEBUG_LEVEL > 1 +#if OSL_DEBUG_LEVEL > 0 default: OSL_FAIL("which table?"); #endif } |