Kaydet (Commit) 4b9301d4 authored tarafından Christian M. Heller's avatar Christian M. Heller Kaydeden (comit) Thomas Arnhold

fdo#39468 Translate German comments V2 - vcl/source/edit/{textdata, textdoc}

made the changes suggested by Thomas and Petr

Change-Id: I0f9e8dcda27a714628edaa5e1e8fd875c8f67593
Reviewed-on: https://gerrit.libreoffice.org/3162Reviewed-by: 's avatarThomas Arnhold <thomas@arnhold.org>
Tested-by: 's avatarThomas Arnhold <thomas@arnhold.org>
üst 77074e46
...@@ -24,10 +24,6 @@ ...@@ -24,10 +24,6 @@
#include <tools/debug.hxx> #include <tools/debug.hxx>
// -------------------------------------------------------------------------
// (+) class TextSelection
// -------------------------------------------------------------------------
TextSelection::TextSelection() TextSelection::TextSelection()
{ {
} }
...@@ -53,9 +49,6 @@ void TextSelection::Justify() ...@@ -53,9 +49,6 @@ void TextSelection::Justify()
} }
// -------------------------------------------------------------------------
// (+) class TETextPortionList
// -------------------------------------------------------------------------
TETextPortionList::TETextPortionList() TETextPortionList::TETextPortionList()
{ {
} }
...@@ -82,7 +75,7 @@ void TETextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom ) ...@@ -82,7 +75,7 @@ void TETextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom )
sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion ) sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion )
{ {
// Bei nCharPos an Portion-Grenze wird die linke Portion gefunden // find left portion at nCharPos at portion border
sal_uInt16 nTmpPos = 0; sal_uInt16 nTmpPos = 0;
for ( sal_uInt16 nPortion = 0; nPortion < size(); nPortion++ ) for ( sal_uInt16 nPortion = 0; nPortion < size(); nPortion++ )
{ {
...@@ -103,9 +96,6 @@ sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPor ...@@ -103,9 +96,6 @@ sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPor
} }
// -------------------------------------------------------------------------
// (+) class TEParaPortion
// -------------------------------------------------------------------------
TEParaPortion::TEParaPortion( TextNode* pN ) TEParaPortion::TEParaPortion( TextNode* pN )
{ {
mpNode = pN; mpNode = pN;
...@@ -127,13 +117,13 @@ void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) ...@@ -127,13 +117,13 @@ void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff )
} }
else else
{ {
// Einfaches hintereinander tippen // simple consecutive typing
if ( ( nDiff > 0 ) && ( mnInvalidDiff > 0 ) && if ( ( nDiff > 0 ) && ( mnInvalidDiff > 0 ) &&
( ( mnInvalidPosStart+mnInvalidDiff ) == nStart ) ) ( ( mnInvalidPosStart+mnInvalidDiff ) == nStart ) )
{ {
mnInvalidDiff = mnInvalidDiff + nDiff; mnInvalidDiff = mnInvalidDiff + nDiff;
} }
// Einfaches hintereinander loeschen // simple consecutive deleting
else if ( ( nDiff < 0 ) && ( mnInvalidDiff < 0 ) && ( mnInvalidPosStart == nStart ) ) else if ( ( nDiff < 0 ) && ( mnInvalidDiff < 0 ) && ( mnInvalidPosStart == nStart ) )
{ {
mnInvalidPosStart = mnInvalidPosStart + nDiff; mnInvalidPosStart = mnInvalidPosStart + nDiff;
...@@ -202,12 +192,11 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat ...@@ -202,12 +192,11 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat
const TextLine* pUnformatted = maLines[ nLastFormattedLine+1 ]; const TextLine* pUnformatted = maLines[ nLastFormattedLine+1 ];
short nPortionDiff = pUnformatted->GetStartPortion() - pLastFormatted->GetEndPortion(); short nPortionDiff = pUnformatted->GetStartPortion() - pLastFormatted->GetEndPortion();
short nTextDiff = pUnformatted->GetStart() - pLastFormatted->GetEnd(); short nTextDiff = pUnformatted->GetStart() - pLastFormatted->GetEnd();
nTextDiff++; // LastFormatted->GetEnd() war incl. => 1 zuviel abgezogen! nTextDiff++; // LastFormatted->GetEnd() was inclusive => subtracted one too much!
// Die erste unformatierte muss genau eine Portion hinter der letzten der // The first unformated one has to start exactly one portion past the last
// formatierten beginnen: // formated one.
// Wenn in der geaenderten Zeile eine Portion gesplittet wurde, // If a portion got split in the changed row, nLastEnd could be > nNextStart!
// kann nLastEnd > nNextStart sein!
short nPDiff = sal::static_int_cast< short >(-( nPortionDiff-1 )); short nPDiff = sal::static_int_cast< short >(-( nPortionDiff-1 ));
short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 )); short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 ));
if ( nPDiff || nTDiff ) if ( nPDiff || nTDiff )
...@@ -228,9 +217,6 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat ...@@ -228,9 +217,6 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat
} }
} }
// -------------------------------------------------------------------------
// (+) class TEParaPortions
// -------------------------------------------------------------------------
TEParaPortions::TEParaPortions() TEParaPortions::TEParaPortions()
{ {
} }
...@@ -248,9 +234,6 @@ void TEParaPortions::Reset() ...@@ -248,9 +234,6 @@ void TEParaPortions::Reset()
clear(); clear();
} }
// -------------------------------------------------------------------------
// (+) class IdleFormatter
// -------------------------------------------------------------------------
IdleFormatter::IdleFormatter() IdleFormatter::IdleFormatter()
{ {
mpView = 0; mpView = 0;
......
...@@ -22,17 +22,12 @@ ...@@ -22,17 +22,12 @@
#include <stdlib.h> #include <stdlib.h>
// compare function called by QuickSort
// Vergleichmethode wird von QuickSort gerufen...
static bool CompareStart( const TextCharAttrib* pFirst, const TextCharAttrib* pSecond ) static bool CompareStart( const TextCharAttrib* pFirst, const TextCharAttrib* pSecond )
{ {
return pFirst->GetStart() < pSecond->GetStart(); return pFirst->GetStart() < pSecond->GetStart();
} }
// -------------------------------------------------------------------------
// (+) class TextCharAttrib
// -------------------------------------------------------------------------
TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ) TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd )
{ {
mpAttr = rAttr.Clone(); mpAttr = rAttr.Clone();
...@@ -52,10 +47,6 @@ TextCharAttrib::~TextCharAttrib() ...@@ -52,10 +47,6 @@ TextCharAttrib::~TextCharAttrib()
delete mpAttr; delete mpAttr;
} }
// -------------------------------------------------------------------------
// (+) class TextCharAttribList
// -------------------------------------------------------------------------
TextCharAttribList::TextCharAttribList() TextCharAttribList::TextCharAttribList()
{ {
mbHasEmptyAttribs = sal_False; mbHasEmptyAttribs = sal_False;
...@@ -81,7 +72,7 @@ void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib ) ...@@ -81,7 +72,7 @@ void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib )
mbHasEmptyAttribs = sal_True; mbHasEmptyAttribs = sal_True;
const sal_uInt16 nCount = size(); const sal_uInt16 nCount = size();
const sal_uInt16 nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. const sal_uInt16 nStart = pAttrib->GetStart(); // maybe better for Comp.Opt.
sal_Bool bInserted = sal_False; sal_Bool bInserted = sal_False;
for ( sal_uInt16 x = 0; x < nCount; x++ ) for ( sal_uInt16 x = 0; x < nCount; x++ )
{ {
...@@ -105,9 +96,8 @@ void TextCharAttribList::ResortAttribs() ...@@ -105,9 +96,8 @@ void TextCharAttribList::ResortAttribs()
TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
{ {
// Rueckwaerts, falls eins dort endet, das naechste startet. // backwards; if one ends there and the next starts there
// => Das startende gilt... // ==> the starting one counts
for ( sal_uInt16 nAttr = size(); nAttr; ) for ( sal_uInt16 nAttr = size(); nAttr; )
{ {
TextCharAttrib* pAttr = GetAttrib( --nAttr ); TextCharAttrib* pAttr = GetAttrib( --nAttr );
...@@ -149,8 +139,8 @@ sal_Bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const ...@@ -149,8 +139,8 @@ sal_Bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const
sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound ) sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound )
{ {
// Rueckwaerts, falls eins dort endet, das naechste startet. // backwards; if one ends there and the next starts there
// => Das startende gilt... // ==> the starting one counts
for ( sal_uInt16 nAttr = size(); nAttr; ) for ( sal_uInt16 nAttr = size(); nAttr; )
{ {
TextCharAttrib* pAttr = GetAttrib( --nAttr ); TextCharAttrib* pAttr = GetAttrib( --nAttr );
...@@ -197,10 +187,6 @@ void TextCharAttribList::DeleteEmptyAttribs() ...@@ -197,10 +187,6 @@ void TextCharAttribList::DeleteEmptyAttribs()
mbHasEmptyAttribs = sal_False; mbHasEmptyAttribs = sal_False;
} }
// -------------------------------------------------------------------------
// (+) class TextNode
// -------------------------------------------------------------------------
TextNode::TextNode( const String& rText ) : TextNode::TextNode( const String& rText ) :
maText( rText ) maText( rText )
{ {
...@@ -218,27 +204,25 @@ void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew ) ...@@ -218,27 +204,25 @@ void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew )
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
if ( pAttrib->GetEnd() >= nIndex ) if ( pAttrib->GetEnd() >= nIndex )
{ {
// Alle Attribute hinter der Einfuegeposition verschieben... // move all attributes that are behind the cursor
if ( pAttrib->GetStart() > nIndex ) if ( pAttrib->GetStart() > nIndex )
{ {
pAttrib->MoveForward( nNew ); pAttrib->MoveForward( nNew );
} }
// 0: Leeres Attribut expandieren, wenn an Einfuegestelle // 0: expand empty attribute, if at cursor
else if ( pAttrib->IsEmpty() ) else if ( pAttrib->IsEmpty() )
{ {
// Index nicht pruefen, leeres durfte nur dort liegen. // Do not check the index; empty one may only be here.
// Wenn spaeter doch Ueberpruefung: // If checking later anyway, special case:
// Spezialfall: Start == 0; AbsLen == 1, nNew = 1 => Expand, weil durch Absatzumbruch! // Start == 0; AbsLen == 1, nNew = 1 => Expand due to new paragraph!
// Start <= nIndex, End >= nIndex => Start=End=nIndex! // Start <= nIndex, End >= nIndex => Start=End=nIndex!
// if ( pAttrib->GetStart() == nIndex ) pAttrib->Expand( nNew );
pAttrib->Expand( nNew );
} }
// 1: Attribut startet davor, geht bis Index... // 1: attribute starts before and reaches up to index
else if ( pAttrib->GetEnd() == nIndex ) // Start muss davor liegen else if ( pAttrib->GetEnd() == nIndex ) // start must be before
{ {
// Nur expandieren, wenn kein Feature, // Only expand if no feature and not in Exclude list!
// und wenn nicht in ExcludeListe! // Otherwise e.g. an UL would go until the new ULDB, thus expand both.
// Sonst geht z.B. ein UL bis zum neuen ULDB, beide expandieren
if ( !maCharAttribs.FindEmptyAttrib( pAttrib->Which(), nIndex ) ) if ( !maCharAttribs.FindEmptyAttrib( pAttrib->Which(), nIndex ) )
{ {
pAttrib->Expand( nNew ); pAttrib->Expand( nNew );
...@@ -246,18 +230,17 @@ void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew ) ...@@ -246,18 +230,17 @@ void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew )
else else
bResort = sal_True; bResort = sal_True;
} }
// 2: Attribut startet davor, geht hinter Index... // 2: attribute starts before and reaches past the index
else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
{ {
pAttrib->Expand( nNew ); pAttrib->Expand( nNew );
} }
// 3: Attribut startet auf Index... // 3: attribute starts at Index
else if ( pAttrib->GetStart() == nIndex ) else if ( pAttrib->GetStart() == nIndex )
{ {
if ( nIndex == 0 ) if ( nIndex == 0 )
{ {
pAttrib->Expand( nNew ); pAttrib->Expand( nNew );
// bResort = sal_True; // es gibt ja keine Features mehr...
} }
else else
pAttrib->MoveForward( nNew ); pAttrib->MoveForward( nNew );
...@@ -287,33 +270,33 @@ void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) ...@@ -287,33 +270,33 @@ void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted )
sal_Bool bDelAttr = sal_False; sal_Bool bDelAttr = sal_False;
if ( pAttrib->GetEnd() >= nIndex ) if ( pAttrib->GetEnd() >= nIndex )
{ {
// Alles Attribute hinter der Einfuegeposition verschieben... // move all attributes that are behind the cursor
if ( pAttrib->GetStart() >= nEndChanges ) if ( pAttrib->GetStart() >= nEndChanges )
{ {
pAttrib->MoveBackward( nDeleted ); pAttrib->MoveBackward( nDeleted );
} }
// 1. Innenliegende Attribute loeschen... // 1. delete inner attributes
else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() <= nEndChanges ) ) else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() <= nEndChanges ) )
{ {
// Spezialfall: Attrubt deckt genau den Bereich ab // special case: attribute covers the region exactly
// => als leeres Attribut behalten. // => keep as an empty attribute
if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) ) if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) )
pAttrib->GetEnd() = nIndex; // leer pAttrib->GetEnd() = nIndex; // empty
else else
bDelAttr = sal_True; bDelAttr = sal_True;
} }
// 2. Attribut beginnt davor, endet drinnen oder dahinter... // 2. attribute starts before, ends inside or after
else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
{ {
if ( pAttrib->GetEnd() <= nEndChanges ) // endet drinnen if ( pAttrib->GetEnd() <= nEndChanges ) // ends inside
pAttrib->GetEnd() = nIndex; pAttrib->GetEnd() = nIndex;
else else
pAttrib->Collaps( nDeleted ); // endet dahinter pAttrib->Collaps( nDeleted ); // ends after
} }
// 3. Attribut beginnt drinnen, endet dahinter... // 3. attribute starts inside, ends after
else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() > nEndChanges ) ) else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() > nEndChanges ) )
{ {
// Features duerfen nicht expandieren! // features are not allowed to expand!
pAttrib->GetStart() = nEndChanges; pAttrib->GetStart() = nEndChanges;
pAttrib->MoveBackward( nDeleted ); pAttrib->MoveBackward( nDeleted );
} }
...@@ -369,13 +352,13 @@ TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs ) ...@@ -369,13 +352,13 @@ TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs )
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
if ( pAttrib->GetEnd() < nPos ) if ( pAttrib->GetEnd() < nPos )
{ {
// bleiben unveraendert.... // no change
; ;
} }
else if ( pAttrib->GetEnd() == nPos ) else if ( pAttrib->GetEnd() == nPos )
{ {
// muessen als leeres Attribut kopiert werden. // must be copied as an empty attribute
// !FindAttrib nur sinnvoll, wenn Rueckwaerts durch Liste! // !FindAttrib only sensible if traversing backwards through the list!
if ( bKeepEndingAttribs && !pNew->maCharAttribs.FindAttrib( pAttrib->Which(), 0 ) ) if ( bKeepEndingAttribs && !pNew->maCharAttribs.FindAttrib( pAttrib->Which(), 0 ) )
{ {
TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib ); TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib );
...@@ -386,20 +369,20 @@ TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs ) ...@@ -386,20 +369,20 @@ TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs )
} }
else if ( pAttrib->IsInside( nPos ) || ( !nPos && !pAttrib->GetStart() ) ) else if ( pAttrib->IsInside( nPos ) || ( !nPos && !pAttrib->GetStart() ) )
{ {
// Wenn ganz vorne gecuttet wird, muss das Attribut erhalten bleiben! // If cutting at the very beginning, the attribute has to be
// muessen kopiert und geaendert werden // copied and changed
TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib ); TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib );
pNewAttrib->GetStart() = 0; pNewAttrib->GetStart() = 0;
pNewAttrib->GetEnd() = pAttrib->GetEnd()-nPos; pNewAttrib->GetEnd() = pAttrib->GetEnd()-nPos;
pNew->maCharAttribs.InsertAttrib( pNewAttrib ); pNew->maCharAttribs.InsertAttrib( pNewAttrib );
// stutzen: // trim
pAttrib->GetEnd() = nPos; pAttrib->GetEnd() = nPos;
} }
else else
{ {
DBG_ASSERT( pAttrib->GetStart() >= nPos, "Start < nPos!" ); DBG_ASSERT( pAttrib->GetStart() >= nPos, "Start < nPos!" );
DBG_ASSERT( pAttrib->GetEnd() >= nPos, "End < nPos!" ); DBG_ASSERT( pAttrib->GetEnd() >= nPos, "End < nPos!" );
// alle dahinter verschieben in den neuen Node (this) // move all into the new node (this)
maCharAttribs.RemoveAttrib( nAttr ); maCharAttribs.RemoveAttrib( nAttr );
pNew->maCharAttribs.InsertAttrib( pAttrib ); pNew->maCharAttribs.InsertAttrib( pAttrib );
pAttrib->GetStart() = pAttrib->GetStart() - nPos; pAttrib->GetStart() = pAttrib->GetStart() - nPos;
...@@ -423,7 +406,7 @@ void TextNode::Append( const TextNode& rNode ) ...@@ -423,7 +406,7 @@ void TextNode::Append( const TextNode& rNode )
sal_Bool bMelted = sal_False; sal_Bool bMelted = sal_False;
if ( pAttrib->GetStart() == 0 ) if ( pAttrib->GetStart() == 0 )
{ {
// Evtl koennen Attribute zusammengefasst werden: // potentially merge attributes
sal_uInt16 nTmpAttribs = maCharAttribs.Count(); sal_uInt16 nTmpAttribs = maCharAttribs.Count();
for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ ) for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
{ {
...@@ -437,7 +420,7 @@ void TextNode::Append( const TextNode& rNode ) ...@@ -437,7 +420,7 @@ void TextNode::Append( const TextNode& rNode )
pTmpAttrib->GetEnd() = pTmpAttrib->GetEnd() =
pTmpAttrib->GetEnd() + pAttrib->GetLen(); pTmpAttrib->GetEnd() + pAttrib->GetLen();
bMelted = sal_True; bMelted = sal_True;
break; // es kann nur eins von der Sorte an der Stelle geben break; // there can be only one of this type at this position
} }
} }
} }
...@@ -453,10 +436,6 @@ void TextNode::Append( const TextNode& rNode ) ...@@ -453,10 +436,6 @@ void TextNode::Append( const TextNode& rNode )
} }
} }
// -------------------------------------------------------------------------
// (+) class TextDoc
// -------------------------------------------------------------------------
TextDoc::TextDoc() TextDoc::TextDoc()
{ {
mnLeftMargin = 0; mnLeftMargin = 0;
...@@ -590,7 +569,7 @@ TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight ) ...@@ -590,7 +569,7 @@ TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight )
sal_uInt16 nPrevLen = pLeft->GetText().Len(); sal_uInt16 nPrevLen = pLeft->GetText().Len();
pLeft->Append( *pRight ); pLeft->Append( *pRight );
// der rechte verschwindet. // the paragraph on the right vanishes
sal_uLong nRight = maTextNodes.GetPos( pRight ); sal_uLong nRight = maTextNodes.GetPos( pRight );
maTextNodes.Remove( nRight ); maTextNodes.Remove( nRight );
delete pRight; delete pRight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment