[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 3 commits - default_images/introabout ooo_custom_images/dev ooo_custom_images/dev_nologo ooo_custom_images/nologo sd/inc sd/source solenv/gbuild solenv/inc xmloff/source

Armin Le Grand alg at apache.org
Sat Feb 15 03:07:58 CET 2014


 default_images/introabout/intro.png               |binary
 ooo_custom_images/dev/introabout/intro.png        |binary
 ooo_custom_images/dev_nologo/introabout/intro.png |binary
 ooo_custom_images/nologo/introabout/intro.png     |binary
 sd/inc/EffectMigration.hxx                        |    2 
 sd/source/core/EffectMigration.cxx                |  157 +++++++++++++++++++++-
 sd/source/ui/dlg/animobjs.cxx                     |   64 +++++---
 sd/source/ui/unoidl/unoobj.cxx                    |   31 +++-
 solenv/gbuild/platform/macosx.mk                  |    4 
 solenv/inc/unxmacc.mk                             |    8 -
 xmloff/source/draw/animimp.cxx                    |    5 
 11 files changed, 231 insertions(+), 40 deletions(-)

New commits:
commit 0f11a9d487744af6c50e9f1d547c22cd4bdeab48
Author: Armin Le Grand <alg at apache.org>
Date:   Sat Feb 15 01:16:09 2014 +0000

    i42894 added support for <presentation:animations> at import and creation

diff --git a/sd/inc/EffectMigration.hxx b/sd/inc/EffectMigration.hxx
index 15d431e..267c245 100644
--- a/sd/inc/EffectMigration.hxx
+++ b/sd/inc/EffectMigration.hxx
@@ -33,6 +33,7 @@ class SvxShape;
 class SdAnimationInfo;
 class SdrObject;
 class SdrPathObj;
+class SdrObjGroup;
 
 namespace sd {
 
@@ -75,6 +76,7 @@ public:
     static sal_Bool GetSoundOn( SvxShape* pShape );
 
     static void SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj );
+    static void CreateAnimatedGroup(SdrObjGroup& rGroupObj, SdPage& rPage);
 };
 
 } // end of namespace sd
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx
index 796cc19..dcd3ee7 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -19,17 +19,24 @@
  *
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sd.hxx"
 #include <com/sun/star/presentation/EffectNodeType.hpp>
 #include <com/sun/star/presentation/ShapeAnimationSubType.hpp>
 #include <com/sun/star/presentation/TextAnimationType.hpp>
 #include <com/sun/star/presentation/ParagraphTarget.hpp>
+#include <com/sun/star/animations/Event.hpp>
+#include <com/sun/star/animations/EventTrigger.hpp>
+#include <com/sun/star/animations/Timing.hpp>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/animations/AnimationFill.hpp>
+#include <com/sun/star/animations/XAnimate.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
 #include <svx/unoshape.hxx>
 #include <svx/svdotext.hxx>
 #include <svx/svdopath.hxx>
+#include <svx/svdogrp.hxx>
+#include <svx/svditer.hxx>
 #include "drawdoc.hxx"
 #include "sdpage.hxx"
 #include <CustomAnimationPreset.hxx>
@@ -42,15 +49,18 @@ using namespace ::sd;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::animations;
 using namespace ::com::sun::star::presentation;
-
 using ::com::sun::star::drawing::XShape;
 using ::rtl::OUString;
+using ::com::sun::star::lang::XMultiServiceFactory;
+using ::com::sun::star::drawing::XShape;
+using ::com::sun::star::beans::NamedValue;
 
 struct deprecated_FadeEffect_conversion_table_entry
 {
     FadeEffect  meFadeEffect;
     const sal_Char* mpPresetId;
 }
+
 deprecated_FadeEffect_conversion_table[] =
 {
 // OOo 1.x transitions
@@ -1363,4 +1373,145 @@ void EffectMigration::SetAnimationPath( SvxShape* pShape, SdrPathObj* pPathObj )
     }
 }
 
