summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGökhan Gurbetoğlu <gokhan.gurbetoglu@pardus.org.tr>2016-09-01 10:14:36 +0300
committerMichael Stahl <mstahl@redhat.com>2016-09-05 12:53:19 +0000
commitf62d22286972d22809fafbd9cb44263d12a6aa85 (patch)
tree8dc0a1d07166b04347c1b44ac4e255f77b7ae26a
parent6004f5c61ec4b075075360e49b138d34ad84d056 (diff)
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>
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx32
-rw-r--r--animations/source/animcore/animcore.cxx6
-rw-r--r--basegfx/source/polygon/b2dsvgpolypolygon.cxx7
-rw-r--r--include/sal/log-areas.dox1
4 files changed, 21 insertions, 25 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 4a5f0cb0e5b0..f2aae5084506 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -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();
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index 56d4dafe74e1..604b7e231a4c 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -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;
diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
index 4e1a4b41be73..812cd02a8ada 100644
--- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx
+++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx
@@ -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;
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 29f52271d47b..70661fe507d3 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -536,6 +536,7 @@ certain functionality.
@section other
@li @c accessibility
+@li @c animations
@li @c basegfx
@li @c binaryurp
@li @c configmgr