[Libreoffice-commits] .: 4 commits - sw/source
Bjoern Michaelsen
bmichaelsen at kemper.freedesktop.org
Mon Jul 9 10:20:32 PDT 2012
sw/source/core/crsr/BlockCursor.hxx | 2
sw/source/core/crsr/IBlockCursor.hxx | 55 +-
sw/source/core/crsr/bookmrk.cxx | 9
sw/source/core/crsr/callnk.cxx | 4
sw/source/core/crsr/crbm.cxx | 4
sw/source/core/crsr/crsrsh.cxx | 678 ++++++++++++++++-------------------
sw/source/core/crsr/crstrvl.cxx | 283 ++++++--------
sw/source/core/crsr/findattr.cxx | 291 ++++++---------
sw/source/core/crsr/findcoll.cxx | 19
sw/source/core/crsr/findfmt.cxx | 19
sw/source/core/crsr/findtxt.cxx | 179 ++++-----
sw/source/core/crsr/pam.cxx | 155 ++------
sw/source/core/crsr/paminit.cxx | 4
sw/source/core/crsr/swcrsr.cxx | 284 ++++++--------
sw/source/core/crsr/trvlcol.cxx | 4
sw/source/core/crsr/trvlfnfl.cxx | 44 +-
sw/source/core/crsr/trvlreg.cxx | 22 -
sw/source/core/crsr/trvltbl.cxx | 163 ++++----
sw/source/core/crsr/unocrsr.cxx | 12
sw/source/core/crsr/viscrs.cxx | 52 +-
20 files changed, 1046 insertions(+), 1237 deletions(-)
New commits:
commit 30eb1d6211764da77b2b13b2f6074b40e70a6f29
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Mon Jul 9 10:46:21 2012 +0200
sal_Bool => bool if internal use only (in sw/source/core/crsr/)
while we are at it, make the bool const too
Change-Id: Iedf20880edaa454d55c45c70ed0e6dce3fa90623
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 4d37a59..26cd656 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -115,7 +115,7 @@ void lcl_SetAttrPam( SwPaM& rPam, xub_StrLen nStart, const xub_StrLen* pEnd,
nCntntPos = rPam.GetMark()->nContent.GetIndex();
else
nCntntPos = rPam.GetPoint()->nContent.GetIndex();
- sal_Bool bTstEnd = rPam.GetPoint()->nNode == rPam.GetMark()->nNode;
+ bool bTstEnd = rPam.GetPoint()->nNode == rPam.GetMark()->nNode;
SwCntntNode* pCNd = rPam.GetCntntNode();
rPam.GetPoint()->nContent.Assign( pCNd, nStart );
@@ -407,7 +407,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
}
}
- sal_Bool bContinue = sal_False;
+ bool bContinue = false;
if( SFX_ITEM_DONTCARE == eState )
{
@@ -424,7 +424,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
else if( pCmp->nEnd < aTmp.nEnd ) // extend?
pCmp->nEnd = aTmp.nEnd;
- bContinue = sal_True;
+ bContinue = true;
}
}
// Will the attribute become valid?
@@ -432,7 +432,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
{
pFndArr[ nWhch - nArrStart ] = aTmp;
++nFound;
- bContinue = sal_True;
+ bContinue = true;
}
// then is has to go on the stack
diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx
index 09dc12a..45dddfa 100644
--- a/sw/source/core/crsr/findfmt.cxx
+++ b/sw/source/core/crsr/findfmt.cxx
@@ -34,7 +34,7 @@ sal_Bool SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove,
const SwPaM *pRegion, sal_Bool bInReadOnly )
{
sal_Bool bFound = sal_False;
- sal_Bool bSrchForward = fnMove == fnMoveForward;
+ const bool bSrchForward = (fnMove == fnMoveForward);
SwPaM* pPam = MakeRegion( fnMove, pRegion );
// if at beginning/end then move it out of the node
commit 611eb8eddc86a62f46d3cb81729ea07f88c67732
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Mon Jul 9 10:42:07 2012 +0200
renamed German variables (in sw/source/core/crsr/)
* resolved some conflict from rebasing out the whitespace changes
* kept the whitespace changes in lines that were changed anyway
Conflicts:
sw/source/core/crsr/crsrsh.cxx
sw/source/core/crsr/findattr.cxx
sw/source/core/crsr/findcoll.cxx
sw/source/core/crsr/findtxt.cxx
Change-Id: I857531b5220d7325ccc5adb9fcb9e000b4dd262a
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 4b92dbd..54d0bb9 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2794,9 +2794,9 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
for( int nLoopCnt = 0; !bOk && nLoopCnt < 2; ++nLoopCnt )
{
- sal_Bool bWeiter;
+ bool bContinue;
do {
- bWeiter = sal_False;
+ bContinue = false;
while( 0 != ( pCNd = (rNds.*funcGoSection)( &rNdIdx,
sal_True, !IsReadOnlyAvailable() )) )
{
@@ -2835,10 +2835,10 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
{
// continue search
bOk = sal_False;
- bWeiter = sal_True;
+ bContinue = true;
}
}
- } while( bWeiter );
+ } while( bContinue );
if( !bOk )
{
@@ -3020,48 +3020,55 @@ bool SwCrsrShell::SelectHiddenRange()
return bRet;
}
-sal_uLong SwCrsrShell::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes,
- SwDocPositions eStart, SwDocPositions eEnde,
- sal_Bool& bCancel,
- FindRanges eRng, int bReplace )
+sal_uLong SwCrsrShell::Find( const SearchOptions& rSearchOpt,
+ sal_Bool bSearchInNotes,
+ SwDocPositions eStart, SwDocPositions eEnd,
+ sal_Bool& bCancel,
+ FindRanges eRng,
+ int bReplace )
{
if( pTblCrsr )
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
- sal_uLong nRet = pCurCrsr->Find( rSearchOpt, bSearchInNotes, eStart, eEnde, bCancel, eRng, bReplace );
+ sal_uLong nRet = pCurCrsr->Find( rSearchOpt, bSearchInNotes, eStart, eEnd,
+ bCancel, eRng, bReplace );
if( nRet || bCancel )
UpdateCrsr();
return nRet;
}
sal_uLong SwCrsrShell::Find( const SwTxtFmtColl& rFmtColl,
- SwDocPositions eStart, SwDocPositions eEnde,
- sal_Bool& bCancel,
- FindRanges eRng, const SwTxtFmtColl* pReplFmt )
+ SwDocPositions eStart, SwDocPositions eEnd,
+ sal_Bool& bCancel,
+ FindRanges eRng,
+ const SwTxtFmtColl* pReplFmt )
{
if( pTblCrsr )
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
- sal_uLong nRet = pCurCrsr->Find( rFmtColl, eStart, eEnde, bCancel, eRng, pReplFmt );
+ sal_uLong nRet = pCurCrsr->Find( rFmtColl, eStart, eEnd, bCancel, eRng,
+ pReplFmt );
if( nRet )
UpdateCrsr();
return nRet;
}
-sal_uLong SwCrsrShell::Find( const SfxItemSet& rSet, sal_Bool bNoCollections,
- SwDocPositions eStart, SwDocPositions eEnde,
- sal_Bool& bCancel,
- FindRanges eRng, const SearchOptions* pSearchOpt,
- const SfxItemSet* rReplSet )
+sal_uLong SwCrsrShell::Find( const SfxItemSet& rSet,
+ sal_Bool bNoCollections,
+ SwDocPositions eStart, SwDocPositions eEnd,
+ sal_Bool& bCancel,
+ FindRanges eRng,
+ const SearchOptions* pSearchOpt,
+ const SfxItemSet* rReplSet )
{
if( pTblCrsr )
GetCrsr();
delete pTblCrsr, pTblCrsr = 0;
SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
- sal_uLong nRet = pCurCrsr->Find( rSet, bNoCollections, eStart, eEnde, bCancel,
- eRng, pSearchOpt, rReplSet );
+ sal_uLong nRet = pCurCrsr->Find( rSet, bNoCollections, eStart, eEnd,
+ bCancel, eRng, pSearchOpt, rReplSet );
if( nRet )
UpdateCrsr();
return nRet;
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index e3118fa..4d37a59 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -107,28 +107,27 @@ const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos,
return 0; // invalid text attribute
}
-
-void lcl_SetAttrPam( SwPaM & rPam, xub_StrLen nStart, const xub_StrLen* pEnde,
- const sal_Bool bSaveMark )
+void lcl_SetAttrPam( SwPaM& rPam, xub_StrLen nStart, const xub_StrLen* pEnd,
+ const sal_Bool bSaveMark )
{
xub_StrLen nCntntPos;
if( bSaveMark )
nCntntPos = rPam.GetMark()->nContent.GetIndex();
else
nCntntPos = rPam.GetPoint()->nContent.GetIndex();
- sal_Bool bTstEnde = rPam.GetPoint()->nNode == rPam.GetMark()->nNode;
+ sal_Bool bTstEnd = rPam.GetPoint()->nNode == rPam.GetMark()->nNode;
SwCntntNode* pCNd = rPam.GetCntntNode();
rPam.GetPoint()->nContent.Assign( pCNd, nStart );
rPam.SetMark(); // Point == GetMark
// Point points to end of search area or end of attribute
- if( pEnde )
+ if( pEnd )
{
- if( bTstEnde && *pEnde > nCntntPos )
+ if( bTstEnd && *pEnd > nCntntPos )
rPam.GetPoint()->nContent = nCntntPos;
else
- rPam.GetPoint()->nContent = *pEnde;
+ rPam.GetPoint()->nContent = *pEnd;
}
}
@@ -1214,9 +1213,10 @@ int SwFindParaAttr::IsReplaceMode() const
/// search for attributes
sal_uLong SwCursor::Find( const SfxItemSet& rSet, sal_Bool bNoCollections,
- SwDocPositions nStart, SwDocPositions nEnde, sal_Bool& bCancel,
- FindRanges eFndRngs,
- const SearchOptions* pSearchOpt, const SfxItemSet* pReplSet )
+ SwDocPositions nStart, SwDocPositions nEnd,
+ sal_Bool& bCancel, FindRanges eFndRngs,
+ const SearchOptions* pSearchOpt,
+ const SfxItemSet* pReplSet )
{
// switch off OLE-notifications
SwDoc* pDoc = GetDoc();
@@ -1235,7 +1235,7 @@ sal_uLong SwCursor::Find( const SfxItemSet& rSet, sal_Bool bNoCollections,
SwFindParaAttr aSwFindParaAttr( rSet, bNoCollections, pSearchOpt,
pReplSet, *this );
- sal_uLong nRet = FindAll(aSwFindParaAttr, nStart, nEnde, eFndRngs, bCancel );
+ sal_uLong nRet = FindAll( aSwFindParaAttr, nStart, nEnd, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && bReplace )
pDoc->SetModified();
diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx
index 4563e09..2dccea1 100644
--- a/sw/source/core/crsr/findcoll.cxx
+++ b/sw/source/core/crsr/findcoll.cxx
@@ -76,9 +76,9 @@ int SwFindParaFmtColl::IsReplaceMode() const
}
/// search for Format-Collections
-sal_uLong SwCursor::Find( const SwTxtFmtColl& rFmtColl,
- SwDocPositions nStart, SwDocPositions nEnde, sal_Bool& bCancel,
- FindRanges eFndRngs, const SwTxtFmtColl* pReplFmtColl )
+sal_uLong SwCursor::Find( const SwTxtFmtColl& rFmtColl, SwDocPositions nStart,
+ SwDocPositions nEnd, sal_Bool& bCancel,
+ FindRanges eFndRngs, const SwTxtFmtColl* pReplFmtColl )
{
// switch off OLE-notifications
SwDoc* pDoc = GetDoc();
@@ -100,7 +100,7 @@ sal_uLong SwCursor::Find( const SwTxtFmtColl& rFmtColl,
SwFindParaFmtColl aSwFindParaFmtColl( rFmtColl, pReplFmtColl, *this );
- sal_uLong nRet = FindAll( aSwFindParaFmtColl, nStart, nEnde, eFndRngs, bCancel );
+ sal_uLong nRet = FindAll( aSwFindParaFmtColl, nStart, nEnd, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && pReplFmtColl )
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 5f2eb4c..7bdbe36 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -58,8 +58,8 @@ using namespace util;
String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam );
-String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
- xub_StrLen& rEnde, std::vector<sal_uLong> &rArr, String& rRet,
+String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, xub_StrLen& rEnd,
+ std::vector<sal_uLong> &rArr, String& rRet,
bool bRemoveSoftHyphen )
{
rRet = rNd.GetTxt();
@@ -72,7 +72,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
xub_StrLen nHintStart = STRING_LEN;
bool bNewHint = true;
bool bNewSoftHyphen = true;
- const xub_StrLen nEnd = rEnde;
+ const xub_StrLen nEnd = rEnd;
std::vector<sal_uInt16> aReplaced;
do
@@ -144,7 +144,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
if ( bEmpty && nStart == nAkt )
{
rArr.push_back( nAkt );
- --rEnde;
+ --rEnd;
rRet.Erase( nAkt, 1 );
}
else
@@ -165,9 +165,9 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
if ( bNewSoftHyphen )
{
- rArr.push_back( nAkt );
- --rEnde;
- rRet.Erase( nAkt, 1 );
+ rArr.push_back( nAkt );
+ --rEnd;
+ rRet.Erase( nAkt, 1 );
++nSoftHyphen;
}
}
@@ -180,7 +180,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
{
rRet.Erase( nTmp );
rArr.push_back( nTmp );
- --rEnde;
+ --rEnd;
}
}
@@ -253,7 +253,7 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
sal_Bool bFirst = sal_True;
SwCntntNode * pNode;
- xub_StrLen nStart, nEnde, nTxtLen;
+ xub_StrLen nStart, nEnd, nTxtLen;
sal_Bool bRegSearch = SearchAlgorithms_REGEXP == rSearchOpt.algorithmType;
sal_Bool bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() &&
@@ -269,9 +269,9 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
{
nTxtLen = ((SwTxtNode*)pNode)->GetTxt().Len();
if( rNdIdx == pPam->GetMark()->nNode )
- nEnde = pPam->GetMark()->nContent.GetIndex();
+ nEnd = pPam->GetMark()->nContent.GetIndex();
else
- nEnde = bSrchForward ? nTxtLen : 0;
+ nEnd = bSrchForward ? nTxtLen : 0;
nStart = rCntntIdx.GetIndex();
/* #i80135# */
@@ -287,8 +287,8 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
{
if (!bSrchForward)
{
- xub_StrLen swap = nEnde;
- nEnde = nStart;
+ xub_StrLen swap = nEnd;
+ nEnd = nStart;
nStart = swap;
}
@@ -299,7 +299,7 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
if ( (pTxtAttr->Which()==RES_TXTATR_FIELD) &&
(pTxtAttr->GetFld().GetFld()->Which()==RES_POSTITFLD))
{
- if ( (aPos >= nStart) && (aPos <= nEnde) )
+ if ( (aPos >= nStart) && (aPos <= nEnd) )
aNumberPostits++;
else
{
@@ -311,8 +311,8 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
if (!bSrchForward)
{
- xub_StrLen swap = nEnde;
- nEnde = nStart;
+ xub_StrLen swap = nEnd;
+ nEnd = nStart;
nStart = swap;
}
@@ -352,27 +352,29 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
{
// now we have to split
xub_StrLen nStartInside = 0;
- xub_StrLen nEndeInside = 0;
+ xub_StrLen nEndInside = 0;
sal_Int16 aLoop= bSrchForward ? aStart : aNumberPostits;
while ( (aLoop>=0) && (aLoop<=aNumberPostits))
{
if (bSrchForward)
{
- nStartInside = aLoop==0 ? nStart : *(*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
- nEndeInside = aLoop==aNumberPostits? nEnde : *(*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
- nTxtLen = nEndeInside-nStartInside;
+ nStartInside = aLoop==0 ? nStart : *(*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
+ nEndInside = aLoop==aNumberPostits ? nEnd : *(*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
+ nTxtLen = nEndInside - nStartInside;
}
else
{
nStartInside = aLoop==aNumberPostits ? nStart : *(*pHts)[GetPostIt(aLoop+aIgnore,pHts)]->GetStart();
- nEndeInside = aLoop==0 ? nEnde : *(*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
- nTxtLen = nStartInside-nEndeInside;
+ nEndInside = aLoop==0 ? nEnd : *(*pHts)[GetPostIt(aLoop+aIgnore-1,pHts)]->GetStart()+1;
+ nTxtLen = nStartInside - nEndInside;
}
// search inside the text between a note
- bFound = DoSearch(rSearchOpt,rSTxt,fnMove,bSrchForward,bRegSearch,bChkEmptyPara,bChkParaEnd,
- nStartInside,nEndeInside,nTxtLen, pNode,pPam);
- if (bFound)
+ bFound = DoSearch( rSearchOpt, rSTxt, fnMove, bSrchForward,
+ bRegSearch, bChkEmptyPara, bChkParaEnd,
+ nStartInside, nEndInside, nTxtLen, pNode,
+ pPam );
+ if ( bFound )
break;
else
{
@@ -394,8 +396,9 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
{
// if there is no SwPostItField inside or searching inside notes
// is disabled, we search the whole length just like before
- bFound = DoSearch(rSearchOpt,rSTxt,fnMove,bSrchForward,bRegSearch,bChkEmptyPara,bChkParaEnd,
- nStart,nEnde,nTxtLen, pNode,pPam);
+ bFound = DoSearch( rSearchOpt, rSTxt, fnMove, bSrchForward,
+ bRegSearch, bChkEmptyPara, bChkParaEnd,
+ nStart, nEnd, nTxtLen, pNode, pPam );
}
if (bFound)
break;
@@ -406,9 +409,10 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
}
bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
- SwMoveFn fnMove,
- sal_Bool bSrchForward, sal_Bool bRegSearch, sal_Bool bChkEmptyPara, sal_Bool bChkParaEnd,
- xub_StrLen &nStart, xub_StrLen &nEnde, xub_StrLen nTxtLen,SwNode* pNode, SwPaM* pPam)
+ SwMoveFn fnMove, sal_Bool bSrchForward, sal_Bool bRegSearch,
+ sal_Bool bChkEmptyPara, sal_Bool bChkParaEnd,
+ xub_StrLen &nStart, xub_StrLen &nEnd, xub_StrLen nTxtLen,
+ SwNode* pNode, SwPaM* pPam)
{
bool bFound = false;
SwNodeIndex& rNdIdx = pPam->GetPoint()->nNode;
@@ -433,10 +437,10 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
}
if( bSrchForward )
- lcl_CleanStr( *(SwTxtNode*)pNode, nStart, nEnde,
+ lcl_CleanStr( *(SwTxtNode*)pNode, nStart, nEnd,
aFltArr, sCleanStr, bRemoveSoftHyphens );
else
- lcl_CleanStr( *(SwTxtNode*)pNode, nEnde, nStart,
+ lcl_CleanStr( *(SwTxtNode*)pNode, nEnd, nStart,
aFltArr, sCleanStr, bRemoveSoftHyphens );
SwScriptIterator* pScriptIter = 0;
@@ -450,7 +454,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
nSearchScript = pBreakIt->GetRealScriptOfText( rSearchOpt.searchString, 0 );
}
- xub_StrLen nStringEnd = nEnde;
+ xub_StrLen nStringEnd = nEnd;
while ( (bSrchForward && nStart < nStringEnd) ||
(! bSrchForward && nStart > nStringEnd) )
{
@@ -459,14 +463,14 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
// the break-iterator
if ( pScriptIter )
{
- nEnde = pScriptIter->GetScriptChgPos();
+ nEnd = pScriptIter->GetScriptChgPos();
nCurrScript = pScriptIter->GetCurrScript();
if ( nSearchScript == nCurrScript )
{
const LanguageType eCurrLang =
((SwTxtNode*)pNode)->GetLang( bSrchForward ?
nStart :
- nEnde );
+ nEnd );
if ( eCurrLang != eLastLang )
{
@@ -480,7 +484,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
}
if( nSearchScript == nCurrScript &&
- (rSTxt.*fnMove->fnSearch)( sCleanStr, &nStart, &nEnde, 0 ))
+ (rSTxt.*fnMove->fnSearch)( sCleanStr, &nStart, &nEnd, 0 ))
{
// set section correctly
*GetPoint() = *pPam->GetPoint();
@@ -491,24 +495,24 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
{
xub_StrLen n, nNew;
// if backward search, switch positions temporarily
- if( !bSrchForward ) { n = nStart; nStart = nEnde; nEnde = n; }
+ if( !bSrchForward ) { n = nStart; nStart = nEnd; nEnd = n; }
for( n = 0, nNew = nStart;
n < aFltArr.size() && aFltArr[ n ] <= nStart;
++n, ++nNew )
;
nStart = nNew;
- for( n = 0, nNew = nEnde;
- n < aFltArr.size() && aFltArr[ n ] < nEnde;
+ for( n = 0, nNew = nEnd;
+ n < aFltArr.size() && aFltArr[ n ] < nEnd;
++n, ++nNew )
;
- nEnde = nNew;
+ nEnd = nNew;
// if backward search, switch positions temporarily
- if( !bSrchForward ) { n = nStart; nStart = nEnde; nEnde = n; }
+ if( !bSrchForward ) { n = nStart; nStart = nEnd; nEnd = n; }
}
GetMark()->nContent = nStart;
- GetPoint()->nContent = nEnde;
+ GetPoint()->nContent = nEnd;
// if backward search, switch point and mark
if( !bSrchForward )
@@ -516,7 +520,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
bFound = sal_True;
break;
}
- nStart = nEnde;
+ nStart = nEnd;
}
delete pScriptIter;
@@ -618,9 +622,8 @@ int SwFindParaText::IsReplaceMode() const
sal_uLong SwCursor::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes,
- SwDocPositions nStart, SwDocPositions nEnde,
- sal_Bool& bCancel,
- FindRanges eFndRngs, int bReplace )
+ SwDocPositions nStart, SwDocPositions nEnd,
+ sal_Bool& bCancel, FindRanges eFndRngs, int bReplace )
{
// switch off OLE-notifications
SwDoc* pDoc = GetDoc();
@@ -637,7 +640,7 @@ sal_uLong SwCursor::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNot
if( bSearchSel )
eFndRngs = (FindRanges)(eFndRngs | FND_IN_SEL);
SwFindParaText aSwFindParaText( rSearchOpt, bSearchInNotes, bReplace, *this );
- sal_uLong nRet = FindAll( aSwFindParaText, nStart, nEnde, eFndRngs, bCancel );
+ sal_uLong nRet = FindAll( aSwFindParaText, nStart, nEnd, eFndRngs, bCancel );
pDoc->SetOle2Link( aLnk );
if( nRet && bReplace )
pDoc->SetModified();
commit 5d15480cea118dab711669db9417ddd6a6e348d4
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Mon Jul 9 03:30:54 2012 +0200
adjusted existing comments (in sw/source/core/crsr/)
(modulo some added class header comments)
Change-Id: I0ff7b7a09f45d57da663ab098217587ffe3e24da
diff --git a/sw/source/core/crsr/BlockCursor.hxx b/sw/source/core/crsr/BlockCursor.hxx
index 6bf4703..1bea5c5 100644
--- a/sw/source/core/crsr/BlockCursor.hxx
+++ b/sw/source/core/crsr/BlockCursor.hxx
@@ -25,6 +25,6 @@ struct SwPosition;
IBlockCursor *createBlockCursor(const SwCrsrShell& rCrsrSh, const SwPosition &rPos);
-#endif //_BLOCKURSOR_HXX
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/IBlockCursor.hxx b/sw/source/core/crsr/IBlockCursor.hxx
index 5f4b535..4f51b54 100644
--- a/sw/source/core/crsr/IBlockCursor.hxx
+++ b/sw/source/core/crsr/IBlockCursor.hxx
@@ -34,55 +34,54 @@ class Point;
class IBlockCursor
{
public:
-/** Access to the shell cursor
+ /** Access to the shell cursor
- @return SwShellCrsr& which represents the start and end position of the
- current block selection
-*/
+ @return SwShellCrsr& which represents the start and end position of the
+ current block selection
+ */
virtual SwShellCrsr& getShellCrsr() = 0;
-/** Defines the starting vertex of the block selection
+ /** Defines the starting vertex of the block selection
- @param rPt
- rPt should contain the document coordinates of the mouse cursor when
- the block selection starts (MouseButtonDown)
-*/
+ @param rPt
+ rPt should contain the document coordinates of the mouse cursor when
+ the block selection starts (MouseButtonDown)
+ */
virtual void setStartPoint( const Point &rPt ) = 0;
-/** Defines the ending vertex of the block selection
+ /** Defines the ending vertex of the block selection
- @param rPt
- rPt should contain the document coordinates of the mouse cursor when
- the block selection has started and the mouse has been moved (MouseMove)
-*/
+ @param rPt
+ rPt should contain the document coordinates of the mouse cursor when
+ the block selection has started and the mouse has been moved (MouseMove)
+ */
virtual void setEndPoint( const Point &rPt ) = 0;
-/** The document coordinates where the block selection has been started
+ /** The document coordinates where the block selection has been started
- @return 0, if no start point has been set
-*/
+ @return 0, if no start point has been set
+ */
virtual const Point* getStartPoint() const = 0;
-/** The document coordinates where the block selection ends (at the moment)
+ /** The document coordinates where the block selection ends (at the moment)
- @return 0, if no end point has been set
-*/
+ @return 0, if no end point has been set
+ */
virtual const Point* getEndPoint() const = 0;
-/** Deletion of the mouse created rectangle
+ /** Deletion of the mouse created rectangle
- When start and end points exist, the block cursor depends on this. If the
- cursor is moved by cursor keys (e.g. up/down, home/end) the mouse rectangle
- is obsolet and has to be deleted.
-*/
+ When start and end points exist, the block cursor depends on this. If the
+ cursor is moved by cursor keys (e.g. up/down, home/end) the mouse rectangle
+ is obsolet and has to be deleted.
+ */
virtual void clearPoints() = 0;
-/** Destructor of the block curosr interface
-*/
+ /** Destructor of the block curosr interface */
virtual ~IBlockCursor() {};
};
-#endif // IBLOCKCURSOR_HXX_INCLUDED
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 3b1f76a..7e15633 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -178,8 +178,9 @@ namespace sw { namespace mark
}
}
+ // TODO: everything else uses MarkBase::GenerateNewName ?
NavigatorReminder::NavigatorReminder(const SwPaM& rPaM)
- : MarkBase(rPaM, rtl::OUString("__NavigatorReminder__")) //<-- everything else uses MarkBase::GenerateNewName ?
+ : MarkBase(rPaM, rtl::OUString("__NavigatorReminder__"))
{ }
UnoMark::UnoMark(const SwPaM& aPaM)
@@ -265,7 +266,6 @@ namespace sw { namespace mark
uno::Reference< rdf::XMetadatable > Bookmark::MakeUnoObject()
{
- // create new SwXBookmark
SwDoc *const pDoc( GetMarkPos().GetDoc() );
OSL_ENSURE(pDoc, "Bookmark::MakeUnoObject: no doc?");
const uno::Reference< rdf::XMetadatable> xMeta(
@@ -273,7 +273,6 @@ namespace sw { namespace mark
return xMeta;
}
-
Fieldmark::Fieldmark(const SwPaM& rPaM)
: MarkBase(rPaM, MarkBase::GenerateNewName(rtl::OUString("__Fieldmark__")))
{
@@ -302,8 +301,8 @@ namespace sw { namespace mark
void Fieldmark::Invalidate( )
{
- // @TODO: Does exist a better solution to trigger a format of the
- // fieldmark portion? If yes, please use it.
+ // TODO: Does exist a better solution to trigger a format of the
+ // fieldmark portion? If yes, please use it.
SwPaM aPaM( this->GetMarkPos(), this->GetOtherMarkPos() );
aPaM.InvalidatePaM();
}
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index 66c0b26..29ae8cb 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -120,7 +120,7 @@ void lcl_notifyRow(const SwCntntNode* pNode, SwCrsrShell& rShell)
SwCallLink::~SwCallLink()
{
- if( !nNdTyp || !rShell.bCallChgLnk ) // see ctor
+ if( !nNdTyp || !rShell.bCallChgLnk ) // see ctor
return ;
// If travelling over Nodes check formats and register them anew at the
diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index 08b80ae..4fcab68 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -59,7 +59,7 @@ namespace
}
}
- // returns true if the Cursor had been rolled back
+ /// returns true if the Cursor had been rolled back
bool RollbackIfIllegal()
{
if(m_pCrsr->IsSelOvr(nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 7e4056e..4b92dbd 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -59,10 +59,10 @@
#include <scriptinfo.hxx>
#include <globdoc.hxx>
#include <pamtyp.hxx>
-#include <mdiexp.hxx> // ...Percent()
+#include <mdiexp.hxx>
#include <fmteiro.hxx>
-#include <wrong.hxx> // SMARTTAGS
-#include <unotextrange.hxx> // SMARTTAGS
+#include <wrong.hxx>
+#include <unotextrange.hxx>
#include <vcl/svapp.hxx>
#include <numrule.hxx>
#include <IGrammarContact.hxx>
@@ -83,7 +83,6 @@ TYPEINIT2(SwCrsrShell,ViewShell,SwModify);
*/
void CheckRange( SwCursor* );
-//-----------------------------------------------------------------------
/**
* Check if pCurCrsr points into already existing ranges and delete those.
@@ -112,22 +111,20 @@ void CheckRange( SwCursor* pCurCrsr )
else
if( *pStt < *pTmpEnd )
pTmpDel = pTmp;
- /*
- * If Point or Mark is within the Crsr range, we
- * need to remove the old range. Take note that Point does
- * not belong to the range anymore.
- */
+
+ // If Point or Mark is within the Crsr range, we need to remove the old
+ // range. Take note that Point does not belong to the range anymore.
pTmp = (SwPaM*)pTmp->GetNext();
delete pTmpDel; // Remove old range
pTmpDel = 0;
}
}
+// -----------
+// SwCrsrShell
+// -----------
-/**
- Methods of SwCrsrShell
- */
SwPaM * SwCrsrShell::CreateCrsr()
@@ -164,7 +161,7 @@ sal_Bool SwCrsrShell::DestroyCrsr()
if(pCurCrsr->GetNext() == pCurCrsr)
return sal_False;
- SwCallLink aLk( *this ); // watch Crsr-Moves
+ SwCallLink aLk( *this ); // watch Crsr-Moves
SwCursor* pNextCrsr = (SwCursor*)pCurCrsr->GetNext();
delete pCurCrsr;
pCurCrsr = dynamic_cast<SwShellCrsr*>(pNextCrsr);
@@ -206,7 +203,7 @@ SwPaM* SwCrsrShell::GetCrsr( sal_Bool bMakeTblCrsr ) const
{
if( bMakeTblCrsr && pTblCrsr->IsCrsrMovedUpdt() )
{
- //don't re-create 'parked'(?) cursors
+ //don't re-create 'parked' cursors
const SwCntntNode* pCNd;
if( pTblCrsr->GetPoint()->nNode.GetIndex() &&
pTblCrsr->GetMark()->nNode.GetIndex() &&
@@ -243,7 +240,7 @@ void SwCrsrShell::StartAction()
else
nLeftFrmPos = 0;
}
- ViewShell::StartAction(); // to the ViewShell
+ ViewShell::StartAction(); // to the ViewShell
}
@@ -261,8 +258,8 @@ void SwCrsrShell::EndAction( const sal_Bool bIdleEnd )
if( 1 == nStartAction )
GetDoc()->UpdateNumRule();
- // Task: 76923: dont show the cursor in the ViewShell::EndAction() - call.
- // Only the UpdateCrsr shows the cursor.
+ // #i76923#: Don't show the cursor in the ViewShell::EndAction() - call.
+ // Only the UpdateCrsr shows the cursor.
sal_Bool bSavSVCrsrVis = bSVCrsrVis;
bSVCrsrVis = sal_False;
@@ -295,7 +292,7 @@ void SwCrsrShell::EndAction( const sal_Bool bIdleEnd )
if( bCallChgLnk && bChgCallFlag && aChgLnk.IsSet() )
{
aChgLnk.Call( this );
- bChgCallFlag = sal_False; // reset flag
+ bChgCallFlag = sal_False; // reset flag
}
}
return;
@@ -363,20 +360,16 @@ sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMo
if( pBlockCrsr )
pBlockCrsr->clearPoints();
- //
// 1. CASE: Cursor is in front of label. A move to the right
// will simply reset the bInFrontOfLabel flag:
- //
SwShellCrsr* pShellCrsr = getShellCrsr( true );
if ( !bLeft && pShellCrsr->IsInFrontOfLabel() )
{
SetInFrontOfLabel( sal_False );
bRet = sal_True;
}
- //
// 2. CASE: Cursor is at beginning of numbered paragraph. A move
// to the left will simply set the bInFrontOfLabel flag:
- //
else if ( bLeft && 0 == pShellCrsr->GetPoint()->nContent.GetIndex() &&
!pShellCrsr->IsInFrontOfLabel() && !pShellCrsr->HasMark() &&
0 != ( pTxtNd = pShellCrsr->GetNode()->GetTxtNode() ) &&
@@ -385,9 +378,7 @@ sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMo
SetInFrontOfLabel( sal_True );
bRet = sal_True;
}
- //
// 3. CASE: Regular cursor move. Reset the bInFrontOfLabel flag:
- //
else
{
const sal_Bool bSkipHidden = !GetViewOptions()->IsShowHiddenChar();
@@ -684,7 +675,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
// same table column and not in header/footer -> back
return bRet;
- // Toggle the Header/Footer mode if needed
+ // toggle the header/footer mode if needed
bool bInHeaderFooter = pFrm && ( pFrm->IsHeaderFrm() || pFrm->IsFooterFrm() );
if ( bInHeaderFooter != IsHeaderFooterEdit() )
ToggleHeaderFooterEdit();
@@ -1262,7 +1253,7 @@ static void lcl_CheckHiddenSection( SwNodeIndex& rIdx )
}
}
-// Try to set the cursor to the next visible content node.
+/// Try to set the cursor to the next visible content node.
static void lcl_CheckHiddenPara( SwPosition& rPos )
{
SwNodeIndex aTmp( rPos.nNode );
@@ -1280,7 +1271,7 @@ static void lcl_CheckHiddenPara( SwPosition& rPos )
rPos = SwPosition( aTmp, SwIndex( pTxtNd, 0 ) );
}
-// #i27301# - helper class, which notifies the accessibility about invalid text
+// #i27301# - helper class that notifies the accessibility about invalid text
// selections in its destructor
class SwNotifyAccAboutInvalidTextSelections
{
@@ -1304,7 +1295,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
ClearUpCrsrs();
// In a BasicAction the cursor must be updated, e.g. to create the
- // TableCursor. EndAction now calls UpdateCrsr!
+ // TableCursor. EndAction now calls UpdateCrsr!
if( ActionPend() && BasicActionPend() )
{
if ( eFlags & SwCrsrShell::READONLY )
@@ -1359,8 +1350,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
Point aTmpMk( pITmpCrsr->GetMkPos() );
SwPosition* pPos = pITmpCrsr->GetPoint();
- // JP 30.04.99: Bug 65475
- // if Point/Mark in hidden sections, move them out
+ // Bug 65475 (1999) - if Point/Mark in hidden sections, move them out
lcl_CheckHiddenSection( pPos->nNode );
lcl_CheckHiddenSection( pITmpCrsr->GetMark()->nNode );
@@ -1456,7 +1446,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
(void) bResult; // non-debug: unused
}
- pVisCrsr->Hide(); // always hide visible Cursor
+ pVisCrsr->Hide(); // always hide visible Cursor
// scroll Cursor to visible area
if( (eFlags & SwCrsrShell::SCROLLWIN) &&
(HasSelection() || eFlags & SwCrsrShell::READONLY ||
@@ -1486,7 +1476,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
aCrsrHeight.X() = 0;
aCrsrHeight.Y() = aTmpState.aRealHeight.Y() < 0 ?
-aCharRect.Width() : aCharRect.Height();
- pVisCrsr->Show(); // show again
+ pVisCrsr->Show(); // show again
}
eMvState = MV_NONE; // state for cursor travelling - GetCrsrOfst
if( pTblFrm && Imp()->IsAccessible() )
@@ -1506,7 +1496,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
delete pTblCrsr, pTblCrsr = 0;
}
- pVisCrsr->Hide(); // always hide visible Cursor
+ pVisCrsr->Hide(); // always hide visible Cursor
// are we perhaps in a protected / hidden Section ?
{
@@ -1522,7 +1512,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
if( !FindValidCntntNode( !HasDrawView() ||
0 == Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount()))
{
- // everything protected / hidden -> special Mode
+ // everything protected/hidden -> special mode
if( bAllProtect && !IsReadOnlyAvailable() &&
pSectNd->GetSection().IsProtectFlag() )
bChgState = sal_False;
@@ -1654,7 +1644,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
CallChgLnk(); // notify UI!
}
bAllProtect = sal_False;
- bAgainst = sal_True; // look for the right Frm again
+ bAgainst = sal_True; // look for the right Frm again
}
}
} while( bAgainst );
@@ -1759,7 +1749,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
}
}
- eMvState = MV_NONE; // state for cursor tavelling - GetCrsrOfst
+ eMvState = MV_NONE; // state for cursor tavelling - GetCrsrOfst
if( pFrm && Imp()->IsAccessible() )
Imp()->InvalidateAccessibleCursorPosition( pFrm );
@@ -1784,7 +1774,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
}
if( bSVCrsrVis )
- pVisCrsr->Show(); // show again
+ pVisCrsr->Show(); // show again
}
void SwCrsrShell::RefreshBlockCursor()
@@ -2537,7 +2527,6 @@ void SwCrsrShell::ParkCrsr( const SwNodeIndex &rIdx )
delete pNew;
}
-//=========================================================================
/** Copy constructor
@@ -2884,8 +2873,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText )
sal_Bool SwCrsrShell::IsCrsrReadonly() const
{
if ( GetViewOptions()->IsReadonly() ||
- // Formular view
- GetViewOptions()->IsFormView() )
+ GetViewOptions()->IsFormView() /* Formular view */ )
{
SwFrm *pFrm = GetCurrFrm( sal_False );
const SwFlyFrm* pFly;
@@ -3002,10 +2990,8 @@ sal_Bool SwCrsrShell::IsInRightToLeftText( const Point* pPt ) const
return FRMDIR_VERT_TOP_LEFT == nDir || FRMDIR_HORI_RIGHT_TOP == nDir;
}
-//
-// If the current cursor position is inside a hidden range, the hidden range
-// is selected:
-//
+/// If the current cursor position is inside a hidden range, the hidden range
+/// is selected.
bool SwCrsrShell::SelectHiddenRange()
{
bool bRet = false;
@@ -3160,10 +3146,8 @@ void SwCrsrShell::ClearUpCrsrs()
SwPaM * pTmpCrsr;
bool bChanged = false;
- /*
- For all entries in the ring except the start entry delete the
- entry if it is invalid.
- */
+ // For all entries in the ring except the start entry delete the entry if
+ // it is invalid.
while (pCrsr != pStartCrsr)
{
pTmpCrsr = (SwPaM *) pCrsr->GetNext();
@@ -3193,11 +3177,9 @@ void SwCrsrShell::ClearUpCrsrs()
aNodes.GoNext( &aIdx );
if( pNode == NULL || lcl_NodeContext( *pNode ) != pStart )
{
- /*
- If the start entry of the ring is invalid replace it with a
- cursor pointing to the beginning of the first content node in
- the document.
- */
+ // If the start entry of the ring is invalid replace it with a
+ // cursor pointing to the beginning of the first content node in the
+ // document.
aIdx = (*(aNodes.GetEndOfContent().StartOfSectionNode()));
pNode = aNodes.GoNext( &aIdx );
}
@@ -3214,10 +3196,8 @@ void SwCrsrShell::ClearUpCrsrs()
bChanged = true;
}
- /*
- If at least one of the cursors in the ring have been deleted or
- replaced, remove the table cursor.
- */
+ // If at least one of the cursors in the ring have been deleted or replaced,
+ // remove the table cursor.
if (pTblCrsr != NULL && bChanged)
TblCrsrToCursor();
}
@@ -3381,11 +3361,10 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex();
Pop(sal_False);
- // make sure the selection build later from the
- // data below does not include footnotes and other
- // "in word" character to the left and right in order
- // to preserve those. Therefore count those "in words"
- // in order to modify the selection accordingly.
+ // make sure the selection build later from the data below does not
+ // include footnotes and other "in word" character to the left and
+ // right in order to preserve those. Therefore count those "in
+ // words" in order to modify the selection accordingly.
const sal_Unicode* pChar = aText.GetBuffer();
xub_StrLen nLeft = 0;
while (pChar && *pChar++ == CH_TXTATR_INWORD)
@@ -3400,9 +3379,10 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
*pCrsr->GetPoint() = aPos;
pCrsr->SetMark();
ExtendSelection( sal_True, nLen - nLeft - nRight );
- //no determine the rectangle in the current line
+ // do not determine the rectangle in the current line
xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft;
- //take one less than the line end - otherwise the next line would be calculated
+ // take one less than the line end - otherwise the next line would
+ // be calculated
xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd : (nBegin + nLen - nLeft - nRight);
Push();
pCrsr->DeleteMark();
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 955e50b..8c83389 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -42,7 +42,7 @@
#include <pam.hxx>
#include <ndtxt.hxx>
#include <fldbas.hxx>
-#include <swtable.hxx> // SwTxtFld
+#include <swtable.hxx>
#include <docary.hxx>
#include <txtfld.hxx>
#include <fmtfld.hxx>
@@ -58,7 +58,7 @@
#include <docfld.hxx>
#include <expfld.hxx>
#include <reffld.hxx>
-#include <flddat.hxx> // SwTxtFld
+#include <flddat.hxx>
#include <cellatr.hxx>
#include <swundo.hxx>
#include <redline.hxx>
@@ -906,11 +906,11 @@ sal_Bool SwCrsrShell::MakeOutlineSel( sal_uInt16 nSttPos, sal_uInt16 nEndPos,
if( bWithChildren )
{
- const int nLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;//<-end.zhaojianwei
+ const int nLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;
for( ++nEndPos; nEndPos < rOutlNds.Count(); ++nEndPos )
{
pEndNd = rOutlNds[ nEndPos ];
- const int nNxtLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;//<-end,zhaojianwei
+ const int nNxtLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;
if( nNxtLevel <= nLevel )
break; // EndPos is now on the next one
}
@@ -2127,7 +2127,7 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
SET_CURR_SHELL( this );
SwCallLink aLk( *this );
- // find a text attribute ?
+ // found a text attribute ?
if( pFndAttr )
{
SwCrsrSaveState aSaveState( *pCurCrsr );
@@ -2144,7 +2144,7 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
bRet = sal_True;
}
}
- // find a draw object ?
+ // found a draw object ?
else if( RES_DRAWFRMFMT == pFndFmt->Which() )
{
const SdrObject* pSObj = pFndFmt->FindSdrObject();
@@ -2152,7 +2152,7 @@ sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext )
MakeSelVisible();
bRet = sal_True;
}
- else // then is it a fly
+ else // then is it a fly
{
SwFlyFrm* pFly = pFndFmt->GetFrm(&aPt, sal_False );
if( pFly )
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index eb05b49..e3118fa 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -120,7 +120,7 @@ void lcl_SetAttrPam( SwPaM & rPam, xub_StrLen nStart, const xub_StrLen* pEnde,
SwCntntNode* pCNd = rPam.GetCntntNode();
rPam.GetPoint()->nContent.Assign( pCNd, nStart );
- rPam.SetMark(); // Point == GetMark
+ rPam.SetMark(); // Point == GetMark
// Point points to end of search area or end of attribute
if( pEnde )
@@ -1114,7 +1114,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
pSTxt = new utl::TextSearch( aTmp );
}
- // todo/mba: searching for attributes in Outliner text?!
+ // TODO: searching for attributes in Outliner text?!
sal_Bool bSearchInNotes = sal_False;
// continue search in correct section (pTextRegion)
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index cc5f2e1..5f2eb4c 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -121,7 +121,6 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
const SwTxtAttr* pHt = (*pHts)[n];
if ( pHt->HasDummyChar() && (nStt >= nStart) )
{
- //JP 17.05.00: Task 75806 ask for ">=" and not for ">"
switch( pHt->Which() )
{
case RES_TXTATR_FLYCNT:
@@ -263,7 +262,7 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
sal_Bool bChkParaEnd = bRegSearch && 1 == rSearchOpt.searchString.getLength() &&
!rSearchOpt.searchString.compareToAscii( "$" );
-// LanguageType eLastLang = 0;
+ // LanguageType eLastLang = 0;
while( 0 != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly ) ))
{
if( pNode->IsTxtNode() )
@@ -276,11 +275,12 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
nStart = rCntntIdx.GetIndex();
/* #i80135# */
- // if there are SwPostItFields inside our current node text, we split the text into seperate pieces
- // and search for text inside the pieces as well as inside the fields
+ // if there are SwPostItFields inside our current node text, we
+ // split the text into seperate pieces and search for text inside
+ // the pieces as well as inside the fields
const SwpHints *pHts = ((SwTxtNode*)pNode)->GetpSwpHints();
- // count postitfields by looping over all fields
+ // count PostItFields by looping over all fields
xub_StrLen aNumberPostits = 0;
xub_StrLen aIgnore = 0;
if (pHts && bSearchInNotes)
@@ -392,7 +392,8 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
}
else
{
- // if there is no SwPostItField inside or searching inside notes is disabled, we search the whole length just like before
+ // if there is no SwPostItField inside or searching inside notes
+ // is disabled, we search the whole length just like before
bFound = DoSearch(rSearchOpt,rSTxt,fnMove,bSrchForward,bRegSearch,bChkEmptyPara,bChkParaEnd,
nStart,nEnde,nTxtLen, pNode,pPam);
}
@@ -415,7 +416,8 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
String sCleanStr;
std::vector<sal_uLong> aFltArr;
LanguageType eLastLang = 0;
- // if the search string contains a soft hypen, we don't strip them from the text:
+ // if the search string contains a soft hypen,
+ // we don't strip them from the text:
bool bRemoveSoftHyphens = true;
if ( bRegSearch )
{
@@ -452,9 +454,9 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
while ( (bSrchForward && nStart < nStringEnd) ||
(! bSrchForward && nStart > nStringEnd) )
{
- // SearchAlgorithms_APPROXIMATE works on a per word base
- // so we have to provide the text searcher with the correct
- // locale, because it uses the breakiterator
+ // SearchAlgorithms_APPROXIMATE works on a per word base so we have to
+ // provide the text searcher with the correct locale, because it uses
+ // the break-iterator
if ( pScriptIter )
{
nEnde = pScriptIter->GetScriptChgPos();
@@ -514,9 +516,8 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
bFound = sal_True;
break;
}
-
nStart = nEnde;
- } // end of script while
+ }
delete pScriptIter;
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 1010cdd..e1eef09 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -331,7 +331,6 @@ SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, sal_Bool bChk )
return pNd;
}
-// ----------------------------------------------------------------------
SwPaM::SwPaM( const SwPosition& rPos, SwPaM* pRing )
: Ring( pRing )
@@ -803,7 +802,6 @@ SwCntntNode* GetNode( SwPaM & rPam, sal_Bool& rbFirst, SwMoveFn fnMove,
return pNd;
}
-// ----------------------------------------------------------------------
void GoStartDoc( SwPosition * pPos )
{
@@ -1043,10 +1041,9 @@ String SwPaM::GetTxt() const
SwNodeIndex aNodeIndex = Start()->nNode;
- /* The first node can be the end node. A first end node must be
- handled, too. There fore do ... while and no incrementing of
- aNodeIndex in the first pass.
- */
+ // The first node can be already the end node.
+ // A first end node must be handled, too. Therefore do-while and no
+ // incrementing of aNodeIndex in the first pass.
bool bFirst = true;
do
{
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index a3e98d3..6e10983 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -54,10 +54,9 @@
#include <breakit.hxx>
#include <crsskip.hxx>
#include <vcl/msgbox.hxx>
-#include <mdiexp.hxx> // ...Percent()
-#include <statstr.hrc> // ResId fuer Statusleiste
-#include <redline.hxx> // SwRedline
-
+#include <mdiexp.hxx>
+#include <statstr.hrc>
+#include <redline.hxx>
using namespace ::com::sun::star::i18n;
@@ -337,7 +336,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
if( pFrm && pFrm->IsValid() && 0 == pFrm->Frm().Height() &&
0 != ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) )
{
- // skip to the next / prev valid paragraph with a layout
+ // skip to the next/prev valid paragraph with a layout
SwNodeIndex& rPtIdx = GetPoint()->nNode;
int bGoNxt = pSavePos->nNode < rPtIdx.GetIndex();
while( 0 != ( pFrm = ( bGoNxt ? pFrm->GetNextCntntFrm()
@@ -345,8 +344,8 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
0 == pFrm->Frm().Height() )
;
- // #i72394# skip to prev /next valid paragraph
- // with a layout in case the first search did not succeed:
+ // #i72394# skip to prev/next valid paragraph with a layout in case
+ // the first search did not succeed:
if( !pFrm )
{
bGoNxt = !bGoNxt;
@@ -361,7 +360,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
SwCntntNode* pCNd;
if( pFrm && 0 != (pCNd = (SwCntntNode*)pFrm->GetNode()) )
{
- // set this cntntNode as new position
+ // set this CntntNode as new position
rPtIdx = *pCNd;
pNd = pCNd;
@@ -465,7 +464,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
::CheckNodesRange( GetMark()->nNode,
GetPoint()->nNode, sal_True ))
{
- // TABLE IN TABLE
+ // table in table
const SwTableNode* pOuterTableNd = pMyNd->FindTableNode();
if ( pOuterTableNd )
pMyNd = pOuterTableNd;
@@ -723,7 +722,7 @@ sal_uLong lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr,
int bSrchBkwrd = fnMove == fnMoveBackward, bEnde = sal_False;
SwPaM *pTmpCrsr = pCurCrsr, *pSaveCrsr = pCurCrsr;
- // only create progress-bar for ShellCrsr
+ // only create progress bar for ShellCrsr
bool bIsUnoCrsr = 0 != dynamic_cast<SwUnoCrsr*>(pCurCrsr);
_PercentHdl* pPHdl = 0;
sal_uInt16 nCrsrCnt = 0;
@@ -945,7 +944,7 @@ sal_uLong SwCursor::FindAll( SwFindParas& rParas,
// put cursor as copy of current into ring
// chaining points always to first created, so forward
SAL_WNODEPRECATED_DECLARATIONS_PUSH
- std::auto_ptr< SwCursor > pSav( Create( this ) ); // save the current cursor
+ std::auto_ptr< SwCursor > pSav( Create( this ) ); // save the current cursor
SAL_WNODEPRECATED_DECLARATIONS_POP
// if already outside of body text search from this position or start at
@@ -1335,7 +1334,7 @@ sal_Bool SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, con
// set the cursor to the layout position
Point aPt( *pPt );
pLayout->GetCrsrOfst( GetPoint(), aPt );
- } //swmod 071107//swmod 071225
+ } //swmod 071107 //swmod 071225
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
@@ -1392,7 +1391,6 @@ sal_Bool SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, con
return bRet;
}
-//-----------------------------------------------------------------------------
static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd )
{
@@ -1619,9 +1617,9 @@ sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
break;
// If we were located inside a covered cell but our position has been
- // corrected, we check if the last move has moved the cursor to a different
- // table cell. In this case we set the cursor to the stored covered position
- // and redo the move:
+ // corrected, we check if the last move has moved the cursor to a
+ // different table cell. In this case we set the cursor to the stored
+ // covered position and redo the move:
if ( mnRowSpanOffset )
{
const SwNode* pOldTabBoxSttNode = aOldNodeIdx.GetNode().FindTableBoxStartNode();
@@ -1795,10 +1793,10 @@ sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt,
if ( bAdjustTableCrsr && !bUp )
{
- // Special case: We have a table cursor but the start box
- // has more than one paragraph. If we want to go down, we have to
- // set the point to the last frame in the table box. This is
- // only necessary if we do not already have a table selection
+ // Special case: We have a table cursor but the start box has more
+ // than one paragraph. If we want to go down, we have to set the
+ // point to the last frame in the table box. This is only necessary
+ // if we do not already have a table selection
const SwStartNode* pTblNd = GetNode( sal_True )->FindTableBoxStartNode();
OSL_ENSURE( pTblNd, "pTblCrsr without SwTableNode?" );
@@ -2011,13 +2009,13 @@ sal_Bool SwCursor::GotoTblBox( const String& rName )
sal_Bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
{
- //for optimization test something before
+ // for optimization test something before
const SwNode* pNd = &GetPoint()->nNode.GetNode();
bool bShortCut = false;
if ( fnWhichPara == fnParaCurr )
{
// #i41048#
- // If fnWhichPara == fnParaCurr, (*fnWhichPara)( *this, fnPosPara )
+ // If fnWhichPara == fnParaCurr then (*fnWhichPara)( *this, fnPosPara )
// can already move the cursor to a different text node. In this case
// we better check if IsSelOvr().
const SwCntntNode* pCntntNd = pNd->GetCntntNode();
@@ -2131,7 +2129,7 @@ sal_Bool lcl_SeekEntry( const SwSelBoxes& rTmp, const SwStartNode* pSrch, sal_uI
SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
{
- if( bChg ) // ???
+ if( bChg )
{
if( bParked )
{
diff --git a/sw/source/core/crsr/trvlcol.cxx b/sw/source/core/crsr/trvlcol.cxx
index c2e6133..262ab7b 100644
--- a/sw/source/core/crsr/trvlcol.cxx
+++ b/sw/source/core/crsr/trvlcol.cxx
@@ -93,7 +93,7 @@ sal_Bool SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol
SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SwCrsrSaveState aSaveState( *pCurCrsr );
- pCnt->Calc(); // ???
+ pCnt->Calc();
Point aPt( pCnt->Frm().Pos() + pCnt->Prt().Pos() );
if( fnPosCol == GetColumnEnd )
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 90ba1d7..2defc1b 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -223,8 +223,10 @@ sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
}
else
{
- pStt = aCells[ bVert ? (bRow ? 0 : 3) : (bRow ? 2 : 1) ]->GetTabBox(); // will become point of table cursor
- pEnd = aCells[ bVert ? (bRow ? 3 : 0) : (bRow ? 1 : 2) ]->GetTabBox(); // will become mark of table cursor
+ // will become point of table cursor
+ pStt = aCells[ bVert ? (bRow ? 0 : 3) : (bRow ? 2 : 1) ]->GetTabBox();
+ // will become mark of table cursor
+ pEnd = aCells[ bVert ? (bRow ? 3 : 0) : (bRow ? 1 : 2) ]->GetTabBox();
}
}
@@ -280,8 +282,8 @@ sal_Bool SwCrsrShell::SelTbl()
pTblCrsr->GetPoint()->nNode = *pTblNd;
pTblCrsr->Move( fnMoveForward, fnGoCntnt );
pTblCrsr->SetMark();
- // set MkPos 'close' to the master table, otherwise we might get problems with the
- // repeated headlines check in UpdateCrsr():
+ // set MkPos 'close' to the master table, otherwise we might get problems
+ // with the repeated headlines check in UpdateCrsr():
pTblCrsr->GetMkPos() = pMasterTabFrm->IsVertical() ? pMasterTabFrm->Frm().TopRight() : pMasterTabFrm->Frm().TopLeft();
pTblCrsr->GetPoint()->nNode = *pTblNd->EndOfSectionNode();
pTblCrsr->Move( fnMoveBackward, fnGoCntnt );
@@ -344,15 +346,19 @@ sal_Bool SwCrsrShell::SelTblBox()
return sal_True;
}
-// return the next non-protected cell inside a table
-// rIdx - is on a table node
-// return:
-// true - Idx points to content in a suitable cell
-// false - could not find a suitable cell
+// TODO: provide documentation
+/** get the next non-protected cell inside a table
+
+ @param[in,out] rIdx is on a table node
+ @param bInReadOnly ???
+
+ @return <false> if no suitable cell could be found, otherwise <rIdx> points
+ to content in a suitable cell and <true> is returned.
+*/
bool lcl_FindNextCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
{
// check protected cells
- SwNodeIndex aTmp( rIdx, 2 ); // TableNode + StartNode
+ SwNodeIndex aTmp( rIdx, 2 ); // TableNode + StartNode
// the resulting cell should be in that table:
const SwTableNode* pTblNd = rIdx.GetNode().GetTableNode();
@@ -427,10 +433,10 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
return true;
}
-// comments see lcl_FindNextCell
+/// see lcl_FindNextCell()
bool lcl_FindPrevCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly )
{
- SwNodeIndex aTmp( rIdx, -2 ); // TableNode + EndNode
+ SwNodeIndex aTmp( rIdx, -2 ); // TableNode + EndNode
const SwNode* pTableEndNode = &rIdx.GetNode();
const SwTableNode* pTblNd = pTableEndNode->StartOfSectionNode()->GetTableNode();
@@ -496,9 +502,8 @@ sal_Bool GotoPrevTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl,
SwTableNode* pTblNd = aIdx.GetNode().FindTableNode();
if( pTblNd )
{
- // #i26532#: If we are inside a table, we may not go backward
- // to the table start node, because we would miss any tables
- // inside this table.
+ // #i26532#: If we are inside a table, we may not go backward to the
+ // table start node, because we would miss any tables inside this table.
SwTableNode* pInnerTblNd = 0;
SwNodeIndex aTmpIdx( aIdx );
while( aTmpIdx.GetIndex() &&
@@ -713,9 +718,8 @@ sal_Bool SwCrsrShell::IsTblComplexForChart()
{
sal_Bool bRet = sal_False;
- StartAction(); // IsTblComplexForChart() may trigger table formatting
- // we better do that inside an action
-
+ // Here we may trigger table formatting so we better do that inside an action
+ StartAction();
const SwTableNode* pTNd = pCurCrsr->GetPoint()->nNode.GetNode().FindTableNode();
if( pTNd )
{
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index a7e2aa6..95a5521 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -38,13 +38,13 @@
#include <viewimp.hxx>
#include <dview.hxx>
#include <rootfrm.hxx>
-#include <txtfrm.hxx> // SwTxtFrm
+#include <txtfrm.hxx>
#include <docary.hxx>
#include <extinput.hxx>
#include <ndtxt.hxx>
#include <scriptinfo.hxx>
-#include <mdiexp.hxx> // GetSearchDialog
-#include <comcore.hrc> // ResId for query when (switching to?) Search & Replace
+#include <mdiexp.hxx>
+#include <comcore.hrc>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdrpaintwindow.hxx>
@@ -73,7 +73,7 @@ SwVisCrsr::SwVisCrsr( const SwCrsrShell * pCShell )
#ifdef SW_CRSR_TIMER
bTimerOn = sal_True;
- SetTimeout( 50 ); // 50 millisecond delay
+ SetTimeout( 50 ); // 50 millisecond delay
#endif
}
@@ -83,7 +83,7 @@ SwVisCrsr::~SwVisCrsr()
{
#ifdef SW_CRSR_TIMER
if( bTimerOn )
- Stop(); // stop timer
+ Stop(); // stop timer
#endif
if( bIsVisible && aTxtCrsr.IsVisible() )
@@ -106,11 +106,11 @@ void SwVisCrsr::Show()
#ifdef SW_CRSR_TIMER
{
if( bTimerOn )
- Start(); // start timer
+ Start(); // start timer
else
{
if( IsActive() )
- Stop(); // stop timer
+ Stop(); // stop timer
_SetPosAndShow();
}
@@ -131,7 +131,7 @@ void SwVisCrsr::Hide()
#ifdef SW_CRSR_TIMER
if( IsActive() )
- Stop(); // stop timer
+ Stop(); // stop timer
#endif
if( aTxtCrsr.IsVisible() ) // Shouldn't the flags be in effect?
@@ -164,7 +164,7 @@ sal_Bool SwVisCrsr::ChgTimerFlag( sal_Bool bFlag )
bOld = bTimerOn;
if( !bFlag && bIsVisible && IsActive() )
{
- Stop(); // stop timer
+ Stop(); // stop timer
_SetPosAndShow();
}
bTimerOn = bFlag;
@@ -263,7 +263,6 @@ void SwVisCrsr::_SetPosAndShow()
}
}
-//////////////////////////////////////////////////////////////////////////////
SwSelPaintRects::SwSelPaintRects( const SwCrsrShell& rCSh )
: SwRects( 0 ),
@@ -347,9 +346,9 @@ void SwSelPaintRects::Show()
if (xTargetOverlay.is())
{
- // #i97672# get the system's highlight color and limit it to the maximum
- // allowed luminance. This is needed to react on too bright highlight colors
- // which would otherwise vive a bad visualisation.
+ // #i97672# get the system's highlight color and limit it to the
+ // maximum allowed luminance. This is needed to react on too bright
+ // highlight colors which would otherwise vive a bad visualisation.
const OutputDevice *pOut = Application::GetDefaultDevice();
Color aHighlight(pOut->GetSettings().GetStyleSettings().GetHighlightColor());
const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
@@ -394,12 +393,10 @@ void SwSelPaintRects::Invalidate( const SwRect& rRect )
SwRects::Remove( 0, nSz );
SwRects::Insert( &aReg, 0 );
- // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// If the selection is to the right or at the bottom, outside the
// visible area, it is never aligned on one pixel at the right/bottom.
// This has to be determined here and if that is the case the
// rectangle has to be expanded.
- // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if( GetShell()->bVisPortChgd && 0 != ( nSz = Count()) )
{
SwSelPaintRects::Get1PixelInLogic( *GetShell() );
@@ -503,9 +500,8 @@ void SwShellCrsr::Show()
} while( this != ( pTmp = dynamic_cast<SwShellCrsr*>(pTmp->GetNext()) ) );
}
-
- // This rectangle gets painted anew, therefore the SSelection in this
- // area is invalid.
+// This rectangle gets painted anew, therefore the SSelection in this
+// area is invalid.
void SwShellCrsr::Invalidate( const SwRect& rRect )
{
SwShellCrsr * pTmp = this;
@@ -515,7 +511,7 @@ void SwShellCrsr::Invalidate( const SwRect& rRect )
pTmp->SwSelPaintRects::Invalidate( rRect );
// skip any non SwShellCrsr objects in the ring
- // (see:SwAutoFormat::DeleteSel()
+ // see also: SwAutoFormat::DeleteSel()
Ring* pTmpRing = pTmp;
pTmp = 0;
do
@@ -570,7 +566,7 @@ short SwShellCrsr::MaxReplaceArived()
for( nActCnt = aArr[n]; nActCnt--; )
pSh->StartAction();
pSh = (ViewShell*)pSh->GetNext();
- } //swmod 071107//swmod 071225
+ } //swmod 071107 //swmod 071225
}
else
// otherwise from the Basic, and than switch to RET_YES
@@ -590,7 +586,7 @@ sal_Bool SwShellCrsr::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
&GetPtPos(), GetShell()->GetUpDownX() );
}
-// TRUE: The cursor can be set to the position.
+// if <true> than the cursor can be set to the position.
sal_Bool SwShellCrsr::IsAtValidPos( sal_Bool bPoint ) const
{
if( GetShell() && ( GetShell()->IsAllProtect() ||
@@ -640,8 +636,7 @@ void SwShellTableCrsr::SaveTblBoxCntnt( const SwPosition* pPos )
void SwShellTableCrsr::FillRects()
{
- // Calculate the new rectangles.
- // JP 16.01.98: If the cursor is still "parked" do nothing!!
+ // Calculate the new rectangles. If the cursor is still "parked" do nothing
if( !aSelBoxes.Count() || bParked ||
!GetPoint()->nNode.GetIndex() )
return;
@@ -656,7 +651,7 @@ void SwShellTableCrsr::FillRects()
SwNodeIndex aIdx( *pSttNd );
SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, sal_True, sal_False );
- // TABLE IN TABLE
+ // table in table
// (see also lcl_FindTopLevelTable in unoobj2.cxx for a different
// version to do this)
const SwTableNode* pCurTblNd = pCNd->FindTableNode();
@@ -692,8 +687,7 @@ void SwShellTableCrsr::FillRects()
// Check if the SPoint is within the Table-SSelection.
sal_Bool SwShellTableCrsr::IsInside( const Point& rPt ) const
{
- // Calculate the new rectangles.
- // JP 16.01.98: If the cursor is still "parked" do nothing!!
+ // Calculate the new rectangles. If the cursor is still "parked" do nothing
if( !aSelBoxes.Count() || bParked ||
!GetPoint()->nNode.GetIndex() )
return sal_False;
commit e7540edefe1cf5b7f52ddb9b7b4824479da9234b
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Mon Jul 9 02:46:07 2012 +0200
fdo#39468: translate German comments (=> sw/source/core/crsr)
(removed some old internal StarDivision bug-refs)
Conflicts:
sw/source/core/crsr/findtxt.cxx
sw/source/core/crsr/pam.cxx
Change-Id: Ib88500bf3cae5f6d8cfccd50769c27819999c5fe
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index e2101b5..66c0b26 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -235,7 +235,7 @@ SwCallLink::~SwCallLink()
0 != ( pFlyFrm = pFrm->FindFlyFrm() ) && !rShell.IsTableMode() )
{
const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx();
- OSL_ENSURE( pIndex, "Fly ohne Cntnt" );
+ OSL_ENSURE( pIndex, "Fly without Cntnt" );
if (!pIndex)
return;
diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index d1dfe8f..08b80ae 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -111,7 +111,7 @@ namespace
EndAction();
return pMark;
}
-// setzt CurCrsr.SPoint
+// set CurCrsr.SPoint
bool SwCrsrShell::GotoMark(const ::sw::mark::IMark* const pMark, bool bAtStart)
{
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 246ad75..7e4056e 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -354,7 +354,7 @@ sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMo
if( IsTableMode() )
return bLeft ? GoPrevCell() : GoNextCell();
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
sal_Bool bRet = sal_False;
// #i27615# Handle cursor in front of label.
@@ -461,7 +461,7 @@ void SwCrsrShell::UpdateMarkedListLevel()
sal_Bool SwCrsrShell::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
{
SET_CURR_SHELL( this );
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
sal_Bool bTableMode = IsTableMode();
SwShellCrsr* pTmpCrsr = getShellCrsr( true );
@@ -475,7 +475,7 @@ sal_Bool SwCrsrShell::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
if( bRet )
{
- eMvState = MV_UPDOWN; // Status fuers Crsr-Travelling - GetCrsrOfst
+ eMvState = MV_UPDOWN; // status for Crsr travelling - GetCrsrOfst
if( !ActionPend() )
{
CrsrFlag eUpdtMode = SwCrsrShell::SCROLLWIN;
@@ -488,12 +488,11 @@ sal_Bool SwCrsrShell::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
return bRet;
}
-
sal_Bool SwCrsrShell::LRMargin( sal_Bool bLeft, sal_Bool bAPI)
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SET_CURR_SHELL( this );
- eMvState = MV_LEFTMARGIN; // Status fuers Crsr-Travelling - GetCrsrOfst
+ eMvState = MV_LEFTMARGIN; // status for Crsr travelling - GetCrsrOfst
const sal_Bool bTableMode = IsTableMode();
SwShellCrsr* pTmpCrsr = getShellCrsr( true );
@@ -533,14 +532,14 @@ sal_Bool SwCrsrShell::IsAtLRMargin( sal_Bool bLeft, sal_Bool bAPI ) const
sal_Bool SwCrsrShell::SttEndDoc( sal_Bool bStt )
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SwShellCrsr* pTmpCrsr = pBlockCrsr ? &pBlockCrsr->getShellCrsr() : pCurCrsr;
sal_Bool bRet = pTmpCrsr->SttEndDoc( bStt );
if( bRet )
{
if( bStt )
- pTmpCrsr->GetPtPos().Y() = 0; // expl. 0 setzen (TabellenHeader)
+ pTmpCrsr->GetPtPos().Y() = 0; // set to 0 explicitly (table header)
if( pBlockCrsr )
{
pBlockCrsr->clearPoints();
@@ -568,10 +567,10 @@ sal_Bool SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
{
sal_Bool bRet = sal_False;
- // Springe beim Selektieren nie ueber Section-Grenzen !!
+ // never jump of section borders at selection
if( !pCurCrsr->HasMark() || !pCurCrsr->IsNoCntnt() )
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SET_CURR_SHELL( this );
SwCrsrSaveState aSaveState( *pCurCrsr );
@@ -592,7 +591,7 @@ sal_Bool SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
sal_Bool SwCrsrShell::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SwCursor* pTmpCrsr = getShellCrsr( true );
sal_Bool bRet = pTmpCrsr->MovePara( fnWhichPara, fnPosPara );
if( bRet )
@@ -614,7 +613,7 @@ sal_Bool SwCrsrShell::MoveSection( SwWhichSection fnWhichSect,
}
-// Positionieren des Cursors
+// position cursor
SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt )
@@ -678,12 +677,11 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
if( MV_RIGHTMARGIN == aTmpState.eState )
eMvState = MV_RIGHTMARGIN;
- // steht neu Pos im Header/Footer ?
+ // is the new position in header or footer?
SwFrm* pFrm = lcl_IsInHeaderFooter( aPos.nNode, aPt );
if( IsTableMode() && !pFrm && aPos.nNode.GetNode().StartOfSectionNode() ==
pCrsr->GetPoint()->nNode.GetNode().StartOfSectionNode() )
- // gleiche Tabellenzelle und nicht im Header/Footer
- // -> zurueck
+ // same table column and not in header/footer -> back
return bRet;
// Toggle the Header/Footer mode if needed
@@ -701,8 +699,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
}
if( !pCrsr->HasMark() )
{
- // steht an der gleichen Position und wenn im Header/Footer,
- // dann im gleichen
+ // is at the same position and if in header/footer -> in the same
if( aPos == *pCrsr->GetPoint() &&
bOldInFrontOfLabel == bNewInFrontOfLabel )
{
@@ -713,7 +710,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
}
else if( aPos.nNode.GetNode().IsCntntNode() )
{
- // im gleichen Frame gelandet?
+ // in the same frame?
SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm(
GetLayout(), &aCharRect.Pos(), 0, sal_False );
SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm(
@@ -725,18 +722,17 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
}
else
{
- // SSelection ueber nicht erlaubte Sections oder wenn im Header/Footer
- // dann in verschiedene
+ // SSelection over not allowed sections or if in header/footer -> different
if( !CheckNodesRange( aPos.nNode, pCrsr->GetMark()->nNode, sal_True )
|| ( pFrm && !pFrm->Frm().IsInside( pCrsr->GetMkPos() ) ))
return bRet;
- // steht an der gleichen Position und nicht im Header/Footer
+ // is at same position but not in header/footer
if( aPos == *pCrsr->GetPoint() )
return bRet;
}
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SwCrsrSaveState aSaveState( *pCrsr );
*pCrsr->GetPoint() = aPos;
@@ -758,7 +754,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
{
if( FindValidCntntNode( bOnlyText ) )
{
- // Cursor in einen gueltigen Content stellen
+ // position cursor in a valid content
if( aPos == *pCrsr->GetPoint() )
bRet = CRSR_POSOLD;
else
@@ -769,14 +765,14 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
}
else
{
- // es gibt keinen gueltigen Inhalt -> Cursor verstecken
- pVisCrsr->Hide(); // sichtbaren Cursor immer verstecken
- eMvState = MV_NONE; // Status fuers Crsr-Travelling
+ // there is no valid content -> hide cursor
+ pVisCrsr->Hide(); // always hide visible cursor
+ eMvState = MV_NONE; // status for Crsr travelling
bAllProtect = sal_True;
if( GetDoc()->GetDocShell() )
{
GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True );
- CallChgLnk(); // UI bescheid sagen!
+ CallChgLnk(); // notify UI
}
}
}
@@ -828,7 +824,7 @@ void SwCrsrShell::CrsrToBlockCrsr()
void SwCrsrShell::ClearMark()
{
- // ist ueberhaupt ein GetMark gesetzt ?
+ // is there any GetMark?
if( pTblCrsr )
{
while( pCurCrsr->GetNext() != pCurCrsr )
@@ -837,9 +833,8 @@ void SwCrsrShell::ClearMark()
if( pCurCrsr->HasMark() )
{
- // falls doch nicht alle Indizies richtig verschoben werden
- // (z.B.: Kopf-/Fusszeile loeschen) den Content-Anteil vom
- // Mark aufs Nodes-Array setzen
+ // move content part from mark to nodes array if not all indices
+ // were moved correctly (e.g. when deleting header/footer)
SwPosition& rPos = *pCurCrsr->GetMark();
rPos.nNode.Assign( pDoc->GetNodes(), 0 );
rPos.nContent.Assign( 0, 0 );
@@ -855,9 +850,8 @@ void SwCrsrShell::ClearMark()
{
if( !pCurCrsr->HasMark() )
return;
- // falls doch nicht alle Indizies richtig verschoben werden
- // (z.B.: Kopf-/Fusszeile loeschen) den Content-Anteil vom
- // Mark aufs Nodes-Array setzen
+ // move content part from mark to nodes array if not all indices
+ // were moved correctly (e.g. when deleting header/footer)
SwPosition& rPos = *pCurCrsr->GetMark();
rPos.nNode.Assign( pDoc->GetNodes(), 0 );
rPos.nContent.Assign( 0, 0 );
@@ -870,35 +864,38 @@ void SwCrsrShell::ClearMark()
void SwCrsrShell::NormalizePam(sal_Bool bPointFirst)
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
pCurCrsr->Normalize(bPointFirst);
}
void SwCrsrShell::SwapPam()
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
pCurCrsr->Exchange();
}
+//TODO: provide documentation
+/** Search in the selected area for a Selection that covers the given point.
-// suche innerhalb der Selektierten-Bereiche nach einer Selektion, die
-// den angebenen SPoint umschliesst
-// Ist das Flag bTstOnly gesetzt, dann wird nur getestet, ob dort eine
-// SSelection besteht; des akt. Cursr wird nicht umgesetzt!
-// Ansonsten wird er auf die gewaehlte SSelection gesetzt.
-
+ If only a test run is made, then it checks if a SSelection exists but does
+ not move the current cursor. In a normal run the cursor will be moved to the
+ chosen SSelection.
+ @param rPt The point to search at.
+ @param bTstOnly Should I only do a test run? If true so do not move cursor.
+ @param bTstHit ???
+*/
sal_Bool SwCrsrShell::ChgCurrPam( const Point & rPt,
sal_Bool bTstOnly, sal_Bool bTstHit )
{
SET_CURR_SHELL( this );
- // Pruefe ob der SPoint in einer Tabellen-Selektion liegt
+ // check if the SPoint is in a table selection
if( bTstOnly && pTblCrsr )
return pTblCrsr->IsInside( rPt );
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
- // Suche die Position rPt im Dokument
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
+ // search position <rPt> in document
SwPosition aPtPos( *pCurCrsr->GetPoint() );
Point aPt( rPt );
@@ -907,17 +904,17 @@ sal_Bool SwCrsrShell::ChgCurrPam( const Point & rPt,
if ( !GetLayout()->GetCrsrOfst( &aPtPos, aPt, &aTmpState ) && bTstHit )
return sal_False;
- // suche in allen Selektionen nach dieser Position
- SwShellCrsr* pCmp = (SwShellCrsr*)pCurCrsr; // sicher den Pointer auf Cursor
+ // search in all selections for this position
+ SwShellCrsr* pCmp = (SwShellCrsr*)pCurCrsr; // keep the pointer on cursor
do {
if( pCmp->HasMark() &&
*pCmp->Start() <= aPtPos && *pCmp->End() > aPtPos )
{
- if( bTstOnly || pCurCrsr == pCmp ) // ist der aktuelle.
- return sal_True; // return ohne Update
+ if( bTstOnly || pCurCrsr == pCmp ) // is the current
+ return sal_True; // return without update
pCurCrsr = pCmp;
- UpdateCrsr(); // Cursor steht schon richtig
+ UpdateCrsr(); // cursor is already at the right position
return sal_True;
}
} while( pCurCrsr !=
@@ -928,7 +925,7 @@ sal_Bool SwCrsrShell::ChgCurrPam( const Point & rPt,
void SwCrsrShell::KillPams()
{
- // keiner zum loeschen vorhanden?
+ // Does any exist for deletion?
if( !pTblCrsr && !pBlockCrsr && pCurCrsr->GetNext() == pCurCrsr )
return;
@@ -938,7 +935,7 @@ void SwCrsrShell::KillPams()
if( pTblCrsr )
{
- // Cursor Ring loeschen
+ // delete the ring of cursors
pCurCrsr->DeleteMark();
*pCurCrsr->GetPoint() = *pTblCrsr->GetPoint();
pCurCrsr->GetPtPos() = pTblCrsr->GetPtPos();
@@ -1033,7 +1030,7 @@ bool SwCrsrShell::SetInFrontOfLabel( sal_Bool bNew )
sal_Bool SwCrsrShell::GotoPage( sal_uInt16 nPage )
{
SET_CURR_SHELL( this );
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SwCrsrSaveState aSaveState( *pCurCrsr );
sal_Bool bRet = GetLayout()->SetCurrPage( pCurCrsr, nPage ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
@@ -1048,7 +1045,7 @@ void SwCrsrShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum,
sal_Bool bAtCrsrPos, const sal_Bool bCalcFrm )
{
SET_CURR_SHELL( this );
- // Seitennummer: die erste sichtbare Seite oder die am Cursor
+ // page number: first visible page or the one at the cursor
const SwCntntFrm* pCFrm;
const SwPageFrm *pPg = 0;
@@ -1059,8 +1056,7 @@ void SwCrsrShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum,
while( pPg && pPg->IsEmptyPage() )
pPg = (const SwPageFrm *)pPg->GetNext();
}
- // Abfrage auf pPg muss fuer den Sonderfall Writerstart mit
- // standard.vor sein.
+ // pPg has to exist with a default of 1 for the special case "Writerstart"
rnPhyNum = pPg? pPg->GetPhyPageNum() : 1;
rnVirtNum = pPg? pPg->GetVirtPageNum() : 1;
}
@@ -1070,7 +1066,7 @@ sal_uInt16 SwCrsrShell::GetNextPrevPageNum( sal_Bool bNext )
{
SET_CURR_SHELL( this );
- // Seitennummer: die erste sichtbare Seite oder die am Cursor
+ // page number: first visible page or the one at the cursor
const SwPageFrm *pPg = Imp()->GetFirstVisPage();
if( pPg )
{
@@ -1101,8 +1097,7 @@ sal_uInt16 SwCrsrShell::GetNextPrevPageNum( sal_Bool bNext )
pPg = (const SwPageFrm *)pPg->GetPrev();
}
}
- // Abfrage auf pPg muss fuer den Sonderfall Writerstart mit
- // standard.vor sein.
+ // pPg has to exist with a default of 1 for the special case "Writerstart"
return pPg ? pPg->GetPhyPageNum() : USHRT_MAX;
}
@@ -1110,24 +1105,22 @@ sal_uInt16 SwCrsrShell::GetNextPrevPageNum( sal_Bool bNext )
sal_uInt16 SwCrsrShell::GetPageCnt()
{
SET_CURR_SHELL( this );
- // gebe die Anzahl der Seiten zurueck
+ // return number of pages
return GetLayout()->GetPageNum();
}
-// Gehe zur naechsten SSelection
-
-
+/// go to the next SSelection
sal_Bool SwCrsrShell::GoNextCrsr()
{
- // besteht ueberhaupt ein Ring ?
+ // is there a ring of cursors?
if( pCurCrsr->GetNext() == pCurCrsr )
return sal_False;
SET_CURR_SHELL( this );
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
pCurCrsr = dynamic_cast<SwShellCrsr*>(pCurCrsr->GetNext());
- // Bug 24086: auch alle anderen anzeigen
+ // #i24086#: show also all others
if( !ActionPend() )
{
UpdateCrsr();
@@ -1136,20 +1129,18 @@ sal_Bool SwCrsrShell::GoNextCrsr()
return sal_True;
}
-// gehe zur vorherigen SSelection
-
-
+/// go to the previous SSelection
sal_Bool SwCrsrShell::GoPrevCrsr()
{
- // besteht ueberhaupt ein Ring ?
+ // is there a ring of cursors?
if( pCurCrsr->GetNext() == pCurCrsr )
return sal_False;
SET_CURR_SHELL( this );
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
pCurCrsr = dynamic_cast<SwShellCrsr*>(pCurCrsr->GetPrev());
- // Bug 24086: auch alle anderen anzeigen
+ // #i24086#: show also all others
if( !ActionPend() )
{
UpdateCrsr();
@@ -1164,18 +1155,18 @@ void SwCrsrShell::Paint( const Rectangle &rRect)
{
SET_CURR_SHELL( this );
- // beim Painten immer alle Cursor ausschalten
+ // always switch off all cursors when painting
SwRect aRect( rRect );
sal_Bool bVis = sal_False;
- // ist Cursor sichtbar, dann verstecke den SV-Cursor
- if( pVisCrsr->IsVisible() && !aRect.IsOver( aCharRect ) ) //JP 18.06.97: ???
+ // if a cursor is visible then hide the SV cursor
+ if( pVisCrsr->IsVisible() && !aRect.IsOver( aCharRect ) )
{
bVis = sal_True;
pVisCrsr->Hide();
}
- // Bereich neu painten
+ // re-paint area
ViewShell::Paint( rRect );
if( bHasFocus && !bBasicHideCrsr )
@@ -1184,7 +1175,7 @@ void SwCrsrShell::Paint( const Rectangle &rRect)
if( !ActionPend() )
{
- // damit nicht rechts/unten die Raender abgeschnitten werden
+ // so that right/bottom borders will not be cropped
pAktCrsr->Invalidate( VisArea() );
pAktCrsr->Show();
}
@@ -1192,7 +1183,7 @@ void SwCrsrShell::Paint( const Rectangle &rRect)
pAktCrsr->Invalidate( aRect );
}
- if( bSVCrsrVis && bVis ) // auch SV-Cursor wieder anzeigen
+ if( bSVCrsrVis && bVis ) // also show SV cursor again
pVisCrsr->Show();
}
@@ -1201,9 +1192,9 @@ void SwCrsrShell::Paint( const Rectangle &rRect)
void SwCrsrShell::VisPortChgd( const SwRect & rRect )
{
SET_CURR_SHELL( this );
- sal_Bool bVis; // beim Scrollen immer alle Cursor ausschalten
+ sal_Bool bVis; // switch off all cursors when scrolling
- // ist Cursor sichtbar, dann verstecke den SV-Cursor
+ // if a cursor is visible then hide the SV cursor
if( sal_True == ( bVis = pVisCrsr->IsVisible() ))
pVisCrsr->Hide();
@@ -1211,13 +1202,12 @@ void SwCrsrShell::VisPortChgd( const SwRect & rRect )
aOldRBPos.X() = VisArea().Right();
aOldRBPos.Y() = VisArea().Bottom();
- //Damit es es keine Probleme mit dem SV-Cursor gibt, wird in
- //ViewShell::VisPo.. ein Update() auf das Window gerufen.
- //Waehrend des Paintens duerfen aber nun wieder keine Selectionen
- //angezeigt werden, deshalb wird der Aufruf hier geklammert.
- ViewShell::VisPortChgd( rRect ); // Bereich verschieben
+ // For not having problems with the SV cursor, Update() is called for the
+ // Window in ViewShell::VisPo...
+ // During painting no selections should be shown, thus the call is encapsulated. <- TODO: old artefact?
+ ViewShell::VisPortChgd( rRect ); // move area
- if( bSVCrsrVis && bVis ) // auch SV-Cursor wieder anzeigen
+ if( bSVCrsrVis && bVis ) // show SV cursor again
pVisCrsr->Show();
if( nCrsrMove )
@@ -1226,12 +1216,12 @@ void SwCrsrShell::VisPortChgd( const SwRect & rRect )
bVisPortChgd = sal_False;
}
-// aktualisiere den Crsrs, d.H. setze ihn wieder in den Content.
-// Das sollte nur aufgerufen werden, wenn der Cursor z.B. beim
-// Loeschen von Rahmen irgendwohin gesetzt wurde. Die Position
-// ergibt sich aus seiner aktuellen Position im Layout !!
-
+/** Set the cursor back into content.
+ This should only be called if the cursor was move somewhere else (e.g. when
+ deleting a border). The new position is calculated from its current position
+ in the layout.
+*/
void SwCrsrShell::UpdateCrsrPos()
{
SET_CURR_SHELL( this );
@@ -1258,8 +1248,7 @@ void SwCrsrShell::UpdateCrsrPos()
SizeChgNotify();
}
-// JP 30.04.99: Bug 65475 - falls Point/Mark in versteckten Bereichen
-// stehen, so mussen diese daraus verschoben werden
+// #i65475# - if Point/Mark in hidden sections, move them out
static void lcl_CheckHiddenSection( SwNodeIndex& rIdx )
{
const SwSectionNode* pSectNd = rIdx.GetNode().FindSectionNode();
@@ -1320,7 +1309,7 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
{
if ( eFlags & SwCrsrShell::READONLY )
bIgnoreReadonly = sal_True;
- return; // wenn nicht, dann kein Update !!
+ return; // if not then no update
}
sal_Bool bInHeader= sal_True;
@@ -1711,12 +1700,12 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
if( !bFirst && aOld == aCharRect )
break;
- // falls das Layout meint, nach dem 100 durchlauf ist man immer noch
- // im Fluss, sollte man die akt. Pos. als gegeben hinnehmen!
- // siehe Bug: 29658
+ // if the layout says that we are after the 100th iteration still in
+ // flow then we should always take the current position for granted.
+ // (see bug: 29658)
if( !--nLoopCnt )
{
- OSL_ENSURE( !this, "Endlosschleife? CharRect != OldCharRect ");
+ OSL_ENSURE( !this, "endless loop? CharRect != OldCharRect ");
break;
}
aOld = aCharRect;
@@ -1739,8 +1728,8 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
(HasSelection() || eFlags & SwCrsrShell::READONLY ||
!IsCrsrReadonly() || GetViewOptions()->IsSelectionInReadonly()) )
{
- //JP 30.04.99: so that EndAction, in case of scrolling, doesn't
- // show the SV-Cursor again, save and reset the flag here
+ // in case of scrolling this EndAction doesn't show the SV cursor
+ // again, thus save and reset the flag here
sal_Bool bSav = bSVCrsrVis; bSVCrsrVis = sal_False;
MakeSelVisible();
bSVCrsrVis = bSav;
@@ -1909,9 +1898,7 @@ void SwCrsrShell::RefreshBlockCursor()
}
}
-// erzeuge eine Kopie vom Cursor und speicher diese im Stack
-
-
+/// create a copy of the cursor and save it in the stack
void SwCrsrShell::Push()
{
pCrsrStk = new SwShellCrsr( *this, *pCurCrsr->GetPoint(),
@@ -1924,45 +1911,42 @@ void SwCrsrShell::Push()
}
}
-/*
- * Loescht einen Cursor (gesteuert durch bOldCrsr)
- * - vom Stack oder ( bOldCrsr = sal_True )
- * - den aktuellen und der auf dem Stack stehende wird zum aktuellen
- *
- * Return: es war auf dem Stack noch einer vorhanden
- */
-
+/** delete cursor
+ @param bOldCrsr If <true> so delete from stack, if <false> delete current
+ and assign the one from stack as the new current cursor.
+ @return <true> if there was one on the stack, <false> otherwise
+*/
sal_Bool SwCrsrShell::Pop( sal_Bool bOldCrsr )
{
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
- // noch weitere vorhanden ?
+ // are there any left?
if( 0 == pCrsrStk )
return sal_False;
SwShellCrsr *pTmp = 0, *pOldStk = pCrsrStk;
- // der Nachfolger wird der Aktuelle
+ // the successor becomes the current one
if( pCrsrStk->GetNext() != pCrsrStk )
{
pTmp = dynamic_cast<SwShellCrsr*>(pCrsrStk->GetNext());
}
- if( bOldCrsr ) // loesche vom Stack
- delete pCrsrStk; //
+ if( bOldCrsr ) // delete from stack
+ delete pCrsrStk;
- pCrsrStk = pTmp; // neu zuweisen
+ pCrsrStk = pTmp; // assign new one
if( !bOldCrsr )
{
SwCrsrSaveState aSaveState( *pCurCrsr );
- // wurde die sichtbare SSelection nicht veraendert
+ // If the visible SSelection was not changed
if( pOldStk->GetPtPos() == pCurCrsr->GetPtPos() ||
pOldStk->GetPtPos() == pCurCrsr->GetMkPos() )
{
- // "Selektions-Rechtecke" verschieben
+ // move "Selections Rectangles"
pCurCrsr->Insert( pOldStk, 0 );
pOldStk->Remove( 0, pOldStk->Count() );
}
@@ -1974,7 +1958,7 @@ sal_Bool SwCrsrShell::Pop( sal_Bool bOldCrsr )
pCurCrsr->GetMkPos() = pOldStk->GetMkPos();
}
else
- // keine Selection also alte aufheben und auf die alte Pos setzen
+ // no selection so revoke old one and set to old position
pCurCrsr->DeleteMark();
*pCurCrsr->GetPoint() = *pOldStk->GetPoint();
pCurCrsr->GetPtPos() = pOldStk->GetPtPos();
@@ -1983,32 +1967,30 @@ sal_Bool SwCrsrShell::Pop( sal_Bool bOldCrsr )
if( !pCurCrsr->IsInProtectTable( sal_True ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
- UpdateCrsr(); // akt. Cursor Updaten
+ UpdateCrsr(); // update current cursor
}
return sal_True;
}
-/*
- * Verbinde zwei Cursor miteinander.
- * Loesche vom Stack den obersten und setzen dessen GetMark im Aktuellen.
- */
-
+/** Combine two cursors
+ Delete topmost from stack and use its GetMark in the current.
+*/
void SwCrsrShell::Combine()
{
- // noch weitere vorhanden ?
+ // any others left?
if( 0 == pCrsrStk )
return;
- SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
+ SwCallLink aLk( *this ); // watch Crsr-Moves; call Link if needed
SwCrsrSaveState aSaveState( *pCurCrsr );
- if( pCrsrStk->HasMark() ) // nur wenn GetMark gesetzt wurde
+ if( pCrsrStk->HasMark() ) // only if GetMark was set
{
bool const bResult =
CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True );
- OSL_ENSURE(bResult, "StackCrsr & act. Crsr not in same Section.");
+ OSL_ENSURE(bResult, "StackCrsr & current Crsr not in same Section.");
(void) bResult; // non-debug: unused
- // kopiere das GetMark
+ // copy GetMark
if( !pCurCrsr->HasMark() )
pCurCrsr->SetMark();
*pCurCrsr->GetMark() = *pCrsrStk->GetMark();
@@ -2025,7 +2007,7 @@ void SwCrsrShell::Combine()
if( !pCurCrsr->IsInProtectTable( sal_True ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
- UpdateCrsr(); // akt. Cursor Updaten
+ UpdateCrsr(); // update current cursor
}
@@ -2034,13 +2016,13 @@ void SwCrsrShell::HideCrsrs()
if( !bHasFocus || bBasicHideCrsr )
return;
- // ist Cursor sichtbar, dann verstecke den SV-Cursor
+ // if cursor is visible then hide SV cursor
if( pVisCrsr->IsVisible() )
{
SET_CURR_SHELL( this );
pVisCrsr->Hide();
}
- // hebe die Invertierung der SSelection auf
+ // revoke inversion of SSelection
SwShellCrsr* pAktCrsr = pTblCrsr ? pTblCrsr : pCurCrsr;
pAktCrsr->Hide();
}
@@ -2056,11 +2038,10 @@ void SwCrsrShell::ShowCrsrs( sal_Bool bCrsrVis )
SwShellCrsr* pAktCrsr = pTblCrsr ? pTblCrsr : pCurCrsr;
pAktCrsr->Show();
- if( bSVCrsrVis && bCrsrVis ) // auch SV-Cursor wieder anzeigen
+ if( bSVCrsrVis && bCrsrVis ) // also show SV cursor again
pVisCrsr->Show();
}
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list