+// --------------------------------------------------------------------
+
+static const OUString aServiceNameParallelTimeContainer(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.animations.ParallelTimeContainer"));
+static const OUString aServiceNameAnimateSet(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.animations.AnimateSet"));
+
+// #42894# helper which creates the needed XAnimate for changing visibility and all the (currently) needed embeddings
+void createVisibilityOnOffNode(Reference< XTimeContainer >& rxParentContainer, SdrObject& rCandidate, bool bVisible, bool bOnClick, double fDuration)
+{
+    Reference< XMultiServiceFactory > xMsf(::comphelper::getProcessServiceFactory());
+    Any aAny;
+
+    // create par container node
+    Reference< XAnimationNode > xOuterSeqTimeContainer(xMsf->createInstance(aServiceNameParallelTimeContainer), UNO_QUERY_THROW);
+
+    // set begin
+    aAny <<= (double)(0.0);
+    xOuterSeqTimeContainer->setBegin(aAny);
+
+    // set fill
+    xOuterSeqTimeContainer->setFill(AnimationFill::HOLD);
+
+    // set named values
+    Sequence< NamedValue > aUserDataSequence;
+    aUserDataSequence.realloc(1);
+
+    aUserDataSequence[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("node-type"));
+    aUserDataSequence[0].Value <<= bOnClick ? EffectNodeType::ON_CLICK : EffectNodeType::AFTER_PREVIOUS;
+
+    xOuterSeqTimeContainer->setUserData(aUserDataSequence);
+
+    // create animate set to change visibility for rCandidate
+    Reference< XAnimationNode > xAnimateSetForLast(xMsf->createInstance(aServiceNameAnimateSet), UNO_QUERY_THROW);
+
+    // set begin
+    aAny <<= (double)(0.0);
+    xAnimateSetForLast->setBegin(aAny);
+
+    // set duration
+    aAny <<= fDuration;
+    xAnimateSetForLast->setDuration(aAny);
+
+    // set fill
+    xAnimateSetForLast->setFill(AnimationFill::HOLD);
+
+    // set target
+    Reference< XAnimate > xAnimate(xAnimateSetForLast, UNO_QUERY);
+    Reference< XShape > xTargetShape(rCandidate.getUnoShape(), UNO_QUERY);
+    aAny <<= xTargetShape;
+    xAnimate->setTarget(aAny);
+
+    // set AttributeName
+    xAnimate->setAttributeName(OUString(RTL_CONSTASCII_USTRINGPARAM("Visibility")));
+
+    // set attribute value
+    aAny <<= bVisible ? sal_True : sal_False;
+    xAnimate->setTo(aAny);
+
+    // ad set node to par node
+    Reference< XTimeContainer > xParentContainer(xOuterSeqTimeContainer, UNO_QUERY_THROW);
+    xParentContainer->appendChild(xAnimateSetForLast);
+
+    // add node
+    rxParentContainer->appendChild(xOuterSeqTimeContainer);
+}
+
+// #42894# older AOO formats supported animated group objects, that means all members of the group
+// were shown animated by showing one after the other. This is no longer supported, but the following
+// fallback will create the needed SMIL animation stuff. Unfortunately the members of the group
+// have to be moved directly to the page, else the (explained to be generic, thus I expected this to
+// work) animations will not work in slideshow
+void EffectMigration::CreateAnimatedGroup(SdrObjGroup& rGroupObj, SdPage& rPage)
+{
+    // aw080 will give a vector immeditately
+    SdrObjListIter aIter(rGroupObj);
+
+    if(aIter.Count())
+    {
+        boost::shared_ptr< sd::MainSequence > pMainSequence(rPage.getMainSequence());
+
+        if(pMainSequence.get())
+        {
+            std::vector< SdrObject* > aObjects;
+            aObjects.reserve(aIter.Count());
+
+            while(aIter.IsMore())
+            {
+                // do move to page rough with old/current stuff, will be different in aw080 anyways
+                SdrObject* pCandidate = aIter.Next();
+                rGroupObj.GetSubList()->NbcRemoveObject(pCandidate->GetOrdNum());
+                rPage.NbcInsertObject(pCandidate);
+                aObjects.push_back(pCandidate);
+            }
+
+            // create main node
+            Reference< XMultiServiceFactory > xMsf(::comphelper::getProcessServiceFactory());
+            Reference< XAnimationNode > xOuterSeqTimeContainer(xMsf->createInstance(aServiceNameParallelTimeContainer), UNO_QUERY_THROW);
+            Any aAny;
+
+            // set begin
+            aAny <<= (double)(0.0);
+            xOuterSeqTimeContainer->setBegin(aAny);
+
+            // prepare parent container
+            Reference< XTimeContainer > xParentContainer(xOuterSeqTimeContainer, UNO_QUERY_THROW);
+
+            // prepare loop over objects
+            SdrObject* pLast = 0;
+            SdrObject* pNext = 0;
+            const double fDurationShow(0.2);
+            const double fDurationHide(0.001);
+
+            for(sal_uInt32 a(0); a < aObjects.size(); a++)
+            {
+                pLast = pNext;
+                pNext = aObjects[a];
+
+                // create node
+                if(pLast)
+                {
+                    createVisibilityOnOffNode(xParentContainer, *pLast, false, false, fDurationHide);
+                }
+
+                if(pNext)
+                {
+                    createVisibilityOnOffNode(xParentContainer, *pNext, true, !a, fDurationShow);
+                }
+            }
+
+            // create end node
+            if(pNext)
+            {
+                createVisibilityOnOffNode(xParentContainer, *pNext, false, false, fDurationHide);
+            }
+
+            // add to main sequence and rebuild
+            pMainSequence->createEffects(xOuterSeqTimeContainer);
+            pMainSequence->rebuild();
+        }
+    }
+}
 
+// eof
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 49d193f..adbaf75 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -55,6 +55,9 @@
 #include <vcl/svapp.hxx>
 #endif
 
+// #42894#
+#include <EffectMigration.hxx>
+
 #include <string>
 #include <algorithm>
 
@@ -1232,36 +1235,43 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
             pClone->NbcMove( aMoveSize );
         }
 
-        // Animationsgruppe erzeugen
-        SdrObjGroup* pGroup   = new SdrObjGroup;
-        SdrObjList*  pObjList = pGroup->GetSubList();
+        // #42894# Caution(!) variable pPage looks right, but it is a page from the local
+        // document the dialog is using (!), so get the target page from the target view
+        SdPage* pTargetSdPage = dynamic_cast< SdPage* >(rView.GetSdrPageView() ? rView.GetSdrPageView()->GetPage() : 0);
 
-        for (i = 0; i < nCount; i++)
+        if(pTargetSdPage)
         {
-            // der Clone verbleibt im Animator; in die Gruppe kommt ein Clone
-            // des Clones
-            pClone = pPage->GetObj(i);
-            SdrObject* pCloneOfClone = pClone->Clone();
-            //SdrObject* pCloneOfClone = pPage->GetObj(i)->Clone();
-            pObjList->InsertObject(pCloneOfClone, LIST_APPEND);
-        }
+            // Animationsgruppe erzeugen
+            SdrObjGroup* pGroup   = new SdrObjGroup;
+            SdrObjList*  pObjList = pGroup->GetSubList();
+
+            for (i = 0; i < nCount; i++)
+            {
+                // der Clone verbleibt im Animator; in die Gruppe kommt ein Clone
+                // des Clones
+                pClone = pPage->GetObj(i);
+                SdrObject* pCloneOfClone = pClone->Clone();
+                //SdrObject* pCloneOfClone = pPage->GetObj(i)->Clone();
+                pObjList->InsertObject(pCloneOfClone, LIST_APPEND);
+            }
 
-        // bis jetzt liegt die linke obere Ecke der Gruppe in der Fenstermitte;
-        // jetzt noch um die Haelfte der Groesse nach oben und links korrigieren
-        aTemp = aMaxSizeLog;
-        aTemp.Height() = - aTemp.Height() / 2;
-        aTemp.Width()  = - aTemp.Width() / 2;
-        pGroup->NbcMove(aTemp);
-
-        // Animationsinformation erzeugen
-        SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pGroup,true);
-        pInfo->meEffect = presentation::AnimationEffect_NONE;
-        pInfo->meSpeed = presentation::AnimationSpeed_MEDIUM;
-        pInfo->mbActive = sal_True;
-        pInfo->mbIsMovie = sal_True;
-        pInfo->maBlueScreen = COL_WHITE;
-
-        rView.InsertObjectAtView( pGroup, *pPV, SDRINSERT_SETDEFLAYER);
+            // bis jetzt liegt die linke obere Ecke der Gruppe in der Fenstermitte;
+            // jetzt noch um die Haelfte der Groesse nach oben und links korrigieren
+            aTemp = aMaxSizeLog;
+            aTemp.Height() = - aTemp.Height() / 2;
+            aTemp.Width()  = - aTemp.Width() / 2;
+            pGroup->NbcMove(aTemp);
+
+            // #42894# create needed SMIL stuff and move child objects to page directly (see
+            // comments at EffectMigration::CreateAnimatedGroup why this has to be done).
+            EffectMigration::CreateAnimatedGroup(*pGroup, *pTargetSdPage);
+
+            // #42894# if that worked, delete the group again
+            if(!pGroup->GetSubList()->GetObjCount())
+            {
+                delete pGroup;
+            }
+        }
     }
 
     ClickFirstHdl( this );
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 358f0ad..25dbe46 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -56,6 +56,7 @@
 #include "Outliner.hxx"
 #include "sdresid.hxx"
 #include <comphelper/serviceinfohelper.hxx>
