[Libreoffice-commits] .: 2 commits - starmath/inc starmath/source starmath/visual-editor-todo sw/inc sw/Library_swd.mk sw/Library_sw.mk sw/source

Thomas Arnhold tarnhold at kemper.freedesktop.org
Sat Mar 19 06:01:24 PDT 2011


 starmath/inc/caret.hxx                 |    2 
 starmath/inc/node.hxx                  |    2 
 starmath/inc/visitors.hxx              |    2 
 starmath/source/cursor.cxx             |   46 ++++-----
 starmath/source/node.cxx               |    2 
 starmath/source/visitors.cxx           |   78 +++++++--------
 starmath/visual-editor-todo            |    5 
 sw/Library_sw.mk                       |    2 
 sw/Library_swd.mk                      |    1 
 sw/inc/errhdl.hxx                      |   76 --------------
 sw/source/core/except/dbgloop.cxx      |  168 ---------------------------------
 sw/source/core/except/errhdl.cxx       |  150 -----------------------------
 sw/source/core/swg/SwXMLTextBlocks.cxx |    1 
 13 files changed, 67 insertions(+), 468 deletions(-)

New commits:
commit 44de817533831ed568bbd87dd107bf506bc6bfb6
Author: Jacek Wolszczak <shutdownrunner at gmail.com>
Date:   Sat Mar 19 14:01:13 2011 +0100

    REPLACE j_assert with OSL_

diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx
index be40598..c0bda17 100644
--- a/starmath/inc/caret.hxx
+++ b/starmath/inc/caret.hxx
@@ -188,7 +188,7 @@ public:
     SmCaretPosGraphEntry* Add(SmCaretPos pos,
                             SmCaretPosGraphEntry* left = NULL,
                             SmCaretPosGraphEntry* right = NULL){
-        j_assert(pos.Index >= 0, "Index shouldn't be -1!");
+        OSL_ENSURE(pos.Index >= 0, "Index shouldn't be -1!");
         return Add(SmCaretPosGraphEntry(pos, left, right));
     }
     /** Get an iterator for this graph */
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index cb87e95..c590599 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -34,8 +34,6 @@
 #include <iostream>
 #include <stdio.h>
 
-#define j_assert(cond, msg) DBG_ASSERT(cond, msg)
-
 #include "parse.hxx"
 #include "types.hxx"
 #include "rect.hxx"
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 3dbe887..8960a24 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -176,7 +176,7 @@ public:
     SmCaretPos2LineVisitor( OutputDevice *pDevice, SmCaretPos position ) {
         pDev = pDevice;
         pos = position;
-        j_assert( position.IsValid( ), "Cannot draw invalid position!" );
+        OSL_ENSURE( position.IsValid( ), "Cannot draw invalid position!" );
 
         pos.pSelectedNode->Accept( this );
     }
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 558d305..9c16435 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -38,12 +38,12 @@ void SmCursor::Move(OutputDevice* pDev, SmMovementDirection direction, bool bMov
         case MoveLeft:
         {
             NewPos = position->Left;
-            j_assert(NewPos, "NewPos shouldn't be NULL here!");
+            OSL_ENSURE(NewPos, "NewPos shouldn't be NULL here!");
         }break;
         case MoveRight:
         {
             NewPos = position->Right;
-            j_assert(NewPos, "NewPos shouldn't be NULL here!");
+            OSL_ENSURE(NewPos, "NewPos shouldn't be NULL here!");
         }break;
         case MoveUp:
             //Implementation is practically identical to MoveDown, except for a single if statement
@@ -82,7 +82,7 @@ void SmCursor::Move(OutputDevice* pDev, SmMovementDirection direction, bool bMov
             }
         }break;
         default:
