[Libreoffice-commits] core.git: Branch 'libreoffice-3-6' - sw/source

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Fri May 24 07:02:05 PDT 2013


 sw/source/filter/ww8/ww8par.cxx |  172 ++++++++++++++++++++--------------------
 1 file changed, 88 insertions(+), 84 deletions(-)

New commits:
commit b14f6849f297406e9308576d2a5ad22d295cc125
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Wed Feb 13 02:49:57 2013 +0100

    fdo#43105: apply old sw-nested-positionned-tables-ww8-import-fix.diff
    
    - replaced the really ugly goto hack though
    
    (cherry picked from commit ee1db992b98378b5e2f5e9aa8af0e36c375e582f)
    
    Change-Id: I14dfbe414dc16b634fbaca0a365e2e9ec37ab08e
    Reviewed-on: https://gerrit.libreoffice.org/2133
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
    Tested-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>
    Signed-off-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 1d245c2..5cf410f 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2251,113 +2251,117 @@ bool SwWW8ImplReader::ProcessSpecial(bool &rbReSync, WW8_CP nStartCp)
         if (!nCellLevel)
             nCellLevel = 0 != pPlcxMan->HasParaSprm(0x244B);
     }
-
-    WW8_TablePos *pTabPos=0;
-    WW8_TablePos aTabPos;
-    if (nCellLevel && !bVer67)
+    do
     {
-        WW8PLCFxSave1 aSave;
-        pPlcxMan->GetPap()->Save( aSave );
-        rbReSync = true;
-        WW8PLCFx_Cp_FKP* pPap = pPlcxMan->GetPapPLCF();
-        WW8_CP nMyStartCp=nStartCp;
+        WW8_TablePos *pTabPos=0;
+        WW8_TablePos aTabPos;
+        if(nCellLevel && !bVer67)
+        {
+            WW8PLCFxSave1 aSave;
+            pPlcxMan->GetPap()->Save( aSave );
+            rbReSync = true;
+            WW8PLCFx_Cp_FKP* pPap = pPlcxMan->GetPapPLCF();
+            WW8_CP nMyStartCp=nStartCp;
 
-        if (const sal_uInt8 *pLevel = pPlcxMan->HasParaSprm(0x6649))
-            nCellLevel = *pLevel;
+            if (const sal_uInt8 *pLevel = pPlcxMan->HasParaSprm(0x6649))
+                nCellLevel = *pLevel;
 
-        bool bHasRowEnd = SearchRowEnd(pPap, nMyStartCp, nCellLevel-1);
+            bool bHasRowEnd = SearchRowEnd(pPap, nMyStartCp, (nInTable<nCellLevel?nInTable:nCellLevel-1));
 
-        //Bad Table, remain unchanged in level, e.g. #i19667#
-        if (!bHasRowEnd)
-            nCellLevel = static_cast< sal_uInt8 >(nInTable);
+            //Bad Table, remain unchanged in level, e.g. #i19667#
+            if (!bHasRowEnd)
+                nCellLevel = static_cast< sal_uInt8 >(nInTable);
 
-        if (bHasRowEnd && ParseTabPos(&aTabPos,pPap))
-            pTabPos = &aTabPos;
+            if (bHasRowEnd && ParseTabPos(&aTabPos,pPap))
+                pTabPos = &aTabPos;
 
-        pPlcxMan->GetPap()->Restore( aSave );
-    }
+            pPlcxMan->GetPap()->Restore( aSave );
+        }
 
-//  then look if we are in an Apo
+    //  then look if we are in an Apo
 
-    ApoTestResults aApo = TestApo(nCellLevel, bTableRowEnd, pTabPos);
+        ApoTestResults aApo = TestApo(nCellLevel, bTableRowEnd, pTabPos);
 
-    //look to see if we are in a Table, but Table in foot/end note not allowed
-    bool bStartTab = (nInTable < nCellLevel) && !bFtnEdn;
+        //look to see if we are in a Table, but Table in foot/end note not allowed
+        bool bStartTab = (nInTable < nCellLevel) && !bFtnEdn;
 
-    bool bStopTab = bWasTabRowEnd && (nInTable > nCellLevel) && !bFtnEdn;
+        bool bStopTab = bWasTabRowEnd && (nInTable > nCellLevel) && !bFtnEdn;
 
-    bWasTabRowEnd = false;  // must be deactivated right here to prevent next
-                            // WW8TabDesc::TableCellEnd() from making nonsense
+        bWasTabRowEnd = false;  // must be deactivated right here to prevent next
+                                // WW8TabDesc::TableCellEnd() from making nonsense
 
-    if (nInTable && !bTableRowEnd && !bStopTab && (nInTable == nCellLevel && aApo.HasStartStop()))
-        bStopTab = bStartTab = true;    // Required to stop and start table
+        if (nInTable && !bTableRowEnd && !bStopTab && (nInTable == nCellLevel && aApo.HasStartStop()))
+            bStopTab = bStartTab = true;    // Required to stop and start table
 
