[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - 5 commits - filter/inc filter/source sd/source

Jan Holesovsky kendy at suse.cz
Mon May 13 02:00:58 PDT 2013


 filter/inc/filter/msfilter/svdfppt.hxx |    3 -
 filter/source/msfilter/svdfppt.cxx     |   11 ++++--
 sd/source/filter/ppt/pptin.cxx         |   57 ++++++---------------------------
 3 files changed, 20 insertions(+), 51 deletions(-)

New commits:
commit 4255f70fcf660900e9bcbadffec60015cb4c2502
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Sun May 12 17:33:22 2013 +0200

    bnc#758621: Set the attribs for the entire para if a placeholder.
    
    Setting attributes for empty paragraphs does nothing, we have to apply it to
    the style directly.
    
    Change-Id: Id2a63c961e408906fa7c6457091405692262c6b7

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index f1e1a75..5185298 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2286,6 +2286,14 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
                     }
                     pPortion->ApplyTo( aPortionAttribs, (SdrPowerPointImport&)*this, nDestinationInstance, pTextObj );
                     rOutliner.QuickSetAttribs( aPortionAttribs, aSelection );
+
+                    // set the attribs for the entire paragraph, if it is a placeholder
+                    if ( pTextObj->GetOEPlaceHolderAtom() && aSelection.nStartPos == aSelection.nEndPos )
+                    {
+                        SfxItemSet& rItemSet = rOutliner.GetStyleSheet( nParaIndex )->GetItemSet();
+                        pPortion->ApplyTo( rItemSet, (SdrPowerPointImport&)*this, nDestinationInstance, pTextObj );
+                    }
+
                     aSelection.nStartPos = aSelection.nEndPos;
                 }
                 boost::optional< sal_Int16 > oStartNumbering;
commit fc3fc4f1af182816a575751746564dae525f2e71
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri May 10 20:27:40 2013 +0200

    bnc#758621: Set presentation object as non-empty only if not a placeholder.
    
    Based on work of Felix Zhang <fezhang at suse.com>, thank you!
    
    Change-Id: I26c7cef17b9a5f3d73107b5c974983e58c347d52

diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 476eed8..1e15c3d 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2321,8 +2321,6 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
                     sal_Bool    bVertical = sal_False;
                     if ( ( pTextObj->GetShapeType() == mso_sptRectangle ) || ( pTextObj->GetShapeType() == mso_sptTextBox ) )
                     {
-                        if ( pTextObj->Count() )
-                            bEmptyPresObj = sal_False;
                         switch ( nPlaceholderId )
                         {
                             case PPT_PLACEHOLDER_NOTESBODY :            ePresObjKind = PRESOBJ_NOTES;   break;
@@ -2337,7 +2335,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
 
                             default :
                             {
-                                if ( !pTextObj->Count() )
+                                if ( pTextObj->Count() == 0 )
                                 {
                                     switch ( nPlaceholderId )
                                     {
@@ -2349,6 +2347,8 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
                                         case PPT_PLACEHOLDER_ORGANISZATIONCHART : ePresObjKind = PRESOBJ_ORGCHART; break;
                                     }
                                 }
+                                else
+                                    bEmptyPresObj = sal_False;
                             };
                         }
                     }
commit e3abe3f1c7e4bb7c788de71a9c01dffb1c088332
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri May 10 19:56:04 2013 +0200

    bnc#758621: We don't need this index for anything.
    
    Worse, it prevents us to enter part of the code that we need to execute in
    some (valid) circumstances.
    
    Change-Id: I15084b5efa10fbd5cd0d42856c2745c93d6765da

diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 9d5b20e..476eed8 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2313,17 +2313,9 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
             {
                 sal_uInt32 nPlacementId = pPlaceHolder->nPlacementId;
                 sal_Int16 nPlaceholderId = pPlaceHolder->nPlaceholderId;
-                sal_uInt16 i = 0;
+
                 if ( eAktPageKind == PPT_SLIDEPAGE )
                 {
-                    for ( ; i < 8; i++ )
-                    {
-                        if ( pSlideLayout->aPlaceholderId[ i ] == nPlaceholderId )
-                            break;
-                    }
-                }
-                if ( i < 8 )
-                {
                     PresObjKind ePresObjKind = PRESOBJ_NONE;
                     sal_Bool    bEmptyPresObj = sal_True;
                     sal_Bool    bVertical = sal_False;
commit a6b3cc0212a13615909be47dd06d537d5d9429d5
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri May 10 19:48:06 2013 +0200

    bnc#758621: Kill unused aPlacementId, it is never set.
    
    Based on work of Felix Zhang <fezhang at suse.com>, thank you!
    
    Change-Id: I733a2b69d01f86bcaf0fa401671d475d9b4641a6

diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
index 79272f5..cb34b9a 100644
--- a/filter/inc/filter/msfilter/svdfppt.hxx
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -195,7 +195,6 @@ struct PptSlideLayoutAtom
 {
     sal_Int32           eLayout;                // 0..18
     sal_uInt8           aPlaceholderId[ 8 ];
-    sal_uLong           aPlacementId[ 8 ];
 
 public:
                         PptSlideLayoutAtom() { Clear(); }
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index beb774b..f1e1a75 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -289,10 +289,7 @@ void PptSlideLayoutAtom::Clear()
 {
     eLayout = 0;
     for ( sal_uInt16 i = 0; i < 8; i++ )
-    {
         aPlaceholderId[ i ] = 0;
-        aPlacementId[ i ] = 0;
-    }
 }
 
 SvStream& operator>>( SvStream& rIn, PptSlideLayoutAtom& rAtom )
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 8fa0545..9d5b20e 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2311,6 +2311,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
             const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
             if ( pSlideLayout || ( eAktPageKind == PPT_NOTEPAGE ) )
             {
+                sal_uInt32 nPlacementId = pPlaceHolder->nPlacementId;
                 sal_Int16 nPlaceholderId = pPlaceHolder->nPlaceholderId;
                 sal_uInt16 i = 0;
                 if ( eAktPageKind == PPT_SLIDEPAGE )
@@ -2390,7 +2391,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
                             ApplyAttributes( rStCtrl, aSet );
                             pPresObj->SetMergedItemSet(aSet);
 
-                            if ( ( eAktPageKind != PPT_NOTEPAGE ) && ( pSlideLayout->aPlacementId[ i ] != (sal_uLong)-1 ) )
+                            if ( ( eAktPageKind != PPT_NOTEPAGE ) && ( nPlacementId != 0xffffffff ) )
                             {
                                 SdrObject* pTitleObj = ((SdPage&)pPage->TRG_GetMasterPage()).GetPresObj( PRESOBJ_TITLE );
                                 SdrObject* pOutlineObj = ((SdPage&)pPage->TRG_GetMasterPage()).GetPresObj( PRESOBJ_OUTLINE );
@@ -2409,7 +2410,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
                                 Rectangle aLogicRect( pPresObj->GetLogicRect() );
                                 Size      aLogicSize( aLogicRect.GetSize() );
 
-                                switch ( pSlideLayout->aPlacementId[ i ] )
+                                switch ( nPlacementId )
                                 {
                                     case 0 :            // Lage im Titelbereich
                                     {
commit 71fa700450e6fee186bc117e6d95a382d53ad2c4
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Mon May 13 10:45:18 2013 +0200

    Revert "bnc#758621: show preset texts in slide placeholder."
    
    This reverts commit 27a5c5c0c776d62cc219c2505e2df88ee1905a84.
    
    Mid-air collision :-)  I've been working on an improvement based on this patch
    when Muthu pushed it - the following commits are based on the Felix's work,
    thank you Felix!

diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
index e6a845b..79272f5 100644
--- a/filter/inc/filter/msfilter/svdfppt.hxx
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -1191,7 +1191,7 @@ struct ImplPPTTextObj
     explicit ImplPPTTextObj( PptSlidePersistEntry& rPersistEntry ) : mrPersistEntry ( rPersistEntry ) {};
 };
 
-class MSFILTER_DLLPUBLIC PPTTextObj
+class PPTTextObj
 {
     ImplPPTTextObj*         mpImplTextObj;
     void                    ImplClear();
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 37c2304..8fa0545 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2311,7 +2311,6 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
             const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
             if ( pSlideLayout || ( eAktPageKind == PPT_NOTEPAGE ) )
             {
-                sal_uInt32 nPlacementId = pPlaceHolder->nPlacementId;
                 sal_Int16 nPlaceholderId = pPlaceHolder->nPlaceholderId;
                 sal_uInt16 i = 0;
                 if ( eAktPageKind == PPT_SLIDEPAGE )
@@ -2322,7 +2321,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
                             break;
                     }
                 }
-                if ( i < 8 || nPlacementId == 0xffffffff )
+                if ( i < 8 )
                 {
                     PresObjKind ePresObjKind = PRESOBJ_NONE;
                     sal_Bool    bEmptyPresObj = sal_True;
@@ -2330,40 +2329,18 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
                     if ( ( pTextObj->GetShapeType() == mso_sptRectangle ) || ( pTextObj->GetShapeType() == mso_sptTextBox ) )
                     {
                         if ( pTextObj->Count() )
-                            if ( pTextObj->Count() > 1 || pTextObj->First()->GetTextSize() )
-                                bEmptyPresObj = sal_False;
+                            bEmptyPresObj = sal_False;
                         switch ( nPlaceholderId )
                         {
                             case PPT_PLACEHOLDER_NOTESBODY :            ePresObjKind = PRESOBJ_NOTES;   break;
                             case PPT_PLACEHOLDER_VERTICALTEXTTITLE :
                                 bVertical = sal_True;   // PASSTHROUGH !!!
-                            case PPT_PLACEHOLDER_TITLE :
-                            case PPT_PLACEHOLDER_CENTEREDTITLE :
-                                {
-                                    ePresObjKind = PRESOBJ_TITLE;
-                                    aPresentationText = pPage->GetPresObjText( ePresObjKind );
-                                    break;
-                                }
+                            case PPT_PLACEHOLDER_TITLE :                ePresObjKind = PRESOBJ_TITLE;   break;
                             case PPT_PLACEHOLDER_VERTICALTEXTBODY :
                                 bVertical = sal_True;   // PASSTHROUGH !!!
-                            case PPT_PLACEHOLDER_BODY :
-                                {
-                                    ePresObjKind = PRESOBJ_OUTLINE;
-                                    aPresentationText = pPage->GetPresObjText( ePresObjKind );
-                                    break;
-                                }
-                            case PPT_PLACEHOLDER_SUBTITLE :
-                                {
-                                    ePresObjKind = PRESOBJ_TEXT;
-                                    aPresentationText = pPage->GetPresObjText( ePresObjKind );
-                                    break;
-                                }
-                            case PPT_PLACEHOLDER_OBJECT :
-                                {
-                                    ePresObjKind = PRESOBJ_OBJECT;
-                                    aPresentationText = pPage->GetPresObjText( ePresObjKind );
-                                    break;
-                                }
+                            case PPT_PLACEHOLDER_BODY :                 ePresObjKind = PRESOBJ_OUTLINE; break;
+                            case PPT_PLACEHOLDER_CENTEREDTITLE :        ePresObjKind = PRESOBJ_TITLE;   break;
+                            case PPT_PLACEHOLDER_SUBTITLE :             ePresObjKind = PRESOBJ_TEXT;    break;      // PRESOBJ_OUTLINE
 
                             default :
                             {
@@ -2372,6 +2349,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
                                     switch ( nPlaceholderId )
                                     {
                                         case PPT_PLACEHOLDER_MEDIACLIP :
+                                        case PPT_PLACEHOLDER_OBJECT : ePresObjKind = PRESOBJ_OBJECT; break;
                                         case PPT_PLACEHOLDER_GRAPH : ePresObjKind = PRESOBJ_CHART; break;
                                         case PPT_PLACEHOLDER_TABLE : ePresObjKind = PRESOBJ_TABLE; break;
                                         case PPT_PLACEHOLDER_CLIPART : ePresObjKind = PRESOBJ_GRAPHIC; break;
@@ -2402,12 +2380,6 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj
                         if ( !bEmptyPresObj )
                         {
                             pPage->InsertPresObj( pRet, ePresObjKind );
-                            if ( !pText->HasText() )
-                            {
-                                SdrOutliner* pOutl = ((SdDrawDocument*)(pPage->GetModel()))->GetInternalOutliner();
-                                if ( aPresentationText.Len() )
-                                    pPage->SetObjText( (SdrTextObj*)pText, pOutl, ePresKind, aPresentationText );
-                            }
                         }
                         else
                         {


More information about the Libreoffice-commits mailing list