[Libreoffice-commits] .: sw/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Sun Oct 24 14:49:53 PDT 2010
sw/source/ui/app/apphdl.cxx | 4 +-
sw/source/ui/app/docsh.cxx | 2 -
sw/source/ui/app/docsh2.cxx | 4 +-
sw/source/ui/app/docshini.cxx | 2 -
sw/source/ui/app/docst.cxx | 8 ++--
sw/source/ui/app/swmodul1.cxx | 2 -
sw/source/ui/config/barcfg.cxx | 4 +-
sw/source/ui/config/dbconfig.cxx | 2 -
sw/source/ui/config/modcfg.cxx | 2 -
sw/source/ui/config/optload.cxx | 2 -
sw/source/ui/config/prtopt.cxx | 2 -
sw/source/ui/config/uinums.cxx | 2 -
sw/source/ui/dochdl/swdtflvr.cxx | 22 +++++------
sw/source/ui/docvw/AnnotationWin.cxx | 2 -
sw/source/ui/docvw/PostItMgr.cxx | 26 ++++++-------
sw/source/ui/docvw/SidebarWin.cxx | 4 +-
sw/source/ui/docvw/edtdd.cxx | 2 -
sw/source/ui/docvw/edtwin.cxx | 19 +++++-----
sw/source/ui/docvw/edtwin2.cxx | 8 ++--
sw/source/ui/docvw/srcedtw.cxx | 10 ++---
sw/source/ui/fldui/changedb.cxx | 2 -
sw/source/ui/fldui/fldedt.cxx | 4 +-
sw/source/ui/fldui/fldmgr.cxx | 16 ++++----
sw/source/ui/fldui/fldref.cxx | 4 +-
sw/source/ui/fldui/fldtdlg.cxx | 2 -
sw/source/ui/fldui/fldwrap.cxx | 8 ++--
sw/source/ui/fldui/xfldui.cxx | 8 ++--
sw/source/ui/fmtui/tmpdlg.cxx | 4 +-
sw/source/ui/frmdlg/colmgr.cxx | 10 ++---
sw/source/ui/frmdlg/column.cxx | 5 +-
sw/source/ui/frmdlg/frmdlg.cxx | 2 -
sw/source/ui/frmdlg/frmmgr.cxx | 10 ++---
sw/source/ui/frmdlg/frmpage.cxx | 8 ++--
sw/source/ui/frmdlg/pattern.cxx | 2 -
sw/source/ui/frmdlg/uiborder.cxx | 2 -
sw/source/ui/inc/cfgitems.hxx | 2 -
sw/source/ui/inc/fontcfg.hxx | 2 -
sw/source/ui/inc/uinums.hxx | 2 -
sw/source/ui/index/cntex.cxx | 8 ++--
sw/source/ui/index/cnttab.cxx | 44 +++++++++++------------
sw/source/ui/index/idxmrk.cxx | 8 ++--
sw/source/ui/index/swuiidxmrk.cxx | 36 +++++++++----------
sw/source/ui/index/toxmgr.cxx | 16 ++++----
sw/source/ui/lingu/hhcwrp.cxx | 28 +++++++--------
sw/source/ui/lingu/olmenu.cxx | 8 ++--
sw/source/ui/lingu/sdrhhcwrap.cxx | 6 +--
sw/source/ui/misc/docfnote.cxx | 8 ++--
sw/source/ui/misc/glosbib.cxx | 4 +-
sw/source/ui/misc/glosdoc.cxx | 10 ++---
sw/source/ui/misc/glossary.cxx | 4 +-
sw/source/ui/misc/num.cxx | 2 -
sw/source/ui/misc/numberingtypelistbox.cxx | 6 +--
sw/source/ui/misc/outline.cxx | 2 -
sw/source/ui/misc/redlndlg.cxx | 8 ++--
sw/source/ui/ribbar/inputwin.cxx | 6 +--
sw/source/ui/ribbar/tbxanchr.cxx | 2 -
sw/source/ui/ribbar/workctrl.cxx | 2 -
sw/source/ui/shells/annotsh.cxx | 22 +++++------
sw/source/ui/shells/basesh.cxx | 50 +++++++++++++-------------
sw/source/ui/shells/drawdlg.cxx | 8 ++--
sw/source/ui/shells/drawsh.cxx | 12 +++---
sw/source/ui/shells/drformsh.cxx | 6 +--
sw/source/ui/shells/drwbassh.cxx | 14 +++----
sw/source/ui/shells/drwtxtex.cxx | 22 +++++------
sw/source/ui/shells/drwtxtsh.cxx | 6 +--
sw/source/ui/shells/frmsh.cxx | 20 +++++-----
sw/source/ui/shells/grfsh.cxx | 8 ++--
sw/source/ui/shells/langhelper.cxx | 12 +++---
sw/source/ui/shells/listsh.cxx | 4 +-
sw/source/ui/shells/tabsh.cxx | 34 +++++++++---------
sw/source/ui/shells/textdrw.cxx | 2 -
sw/source/ui/shells/textfld.cxx | 20 +++++-----
sw/source/ui/shells/textglos.cxx | 8 ++--
sw/source/ui/shells/textidx.cxx | 20 +++++-----
sw/source/ui/shells/textsh.cxx | 24 ++++++------
sw/source/ui/shells/textsh1.cxx | 40 ++++++++++-----------
sw/source/ui/shells/textsh2.cxx | 4 +-
sw/source/ui/shells/txtattr.cxx | 14 +++----
sw/source/ui/shells/txtcrsr.cxx | 12 +++---
sw/source/ui/shells/txtnum.cxx | 8 ++--
sw/source/ui/table/chartins.cxx | 6 +--
sw/source/ui/table/convert.cxx | 4 +-
sw/source/ui/table/instable.cxx | 4 +-
sw/source/ui/table/swtablerep.cxx | 2 -
sw/source/ui/table/tabledlg.cxx | 33 ++++++++---------
sw/source/ui/table/tablemgr.cxx | 12 +++---
sw/source/ui/table/tautofmt.cxx | 2 -
sw/source/ui/uiview/pview.cxx | 16 ++++----
sw/source/ui/uiview/srcview.cxx | 8 ++--
sw/source/ui/uiview/view.cxx | 2 -
sw/source/ui/uiview/view0.cxx | 2 -
sw/source/ui/uiview/view2.cxx | 32 ++++++++---------
sw/source/ui/uiview/viewcoll.cxx | 4 +-
sw/source/ui/uiview/viewdlg.cxx | 2 -
sw/source/ui/uiview/viewdlg2.cxx | 8 ++--
sw/source/ui/uiview/viewdraw.cxx | 6 +--
sw/source/ui/uiview/viewling.cxx | 10 ++---
sw/source/ui/uiview/viewmdi.cxx | 14 +++----
sw/source/ui/uiview/viewport.cxx | 6 +--
sw/source/ui/uiview/viewprt.cxx | 2 -
sw/source/ui/uiview/viewsrch.cxx | 10 ++---
sw/source/ui/uiview/viewtab.cxx | 23 +++++-------
sw/source/ui/uno/SwXFilterOptions.cxx | 4 +-
sw/source/ui/uno/dlelstnr.cxx | 2 -
sw/source/ui/uno/swdetect.cxx | 2 -
sw/source/ui/uno/swdetect.hxx | 2 -
sw/source/ui/uno/unoatxt.cxx | 26 ++++++-------
sw/source/ui/uno/unomailmerge.cxx | 36 +++++++++----------
sw/source/ui/uno/unomod.cxx | 8 ++--
sw/source/ui/uno/unotxdoc.cxx | 54 ++++++++++++++---------------
sw/source/ui/uno/unotxvw.cxx | 26 ++++++-------
sw/source/ui/utlui/content.cxx | 33 ++++++++---------
sw/source/ui/utlui/glbltree.cxx | 12 +++---
sw/source/ui/utlui/gloslst.cxx | 6 +--
sw/source/ui/utlui/navicfg.cxx | 4 +-
sw/source/ui/utlui/navipi.cxx | 2 -
sw/source/ui/utlui/numfmtlb.cxx | 10 ++---
sw/source/ui/utlui/swrenamexnameddlg.cxx | 4 +-
sw/source/ui/utlui/uiitems.cxx | 6 +--
sw/source/ui/utlui/uitool.cxx | 11 +++--
sw/source/ui/utlui/unotools.cxx | 2 -
sw/source/ui/utlui/viewlayoutctrl.cxx | 2 -
sw/source/ui/vba/vbatablehelper.cxx | 2 -
sw/source/ui/web/wdocsh.cxx | 2 -
sw/source/ui/web/wview.cxx | 2 -
sw/source/ui/wrtsh/delete.cxx | 2 -
sw/source/ui/wrtsh/select.cxx | 2 -
sw/source/ui/wrtsh/wrtsh1.cxx | 18 ++++-----
sw/source/ui/wrtsh/wrtsh2.cxx | 12 +++---
sw/source/ui/wrtsh/wrtsh3.cxx | 2 -
sw/source/ui/wrtsh/wrtundo.cxx | 2 -
131 files changed, 650 insertions(+), 654 deletions(-)
New commits:
commit bf35001fc3055553c132c852ca04ff6c77214316
Author: Jacek Wolszczak <shutdownrunner at gmail.com>
Date: Sun Oct 24 23:48:32 2010 +0200
DBG_* -> OSL_ENSURE cleanup, few German -> English translations.
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 2377fef..4676f13 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -206,7 +206,7 @@ void SwModule::StateOther(SfxItemSet &rSet)
IsInsTblFormatNum( bWebView )));
break;
default:
- DBG_ERROR("::StateOther: default");
+ OSL_ENSURE(false, "::StateOther: default");
}
nWhich = aIter.NextWhich();
}
@@ -306,7 +306,7 @@ void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs
{
if ( m_pView )
{
- DBG_ERROR( "SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" );
+ OSL_ENSURE(false, "SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" );
return;
}
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index c63d490..68172fd 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -828,7 +828,7 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS
{
if ( !pOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) )
{
- DBG_ERROR( "Copying of objects didn't work!" );
+ OSL_ENSURE(false, "Copying of objects didn't work!" );
}
}
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 3250151..02a8639 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -1304,7 +1304,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
catch(Exception& )
{
- DBG_ERROR("control acces failed");
+ OSL_ENSURE(false, "control acces failed");
}
xFP->setTitle( SW_RESSTR( nStrId ));
@@ -1425,7 +1425,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
break;
- default: DBG_ERROR("falscher Dispatcher");
+ default: OSL_ENSURE(false, "wrong Dispatcher");
}
}
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 9cc11af..a3d7276 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -692,7 +692,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium )
}
else
{
- DBG_ERROR("Code removed!");
+ OSL_ENSURE(false, "Code removed!");
}
SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 3152a0a..2fbb55b 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -257,7 +257,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
break;
default:
- DBG_ERROR( "Invalid SlotId");
+ OSL_ENSURE(false, "Invalid SlotId");
}
nWhich = aIter.NextWhich();
}
@@ -485,7 +485,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
break;
default:
- DBG_ERROR( "Invalid SlotId");
+ OSL_ENSURE(false, "Invalid SlotId");
}
rReq.Done();
@@ -893,7 +893,7 @@ USHORT SwDocShell::ApplyStyles(const String &rName, USHORT nFamily,
break;
}
default:
- DBG_ERROR("Unknown family");
+ OSL_ENSURE(false, "Unknown family");
}
pSh->EndAllAction();
@@ -948,7 +948,7 @@ USHORT SwDocShell::DoWaterCan(const String &rName, USHORT nFamily)
break;
default:
- DBG_ERROR( "Unknown family");
+ OSL_ENSURE(false, "Unknown family");
}
}
else
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 8d7ac28..cbcef9a 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -404,7 +404,7 @@ void SwModule::ShowDBObj(SwView& rView, const SwDBData& rData, BOOL /*bOnlyIfAva
xControllerSelection->select(makeAny(aSelection.createPropertyValueSequence()));
}
else {
- DBG_ERROR("no selection supplier in the beamer!");
+ OSL_ENSURE(false, "no selection supplier in the beamer!");
}
}
}
diff --git a/sw/source/ui/config/barcfg.cxx b/sw/source/ui/config/barcfg.cxx
index b92b9f4..8c8ef22 100644
--- a/sw/source/ui/config/barcfg.cxx
+++ b/sw/source/ui/config/barcfg.cxx
@@ -30,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <wrtsh.hxx>
@@ -58,7 +58,7 @@ SwToolbarConfigItem::SwToolbarConfigItem( BOOL bWeb ) :
Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues = GetProperties(aNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
if(aValues.getLength() == aNames.getLength())
{
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
diff --git a/sw/source/ui/config/dbconfig.cxx b/sw/source/ui/config/dbconfig.cxx
index 4161b7a..c49f457 100644
--- a/sw/source/ui/config/dbconfig.cxx
+++ b/sw/source/ui/config/dbconfig.cxx
@@ -31,7 +31,7 @@
#include <dbconfig.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <swdbdata.hxx>
diff --git a/sw/source/ui/config/modcfg.cxx b/sw/source/ui/config/modcfg.cxx
index 86bdbfb..bb84277 100644
--- a/sw/source/ui/config/modcfg.cxx
+++ b/sw/source/ui/config/modcfg.cxx
@@ -37,7 +37,7 @@
#include <svl/mailenum.hxx>
#include <svx/svxids.hrc>
#include <editeng/svxenum.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <tools/globname.hxx>
#include <swtypes.hxx>
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 2f07abb..899ad9c 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -586,7 +586,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
}
else
{
- DBG_ERRORFILE( "Couldn't get PRODUCTNAME variable" );
+ OSL_ENSURE(false, "Couldn't get PRODUCTNAME variable" );
}
SvObjectServerList aObjS;
diff --git a/sw/source/ui/config/prtopt.cxx b/sw/source/ui/config/prtopt.cxx
index 038c8a2..55a2f05 100644
--- a/sw/source/ui/config/prtopt.cxx
+++ b/sw/source/ui/config/prtopt.cxx
@@ -33,7 +33,7 @@
#include <unotools/configmgr.hxx>
#include <prtopt.hxx>
#include <swprtopt.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index f9ad296..a1695c1 100644
--- a/sw/source/ui/config/uinums.cxx
+++ b/sw/source/ui/config/uinums.cxx
@@ -159,7 +159,7 @@ int SwBaseNumRules::Load(SvStream &rStream)
// gleiche VERSION_40A wie das SP2 #55402#
if(VERSION_40A == nVersion)
{
- DBG_ERROR("Version 364 ist nicht eindeutig #55402#");
+ OSL_ENSURE(false, "Version 364 is not clear #55402#");
}
else if( VERSION_30B == nVersion || VERSION_31B == nVersion ||
ACT_NUM_VERSION >= nVersion )
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index c2dbe91..6b73704 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -317,7 +317,7 @@ SwTransferable::~SwTransferable()
static SwDoc * lcl_GetDoc(SwDocFac & rDocFac)
{
SwDoc *const pDoc = rDocFac.GetDoc();
- ASSERT( pDoc, "Document not found" );
+ OSL_ENSURE( pDoc, "Document not found" );
if (pDoc)
{
pDoc->SetClipBoard( true );
@@ -622,7 +622,7 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
const SvxFontHeightItem& rDefaultFontHeight = (const SvxFontHeightItem&)rItemPool.GetDefaultItem(EE_CHAR_FONTHEIGHT);
// SW should have no MasterPages
- DBG_ASSERT(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)");
+ OSL_ENSURE(0L == pModel->GetMasterPageCount(), "SW with MasterPages (!)");
for(sal_uInt16 a(0); a < pModel->GetPageCount(); a++)
{
@@ -1253,11 +1253,11 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
switch( nClearedAction )
{
case EXCHG_OUT_ACTION_INSERT_PRIVATE:
-ASSERT( pPt, "EXCHG_OUT_ACTION_INSERT_PRIVATE: was soll hier passieren?" );
+ OSL_ENSURE( pPt, "EXCHG_OUT_ACTION_INSERT_PRIVATE: what should happen here?" );
break;
case EXCHG_OUT_ACTION_MOVE_PRIVATE:
-ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
+ OSL_ENSURE( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: what should happen here?" )
break;
@@ -1371,7 +1371,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
break;
default:
- ASSERT( pPt, "unbekanntes Format" );
+ OSL_ENSURE( pPt, "unknown format" );
}
break;
@@ -1447,7 +1447,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
nActionFlags, bMsg );
break;
default:
- ASSERT( FALSE, "unbekanntes Format" );
+ OSL_ENSURE( false, "unknown format" );
}
break;
@@ -1486,7 +1486,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIVATE: was soll hier passieren?" );
break;
default:
- ASSERT( FALSE, "unbekannte Action" );
+ OSL_ENSURE(false, "unknown action" );
}
}
@@ -1762,7 +1762,7 @@ int SwTransferable::_PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh,
{
if ( !rData.GetTransferableObjectDescriptor( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR, aObjDesc ) )
{
- DBG_ASSERT( !xStrm.is(), "An object without descriptor in clipboard!");
+ OSL_ENSURE( !xStrm.is(), "An object without descriptor in clipboard!");
}
}
else
@@ -2029,7 +2029,7 @@ int SwTransferable::_PasteDDE( TransferableDataHelper& rData,
SotStorageStreamRef xStrm;
if( !rData.GetSotStorageStream( SOT_FORMATSTR_ID_LINK, xStrm ))
{
- ASSERT( !&rWrtShell, "DDE Data not found." );
+ OSL_ENSURE( !&rWrtShell, "DDE Data not found." );
return 0;
} //sinnvollen Fehler melden!!
@@ -2696,7 +2696,7 @@ BOOL SwTransferable::_CheckForURLOrLNKFile( TransferableDataHelper& rData,
String sExt( rFileName.Copy( nLen - 3 ));
if( sExt.EqualsIgnoreCaseAscii( "url" ))
{
-ASSERT( !&rFileName, "how do we read today .URL - Files?" );
+ OSL_ENSURE( !&rFileName, "how do we read today .URL - Files?" );
}
}
}
@@ -3139,7 +3139,7 @@ int SwTransferable::PrivatePaste( SwWrtShell& rShell )
{
// erst den SelectionType erfragen, dann Action-Klammerung !!!!
// (sonst wird nicht in eine TabellenSelektion gepastet!!!)
- ASSERT( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" );
+ OSL_ENSURE( !rShell.ActionPend(), "Paste darf nie eine Actionklammerung haben" );
if ( !pClpDocFac )
return sal_False; // the return value of the SwFEShell::Paste also is BOOL!
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index a8f89b3..26ffa20 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -264,7 +264,7 @@ SvxLanguageItem SwAnnotationWin::GetLanguage(void)
case SCRIPTTYPE_LATIN : nLangWhichId = EE_CHAR_LANGUAGE ; break;
case SCRIPTTYPE_ASIAN : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break;
case SCRIPTTYPE_COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
- default: DBG_ERROR("GetLanguage: wrong script tye");
+ default: OSL_ENSURE(false, "GetLanguage: wrong script type");
}
return SvxLanguageItem(mpFld->GetLanguage(),nLangWhichId);
}
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index e640f4a..93fb75b 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -240,7 +240,7 @@ void SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistance, bool b
if (pItem->ISA(SwRedline))
mvPostItFlds.push_back(new SwRedCommentItem( static_cast<SwRedline*>(pItem), true, bFocus)) ;
*/
- DBG_ASSERT(pItem->ISA(SwFmtFld) /*|| pItem->ISA(SwRedline)*/,"Mgr::InsertItem: seems like new stuff was added");
+ OSL_ENSURE(pItem->ISA(SwFmtFld) /*|| pItem->ISA(SwRedline)*/,"Mgr::InsertItem: seems like new stuff was added");
StartListening(*pItem);
}
@@ -316,7 +316,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if ( mpView->GetDocShell() != &rBC )
{
// field to be removed is the broadcaster
- DBG_ERROR("Notification for removed SwFmtFld was not sent!");
+ OSL_ENSURE(false, "Notification for removed SwFmtFld was not sent!");
RemoveItem(&rBC);
}
break;
@@ -375,7 +375,7 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else
{
- DBG_ERROR( "Inserted field not in document!" );
+ OSL_ENSURE(false, "Inserted field not in document!" );
}
break;
}
@@ -491,7 +491,7 @@ bool SwPostItMgr::CalcRects()
SwSidebarItem* pItem = (*i);
if ( !pItem->UseElement() )
{
- DBG_ERROR("PostIt is not in doc or other wrong use");
+ OSL_ENSURE(false, "PostIt is not in doc or other wrong use");
bRepair = true;
continue;
}
@@ -774,7 +774,7 @@ void SwPostItMgr::LayoutPostIts()
(*i)->ShowAnchorOnly(Point(mPages[n]->mPageRect.Right(),
mPages[n]->mPageRect.Bottom()));
}
- DBG_ASSERT(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): note overlaps, but bScrollbar is not true");
+ OSL_ENSURE(mPages[n]->bScrollbar,"SwPostItMgr::LayoutByPage(): note overlaps, but bScrollbar is not true");
}
}
@@ -814,7 +814,7 @@ void SwPostItMgr::LayoutPostIts()
SwSidebarItem* pItem = (*i);
if ( !pItem->UseElement() )
{
- DBG_ERROR("PostIt is not in doc!");
+ OSL_ENSURE(false, "PostIt is not in doc!");
bRepair = true;
continue;
}
@@ -847,13 +847,13 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
{
if ( mPages[aPage-1]->mList->empty() )
{
- DBG_ERROR("Notes SidePane painted but no rects and page lists calculated!");
+ OSL_ENSURE(false, "Notes SidePane painted but no rects and page lists calculated!");
return false;
}
SwSidebarItem_iterator aItem = mPages[aPage-1]->mList->end();
--aItem;
- DBG_ASSERT ((*aItem)->pPostIt,"BorderOverPageBorder: NULL postIt, should never happen");
+ OSL_ENSURE ((*aItem)->pPostIt,"BorderOverPageBorder: NULL postIt, should never happen");
if ((*aItem)->pPostIt)
{
const long aSidebarheight = mPages[aPage-1]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
@@ -866,7 +866,7 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const
void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage)
{
- DBG_ASSERT((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
+ OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value");
// do not scroll more than neccessary up or down
if ( ((mPages[aPage-1]->lOffset == 0) && (lScroll>0)) || ( BorderOverPageBorder(aPage) && (lScroll<0)) )
return;
@@ -1145,7 +1145,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
// security check so we don't loop forever
if (loop>MAX_LOOP_COUNT)
{
- DBG_ERROR("PostItMgr::Layout(): We are looping forever");
+ OSL_ENSURE(false, "PostItMgr::Layout(): We are looping forever");
break;
}
}
@@ -1444,7 +1444,7 @@ long SwPostItMgr::GetNextBorder()
}
}
- DBG_ERROR("SwPostItMgr::GetNextBorder(): We have to find a next border here");
+ OSL_ENSURE(false, "SwPostItMgr::GetNextBorder(): We have to find a next border here");
return -1;
}
@@ -1534,7 +1534,7 @@ bool SwPostItMgr::IsHit(const Point &aPointPixel)
if( nPageNum )
{
Rectangle aRect;
- DBG_ASSERT(mPages.size()>nPageNum-1,"SwPostitMgr:: page container size wrong");
+ OSL_ENSURE(mPages.size()>nPageNum-1,"SwPostitMgr:: page container size wrong");
aRect = mPages[nPageNum-1]->eSidebarPosition == sw::sidebarwindows::SIDEBAR_LEFT
? Rectangle(Point(aPageFrm.Left()-GetSidebarWidth()-GetSidebarBorderWidth(),aPageFrm.Top()),Size(GetSidebarWidth(),aPageFrm.Height()))
: Rectangle( Point(aPageFrm.Right()+GetSidebarBorderWidth(),aPageFrm.Top()) , Size(GetSidebarWidth(),aPageFrm.Height()));
@@ -1765,7 +1765,7 @@ IMPL_LINK( SwPostItMgr, CalcHdl, void*, /* pVoid*/ )
mnEventId = 0;
if ( mbLayouting )
{
- DBG_ERROR("Reentrance problem in Layout Manager!");
+ OSL_ENSURE(false, "Reentrance problem in Layout Manager!");
mbWaitingForCalcRects = false;
return 0;
}
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index 51c991c..72a9da5 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -493,7 +493,7 @@ void SwSidebarWin::SetPosAndSize()
}
break;
default:
- ASSERT( false,
+ OSL_ENSURE( false,
"<SwSidebarWin::SetPosAndSize()> - unexpected position of sidebar" );
break;
}
@@ -1258,7 +1258,7 @@ void SwSidebarWin::ChangeSidebarItem( SwSidebarItem& rSidebarItem )
{
SidebarWinAccessible* pAcc =
static_cast<SidebarWinAccessible*>( GetWindowPeer() );
- ASSERT( dynamic_cast<SidebarWinAccessible*>( GetWindowPeer() ),
+ OSL_ENSURE( dynamic_cast<SidebarWinAccessible*>( GetWindowPeer() ),
"<SwSidebarWin::ChangeSidebarItem(..)> - unexpected type of window peer -> crash possible!" );
pAcc->ChangeSidebarItem( mrSidebarItem );
}
diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx
index f534194..ede176b 100644
--- a/sw/source/ui/docvw/edtdd.cxx
+++ b/sw/source/ui/docvw/edtdd.cxx
@@ -326,7 +326,7 @@ USHORT SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppObj )
case OBJCNT_URLBUTTON: nDropDestination = EXCHG_DEST_DOC_URLBUTTON; break;
case OBJCNT_GROUPOBJ: nDropDestination = EXCHG_DEST_DOC_GROUPOBJ; break;
- default: ASSERT( !this, "new ObjectType?" );
+ default: OSL_ENSURE( !this, "new ObjectType?" );
}
}
if ( !nDropDestination )
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index eff7432..4d179f2 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -141,6 +141,7 @@
#include <PostItMgr.hxx>
//JP 11.10.2001: enable test code for bug fix 91313
+//TODO: This one could most probably be removed
#if defined(DBG_UTIL) && (OSL_DEBUG_LEVEL > 1)
//#define TEST_FOR_BUG91313
#endif
@@ -849,7 +850,7 @@ void SwEditWin::FlushInBuffer()
// as well, we now expand the selection accordingly.
SwPaM &rCrsr = *rSh.GetCrsr();
xub_StrLen nCrsrStartPos = rCrsr.Start()->nContent.GetIndex();
- DBG_ASSERT( nCrsrStartPos >= nExpandSelection, "cannot expand selection as specified!!" );
+ OSL_ENSURE( nCrsrStartPos >= nExpandSelection, "cannot expand selection as specified!!" );
if (nExpandSelection && nCrsrStartPos >= nExpandSelection)
{
if (!rCrsr.HasMark())
@@ -1038,7 +1039,7 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb )
case MOVE_DOWN_SMALL: if( aTmp.Height() < aSnap.Height() + MINFLY ) break;
nDown = aSnap.Height(); // kein break
case MOVE_DOWN_BIG: aTmp.Top( aTmp.Top() + nDown ); break;
- default: ASSERT( TRUE, "ChangeFly: Unknown direction." );
+ default: OSL_ENSURE(true, "ChangeFly: Unknown direction." );
}
BOOL bSet = FALSE;
if ((FLY_AS_CHAR == eAnchorId) && ( nDir % 2 ))
@@ -1529,7 +1530,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
case KS_CheckKey:
eKeyState = KS_KeyToView; // default weiter zur View
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// JP 19.01.99: zum Umschalten des Cursor Verhaltens in ReadOnly
// Bereichen
@@ -4250,7 +4251,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
else if ( SwContentAtPos::SW_FORMCTRL == aCntntAtPos.eCntntAtPos )
{
- ASSERT( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???");
+ OSL_ENSURE( aCntntAtPos.aFnd.pFldmark != NULL, "where is my field ptr???");
if ( aCntntAtPos.aFnd.pFldmark != NULL)
{
IFieldmark *fieldBM = const_cast< IFieldmark* > ( aCntntAtPos.aFnd.pFldmark );
@@ -4940,9 +4941,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
}
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
default:
- ASSERT( !this, "unknown speech command." );
+ OSL_ENSURE( !this, "unknown speech command." );
#endif
}
if ( nSlotId )
@@ -5208,9 +5209,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
}
}
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
default:
- ASSERT( !this, "unknown command." );
+ OSL_ENSURE( !this, "unknown command." );
#endif
}
if (bCallBase)
@@ -5535,7 +5536,7 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > SwEditWin::Create
vos::OGuard aGuard(Application::GetSolarMutex()); // this should have
// happend already!!!
SwWrtShell *pSh = rView.GetWrtShellPtr();
- ASSERT( pSh, "no writer shell, no accessible object" );
+ OSL_ENSURE( pSh, "no writer shell, no accessible object" );
uno::Reference<
::com::sun::star::accessibility::XAccessible > xAcc;
if( pSh )
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index 06ea4d2..aa9d890 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -32,7 +32,7 @@
#include <hintids.hxx>
#include <doc.hxx>
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -144,7 +144,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
SwContentAtPos::SW_TOXMARK |
SwContentAtPos::SW_REFMARK |
SwContentAtPos::SW_SMARTTAG |
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
SwContentAtPos::SW_TABLEBOXVALUE |
( bBalloon ? SwContentAtPos::SW_CURR_ATTRS : 0) |
#endif
@@ -158,7 +158,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
sTxt.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "= " ));
sTxt += ((SwTblBoxFormula*)aCntntAtPos.aFnd.pAttr)->GetFormula();
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
case SwContentAtPos::SW_TABLEBOXVALUE:
{
sTxt = UniString(
@@ -360,7 +360,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
{
// --> OD 2008-01-09 #i85090#
const SwGetRefField* pRefFld( dynamic_cast<const SwGetRefField*>(pFld) );
- ASSERT( pRefFld,
+ OSL_ENSURE( pRefFld,
"<SwEditWin::RequestHelp(..)> - unexpected type of <pFld>" );
if ( pRefFld )
{
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index 80224a3..a089a21 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -169,8 +169,8 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList)
{
//was war das denn?
#if OSL_DEBUG_LEVEL > 1
- DBG_ERROR("Token nicht erkannt!");
- DBG_ERROR(ByteString(sToken, gsl_getSystemTextEncoding()).GetBuffer());
+ OSL_ENSURE(false, "Token not recognised!");
+ OSL_ENSURE(false, ByteString(sToken, gsl_getSystemTextEncoding()).GetBuffer());
#endif
}
@@ -614,7 +614,7 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll)
IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer )
{
Time aSyntaxCheckStart;
- DBG_ASSERT( pTextView, "Noch keine View, aber Syntax-Highlight ?!" );
+ OSL_ENSURE( pTextView, "Noch keine View, aber Syntax-Highlight ?!" );
// pTextEngine->SetUpdateMode( FALSE );
bHighlighting = TRUE;
@@ -763,13 +763,13 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff )
// optimiert das die TextEngine.
USHORT nLastEnd = 0;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
USHORT nLine = aPortionList[0].nLine;
#endif
for ( USHORT i = 0; i < nCount; i++ )
{
SwTextPortion& r = aPortionList[i];
- DBG_ASSERT( r.nLine == nLine, "doch mehrere Zeilen ?" );
+ OSL_ENSURE( r.nLine == nLine, "doch mehrere Zeilen ?" );
if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben
continue;
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index 92a787b..a4d78ca 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -131,7 +131,7 @@ void SwChangeDBDlg::FillDBPopup()
Reference<XInterface> xInstance = xMgr->createInstance( C2U( "com.sun.star.sdb.DatabaseContext" ));
xDBContext = Reference<XNameAccess>(xInstance, UNO_QUERY) ;
}
- DBG_ASSERT(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
+ OSL_ENSURE(xDBContext.is(), "com.sun.star.sdb.DataBaseContext: service not available");
const SwDBData& rDBData = pSh->GetDBData();
String sDBName(rDBData.sDataSource);
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 8405048..5e697ec 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -351,12 +351,12 @@ IMPL_LINK( SwFldEditDlg, AddressHdl, PushButton *, EMPTYARG )
}
aSet.Put(SfxUInt16Item(SID_FIELD_GRABFOCUS, nEditPos));
SwAbstractDialogFactory* pFact = swui::GetFactory();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( this, aSet,
pSh->GetView().GetViewFrame()->GetFrame().GetFrameInterface(),
RC_DLG_ADDR );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
{
pSh->UpdateFlds( *pCurFld );
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index b9a1954..cfcccef 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -257,7 +257,7 @@ static SwWrtShell* lcl_GetShell()
SwView* pView;
if ( 0 != (pView = ::GetActiveView()) )
return pView->GetWrtShellPtr();
- DBG_ERROR("no current shell found!");
+ OSL_ENSURE(false, "no current shell found!");
return 0;
}
@@ -454,14 +454,14 @@ USHORT SwFldMgr::GetGroup(BOOL bHtmlMode, USHORT nTypeId, USHORT nSubType) const
USHORT SwFldMgr::GetTypeId(USHORT nPos)
{
- ASSERT(nPos < ::GetPackCount(), "unzulaessige Pos");
+ OSL_ENSURE(nPos < ::GetPackCount(), "forbidden Pos");
return aSwFlds[ nPos ].nTypeId;
}
const String& SwFldMgr::GetTypeStr(USHORT nPos)
{
- ASSERT(nPos < ::GetPackCount(), "unzulaessige TypeId");
+ OSL_ENSURE(nPos < ::GetPackCount(), "forbidden TypeId");
USHORT nFldWh = aSwFlds[ nPos ].nTypeId;
@@ -619,7 +619,7 @@ BOOL SwFldMgr::GetSubTypes(USHORT nTypeId, SvStringsDtor& rToFill)
USHORT SwFldMgr::GetFormatCount(USHORT nTypeId, BOOL bIsText, BOOL bHtmlMode) const
{
- ASSERT(nTypeId < TYP_END, "unzulaessige TypeId");
+ OSL_ENSURE(nTypeId < TYP_END, "forbidden TypeId");
{
const USHORT nPos = GetPos(nTypeId);
@@ -677,7 +677,7 @@ USHORT SwFldMgr::GetFormatCount(USHORT nTypeId, BOOL bIsText, BOOL bHtmlMode) co
String SwFldMgr::GetFormatStr(USHORT nTypeId, ULONG nFormatId) const
{
String aRet;
- ASSERT(nTypeId < TYP_END, "unzulaessige TypeId");
+ OSL_ENSURE(nTypeId < TYP_END, "forbidden TypeId");
const USHORT nPos = GetPos(nTypeId);
@@ -1377,11 +1377,11 @@ BOOL SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
}
break;
default:
- { ASSERT(!this, "Falscher Feldtyp");
+ { OSL_ENSURE(!this, "wrong field type");
return FALSE;
}
}
- ASSERT(pFld, "Feld nicht vorhanden");
+ OSL_ENSURE(pFld, "field not available");
//the auto language flag has to be set prior to the language!
@@ -1426,7 +1426,7 @@ void SwFldMgr::UpdateCurFld(ULONG nFormat,
SwField * _pTmpFld) // #111840#
{
// Format aendern
- ASSERT(pCurFld, "kein Feld an der CursorPos");
+ OSL_ENSURE(pCurFld, "no field at CursorPos");
bool bDelete = false;
SwField *pTmpFld; // mb: fixed memory leak
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index cdbcecd..7240f98 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -940,7 +940,7 @@ BOOL SwFldRefPage::FillItemSet(SfxItemSet& )
else if ( nTypeId == REFFLDFLAG_HEADING )
{
SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry();
- ASSERT( pEntry,
+ OSL_ENSURE( pEntry,
"<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" );
if ( pEntry )
{
@@ -960,7 +960,7 @@ BOOL SwFldRefPage::FillItemSet(SfxItemSet& )
else if ( nTypeId == REFFLDFLAG_NUMITEM )
{
SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry();
- ASSERT( pEntry,
+ OSL_ENSURE( pEntry,
"<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" );
if ( pEntry )
{
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 438320a..db2e9b6 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -303,7 +303,7 @@ void SwFldDlg::EnableInsert(BOOL bEnable)
if( bEnable )
{
SwView* pView = ::GetActiveView();
- DBG_ASSERT(pView, "no view found");
+ OSL_ENSURE(pView, "no view found");
if( !pView ||
(pView->GetWrtShell().IsReadOnlyAvailable() &&
pView->GetWrtShell().HasReadonlySel()) )
diff --git a/sw/source/ui/fldui/fldwrap.cxx b/sw/source/ui/fldui/fldwrap.cxx
index 2c45028..abe6b86 100644
--- a/sw/source/ui/fldui/fldwrap.cxx
+++ b/sw/source/ui/fldui/fldwrap.cxx
@@ -99,10 +99,10 @@ SwFldDlgWrapper::SwFldDlgWrapper( Window* _pParent, USHORT nId,
: SwChildWinWrapper( _pParent, nId )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlgInterface = pDlg;
pWindow = pDlg->GetWindow();
pDlg->Start();
@@ -146,10 +146,10 @@ SwFldDataOnlyDlgWrapper::SwFldDataOnlyDlgWrapper( Window* _pParent, USHORT nId,
: SwChildWinWrapper( _pParent, nId )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlgInterface = pDlg;
pWindow = pDlg->GetWindow();
diff --git a/sw/source/ui/fldui/xfldui.cxx b/sw/source/ui/fldui/xfldui.cxx
index 7c791c1..5395a11 100644
--- a/sw/source/ui/fldui/xfldui.cxx
+++ b/sw/source/ui/fldui/xfldui.cxx
@@ -30,7 +30,7 @@
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
@@ -89,7 +89,7 @@ BOOL SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName,
if(xTSupplier.is())
{
Reference<XNameAccess> xTbls = xTSupplier->getTables();
- DBG_ASSERT(xTbls->hasByName(rTblQryName), "table not available anymore?");
+ OSL_ENSURE(xTbls->hasByName(rTblQryName), "table not available anymore?");
try
{
Any aTable = xTbls->getByName(rTblQryName);
@@ -106,7 +106,7 @@ BOOL SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName,
if(xQSupplier.is())
{
Reference<XNameAccess> xQueries = xQSupplier->getQueries();
- DBG_ASSERT(xQueries->hasByName(rTblQryName), "table not available anymore?");
+ OSL_ENSURE(xQueries->hasByName(rTblQryName), "table not available anymore?");
try
{
Any aQuery = xQueries->getByName(rTblQryName);
@@ -127,7 +127,7 @@ BOOL SwFldMgr::IsDBNumeric( const String& rDBName, const String& rTblQryName,
}
catch(Exception& )
{
- DBG_ERROR("Exception in getColumns()");
+ OSL_ENSURE(false, "Exception in getColumns()");
}
if(xCols.is() && xCols->hasByName(rFldName))
{
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 9896375..266d8cf 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -329,7 +329,7 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
break;
default:
- ASSERT(!this, "Falsche Familie");
+ OSL_ENSURE(!this, "wrong family");
}
}
@@ -400,7 +400,7 @@ void SwTemplateDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
{
case TP_CHAR_STD:
{
- ASSERT(::GetActiveView(), "keine View aktiv");
+ OSL_ENSURE(::GetActiveView(), "no active view");
SvxFontListItem aFontListItem( *( (SvxFontListItem*)::GetActiveView()->
GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) );
diff --git a/sw/source/ui/frmdlg/colmgr.cxx b/sw/source/ui/frmdlg/colmgr.cxx
index 31daff1..6ea6307 100644
--- a/sw/source/ui/frmdlg/colmgr.cxx
+++ b/sw/source/ui/frmdlg/colmgr.cxx
@@ -72,7 +72,7 @@ USHORT SwColMgr::GetGutterWidth( USHORT nPos ) const
nRet = GetCount() > 1 ? aFmtCol.GetGutterWidth() : DEF_GUTTER_WIDTH;
else
{
- DBG_ASSERT(nPos < GetCount() - 1, "Spalte ueberindiziert" );
+ OSL_ENSURE(nPos < GetCount() - 1, "Spalte ueberindiziert" );
const SwColumns& rCols = aFmtCol.GetColumns();
nRet = rCols.GetObject(nPos)->GetRight() + rCols.GetObject(nPos + 1)->GetLeft();
}
@@ -85,7 +85,7 @@ void SwColMgr::SetGutterWidth(USHORT nGutterWidth, USHORT nPos )
aFmtCol.SetGutterWidth(nGutterWidth, nWidth);
else
{
- DBG_ASSERT(nPos < GetCount() - 1, "Spalte ueberindiziert" );
+ OSL_ENSURE(nPos < GetCount() - 1, "Spalte ueberindiziert" );
SwColumns& rCols = aFmtCol.GetColumns();
USHORT nGutterWidth2 = nGutterWidth / 2;
rCols.GetObject(nPos)->SetRight(nGutterWidth2);
@@ -103,7 +103,7 @@ short SwColMgr::GetLineHeightPercent() const
void SwColMgr::SetLineHeightPercent(short nPercent)
{
- ASSERT(nPercent <= 100, LineHeight darf nur bis 100 % gross sein);
+ OSL_ENSURE(nPercent <= 100, "line height may only be 100 \%");
aFmtCol.SetLineHeight((BYTE)nPercent);
}
@@ -112,13 +112,13 @@ void SwColMgr::SetLineHeightPercent(short nPercent)
------------------------------------------------------------------------*/
USHORT SwColMgr::GetColWidth(USHORT nIdx) const
{
- ASSERT(nIdx < GetCount(), Spaltenarray ueberindiziert.);
+ OSL_ENSURE(nIdx < GetCount(), "Spaltenarray ueberindiziert.");
return aFmtCol.CalcPrtColWidth(nIdx, nWidth);
}
void SwColMgr::SetColWidth(USHORT nIdx, USHORT nWd)
{
- ASSERT(nIdx < GetCount(), Spaltenarray ueberindiziert.);
+ OSL_ENSURE(nIdx < GetCount(), "Spaltenarray ueberindiziert.");
aFmtCol.GetColumns()[nIdx]->SetWishWidth(nWd);
}
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index c0ca792..87069fc 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -202,8 +202,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) :
else
aApplyToLB.RemoveEntry( nPagePos );
-
- ASSERT( pColPgSet, "" );
+ OSL_ENSURE( pColPgSet, "" );
// TabPage erzeugen
SwColumnPage* pPage = (SwColumnPage*) SwColumnPage::Create( this,
*pColPgSet );
@@ -919,7 +918,7 @@ IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld )
if(aAutoWidthBox.IsChecked())
{
USHORT nMaxGap = pColMgr->GetActualSize() - nCols * MINLAY;
- DBG_ASSERT(nCols, "Abstand kann nicht ohne Spalten eingestellt werden");
+ OSL_ENSURE(nCols, "Abstand kann nicht ohne Spalten eingestellt werden");
nMaxGap /= nCols - 1;
if(nActValue > nMaxGap)
{
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index 7789491..2fdf235 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -101,7 +101,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
}
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index ce66d39..321f772 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -142,8 +142,8 @@ void SwFlyFrmAttrMgr::_UpdateFlyFrm()
--------------------------------------------------------------------*/
void SwFlyFrmAttrMgr::UpdateFlyFrm()
{
- ASSERT( pOwnSh->IsFrmSelected(),
- "Kein Rahmen selektiert oder keine Shell, Update nicht moeglich");
+ OSL_ENSURE( pOwnSh->IsFrmSelected(),
+ "no frame selected or no shell, update not possible");
if( pOwnSh->IsFrmSelected() )
{
@@ -201,7 +201,7 @@ void SwFlyFrmAttrMgr::InsertFlyFrm(RndStdIds eAnchorType,
const Size &rSize,
BOOL bAbs )
{
- ASSERT( eAnchorType == FLY_AT_PAGE ||
+ OSL_ENSURE( eAnchorType == FLY_AT_PAGE ||
eAnchorType == FLY_AT_PARA ||
eAnchorType == FLY_AT_CHAR ||
eAnchorType == FLY_AT_FLY ||
@@ -542,7 +542,7 @@ void SwFlyFrmAttrMgr::DelAttr( USHORT nId )
void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight )
{
- ASSERT( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" );
+ OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Welchen Raend setzen?" );
SvxLRSpaceItem aTmp( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) );
if( LONG_MAX != nLeft )
@@ -554,7 +554,7 @@ void SwFlyFrmAttrMgr::SetLRSpace( long nLeft, long nRight )
void SwFlyFrmAttrMgr::SetULSpace( long nTop, long nBottom )
{
- ASSERT(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" );
+ OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Welchen Raend setzen?" );
SvxULSpaceItem aTmp( (SvxULSpaceItem&)aSet.Get( RES_UL_SPACE ) );
if( LONG_MAX != nTop )
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 6b10ee9..099e6ba 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -795,7 +795,7 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
if ( nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE )
{
- ASSERT(pSh , "shell not found");
+ OSL_ENSURE(pSh , "shell not found");
const SfxPoolItem* pItem;
//OS: nur fuer die Variante Einfuegen/Grafik/Eigenschaften
if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_GRF_REALSIZE, FALSE, &pItem))
@@ -939,7 +939,7 @@ BOOL SwFrmPage::FillItemSet(SfxItemSet &rSet)
BOOL bRet = FALSE;
SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
: ((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell();
- ASSERT( pSh , "shell not found");
+ OSL_ENSURE( pSh , "shell not found");
const SfxItemSet& rOldSet = GetItemSet();
const SfxPoolItem* pOldItem = 0;
@@ -1658,7 +1658,7 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG )
SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell()
:((SwFrmDlg*)GetParent()->GetParent())->GetWrtShell();
- ASSERT(pSh , "shell not found");
+ OSL_ENSURE(pSh , "shell not found");
SwFlyFrmAttrMgr aMgr( bNew, pSh, (const SwAttrSet&)GetItemSet() );
SvxSwFrameValidation aVal;
@@ -2788,7 +2788,7 @@ void SwFrmAddPage::Reset(const SfxItemSet &rSet )
aTmpName1 = ((const SfxStringItem*)pItem)->GetValue();
}
- DBG_ASSERT(pWrtSh, "keine Shell?");
+ OSL_ENSURE(pWrtSh, "keine Shell?");
if( bNew || !aTmpName1.Len() )
switch( nDlgType )
diff --git a/sw/source/ui/frmdlg/pattern.cxx b/sw/source/ui/frmdlg/pattern.cxx
index 5cd5a7b..b9ca694 100644
--- a/sw/source/ui/frmdlg/pattern.cxx
+++ b/sw/source/ui/frmdlg/pattern.cxx
@@ -55,7 +55,7 @@ SwBackgroundDlg::SwBackgroundDlg(Window* pParent, const SfxItemSet& rSet) :
{
SetText(SW_RESSTR(STR_FRMUI_PATTERN));
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND );
if ( fnCreatePage )
{
diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx
index 8507907..9ef5297 100644
--- a/sw/source/ui/frmdlg/uiborder.cxx
+++ b/sw/source/ui/frmdlg/uiborder.cxx
@@ -57,7 +57,7 @@ SwBorderDlg::SwBorderDlg(Window* pParent, SfxItemSet& rSet, USHORT nType) :
// TabPage erzeugen
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER );
if ( fnCreatePage )
{
diff --git a/sw/source/ui/inc/cfgitems.hxx b/sw/source/ui/inc/cfgitems.hxx
index 8c8a55b..5ce83a9 100644
--- a/sw/source/ui/inc/cfgitems.hxx
+++ b/sw/source/ui/inc/cfgitems.hxx
@@ -37,7 +37,7 @@
class SwWriterApp;
class SwModule;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
class SwTestTabPage;
#endif
class SwAddPrinterTabPage;
diff --git a/sw/source/ui/inc/fontcfg.hxx b/sw/source/ui/inc/fontcfg.hxx
index 0eb08e9..7ffbe2e 100644
--- a/sw/source/ui/inc/fontcfg.hxx
+++ b/sw/source/ui/inc/fontcfg.hxx
@@ -31,7 +31,7 @@
#include <unotools/configitem.hxx>
#include <tools/string.hxx>
#include <i18npool/lang.h>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include "swdllapi.h"
#define FONT_STANDARD 0
diff --git a/sw/source/ui/inc/uinums.hxx b/sw/source/ui/inc/uinums.hxx
index f67cae0..2301193 100644
--- a/sw/source/ui/inc/uinums.hxx
+++ b/sw/source/ui/inc/uinums.hxx
@@ -124,7 +124,7 @@ public:
// INLINE METHODE --------------------------------------------------------
inline const SwNumRulesWithName *SwBaseNumRules::GetRules(USHORT nIdx) const
{
- ASSERT(nIdx < nMaxRules, Array der NumRules ueberindiziert.);
+ OSL_ENSURE(nIdx < nMaxRules, "Array der NumRules ueberindiziert.");
return pNumRules[nIdx];
}
diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx
index 374925e..f4157fa 100644
--- a/sw/source/ui/index/cntex.cxx
+++ b/sw/source/ui/index/cntex.cxx
@@ -179,7 +179,7 @@ IMPL_LINK( SwMultiTOXTabDialog, CreateExample_Hdl, void*, EMPTYARG )
}
catch(Exception&)
{
- DBG_ERROR("::CreateExample() - exception caught");
+ OSL_ENSURE(false, "::CreateExample() - exception caught");
}
return 0;
}
@@ -203,7 +203,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
try
{
- DBG_ASSERT(pxIndexSectionsArr[nTOXIndex] &&
+ OSL_ENSURE(pxIndexSectionsArr[nTOXIndex] &&
pxIndexSectionsArr[nTOXIndex]->xContainerSection.is(),
"Section not created");
uno::Reference< frame::XModel > & xModel = pExampleFrame->GetModel();
@@ -428,7 +428,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
aSequPropVals.realloc(nTokenIndex);
uno::Any aFormatAccess = xIdxProps->getPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_LEVEL_FORMAT)));
- DBG_ASSERT(aFormatAccess.getValueType() == ::getCppuType((uno::Reference<container::XIndexReplace>*)0),
+ OSL_ENSURE(aFormatAccess.getValueType() == ::getCppuType((uno::Reference<container::XIndexReplace>*)0),
"wrong property type");
@@ -473,7 +473,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
}
catch(Exception&)
{
- DBG_ERROR("::CreateExample() - exception caught");
+ OSL_ENSURE(false, "::CreateExample() - exception caught");
}
}
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index f2a61a6..ed51110 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -328,7 +328,7 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(Window* pParent, const SfxItemSet& rSet
}
}
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AddTabPage(TP_TOX_SELECT, SwTOXSelectTabPage::Create, 0);
AddTabPage(TP_TOX_STYLES, SwTOXStylesTabPage::Create, 0);
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
@@ -1070,7 +1070,7 @@ CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData)
case TO_OBJECT : eRet.eType = TOX_OBJECTS; break;
case TO_TABLE : eRet.eType = TOX_TABLES; break;
case TO_AUTHORITIES : eRet.eType = TOX_AUTHORITIES; break;
- default: DBG_ERROR("what a type?");
+ default: OSL_ENSURE(false, "what a type?");
}
return eRet;
}
@@ -1181,7 +1181,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription()
for( long nCnt = 0; nCnt < aSortAlgorithmLB.GetEntryCount(); ++nCnt )
{
const String* pEntryData = (const String*)aSortAlgorithmLB.GetEntryData( (USHORT)nCnt );
- DBG_ASSERT(pEntryData, "no entry data available");
+ OSL_ENSURE(pEntryData, "no entry data available");
if( pEntryData && *pEntryData == rDesc.GetSortAlgorithm())
{
aSortAlgorithmLB.SelectEntryPos( (USHORT)nCnt );
@@ -1296,7 +1296,7 @@ void SwTOXSelectTabPage::FillTOXDescription()
rDesc.SetLanguage(aLanguageLB.GetSelectLanguage());
const String* pEntryData = (const String*)aSortAlgorithmLB.GetEntryData(
aSortAlgorithmLB.GetSelectEntryPos() );
- DBG_ASSERT(pEntryData, "no entry data available");
+ OSL_ENSURE(pEntryData, "no entry data available");
if(pEntryData)
rDesc.SetSortAlgorithm(*pEntryData);
}
@@ -1554,7 +1554,7 @@ IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox)
IMPL_LINK(SwTOXSelectTabPage, TOXAreaHdl, ListBox*, pBox)
{
- DBG_WARNING("not implemented");
+ OSL_ENSURE(false, "not implemented");
switch((long)pBox->GetEntryData( pBox->GetSelectEntryPos() ))
{
case AREA_DOCUMENT : break;
@@ -1808,7 +1808,7 @@ public:
void SetLinkEnd()
{
- DBG_ASSERT(TOKEN_LINK_START == aFormToken.eTokenType,
+ OSL_ENSURE(TOKEN_LINK_START == aFormToken.eTokenType,
"call SetLinkEnd for link start only!");
aFormToken.eTokenType = TOKEN_LINK_END;
aFormToken.sText.AssignAscii(SwForm::aFormLinkEnd);
@@ -1816,7 +1816,7 @@ public:
}
void SetLinkStart()
{
- DBG_ASSERT(TOKEN_LINK_END == aFormToken.eTokenType,
+ OSL_ENSURE(TOKEN_LINK_END == aFormToken.eTokenType,
"call SetLinkStart for link start only!");
aFormToken.eTokenType = TOKEN_LINK_START;
aFormToken.sText.AssignAscii(SwForm::aFormLinkStt);
@@ -2431,7 +2431,7 @@ IMPL_LINK(SwTOXEntryTabPage, RemoveInsertAuthHdl, PushButton*, pButton)
else
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(WINDOW_EDIT != pCtrl->GetType(), "Remove should be disabled");
+ OSL_ENSURE(WINDOW_EDIT != pCtrl->GetType(), "Remove should be disabled");
if( WINDOW_EDIT != pCtrl->GetType() )
{
//fill it into the ListBox
@@ -2569,7 +2569,7 @@ IMPL_LINK(SwTOXEntryTabPage, LevelHdl, SvTreeListBox*, pBox)
{
sal_uInt32 nSearch = aToken.nAuthorityField;
sal_uInt16 nLstBoxPos = aAuthFieldsLB.GetEntryPos( (void*) nSearch );
- DBG_ASSERT(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?");
+ OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND != nLstBoxPos, "Entry not found?");
aAuthFieldsLB.RemoveEntry(nLstBoxPos);
}
@@ -2743,7 +2743,7 @@ IMPL_LINK(SwTOXEntryTabPage, StyleSelectHdl, ListBox*, pBox)
if(sEntry == sNoCharStyle)
sEntry.Erase();
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl, "no active control?");
+ OSL_ENSURE(pCtrl, "no active control?");
if(pCtrl)
{
if(WINDOW_EDIT == pCtrl->GetType())
@@ -2762,7 +2762,7 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoHdl, ListBox*, pBox)
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl, "no active control?");
+ OSL_ENSURE(pCtrl, "no active control?");
if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
((SwTOXButton*)pCtrl)->SetChapterInfo(nPos);
@@ -2776,7 +2776,7 @@ IMPL_LINK(SwTOXEntryTabPage, ChapterInfoOutlineHdl, NumericField*, pField)
const sal_uInt16 nLevel = static_cast<BYTE>(pField->GetValue());
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl, "no active control?");
+ OSL_ENSURE(pCtrl, "no active control?");
if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
((SwTOXButton*)pCtrl)->SetOutlineLevel(nLevel);
@@ -2791,7 +2791,7 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox)
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl, "no active control?");
+ OSL_ENSURE(pCtrl, "no active control?");
if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
{
((SwTOXButton*)pCtrl)->SetEntryNumberFormat(nPos);//i89791
@@ -2804,7 +2804,7 @@ IMPL_LINK(SwTOXEntryTabPage, NumberFormatHdl, ListBox*, pBox)
IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField)
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
+ OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
TOKEN_TAB_STOP == ((SwTOXButton*)pCtrl)->GetFormToken().eTokenType,
"no active style::TabStop control?");
if( pCtrl && WINDOW_EDIT != pCtrl->GetType() )
@@ -2819,7 +2819,7 @@ IMPL_LINK(SwTOXEntryTabPage, TabPosHdl, MetricField*, pField)
IMPL_LINK(SwTOXEntryTabPage, FillCharHdl, ComboBox*, pBox)
{
Control* pCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
+ OSL_ENSURE(pCtrl && WINDOW_EDIT != pCtrl->GetType() &&
TOKEN_TAB_STOP == ((SwTOXButton*)pCtrl)->GetFormToken().eTokenType,
"no active style::TabStop control?");
if(pCtrl && WINDOW_EDIT != pCtrl->GetType())
@@ -2839,7 +2839,7 @@ IMPL_LINK(SwTOXEntryTabPage, AutoRightHdl, CheckBox*, pBox)
{
//the most right style::TabStop is usually right aligned
Control* pCurCtrl = aTokenWIN.GetActiveControl();
- DBG_ASSERT(WINDOW_EDIT != pCurCtrl->GetType() &&
+ OSL_ENSURE(WINDOW_EDIT != pCurCtrl->GetType() &&
((SwTOXButton*)pCurCtrl)->GetFormToken().eTokenType == TOKEN_TAB_STOP,
"no style::TabStop selected!");
@@ -2974,7 +2974,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
if(TOKEN_TEXT == aToken.eTokenType)
{
- DBG_ASSERT(!bLastWasText, "text following text is invalid");
+ OSL_ENSURE(!bLastWasText, "text following text is invalid");
Control* pCtrl = InsertItem(aToken.sText, aToken);
bLastWasText = sal_True;
if(!GetActiveControl())
@@ -3104,7 +3104,7 @@ void SwTokenWindow::InsertAtSelection(
const String& rText,
const SwFormToken& rToken)
{
- DBG_ASSERT(pActiveCtrl, "no active control!");
+ OSL_ENSURE(pActiveCtrl, "no active control!");
if(!pActiveCtrl)
return;
SwFormToken aToInsertToken(rToken);
@@ -3191,7 +3191,7 @@ void SwTokenWindow::InsertAtSelection(
if(bPostLinkStartFound)
{
- DBG_ASSERT(pExchange, "no control to exchange?");
+ OSL_ENSURE(pExchange, "no control to exchange?");
if(pExchange)
{
((SwTOXButton*)pExchange)->SetLinkEnd();
@@ -3201,7 +3201,7 @@ void SwTokenWindow::InsertAtSelection(
if(bPreEndLinkFound)
{
- DBG_ASSERT(pExchange, "no control to exchange?");
+ OSL_ENSURE(pExchange, "no control to exchange?");
if(pExchange)
{
((SwTOXButton*)pExchange)->SetLinkStart();
@@ -3278,10 +3278,10 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, sal_Bool bInternalCall )
m_pParent->PreTokenButtonRemoved(pDel->GetFormToken());
sal_uInt32 nActivePos = aControlList.GetPos(pDel);
- DBG_ASSERT(nActivePos != 0xffffffff, "Control does not exist!");
+ OSL_ENSURE(nActivePos != 0xffffffff, "Control does not exist!");
// the two neighbours of the box must be merged
// the properties of the right one will be lost
- DBG_ASSERT(nActivePos && nActivePos < aControlList.Count() - 1,
+ OSL_ENSURE(nActivePos && nActivePos < aControlList.Count() - 1,
"Button at first or last position?");
aControlList.Seek(nActivePos - 1);
Control* pLeftEdit = aControlList.GetCurObject();
diff --git a/sw/source/ui/index/idxmrk.cxx b/sw/source/ui/index/idxmrk.cxx
index b7b1158..66a407d 100644
--- a/sw/source/ui/index/idxmrk.cxx
+++ b/sw/source/ui/index/idxmrk.cxx
@@ -77,9 +77,9 @@ SwInsertIdxMarkWrapper::SwInsertIdxMarkWrapper( Window *pParentWindow,
SfxChildWindow(pParentWindow, nId)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pAbstDlg = pFact->CreateIndexMarkFloatDlg( DLG_INSIDXMARK , pBindings, this, pParentWindow, pInfo );
- DBG_ASSERT(pAbstDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pAbstDlg, "Dialogdiet fail!");
pWindow = pAbstDlg->GetWindow();
pWindow->Show(); // at this point,because before pSh has to be initialized in ReInitDlg()
// -> Show() will invoke StateChanged() and save pos
@@ -107,9 +107,9 @@ SwInsertAuthMarkWrapper::SwInsertAuthMarkWrapper( Window *pParentWindow,
SfxChildWindow(pParentWindow, nId)
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pAbstDlg = pFact->CreateAuthMarkFloatDlg( DLG_INSAUTHMARK, pBindings, this, pParentWindow, pInfo );
- DBG_ASSERT(pAbstDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pAbstDlg, "Dialogdiet fail!");
pWindow = pAbstDlg->GetWindow();
eChildAlignment = SFX_ALIGN_NOALIGNMENT;
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index d63ca24..e6ec8db 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -241,10 +241,10 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
--------------------------------------------------------------------*/
void SwIndexMarkDlg::InitControls()
{
- DBG_ASSERT(pSh && pTOXMgr, "Shell nicht da?");
+ OSL_ENSURE(pSh && pTOXMgr, "no shell?");
// Inhalts-Verzeichnis
const SwTOXType* pType = pTOXMgr->GetTOXType(TOX_CONTENT, 0);
- ASSERT(pType, "Kein Verzeichnistyp !!");
+ OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
String sTmpTypeSelection;
if(aTypeDCB.GetSelectEntryCount())
sTmpTypeSelection = aTypeDCB.GetSelectEntry();
@@ -253,7 +253,7 @@ void SwIndexMarkDlg::InitControls()
// Stichwort-Verzeichnis
pType = pTOXMgr->GetTOXType(TOX_INDEX, 0);
- ASSERT(pType, "Kein Verzeichnistyp !!");
+ OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
aTypeDCB.InsertEntry(pType->GetTypeName());
// Benutzerverzeichnisse
@@ -368,19 +368,19 @@ void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading()
//get the current language
if(!bNewMark) //if dialog is opened to iterate existing marks
{
- ASSERT(pTOXMgr, "need TOXMgr")
+ OSL_ENSURE(pTOXMgr, "need TOXMgr")
if(!pTOXMgr)
return;
SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
- ASSERT(pMark, "need current SwTOXMark");
+ OSL_ENSURE(pMark, "need current SwTOXMark");
if(!pMark)
return;
SwTxtTOXMark* pTxtTOXMark = pMark->GetTxtTOXMark();
- ASSERT(pTxtTOXMark, "need current SwTxtTOXMark");
+ OSL_ENSURE(pTxtTOXMark, "need current SwTxtTOXMark");
if(!pTxtTOXMark)
return;
const SwTxtNode* pTxtNode = pTxtTOXMark->GetpTxtNd();
- ASSERT(pTxtNode, "need current SwTxtNode");
+ OSL_ENSURE(pTxtNode, "need current SwTxtNode");
if(!pTxtNode)
return;
xub_StrLen nTextIndex = *pTxtTOXMark->GetStart();
@@ -866,9 +866,9 @@ IMPL_LINK( SwIndexMarkDlg, DelHdl, Button *, EMPTYARG )
--------------------------------------------------------------------*/
void SwIndexMarkDlg::UpdateDialog()
{
- DBG_ASSERT(pSh && pTOXMgr, "Shell nicht da?");
+ OSL_ENSURE(pSh && pTOXMgr, "no shell?");
SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
- ASSERT(pMark, "Keine aktuelle Markierung");
+ OSL_ENSURE(pMark, "no current marker");
if(!pMark)
return;
@@ -1351,8 +1351,8 @@ IMPL_LINK( SwAuthMarkDlg, InsertHdl, PushButton *, EMPTYARG )
if(pSh)
{
sal_Bool bDifferent = sal_False;
- DBG_ASSERT(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!");
- DBG_ASSERT(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!");
+ OSL_ENSURE(m_sFields[AUTH_FIELD_IDENTIFIER].Len() , "No Id is set!");
+ OSL_ENSURE(m_sFields[AUTH_FIELD_AUTHORITY_TYPE].Len() , "No authority type is set!");
//check if the entry already exists with different content
const SwAuthorityFieldType* pFType = (const SwAuthorityFieldType*)
pSh->GetFldType(RES_AUTHORITY, aEmptyStr);
@@ -1431,7 +1431,7 @@ IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton)
}
if(bCreate)
{
- DBG_ASSERT(LISTBOX_ENTRY_NOTFOUND ==
+ OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND ==
aEntryLB.GetEntryPos(m_sFields[AUTH_FIELD_IDENTIFIER]),
"entry exists!");
aEntryLB.InsertEntry(m_sFields[AUTH_FIELD_IDENTIFIER]);
@@ -1547,9 +1547,9 @@ IMPL_LINK(SwAuthMarkDlg, IsEntryAllowedHdl, Edit*, pEdit)
void SwAuthMarkDlg::InitControls()
{
- DBG_ASSERT(pSh, "Shell nicht da?");
+ OSL_ENSURE(pSh, "no shell?");
SwField* pField = pSh->GetCurFld();
- ASSERT(bNewEntry || pField, "Keine aktuelle Markierung");
+ OSL_ENSURE(bNewEntry || pField, "no current marker");
if(bNewEntry)
{
ChangeSourceHdl(aFromComponentRB.IsChecked() ? &aFromComponentRB : &aFromDocContentRB);
@@ -1564,7 +1564,7 @@ void SwAuthMarkDlg::InitControls()
const SwAuthEntry* pEntry = ((SwAuthorityFieldType*)pField->GetTyp())->
GetEntryByHandle(((SwAuthorityField*)pField)->GetHandle());
- DBG_ASSERT(pEntry, "No authority entry found");
+ OSL_ENSURE(pEntry, "No authority entry found");
if(!pEntry)
return;
for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++)
@@ -1749,12 +1749,12 @@ String SwCreateAuthEntryDlg_Impl::GetEntryText(ToxAuthorityField eField) const
String sRet;
if( AUTH_FIELD_AUTHORITY_TYPE == eField )
{
- DBG_ASSERT(pTypeListBox, "No ListBox");
+ OSL_ENSURE(pTypeListBox, "No ListBox");
sRet = String::CreateFromInt32(pTypeListBox->GetSelectEntryPos());
}
else if( AUTH_FIELD_IDENTIFIER == eField && !m_bNewEntryMode)
{
- DBG_ASSERT(pIdentifierBox, "No ComboBox");
+ OSL_ENSURE(pIdentifierBox, "No ComboBox");
sRet = pIdentifierBox->GetText();
}
else
@@ -1826,7 +1826,7 @@ SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings,
FreeResource();
Initialize(pInfo);
SwWrtShell* pWrtShell = ::GetActiveWrtShell();
- DBG_ASSERT(pWrtShell, "No shell?");
+ OSL_ENSURE(pWrtShell, "No shell?");
aDlg.ReInitDlg(*pWrtShell);
}
diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx
index 9db17b1..4d45c19 100644
--- a/sw/source/ui/index/toxmgr.cxx
+++ b/sw/source/ui/index/toxmgr.cxx
@@ -92,8 +92,8 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
{
case TOX_CONTENT:
{
- ASSERT(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
- ungueltiger Level InsertTOCMark);
+ OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
+ "invalid InsertTOCMark level");
pMark = new SwTOXMark(pSh->GetTOXType(TOX_CONTENT, 0));
pMark->SetLevel( static_cast< USHORT >(rDesc.GetLevel()) );
@@ -127,8 +127,8 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
break;
case TOX_USER:
{
- ASSERT(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
- ungueltiger Level InsertTOCMark);
+ OSL_ENSURE(rDesc.GetLevel() > 0 && rDesc.GetLevel() <= MAXLEVEL,
+ "invalid InsertTOCMark level");
USHORT nId = rDesc.GetTOUName() ?
GetUserTypeID(*rDesc.GetTOUName()) : 0;
pMark = new SwTOXMark(pSh->GetTOXType(TOX_USER, nId));
@@ -151,7 +151,7 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
{
- ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+ OSL_ENSURE(pCurTOXMark, "no current TOXMark");
pSh->StartAllAction();
if(pCurTOXMark->GetTOXType()->GetType() == TOX_INDEX)
@@ -249,7 +249,7 @@ USHORT SwTOXMgr::GetUserTypeID(const String& rStr)
void SwTOXMgr::NextTOXMark(BOOL bSame)
{
- ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+ OSL_ENSURE(pCurTOXMark, "no current TOXMark");
if( pCurTOXMark )
{
SwTOXSearch eDir = bSame ? TOX_SAME_NXT : TOX_NXT;
@@ -260,7 +260,7 @@ void SwTOXMgr::NextTOXMark(BOOL bSame)
void SwTOXMgr::PrevTOXMark(BOOL bSame)
{
- ASSERT(pCurTOXMark, "kein aktuelles TOXMark");
+ OSL_ENSURE(pCurTOXMark, "no current TOXMark");
if( pCurTOXMark )
{
SwTOXSearch eDir = bSame ? TOX_SAME_PRV : TOX_PRV;
@@ -408,7 +408,7 @@ BOOL SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
}
- DBG_ASSERT(pNewTOX, "no TOXBase created!" );
+ OSL_ENSURE(pNewTOX, "no TOXBase created!" );
if(!pNewTOX)
return FALSE;
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index d7ae94e..775651c 100644
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -237,7 +237,7 @@ void SwHHCWrapper::SelectNewUnit_impl( sal_Int32 nUnitStart, sal_Int32 nUnitEnd
void SwHHCWrapper::HandleNewUnit(
const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd )
{
- DBG_ASSERT( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
+ OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
if (!(0 <= nUnitStart && nUnitStart <= nUnitEnd))
return;
@@ -260,7 +260,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
//!! please see also TextConvWrapper::ChangeText with is a modified
//!! copy of this code
- DBG_ASSERT( rNewText.Len() != 0, "unexpected empty string" );
+ OSL_ENSURE( rNewText.Len() != 0, "unexpected empty string" );
if (rNewText.Len() == 0)
return;
@@ -286,7 +286,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
// different length. Negative values allowed!
long nCorrectionOffset = 0;
- DBG_ASSERT(nIndices == 0 || nIndices == nConvTextLen,
+ OSL_ENSURE(nIndices == 0 || nIndices == nConvTextLen,
"mismatch between string length and sequence length!" );
// find all substrings that need to be replaced (and only those)
@@ -317,7 +317,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
// set selection to sub string to be replaced in original text
xub_StrLen nChgInNodeStartIndex = static_cast< xub_StrLen >( nStartIndex + nCorrectionOffset + nChgPos );
- DBG_ASSERT( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing selected)" );
+ OSL_ENSURE( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing selected)" );
rWrtShell.GetCrsr()->GetMark()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex );
rWrtShell.GetCrsr()->GetPoint()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex + nChgLen );
#ifdef DEBUG
@@ -418,7 +418,7 @@ void SwHHCWrapper::ReplaceUnit(
static OUString aBracketedStart( C2U( "(" ) );
static OUString aBracketedEnd( C2U( ")" ) );
- DBG_ASSERT( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
+ OSL_ENSURE( nUnitStart >= 0 && nUnitEnd >= nUnitStart, "wrong arguments" );
if (!(nUnitStart >= 0 && nUnitEnd >= nUnitStart))
return;
@@ -432,7 +432,7 @@ void SwHHCWrapper::ReplaceUnit(
OUString aOrigTxt( rWrtShell.GetSelTxt() );
OUString aNewTxt( rReplaceWith );
- DBG_ASSERT( aOrigTxt == rOrigText, "!! text mismatch !!" );
+ OSL_ENSURE( aOrigTxt == rOrigText, "!! text mismatch !!" );
SwFmtRuby *pRuby = 0;
sal_Bool bRubyBelow = sal_False;
String aNewOrigText;
@@ -475,7 +475,7 @@ void SwHHCWrapper::ReplaceUnit(
}
break;
default:
- DBG_ERROR( "unexpected case" );
+ OSL_ENSURE(false, "unexpected case" );
}
nUnitOffset += nUnitStart + aNewTxt.getLength();
@@ -532,7 +532,7 @@ void SwHHCWrapper::ReplaceUnit(
rWrtShell.SetMark();
rWrtShell.GetCrsr()->GetMark()->nContent -= (xub_StrLen) aNewTxt.getLength();
- DBG_ASSERT( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL,
+ OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL,
"SwHHCWrapper::ReplaceUnit : unexpected target language" );
sal_uInt16 aRanges[] = {
@@ -543,13 +543,13 @@ void SwHHCWrapper::ReplaceUnit(
SfxItemSet aSet( rWrtShell.GetAttrPool(), aRanges );
if (pNewUnitLanguage)
{
- //DBG_ASSERT(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ),
+ //OSL_ENSURE(!IsSimilarChinese( *pNewUnitLanguage, nOldLang ),
// "similar language should not be changed!");
aSet.Put( SvxLanguageItem( *pNewUnitLanguage, RES_CHRATR_CJK_LANGUAGE ) );
}
const Font *pTargetFont = GetTargetFont();
- DBG_ASSERT( pTargetFont, "target font missing?" );
+ OSL_ENSURE( pTargetFont, "target font missing?" );
if (pTargetFont && pNewUnitLanguage)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( RES_CHRATR_CJK_FONT );
@@ -581,7 +581,7 @@ sal_Bool SwHHCWrapper::HasRubySupport() const
void SwHHCWrapper::Convert()
{
- DBG_ASSERT( pConvArgs == 0, "NULL pointer expected" );
+ OSL_ENSURE( pConvArgs == 0, "NULL pointer expected" );
{
SwPaM *pCrsr = pView->GetWrtShell().GetCrsr();
SwPosition* pSttPos = pCrsr->Start();
@@ -611,13 +611,13 @@ void SwHHCWrapper::Convert()
pTxtNode, pSttPos->nContent,
pTxtNode, pSttPos->nContent );
}
- DBG_ASSERT( pConvArgs->pStartNode && pConvArgs->pStartNode->IsTxtNode(),
+ OSL_ENSURE( pConvArgs->pStartNode && pConvArgs->pStartNode->IsTxtNode(),
"failed to get proper start text node" );
- DBG_ASSERT( pConvArgs->pEndNode && pConvArgs->pEndNode->IsTxtNode(),
+ OSL_ENSURE( pConvArgs->pEndNode && pConvArgs->pEndNode->IsTxtNode(),
"failed to get proper end text node" );
// chinese conversion specific settings
- DBG_ASSERT( IsChinese( GetSourceLanguage() ) == IsChinese( GetTargetLanguage() ),
+ OSL_ENSURE( IsChinese( GetSourceLanguage() ) == IsChinese( GetTargetLanguage() ),
"source and target language mismatch?" );
if (IsChinese( GetTargetLanguage() ))
{
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index c42e41c..6aa2341 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -310,7 +310,7 @@ void SwSpellPopup::fillLangPopupMenu(
aEntryTxt != sAsterix &&
aEntryTxt != sEmpty)
{
- DBG_ASSERT( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + MN_MAX_NUM_LANG,
+ OSL_ENSURE( nLangItemIdStart <= nItemId && nItemId <= nLangItemIdStart + MN_MAX_NUM_LANG,
"nItemId outside of expected range!" );
pPopupMenu->InsertItem( nItemId, aEntryTxt, MIB_RADIOCHECK );
if (aEntryTxt == aCurLang)
@@ -398,7 +398,7 @@ pSh( pWrtSh ),
xSpellAlt(xAlt),
bGrammarResults(false)
{
- DBG_ASSERT(xSpellAlt.is(), "no spelling alternatives available");
+ OSL_ENSURE(xSpellAlt.is(), "no spelling alternatives available");
// CreateAutoMnemonics();
SetMenuFlags(MENU_FLAG_NOAUTOMNEMONICS);
@@ -738,7 +738,7 @@ void SwSpellPopup::Execute( USHORT nId )
{
sal_Int32 nAltIdx = (MN_SUGGESTION_START <= nId && nId <= MN_SUGGESTION_END) ?
nId - MN_SUGGESTION_START : nId - MN_AUTOCORR_START;
- DBG_ASSERT( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" );
+ OSL_ENSURE( 0 <= nAltIdx && nAltIdx < aSuggestions.getLength(), "index out of range" );
if (0 <= nAltIdx && nAltIdx < aSuggestions.getLength() && (bGrammarResults || xSpellAlt.is()))
{
sal_Bool bOldIns = pSh->IsInsMode();
@@ -825,7 +825,7 @@ void SwSpellPopup::Execute( USHORT nId )
else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END)
{
OUString aWord( xSpellAlt->getWord() );
-// DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" );
+// OSL_ENSURE( nDicIdx < aDics.getLength(), "dictionary index out of range" );
PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC);
String aDicName ( pMenu->GetItemText(nId) );
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index a5e576c..95d8863 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -106,7 +106,7 @@ SdrHHCWrapper::~SdrHHCWrapper()
if (pTextObj)
{
SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
- ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+ OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
pSdrView->SdrEndTextEdit( sal_True );
SetUpdateMode(sal_False);
pOutlView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) );
@@ -132,7 +132,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
if ( pTextObj )
{
SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
- ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+ OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
pSdrView->SdrEndTextEdit( sal_True );
SetUpdateMode(sal_False);
pOutlView->SetOutputArea( Rectangle( Point(), Size(1, 1) ) );
@@ -204,7 +204,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
if (HasConvertibleTextPortion( nSourceLang ))
{
SdrView *pSdrView = pView->GetWrtShell().GetDrawView();
- ASSERT( pSdrView, "SdrHHCWrapper without DrawView?" );
+ OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" );
SdrPageView* pPV = pSdrView->GetSdrPageView();
nDocIndex = n;
bNextDoc = sal_True;
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index fa59c10..b35e10f 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -242,7 +242,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
aParaTemplBox.SelectEntry( sStr ); // Default
else
{
- ASSERT(!pColl->IsDefault(), "Defaultvorlage fuer Fussnoten ist falsch.");
+ OSL_ENSURE(!pColl->IsDefault(), "default style for footnotes is wrong");
const USHORT nPos = aParaTemplBox.GetEntryPos(pColl->GetName());
if( LISTBOX_ENTRY_NOTFOUND != nPos )
aParaTemplBox.SelectEntryPos( nPos );
@@ -298,9 +298,9 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum)
case FTNNUM_CHAPTER:
sSelect = aNumChapter;
break;
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
default:
- DBG_ERROR("Which numbering type?");
+ OSL_ENSURE(false, "Which numbering type?");
#endif
}
aNumCountBox.SelectEntry(sSelect);
@@ -440,7 +440,7 @@ BOOL SwEndNoteOptionPage::FillItemSet( SfxItemSet & )
{
const String aFmtName( aParaTemplBox.GetSelectEntry() );
SwTxtFmtColl *pColl = pSh->GetParaStyle(aFmtName, SwWrtShell::GETSTYLE_CREATEANY);
- ASSERT(pColl, "Absatzvorlage nicht gefunden.");
+ OSL_ENSURE(pColl, "paragraph style not found");
pInf->SetFtnTxtColl(*pColl);
}
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 117f43f..7498785 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -268,7 +268,7 @@ IMPL_LINK( SwGlossaryGroupDlg, NewHdl, Button*, EMPTYARG )
// sGroup.ToLower();
sGroup += GLOS_DELIM;
sGroup += String::CreateFromInt32(aPathLB.GetSelectEntryPos());
- DBG_ASSERT(!pGlosHdl->FindGroupName(sGroup), "Gruppe bereits vorhanden!");
+ OSL_ENSURE(!pGlosHdl->FindGroupName(sGroup), "group already available!");
if(!pInsertedArr)
pInsertedArr = new SvStrings;
pInsertedArr->Insert(new String(sGroup), pInsertedArr->Count());
@@ -366,7 +366,7 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG )
sNewName += GLOS_DELIM;
sNewName += String::CreateFromInt32(aPathLB.GetSelectEntryPos());
- DBG_ASSERT(!pGlosHdl->FindGroupName(sNewName), "Gruppe bereits vorhanden!");
+ OSL_ENSURE(!pGlosHdl->FindGroupName(sNewName), "group already available!");
// befindet sich der umzubenennende Name unter den
// den neuen - dann austauschen
diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx
index afefcce..d508837 100644
--- a/sw/source/ui/misc/glosdoc.cxx
+++ b/sw/source/ui/misc/glosdoc.cxx
@@ -41,7 +41,7 @@
#ifndef __RSC //autogen
#include <tools/errinf.hxx>
#endif
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <svl/urihelper.hxx>
#include <svl/fstathelper.hxx>
#include <unotools/pathoptions.hxx>
@@ -160,7 +160,7 @@ sal_Bool SwGlossaries::FindGroupName(String & rGroup)
String SwGlossaries::GetGroupName(sal_uInt16 nGroupId)
{
- ASSERT(nGroupId < m_pGlosArr->Count(), Textbausteinarray ueberindiziert);
+ OSL_ENSURE(nGroupId < m_pGlosArr->Count(), "Textbausteinarray ueberindiziert");
return *(*m_pGlosArr)[nGroupId];
}
@@ -253,7 +253,7 @@ sal_Bool SwGlossaries::RenameGroupDoc(
sOldFileURL += rOldGroup.GetToken(0, GLOS_DELIM);
sOldFileURL += SwGlossaries::GetExtension();
BOOL bExist = FStatHelper::IsDocument( sOldFileURL );
- DBG_ASSERT(bExist, "Gruppe existiert nicht!");
+ OSL_ENSURE(bExist, "group doesn't exist!");
if(bExist)
{
sal_uInt16 nNewPath = (sal_uInt16)rNewGroup.GetToken(1, GLOS_DELIM).ToInt32();
@@ -269,7 +269,7 @@ sal_Bool SwGlossaries::RenameGroupDoc(
sTempNewFilePath += INET_PATH_TOKEN;
sTempNewFilePath += sNewFileName ;
bExist = FStatHelper::IsDocument( sTempNewFilePath );
- DBG_ASSERT(!bExist, "Gruppe existiert bereits!");
+ OSL_ENSURE(!bExist, "group already exists!");
if(!bExist)
{
BOOL bCopyCompleted = SWUnoHelper::UCB_CopyFile(
@@ -322,7 +322,7 @@ sal_Bool SwGlossaries::DelGroupDoc(const String &rName)
// der Textbausteinbereiche entfernt werden
// Kein && wegen CFfront
BOOL bRemoved = SWUnoHelper::UCB_DeleteFile( sFileURL );
- DBG_ASSERT(bRemoved, "file has not been removed");
+ OSL_ENSURE(bRemoved, "file has not been removed");
RemoveFileFromList( aName );
return bRemoved;
}
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index cba958f..e945333 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -564,7 +564,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
if(aTitle.Len() && pGlossaryHdl->DelGlossary(aShortName))
{
SvLBoxEntry* pChild = DoesBlockExist(aTitle, aShortName);
- DBG_ASSERT(pChild, "Eintrag nicht gefunden!");
+ OSL_ENSURE(pChild, "entry not found!");
SvLBoxEntry* pParent = aCategoryBox.GetParent(pChild);
aCategoryBox.Select(pParent);
@@ -1116,7 +1116,7 @@ IMPL_LINK( SwGlossaryDlg, PathHdl, Button *, pBtn )
if(pFact)
{
AbstractSvxMultiPathDialog* pDlg = pFact->CreateSvxMultiPathDialog( pBtn );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
SvtPathOptions aPathOpt;
String sGlosPath( aPathOpt.GetAutoTextPath() );
pDlg->SetPath(sGlosPath);
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index b8b3438..f93b95b 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -513,7 +513,7 @@ void SwNumPositionTabPage::InitPosAndSpaceMode()
{
if ( pActNum == 0 )
{
- DBG_ASSERT( false,
+ OSL_ENSURE( false,
"<SwNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> has to be already set!" );
return;
}
diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx
index c141fb9..7ccb7eb 100644
--- a/sw/source/ui/misc/numberingtypelistbox.cxx
+++ b/sw/source/ui/misc/numberingtypelistbox.cxx
@@ -55,7 +55,7 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, const ResId& rResI
uno::Reference < uno::XInterface > xI = xMSF->createInstance(
::rtl::OUString::createFromAscii( "com.sun.star.text.DefaultNumberingProvider" ) );
uno::Reference<text::XDefaultNumberingProvider> xDefNum(xI, uno::UNO_QUERY);
- DBG_ASSERT(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
+ OSL_ENSURE(xDefNum.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\"");
pImpl->xInfo = uno::Reference<text::XNumberingTypeInfo>(xDefNum, uno::UNO_QUERY);
Reload(nTypeFlags);
@@ -147,9 +147,9 @@ sal_Int16 SwNumberingTypeListBox::GetSelectedNumberingType()
USHORT nSelPos = GetSelectEntryPos();
if(LISTBOX_ENTRY_NOTFOUND != nSelPos)
nRet = (sal_Int16)(ULONG)GetEntryData(nSelPos);
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
else
- DBG_ERROR("SwNumberingTypeListBox not selected");
+ OSL_ENSURE(false, "SwNumberingTypeListBox not selected");
#endif
return nRet;
}
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 84bfd6e..26932fc 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -69,9 +69,7 @@
#include <unomid.h>
#include <IDocumentOutlineNodes.hxx>
-// --> OD 2008-04-14 #outlinelevel#
#include <app.hrc>
-// <--
using namespace ::com::sun::star;
diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx
index 214da30..ad3988b 100644
--- a/sw/source/ui/misc/redlndlg.cxx
+++ b/sw/source/ui/misc/redlndlg.cxx
@@ -817,7 +817,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( BOOL bSelect, BOOL bAccept )
ListBoxEntries_t aRedlines;
// don't activate
- DBG_ASSERT( bInhibitActivate == false,
+ OSL_ENSURE( bInhibitActivate == false,
"recursive call of CallAcceptReject?");
bInhibitActivate = true;
@@ -1127,9 +1127,9 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
sComment = rRedline.GetComment();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::DialogGetRanges fnGetRange = pFact->GetDialogGetRangesFunc( RID_SVXDLG_POSTIT );
- DBG_ASSERT(fnGetRange, "Dialogdiet fail! GetRanges()");
+ OSL_ENSURE(fnGetRange, "Dialogdiet fail! GetRanges()");
SfxItemSet aSet( pSh->GetAttrPool(), fnGetRange() );
aSet.Put(SvxPostItTextItem(sComment.ConvertLineEnd(), SID_ATTR_POSTIT_TEXT));
@@ -1140,7 +1140,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
SID_ATTR_POSTIT_DATE ));
AbstractSvxPostItDialog* pDlg = pFact->CreateSvxPostItDialog( pParentDlg, aSet, FALSE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->HideAuthor();
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index 9d04ea6..604786a 100644
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -190,7 +190,7 @@ void SwInputWindow::ShowWin()
pView->GetHLineal().SetActive( FALSE );
pView->GetVLineal().SetActive( FALSE );
- DBG_ASSERT(pWrtShell, "Keine WrtShell!");
+ OSL_ENSURE(pWrtShell, "no WrtShell!");
// Cursor in Tabelle
bIsTable = pWrtShell->IsCrsrInTbl() ? TRUE : FALSE;
@@ -211,7 +211,7 @@ void SwInputWindow::ShowWin()
aPos.SetText(SW_RESSTR(STR_TBL_FORMULA));
// Aktuelles Feld bearbeiten
- ASSERT(pMgr == 0, FieldManager nicht geloescht.);
+ OSL_ENSURE(pMgr == 0, "FieldManager not deleted");
pMgr = new SwFldMgr;
// JP 13.01.97: Formel soll immer mit einem "=" beginnen, hier
@@ -568,7 +568,7 @@ void __EXPORT InputEdit::UpdateRange(const String& rBoxes,
aStr += cClose;
SetText(aStr);
USHORT nPos = aStr.Search( cClose );
- ASSERT(nPos < aStr.Len(), Delimiter nicht gefunden.);
+ OSL_ENSURE(nPos < aStr.Len(), "delimiter not found");
++nPos;
SetSelection( Selection( nPos, nPos ));
}
diff --git a/sw/source/ui/ribbar/tbxanchr.cxx b/sw/source/ui/ribbar/tbxanchr.cxx
index 6f8e0aa..0f9278b 100644
--- a/sw/source/ui/ribbar/tbxanchr.cxx
+++ b/sw/source/ui/ribbar/tbxanchr.cxx
@@ -140,7 +140,7 @@ void SwTbxAnchor::Click()
}
if(!pActiveView)
{
- DBG_ERROR("No active view could be found");
+ OSL_ENSURE(false, "No active view found");
return;
}
SwWrtShell* pWrtShell = pActiveView->GetWrtShellPtr();
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index 6855ae1..772342b 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -382,7 +382,7 @@ IMPL_LINK(SwTbxAutoTextCtrl, PopupHdl, PopupMenu*, pMenu)
SwGlossaryHdl* pGlosHdl = pView->GetGlosHdl();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
::GlossarySetActGroup fnSetActGroup = pFact->SetGlossaryActGroupFunc( DLG_RENAME_GLOS );
if ( fnSetActGroup )
(*fnSetActGroup)( sGroup );
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 5299709..4731302 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -168,7 +168,7 @@ SfxUndoManager* SwAnnotationShell::GetUndoManager()
if ( !pPostItMgr ||
!pPostItMgr->HasActiveSidebarWin() )
{
- DBG_ASSERT(pPostItMgr,"PostItMgr::Layout(): We are looping forever");
+ OSL_ENSURE(pPostItMgr,"PostItMgr::Layout(): We are looping forever");
return 0;
}
return &pPostItMgr->GetActiveSidebarWin()->GetOutlinerView()->GetOutliner()->GetUndoManager();
@@ -373,10 +373,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
case FN_FORMAT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( rView.GetWindow(), rView.GetWrtShell(), DLG_DOC_FOOTNOTE );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
@@ -385,10 +385,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
{
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
rView.GetWindow(), &aTmp, rView.GetWrtShell());
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
rReq.Done();
@@ -424,7 +424,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( rView.GetWindow() );
pDialog->SetValues(aCurr, aDocStat );
pDialog->Execute();
@@ -450,10 +450,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR,0, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
USHORT nRet = pDlg->Execute();
if(RET_OK == nRet )
{
@@ -498,10 +498,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
USHORT nRet = pDlg->Execute();
if(RET_OK == nRet)
{
@@ -1354,7 +1354,7 @@ void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
break;
default:
- ASSERT(!this, "falscher Dispatcher");
+ OSL_ENSURE(!this, "wrong dispatcher");
}
if( nMode )
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 6eb7d31..71a212c 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -250,7 +250,7 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
rSh.DelLeft();
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_ENSURE(false, "wrong Dispatcher");
return;
}
rReq.Done();
@@ -414,7 +414,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq)
}
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_ENSURE(false, "wrong Dispatcher");
return;
}
if(!bIgnore)
@@ -511,7 +511,7 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq)
rSh.Do( SwWrtShell::REPEAT );
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_ENSURE(false, "wrong Dispatcher");
}
if (pViewFrame) { pViewFrame->GetBindings().InvalidateAll(sal_False); }
@@ -859,11 +859,11 @@ void SwBaseShell::Execute(SfxRequest &rReq)
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwConvertTableDlg* pDlg = pFact->CreateSwConvertTableDlg(
GetView(),DLG_CONV_TEXT_TABLE , bToTable);
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if( RET_OK == pDlg->Execute() )
{
pDlg->GetValues( cDelim, aInsTblOpts, pTAFmt );
@@ -1158,7 +1158,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
static_cast<const SfxBoolItem*>( pItem )->GetValue();
// set form design mode
- DBG_ASSERT( GetView().GetFormShell() != NULL, "form shell?" );
+ OSL_ENSURE( GetView().GetFormShell() != NULL, "form shell?" );
SfxRequest aReq( GetView().GetViewFrame(), SID_FM_DESIGN_MODE );
aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) );
GetView().GetFormShell()->Execute( aReq );
@@ -1217,7 +1217,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
case FN_PAGE_STYLE_SET_PAPER_SIZE:
case FN_PAGE_STYLE_SET_PAPER_BIN:
{
- DBG_ERROR("not implemented");
+ OSL_ENSURE(false, "not implemented");
}
break;
@@ -1244,7 +1244,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
}
break;
default:
- DBG_ERROR("falscher Dispatcher");
+ OSL_ENSURE(false, "wrong Dispatcher");
}
}
@@ -2310,7 +2310,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
default:
// bMsgOk = FALSE;
rReq.Ignore();
- DBG_ERROR( "Unbekannte Message bei ExecuteAttr!" );
+ OSL_ENSURE(false, "unknown message in ExecuteAttr!" );
return;
}
@@ -2433,10 +2433,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
::PrepareBoxInfo( aSet, rSh );
rSh.GetTabBorders( aSet );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_TABLE, RC_DLG_SWBORDERDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
@@ -2450,10 +2450,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
aSet.Put( aMgr.GetAttrSet() );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_FRAME, RC_DLG_SWBORDERDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
@@ -2468,10 +2468,10 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
::PrepareBoxInfo( aSet, rSh );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_PARA, RC_DLG_SWBORDERDLG );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
rSh.SetAttr( *pDlg->GetOutputItemSet() );
@@ -2493,7 +2493,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
SfxAbstractDialog * pDlg = 0;
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
+ OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
// Tabellenzelle(n) selektiert?
@@ -2505,7 +2505,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
pDlg = pFact->CreateSfxDialog( pMDI, aSet,
rView.GetViewFrame()->GetFrame().GetFrameInterface(),
RC_SWDLG_BACKGROUND );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
aSet.Put( aBrush );
if ( pDlg->Execute() == RET_OK )
{
@@ -2524,7 +2524,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
pDlg = pFact->CreateSfxDialog( pMDI, aSet,
rView.GetViewFrame()->GetFrame().GetFrameInterface(),
RC_SWDLG_BACKGROUND );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ OSL_ENSURE(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() == RET_OK )
{
rSh.SetFlyFrmAttr((SfxItemSet &) *pDlg->GetOutputItemSet() );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list