[Libreoffice-commits] core.git: 2 commits - sw/source
LuboÅ¡ LuÅák
l.lunak at suse.cz
Mon Jul 1 03:28:27 PDT 2013
sw/source/core/crsr/swcrsr.cxx | 65 +++++++++---------------------------
sw/source/core/docnode/nodedump.cxx | 43 ++++++++++++++---------
2 files changed, 45 insertions(+), 63 deletions(-)
New commits:
commit dc7498e4f0632c10a0019564d2e71b5403e40812
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Fri Jun 28 17:04:49 2013 +0200
don't show section/table nodes as plain start nodes in debug dump
Change-Id: I8b4901d98c210f5a3228981a2b180f2fcc06c768
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 96e787a..01ba1d2 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -220,25 +220,36 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
{
WriterHelper writer( w );
const char* name = "???";
- switch( GetStartNodeType())
+ switch( GetNodeType() )
{
- case SwNormalStartNode:
- name = "start";
- break;
- case SwTableBoxStartNode:
- name = "tablebox";
- break;
- case SwFlyStartNode:
- name = "fly";
- break;
- case SwFootnoteStartNode:
- name = "footnote";
+ case ND_TABLENODE:
+ name = "table";
break;
- case SwHeaderStartNode:
- name = "header";
+ case ND_SECTIONNODE:
+ name = "section";
break;
- case SwFooterStartNode:
- name = "footer";
+ default:
+ switch( GetStartNodeType())
+ {
+ case SwNormalStartNode:
+ name = "start";
+ break;
+ case SwTableBoxStartNode:
+ name = "tablebox";
+ break;
+ case SwFlyStartNode:
+ name = "fly";
+ break;
+ case SwFootnoteStartNode:
+ name = "footnote";
+ break;
+ case SwHeaderStartNode:
+ name = "header";
+ break;
+ case SwFooterStartNode:
+ name = "footer";
+ break;
+ }
break;
}
writer.startElement( name );
commit ed1d006e1ab594ff0b64a41eadd1b8fe48ab0414
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Jun 24 20:15:06 2013 +0200
remove strange #ifdefs, presumably a workaround for ancient compiler bug
Change-Id: I77287909b88be01615e2aae302c48904c1adf933
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 6b4a772..9dadc67 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -482,13 +482,6 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
return sal_False;
}
-#if defined( UNX )
-#define IDX (*pCellStt)
-#else
-#define IDX aCellStt
-#endif
-
-
sal_Bool SwCursor::IsInProtectTable( sal_Bool bMove, sal_Bool bChgCrsr )
{
SwCntntNode* pCNd = GetCntntNode();
@@ -540,32 +533,24 @@ sal_Bool SwCursor::IsInProtectTable( sal_Bool bMove, sal_Bool bChgCrsr )
// search next valid box
// if there is another StartNode after the EndNode of a cell then
// there is another cell
-#if defined( UNX )
- SwNodeIndex* pCellStt = new SwNodeIndex( *GetNode()->
- FindTableBoxStartNode()->EndOfSectionNode(), 1 );
-#else
SwNodeIndex aCellStt( *GetNode()->FindTableBoxStartNode()->EndOfSectionNode(), 1 );
-#endif
sal_Bool bProt = sal_True;
GoNextCell:
do {
- if( !IDX.GetNode().IsStartNode() )
+ if( !aCellStt.GetNode().IsStartNode() )
break;
- ++IDX;
- if( 0 == ( pCNd = IDX.GetNode().GetCntntNode() ))
- pCNd = IDX.GetNodes().GoNext( &IDX );
+ ++aCellStt;
+ if( 0 == ( pCNd = aCellStt.GetNode().GetCntntNode() ))
+ pCNd = aCellStt.GetNodes().GoNext( &aCellStt );
if( 0 == ( bProt = pCNd->IsProtect() ))
break;
- IDX.Assign( *pCNd->FindTableBoxStartNode()->EndOfSectionNode(), 1 );
+ aCellStt.Assign( *pCNd->FindTableBoxStartNode()->EndOfSectionNode(), 1 );
} while( bProt );
SetNextCrsr:
if( !bProt ) // found free cell
{
- GetPoint()->nNode = IDX;
-#if defined( UNX )
- delete pCellStt;
-#endif
+ GetPoint()->nNode = aCellStt;
SwCntntNode* pTmpCNd = GetCntntNode();
if( pTmpCNd )
{
@@ -576,19 +561,16 @@ SetNextCrsr:
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
// end of table, so go to next node
- ++IDX;
+ ++aCellStt;
SwNode* pNd;
- if( ( pNd = &IDX.GetNode())->IsEndNode() || HasMark())
+ if( ( pNd = &aCellStt.GetNode())->IsEndNode() || HasMark())
{
// if only table in FlyFrame or SSelection then stay on old position
if( bChgCrsr )
RestoreSavePos();
-#if defined( UNX )
- delete pCellStt;
-#endif
return sal_True;
}
- else if( pNd->IsTableNode() && IDX++ )
+ else if( pNd->IsTableNode() && aCellStt++ )
goto GoNextCell;
bProt = sal_False; // index is now on a content node
@@ -599,33 +581,25 @@ SetNextCrsr:
{
// if there is another EndNode in front of the StartNode than there
// exists a previous cell
-#if defined( UNX )
- SwNodeIndex* pCellStt = new SwNodeIndex(
- *GetNode()->FindTableBoxStartNode(), -1 );
-#else
SwNodeIndex aCellStt( *GetNode()->FindTableBoxStartNode(), -1 );
-#endif
SwNode* pNd;
sal_Bool bProt = sal_True;
GoPrevCell:
do {
- if( !( pNd = &IDX.GetNode())->IsEndNode() )
+ if( !( pNd = &aCellStt.GetNode())->IsEndNode() )
break;
- IDX.Assign( *pNd->StartOfSectionNode(), +1 );
- if( 0 == ( pCNd = IDX.GetNode().GetCntntNode() ))
- pCNd = pNd->GetNodes().GoNext( &IDX );
+ aCellStt.Assign( *pNd->StartOfSectionNode(), +1 );
+ if( 0 == ( pCNd = aCellStt.GetNode().GetCntntNode() ))
+ pCNd = pNd->GetNodes().GoNext( &aCellStt );
if( 0 == ( bProt = pCNd->IsProtect() ))
break;
- IDX.Assign( *pNd->FindTableBoxStartNode(), -1 );
+ aCellStt.Assign( *pNd->FindTableBoxStartNode(), -1 );
} while( bProt );
SetPrevCrsr:
if( !bProt ) // found free cell
{
- GetPoint()->nNode = IDX;
-#if defined( UNX )
- delete pCellStt;
-#endif
+ GetPoint()->nNode = aCellStt;
SwCntntNode* pTmpCNd = GetCntntNode();
if( pTmpCNd )
{
@@ -636,18 +610,15 @@ SetPrevCrsr:
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS );
}
// at the beginning of a table, so go to next node
- IDX--;
- if( ( pNd = &IDX.GetNode())->IsStartNode() || HasMark() )
+ aCellStt--;
+ if( ( pNd = &aCellStt.GetNode())->IsStartNode() || HasMark() )
{
// if only table in FlyFrame or SSelection then stay on old position
if( bChgCrsr )
RestoreSavePos();
-#if defined( UNX )
- delete pCellStt;
-#endif
return sal_True;
}
- else if( pNd->StartOfSectionNode()->IsTableNode() && IDX-- )
+ else if( pNd->StartOfSectionNode()->IsTableNode() && aCellStt-- )
goto GoPrevCell;
bProt = sal_False; // index is now on a content node
More information about the Libreoffice-commits
mailing list