-            j_assert(false, "Movement direction not supported!");
+            OSL_FAIL("Movement direction not supported!");
     }
     if(NewPos){
         position = NewPos;
@@ -100,7 +100,7 @@ void SmCursor::MoveTo(OutputDevice* pDev, Point pos, bool bMoveAnchor){
          dbp_sq = 1;    //Distance to best line squared
     SmCaretPosGraphIterator it = pGraph->GetIterator();
     while(it.Next()){
-        j_assert(it->CaretPos.IsValid(), "The caret position graph may not have invalid positions!");
+        OSL_ENSURE(it->CaretPos.IsValid(), "The caret position graph may not have invalid positions!");
         //Compute current line
         curr_line = SmCaretPos2LineVisitor(pDev, it->CaretPos).GetResult();
         //If we have a position compare to it
@@ -160,8 +160,8 @@ void SmCursor::BuildGraph(){
     if(!anchor)
         anchor = position;
 
-    j_assert(position->CaretPos.IsValid(), "Position must be valid");
-    j_assert(anchor->CaretPos.IsValid(), "Anchor must be valid");
+    OSL_ENSURE(position->CaretPos.IsValid(), "Position must be valid");
+    OSL_ENSURE(anchor->CaretPos.IsValid(), "Anchor must be valid");
 }
 
 bool SmCursor::SetCaretPosition(SmCaretPos pos, bool moveAnchor){
@@ -203,7 +203,7 @@ void SmCursor::DeletePrev(OutputDevice* pDev){
         BeginEdit();
         //Line to merge things into, so we can delete pLine
         SmNode* pMergeLine = pLineParent->GetSubNode(nLineOffset-1);
-        j_assert(pMergeLine, "pMergeLine cannot be NULL!");
+        OSL_ENSURE(pMergeLine, "pMergeLine cannot be NULL!");
         //Convert first line to list
         SmNodeList *pLineList = NodeToList(pMergeLine);
         //Find iterator to patch
@@ -269,17 +269,17 @@ void SmCursor::Delete(){
 
     //Find an arbitrary selected node
     SmNode* pSNode = FindSelectedNode(pTree);
-    j_assert(pSNode != NULL, "There must be a selection when HasSelection is true!");
+    OSL_ENSURE(pSNode != NULL, "There must be a selection when HasSelection is true!");
 
     //Find the topmost node of the line that holds the selection
     SmNode* pLine = FindTopMostNodeInLine(pSNode, true);
-    j_assert(pLine != pTree, "Shouldn't be able to select the entire tree");
+    OSL_ENSURE(pLine != pTree, "Shouldn't be able to select the entire tree");
 
     //Get the parent of the line
     SmStructureNode* pLineParent = pLine->GetParent();
     //Find line offset in parent
     int nLineOffset = pLineParent->IndexOfSubNode(pLine);
-    j_assert(nLineOffset != -1, "pLine must be a child of it's parent!");
+    OSL_ENSURE(nLineOffset != -1, "pLine must be a child of it's parent!");
 
     //Position after delete
     SmCaretPos PosAfterDelete;
@@ -317,7 +317,7 @@ void SmCursor::InsertNodes(SmNodeList* pNewNodes){
     //Find line parent and line index in parent
     SmStructureNode* pLineParent = pLine->GetParent();
     int nParentIndex = pLineParent->IndexOfSubNode(pLine);
-    j_assert(nParentIndex != -1, "pLine must be a subnode of pLineParent!");
+    OSL_ENSURE(nParentIndex != -1, "pLine must be a subnode of pLineParent!");
 
     //Convert line to list
     SmNodeList* pLineList = NodeToList(pLine);
@@ -506,7 +506,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
     SmNode *pLine;
     if(HasSelection()) {
         SmNode *pSNode = FindSelectedNode(pTree);
-        j_assert(pSNode != NULL, "There must be a selected node when HasSelection is true!");
+        OSL_ENSURE(pSNode != NULL, "There must be a selected node when HasSelection is true!");
         pLine = FindTopMostNodeInLine(pSNode, sal_True);
     } else
         pLine = FindTopMostNodeInLine(position->CaretPos.pSelectedNode, sal_False);
@@ -514,7 +514,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
     //Find Parent and offset in parent
     SmStructureNode *pLineParent = pLine->GetParent();
     int nParentIndex = pLineParent->IndexOfSubNode(pLine);
-    j_assert(nParentIndex != -1, "pLine must be a subnode of pLineParent!");
+    OSL_ENSURE(nParentIndex != -1, "pLine must be a subnode of pLineParent!");
 
     //TODO: Consider handling special cases where parent is an SmOperNode,
     //      Maybe this method should be able to add limits to an SmOperNode...
@@ -677,7 +677,7 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) {
     SmNode *pLine;
     if(HasSelection()) {
         SmNode *pSNode = FindSelectedNode(pTree);
-        j_assert(pSNode != NULL, "There must be a selected node if HasSelection()");
+        OSL_ENSURE(pSNode != NULL, "There must be a selected node if HasSelection()");
         pLine = FindTopMostNodeInLine(pSNode, sal_True);
     } else
         pLine = FindTopMostNodeInLine(position->CaretPos.pSelectedNode, sal_False);
@@ -685,7 +685,7 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) {
     //Find parent and offset in parent
     SmStructureNode *pLineParent = pLine->GetParent();
     int nParentIndex = pLineParent->IndexOfSubNode(pLine);
-    j_assert( nParentIndex != -1, "pLine must be a subnode of pLineParent!");
+    OSL_ENSURE( nParentIndex != -1, "pLine must be a subnode of pLineParent!");
 
     //Convert line to list
     SmNodeList *pLineList = NodeToList(pLine);
@@ -813,7 +813,7 @@ bool SmCursor::InsertRow() {
     SmNode *pLine;
     if(HasSelection()) {
         SmNode *pSNode = FindSelectedNode(pTree);
-        j_assert(pSNode != NULL, "There must be a selected node if HasSelection()");
+        OSL_ENSURE(pSNode != NULL, "There must be a selected node if HasSelection()");
         pLine = FindTopMostNodeInLine(pSNode, sal_True);
     } else
         pLine = FindTopMostNodeInLine(position->CaretPos.pSelectedNode, sal_False);
@@ -821,7 +821,7 @@ bool SmCursor::InsertRow() {
     //Find parent and offset in parent
     SmStructureNode *pLineParent = pLine->GetParent();
     int nParentIndex = pLineParent->IndexOfSubNode(pLine);
-    j_assert( nParentIndex != -1, "pLine must be a subnode of pLineParent!");
+    OSL_ENSURE( nParentIndex != -1, "pLine must be a subnode of pLineParent!");
 
     //Discover the context of this command
     SmTableNode  *pTable  = NULL;
@@ -836,7 +836,7 @@ bool SmCursor::InsertRow() {
         //NOTE: This hack might give problems if we stop ignoring SmAlignNode
         pTable = (SmTableNode*)pLineParent->GetParent();
         nTableIndex = pTable->IndexOfSubNode(pLineParent);
-        j_assert(nTableIndex != -1, "pLineParent must be a child of its parent!");
+        OSL_ENSURE(nTableIndex != -1, "pLineParent must be a child of its parent!");
     }
     if(pLineParent->GetType() == NMATRIX)
         pMatrix = (SmMatrixNode*)pLineParent;
@@ -916,7 +916,7 @@ bool SmCursor::InsertRow() {
         }
         pMatrix->SetRowCol(rows + 1, cols);
     } else
-        j_assert(sal_False, "We must be either the context of a table or matrix!");
+        OSL_FAIL("We must be either the context of a table or matrix!");
 
     //Finish editing
     FinishEdit(pLineList, pLineParent, nParentIndex, PosAfterInsert);
@@ -933,7 +933,7 @@ void SmCursor::InsertFraction() {
     SmNode *pLine;
     if(HasSelection()) {
         SmNode *pSNode = FindSelectedNode(pTree);
-        j_assert(pSNode != NULL, "There must be a selected node when HasSelection is true!");
+        OSL_ENSURE(pSNode != NULL, "There must be a selected node when HasSelection is true!");
         pLine = FindTopMostNodeInLine(pSNode, sal_True);
     } else
         pLine = FindTopMostNodeInLine(position->CaretPos.pSelectedNode, sal_False);
@@ -941,7 +941,7 @@ void SmCursor::InsertFraction() {
     //Find Parent and offset in parent
     SmStructureNode *pLineParent = pLine->GetParent();
     int nParentIndex = pLineParent->IndexOfSubNode(pLine);
-    j_assert(nParentIndex != -1, "pLine must be a subnode of pLineParent!");
+    OSL_ENSURE(nParentIndex != -1, "pLine must be a subnode of pLineParent!");
 
     //We begin modifying the tree here
     BeginEdit();
@@ -1090,9 +1090,9 @@ void SmCursor::InsertElement(SmFormulaElement element){
             pNewNode = new SmMathSymbolNode(token);
         }break;
         default:
-            j_assert(false, "Element unknown!");
+            OSL_FAIL("Element unknown!");
     }
-    j_assert(pNewNode != NULL, "No new node was created!");
+    OSL_ENSURE(pNewNode != NULL, "No new node was created!");
     if(!pNewNode)
         return;
 
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 84775e3..6bceda4 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -3038,7 +3038,7 @@ void SmNode::Accept(SmVisitor*){
     //obscure copy constructor is used... I can't find it's implementation, and
     //don't want to figure out how to fix it... If you want to, just delete this
     //method, making SmNode abstract, and see where you can an problem with that.
-    j_assert(false, "SmNode should not be visitable!");
+    OSL_FAIL("SmNode should not be visitable!");
 }
 
 void SmTableNode::Accept(SmVisitor* pVisitor) {
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 4a69d85..78e5adc 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -32,163 +32,163 @@
 
 void SmVisitorTest::Visit( SmTableNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NTABLE, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NTABLE, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmBraceNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NBRACE, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NBRACE, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmBracebodyNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NBRACEBODY, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NBRACEBODY, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmOperNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NOPER, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NOPER, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmAlignNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NALIGN, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NALIGN, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmAttributNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NATTRIBUT, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NATTRIBUT, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmFontNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NFONT, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NFONT, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmUnHorNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NUNHOR, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NUNHOR, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmBinHorNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NBINHOR, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NBINHOR, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmBinVerNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NBINVER, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NBINVER, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmBinDiagonalNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NBINDIAGONAL, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NBINDIAGONAL, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmSubSupNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NSUBSUP, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NSUBSUP, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmMatrixNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NMATRIX, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NMATRIX, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmPlaceNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NPLACE, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NPLACE, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmTextNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NTEXT, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NTEXT, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmSpecialNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NSPECIAL, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NSPECIAL, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmGlyphSpecialNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NGLYPH_SPECIAL, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NGLYPH_SPECIAL, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmMathSymbolNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NMATH, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NMATH, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmBlankNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NBLANK, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NBLANK, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmErrorNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NERROR, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NERROR, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmLineNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NLINE, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NLINE, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmExpressionNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NEXPRESSION, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NEXPRESSION, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmPolyLineNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NPOLYLINE, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NPOLYLINE, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmRootNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NROOT, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NROOT, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmRootSymbolNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NROOTSYMBOL, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NROOTSYMBOL, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmRectangleNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NRECTANGLE, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NRECTANGLE, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
 void SmVisitorTest::Visit( SmVerticalBraceNode* pNode )
 {
-    j_assert( pNode->GetType( ) == NVERTICAL_BRACE, "the visitor-patterns isn't implemented correctly" );
+    OSL_ENSURE( pNode->GetType( ) == NVERTICAL_BRACE, "the visitor-patterns isn't implemented correctly" );
     VisitChildren( pNode );
 }
 
@@ -347,7 +347,7 @@ SmCaretDrawingVisitor::SmCaretDrawingVisitor( OutputDevice& rDevice,
     pos = position;
     Offset = offset;
     isCaretVisible = caretVisible;
-    j_assert( position.IsValid( ), "Cannot draw invalid position!" );
+    OSL_ENSURE( position.IsValid( ), "Cannot draw invalid position!" );
     if( !position.IsValid( ) )
         return;
 
@@ -789,7 +789,7 @@ SmSetSelectionVisitor::SmSetSelectionVisitor( SmCaretPos startPos, SmCaretPos en
     IsSelecting = false;
 
     //Assume that pTree is a SmTableNode
-    j_assert(pTree->GetType() == NTABLE, "pTree should be a SmTableNode!");
+    OSL_ENSURE(pTree->GetType() == NTABLE, "pTree should be a SmTableNode!");
     //Visit root node, this is special as this node cannot be selected, but it's children can!
     if(pTree->GetType() == NTABLE){
         //Change state if StartPos is infront of this node
@@ -798,7 +798,7 @@ SmSetSelectionVisitor::SmSetSelectionVisitor( SmCaretPos startPos, SmCaretPos en
         //Change state if EndPos is infront of this node
         if( EndPos.pSelectedNode == pTree && EndPos.Index == 0 )
             IsSelecting = !IsSelecting;
-        j_assert(!IsSelecting, "Caret positions needed to set IsSelecting about, shouldn't be possible!");
+        OSL_ENSURE(!IsSelecting, "Caret positions needed to set IsSelecting about, shouldn't be possible!");
 
         //Visit lines
         SmNodeIterator it( pTree );
@@ -814,7 +814,7 @@ SmSetSelectionVisitor::SmSetSelectionVisitor( SmCaretPos startPos, SmCaretPos en
             }
         }
         //Check if pTree isn't selected
-        j_assert(!pTree->IsSelected(), "pTree should never be selected!");
+        OSL_ENSURE(!pTree->IsSelected(), "pTree should never be selected!");
         //Discard the selection if there's a bug (it's better than crashing)
         if(pTree->IsSelected())
             SetSelectedOnAll(pTree, false);
@@ -985,7 +985,7 @@ SmCaretPosGraphBuildingVisitor::SmCaretPosGraphBuildingVisitor( SmNode* pRootNod
     pRightMost  = NULL;
     pGraph = new SmCaretPosGraph( );
     //pRootNode should always be a table
-    j_assert( pRootNode->GetType( ) == NTABLE, "pRootNode must be a table node");
+    OSL_ENSURE( pRootNode->GetType( ) == NTABLE, "pRootNode must be a table node");
     //Handle the special case where NTABLE is used a rootnode
     if( pRootNode->GetType( ) == NTABLE ){
         //Children are SmLineNodes
@@ -1077,10 +1077,10 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmSubSupNode* pNode )
                          *bodyRight;
 
     left = pRightMost;
-    j_assert( pRightMost, "pRightMost shouldn't be NULL here!" );
+    OSL_ENSURE( pRightMost, "pRightMost shouldn't be NULL here!" );
 
     //Create bodyLeft
-    j_assert( pNode->GetBody( ), "SmSubSupNode Doesn't have a body!" );
+    OSL_ENSURE( pNode->GetBody( ), "SmSubSupNode Doesn't have a body!" );
     bodyLeft = pGraph->Add( SmCaretPos( pNode->GetBody( ), 0 ), left );
     left->SetRight( bodyLeft ); //TODO: Don't make this if LSUP or LSUB are NULL ( not sure??? )
 
@@ -1329,7 +1329,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmMatrixNode* pNode )
  */
 void SmCaretPosGraphBuildingVisitor::Visit( SmTextNode* pNode )
 {
-    j_assert( pNode->GetText( ).Len( ) > 0, "Empty SmTextNode is bad" );
+    OSL_ENSURE( pNode->GetText( ).Len( ) > 0, "Empty SmTextNode is bad" );
 
     int size = pNode->GetText( ).Len( );
     for( int i = 1; i <= size; i++ ){
@@ -1370,7 +1370,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmBinVerNode* pNode )
 
     //Set left
     left = pRightMost;
-    j_assert( pRightMost, "There must be a position infront of this" );
+    OSL_ENSURE( pRightMost, "There must be a position infront of this" );
 
     //Create right
     right = pGraph->Add( SmCaretPos( pNode, 1 ) );
@@ -1609,7 +1609,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmRootNode* pNode )
 {
     SmNode  *pExtra = pNode->GetSubNode( 0 ), //Argument, NULL for sqrt, and SmTextNode if cubicroot
             *pBody  = pNode->GetSubNode( 2 ); //Body of the root
-    j_assert( pBody, "pBody cannot be NULL" );
+    OSL_ENSURE( pBody, "pBody cannot be NULL" );
 
     SmCaretPosGraphEntry  *left,
                         *right,
@@ -1617,7 +1617,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmRootNode* pNode )
                         *bodyRight;
 
     //Get left and save it
-    j_assert( pRightMost, "There must be a position infront of this" );
+    OSL_ENSURE( pRightMost, "There must be a position infront of this" );
     left = pRightMost;
 
     //Create body left
@@ -2051,7 +2051,7 @@ SmSelectionDrawingVisitor::SmSelectionDrawingVisitor( OutputDevice& rDevice, SmN
     bHasSelectionArea = false;
 
     //Visit everything
-    j_assert( pTree, "pTree can't be null!" );
+    OSL_ENSURE( pTree, "pTree can't be null!" );
     if( pTree )
         pTree->Accept( this );
 
diff --git a/starmath/visual-editor-todo b/starmath/visual-editor-todo
index 3be3fd2..f378d2d 100644
--- a/starmath/visual-editor-todo
+++ b/starmath/visual-editor-todo
@@ -15,9 +15,8 @@ Easy
 1. SmGraphicWindow::KeyInput relies on comparison of sal_Char, a better way must be available for CTRL+c
 2. Code style (missing spaces, linebreaks and a few renames)
 3. More documentation
-4. Replace j_assert with DBG_ASSERT (don't do this yet).
-5. Remove the CreateTextFromNode methods and replace calls to it with NodeToTextVisitor
-6. Extend NodeToTextVisitor to update token offsets so SmNode::GetRow and SmNode::GetColumn will work.
+4. Remove the CreateTextFromNode methods and replace calls to it with NodeToTextVisitor
+5. Extend NodeToTextVisitor to update token offsets so SmNode::GetRow and SmNode::GetColumn will work.
    (These methods can be used to enable synchronization of caret positions between visual and non-visual editor).
 
 Medium
commit fb7b65b670ad492047b3db13bdd899df72f2109c
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Fri Mar 18 21:35:37 2011 +0100

    Remove core/except (came in with m101)

diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 6bcc9da..8d929e5 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -247,8 +247,6 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
     sw/source/core/edit/edtox \
     sw/source/core/edit/edundo \
     sw/source/core/edit/edws \
-    sw/source/core/except/dbgloop \
-    sw/source/core/except/errhdl \
     sw/source/core/fields/authfld \
     sw/source/core/fields/cellfml \
     sw/source/core/fields/chpfld \
diff --git a/sw/Library_swd.mk b/sw/Library_swd.mk
index a0dcfaf..3a76b87 100644
--- a/sw/Library_swd.mk
+++ b/sw/Library_swd.mk
@@ -62,7 +62,6 @@ $(eval $(call gb_Library_add_linked_libs,swd,\
 ))
 
 $(eval $(call gb_Library_add_exception_objects,swd,\
-    sw/source/core/except/errhdl \
     sw/source/filter/basflt/iodetect \
     sw/source/ui/uno/detreg \
     sw/source/ui/uno/swdet2 \
diff --git a/sw/inc/errhdl.hxx b/sw/inc/errhdl.hxx
deleted file mode 100644
index 2d7be7b..0000000
--- a/sw/inc/errhdl.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _ERRHDL_HXX
-#define _ERRHDL_HXX
-
-#ifdef DBG_UTIL
-
-#include <tools/solar.h>
-#include <sal/types.h>
-#include "swdllapi.h"
-
-extern sal_Bool bAssert;				// sal_True, wenn eine ASSERT-Box hochkam
-
-
-// -----------------------------------------------------------------------
-// Ausgabe einer Fehlermeldung inkl. Dateiname und Zeilennummer
-// wo der Fehler auftrat.
-// Die Funktion darf nicht direkt benutzt werden!
-// -----------------------------------------------------------------------
-SW_DLLPUBLIC void AssertFail( const sal_Char*, const sal_Char*, sal_uInt16 );
-SW_DLLPUBLIC void AssertFail( sal_uInt16, const sal_Char*, sal_uInt16 );
-
-#define ASSERT( cond, message ) \
-    if( !(cond) ) { \
-        const char	 *_pErrorText = #message; \
-        const char	 *_pFileName  = __FILE__; \
-       ::AssertFail( _pErrorText, _pFileName, __LINE__ ); \
-    }
-
-// -----------------------------------------------------------------------
-// Prueft ob die angegebene Bedingung wahr ist, wenn nicht wird eine
-// Fehlermeldung die ueber die ID Identifiziert wird, ausgegeben.
-// -----------------------------------------------------------------------
-#define ASSERT_ID( cond, id ) \
-    if( !(cond) ) { \
-        const char	 *_pFileName  = __FILE__; \
-       ::AssertFail( (sal_uInt16)id, _pFileName, __LINE__ ); \
-    }
-
-
-// -----------------------------------------------------------------------
-// Beim Bilden der Produktversion werden alle Debug-Utilities automatisch
-// ignoriert
-// -----------------------------------------------------------------------
-#else
-#define ASSERT( cond, message ) 	;
-#define ASSERT_ID( cond, id )		;
-#endif // PRODUCT
-
-
-
-#endif
diff --git a/sw/source/core/except/dbgloop.cxx b/sw/source/core/except/dbgloop.cxx
deleted file mode 100644
index 1e91423..0000000
--- a/sw/source/core/except/dbgloop.cxx
+++ /dev/null
@@ -1,168 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-#ifdef DBG_UTIL
-
-#include <tools/stream.hxx>
-#include "dbgloop.hxx"
-#include "errhdl.hxx"
-
-DbgLoopStack DbgLoop::aDbgLoopStack;
-
-/*************************************************************************
- *						class DbgLoopStack
- *************************************************************************/
-
-DbgLoopStack::DbgLoopStack()
-{
-    Reset();
-}
-
-void DbgLoopStack::Reset()
-{
-    nPtr = 0;
-    pDbg = 0;
-    for( sal_uInt16 i = 0; i < DBG_MAX_STACK; ++i )
-        aCount[i] = 0;
-}
-
-/*************************************************************************
- *						 DbgLoopStack::Push()
- *************************************************************************/
-
-void DbgLoopStack::Push( const void *pThis )
-{
-    // Wir muessen irgendwie mitbekommen, wann die erste Stackposition
-    // resettet werden soll, z.B. wenn wir einen Nullpointer uebergeben
-    if( !nPtr && ( pDbg != pThis || !pThis ) )
-    {
-        aCount[1] = 0;
-        pDbg = pThis;
-    }
-
-    ++nPtr;
-    if( DBG_MAX_STACK > nPtr )
-    {
-        // Wenn eine loop entdeckt wird, wird der counter wieder zurueckgesetzt.
-        ASSERT( DBG_MAX_LOOP > aCount[nPtr], "DbgLoopStack::Push: loop detected" );
-        if( DBG_MAX_LOOP > aCount[nPtr] )
-            ++(aCount[nPtr]);
-        else
-            aCount[nPtr] = 0;
-    }
-}
-
-/*************************************************************************
- *						 DbgLoopStack::Pop()
- *************************************************************************/
-
-void DbgLoopStack::Pop()
-{
-    if( DBG_MAX_STACK > nPtr )
-    {
-        ASSERT( nPtr, "DbgLoopStack::Pop: can't pop the stack" );
-
-        ASSERT( aCount[nPtr], "DbgLoopStack::Pop: can't dec the count" );
-        if( DBG_MAX_STACK > nPtr + 1 )
-            aCount[nPtr + 1] = 0;
-    }
-    --nPtr;
-}
-
-/*************************************************************************
- *						 DbgLoopStack::Print()
- *************************************************************************/
-
-void DbgLoopStack::Print( SvStream &rOS ) const
-{
-    rOS << "POS: " << nPtr << '\n';
-    sal_uInt16 i;
-    for( i = 0; i < DBG_MAX_STACK; ++i )
-        rOS << i << " ";
-    rOS << '\n';
-    for( i = 0; i < DBG_MAX_STACK; ++i )
-        rOS << aCount[i] << " ";
-    rOS << '\n';
-}
-
-#ifdef STAND_ALONE
-// compile with: cl /AL /DSTAND_ALONE dbgloop.cxx
-
-/*************************************************************************
- *							main()
- *************************************************************************/
-
-#include <stdlib.h>
-
-void AssertFail( const char *pErr, const char *pFile, sal_uInt16 nLine )
-{
-    cout << pErr << '\n';
-    PrintLoopStack( cout );
-    exit(0);
-}
-
-class Test
-{
-public:
-        void Run() const;
-};
-
-void Test::Run() const
-{
-    cout << "---" << '\n';
-    for( sal_uInt16 i = 0; i < 10; ++i )
-    {
-        cout << "i" << i;
-        DBG_LOOP;
-        PrintLoopStack( cout );
-        for( sal_uInt16 j = 0; j < 10; ++j )
-        {
-            cout << " j" << j;
-            DBG_LOOP;
-            PrintLoopStack( cout );
-        }
-        cout << '\n';
-    }
-    PrintLoopStack( cout );
-}
-
-int main()
-{
-    // unterschiedliche Instanzen waehlen wg. pDbg != pThis
-    Test aTest1;
-    aTest1.Run();
-    Test aTest2;
-    aTest2.Run();
-    return 0;
-}
-#endif
-
-#endif // DBG_UTIL
-
diff --git a/sw/source/core/except/errhdl.cxx b/sw/source/core/except/errhdl.cxx
deleted file mode 100644
index c42350a..0000000
--- a/sw/source/core/except/errhdl.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-#ifdef DBG_UTIL
-
-#define _ERRHDL_CXX
-
-
-#include "stdlib.h"
-#include <tools/debug.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/sound.hxx>
-#include <errhdl.hxx>
-
-#ifndef CVBREAK
-#define CVBREAK
-#endif
-
-// Error Codes.
-#define ERR_SWGBASE 25000
-
-#define ERR_VAR_IDX                            (ERR_SWGBASE+ 0)
-#define ERR_OUTOFSCOPE                         (ERR_SWGBASE+ 1)
-
-#define ERR_NUMLEVEL                           (ERR_SWGBASE+ 2)
-
-// Error Codes for TxtNode.
-#define ERR_NOHINTS                            (ERR_SWGBASE+ 3)
-
-// Strings to be queried are in COREDL.DLL from _START to _END.
-#define ERR_SWGMSG_START                       (ERR_VAR_IDX)
-#define ERR_SWGMSG_END                         (ERR_NOHINTS)
-
-sal_Bool bAssertFail = sal_False;			// ist gerade eine Assertbox oben ?
-sal_Bool bAssert = sal_False;				// sal_True, wenn mal ein ASSERT kam.
-
-/*------------------------------------------------------------------------
-    Ausgabe einer Fehlermeldung inkl. Bedingung, Dateiname und Zeilennummer
-    wo der Fehler auftrat.
-    Die Funktion wird durch das ASSERT Makro gerufen!
-    Parameter:
-                char	*pError		Fehlermeldung
-                char	*pFileName	Filename in dem der Fehler auftrat
-                sal_uInt16	nLine		Zeilennummer in dem der Fehler auftrat
-------------------------------------------------------------------------*/
-
-void AssertFail( const sal_Char* pError, const sal_Char* pFileName, sal_uInt16 nLine )
-{
-    CVBREAK;
-    // NOTE4("ASSERT: %s at %d: %s\n", pFileName, nLine, pError);
-    bAssert = sal_True;
-
-    if( !bAssertFail && GetpApp() && GetpApp()->IsInMain() )
-    {
-        bAssertFail = sal_True;
-        ByteString	aErr;
-        aErr = "Assertion failed\n==================\nFILE      :  ";
-        aErr += pFileName;
-        aErr += " at line ";
-        aErr += ByteString::CreateFromInt32( nLine );
-        aErr += "\nERROR :  ";
-        aErr += pError;
-
-        ByteString aTmp( getenv( "SW_NOBEEP" ) );
-        if ( aTmp != "sal_True" )
-            Sound::Beep(SOUND_ERROR);
-
-#if defined( UNX ) && !defined( DBG_UTIL )
-        DBG_ERROR( aErr.GetBuffer() ); // DbgErr ist in UNIX-nicht Produkt-Versionen nicht definiert
-#else
-        DbgError( aErr.GetBuffer() );
-#endif
-        bAssertFail = sal_False;
-    }
-    else
-    {
-        Sound::Beep(SOUND_ERROR);
-        Sound::Beep(SOUND_ERROR);
-        Sound::Beep(SOUND_ERROR);
-        if( !bAssertFail )
-            *(short *)0 = 4711; 		// UAE ausloesen
-    }
-}
-
-/*------------------------------------------------------------------------
-    Ausgabe einer Fehlermeldung inkl. Bedingung, Dateiname und Zeilennummer
-    wo der Fehler auftrat.
-    Die Funktion wird durch das ASSERT Makro gerufen!
-    Parameter:
-                sal_uInt16	nErrorId	Id fuer Fehlermeldung
-                char	*pFileName	Filename in dem der Fehler auftrat
-                sal_uInt16	nLine		Zeilennummer in dem der Fehler auftrat
-------------------------------------------------------------------------*/
-
-void AssertFail( sal_uInt16 nErrorId, const sal_Char* pFileName, sal_uInt16 nLine )
-{
-    // Umsetzung der ErrorId in eine Fehlermeldung
-    static const sal_Char
-        /* Error Fehlermeldungen zugriffe ausserhalb eines Bereiches */
-        sERR_VAR_IDX[]		= "Op[]",
-        sERR_OUTOFSCOPE[]	= "Zugriff ausserhalb des Bereiches",
-        /* Error Codes fuer Numerierungsregeln */
-        sERR_NUMLEVEL[] 	= "Falscher Num-Level",
-        /* Error Codes fuer TxtNode */
-        sERR_NOHINTS[]		= "Zugriff auf ungueltiges HintsArray",
-        sERR_UNKNOWN[]		= "???";
-
-    static const sal_Char* aErrStrTab[ ERR_SWGMSG_END - ERR_SWGMSG_START +1 ] =
-    {
-        sERR_VAR_IDX, sERR_OUTOFSCOPE, sERR_NUMLEVEL, sERR_NOHINTS
-    };
-
-    const sal_Char* pMsg;
-    if( nErrorId >= ERR_SWGMSG_START && nErrorId < ERR_SWGMSG_END )
-        pMsg = aErrStrTab[ nErrorId - ERR_SWGMSG_START ];
-    else
-        pMsg = sERR_UNKNOWN;
-
-    AssertFail( pMsg, pFileName, nLine );
-}
-
-#endif // DBG_UTIL
-
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index 68372d5..bc8f4fc 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -47,7 +47,6 @@
 #include <shellio.hxx>
 #include <poolfmt.hxx>
 #include <SwXMLTextBlocks.hxx>
-#include <errhdl.hxx>
 #include <SwXMLBlockImport.hxx>
 #include <SwXMLBlockExport.hxx>
 #include <swerror.h>


More information about the Libreoffice-commits mailing list