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

Xisco Fauli anistenis at gmail.com
Thu May 9 12:08:48 PDT 2013


 editeng/source/outliner/outliner.cxx |   10 ++++++++--
 filter/source/msfilter/svdfppt.cxx   |   22 +++++++---------------
 2 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit 17aa2d99a0537f230aa1bc7f0df40937462441eb
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Thu May 9 21:06:40 2013 +0200

    Related: #119477#, nBuStart is initialized as -1, an unsigned int is required
    
    Otherwise 65536 will be printed as the firt bullet
    
    Change-Id: Ie200c1c67a9b73321990a55940115ae30b9e7c37

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index c7cd534..d8fa17d 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2207,7 +2207,6 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
                 rOutliner.SetStyleSheet( 0, pSheet );
         }
         rOutliner.SetVertical( pTextObj->GetVertical() );
-        sal_Int16 nLastStartNumbering = -1;
         const PPTParagraphObj* pPreviousParagraph = NULL;
         for ( PPTParagraphObj* pPara = pTextObj->First(); pPara; pPara = pTextObj->Next() )
         {
@@ -2303,7 +2302,6 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
                 if ( !nIsBullet2 )
                     aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, sal_False ) );
 
-
                 pPreviousParagraph = pPara;
                 if ( !aSelection.nStartPos )    // in PPT empty paragraphs never gets a bullet
                 {
@@ -3582,7 +3580,7 @@ sal_Bool PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rM
         sal_Int16 nBuStart = *rStartNumbering;
         //The Seventh bit of nBuFlags that specifies whether fBulletHasAutoNumber exists,
         //and fBulletHasAutoNumber that specifies whether this paragraph has an automatic numbering scheme.
-        if ( ( nBuFlags & 0x02000000 ) && ( nBuStart != 1 ))
+        if ( ( nBuFlags & 0x02000000 ) && ( nBuStart != -1 ))
         {
             rNumberFormat.SetStart( static_cast<sal_uInt16>(nBuStart) );
         }
commit 3ba0e7ad7ad1c85a87acbef354fb423470472017
Author: Sun Ying <sunying at apache.org>
Date:   Wed Sep 19 07:09:20 2012 +0000

    #119477# fix bullet's start with error when save .ppt file
    
    Reported by: Liu Ping Tan
    Patch by: Ying Sun
    Review by: Steve Yin.

diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 8029501..c28ca80 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1888,10 +1888,16 @@ sal_uInt16 Outliner::ImplGetNumbering( sal_uInt16 nPara, const SvxNumberFormat*
         if( pFmt == 0 )
             continue; // ignore paragraphs without bullets
 
-        // check if numbering is the same
-        if( !isSameNumbering( *pFmt, *pParaFmt ) )
+        // check if numbering less than or equal to pParaFmt
+        if( !isSameNumbering( *pFmt, *pParaFmt ) || ( pFmt->GetStart() < pParaFmt->GetStart() ) )
             break;
 
+        if (  pFmt->GetStart() > pParaFmt->GetStart() )
+        {
+           nNumber += pFmt->GetStart() - pParaFmt->GetStart();
+           pParaFmt = pFmt;
+        }
+
         const SfxBoolItem& rBulletState = (const SfxBoolItem&) pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE );
 
         if( rBulletState.GetValue() )
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 1914c55..c7cd534 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2303,19 +2303,6 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
                 if ( !nIsBullet2 )
                     aParagraphAttribs.Put( SfxBoolItem( EE_PARA_BULLETSTATE, sal_False ) );
 
-                if ( oStartNumbering )
-                {
-                    if ( *oStartNumbering != nLastStartNumbering )
-                        rOutliner.SetNumberingStartValue( nParaIndex, *oStartNumbering );
-                    else
-                        rOutliner.SetNumberingStartValue( nParaIndex, -1 );
-                    nLastStartNumbering = *oStartNumbering;
-                }
-                else
-                {
-                    nLastStartNumbering = -1;
-                    rOutliner.SetNumberingStartValue( nParaIndex, nLastStartNumbering );
-                }
 
                 pPreviousParagraph = pPara;
                 if ( !aSelection.nStartPos )    // in PPT empty paragraphs never gets a bullet
@@ -3592,6 +3579,13 @@ sal_Bool PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rM
             break;
         }
         rStartNumbering = boost::optional< sal_Int16 >( nAnmScheme >> 16 );
+        sal_Int16 nBuStart = *rStartNumbering;
+        //The Seventh bit of nBuFlags that specifies whether fBulletHasAutoNumber exists,
+        //and fBulletHasAutoNumber that specifies whether this paragraph has an automatic numbering scheme.
+        if ( ( nBuFlags & 0x02000000 ) && ( nBuStart != 1 ))
+        {
+            rNumberFormat.SetStart( static_cast<sal_uInt16>(nBuStart) );
+        }
     }
     return bHardAttribute;
 }


More information about the Libreoffice-commits mailing list