[Libreoffice-commits] .: 2 commits - sw/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Tue Jan 10 02:52:39 PST 2012
sw/source/core/doc/docnew.cxx | 173 ++++++++++++++++++------------------
sw/source/core/doc/docnum.cxx | 198 ++++++++++++++++++++----------------------
2 files changed, 183 insertions(+), 188 deletions(-)
New commits:
commit d93196c815c77e9612423ceb81d4b39b79407e35
Author: Philipp Weissenbacher <Philipp Weissenbacher>
Date: Sun Jan 8 22:38:04 2012 +0100
Translate German comments and correct a few English ones
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index d5a609a..baa798d 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -120,8 +120,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
// assure that the outline numbering rule is an automatic rule
pOutlineRule->SetAutoRule( sal_True );
- // teste ob die evt. gesetzen CharFormate in diesem Document
- // definiert sind
+ // test whether the optional CharFormats are defined in this Document
pOutlineRule->CheckCharFmts( this );
// notify text nodes, which are registered at the outline style, about the
@@ -146,7 +145,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
pOutlineRule->SetInvalidRule(sal_True);
UpdateNumRule();
- // gibt es Fussnoten && gilt Kapitelweises Nummerieren, dann updaten
+ // update if we have foot notes && chapter-wise numbering
if( GetFtnIdxs().Count() && FTNNUM_CHAPTER == GetFtnInfo().eNum )
GetFtnIdxs().UpdateAllFtn();
@@ -182,13 +181,13 @@ void SwDoc::PropagateOutlineRule()
}
}
-// Hoch-/Runterstufen
+// Increase/Decrease
sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
{
if( !GetNodes().GetOutLineNds().Count() || !nOffset )
return sal_False;
- // den Bereich feststellen
+ // calculate the area
const SwOutlineNodes& rOutlNds = GetNodes().GetOutLineNds();
const SwNodePtr pSttNd = (SwNodePtr)&rPam.Start()->nNode.GetNode();
const SwNodePtr pEndNd = (SwNodePtr)&rPam.End()->nNode.GetNode();
@@ -196,19 +195,19 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
if( !rOutlNds.Seek_Entry( pSttNd, &nSttPos ) &&
!nSttPos-- )
- // wir stehen in keiner "Outline-Section"
+ // we're not in an "Outline section"
return sal_False;
if( rOutlNds.Seek_Entry( pEndNd, &nEndPos ) )
++nEndPos;
- // jetzt haben wir unseren Bereich im OutlineNodes-Array
- // dann prufe ersmal, ob nicht unterebenen aufgehoben werden
- // (Stufung ueber die Grenzen)
+ // We now have the wanted area in the OutlineNodes array,
+ // so check now if we're not invalidating sublevels
+ // (stepping over the limits)
sal_uInt16 n;
- // so, dann koennen wir:
- // 1. Vorlagen-Array anlegen
+ // Here we go:
+ // 1. Create the Template array:
SwTxtFmtColl* aCollArr[ MAXLEVEL ];
memset( aCollArr, 0, sizeof( SwTxtFmtColl* ) * MAXLEVEL );
@@ -282,13 +281,11 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
/* --> #i13747#
- Build a move table that states from which level an outline will
+ Build a move table that states from which level to which other level
+ an outline will be moved.
- be moved to which other level. */
-
- /* the move table
-
- aMoveArr[n] = m: replace aCollArr[n] with aCollArr[m]
+ the move table:
+ aMoveArr[n] = m: replace aCollArr[n] with aCollArr[m]
*/
int aMoveArr[MAXLEVEL];
int nStep; // step size for searching in aCollArr: -1 or 1
@@ -380,7 +377,7 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
GetIDocumentUndoRedo().AppendUndo(pUndoOLR);
}
- // 2. allen Nodes die neue Vorlage zuweisen
+ // 2. Apply the new Template to all Nodes
n = nSttPos;
while( n < nEndPos)
@@ -427,10 +424,10 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset )
return sal_True;
}
-// Hoch-/Runter - Verschieben !
+// Move up/down
sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
{
- // kein Verschiebung in den Sonderbereichen
+ // Do not move to special areas
const SwPosition& rStt = *rPam.Start(),
& rEnd = &rStt == rPam.GetPoint() ? *rPam.GetMark()
: *rPam.GetPoint();
@@ -564,12 +561,12 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
return sal_False;
OSL_ENSURE( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.GetIndex(),
- "Position liegt im MoveBereich" );
+ "Position lies within MoveArea" );
- // wurde ein Position in den Sonderbereichen errechnet, dann
- // setze die Position auf den Dokumentanfang.
- // Sollten da Bereiche oder Tabellen stehen, so werden sie nach
- // hinten verschoben.
+ // If a Position was calculated for the special area, we set it
+ // to document start instead.
+ // Areas or Tables at the document start will be moved to the
+ // back.
nNewPos = Max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 );
long nOffs = nNewPos - ( 0 < nOffset ? aEndRg.GetIndex() : aSttRg.GetIndex());
@@ -588,14 +585,14 @@ sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
String sTxt( pTxtNd->GetExpandTxt() );
if( sTxt.Equals( rName ) )
{
- // "exact" gefunden, setze Pos auf den Node
+ // Found "exact", set Pos to the Node
nSavePos = n;
break;
}
else if( !bExact && USHRT_MAX == nSavePos &&
COMPARE_EQUAL == sTxt.CompareTo( rName, rName.Len()) )
{
- // dann vielleicht nur den den 1.Teil vom Text gefunden
+ // maybe we just found the text's first part
nSavePos = n;
}
}
@@ -605,16 +602,16 @@ sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
{
- // Gueltig Nummern sind (immer nur Offsets!!!):
- // ([Nummer]+\.)+ (als regulaerer Ausdruck!)
- // (Nummer gefolgt von Punkt, zum 5 Wiederholungen)
- // also: "1.1.", "1.", "1.1.1."
+ // Valid numbers are (always just offsets!):
+ // ([Number]+\.)+ (as a regular expression!)
+ // (Number follwed by a period, with 5 repetitions)
+ // i.e.: "1.1.", "1.", "1.1.1."
xub_StrLen nPos = 0;
String sNum = rName.GetToken( 0, '.', nPos );
if( STRING_NOTFOUND == nPos )
- return USHRT_MAX; // ungueltige Nummer!!!
+ return USHRT_MAX; // invalid number!
- sal_uInt16 nLevelVal[ MAXLEVEL ]; // Nummern aller Levels
+ sal_uInt16 nLevelVal[ MAXLEVEL ]; // numbers of all levels
memset( nLevelVal, 0, MAXLEVEL * sizeof( nLevelVal[0] ));
sal_uInt8 nLevel = 0;
String sName( rName );
@@ -629,9 +626,9 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
nVal *= 10; nVal += c - '0';
}
else if( nLevel )
- break; // "fast" gueltige Nummer
+ break; // "almost" valid number
else
- return USHRT_MAX; // ungueltige Nummer!!!
+ return USHRT_MAX; // invalid number!
if( MAXLEVEL > nLevel )
nLevelVal[ nLevel++ ] = nVal;
@@ -643,18 +640,17 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
if(!comphelper::string::isdigitAsciiString(sNum))
nPos = STRING_NOTFOUND;
}
- rName = sName; // das ist der nachfolgende Text.
+ rName = sName; // that's the follow-up text
- // alle Levels gelesen, dann suche mal im Document nach dieser
- // Gliederung:
+ // read all levels, so search the document for this outline
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
- // OS: ohne OutlineNodes lohnt die Suche nicht
- // und man spart sich einen Absturz
+ // Without OutlineNodes searching doesn't pay off
+ // and we save a crash
if(!rOutlNds.Count())
return USHRT_MAX;
SwTxtNode* pNd;
nPos = 0;
- //search in the existing outline nodes for the required outline num array
+ // search in the existing outline nodes for the required outline num array
for( ; nPos < rOutlNds.Count(); ++nPos )
{
pNd = rOutlNds[ nPos ]->GetTxtNode();
@@ -669,7 +665,7 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
{
const SwNodeNum & rNdNum = *(pNd->GetNum());
SwNumberTree::tNumberVector aLevelVal = rNdNum.GetNumberVector();
- //now compare with the one searched for
+ // now compare with the one searched for
bool bEqual = true;
for( sal_uInt8 n = 0; (n < nLevel) && bEqual; ++n )
{
@@ -696,23 +692,23 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
return nPos;
}
-// zu diesem Gliederungspunkt
+// Ad this bullet point:
-// JP 13.06.96:
-// im Namen kann eine Nummer oder/und der Text stehen.
-// zuerst wird ueber die Nummer versucht den richtigen Eintrag zu finden.
-// Gibt es diesen, dann wird ueber den Text verglichen, od es der
-// gewuenschte ist. Ist das nicht der Fall, wird noch mal nur ueber den
-// Text gesucht. Wird dieser gefunden ist es der Eintrag. Ansonsten der,
-// der ueber die Nummer gefunden wurde.
-// Ist keine Nummer angegeben, dann nur den Text suchen.
+// A Name can contain a Number and/or the Text.
+//
+// First, we try to find the correct Entry via the Number.
+// If it exists, we compare the Text, to see if it's the right one.
+// If that's not the case, we search again via the Text. If it is
+// found, we got the right entry. Or else we use the one found by
+// searching for the Number.
+// If we don't have a Number, we search via the Text only.
sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
{
if( rName.Len() )
{
const SwOutlineNodes& rOutlNds = GetNodes().GetOutLineNds();
- // 1. Schritt: ueber die Nummer:
+ // 1. step: via the Number:
String sName( rName );
sal_uInt16 nFndPos = ::lcl_FindOutlineNum( GetNodes(), sName );
if( USHRT_MAX != nFndPos )
@@ -735,7 +731,7 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
if( !sExpandedText.Equals( sName ) )
{
sal_uInt16 nTmp = ::lcl_FindOutlineName( GetNodes(), sName, sal_True );
- if( USHRT_MAX != nTmp ) // ueber den Namen gefunden
+ if( USHRT_MAX != nTmp ) // found via the Name
{
nFndPos = nTmp;
pNd = rOutlNds[ nFndPos ]->GetTxtNode();
@@ -774,7 +770,7 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const
void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
{
SwNumRule* pOld = rDoc.FindNumRulePtr( rRule.GetName() );
- OSL_ENSURE( pOld, "ohne die alte NumRule geht gar nichts" );
+ OSL_ENSURE( pOld, "we cannot proceed without the old NumRule" );
sal_uInt16 nChgFmtLevel = 0, nMask = 1;
sal_uInt8 n;
@@ -793,7 +789,7 @@ void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule )
nChgFmtLevel |= nMask;
}
- if( !nChgFmtLevel ) // es wurde nichts veraendert?
+ if( !nChgFmtLevel ) // Nothing has been changed?
{
const bool bInvalidateNumRule( pOld->IsContinusNum() != rRule.IsContinusNum() );
pOld->CheckCharFmts( &rDoc );
@@ -1017,7 +1013,7 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt )
}
}
-// loeschen geht nur, wenn die Rule niemand benutzt!
+// We can only delete if the Rule is unused!
sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
{
sal_uInt16 nPos = FindNumRule( rName );
@@ -1299,10 +1295,10 @@ sal_Bool SwDoc::NoNum( const SwPaM& rPam )
{
sal_Bool bRet = SplitNode( *rPam.GetPoint(), false );
- // ist ueberhaupt Nummerierung im Spiel ?
+ // Do we actually use Numbering at all?
if( bRet )
{
- // NoNum setzen und Upaten
+ // Set NoNum and Upate
const SwNodeIndex& rIdx = rPam.GetPoint()->nNode;
SwTxtNode* pNd = rIdx.GetNode().GetTxtNode();
const SwNumRule* pRule = pNd->GetNumRule();
@@ -1313,7 +1309,7 @@ sal_Bool SwDoc::NoNum( const SwPaM& rPam )
SetModified();
}
else
- bRet = sal_False; // keine Nummerierung , ?? oder immer sal_True ??
+ bRet = sal_False; // no Numbering or just always sal_True?
}
return bRet;
}
@@ -1376,7 +1372,7 @@ void SwDoc::DelNumRules( const SwPaM& rPam )
}
}
- // dann noch alle Updaten
+ // Finally, update all
UpdateNumRule();
if( pOutlNd )
@@ -1389,7 +1385,7 @@ void SwDoc::InvalidateNumRules()
(*pNumRuleTbl)[n]->SetInvalidRule(sal_True);
}
-// zum naechsten/vorhergehenden Punkt auf gleicher Ebene
+// To the next/preceding Bullet at the same Level
sal_Bool lcl_IsNumOk( sal_uInt8 nSrchNum, sal_uInt8& rLower, sal_uInt8& rUpper,
sal_Bool bOverUpper, sal_uInt8 nNumber )
{
@@ -1423,7 +1419,7 @@ sal_Bool lcl_IsValidPrevNextNumNode( const SwNodeIndex& rIdx )
bRet = SwTableBoxStartNode == ((SwStartNode&)rNd).GetStartNodeType();
break;
- case ND_SECTIONNODE: // der ist erlaubt, also weiter
+ case ND_SECTIONNODE: // that one's valid, so proceed
bRet = sal_True;
break;
}
@@ -1443,8 +1439,7 @@ sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext,
SwNodeIndex aIdx( rPos.nNode );
if( ! pNd->IsCountedInList() )
{
- // falls gerade mal NO_NUMLEVEL an ist, so such den vorherigen Node
- // mit Nummerierung
+ // If NO_NUMLEVEL is switched on, we search the preceding Node with Numbering
sal_Bool bError = sal_False;
do {
aIdx--;
@@ -1460,7 +1455,7 @@ sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext,
nTmpNum = static_cast<sal_uInt8>(pNd->GetActualListLevel());
if( !( ! pNd->IsCountedInList() &&
(nTmpNum >= nSrchNum )) )
- break; // gefunden
+ break; // found it!
}
else
bError = sal_True;
@@ -1514,7 +1509,7 @@ sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext,
aIdx--;
}
- if( !bRet && !bOverUpper && pLast ) // nicht ueber hoehere Nummmern, aber bis Ende
+ if( !bRet && !bOverUpper && pLast ) // do not iterate over higher numbers, but still to the end
{
if( bNext )
{
@@ -1779,7 +1774,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
}
else
{
- //Impossible to move to negative index
+ // Impossible to move to negative index
if( sal_uLong(abs( nOffset )) > nStIdx)
return sal_False;
@@ -1787,8 +1782,8 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
nStIdx += nOffset;
}
nInStIdx = nInEndIdx + 1;
- // Folgende Absatzbloecke sollen vertauscht werden:
- // [ nStIdx, nInEndIdx ] mit [ nInStIdx, nEndIdx ]
+ // The following paragraphs shall be swapped:
+ // Swap [ nStIdx, nInEndIdx ] with [ nInStIdx, nEndIdx ]
if( nEndIdx >= GetNodes().GetEndOfContent().GetIndex() )
return sal_False;
@@ -1825,8 +1820,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
return sal_False; // The "end" notes are in different sections
}
- // auf Redlining testen - darf die Selektion ueberhaupt verschoben
- // werden?
+ // Test for Redlining - Can the Selection be moved at all, actually?
if( !IsIgnoreRedline() )
{
sal_uInt16 nRedlPos = GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_DELETE );
@@ -1838,7 +1832,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
aEndPos.nContent = pCNd ? pCNd->Len() : 1;
sal_Bool bCheckDel = sal_True;
- // es existiert fuer den Bereich irgendein Redline-Delete-Object
+ // There is a some Redline Delete Object for the Area
for( ; nRedlPos < GetRedlineTbl().Count(); ++nRedlPos )
{
const SwRedline* pTmp = GetRedlineTbl()[ nRedlPos ];
@@ -1848,23 +1842,22 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
switch( ComparePosition( *pRStt, *pREnd, aStPos, aEndPos ))
{
case POS_COLLIDE_START:
- case POS_BEHIND: // Pos1 liegt hinter Pos2
+ case POS_BEHIND: // Pos1 comes after Pos2
nRedlPos = GetRedlineTbl().Count();
break;
case POS_COLLIDE_END:
- case POS_BEFORE: // Pos1 liegt vor Pos2
+ case POS_BEFORE: // Pos1 comes before Pos2
break;
- case POS_INSIDE: // Pos1 liegt vollstaendig in Pos2
- // ist erlaubt, aber checke dann alle nachfolgenden
- // auf Ueberlappungen
+ case POS_INSIDE: // Pos1 is completely inside Pos2
+ // that's valid, but check all following for overlapping
bCheckDel = sal_False;
break;
- case POS_OUTSIDE: // Pos2 liegt vollstaendig in Pos1
- case POS_EQUAL: // Pos1 ist genauso gross wie Pos2
- case POS_OVERLAP_BEFORE: // Pos1 ueberlappt Pos2 am Anfang
- case POS_OVERLAP_BEHIND: // Pos1 ueberlappt Pos2 am Ende
+ case POS_OUTSIDE: // Pos2 is completely inside Pos1
+ case POS_EQUAL: // Pos1 is as big as Pos2
+ case POS_OVERLAP_BEFORE: // Pos1 overlaps Pos2 in the beginning
+ case POS_OVERLAP_BEHIND: // Pos1 overlaps Pos2 at the end
return sal_False;
}
}
@@ -1873,9 +1866,10 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
}
{
- // DataChanged vorm verschieben verschicken, dann bekommt
- // man noch mit, welche Objecte sich im Bereich befinden.
- // Danach koennen sie vor/hinter der Position befinden.
+ // Send DataChanged before moving. We then can detect
+ // which objects are still in the Area.
+ // After the move they could come before/after the
+ // Position.
SwDataChanged aTmp( rPam, 0 );
}
@@ -1885,8 +1879,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
SwRedline* pOwnRedl = 0;
if( IsRedlineOn() )
{
- // wenn der Bereich komplett im eigenen Redline liegt, kann es
- // verschoben werden!
+ // If the Area is completely in the own Redline, we can move it!
sal_uInt16 nRedlPos = GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_INSERT );
if( USHRT_MAX != nRedlPos )
{
@@ -1894,7 +1887,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
const SwPosition *pRStt = pTmp->Start(), *pREnd = pTmp->End();
SwRedline aTmpRedl( nsRedlineType_t::REDLINE_INSERT, rPam );
const SwCntntNode* pCEndNd = pEnd->nNode.GetNode().GetCntntNode();
- // liegt komplett im Bereich, und ist auch der eigene Redline?
+ // Is completely in the Area and is the own Redline too?
if( aTmpRedl.IsOwnRedline( *pTmp ) &&
(pRStt->nNode < pStt->nNode ||
(pRStt->nNode == pStt->nNode && !pRStt->nContent.GetIndex()) ) &&
@@ -1908,14 +1901,14 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
{
pTmp = GetRedlineTbl()[ nRedlPos+1 ];
if( *pTmp->Start() == *pREnd )
- // dann doch nicht!
+ // then don't!
pOwnRedl = 0;
}
if( pOwnRedl &&
!( pRStt->nNode <= aIdx && aIdx <= pREnd->nNode ))
{
- // nicht in sich selbst, dann auch nicht moven
+ // it's not in itself, so don't move it
pOwnRedl = 0;
}
}
@@ -1925,7 +1918,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
{
GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
- // zuerst das Insert, dann das Loeschen
+ // First the Insert, then the Delete
SwPosition aInsPos( aIdx );
aInsPos.nContent.Assign( aIdx.GetNode().GetCntntNode(), 0 );
@@ -1965,14 +1958,14 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
CopyRange( aPam, aInsPos, false );
if( bDelLastPara )
{
- // dann muss der letzte leere Node wieder entfernt werden
+ // We need to remove the last empty Node again
aIdx = aInsPos.nNode;
SwCntntNode* pCNd = GetNodes().GoPrevious( &aInsPos.nNode );
xub_StrLen nCLen = 0; if( pCNd ) nCLen = pCNd->Len();
aInsPos.nContent.Assign( pCNd, nCLen );
- // alle die im zu loeschenden Node stehen, mussen auf den
- // naechsten umgestezt werden
+ // All, that are in the to-be-deleted Node, need to be
+ // moved to the next Node
SwPosition* pPos;
for( sal_uInt16 n = 0; n < GetRedlineTbl().Count(); ++n )
{
@@ -2000,7 +1993,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
checkRedlining(eOld);
if (GetIDocumentUndoRedo().DoesUndo())
{
- //JP 06.01.98: MUSS noch optimiert werden!!!
+ // Still NEEDS to be optimized (even after 14 years)
SetRedlineMode(
(RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE));
SwUndo *const pUndo(new SwUndoRedlineDelete(aPam, UNDO_DELETE));
@@ -2011,14 +2004,14 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl
// prevent assertion from aPam's target being deleted
// (Alternatively, one could just let aPam go out of scope, but
- // that requires touching a lot of code.)
+ // that requires touching a lot of code.)
aPam.GetBound(sal_True).nContent.Assign( NULL, 0 );
aPam.GetBound(sal_False).nContent.Assign( NULL, 0 );
AppendRedline( pNewRedline, true );
-//JP 06.01.98: MUSS noch optimiert werden!!!
-SetRedlineMode( eOld );
+ // Still NEEDS to be optimized!
+ SetRedlineMode( eOld );
GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
SetModified();
@@ -2055,8 +2048,9 @@ SetRedlineMode( eOld );
{
// i57907: Under circumstances (sections at the end of a chapter)
// the rPam.Start() is not moved to the new position.
- // But aIdx should be at the new end position and as long as the number of moved paragraphs
- // is nMoved, I know, where the new position is.
+ // But aIdx should be at the new end position and as long as the
+ // number of moved paragraphs is nMoved, I know, where the new
+ // position is.
pUndo->SetStartNode( aIdx.GetIndex() - nMoved );
GetIDocumentUndoRedo().AppendUndo(pUndo);
}
@@ -2266,7 +2260,7 @@ String SwDoc::GetUniqueNumRuleName( const String* pChkStr, sal_Bool bAutoNum ) c
const String& rNm = pNumRule->GetName();
if( rNm.Match( aName ) == nNmLen )
{
- // Nummer bestimmen und das Flag setzen
+ // Determine Number and set the Flag
nNum = (sal_uInt16)rNm.Copy( nNmLen ).ToInt32();
if( nNum-- && nNum < pNumRuleTbl->Count() )
pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
@@ -2277,12 +2271,12 @@ String SwDoc::GetUniqueNumRuleName( const String* pChkStr, sal_Bool bAutoNum ) c
if( !pChkStr )
{
- // alle Nummern entsprechend geflag, also bestimme die richtige Nummer
+ // All Numbers have been flagged accordingly, so identify the right Number
nNum = pNumRuleTbl->Count();
for( n = 0; n < nFlagSize; ++n )
if( 0xff != ( nTmp = pSetFlags[ n ] ))
{
- // also die Nummer bestimmen
+ // identify the Number
nNum = n * 8;
while( nTmp & 1 )
++nNum, nTmp >>= 1;
commit 5513e24eeaca20a12aac338a722fc9ba81c7c833
Author: Philipp Weissenbacher <Philipp Weissenbacher>
Date: Sun Jan 8 21:35:45 2012 +0100
Translate German comments
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 27a8286..1ba11b8 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -26,7 +26,7 @@
*
************************************************************************/
-#define ROLBCK_HISTORY_ONLY // Der Kampf gegen die CLOOK's
+#define ROLBCK_HISTORY_ONLY // The fight against the CLOOK's
#include <doc.hxx>
#include <dcontact.hxx>
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
@@ -62,9 +62,9 @@
#include <fmtfordr.hxx>
#include <fmtpdsc.hxx>
#include <pvprtdat.hxx>
-#include <rootfrm.hxx> //Damit der RootDtor gerufen wird.
+#include <rootfrm.hxx> // So that the RootDtor is being called
#include <layouter.hxx>
-#include <pagedesc.hxx> //Damit die PageDescs zerstoert werden koennen.
+#include <pagedesc.hxx> // So that the PageDescs can be destroyed
#include <ndtxt.hxx>
#include <printdata.hxx>
#include <docfld.hxx>
@@ -73,12 +73,12 @@
#include <docstat.hxx>
#include <charfmt.hxx>
#include <frmfmt.hxx>
-#include <rolbck.hxx> // Undo-Attr, SwHistory
-#include <poolfmt.hxx> // fuer die Pool-Vorlage
+#include <rolbck.hxx> // Undo attributes, SwHistory
+#include <poolfmt.hxx> // for the Pool template
#include <dbmgr.hxx>
#include <docsh.hxx>
-#include <acorrect.hxx> // fuer die autom. Aufnahme von Ausnahmen
-#include <visiturl.hxx> // fuer die URL-Change Benachrichtigung
+#include <acorrect.hxx> // for the automatic adding of exceptions
+#include <visiturl.hxx> // for the URLChange message
#include <docary.hxx>
#include <lineinfo.hxx>
#include <drawdoc.hxx>
@@ -99,7 +99,7 @@
#include <UndoManager.hxx>
#include <unochart.hxx>
-#include <cmdid.h> // fuer den dflt - Printer in SetJob
+#include <cmdid.h> // for the default printer in SetJob
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
@@ -189,7 +189,7 @@ void StartGrammarChecking( SwDoc &rDoc )
}
/*
- * interne Funktionen
+ * internal functions
*/
sal_Bool lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
{
@@ -203,7 +203,7 @@ sal_Bool lcl_DelFmtIndizes( const SwFrmFmtPtr& rpFmt, void* )
}
/*
- * exportierte Methoden
+ * exported methods
*/
SwDoc::SwDoc()
: m_pNodes( new SwNodes(this) )
@@ -369,12 +369,12 @@ SwDoc::SwDoc()
mpGrammarContact = ::createGrammarContact();
/*
- * Defaultformate und DefaultFormatsammlungen (FmtColl)
- * werden an der Position 0 in das jeweilige Array eingetragen.
- * Die Formate der FmtColls sind von den Defaultformaten
- * abgeleitet und stehen auch in der Liste.
+ * DefaultFormats and DefaultFormatCollections (FmtColl)
+ * are inserted at position 0 at the respective array.
+ * The formats in the FmtColls are derived from the
+ * DefaultFormats and are also in the list.
*/
- /* Formate */
+ /* Formats */
pFrmFmtTbl->Insert(pDfltFrmFmt, 0 );
pCharFmtTbl->Insert(pDfltCharFmt, 0 );
@@ -384,18 +384,18 @@ SwDoc::SwDoc()
// GRF
pGrfFmtCollTbl->Insert(pDfltGrfFmtColl, 0 );
- // PageDesc, EmptyPageFmt und ColumnFmt anlegen
+ // Create PageDesc, EmptyPageFmt and ColumnFmt
if ( !aPageDescs.Count() )
GetPageDescFromPool( RES_POOLPAGE_STANDARD );
- //Leere Seite Einstellen.
+ // Set to "Empty Page"
pEmptyPageFmt->SetFmtAttr( SwFmtFrmSize( ATT_FIX_SIZE ) );
- //BodyFmt fuer Spalten Einstellen.
+ // Set BodyFmt for "Column Setting" Spalten Einstellen. FIXME: WHAT?
pColumnContFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
_InitFieldTypes();
- // lege (fuer die Filter) eine Default-OutlineNumRule an
+ // Create a default OutlineNumRule (for Filters)
pOutlineRule = new SwNumRule( String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ),
// #i89178#
numfunc::GetDefaultPositionAndSpaceMode(),
@@ -410,14 +410,14 @@ SwDoc::SwDoc()
new SwTxtNode( SwNodeIndex( GetNodes().GetEndOfContent() ),
GetTxtCollFromPool( RES_POOLCOLL_STANDARD ));
- // den eigenen IdleTimer setzen
+ // set the own IdleTimer
aIdleTimer.SetTimeout( 600 );
aIdleTimer.SetTimeoutHdl( LINK(this, SwDoc, DoIdleJobs) );
aOLEModifiedTimer.SetTimeout( 1000 );
aOLEModifiedTimer.SetTimeoutHdl( LINK( this, SwDoc, DoUpdateModifiedOLE ));
- // DBMgr anlegen
+ // Create DBMgr
pNewDBMgr = new SwNewDBMgr;
// create TOXTypes
@@ -444,10 +444,9 @@ SwDoc::SwDoc()
}
/*
- * Besonderheiten: an der Position 0 des Arrays der Formate und
- * der GDI-Objekte befindet sich ein Member der Klasse SwDoc.
- * Dieser darf also keinesfalls durch delete geloescht
- * werden!!!!!!!!!!
+ * Speciality: a member of the class SwDoc is located at
+ * position 0 in the array of the Format and GDI objects.
+ * This MUST not be destroyed using 'delete' in any case!
*/
SwDoc::~SwDoc()
{
@@ -492,7 +491,7 @@ SwDoc::~SwDoc()
delete pLayouter;
pLayouter = 0L;
- // Undo-Benachrichtigung vom Draw abschalten
+ // Deactivate Undo notification from the Draw
if( pDrawModel )
{
DrawNotifyUndoHdl();
@@ -509,7 +508,7 @@ SwDoc::~SwDoc()
delete pUpdtFlds;
delete pACEWord;
- // die BaseLinks freigeben.
+ // Release the BaseLinks
{
for( sal_uInt16 n = pLinkMgr->GetServers().Count(); n; )
pLinkMgr->GetServers()[ --n ]->Closed();
@@ -518,8 +517,8 @@ SwDoc::~SwDoc()
pLinkMgr->Remove( 0, pLinkMgr->GetLinks().Count() );
}
- // die KapitelNummern / Nummern muessen vor den Vorlage geloescht werden
- // ansonsten wird noch staendig geupdatet !!!
+ // The ChapterNumbers/Numbers need to be deleted before the Templates
+ // or we update all the time!
m_pNodes->pOutlineNds->Remove(sal_uInt16(0), m_pNodes->pOutlineNds->Count());
SwNodes & rUndoNodes( GetUndoManager().GetUndoNodes() );
rUndoNodes.pOutlineNds->Remove(sal_uInt16(0), rUndoNodes.pOutlineNds->Count());
@@ -529,8 +528,8 @@ SwDoc::~SwDoc()
// indices could be registered in attributes
m_pUndoManager->DelAllUndoObj();
- // in den BookMarks sind Indizies auf den Content. Diese muessen vorm
- // loesche der Nodes geloescht werden.
+ // The BookMarks contain indices to the Content. These must be deleted
+ // before deleting the Nodes.
pMarkManager->clearAllMarks();
DELETEZ( pMacroTable );
@@ -543,8 +542,8 @@ SwDoc::~SwDoc()
delete pTmp;
}
-//JP: alt - loeschen ohne Flag ist teuer; Modify wird verschickt!
-// aTOXTypes.DeleteAndDestroy( 0, aTOXTypes.Count() );
+ // Old - deletion without a Flag is expensive, because we send a Modify
+ // aTOXTypes.DeleteAndDestroy( 0, aTOXTypes.Count() );
{
for( sal_uInt16 n = pTOXTypes->Count(); n; )
{
@@ -555,78 +554,81 @@ SwDoc::~SwDoc()
}
delete pDefTOXBases;
- //Im einen oder anderen FrmFormat koennen noch Indizes angemeldet sein,
- //Diese muessen spaetestens jetzt zerstoert werden.
+ // Any of the FrmFormats can still have indices registered.
+ // These need to be destroyed now at the latest.
pFrmFmtTbl->ForEach( &lcl_DelFmtIndizes, this );
pSpzFrmFmtTbl->ForEach( &lcl_DelFmtIndizes, this );
((SwFrmFmts&)*pSectionFmtTbl).ForEach( &lcl_DelFmtIndizes, this );
- //Die Formate, die hier hinter stehen sind von den DefaultFormaten
- //abhaengig. Erst nach dem Loeschen der FmtIndizes weil der Inhalt von
- //Kopf-/Fussbereichen geloescht wird. Wenn dort noch Indizes von Flys
- //angemeldet sind gibts was an die Ohren.
+ // The Formats that come hereafter are depended on the
+ // DefaultFormats.
+ // FIXME: What?
+ // FIXME: Erst nach dem Loeschen der FmtIndizes weil der Inhalt von
+ // FIXME: Kopf-/Fussbereichen geloescht wird. Wenn dort noch Indizes von Flys
+ // FIXME: angemeldet sind gibts was an die Ohren.
aPageDescs.DeleteAndDestroy( 0, aPageDescs.Count() );
- // Inhaltssections loeschen
- // nicht erst durch den SwNodes-DTOR, damit Formate
- // keine Abhaengigen mehr haben.
+ // Delete content selections.
+ // Don't wait for the SwNodes dtor to destroy them; so that Formats
+ // do not have any dependencies anymore.
m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() );
rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() );
- // Formate loeschen, spaeter mal permanent machen.
+ // Delete Formats, make it permanent some time in the future
- // Delete fuer Collections
- // damit die Abhaengigen wech sind
+ // Delete for Collections
+ // So that we get rid of the dependencies
pFtnInfo->ReleaseCollection();
pEndNoteInfo->ReleaseCollection();
OSL_ENSURE( pDfltTxtFmtColl == (*pTxtFmtCollTbl)[0],
- "Default-Text-Collection muss immer am Anfang stehen" );
+ "Default-Text-Collection must always be at the start" );
- // JP 27.01.98: opt.: ausgehend davon, das Standard als 2. im Array
- // steht, sollte das als letztes geloescht werden, damit
- // die ganze Umhaengerei der Formate vermieden wird!
+ // Optimization: Based on the fact that Standard is always 2nd in the
+ // array, we should delete it as the last. With this we avoid
+ // remangling the Formats all the time!
if( 2 < pTxtFmtCollTbl->Count() )
pTxtFmtCollTbl->DeleteAndDestroy( 2, pTxtFmtCollTbl->Count()-2 );
pTxtFmtCollTbl->DeleteAndDestroy( 1, pTxtFmtCollTbl->Count()-1 );
delete pTxtFmtCollTbl;
OSL_ENSURE( pDfltGrfFmtColl == (*pGrfFmtCollTbl)[0],
- "Default-Grf-Collection muss immer am Anfang stehen" );
+ "DefaultGrfCollection must always be at the start" );
pGrfFmtCollTbl->DeleteAndDestroy( 1, pGrfFmtCollTbl->Count()-1 );
-// ergibt sich automatisch - kein _DEL Array!
-// pGrfFmtCollTbl->Remove( 0, n );
+ // Is the result anyway - no _DEL array!
+ // pGrfFmtCollTbl->Remove( 0, n );
delete pGrfFmtCollTbl;
/*
- * Defaultformate und DefaultFormatsammlungen (FmtColl)
- * sind an der Position 0 der jeweiligen Arrays eingetragen.
- * Damit sie nicht vom DTOR der Array's zum 2.mal geloescht werden,
- * nehme sie aus dem Array.
+ * DefaultFormats and DefaultFormatCollections (FmtColl)
+ * are at position 0 of their respective arrays.
+ * In order to not be deleted by the array's dtor, we remove them
+ * now.
*/
pFrmFmtTbl->Remove( 0 );
pCharFmtTbl->Remove( 0 );
- // Delete fuer pPrt
+ // Delete for pPrt
DELETEZ( pPrt );
DELETEZ( pNewDBMgr );
- // Alle Flys muessen vor dem Drawing Model zerstoert werden,
- // da Flys noch DrawContacts enthalten koennen, wenn wegen
- // eines Lesefehlers kein Layout aufgebaut wurde.
+ // All Flys need to be destroyed before the Drawing Model,
+ // because Flys can still contain DrawContacts, when no
+ // Layout could be constructed due to a read error.
pSpzFrmFmtTbl->DeleteAndDestroy( 0, pSpzFrmFmtTbl->Count() );
- //Erst jetzt das Model zerstoeren, die Zeichenobjekte - die ja auch
- //im Undo herumlungern - wollen noch ihre Attribute beim Model entfernen.
- //Ausserdem koennen vorher noch DrawContacts existieren.
+ // Only now destroy the Model, the drawing objects - which are also
+ // contained in the Undo - need to remove their attributes from the
+ // Model. Also, DrawContacts could exist before that.
ReleaseDrawModel();
- //JP 28.01.99: DrawModel vorm LinkManager zerstoeren, da am DrawModel
- // dieser immer gesetzt ist.
+ // Destroy DrawModel before the LinkManager, because it's always set
+ // in the DrawModel.
DELETEZ( pLinkMgr );
- //Tables vor dem loeschen der Defaults leeren, sonst GPF wegen Def-Abhaengigen.
- //Die Arrays sollten (wegen includes) bei Gelegenheit auch zu Pointern werden.
+ // Clear the Tables before deleting them, or we crash due to
+ // FIXME: Def-Abhängigen
+ // We also convert the arrays (due to includes) to pointers.
delete pFrmFmtTbl;
delete pSpzFrmFmtTbl;
@@ -696,8 +698,8 @@ SfxPrinter& SwDoc::CreatePrinter_() const
OSL_FAIL( "Printer will be created!" );
#endif
- // wir erzeugen einen default SfxPrinter.
- // Das ItemSet wird vom Sfx geloescht!
+ // We create a default SfxPrinter.
+ // The ItemSet is deleted by Sfx!
SfxItemSet *pSet = new SfxItemSet( ((SwDoc*)this)->GetAttrPool(),
FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
SID_HTML_MODE, SID_HTML_MODE,
@@ -725,7 +727,7 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
}
pLinkMgr->SetPersist( pDocShell );
- //JP 27.08.98: Bug 55570 - DocShell Pointer auch am DrawModel setzen
+ // Bug 55570 - Set the DocShell pointer also in the DrawModel
if( pDrawModel )
{
((SwDrawDocument*)pDrawModel)->SetObjectShell( pDocShell );
@@ -736,8 +738,7 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
}
}
-// Convenience-Methode, um uebermaessige Includes von docsh.hxx
-// zu vermeiden
+// Convenience method; to avoid excessive includes from docsh.hxx
uno::Reference < embed::XStorage > SwDoc::GetDocStorage()
{
if( pDocShell )
@@ -757,14 +758,14 @@ void SwDoc::ClearDoc()
GetIDocumentUndoRedo().DelAllUndoObj();
::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
- // Undo-Benachrichtigung vom Draw abschalten
+ // Deactivate Undo notification from the Draw
if( pDrawModel )
{
DrawNotifyUndoHdl();
ClrContourCache();
}
- // stehen noch FlyFrames rum, loesche auch diese
+ // if there are still FlyFrames dangling around, delete them too
sal_uInt16 n;
while ( 0 != (n = GetSpzFrmFmts()->Count()) )
DelLayoutFmt((*pSpzFrmFmtTbl)[n-1]);
@@ -775,8 +776,8 @@ void SwDoc::ClearDoc()
delete pACEWord;
- // in den BookMarks sind Indizies auf den Content. Diese muessen vorm
- // loesche der Nodes geloescht werden.
+ // The BookMarks contain indices to the Content. These must be deleted
+ // before deleting the Nodes.
pMarkManager->clearAllMarks();
InitTOXTypes();
@@ -785,7 +786,7 @@ void SwDoc::ClearDoc()
SwPageDesc* pDummyPgDsc = aPageDescs[ nDummyPgDsc ];
SwNodeIndex aSttIdx( *GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
- // den ersten immer wieder neu anlegen (ohne Attribute/Vorlagen/...)
+ // create the first one over and over again (without Attribute/Templates etc.
SwTxtNode* pFirstNd = GetNodes().MakeTxtNode( aSttIdx, pDfltTxtFmtColl );
if( pCurrentView ) //swmod 071029//swmod 071225
@@ -815,18 +816,18 @@ void SwDoc::ClearDoc()
// Counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
- //remove the dummy pagedec from the array and delete all the old ones
+ // remove the dummy pagedec from the array and delete all the old ones
aPageDescs.Remove( nDummyPgDsc );
aPageDescs.DeleteAndDestroy( 0, aPageDescs.Count() );
- // Delete fuer Collections
- // damit die Abhaengigen wech sind
+ // Delete for Collections
+ // So that we get rid of the dependencies
pFtnInfo->ReleaseCollection();
pEndNoteInfo->ReleaseCollection();
- // opt.: ausgehend davon, das Standard als 2. im Array
- // steht, sollte das als letztes geloescht werden, damit
- // die ganze Umhaengerei der Formate vermieden wird!
+ // Optimization: Based on the fact that Standard is always 2nd in the
+ // array, we should delete it as the last. With this we avoid
+ // remangling the Formats all the time!
if( 2 < pTxtFmtCollTbl->Count() )
pTxtFmtCollTbl->DeleteAndDestroy( 2, pTxtFmtCollTbl->Count()-2 );
pTxtFmtCollTbl->DeleteAndDestroy( 1, pTxtFmtCollTbl->Count()-1 );
@@ -1053,7 +1054,7 @@ void SwDoc::InitTOXTypes()
void SwDoc::ReplaceDefaults(const SwDoc& rSource)
{
- //copy property defaults
+ // copy property defaults
const sal_uInt16 aRangeOfDefaults[] =
{
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
@@ -1137,7 +1138,7 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
pRet->ReplaceStyles(*this);
- //copy content
+ // copy content
pRet->Paste( *this );
// remove the temporary shell if it is there as it was done before
@@ -1153,7 +1154,7 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
-----------------------------------------------------------------------*/
void SwDoc::Paste( const SwDoc& rSource )
{
-// this has to be empty const sal_uInt16 nStartPageNumber = GetPhyPageNum();
+ // this has to be empty const sal_uInt16 nStartPageNumber = GetPhyPageNum();
// until the end of the NodesArray
SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), 2 );
SwPaM aCpyPam( aSourceIdx ); //DocStart
More information about the Libreoffice-commits
mailing list