[Libreoffice-commits] core.git: sw/source

Sophie Su sea0721moon at gmail.com
Thu Sep 15 19:55:57 UTC 2016


 sw/source/core/undo/docundo.cxx |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 5059efab2f982daf041701165d15587794ffbfc7
Author: Sophie Su <sea0721moon at gmail.com>
Date:   Sat Aug 27 10:59:53 2016 +0800

    tdf#43157 clean up OSL_ASSERT in /core/sw/source/core/undo/docundo.cxx
    
    Change-Id: I866ba17ffe82294758fd54c525c030eda1e0761a
    Reviewed-on: https://gerrit.libreoffice.org/28418
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index dcab9bb..06a53f7 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -40,6 +40,7 @@
 #include <IDocumentRedlineAccess.hxx>
 #include <IDocumentState.hxx>
 #include <comphelper/lok.hxx>
+#include <assert.h>
 
 using namespace ::com::sun::star;
 
@@ -64,7 +65,7 @@ UndoManager::UndoManager(std::shared_ptr<SwNodes> const & xUndoNodes,
     ,   m_pDocShell(nullptr)
     ,   m_pView(nullptr)
 {
-    OSL_ASSERT(m_xUndoNodes.get());
+    assert(m_xUndoNodes.get());
     // writer expects it to be disabled initially
     // Undo is enabled by SwEditShell constructor
     SdrUndoManager::EnableUndo(false);
@@ -271,13 +272,13 @@ UndoManager::StartUndo(SwUndoId const i_eUndoId,
 
     SwUndoId const eUndoId( (i_eUndoId == UNDO_EMPTY) ? UNDO_START : i_eUndoId );
 
-    OSL_ASSERT(UNDO_END != eUndoId);
+    assert(UNDO_END != eUndoId);
     OUString comment( (UNDO_START == eUndoId)
         ?   OUString("??")
         :   OUString(SW_RES(UNDO_BASE + eUndoId)) );
     if (pRewriter)
     {
-        OSL_ASSERT(UNDO_START != eUndoId);
+        assert(UNDO_START != eUndoId);
         comment = pRewriter->Apply(comment);
     }
 
@@ -313,12 +314,12 @@ UndoManager::EndUndo(SwUndoId const i_eUndoId, SwRewriter const*const pRewriter)
 
     if (nCount) // otherwise: empty list action not inserted!
     {
-        OSL_ASSERT(pLastUndo);
-        OSL_ASSERT(UNDO_START != eUndoId);
+        assert(pLastUndo);
+        assert(UNDO_START != eUndoId);
         SfxUndoAction *const pUndoAction(SdrUndoManager::GetUndoAction());
         SfxListUndoAction *const pListAction(
             dynamic_cast<SfxListUndoAction*>(pUndoAction));
-        OSL_ASSERT(pListAction);
+        assert(pListAction);
         if (pListAction)
         {
             if (UNDO_END != eUndoId)
@@ -644,7 +645,7 @@ bool UndoManager::Repeat(::sw::RepeatContext & rContext,
         return false;
     }
     SfxUndoAction *const pRepeatAction(GetUndoAction());
-    OSL_ASSERT(pRepeatAction);
+    assert(pRepeatAction);
     if (!pRepeatAction || !pRepeatAction->CanRepeat(rContext))
     {
         return false;


More information about the Libreoffice-commits mailing list