[Libreoffice-commits] core.git: 2 commits - sw/source

Michael Stahl mstahl at redhat.com
Mon Jan 12 11:21:35 PST 2015


 sw/source/filter/ww8/ww8par6.cxx |   43 ++++++++++++++++-----------------------
 1 file changed, 18 insertions(+), 25 deletions(-)

New commits:
commit e71668c4e642cc497206bfbe7191f64bddf31db0
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Jan 12 20:02:29 2015 +0100

    sw: fdo#88005: fix check in SwWW8ImplReader::StopApo()
    
    404f16e97f1c2fcd8f9a1297bdfa46cba970467e is embarrassing crap; the real
    problem there is that the paragraph that should be removed is _inside_
    the frame, but in sf_68e4f217c107f6eada21adfe6e3c9c57-82055-minimized.doc
    the MoveInsideFly() is not called so a non-empty body paragraph was removed.
    
    Change-Id: I5d4443804c52a5fa30ddb51609ccbbee07abc5aa

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 2889fc0..aeb40d0 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2473,8 +2473,7 @@ void SwWW8ImplReader::StopApo()
         Color aBg(0xFE, 0xFF, 0xFF, 0xFF);  //Transparent by default
 
         SwTxtNode* pNd = aPref.GetNode().GetTxtNode();
-        if (pNd && &pPaM->GetPoint()->nNode.GetNode()
-                        != &pSFlyPara->pMainTextPos->nNode.GetNode())
+        if (pNd && pSFlyPara->pFlyFmt)
         {
             /*
             #i582#
commit 0a8d597cbfe1bf60b4e83257bd12f17e350b335c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Jan 12 20:02:01 2015 +0100

    sw: translate some german comments
    
    Change-Id: If189a60ae48a64cde109e52903c9a4b8b9fde85a

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index bc8de99..2889fc0 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2329,13 +2329,11 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo,
     if( !pWFlyPara->bGrafApo )
     {
 
-        // Innerhalb des GrafApo muessen Textattribute ignoriert werden, da
-        // sie sonst auf den folgenden Zeilen landen.  Der Rahmen wird nur
-        // eingefuegt, wenn er *nicht* nur zum Positionieren einer einzelnen
-        // Grafik dient.  Ist es ein Grafik-Rahmen, dann werden pWFlyPara und
-        // pSFlyPara behalten und die
-        // daraus resultierenden Attribute beim Einfuegen der Grafik auf die
-        // Grafik angewendet.
+        // Within the GrafApo text attributes have to be ignored, because
+        // they would apply to the following lines.  The frame is only inserted
+        // if it is not merely positioning a single image.  If it is an image
+        // frame, pWFlyPara and pSFlyPara are retained and the resulting
+        // attributes applied to the image when inserting the image.
 
         WW8FlySet aFlySet(*this, pWFlyPara, pSFlyPara, false);
 
@@ -2392,14 +2390,13 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo,
         if (pSFlyPara->pFlyFmt)
             MoveInsideFly(pSFlyPara->pFlyFmt);
 
-        // 1) ReadText() wird nicht wie beim W4W-Reader rekursiv aufgerufen,
-        //    da die Laenge des Apo zu diesen Zeitpunkt noch nicht feststeht,
-        //    ReadText() diese Angabe aber braucht.
-        // 2) Der CtrlStck wird nicht neu erzeugt.
-        //    die Char-Attribute laufen weiter ( AErger mit SW-Attributen )
-        //    Paraattribute muessten am Ende jeden Absatzes zurueckgesetzt
-        //    sein, d.h. es duerften am Absatzende keine Paraattribute
-        //    auf dem Stack liegen
+        // 1) ReadText() is not called recursively because the length of
+        //    the Apo is unknown at that  time, and ReadText() needs it.
+        // 2) the CtrlStck is not re-created.
+        //    the Char attributes continue (trouble with Sw-attributes)
+        //    Para attributes must be reset at the end of every paragraph,
+        //    i.e. at the end of a paragraph there must not be para attributes
+        //    on the stack
     }
     return true;
 }
@@ -2413,7 +2410,7 @@ void wwSectionManager::JoinNode(const SwPosition &rPos, const SwNode &rNode)
 bool SwWW8ImplReader::JoinNode(SwPaM &rPam, bool bStealAttr)
 {
     bool bRet = false;
-    rPam.GetPoint()->nContent = 0;          // an den Anfang der Zeile gehen
+    rPam.GetPoint()->nContent = 0; // go to start of paragraph
 
     SwNodeIndex aPref(rPam.GetPoint()->nNode, -1);
 
@@ -2439,8 +2436,7 @@ void SwWW8ImplReader::StopApo()
         return;
     if (pWFlyPara->bGrafApo)
     {
-        // Grafik-Rahmen, der *nicht* eingefuegt wurde leeren Absatz incl.
-        // Attributen entfernen
+        // image frame that has not been inserted: delete empty paragraph + attr
         JoinNode(*pPaM, true);
 
     }
@@ -2541,10 +2537,8 @@ void SwWW8ImplReader::StopApo()
         }
 
         delete pSFlyPara->pMainTextPos, pSFlyPara->pMainTextPos = 0;
-
-// Damit die Frames bei Einfuegen in existierendes Doc erzeugt werden,
-// wird in fltshell.cxx beim Setzen des FltAnchor-Attributes
-// pFlyFrm->MakeFrms() gerufen
+// To create the SwFrms when inserting into an existing document, fltshell.cxx
+// will call pFlyFrm->MakeFrms() when setting the FltAnchor attribute
 
     }
 
@@ -2556,7 +2550,7 @@ void SwWW8ImplReader::StopApo()
     DELETEZ( pWFlyPara );
 }
 
-// TestSameApo() beantwortet die Frage, ob es dasselbe APO oder ein neues ist
+// TestSameApo() returns if it's the same Apo or a different one
 bool SwWW8ImplReader::TestSameApo(const ApoTestResults &rApo,
     const WW8_TablePos *pTabPos)
 {


More information about the Libreoffice-commits mailing list