tdf#43157 - Clean up OSL_ASSERT, DBG_ASSERT, etc.

Change-Id: I8114e338451b5b2e79b2318f558cbd075f024f08
Reviewed-on: https://gerrit.libreoffice.org/28584
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
Gökhan Gurbetoğlu 2016-09-01 10:14:36 +03:00 committed by Michael Stahl
parent 6004f5c61e
commit f62d222869
4 changed files with 21 additions and 25 deletions

View File

@ -32,7 +32,7 @@ namespace accessibility
{
void SfxListenerGuard::startListening(::SfxBroadcaster & rNotifier)
{
OSL_ENSURE(m_pNotifier == nullptr, "called more than once");
assert(m_pNotifier == nullptr && "called more than once");
m_pNotifier = &rNotifier;
m_rListener.StartListening(*m_pNotifier, true);
}
@ -48,7 +48,7 @@ void SfxListenerGuard::endListening()
void WindowListenerGuard::startListening(vcl::Window & rNotifier)
{
OSL_ENSURE(m_pNotifier == nullptr, "called more than once");
assert(m_pNotifier == nullptr && "called more than once");
m_pNotifier = &rNotifier;
m_pNotifier->AddEventListener(m_aListener);
}
@ -278,11 +278,9 @@ void SAL_CALL Paragraph::grabFocus() throw (css::uno::RuntimeException, std::exc
}
catch (const css::lang::IndexOutOfBoundsException & rEx)
{
OSL_TRACE(
"textwindowaccessibility.cxx: Paragraph::grabFocus:"
" caught unexpected %s\n",
OUStringToOString(rEx.Message, RTL_TEXTENCODING_UTF8).
getStr());
SAL_INFO("accessibility",
"textwindowaccessibility.cxx: Paragraph::grabFocus: caught unexpected "
<< rEx.Message);
}
}
@ -1879,8 +1877,7 @@ void Document::handleParagraphNotifications()
case TEXT_HINT_PARAINSERTED:
{
::sal_uLong n = aHint.GetValue();
OSL_ENSURE(n <= m_xParagraphs->size(),
"bad TEXT_HINT_PARAINSERTED event");
assert(n <= m_xParagraphs->size() && "bad TEXT_HINT_PARAINSERTED event");
// Save the values of old iterators (the iterators themselves
// will get invalidated), and adjust the old values so that they
@ -1953,8 +1950,7 @@ void Document::handleParagraphNotifications()
}
else
{
OSL_ENSURE(n < m_xParagraphs->size(),
"Bad TEXT_HINT_PARAREMOVED event");
assert(n < m_xParagraphs->size() && "Bad TEXT_HINT_PARAREMOVED event");
Paragraphs::iterator aIt(m_xParagraphs->begin() + n);
// numeric overflow cannot occur
@ -1998,8 +1994,7 @@ void Document::handleParagraphNotifications()
--m_nSelectionLastPara;
else if (sal::static_int_cast<sal_Int32>(n) == m_nSelectionLastPara)
{
OSL_ENSURE(m_nSelectionFirstPara < m_nSelectionLastPara,
"logic error");
assert(m_nSelectionFirstPara < m_nSelectionLastPara && "logic error");
--m_nSelectionLastPara;
m_nSelectionLastPos = 0x7FFFFFFF;
}
@ -2047,8 +2042,7 @@ void Document::handleParagraphNotifications()
case TEXT_HINT_FORMATPARA:
{
::sal_uLong n = aHint.GetValue();
OSL_ENSURE(n < m_xParagraphs->size(),
"Bad TEXT_HINT_FORMATPARA event");
assert(n < m_xParagraphs->size() && "Bad TEXT_HINT_FORMATPARA event");
(*m_xParagraphs)[static_cast< Paragraphs::size_type >(n)].
changeHeight(static_cast< ::sal_Int32 >(
@ -2070,7 +2064,7 @@ void Document::handleParagraphNotifications()
break;
}
default:
OSL_FAIL( "bad buffered hint");
SAL_WARN("accessibility", "bad buffered hint");
break;
}
}
@ -2211,9 +2205,9 @@ void Document::sendEvent(::sal_Int32 start, ::sal_Int32 end, ::sal_Int16 nEventI
void Document::handleSelectionChangeNotification()
{
::TextSelection const & rSelection = m_rView.GetSelection();
OSL_ENSURE(rSelection.GetStart().GetPara() < m_xParagraphs->size()
&& rSelection.GetEnd().GetPara() < m_xParagraphs->size(),
"bad TEXT_HINT_VIEWSELECTIONCHANGED event");
assert(rSelection.GetStart().GetPara() < m_xParagraphs->size() &&
rSelection.GetEnd().GetPara() < m_xParagraphs->size() &&
"bad TEXT_HINT_VIEWSELECTIONCHANGED event");
::sal_Int32 nNewFirstPara
= static_cast< ::sal_Int32 >(rSelection.GetStart().GetPara());
::sal_Int32 nNewFirstPos = rSelection.GetStart().GetIndex();

View File

@ -429,7 +429,7 @@ AnimationNode::AnimationNode( sal_Int16 nNodeType )
mnIterateType( css::presentation::ShapeAnimationSubType::AS_WHOLE ),
mfIterateInterval(0.0)
{
OSL_ENSURE((sal_uInt32)nNodeType < sizeof(mpTypes)/sizeof(Sequence<Type>*), "NodeType out of range");
assert((sal_uInt32)nNodeType < sizeof(mpTypes)/sizeof(Sequence<Type>*));
}
AnimationNode::AnimationNode( const AnimationNode& rNode )
@ -1215,7 +1215,7 @@ Reference< XCloneable > SAL_CALL AnimationNode::createClone() throw (RuntimeExce
}
catch(const Exception&)
{
OSL_TRACE( "animations::AnimationNode::createClone(), exception caught!" );
SAL_INFO("animations", "animations::AnimationNode::createClone(), exception caught!");
}
}
}
@ -1223,7 +1223,7 @@ Reference< XCloneable > SAL_CALL AnimationNode::createClone() throw (RuntimeExce
}
catch(const Exception&)
{
OSL_TRACE( "animations::AnimationNode::createClone(), exception caught!" );
SAL_INFO("animations", "animations::AnimationNode::createClone(), exception caught!");
}
return xNewNode;

View File

@ -620,8 +620,9 @@ namespace basegfx
default:
{
OSL_FAIL("importFromSvgD(): skipping tags in svg:d element (unknown)!");
OSL_TRACE("importFromSvgD(): skipping tags in svg:d element (unknown: \"%c\")!", aCurrChar);
SAL_WARN("basegfx", "importFromSvgD(): skipping tags in svg:d element (unknown: \""
<< aCurrChar
<< "\")!");
++nPos;
break;
}
@ -665,7 +666,7 @@ namespace basegfx
OUString exportToSvgPoints( const B2DPolygon& rPoly )
{
OSL_ENSURE(!rPoly.areControlPointsUsed(), "exportToSvgPoints: Only non-bezier polygons allowed (!)");
SAL_WARN_IF(rPoly.areControlPointsUsed(), "basegfx", "exportToSvgPoints: Only non-bezier polygons allowed (!)");
const sal_uInt32 nPointCount(rPoly.count());
OUStringBuffer aResult;

View File

@ -536,6 +536,7 @@ certain functionality.
@section other
@li @c accessibility
@li @c animations
@li @c basegfx
@li @c binaryurp
@li @c configmgr