Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3162

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/62/3162/1

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

Change-Id: I0f9e8dcda27a714628edaa5e1e8fd875c8f67593
---
M vcl/source/edit/textdata.cxx
M vcl/source/edit/textdoc.cxx
2 files changed, 48 insertions(+), 81 deletions(-)



diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx
index f713947..0025ca8 100644
--- a/vcl/source/edit/textdata.cxx
+++ b/vcl/source/edit/textdata.cxx
@@ -24,10 +24,6 @@
 #include <tools/debug.hxx>
 
 
-// -------------------------------------------------------------------------
-// (+) class TextSelection
-// -------------------------------------------------------------------------
-
 TextSelection::TextSelection()
 {
 }
@@ -53,9 +49,6 @@
 }
 
 
-// -------------------------------------------------------------------------
-// (+) class TETextPortionList
-// -------------------------------------------------------------------------
 TETextPortionList::TETextPortionList()
 {
 }
@@ -82,7 +75,7 @@
 
 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 boarder
     sal_uInt16 nTmpPos = 0;
     for ( sal_uInt16 nPortion = 0; nPortion < size(); nPortion++ )
     {
@@ -103,9 +96,6 @@
 }
 
 
-// -------------------------------------------------------------------------
-// (+) class TEParaPortion
-// -------------------------------------------------------------------------
 TEParaPortion::TEParaPortion( TextNode* pN )
 {
     mpNode = pN;
@@ -127,13 +117,13 @@
     }
     else
     {
-        // Einfaches hintereinander tippen
+        // simple consecutive typing
         if ( ( nDiff > 0 ) && ( mnInvalidDiff > 0 ) &&
              ( ( mnInvalidPosStart+mnInvalidDiff ) == nStart ) )
         {
             mnInvalidDiff = mnInvalidDiff + nDiff;
         }
-        // Einfaches hintereinander loeschen
+        // simple consecutive deleting
         else if ( ( nDiff < 0 ) && ( mnInvalidDiff < 0 ) && ( mnInvalidPosStart == nStart ) )
         {
             mnInvalidPosStart = mnInvalidPosStart + nDiff;
@@ -202,12 +192,11 @@
         const TextLine* pUnformatted = maLines[ nLastFormattedLine+1 ];
         short nPortionDiff = pUnformatted->GetStartPortion() - pLastFormatted->GetEndPortion();
         short nTextDiff = pUnformatted->GetStart() - pLastFormatted->GetEnd();
-        nTextDiff++;    // LastFormatted->GetEnd() war incl. => 1 zuviel abgezogen!
+        nTextDiff++;    // LastFormatted->GetEnd() was inclusive => 1 subtracted too much!
 
-        // Die erste unformatierte muss genau eine Portion hinter der letzten der
-        // formatierten beginnen:
-        // Wenn in der geaenderten Zeile eine Portion gesplittet wurde,
-        // kann nLastEnd > nNextStart sein!
+        // The first unformated one has to start exactly one portion past the last
+        // formated one.
+        // If a portion got split in the changed row, nLastEnd could be > nNextStart!
         short nPDiff = sal::static_int_cast< short >(-( nPortionDiff-1 ));
         short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 ));
         if ( nPDiff || nTDiff )
@@ -228,9 +217,6 @@
     }
 }
 
-// -------------------------------------------------------------------------
-// (+) class TEParaPortions
-// -------------------------------------------------------------------------
 TEParaPortions::TEParaPortions()
 {
 }
@@ -248,9 +234,6 @@
     clear();
 }
 
