summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docbm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/docbm.cxx')
-rw-r--r--sw/source/core/doc/docbm.cxx105
1 files changed, 52 insertions, 53 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 6587f7e0e66e..30f65bd3b311 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -58,7 +58,6 @@
#include <swserv.hxx>
#include <swundo.hxx>
#include <tools/pstm.hxx>
-#include <undobj.hxx>
#include <unocrsr.hxx>
#include <viscrs.hxx>
#include <stdio.h>
@@ -247,7 +246,7 @@ namespace
bind(&::rtl::OUString::equals, bind(&IMark::GetName, _1), rName));
}
-#if FALSE
+#if 0
static void lcl_DebugMarks(IDocumentMarkAccess::container_t vMarks)
{
OSL_TRACE("%d Marks", vMarks.size());
@@ -321,7 +320,7 @@ namespace sw { namespace mark
const ::rtl::OUString& rName,
const IDocumentMarkAccess::MarkType eType)
{
-#if FALSE
+#if 0
{
::rtl::OString sName = ::rtl::OUStringToOString(rName, RTL_TEXTENCODING_UTF8);
const SwPosition* const pPos1 = rPaM.GetPoint();
@@ -408,7 +407,7 @@ namespace sw { namespace mark
break;
}
pMarkBase->InitDoc(m_pDoc);
-#if FALSE
+#if 0
OSL_TRACE("--- makeType ---");
OSL_TRACE("Marks");
lcl_DebugMarks(m_vMarks);
@@ -519,7 +518,7 @@ namespace sw { namespace mark
// restore sorting if needed
if(isSortingNeeded)
sortMarks();
-#if FALSE
+#if 0
OSL_TRACE("correctMarksAbsolute");
lcl_DebugMarks(m_vMarks);
#endif
@@ -559,7 +558,7 @@ namespace sw { namespace mark
// restore sorting if needed
if(isSortingNeeded)
sortMarks();
-#if FALSE
+#if 0
OSL_TRACE("correctMarksRelative");
lcl_DebugMarks(m_vMarks);
#endif
@@ -675,7 +674,7 @@ namespace sw { namespace mark
}
if(isSortingNeeded)
sortMarks();
-#if FALSE
+#if 0
OSL_TRACE("deleteMarks");
lcl_DebugMarks(m_vMarks);
#endif
@@ -878,19 +877,19 @@ namespace
class _SwSaveTypeCountContent
{
union {
- struct { USHORT nType, nCount; } TC;
- ULONG nTypeCount;
+ struct { sal_uInt16 nType, nCount; } TC;
+ sal_uLong nTypeCount;
} TYPECOUNT;
xub_StrLen nContent;
public:
_SwSaveTypeCountContent() { TYPECOUNT.nTypeCount = 0; nContent = 0; }
- _SwSaveTypeCountContent( USHORT nType )
+ _SwSaveTypeCountContent( sal_uInt16 nType )
{
SetTypeAndCount( nType, 0 );
nContent = 0;
}
- _SwSaveTypeCountContent( const SvULongs& rArr, USHORT& rPos )
+ _SwSaveTypeCountContent( const SvULongs& rArr, sal_uInt16& rPos )
{
TYPECOUNT.nTypeCount = rArr[ rPos++ ];
nContent = static_cast<xub_StrLen>(rArr[ rPos++ ]);
@@ -901,17 +900,17 @@ namespace
rArr.Insert( nContent, rArr.Count() );
}
- void SetType( USHORT n ) { TYPECOUNT.TC.nType = n; }
- USHORT GetType() const { return TYPECOUNT.TC.nType; }
+ void SetType( sal_uInt16 n ) { TYPECOUNT.TC.nType = n; }
+ sal_uInt16 GetType() const { return TYPECOUNT.TC.nType; }
void IncType() { ++TYPECOUNT.TC.nType; }
void DecType() { --TYPECOUNT.TC.nType; }
- void SetCount( USHORT n ) { TYPECOUNT.TC.nCount = n; }
- USHORT GetCount() const { return TYPECOUNT.TC.nCount; }
- USHORT IncCount() { return ++TYPECOUNT.TC.nCount; }
- USHORT DecCount() { return --TYPECOUNT.TC.nCount; }
+ void SetCount( sal_uInt16 n ) { TYPECOUNT.TC.nCount = n; }
+ sal_uInt16 GetCount() const { return TYPECOUNT.TC.nCount; }
+ sal_uInt16 IncCount() { return ++TYPECOUNT.TC.nCount; }
+ sal_uInt16 DecCount() { return --TYPECOUNT.TC.nCount; }
- void SetTypeAndCount( USHORT nT, USHORT nC )
+ void SetTypeAndCount( sal_uInt16 nT, sal_uInt16 nC )
{ TYPECOUNT.TC.nCount = nC; TYPECOUNT.TC.nType = nT; }
void SetContent( xub_StrLen n ) { nContent = n; }
@@ -927,9 +926,9 @@ namespace
static const int BEHIND_SAME_NODE = 3; // Same node index but content index behind given content index
static const int BEHIND_NODE = 4; // Position behind the given node index
- static int lcl_RelativePosition( const SwPosition& rPos, ULONG nNode, xub_StrLen nCntnt )
+ static int lcl_RelativePosition( const SwPosition& rPos, sal_uLong nNode, xub_StrLen nCntnt )
{
- ULONG nIndex = rPos.nNode.GetIndex();
+ sal_uLong nIndex = rPos.nNode.GetIndex();
int nReturn = BEFORE_NODE;
if( nIndex == nNode )
{
@@ -952,17 +951,17 @@ namespace
return rPos.nNode > rNdIdx || ( pIdx && rPos.nNode == rNdIdx && rPos.nContent > pIdx->GetIndex() );
}
- static void lcl_ChkPaM( SvULongs& rSaveArr, ULONG nNode, xub_StrLen nCntnt,
+ static void lcl_ChkPaM( SvULongs& rSaveArr, sal_uLong nNode, xub_StrLen nCntnt,
const SwPaM& rPam, _SwSaveTypeCountContent& rSave,
- BOOL bChkSelDirection )
+ sal_Bool bChkSelDirection )
{
// SelektionsRichtung beachten
- bool bBound1IsStart = !bChkSelDirection ? TRUE :
+ bool bBound1IsStart = !bChkSelDirection ? sal_True :
( *rPam.GetPoint() < *rPam.GetMark()
? rPam.GetPoint() == &rPam.GetBound()
: rPam.GetMark() == &rPam.GetBound());
- const SwPosition* pPos = &rPam.GetBound( TRUE );
+ const SwPosition* pPos = &rPam.GetBound( sal_True );
if( pPos->nNode.GetIndex() == nNode &&
( bBound1IsStart ? pPos->nContent.GetIndex() < nCntnt
: pPos->nContent.GetIndex() <= nCntnt ))
@@ -971,7 +970,7 @@ namespace
rSave.Add( rSaveArr );
}
- pPos = &rPam.GetBound( FALSE );
+ pPos = &rPam.GetBound( sal_False );
if( pPos->nNode.GetIndex() == nNode &&
( (bBound1IsStart && bChkSelDirection)
? pPos->nContent.GetIndex() <= nCntnt
@@ -1068,12 +1067,12 @@ void SaveBookmark::SetInDoc(
if(pIdx && !m_nNode2)
aPam.GetMark()->nContent += m_nCntnt2;
else
- aPam.GetMark()->nContent.Assign(aPam.GetCntntNode(FALSE), m_nCntnt2);
+ aPam.GetMark()->nContent.Assign(aPam.GetCntntNode(sal_False), m_nCntnt2);
}
else
{
aPam.GetMark()->nNode = m_nNode2;
- aPam.GetMark()->nContent.Assign(aPam.GetCntntNode(FALSE), m_nCntnt2);
+ aPam.GetMark()->nContent.Assign(aPam.GetCntntNode(sal_False), m_nCntnt2);
}
}
@@ -1093,7 +1092,7 @@ void SaveBookmark::SetInDoc(
}
if(!aPam.HasMark()
- || CheckNodesRange(aPam.GetPoint()->nNode, aPam.GetMark()->nNode, TRUE))
+ || CheckNodesRange(aPam.GetPoint()->nNode, aPam.GetMark()->nNode, sal_True))
{
::sw::mark::IBookmark* const pBookmark = dynamic_cast< ::sw::mark::IBookmark* >(pDoc->getIDocumentMarkAccess()->makeMark(aPam, m_aName, m_eOrigBkmType));
if(pBookmark)
@@ -1135,13 +1134,13 @@ void _DelBookmarks(
// Array, das alle Angaben auf die Position als Offset speichert.
// Die neue Zuordung erfolgt nach dem Moven.
SwRedlineTbl& rTbl = (SwRedlineTbl&)pDoc->GetRedlineTbl();
- for(USHORT nCnt = 0; nCnt < rTbl.Count(); ++nCnt )
+ for(sal_uInt16 nCnt = 0; nCnt < rTbl.Count(); ++nCnt )
{
// liegt auf der Position ??
SwRedline* pRedl = rTbl[ nCnt ];
- SwPosition *pRStt = &pRedl->GetBound(TRUE),
- *pREnd = &pRedl->GetBound(FALSE);
+ SwPosition *pRStt = &pRedl->GetBound(sal_True),
+ *pREnd = &pRedl->GetBound(sal_False);
if( *pRStt > *pREnd )
{
SwPosition *pTmp = pRStt; pRStt = pREnd, pREnd = pTmp;
@@ -1154,11 +1153,11 @@ void _DelBookmarks(
pRStt->nContent = *pEndIdx;
else
{
- BOOL bStt = TRUE;
+ sal_Bool bStt = sal_True;
SwCntntNode* pCNd = pRStt->nNode.GetNode().GetCntntNode();
if( !pCNd && 0 == ( pCNd = pDoc->GetNodes().GoNext( &pRStt->nNode )) )
{
- bStt = FALSE;
+ bStt = sal_False;
pRStt->nNode = rStt;
if( 0 == ( pCNd = pDoc->GetNodes().GoPrevious( &pRStt->nNode )) )
{
@@ -1177,11 +1176,11 @@ void _DelBookmarks(
pREnd->nContent = *pSttIdx;
else
{
- BOOL bStt = FALSE;
+ sal_Bool bStt = sal_False;
SwCntntNode* pCNd = pREnd->nNode.GetNode().GetCntntNode();
if( !pCNd && 0 == ( pCNd = pDoc->GetNodes().GoPrevious( &pREnd->nNode )) )
{
- bStt = TRUE;
+ bStt = sal_True;
pREnd->nNode = rEnd;
if( 0 == ( pCNd = pDoc->GetNodes().GoNext( &pREnd->nNode )) )
{
@@ -1197,10 +1196,10 @@ void _DelBookmarks(
}
void _SaveCntntIdx(SwDoc* pDoc,
- ULONG nNode,
+ sal_uLong nNode,
xub_StrLen nCntnt,
SvULongs& rSaveArr,
- BYTE nSaveFly)
+ sal_uInt8 nSaveFly)
{
// 1. Bookmarks
_SwSaveTypeCountContent aSave;
@@ -1281,7 +1280,7 @@ void _SaveCntntIdx(SwDoc* pDoc,
SwFrm* pFrm = pNode->GetFrm();
#if OSL_DEBUG_LEVEL > 1
- static BOOL bViaDoc = FALSE;
+ static sal_Bool bViaDoc = sal_False;
if( bViaDoc )
pFrm = NULL;
#endif
@@ -1375,14 +1374,14 @@ void _SaveCntntIdx(SwDoc* pDoc,
if( _pStkCrsr )
do {
lcl_ChkPaM( rSaveArr, nNode, nCntnt, *_pStkCrsr,
- aSave, FALSE );
+ aSave, sal_False );
aSave.IncCount();
} while ( (_pStkCrsr != 0 ) &&
((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) );
FOREACHPAM_START( PCURSH->_GetCrsr() )
lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR,
- aSave, FALSE );
+ aSave, sal_False );
aSave.IncCount();
FOREACHPAM_END()
@@ -1393,10 +1392,10 @@ void _SaveCntntIdx(SwDoc* pDoc,
{
aSave.SetTypeAndCount( 0x400, 0 );
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( USHORT n = 0; n < rTbl.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
{
FOREACHPAM_START( rTbl[ n ] )
- lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, FALSE );
+ lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, sal_False );
aSave.IncCount();
FOREACHPAM_END()
@@ -1405,7 +1404,7 @@ void _SaveCntntIdx(SwDoc* pDoc,
if( pUnoTblCrsr )
{
FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() )
- lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, FALSE );
+ lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, sal_False );
aSave.IncCount();
FOREACHPAM_END()
}
@@ -1416,15 +1415,15 @@ void _SaveCntntIdx(SwDoc* pDoc,
void _RestoreCntntIdx(SwDoc* pDoc,
SvULongs& rSaveArr,
- ULONG nNode,
+ sal_uLong nNode,
xub_StrLen nOffset,
- BOOL bAuto)
+ sal_Bool bAuto)
{
SwCntntNode* pCNd = pDoc->GetNodes()[ nNode ]->GetCntntNode();
const SwRedlineTbl& rRedlTbl = pDoc->GetRedlineTbl();
SwSpzFrmFmts* pSpz = pDoc->GetSpzFrmFmts();
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
- USHORT n = 0;
+ sal_uInt16 n = 0;
while( n < rSaveArr.Count() )
{
_SwSaveTypeCountContent aSave( rSaveArr, n );
@@ -1493,7 +1492,7 @@ void _RestoreCntntIdx(SwDoc* pDoc,
SwCrsrShell* pShell = pDoc->GetEditShell();
if( pShell )
{
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
FOREACHSHELL_START( pShell )
SwPaM *_pStkCrsr = PCURSH->GetStkCrsr();
if( _pStkCrsr )
@@ -1531,9 +1530,9 @@ void _RestoreCntntIdx(SwDoc* pDoc,
case 0x0400:
case 0x0401:
{
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( USHORT i = 0; i < rTbl.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
{
FOREACHPAM_START( rTbl[ i ] )
if( aSave.GetCount() == nCnt )
@@ -1587,7 +1586,7 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
const IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
SwCntntNode* pCNd = (SwCntntNode*)rNd.GetCntntNode();
- USHORT n = 0;
+ sal_uInt16 n = 0;
while( n < rSaveArr.Count() )
{
_SwSaveTypeCountContent aSave( rSaveArr, n );
@@ -1653,7 +1652,7 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
SwCrsrShell* pShell = pDoc->GetEditShell();
if( pShell )
{
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
FOREACHSHELL_START( pShell )
SwPaM *_pStkCrsr = PCURSH->GetStkCrsr();
if( _pStkCrsr )
@@ -1691,9 +1690,9 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
case 0x0400:
case 0x0401:
{
- USHORT nCnt = 0;
+ sal_uInt16 nCnt = 0;
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( USHORT i = 0; i < rTbl.Count(); ++i )
+ for( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
{
FOREACHPAM_START( rTbl[ i ] )
if( aSave.GetCount() == nCnt )