[Libreoffice-commits] .: 4 commits - sw/source
David Tardon
dtardon at kemper.freedesktop.org
Fri Nov 26 23:27:04 PST 2010
sw/source/core/layout/dbg_lay.cxx | 2 -
sw/source/core/undo/undobj.cxx | 4 ++-
sw/source/filter/html/css1atr.cxx | 2 -
sw/source/filter/xml/XMLRedlineImportHelper.cxx | 30 ++++++++++++------------
4 files changed, 20 insertions(+), 18 deletions(-)
New commits:
commit 4b7aab59792a1c864c7ba524f97b3df935d94dd9
Author: David Tardon <dtardon at redhat.com>
Date: Sat Nov 27 08:20:58 2010 +0100
compiler warning: add parentheses around operands of ==
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 4e8ca43..fe43193 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -879,7 +879,7 @@ USHORT SwHTMLWriter::GetCSS1Selector( const SwFmt *pFmt, ByteString& rToken,
// Wenn eine PoolId gesetzt ist, entspricht der Name der
// Vorlage dem szugehoerigen Token
- OSL_ENSURE( rRefPoolId != 0 == rToken.Len() > 0,
+ OSL_ENSURE( (rRefPoolId != 0) == (rToken.Len() > 0),
"Token missing" );
}
else
commit 965142ad795ebfddb4460b012626a0b223034543
Author: David Tardon <dtardon at redhat.com>
Date: Sat Nov 27 08:19:24 2010 +0100
fix debug build
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 44fb440..bb751d6 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1197,10 +1197,12 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
for( USHORT n = rSData.Count(); n; )
rSData[ --n ]->RedlineToDoc( aPam );
+#if OSL_DEBUG_LEVEL > 1
// check redline count against count saved in RedlineSaveData object
- DBG_ASSERT( (rSData.Count() == 0) ||
+ OSL_ENSURE( (rSData.Count() == 0) ||
(rSData[0]->nRedlineCount == rDoc.GetRedlineTbl().Count()),
"redline count not restored properly" );
+#endif
rDoc.SetRedlineMode_intern( eOld );
}
commit 6bc5dfa9e89afc18b65a101821ec37592a608644
Author: David Tardon <dtardon at redhat.com>
Date: Sat Nov 27 08:10:16 2010 +0100
fix debug build
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index eeff8a9..c5d3fab 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -104,7 +104,7 @@
*
* --------------------------------------------------*/
-#if !defined(OSL_DEBUG_LEVEL) || OSL_DEBUG_LEVEL == 0
+#if !defined(OSL_DEBUG_LEVEL) || OSL_DEBUG_LEVEL <= 1
#error Who broken the makefiles?
#endif
commit ef78de10125a6cf4000b5a4e764c4a3b03f23348
Author: David Tardon <dtardon at redhat.com>
Date: Sat Nov 27 07:54:47 2010 +0100
fix non-product build
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 01e2ff6..1838502 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -71,20 +71,20 @@ using ::com::sun::star::beans::XPropertySetInfo;
SwDoc* lcl_GetDocViaTunnel( Reference<XTextCursor> & rCursor )
{
Reference<XUnoTunnel> xTunnel( rCursor, UNO_QUERY);
- DBG_ASSERT( xTunnel.is(), "missing XUnoTunnel for Cursor" );
+ OSL_ENSURE( xTunnel.is(), "missing XUnoTunnel for Cursor" );
OTextCursorHelper* pSwXCursor = reinterpret_cast< OTextCursorHelper * >(
sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(OTextCursorHelper::getUnoTunnelId())) );
- DBG_ASSERT( NULL != pSwXCursor, "OTextCursorHelper missing" );
+ OSL_ENSURE( NULL != pSwXCursor, "OTextCursorHelper missing" );
return pSwXCursor->GetDoc();
}
SwDoc* lcl_GetDocViaTunnel( Reference<XTextRange> & rRange )
{
Reference<XUnoTunnel> xTunnel(rRange, UNO_QUERY);
- DBG_ASSERT(xTunnel.is(), "Can't tunnel XTextRange");
+ OSL_ENSURE(xTunnel.is(), "Can't tunnel XTextRange");
SwXTextRange *pRange = reinterpret_cast< SwXTextRange *>(
sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SwXTextRange::getUnoTunnelId())) );
- DBG_ASSERT( NULL != pRange, "SwXTextRange missing" );
+ OSL_ENSURE( NULL != pRange, "SwXTextRange missing" );
return pRange->GetDoc();
}
@@ -157,11 +157,11 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
// SwXTextRange -> PaM
SwUnoInternalPaM aPaM(*pDoc);
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
sal_Bool bSuccess =
#endif
::sw::XTextRangeToSwPaM(aPaM, rRange);
- DBG_ASSERT(bSuccess, "illegal range");
+ OSL_ENSURE(bSuccess, "illegal range");
// PaM -> Index
Set(aPaM.GetPoint()->nNode);
@@ -169,17 +169,17 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex(
void XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos)
{
- DBG_ASSERT(IsValid(), "Can't get Position");
+ OSL_ENSURE(IsValid(), "Can't get Position");
// create PAM from start cursor (if no node index is present)
if (NULL == pIndex)
{
SwUnoInternalPaM aUnoPaM(*GetDoc());
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
sal_Bool bSuccess =
#endif
::sw::XTextRangeToSwPaM(aUnoPaM, xRange);
- DBG_ASSERT(bSuccess, "illegal range");
+ OSL_ENSURE(bSuccess, "illegal range");
rPos = *aUnoPaM.GetPoint();
}
@@ -193,7 +193,7 @@ void XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos)
SwDoc* XTextRangeOrNodeIndexPosition::GetDoc()
{
- DBG_ASSERT(IsValid(), "Can't get Doc");
+ OSL_ENSURE(IsValid(), "Can't get Doc");
return (NULL != pIndex) ? pIndex->GetNodes().GetDoc() : lcl_GetDocViaTunnel(xRange);
}
@@ -332,7 +332,7 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
// and delete the incomplete ones. Finally, delete it.
if( IsReady(pInfo) )
{
- DBG_ERROR("forgotten RedlineInfo; now inserted");
+ OSL_ENSURE(false, "forgotten RedlineInfo; now inserted");
InsertIntoDocument( pInfo );
}
else
@@ -341,7 +341,7 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
pInfo->bNeedsAdjustment = sal_False;
if( IsReady(pInfo) )
{
- DBG_ERROR("RedlineInfo without adjustment; now inserted");
+ OSL_ENSURE(false, "RedlineInfo without adjustment; now inserted");
InsertIntoDocument( pInfo );
}
else
@@ -350,7 +350,7 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
// (i.e. end without start, or start without
// end). This may well be a problem in the file,
// rather than the code.
- DBG_ERROR("incomplete redline (maybe file was corrupt); "
+ OSL_ENSURE(false, "incomplete redline (maybe file was corrupt); "
"now deleted");
}
}
@@ -599,8 +599,8 @@ inline sal_Bool XMLRedlineImportHelper::IsReady(RedlineInfo* pRedline)
void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
{
- DBG_ASSERT(NULL != pRedlineInfo, "need redline info");
- DBG_ASSERT(IsReady(pRedlineInfo), "redline info not complete yet!");
+ OSL_ENSURE(NULL != pRedlineInfo, "need redline info");
+ OSL_ENSURE(IsReady(pRedlineInfo), "redline info not complete yet!");
// this method will modify the document directly -> lock SolarMutex
SolarMutexGuard aGuard;
More information about the Libreoffice-commits
mailing list