[Libreoffice-commits] .: Branch 'libreoffice-3-4' - filter/source

Petr Mladek pmladek at kemper.freedesktop.org
Fri Apr 29 08:11:45 PDT 2011


 filter/source/msfilter/msdffimp.cxx |   15 +++++++++++----
 filter/source/msfilter/svdfppt.cxx  |   15 +++++++++++++++
 2 files changed, 26 insertions(+), 4 deletions(-)

New commits:
commit c386dedd5ba63704e59d417c54dd1f3c73688aec
Author: Radek Doulik <rodo at novell.com>
Date:   Fri Apr 29 17:11:19 2011 +0200

    svx-ppt-bullet-offset-fix.diff: bullet list paragraph indentation (bnc#593609)
    
    fixes TextRulerAtom record import, where we sometime ended up with bullet
    offsets close to 0xffff

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 4e695ea..a1c55c7 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4046,18 +4046,25 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
                             sal_uInt16 nLen = (sal_uInt16)aHd.nRecLen;
                             if(nLen)
                             {
+                                sal_uInt32 nMask;
                                 sal_uInt16 nVal1, nVal2, nVal3;
                                 sal_uInt16 nDefaultTab = 2540; // PPT def: 1 Inch //rOutliner.GetDefTab();
                                 sal_uInt16 nMostrightTab = 0;
                                 SfxItemSet aSet(rOutliner.GetEmptyItemSet());
                                 SvxTabStopItem aTabItem(0, 0, SVX_TAB_ADJUST_DEFAULT, EE_PARA_TABS);
 
-                                rSt >> nVal1;
-                                rSt >> nVal2;
+                                rSt >> nMask;
                                 nLen -= 4;
 
+                                if(nLen && (nMask & 0x0002))
+                                {
+                                    // number of indent levels
+                                    rSt >> nVal3;
+                                    nLen -= 2;
+                                }
+
                                 // Allg. TAB verstellt auf Wert in nVal3
-                                if(nLen && (nVal1 & 0x0001))
+                                if(nLen && (nMask & 0x0001))
                                 {
                                     rSt >> nVal3;
                                     nLen -= 2;
@@ -4065,7 +4072,7 @@ bool SvxMSDffManager::ReadObjText(SvStream& rSt, SdrObject* pObj) const
                                 }
 
                                 // Weitere, frei gesetzte TABs
-                                if(nLen && (nVal1 & 0x0004))
+                                if(nLen && (nMask & 0x0004))
                                 {
                                     rSt >> nVal1;
                                     nLen -= 2;
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 95c7723..b773a08 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -4499,6 +4499,10 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerP
             sal_Int16	nTCount;
             sal_Int32	i;
             rIn >> mpImplRuler->nFlags;
+
+            // number of indent levels, unused now
+            if ( mpImplRuler->nFlags & 2 )
+                rIn >> nTCount;
             if ( mpImplRuler->nFlags & 1 )
                 rIn >> mpImplRuler->nDefaultTab;
             if ( mpImplRuler->nFlags & 4 )
@@ -4521,6 +4525,17 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerP
                     rIn >> mpImplRuler->nTextOfs[ i ];
                 if ( mpImplRuler->nFlags & ( 256 << i ) )
                     rIn >> mpImplRuler->nBulletOfs[ i ];
+                if( mpImplRuler->nBulletOfs[ i ] > 0x7fff) {
+                    // workaround
+                    // when bullet offset is > 0x7fff, the paragraph should look like
+                    // *    first line text
+                    // second line text
+                    //
+                    // we add to bullet para indent 0xffff - bullet offset. it looks like
+                    // best we can do for now
+                    mpImplRuler->nTextOfs[ i ] += 0xffff - mpImplRuler->nBulletOfs[ i ];
+                    mpImplRuler->nBulletOfs[ i ] = 0;
+                }
             }
         }
         rIn.Seek( nOldPos );


More information about the Libreoffice-commits mailing list