-// -------------------------------------------------------------------------
-// (+) class IdleFormatter
-// -------------------------------------------------------------------------
 IdleFormatter::IdleFormatter()
 {
     mpView = 0;
diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx
index 5dc0394..aa772bc 100644
--- a/vcl/source/edit/textdoc.cxx
+++ b/vcl/source/edit/textdoc.cxx
@@ -22,17 +22,12 @@
 #include <stdlib.h>
 
 
-
-// Vergleichmethode wird von QuickSort gerufen...
-
+// compare function called by QuickSort
 static bool CompareStart( const TextCharAttrib* pFirst, const TextCharAttrib* pSecond )
 {
     return pFirst->GetStart() < pSecond->GetStart();
 }
 
-// -------------------------------------------------------------------------
-// (+) class TextCharAttrib
-// -------------------------------------------------------------------------
 TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd )
 {
     mpAttr = rAttr.Clone();
@@ -51,10 +46,6 @@
 {
     delete mpAttr;
 }
-
-// -------------------------------------------------------------------------
-// (+) class TextCharAttribList
-// -------------------------------------------------------------------------
 
 TextCharAttribList::TextCharAttribList()
 {
@@ -81,7 +72,7 @@
         mbHasEmptyAttribs = sal_True;
 
     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;
     for ( sal_uInt16 x = 0; x < nCount; x++ )
     {
@@ -105,9 +96,8 @@
 
 TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
 {
-    // Rueckwaerts, falls eins dort endet, das naechste startet.
-    // => Das startende gilt...
-
+    // backwards; if one ends there and the next starts there
+    // ==> the starting one counts
     for ( sal_uInt16 nAttr = size(); nAttr; )
     {
         TextCharAttrib* pAttr = GetAttrib( --nAttr );
@@ -149,8 +139,8 @@
 
 sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound )
 {
-    // Rueckwaerts, falls eins dort endet, das naechste startet.
-    // => Das startende gilt...
+    // backwards; if one ends there and the next starts there
+    // ==> the starting one counts
     for ( sal_uInt16 nAttr = size(); nAttr; )
     {
         TextCharAttrib* pAttr = GetAttrib( --nAttr );
@@ -197,10 +187,6 @@
     mbHasEmptyAttribs = sal_False;
 }
 
-// -------------------------------------------------------------------------
-// (+) class TextNode
-// -------------------------------------------------------------------------
-
 TextNode::TextNode( const String& rText ) :
     maText( rText )
 {
@@ -218,27 +204,28 @@
         TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
         if ( pAttrib->GetEnd() >= nIndex )
         {
-            // Alle Attribute hinter der Einfuegeposition verschieben...
+            // move all attributes (that are?) past the cursor
             if ( pAttrib->GetStart() > nIndex )
             {
                 pAttrib->MoveForward( nNew );
             }
-            // 0: Leeres Attribut expandieren, wenn an Einfuegestelle
+            // 0: expand empty attribute, if at cursor
             else if ( pAttrib->IsEmpty() )
             {
-                // Index nicht pruefen, leeres durfte nur dort liegen.
-                // Wenn spaeter doch Ueberpruefung:
-                //   Spezialfall: Start == 0; AbsLen == 1, nNew = 1 => Expand, weil durch 
Absatzumbruch!
+                // Do not check the index; empty one may only be here.
+                // If checking later anyway:
+                //   special case: Start == 0; AbsLen == 1, nNew = 1 => Expand due to new 
paragraph!
                 // Start <= nIndex, End >= nIndex => Start=End=nIndex!
+
+// TODO: why is the next line commented out?
 //              if ( pAttrib->GetStart() == nIndex )
                     pAttrib->Expand( nNew );
             }
-            // 1: Attribut startet davor, geht bis Index...
-            else if ( pAttrib->GetEnd() == nIndex ) // Start muss davor liegen
+            // 1: attribute starts before and reaches up to index
+            else if ( pAttrib->GetEnd() == nIndex ) // start must be before
             {
-                // Nur expandieren, wenn kein Feature,
-                // und wenn nicht in ExcludeListe!
-                // Sonst geht z.B. ein UL bis zum neuen ULDB, beide expandieren
+                // Only expand if no feature and not in Exclude list!
+                // Otherwise expand e.g. a UL to the new ULDB, expand both
                 if ( !maCharAttribs.FindEmptyAttrib( pAttrib->Which(), nIndex ) )
                 {
                     pAttrib->Expand( nNew );
@@ -246,18 +233,19 @@
                 else
                     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 ) )
             {
                 pAttrib->Expand( nNew );
             }
-            // 3: Attribut startet auf Index...
+            // 3: attribute starts at Index
             else if ( pAttrib->GetStart() == nIndex )
             {
                 if ( nIndex == 0 )
                 {
                     pAttrib->Expand( nNew );
-//                  bResort = sal_True;     // es gibt ja keine Features mehr...
+// TODO: why is the next line commented out?
+//                  bResort = sal_True;     // there are no more features
                 }
                 else
                     pAttrib->MoveForward( nNew );
@@ -287,33 +275,33 @@
         sal_Bool bDelAttr = sal_False;
         if ( pAttrib->GetEnd() >= nIndex )
         {
-            // Alles Attribute hinter der Einfuegeposition verschieben...
+            // move all attributes (that are?) past the cursor
             if ( pAttrib->GetStart() >= nEndChanges )
             {
                 pAttrib->MoveBackward( nDeleted );
             }
-            // 1. Innenliegende Attribute loeschen...
+            // 1. delete inner attributes
             else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() <= nEndChanges ) )
             {
-                // Spezialfall: Attrubt deckt genau den Bereich ab
-                // => als leeres Attribut behalten.
+                // special case: attribute covers the region exactly
+                // => keep as an empty attribute
                 if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) )
-                    pAttrib->GetEnd() = nIndex; // leer
+                    pAttrib->GetEnd() = nIndex; // empty
                 else
                     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 ) )
             {
-                if ( pAttrib->GetEnd() <= nEndChanges ) // endet drinnen
+                if ( pAttrib->GetEnd() <= nEndChanges ) // ends inside
                     pAttrib->GetEnd() = nIndex;
                 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 ) )
             {
-                // Features duerfen nicht expandieren!
+                // features are not allowed to expand!
                 pAttrib->GetStart() = nEndChanges;
                 pAttrib->MoveBackward( nDeleted );
             }
@@ -369,13 +357,13 @@
         TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
         if ( pAttrib->GetEnd() < nPos )
         {
-            // bleiben unveraendert....
+            // no change
             ;
         }
         else if ( pAttrib->GetEnd() == nPos )
         {
-            // muessen als leeres Attribut kopiert werden.
-            // !FindAttrib nur sinnvoll, wenn Rueckwaerts durch Liste!
+            // must be copied as an empty attribute
+            // !FindAttrib only sensible if traversing backwards through the list!
             if ( bKeepEndingAttribs && !pNew->maCharAttribs.FindAttrib( pAttrib->Which(), 0 ) )
             {
                 TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib );
@@ -386,20 +374,20 @@
         }
         else if ( pAttrib->IsInside( nPos ) || ( !nPos && !pAttrib->GetStart() ) )
         {
-            // Wenn ganz vorne gecuttet wird, muss das Attribut erhalten bleiben!
-            // muessen kopiert und geaendert werden
+            // If cutting at the very beginning, the attribute has to be
+            // copied and changed
             TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib );
             pNewAttrib->GetStart() = 0;
             pNewAttrib->GetEnd() = pAttrib->GetEnd()-nPos;
             pNew->maCharAttribs.InsertAttrib( pNewAttrib );
-            // stutzen:
+            // trim
             pAttrib->GetEnd() = nPos;
         }
         else
         {
             DBG_ASSERT( pAttrib->GetStart() >= nPos, "Start < 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 );
             pNew->maCharAttribs.InsertAttrib( pAttrib );
             pAttrib->GetStart() = pAttrib->GetStart() - nPos;
@@ -423,7 +411,7 @@
         sal_Bool bMelted = sal_False;
         if ( pAttrib->GetStart() == 0 )
         {
-            // Evtl koennen Attribute zusammengefasst werden:
+            // potentially merge attributes
             sal_uInt16 nTmpAttribs = maCharAttribs.Count();
             for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
             {
@@ -437,7 +425,7 @@
                         pTmpAttrib->GetEnd() =
                             pTmpAttrib->GetEnd() + pAttrib->GetLen();
                         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
                     }
                 }
             }
@@ -452,10 +440,6 @@
         }
     }
 }
-
-// -------------------------------------------------------------------------
-// (+) class TextDoc
-// -------------------------------------------------------------------------
 
 TextDoc::TextDoc()
 {
@@ -590,7 +574,7 @@
     sal_uInt16 nPrevLen = pLeft->GetText().Len();
     pLeft->Append( *pRight );
 
-    // der rechte verschwindet.
+    // the right paragraph vanishes
     sal_uLong nRight = maTextNodes.GetPos( pRight );
     maTextNodes.Remove( nRight );
     delete pRight;

-- 
To view, visit https://gerrit.libreoffice.org/3162
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f9e8dcda27a714628edaa5e1e8fd875c8f67593
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Christian M. Heller <christian.heller63@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.