-//  Dann auf Anl (Nummerierung) testen
-//  und dann alle Ereignisse in der richtigen Reihenfolge bearbeiten
+    //  Dann auf Anl (Nummerierung) testen
+    //  und dann alle Ereignisse in der richtigen Reihenfolge bearbeiten
 
-    if( bAnl && !bTableRowEnd )
-    {
-        const sal_uInt8* pSprm13 = pPlcxMan->HasParaSprm( 13 );
-        if( pSprm13 )
-        {                                   // Noch Anl ?
-            sal_uInt8 nT = static_cast< sal_uInt8 >(GetNumType( *pSprm13 ));
-            if( ( nT != WW8_Pause && nT != nWwNumType ) // Anl-Wechsel
-                || aApo.HasStartStop()                  // erzwungenes Anl-Ende
-                || bStopTab || bStartTab )
-            {
-                StopAnlToRestart(nT);  // Anl-Restart ( = Wechsel ) ueber sprms
+        if( bAnl && !bTableRowEnd )
+        {
+            const sal_uInt8* pSprm13 = pPlcxMan->HasParaSprm( 13 );
+            if( pSprm13 )
+            {                                   // Noch Anl ?
+                sal_uInt8 nT = static_cast< sal_uInt8 >(GetNumType( *pSprm13 ));
+                if( ( nT != WW8_Pause && nT != nWwNumType ) // Anl-Wechsel
+                    || aApo.HasStartStop()                  // erzwungenes Anl-Ende
+                    || bStopTab || bStartTab )
+                {
+                    StopAnlToRestart(nT);  // Anl-Restart ( = Wechsel ) ueber sprms
+                }
+                else
+                {
+                    NextAnlLine( pSprm13 );                 // naechste Anl-Zeile
+                }
             }
             else
-            {
-                NextAnlLine( pSprm13 );                 // naechste Anl-Zeile
+            {                                           // Anl normal zuende
+                StopAllAnl();                                  // Wirkliches Ende
             }
         }
-        else
-        {                                           // Anl normal zuende
-            StopAllAnl();                                  // Wirkliches Ende
+        if (bStopTab)
+        {
+            StopTable();
+            maApos.pop_back();
+            --nInTable;
+        }
+        if (aApo.mbStopApo)
+        {
+            StopApo();
+            maApos[nInTable] = false;
         }
-    }
-    if (bStopTab)
-    {
-        StopTable();
-        maApos.pop_back();
-        --nInTable;
-    }
-    if (aApo.mbStopApo)
-    {
-        StopApo();
-        maApos[nInTable] = false;
-    }
-
-    if (aApo.mbStartApo)
-    {
-        maApos[nInTable] = StartApo(aApo, pTabPos);
-        // nach StartApo ist ein ReSync noetig ( eigentlich nur, falls die Apo
-        // ueber eine FKP-Grenze geht
-        rbReSync = true;
-    }
-    if (bStartTab)
-    {
-        WW8PLCFxSave1 aSave;
-        pPlcxMan->GetPap()->Save( aSave );
 
-        if (bAnl)                           // Nummerierung ueber Zellengrenzen
-            StopAllAnl();                   // fuehrt zu Absturz -> keine Anls
-                                            // in Tabellen
-        while (nInTable < nCellLevel)
+        if (aApo.mbStartApo)
         {
-            if (StartTable(nStartCp))
-                ++nInTable;
-            else
-                break;
+            maApos[nInTable] = StartApo(aApo, pTabPos);
+            // nach StartApo ist ein ReSync noetig ( eigentlich nur, falls die Apo
+            // ueber eine FKP-Grenze geht
+            rbReSync = true;
+        }
+        if (bStartTab)
+        {
+            WW8PLCFxSave1 aSave;
+            pPlcxMan->GetPap()->Save( aSave );
 
-            maApos.push_back(false);
+            if (bAnl)                           // Nummerierung ueber Zellengrenzen
+                StopAllAnl();                   // fuehrt zu Absturz -> keine Anls
+                                                // in Tabellen
+            if(nInTable < nCellLevel)
+            {
+                if (StartTable(nStartCp))
+                    ++nInTable;
+                else
+                    break;
+                maApos.push_back(false);
+            }
+            if(nInTable >= nCellLevel)
+            {
+                // nach StartTable ist ein ReSync noetig ( eigentlich nur, falls die
+                // Tabelle ueber eine FKP-Grenze geht
+                rbReSync = true;
+                pPlcxMan->GetPap()->Restore( aSave );
+            }
         }
-        // nach StartTable ist ein ReSync noetig ( eigentlich nur, falls die
-        // Tabelle ueber eine FKP-Grenze geht
-        rbReSync = true;
-        pPlcxMan->GetPap()->Restore( aSave );
-    }
+    } while (nInTable < nCellLevel);
     return bTableRowEnd;
 }
 


More information about the Libreoffice-commits mailing list