+#include <svx/svdogrp.hxx>
 
 #include "anminfo.hxx"
 #include "unohelp.hxx"
@@ -542,17 +543,39 @@ void SAL_CALL SdXShape::setPropertyValue( const ::rtl::OUString& aPropertyName,
                     EffectMigration::SetAnimationSpeed( mpShape, eSpeed );
                     break;
                 }
-/* TODO??       case WID_ISANIMATION:
+                case WID_ISANIMATION:
                 {
+                    sal_Bool bIsAnimation(sal_False);
 
-                    sal_Bool bIsAnimation;
                     if(!(aValue >>= bIsAnimation))
+                    {
                         throw lang::IllegalArgumentException();
+                    }
+
+                    if(bIsAnimation)
+                    {
+                        SdrObjGroup* pGroup = dynamic_cast< SdrObjGroup* >(pObj);
+                        SdPage* pPage = dynamic_cast< SdPage* >(pGroup->GetPage());
 
-                    pInfo->mbIsMovie = bIsAnimation;
+                        if(pGroup && pPage)
+                        {
+                            // #42894# Animated Group object, migrate that effect
+                            EffectMigration::CreateAnimatedGroup(*pGroup, *pPage);
+
+                            // #42894# unfortunately when doing this all group members have to
+                            // be moved to the page as direct members, else the currently
+                            // available forms of animation do not work. If it succeeds,
+                            // the group is empty and can be removed and deleted
+                            if(!pGroup->GetSubList()->GetObjCount())
+                            {
+                                pPage->NbcRemoveObject(pGroup->GetOrdNum());
+                                delete pGroup;
+                            }
+                        }
+                    }
+                    //pInfo->mbIsMovie = bIsAnimation;
                     break;
                 }
-*/
                 case WID_BOOKMARK:
                 {
                     OUString aString;
diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx
index 1f63217..3676b85 100644
--- a/xmloff/source/draw/animimp.cxx
+++ b/xmloff/source/draw/animimp.cxx
@@ -615,8 +615,9 @@ void XMLAnimationsEffectContext::EndElement()
                     aAny <<= (sal_Bool)sal_True;
                     xSet->setPropertyValue( mpImpl->msIsAnimation, aAny );
 
-                    aAny <<= meSpeed;
-                    xSet->setPropertyValue( mpImpl->msSpeed, aAny );
+                    // #42894# speed is not supported for the old group animation fallback, so no need to set it
+                    // aAny <<= meSpeed;
+                    // xSet->setPropertyValue( mpImpl->msSpeed, aAny );
                 }
                 else
                 {
commit a04a229475a38600db57fdd40d97fa2e13283467
Author: Andre Fischer <af at apache.org>
Date:   Fri Feb 14 15:02:32 2014 +0000

    124224: Using the modern logo once again.

diff --git a/default_images/introabout/intro.png b/default_images/introabout/intro.png
index 767a177..6dcf860 100755
Binary files a/default_images/introabout/intro.png and b/default_images/introabout/intro.png differ
diff --git a/ooo_custom_images/dev/introabout/intro.png b/ooo_custom_images/dev/introabout/intro.png
index 9e9b893..bb7c747 100755
Binary files a/ooo_custom_images/dev/introabout/intro.png and b/ooo_custom_images/dev/introabout/intro.png differ
diff --git a/ooo_custom_images/dev_nologo/introabout/intro.png b/ooo_custom_images/dev_nologo/introabout/intro.png
index 5b66665..bb7c747 100755
Binary files a/ooo_custom_images/dev_nologo/introabout/intro.png and b/ooo_custom_images/dev_nologo/introabout/intro.png differ
diff --git a/ooo_custom_images/nologo/introabout/intro.png b/ooo_custom_images/nologo/introabout/intro.png
index 36f34bb..3c94ae0 100755
Binary files a/ooo_custom_images/nologo/introabout/intro.png and b/ooo_custom_images/nologo/introabout/intro.png differ
commit 2c73ea30530176cfc94d91b8dff2ca9e66ce7ea0
Author: Herbert Dürr <hdu at apache.org>
Date:   Fri Feb 14 13:44:34 2014 +0000

    #i114728# force target compatibility when building with a newer OSX SDK
    
    using OSX's MAC_OS_X_VERSION_MAX_ALLOWED define forces the build to be binary
    compatibile to the configured deployment target, even when the SDK version
    employed for building it is newer than the deployment target

diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 3391389..ac30fee 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -111,6 +111,10 @@ endif
 # (see toolkit module for a case where it is necessary to do it this way)
 gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions
 
+ifneq ($(MACOSX_DEPLOYMENT_TARGET),)
+	gb_CXXFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_$(subst .,_,$(MACOSX_DEPLOYMENT_TARGET))
+endif
+
 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
 gb_CFLAGS_WERROR := -Werror
 gb_CXXFLAGS_WERROR := -Werror
diff --git a/solenv/inc/unxmacc.mk b/solenv/inc/unxmacc.mk
index 3688420..dc65180 100644
--- a/solenv/inc/unxmacc.mk
+++ b/solenv/inc/unxmacc.mk
@@ -36,10 +36,10 @@ LINKOUTPUT_FILTER=
 #  compiling STLport sources too, either internally or externally.
 CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -D_USE_NAMESPACE=1
 
-# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build result
-# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
-# http://developer.apple.com/technotes/tn2002/tn2064.html
-# done in setsolar/configure now. left here for documentation
+.IF "$(MACOSX_DEPLOYMENT_TARGET)" != ""
+    CDEFS += -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_$(subst,.,_ $(MACOSX_DEPLOYMENT_TARGET))
+.ENDIF
+
 CDEFS+=-DQUARTZ 
 EXTRA_CDEFS*=-isysroot $(MACOSX_SDK_PATH)
 


More information about the Libreoffice-commits mailing list