summaryrefslogtreecommitdiff
path: root/accessibility
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 /accessibility
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>
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx32
1 files changed, 13 insertions, 19 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();