openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1579184 [21/33] - in /openoffice/branches/alg_writerframes: ./ ext_sources/ extras/l10n/source/de/ extras/l10n/source/es/ extras/l10n/source/eu/ extras/l10n/source/hi/ extras/l10n/source/kk/ extras/l10n/source/lt/ extras/l10n/source/nb/ ex...
Date Wed, 19 Mar 2014 10:15:07 GMT
Modified: openoffice/branches/alg_writerframes/main/sd/source/core/EffectMigration.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/core/EffectMigration.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/core/EffectMigration.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/core/EffectMigration.cxx Wed Mar 19 10:14:42 2014
@@ -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( 
 	}
 }
 
+// --------------------------------------------------------------------
+
+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

Modified: openoffice/branches/alg_writerframes/main/sd/source/filter/xml/sdxmlwrp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/filter/xml/sdxmlwrp.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/filter/xml/sdxmlwrp.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/filter/xml/sdxmlwrp.cxx Wed Mar 19 10:14:42 2014
@@ -791,7 +791,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& n
 
             bool bTransform = false;
 
-			if( (nRet == 0) )
+			if( nRet == 0 )
             {
                 if( sBuildId.getLength() )
 			    {

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx Wed Mar 19 10:14:42 2014
@@ -876,7 +876,8 @@ uno::Any SAL_CALL AccessibleDocumentView
 			sValue += sName;
 			sValue += String::CreateFromInt32(pDrViewSh->GetPageTabControl()->GetPageCount()) ;
 			sValue +=  rtl::OUString::createFromAscii(";");
-		if(pDrViewSh->IsLayerModeActive() )
+
+        if(pDrViewSh->IsLayerModeActive() && pDrViewSh->GetLayerTabControl()) // #87182#
 		{
 			sName = rtl::OUString::createFromAscii("page-name:");
 			sValue = sName;

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/animations/CustomAnimationDialog.src
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/animations/CustomAnimationDialog.src?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/animations/CustomAnimationDialog.src (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/animations/CustomAnimationDialog.src Wed Mar 19 10:14:42 2014
@@ -242,7 +242,7 @@ TabPage RID_TP_CUSTOMANIMATION_EFFECT
 		Maximum = 9999 ;
 		DecimalDigits = 1 ;
 		Unit = FUNIT_CUSTOM ;
-		CustomUnitText [ en-US ] = "sec";
+		CustomUnitText [ en-US ] = " sec";
 		SpinSize = 5 ;
 		Hide = TRUE;
 	};
@@ -447,8 +447,7 @@ TabPage RID_TP_CUSTOMANIMATION_EFFECT
 		Minimum = 0 ;
 		Maximum = 1024 ;
 		DecimalDigits = 1 ;
-		Unit = FUNIT_CUSTOM ;
-		CustomUnitText [ en-US ] = "%";
+		Unit = FUNIT_PERCENT ;
 		SpinSize = 1 ;
 		
 	};
@@ -510,7 +509,7 @@ TabPage RID_TP_CUSTOMANIMATION_DURATION
 		Maximum = 9999 ;
 		DecimalDigits = 1 ;
 		Unit = FUNIT_CUSTOM ;
-		CustomUnitText [ en-US ] = "sec";
+		CustomUnitText [ en-US ] = " sec";
 		SpinSize = 5 ;
 	};
 
@@ -660,7 +659,7 @@ TabPage RID_TP_CUSTOMANIMATION_TEXT
 		Maximum = 9999 ;
 		DecimalDigits = 1 ;
 		Unit = FUNIT_CUSTOM ;
-		CustomUnitText [ en-US ] = "sec";
+		CustomUnitText [ en-US ] = " sec";
 		SpinSize = 5 ;
 	};
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/animations/CustomAnimationPane.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/animations/CustomAnimationPane.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/animations/CustomAnimationPane.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/animations/CustomAnimationPane.cxx Wed Mar 19 10:14:42 2014
@@ -352,7 +352,7 @@ IMPL_LINK(CustomAnimationPane,EventMulti
             // At this moment the controller may not yet been set at model
             // or ViewShellBase.  Take it from the view shell passed with
             // the event.
-            if (mrBase.GetMainViewShell() != NULL)
+            if( bool(mrBase.GetMainViewShell()) )
             {
 				if( mrBase.GetMainViewShell()->GetShellType() == ViewShell::ST_IMPRESS )
 				{

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/animations/SlideTransitionPane.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/animations/SlideTransitionPane.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/animations/SlideTransitionPane.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/animations/SlideTransitionPane.cxx Wed Mar 19 10:14:42 2014
@@ -1190,7 +1190,7 @@ IMPL_LINK(SlideTransitionPane,EventMulti
                 // At this moment the controller may not yet been set at
                 // model or ViewShellBase.  Take it from the view shell
                 // passed with the event.
-                if (mrBase.GetMainViewShell() != NULL)
+                if( bool(mrBase.GetMainViewShell()) )
                 {
                     mxView = Reference<drawing::XDrawView>::query(mrBase.GetController());
                     onSelectionChanged();

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/animations/SlideTransitionPane.src
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/animations/SlideTransitionPane.src?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/animations/SlideTransitionPane.src (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/animations/SlideTransitionPane.src Wed Mar 19 10:14:42 2014
@@ -156,7 +156,7 @@ Control DLG_SLIDE_TRANSITION_PANE
 		SpinSize = 1 ;
 
 		Unit = FUNIT_CUSTOM ;
-		CustomUnitText [ en-US ] = "sec";
+		CustomUnitText [ en-US ] = " sec";
 	};
 
     FixedLine FL_EMPTY1

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/app/sdxfer.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/app/sdxfer.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/app/sdxfer.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/app/sdxfer.cxx Wed Mar 19 10:14:42 2014
@@ -440,12 +440,14 @@ void SdTransferable::AddSupportedFormats
 
 		    if( mpGraphic->GetType() == GRAPHIC_BITMAP )
 		    {
+			    AddFormat( SOT_FORMATSTR_ID_PNG );
 			    AddFormat( SOT_FORMAT_BITMAP );
 			    AddFormat( SOT_FORMAT_GDIMETAFILE );
 		    }
 		    else
 		    {
 			    AddFormat( SOT_FORMAT_GDIMETAFILE );
+			    AddFormat( SOT_FORMATSTR_ID_PNG );
 			    AddFormat( SOT_FORMAT_BITMAP );
 		    }
 	    }
@@ -461,6 +463,7 @@ void SdTransferable::AddSupportedFormats
 			if( !mpSdDrawDocument || !lcl_HasOnlyControls( mpSdDrawDocument ) )
 			{
 				AddFormat( SOT_FORMAT_GDIMETAFILE );
+				AddFormat( SOT_FORMATSTR_ID_PNG );
 				AddFormat( SOT_FORMAT_BITMAP );
 			}
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/dlg/animobjs.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/dlg/animobjs.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/dlg/animobjs.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/dlg/animobjs.cxx Wed Mar 19 10:14:42 2014
@@ -55,6 +55,9 @@
 #include <vcl/svapp.hxx>
 #endif
 
+// #42894# 
+#include <EffectMigration.hxx>
+
 #include <string>
 #include <algorithm>
 
@@ -1232,39 +1235,46 @@ void AnimationWindow::CreateAnimObj (::s
 			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);
+
+        if(pTargetSdPage)
+        {
+            // 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);
-		}
+            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;
+            // 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);
 
-		rView.InsertObjectAtView( pGroup, *pPV, SDRINSERT_SETDEFLAYER);
-	}
+            // #42894# if that worked, delete the group again
+            if(!pGroup->GetSubList()->GetObjCount())
+            {
+                delete pGroup;
+            }
+        }
+    }
 
-	ClickFirstHdl( this );
+    ClickFirstHdl( this );
 }
 
 void AnimationWindow::DataChanged( const DataChangedEvent& rDCEvt )

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/framework/factories/FullScreenPane.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/framework/factories/FullScreenPane.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/framework/factories/FullScreenPane.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/framework/factories/FullScreenPane.cxx Wed Mar 19 10:14:42 2014
@@ -161,7 +161,7 @@ void SAL_CALL FullScreenPane::setVisible
 
     if (mpWindow != NULL)
         mpWindow->Show(bIsVisible);
-    if (mpWorkWindow != NULL)
+    if( bool(mpWorkWindow))
         mpWorkWindow->Show(bIsVisible);
 }
 
@@ -173,7 +173,7 @@ Reference<accessibility::XAccessible> SA
 {
     ThrowIfDisposed();
 
-    if (mpWorkWindow != NULL)
+    if( bool(mpWorkWindow))
         return mpWorkWindow->GetAccessible(sal_False);
     else
         return NULL;

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/framework/factories/ViewShellWrapper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/framework/factories/ViewShellWrapper.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/framework/factories/ViewShellWrapper.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/framework/factories/ViewShellWrapper.cxx Wed Mar 19 10:14:42 2014
@@ -64,7 +64,7 @@ ViewShellWrapper::ViewShellWrapper (
     if (rxWindow.is())
     {
         rxWindow->addWindowListener(this);
-        if (pViewShell != NULL)
+        if( bool(pViewShell) )
         {
             pViewShell->Resize();
         }

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/func/fuinsert.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/func/fuinsert.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/func/fuinsert.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/func/fuinsert.cxx Wed Mar 19 10:14:42 2014
@@ -142,8 +142,18 @@ void FuInsertGraphic::DoExecute( SfxRequ
 			{
 				sal_Int8	nAction = DND_ACTION_COPY;
 				SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_GRAPHIC );
-				if( pPickObj )
-					nAction = DND_ACTION_LINK;
+                bool bSelectionReplaced(false);
+
+                if( pPickObj )
+                {
+                    nAction = DND_ACTION_LINK;
+                }
+                else if(1 == mpView->GetMarkedObjectCount())
+                {
+                    pPickObj = mpView->GetMarkedObjectByIndex(0);
+                    nAction = DND_ACTION_MOVE;
+                    bSelectionReplaced = true;
+                }
 
 				Point aPos;
 				Rectangle aRect(aPos, mpWindow->GetOutputSizePixel() );
@@ -158,6 +168,11 @@ void FuInsertGraphic::DoExecute( SfxRequ
 					String aPath(aDlg.GetPath());
 					pGrafObj->SetGraphicLink(aPath, aFltName);
 				}
+
+                if(bSelectionReplaced && pGrafObj)
+                {
+                    mpView->MarkObj(pGrafObj, mpView->GetSdrPageView());
+                }
 			}
 		}
 		else
@@ -363,7 +378,15 @@ void FuInsertOLE::DoExecute( SfxRequest&
 					pPage->InsertPresObj( pOleObj, ePresObjKind );
 					pOleObj->SetUserCall(pPickObj->GetUserCall());
 				}
-			}
+
+                // #123468# we need to end text edit before replacing the object. There cannot yet
+                // being text typed (else it would not be an EmptyPresObj anymore), but it may be
+                // in text edit mode
+                if(mpView->IsTextEdit())
+                {
+                    mpView->SdrEndTextEdit();
+                }
+            }
 
 			bool bRet = true;
 			if( pPickObj )

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/MasterPageContainer.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/MasterPageContainer.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/MasterPageContainer.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/MasterPageContainer.cxx Wed Mar 19 10:14:42 2014
@@ -699,7 +699,7 @@ void MasterPageContainer::Implementation
     MasterPageContainerType::const_iterator iDescriptor;
     MasterPageContainerType::const_iterator iContainerEnd(maContainer.end());
     for (iDescriptor=maContainer.begin(); iDescriptor!=iContainerEnd; ++iDescriptor)
-        if (*iDescriptor!=NULL && (*iDescriptor)->mpMasterPage != NULL)
+        if( bool(*iDescriptor) && (*iDescriptor)->mpMasterPage != NULL)
         {
             Size aPageSize ((*iDescriptor)->mpMasterPage->GetSize());
             nWidth = aPageSize.Width();

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/MasterPageObserver.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/MasterPageObserver.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/MasterPageObserver.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/MasterPageObserver.cxx Wed Mar 19 10:14:42 2014
@@ -186,7 +186,7 @@ void MasterPageObserver::Implementation:
     SdDrawDocument& rDocument)
 {
     // Gather the names of all the master pages in the given document.
-    MasterPageContainer::data_type aMasterPageSet;
+    MasterPageContainer::mapped_type aMasterPageSet;
     sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD);
     for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++)
     {

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/PanelBase.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/PanelBase.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/PanelBase.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/sidebar/PanelBase.cxx Wed Mar 19 10:14:42 2014
@@ -106,7 +106,7 @@ void PanelBase::Resize (void)
 void PanelBase::SetSidebar (const cssu::Reference<css::ui::XSidebar>& rxSidebar)
 {
     mxSidebar = rxSidebar;
-    if (mxSidebar.is() && mpWrappedControl!=NULL)
+    if (mxSidebar.is() && bool(mpWrappedControl))
         mxSidebar->requestLayout();
 }
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slideshow/slideshowimpl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slideshow/slideshowimpl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slideshow/slideshowimpl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slideshow/slideshowimpl.cxx Wed Mar 19 10:14:42 2014
@@ -3381,7 +3381,7 @@ void SlideshowImpl::gotoPreviousSlide (c
 		const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
 		if( eMode == SHOWWINDOWMODE_END )
 		{
-			const sal_Int32 nLastSlideIndex = mpSlideController->getSlideIndexCount() - 1;
+			const sal_Int32 nLastSlideIndex = mpSlideController->getCurrentSlideIndex();
 			if( nLastSlideIndex >= 0 )
 				mpShowWindow->RestartShow( nLastSlideIndex );
 		}

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlideSorterController.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlideSorterController.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlideSorterController.cxx Wed Mar 19 10:14:42 2014
@@ -665,7 +665,7 @@ IMPL_LINK(SlideSorterController, WindowE
                     : ViewShell::OUTPUT_DRAWMODE_COLOR);
                 if (mrSlideSorter.GetViewShell() != NULL)
                     mrSlideSorter.GetViewShell()->GetFrameView()->SetDrawMode(nDrawMode);
-                if (pActiveWindow != NULL)
+                if( bool(pActiveWindow) )
                     pActiveWindow->SetDrawMode(nDrawMode);
                 mrView.HandleDrawModeChange();
                 
@@ -946,6 +946,8 @@ void SlideSorterController::FinishEditMo
 {
     if (mrModel.GetEditMode() == EM_MASTERPAGE)
     {
+        mpPageSelector->DeselectAllPages();
+
         // Search for the master page that was determined in
         // PrepareEditModeChange() and make it the current page.
         PageEnumeration aAllPages (PageEnumerationProvider::CreateAllPagesEnumeration(mrModel));
@@ -955,16 +957,20 @@ void SlideSorterController::FinishEditMo
             if (pDescriptor->GetPage() == mpEditModeChangeMasterPage)
             {
                 GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
+                mpPageSelector->SelectPage(pDescriptor);
                 break;
             }
         }
     }
     else
     {
+        PageSelector::BroadcastLock aBroadcastLock (*mpPageSelector);
+
         SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(mnCurrentPageBeforeSwitch));
         GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
 
         // Restore the selection.
+        mpPageSelector->DeselectAllPages();
         ::std::vector<SdPage*>::iterator iPage;
         for (iPage=maSelectionBeforeSwitch.begin();
              iPage!=maSelectionBeforeSwitch.end();
@@ -1047,14 +1053,8 @@ void SlideSorterController::SetDocumentS
     {
         ModelChangeLock aLock (*this);
         PreModelChange();
-        
-        mrModel.SetDocumentSlides(rxSlides);
-        mrView.Layout();
 
-        // Select just the current slide.
-        PageSelector::BroadcastLock aBroadcastLock (*mpPageSelector);
-        mpPageSelector->DeselectAllPages();
-        mpPageSelector->SelectPage(mpCurrentSlideManager->GetCurrentSlide());
+        mrModel.SetDocumentSlides(rxSlides);
     }
 }
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx Wed Mar 19 10:14:42 2014
@@ -86,11 +86,14 @@ void CurrentSlideManager::NotifyCurrentS
 {
     if (mnCurrentSlideIndex != nSlideIndex)
     {
+        PageSelector::BroadcastLock aBroadcastLock (mrSlideSorter.GetController().GetPageSelector());
+
+        mrSlideSorter.GetController().GetPageSelector().DeselectAllPages();
+
         ReleaseCurrentSlide();
         AcquireCurrentSlide(nSlideIndex);
 
         // Update the selection.
-        mrSlideSorter.GetController().GetPageSelector().DeselectAllPages();
         if (mpCurrentSlide)
         {
             mrSlideSorter.GetController().GetPageSelector().SelectPage(mpCurrentSlide);

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsListener.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsListener.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsListener.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsListener.cxx Wed Mar 19 10:14:42 2014
@@ -501,11 +501,6 @@ void SAL_CALL Listener::propertyChange (
                     String(RTL_CONSTASCII_USTRINGPARAM("Number")));
                 sal_Int32 nCurrentPage = 0;
                 aPageNumber >>= nCurrentPage;
-                // The selection is already set but we call SelectPage()
-                // nevertheless in order to make the new current page the
-                // last recently selected page of the PageSelector.  This is
-                // used when making the selection visible.
-                mrController.GetPageSelector().SelectPage(nCurrentPage-1);
                 mrController.GetCurrentSlideManager()->NotifyCurrentSlideChange(nCurrentPage-1);
             }
             catch (beans::UnknownPropertyException aEvent)

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx Wed Mar 19 10:14:42 2014
@@ -65,7 +65,7 @@ PageSelector::PageSelector (SlideSorter&
       mpSelectionAnchor(),
       mpCurrentPage(),
       mnUpdateLockCount(0),
-      mbIsUpdateCurrentPagePending(false)
+      mbIsUpdateCurrentPagePending(true)
 {
     CountSelectedPages ();
 }
@@ -183,7 +183,7 @@ void PageSelector::SelectPage (const Sha
         mrSlideSorter.GetView().RequestRepaint(rpDescriptor);
 
         mpMostRecentlySelectedPage = rpDescriptor;
-        if (mpSelectionAnchor == NULL)
+        if( !bool(mpSelectionAnchor) )
             mpSelectionAnchor = rpDescriptor;
 
         if (mnBroadcastDisableLevel > 0)
@@ -393,27 +393,39 @@ void PageSelector::UpdateCurrentPage (co
     mbIsUpdateCurrentPagePending = false;
     
     // Make the first selected page the current page.
+    SharedPageDescriptor pCurrentPageDescriptor;
     const sal_Int32 nPageCount (GetPageCount());
     for (sal_Int32 nIndex=0; nIndex<nPageCount; ++nIndex)
     {
         SharedPageDescriptor pDescriptor (mrModel.GetPageDescriptor(nIndex));
-        if (pDescriptor && pDescriptor->HasState(PageDescriptor::ST_Selected))
+        if ( ! pDescriptor)
+            continue;
+        if (pDescriptor->HasState(PageDescriptor::ST_Selected))
         {
-            // Switching the current slide normally sets also the selection
-            // to just the new current slide.  To prevent that, we store
-            // (and at the end of this scope restore) the current selection.
-            ::boost::shared_ptr<PageSelection> pSelection (GetPageSelection());
-                
-            mrController.GetCurrentSlideManager()->SwitchCurrentSlide(pDescriptor);
-                
-            // Restore the selection and prevent a recursive call to
-            // UpdateCurrentPage().
-            SetPageSelection(pSelection, false);
-            return;
+            pCurrentPageDescriptor = pDescriptor;
+            break;
         }
     }
+    if ( ! pCurrentPageDescriptor && nPageCount>0)
+    {
+        // No page is selected.  Make the first slide the current page.
+        pCurrentPageDescriptor = mrModel.GetPageDescriptor(0);
+    }
 
-    // No page is selected.  Do not change the current slide.
+    if (pCurrentPageDescriptor)
+    {
+        // Switching the current slide normally sets also the
+        // selection to just the new current slide.  To prevent that,
+        // we store (and at the end of this scope restore) the current
+        // selection.
+        ::boost::shared_ptr<PageSelection> pSelection (GetPageSelection());
+                
+        mrController.GetCurrentSlideManager()->SwitchCurrentSlide(pCurrentPageDescriptor);
+                
+        // Restore the selection and prevent a recursive call to
+        // UpdateCurrentPage().
+        SetPageSelection(pSelection, false);
+    }
 }
 
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx Wed Mar 19 10:14:42 2014
@@ -91,12 +91,12 @@ void ScrollBarManager::LateInitializatio
 
 void ScrollBarManager::Connect (void)
 {
-    if (mpVerticalScrollBar != NULL)
+    if( bool(mpVerticalScrollBar))
     {
         mpVerticalScrollBar->SetScrollHdl (
             LINK(this, ScrollBarManager, VerticalScrollBarHandler));
     }
-    if (mpHorizontalScrollBar != NULL)
+    if( bool(mpHorizontalScrollBar))
     {
         mpHorizontalScrollBar->SetScrollHdl(
             LINK(this, ScrollBarManager, HorizontalScrollBarHandler));
@@ -108,11 +108,11 @@ void ScrollBarManager::Connect (void)
 
 void ScrollBarManager::Disconnect (void)
 {
-    if (mpVerticalScrollBar != NULL)
+    if( bool(mpVerticalScrollBar) )
     {
         mpVerticalScrollBar->SetScrollHdl (Link());
     }
-    if (mpHorizontalScrollBar != NULL)
+    if( bool(mpHorizontalScrollBar) )
     {
         mpHorizontalScrollBar->SetScrollHdl (Link());
     }
@@ -142,13 +142,13 @@ Rectangle ScrollBarManager::PlaceScrollB
         bIsHorizontalScrollBarAllowed,
         bIsVerticalScrollBarAllowed));
 
-    if (mpHorizontalScrollBar!=NULL && mpHorizontalScrollBar->IsVisible())
+    if( bool(mpHorizontalScrollBar) && mpHorizontalScrollBar->IsVisible())
         PlaceHorizontalScrollBar (rAvailableArea);
 
-    if (mpVerticalScrollBar!=NULL && mpVerticalScrollBar->IsVisible())
+    if( bool(mpVerticalScrollBar) && mpVerticalScrollBar->IsVisible())
         PlaceVerticalScrollBar (rAvailableArea);
 
-    if (mpScrollBarFiller!=NULL && mpScrollBarFiller->IsVisible())
+    if( bool(mpScrollBarFiller) && mpScrollBarFiller->IsVisible())
         PlaceFiller (rAvailableArea);
 
     return aRemainingSpace;
@@ -219,7 +219,7 @@ void ScrollBarManager::UpdateScrollBars 
 
     // The horizontal scroll bar is only shown when the window is
     // horizontally smaller than the view.
-    if (mpHorizontalScrollBar != NULL && mpHorizontalScrollBar->IsVisible())
+    if( bool(mpHorizontalScrollBar) && mpHorizontalScrollBar->IsVisible())
     {
         mpHorizontalScrollBar->Show();
         mpHorizontalScrollBar->SetRange (
@@ -249,7 +249,7 @@ void ScrollBarManager::UpdateScrollBars 
     }
 
     // The vertical scroll bar is always shown.
-    if (mpVerticalScrollBar != NULL && mpVerticalScrollBar->IsVisible())
+    if( bool(mpVerticalScrollBar) && mpVerticalScrollBar->IsVisible())
     {
         mpVerticalScrollBar->SetRange (
             Range(aModelArea.Top(), aModelArea.Bottom()));
@@ -298,7 +298,7 @@ IMPL_LINK(ScrollBarManager, VerticalScro
     if (pScrollBar!=NULL
         && pScrollBar==mpVerticalScrollBar.get()
         && pScrollBar->IsVisible()
-        && mrSlideSorter.GetContentWindow()!=NULL)
+        && bool(mrSlideSorter.GetContentWindow()) )
     {
         double nRelativePosition = double(pScrollBar->GetThumbPos())
             / double(pScrollBar->GetRange().Len());
@@ -317,7 +317,7 @@ IMPL_LINK(ScrollBarManager, HorizontalSc
     if (pScrollBar!=NULL 
         && pScrollBar==mpHorizontalScrollBar.get()
         && pScrollBar->IsVisible()
-        && mrSlideSorter.GetContentWindow()!=NULL)
+        && bool(mrSlideSorter.GetContentWindow()) )
     {
         double nRelativePosition = double(pScrollBar->GetThumbPos())
             / double(pScrollBar->GetRange().Len());
@@ -490,7 +490,7 @@ void ScrollBarManager::SetTopLeft (const
 
 sal_Int32 ScrollBarManager::GetTop (void) const
 {
-    if (mpVerticalScrollBar != NULL)
+    if( bool(mpVerticalScrollBar))
         return mpVerticalScrollBar->GetThumbPos();
     else
         return 0;
@@ -501,7 +501,7 @@ sal_Int32 ScrollBarManager::GetTop (void
 
 sal_Int32 ScrollBarManager::GetLeft (void) const
 {
-    if (mpHorizontalScrollBar != NULL)
+    if( bool(mpHorizontalScrollBar))
         return mpHorizontalScrollBar->GetThumbPos();
     else
         return 0;
@@ -512,7 +512,7 @@ sal_Int32 ScrollBarManager::GetLeft (voi
 
 int ScrollBarManager::GetVerticalScrollBarWidth (void) const
 {
-    if (mpVerticalScrollBar != NULL && mpVerticalScrollBar->IsVisible())
+    if( bool(mpVerticalScrollBar) && mpVerticalScrollBar->IsVisible())
         return mpVerticalScrollBar->GetSizePixel().Width();
     else
         return 0;
@@ -523,7 +523,7 @@ int ScrollBarManager::GetVerticalScrollB
 
 int ScrollBarManager::GetHorizontalScrollBarHeight (void) const
 {
-    if (mpHorizontalScrollBar != NULL && mpHorizontalScrollBar->IsVisible())
+    if( bool(mpHorizontalScrollBar) && mpHorizontalScrollBar->IsVisible())
         return mpHorizontalScrollBar->GetSizePixel().Height();
     else
         return 0;
@@ -545,7 +545,7 @@ void ScrollBarManager::CalcAutoScrollOff
         pWindow->LogicToPixel(mrSlideSorter.GetView().GetModelArea()));
 
     if (aWindowSize.Width() > maScrollBorder.Width() * 3
-        && mpHorizontalScrollBar != NULL
+        && bool(mpHorizontalScrollBar)
         && mpHorizontalScrollBar->IsVisible())
     {
         if (rMouseWindowPosition.X() < maScrollBorder.Width()

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx Wed Mar 19 10:14:42 2014
@@ -56,7 +56,7 @@ namespace sd { namespace slidesorter { n
 class DocumentPageContainer;
 
 inline sal_Int32 FromCoreIndex (const sal_uInt16 nCoreIndex) { return (nCoreIndex-1)/2; }
-inline sal_uInt16 ToCoreIndex (const sal_Int32 nIndex) { return nIndex*2+1; }
+inline sal_uInt16 ToCoreIndex (const sal_Int32 nIndex) { return static_cast<sal_uInt16>(nIndex*2+1); }
 
 /** The model of the slide sorter gives access to the slides that are to be
     displayed in the slide sorter view.  Via the SetDocumentSlides() method

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx Wed Mar 19 10:14:42 2014
@@ -110,9 +110,9 @@ public:
 
     view::Layouter& GetLayouter (void);
 
-	virtual void ModelHasChanged (void);
+    virtual void ModelHasChanged (void);
 
-	void LocalModelHasChanged(void);
+    void LocalModelHasChanged(void);
 
     /** This method is typically called before a model change takes place.
         All references to model data are released.  PostModelChange() has to

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/model/SlideSorterModel.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/model/SlideSorterModel.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/model/SlideSorterModel.cxx Wed Mar 19 10:14:42 2014
@@ -173,7 +173,6 @@ bool SlideSorterModel::SetEditMode (Edit
     {
         meEditMode = eEditMode;
         UpdatePageList();
-        ClearDescriptorList();
         bEditModeChanged = true;
     }
     return bEditModeChanged;
@@ -217,7 +216,7 @@ SharedPageDescriptor SlideSorterModel::G
     if (nPageIndex>=0 && nPageIndex<GetPageCount())
     {
         pDescriptor = maPageDescriptors[nPageIndex];
-        if (pDescriptor == NULL && bCreate && mxSlides.is())
+        if( !bool(pDescriptor) && bCreate && mxSlides.is())
         {
             SdPage* pPage = GetPage(nPageIndex);
             pDescriptor.reset(new PageDescriptor (
@@ -424,7 +423,8 @@ void SlideSorterModel::SynchronizeDocume
     while (aAllPages.HasMoreElements())
     {
         SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
-        pDescriptor->GetPage()->SetSelected(pDescriptor->HasState(PageDescriptor::ST_Selected));
+        const bool bIsSelected (pDescriptor->HasState(PageDescriptor::ST_Selected));
+        pDescriptor->GetPage()->SetSelected(bIsSelected);
     }
 }
 
@@ -439,7 +439,8 @@ void SlideSorterModel::SynchronizeModelS
     while (aAllPages.HasMoreElements())
     {
         SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
-        pDescriptor->SetState(PageDescriptor::ST_Selected, pDescriptor->GetPage()->IsSelected());
+        const bool bIsSelected (pDescriptor->GetPage()->IsSelected());
+        pDescriptor->SetState(PageDescriptor::ST_Selected, bIsSelected);
     }
 }
 
@@ -459,11 +460,29 @@ void SlideSorterModel::SetDocumentSlides
 {
     ::osl::MutexGuard aGuard (maMutex);
 
-    // Reset the current page so to cause everbody to release references to it.
+    // Make the current selection persistent and then release the
+    // current set of pages.
+    SynchronizeDocumentSelection();
+    mxSlides = NULL;
+    ClearDescriptorList ();
+
+    // Reset the current page to cause everbody to release references to it.
     mrSlideSorter.GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange(-1);
 
+    // Set the new set of pages.
     mxSlides = rxSlides;
-    Resync();
+    AdaptSize();
+    SynchronizeModelSelection();
+    mrSlideSorter.GetController().GetPageSelector().CountSelectedPages();
+
+    model::PageEnumeration aSelectedPages (
+        model::PageEnumerationProvider::CreateSelectedPagesEnumeration(*this));
+    if (aSelectedPages.HasMoreElements())
+    {
+        SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
+        mrSlideSorter.GetController().GetCurrentSlideManager()->NotifyCurrentSlideChange(
+            pDescriptor->GetPage());
+    }
 
     ViewShell* pViewShell = mrSlideSorter.GetViewShell();
     if (pViewShell != NULL)
@@ -667,7 +686,6 @@ void SlideSorterModel::InsertSlide (SdPa
 
     // Update page indices.
     UpdateIndices(nIndex+1);
-    OSL_TRACE("page inserted");
 }
 
 
@@ -705,7 +723,6 @@ void SlideSorterModel::DeleteSlide (cons
         maPageDescriptors.erase(maPageDescriptors.begin()+nIndex);
         UpdateIndices(nIndex);
     }
-    OSL_TRACE("page removed");
 }
 
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlideSorterView.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlideSorterView.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlideSorterView.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlideSorterView.cxx Wed Mar 19 10:14:42 2014
@@ -278,10 +278,10 @@ void SlideSorterView::ModelHasChanged (v
 
 void SlideSorterView::LocalModelHasChanged(void)
 {
-	mbModelChangedWhileModifyEnabled = false;
-
-	// First call our base class.
-	View::ModelHasChanged ();
+    mbModelChangedWhileModifyEnabled = false;
+    
+    // First call our base class.
+    View::ModelHasChanged ();
 }
 
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsButtonBar.cxx Wed Mar 19 10:14:42 2014
@@ -469,7 +469,7 @@ void ButtonBar::Paint (
 
 bool ButtonBar::IsMouseOverButton (void) const
 {
-    return mpButtonUnderMouse;
+    return (mpButtonUnderMouse.get() != NULL);
 }
 
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx Wed Mar 19 10:14:42 2014
@@ -254,7 +254,7 @@ void PageObjectPainter::PaintPreview (
         PageObjectLayouter::Preview,
         PageObjectLayouter::ModelCoordinateSystem));
 
-    if (mpCache != NULL)
+    if( bool(mpCache))
     {
         const SdrPage* pPage = rpDescriptor->GetPage();
         mpCache->SetPreciousFlag(pPage, true);

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx Wed Mar 19 10:14:42 2014
@@ -70,7 +70,9 @@ void ViewCacheContext::NotifyPreviewCrea
     }
     else
     {
-        OSL_ASSERT(pDescriptor);
+        // It is OK when a preview was created for a page that is not
+        // currently displayed because both normal and master pages are
+        // kept in the same cache.
     }
 }
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/unoidl/unoobj.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/unoidl/unoobj.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/unoidl/unoobj.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/unoidl/unoobj.cxx Wed Mar 19 10:14:42 2014
@@ -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
 					EffectMigration::SetAnimationSpeed( mpShape, eSpeed );
 					break;
 				}
-/* TODO??		case WID_ISANIMATION:
-				{
-
-					sal_Bool bIsAnimation;
-					if(!(aValue >>= bIsAnimation))
-						throw lang::IllegalArgumentException();
-
-					pInfo->mbIsMovie = bIsAnimation;
-					break;
-				}
-*/
+                case WID_ISANIMATION:
+                {
+                    sal_Bool bIsAnimation(sal_False);
+
+                    if(!(aValue >>= bIsAnimation))
+                    {
+                        throw lang::IllegalArgumentException();
+                    }
+
+                    if(bIsAnimation)
+                    {
+                        SdrObjGroup* pGroup = dynamic_cast< SdrObjGroup* >(pObj);
+                        SdPage* pPage = dynamic_cast< SdPage* >(pGroup->GetPage());
+
+                        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;

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/Outliner.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/Outliner.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/Outliner.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/Outliner.cxx Wed Mar 19 10:14:42 2014
@@ -685,7 +685,7 @@ bool Outliner::SearchAndReplaceOnce (voi
 		return true;
 
     ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
-	if (pViewShell != NULL)
+	if( bool(pViewShell))
 	{
 		mpView = pViewShell->GetView();
 		mpWindow = pViewShell->GetActiveWindow();
@@ -932,7 +932,7 @@ void Outliner::RestoreStartPosition (voi
         bRestore = false;
     // Dont't restore when the view shell is not valid.
     ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
-    if (pViewShell == NULL)
+    if( !bool(pViewShell))
         bRestore = false;
 
     if (bRestore)
@@ -1030,7 +1030,7 @@ void Outliner::ProvideNextTextObject (vo
                 PutTextIntoOutliner ();
 
                 ::boost::shared_ptr<ViewShell> pViewShell (mpWeakViewShell.lock());
-                if (pViewShell != NULL)
+                if( bool(pViewShell))
                     switch (meMode)
                     {
                         case SEARCH:

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/ViewShellBase.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/ViewShellBase.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/ViewShellBase.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/ViewShellBase.cxx Wed Mar 19 10:14:42 2014
@@ -1552,7 +1552,7 @@ void CurrentPageSetter::operator() (bool
 {
     FrameView* pFrameView = NULL;
 
-    if (mrBase.GetMainViewShell() != NULL)
+    if( bool(mrBase.GetMainViewShell()))
     {
         pFrameView = mrBase.GetMainViewShell()->GetFrameView();
     }

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/ViewShellManager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/ViewShellManager.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/ViewShellManager.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/ViewShellManager.cxx Wed Mar 19 10:14:42 2014
@@ -1228,7 +1228,7 @@ ShellDescriptor ViewShellManager::Implem
     for (FactoryList::const_iterator iFactory=aRange.first; iFactory!=aRange.second; ++iFactory)
     {
         SharedShellFactory pFactory = iFactory->second;
-        if (pFactory != NULL)
+        if( bool(pFactory))
             aResult.mpShell = pFactory->CreateShell(nShellId, pParentWindow, pFrameView);
 
         // Exit the loop when the shell has been successfully created.

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews1.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews1.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews1.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews1.cxx Wed Mar 19 10:14:42 2014
@@ -401,7 +401,13 @@ void DrawViewShell::ChangeEditMode(EditM
         GetViewShellBase().GetDrawController().BroadcastContextChange();
 
 		meEditMode = eEMode;
-		mbIsLayerModeActive = bIsLayerModeActive;
+
+        if(pLayerBar)
+        {
+            // #87182# only switch activation mode of LayerTabBar when there is one,
+            // else it will not get initialized with the current set of Layers as needed
+            mbIsLayerModeActive = bIsLayerModeActive;
+        }
 
         // Determine whether to show the master view toolbar.  The master
         // page mode has to be active and the shell must not be a handout
@@ -684,7 +690,11 @@ IMPL_LINK( DrawViewShell, TabSplitHdl, T
 	aTabSize.Width() = Min(pTab->GetSplitSize(), (long)(nMax-1));
 
 	maTabControl.SetSizePixel(aTabSize);
-	GetLayerTabControl()->SetSizePixel(aTabSize);
+
+    if(GetLayerTabControl()) // #87182#
+    {
+        GetLayerTabControl()->SetSizePixel(aTabSize);
+    }
 
 	Point aPos = maTabControl.GetPosPixel();
 	aPos.X() += aTabSize.Width();

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews3.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews3.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews3.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews3.cxx Wed Mar 19 10:14:42 2014
@@ -222,18 +222,35 @@ void  DrawViewShell::ExecCtrl(SfxRequest
 		case SID_SWITCHLAYER:  // BASIC
 		{
 			const SfxItemSet *pArgs = rReq.GetArgs ();
-			sal_uInt16 nCurPage = GetLayerTabControl()->GetCurPageId ();
 
-			if( pArgs && pArgs->Count () == 1)
-			{
-				SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
-				if( pWhatLayer )
-					nCurPage = (short) pWhatLayer->GetValue ();
-			}
+            // #87182#
+            bool bCurPageValid(false);
+            sal_uInt16 nCurPage(0);
+            
+            if(GetLayerTabControl())
+            {
+                nCurPage = GetLayerTabControl()->GetCurPageId();
+                bCurPageValid = true;
+            }
 
-			mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) );
-			Invalidate();
-			rReq.Done ();
+            if(pArgs && 1 == pArgs->Count())
+            {
+                SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False);
+
+                if(pWhatLayer)
+                {
+                    nCurPage = (short)pWhatLayer->GetValue();
+                    bCurPageValid = true;
+                }
+            }
+
+            if(bCurPageValid)
+            {
+                mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) );
+                Invalidate();
+            }
+
+            rReq.Done ();
 
 			break;
 		}

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews4.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews4.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews4.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews4.cxx Wed Mar 19 10:14:42 2014
@@ -124,6 +124,12 @@ void DrawViewShell::DeleteActualPage()
 
 void DrawViewShell::DeleteActualLayer()
 {
+    if(!GetLayerTabControl()) // #87182#
+    {
+        OSL_ENSURE(false, "No LayerTabBar (!)");
+        return;
+    }
+
 	SdrLayerAdmin& rAdmin = GetDoc()->GetLayerAdmin();
 	const String&  rName  = GetLayerTabControl()->GetPageText(GetLayerTabControl()->GetCurPageId());
 	String         aString(SdResId(STR_ASK_DELETE_LAYER));

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews5.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews5.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews5.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews5.cxx Wed Mar 19 10:14:42 2014
@@ -320,6 +320,17 @@ void DrawViewShell::ReadFrameViewData(Fr
 
 	EditMode eNewEditMode = pView->GetViewShEditMode(mePageKind);
 	sal_Bool bNewLayerMode = pView->IsLayerMode();
+
+    if(IsLayerModeActive() && bNewLayerMode)
+    {
+        // #57936# Force mbIsLayerModeActive to false so that ChangeEditMode
+        // below does something regarding LayerTabBar content refresh. That refresh
+        // is only done when IsLayerModeActive changes. It needs to be done
+        // since e.g. Layer vsisibility was changed above and this may need
+        // a refresh to show the correct graphical representation
+        mbIsLayerModeActive = false;
+    }
+
 	ChangeEditMode(eNewEditMode, bNewLayerMode);
 	SwitchPage(nSelectedPage);
 

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews7.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews7.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews7.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviews7.cxx Wed Mar 19 10:14:42 2014
@@ -911,22 +911,29 @@ void DrawViewShell::GetMenuState( SfxIte
 	// darf der aktuelle Layer geloescht werden?
 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_DELETE_LAYER ) )
 	{
-		sal_uInt16		  nCurrentLayer = GetLayerTabControl()->GetCurPageId();
-		const String& rName 		= GetLayerTabControl()->GetPageText(nCurrentLayer);
-
-		sal_Bool bDisableIt = !IsLayerModeActive();
-        bDisableIt |= (rName == String(SdResId(STR_LAYER_LAYOUT)));
-        bDisableIt |= (rName == String(SdResId(STR_LAYER_BCKGRND)));
-        bDisableIt |= (rName == String(SdResId(STR_LAYER_BCKGRNDOBJ)));
-        bDisableIt |= (rName == String(SdResId(STR_LAYER_CONTROLS)));
-        bDisableIt |= (rName == String(SdResId(STR_LAYER_MEASURELINES)));
+        if(GetLayerTabControl()) // #87182#
+        {
+            sal_uInt16		  nCurrentLayer = GetLayerTabControl()->GetCurPageId();
+            const String& rName 		= GetLayerTabControl()->GetPageText(nCurrentLayer);
 
-		if (bDisableIt)
-		{
-			rSet.DisableItem(SID_DELETE_LAYER);
-            rSet.DisableItem(SID_RENAMELAYER);
-		}
-	}
+            sal_Bool bDisableIt = !IsLayerModeActive();
+            bDisableIt |= (rName == String(SdResId(STR_LAYER_LAYOUT)));
+            bDisableIt |= (rName == String(SdResId(STR_LAYER_BCKGRND)));
+            bDisableIt |= (rName == String(SdResId(STR_LAYER_BCKGRNDOBJ)));
+            bDisableIt |= (rName == String(SdResId(STR_LAYER_CONTROLS)));
+            bDisableIt |= (rName == String(SdResId(STR_LAYER_MEASURELINES)));
+
+            if (bDisableIt)
+            {
+                rSet.DisableItem(SID_DELETE_LAYER);
+                rSet.DisableItem(SID_RENAMELAYER);
+            }
+        }
+        else
+        {
+            OSL_ENSURE(false, "No LayerTabBar (!)");
+        }
+    }
 
 	if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CUT ) ||
 		SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_COPY ) ||

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviewsb.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviewsb.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviewsb.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/drviewsb.cxx Wed Mar 19 10:14:42 2014
@@ -233,6 +233,14 @@ void DrawViewShell::FuTemp02(SfxRequest&
 
 		case SID_MODIFYLAYER:
 		{
+            if(!GetLayerTabControl()) // #87182#
+            {
+                OSL_ENSURE(false, "No LayerTabBar (!)");
+                Cancel();
+                rReq.Ignore();
+                break;
+            }
+
 			if ( mpDrawView->IsTextEdit() )
 			{
 				mpDrawView->SdrEndTextEdit();
@@ -387,8 +395,14 @@ void DrawViewShell::FuTemp02(SfxRequest&
 				mpDrawView->SdrEndTextEdit();
 			}
 
-			GetLayerTabControl()->StartEditMode(
-                GetLayerTabControl()->GetCurPageId() );
+            if(GetLayerTabControl()) // #87182#
+            {
+                GetLayerTabControl()->StartEditMode(GetLayerTabControl()->GetCurPageId());
+            }
+            else
+            {
+                OSL_ENSURE(false, "No LayerTabBar (!)");
+            }
 
 			Cancel();
 			rReq.Ignore ();
@@ -825,6 +839,12 @@ void DrawViewShell::ModifyLayer (
     bool bIsLocked,
     bool bIsPrintable)
 {
+    if(!GetLayerTabControl()) // #87182#
+    {
+        OSL_ENSURE(false, "No LayerTabBar (!)");
+        return;
+    }
+
 	if( pLayer )
 	{
 		const sal_uInt16 nPageCount = GetLayerTabControl()->GetPageCount();

Modified: openoffice/branches/alg_writerframes/main/sd/source/ui/view/sdview4.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sd/source/ui/view/sdview4.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sd/source/ui/view/sdview4.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sd/source/ui/view/sdview4.cxx Wed Mar 19 10:14:42 2014
@@ -107,67 +107,70 @@ SdrGrafObj* View::InsertGraphic( const G
 		PickObj(rPos, getHitTolLog(), pPickObj, pPageView);
 	}
 
-	if( mnAction == DND_ACTION_LINK && pPickObj && pPV )
-	{
-		const bool bIsGraphic(0 != dynamic_cast< SdrGrafObj* >(pPickObj));
+    const bool bIsGraphic(0 != dynamic_cast< SdrGrafObj* >(pPickObj));
 
-        if(bIsGraphic || (pPickObj->IsEmptyPresObj() && !bOnMaster)) // #121603# Do not use pObj, it may be NULL
-		{
-			if( IsUndoEnabled() )
-				BegUndo(String(SdResId(STR_INSERTGRAPHIC)));	
+    if(pPickObj && !bIsGraphic && pPickObj->IsClosedObj() && !dynamic_cast< SdrOle2Obj* >(pPickObj))
+    {
+        // fill style change (fill object with graphic), independent of mnAction
+        // and thus of DND_ACTION_LINK or DND_ACTION_MOVE
+        if( IsUndoEnabled() )
+        {
+            BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
+            AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
+            EndUndo();
+        }
+
+        SfxItemSet aSet(mpDocSh->GetPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
+
+        aSet.Put(XFillStyleItem(XFILL_BITMAP));
+        aSet.Put(XFillBitmapItem(&mpDocSh->GetPool(), rGraphic));
+        pPickObj->SetMergedItemSetAndBroadcast(aSet);
+    }
+    else if(DND_ACTION_LINK == mnAction 
+        && pPickObj 
+        && pPV  
+        && (bIsGraphic || (pPickObj->IsEmptyPresObj() && !bOnMaster))) // #121603# Do not use pObj, it may be NULL
+	{
+        // hit on SdrGrafObj with wanted new linked graphic (or PresObj placeholder hit)
+		if( IsUndoEnabled() )
+			BegUndo(String(SdResId(STR_INSERTGRAPHIC)));	
 
-			SdPage* pPage = (SdPage*) pPickObj->GetPage();
+		SdPage* pPage = (SdPage*) pPickObj->GetPage();
 
-			if( bIsGraphic )
-			{
-				// Das Objekt wird mit der Bitmap gefuellt
-				pNewGrafObj = (SdrGrafObj*) pPickObj->Clone();
-				pNewGrafObj->SetGraphic(rGraphic);
-			}
-			else
-			{
-				pNewGrafObj = new SdrGrafObj( rGraphic, pPickObj->GetLogicRect() );
-				pNewGrafObj->SetEmptyPresObj(sal_True);
-			}
-
-			if ( pNewGrafObj->IsEmptyPresObj() )
-			{
-				Rectangle aRect( pNewGrafObj->GetLogicRect() );
-				pNewGrafObj->AdjustToMaxRect( aRect, sal_False );
-				pNewGrafObj->SetOutlinerParaObject(NULL);
-				pNewGrafObj->SetEmptyPresObj(sal_False);
-			}
+		if( bIsGraphic )
+		{
+			// Das Objekt wird mit der Bitmap gefuellt
+			pNewGrafObj = (SdrGrafObj*) pPickObj->Clone();
+			pNewGrafObj->SetGraphic(rGraphic);
+		}
+		else
+		{
+			pNewGrafObj = new SdrGrafObj( rGraphic, pPickObj->GetLogicRect() );
+			pNewGrafObj->SetEmptyPresObj(sal_True);
+		}
 
-			if (pPage && pPage->IsPresObj(pPickObj))
-			{
-				// Neues PresObj in die Liste eintragen
-				pPage->InsertPresObj( pNewGrafObj, PRESOBJ_GRAPHIC );
-				pNewGrafObj->SetUserCall(pPickObj->GetUserCall());
-			}
+		if ( pNewGrafObj->IsEmptyPresObj() )
+		{
+			Rectangle aRect( pNewGrafObj->GetLogicRect() );
+			pNewGrafObj->AdjustToMaxRect( aRect, sal_False );
+			pNewGrafObj->SetOutlinerParaObject(NULL);
+			pNewGrafObj->SetEmptyPresObj(sal_False);
+		}
 
-			if (pImageMap)
-				pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap));
+		if (pPage && pPage->IsPresObj(pPickObj))
+		{
+			// Neues PresObj in die Liste eintragen
+			pPage->InsertPresObj( pNewGrafObj, PRESOBJ_GRAPHIC );
+			pNewGrafObj->SetUserCall(pPickObj->GetUserCall());
+		}
 
-			ReplaceObjectAtView(pPickObj, *pPV, pNewGrafObj); // maybe ReplaceObjectAtView
+		if (pImageMap)
+			pNewGrafObj->InsertUserData(new SdIMapInfo(*pImageMap));
 
-			if( IsUndoEnabled() )
-				EndUndo();
-		}
-		else if(pPickObj->IsClosedObj())
-		{
-            // fill object with graphic
-			if( IsUndoEnabled() )
-			{
-				BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
-				AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
-				EndUndo();
-			}
+		ReplaceObjectAtView(pPickObj, *pPV, pNewGrafObj); // maybe ReplaceObjectAtView
 
-			SfxItemSet aSet(mpDocSh->GetPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
-			aSet.Put(XFillStyleItem(XFILL_BITMAP));
-			aSet.Put(XFillBitmapItem(&mpDocSh->GetPool(), rGraphic));
-			pPickObj->SetMergedItemSetAndBroadcast(aSet);
-		}
+		if( IsUndoEnabled() )
+			EndUndo();
 	}
 	else if ( pPV )
 	{

Modified: openoffice/branches/alg_writerframes/main/set_soenv.in
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/set_soenv.in?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/set_soenv.in (original)
+++ openoffice/branches/alg_writerframes/main/set_soenv.in Wed Mar 19 10:14:42 2014
@@ -20,13 +20,7 @@
 #  under the License.
 #  
 ###############################################################
-#
-# Program:     set_soenv.in
-# Version:     $Revision: 1.201 $
-# Date:        $Date: 2008-09-05 14:14:29 $
-# Author:      Willem van Dorp, Ross Nicholson, Oisin Boydell - Sun Microsystems, Ireland.
-#
-#---------------------------------------------------------------------------
+
 #---------------------------------------------------------------------------
 # Description:
 # set_soenv generates a file that contains all necessary 
@@ -102,7 +96,7 @@ my ( $oldPATH, $SRC_ROOT, $SO_HOME, $JAV
      $SOLARSRC, $DEVROOT, $SOLARVER, $SOLARVERSION, $WORKDIR, $OUTDIR, $SOLARENV, 
      $STAR_INIROOT, $STAR_INIROOTOLD, $STAR_STANDLST, $STAR_SSCOMMON, $STAR_SSOLARINI, 
      $DMAKEROOT, $CLASSPATH, $XCLASSPATH, $COMPATH, $CXX_X64_BINARY, $LINK_X64_BINARY, $LIBMGR_X64_BINARY,
-     $MSPDB_PATH, $MIDL_PATH, $CSC_PATH,
+     $MSPDB_PATH, $MIDL_PATH, $CSC_PATH, $MACOSX_DEPLOYMENT_TARGET, $MACOSX_SDK_PATH,
      $PATH, $SOLAREXTRAINC, $SOLAREXTRALIB, $SOLARLIB, 
      $SOLARINC, $LOCALINI, $FRAMEWORKSHOME, $COMEX, $PERL, 
      $COMP_ENV, $ILIB, $JAVAHOME, $PSDK_HOME, $DIRECTXSDK_LIB, $USE_NEW_SDK, $FRAME_HOME, 
@@ -952,16 +946,6 @@ if ( $platform =~ m/os2/ )
    $PERL_PATH = '';
 }
 
-# Mac OS X/Darwin only variables.
-if ( $platform =~ m/darwin/ )
-{  $FRAMEWORKSHOME       = $ds."Developer".$ds."SDKs".$ds."MacOSX10.4u.sdk".$ds."System".$ds."Library".$ds."Frameworks";
-   if ( $XLIB eq "no_x_libraries" ) {
-      $GUIBASE  = "aqua";
-   } else {
-      $GUIBASE  = "unx";
-   }
-}
-
 # The project's workstamp.
 $WORK_STAMP            = "@SOURCEVERSION@";
 # Location of the source.
@@ -1456,7 +1440,10 @@ elsif ($platform =~ m/cygwin/)
 }
 elsif ($platform =~ m/darwin/)
 {
-   $SOLARINC .= " " . $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Headers";
+    $FRAMEWORKSHOME = "@MACOSX_SDK_PATH@/System/Library/Frameworks";
+    my $STLINC .= $I."/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/";
+    $SOLARINC .= $STLINC . $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Headers";
+    $GUIBASE  = "aqua";
 }
 else
 {  AddWarning( "set_soenv", "$platform not configured for system dependant include dir" );
@@ -1658,6 +1645,7 @@ ToFile( "SOLAR_JAVA",        $SOLAR_JAVA
 ToFile( "BIG_SVX",           $BIG_SVX,           "e" );
 ToFile( "COM",               $COM,               "e" );
 ToFile( "COMPATH",           $COMPATH,           "e" );
+ToFile( "CC_PATH",           "@CC_PATH@",        "e" );
 ToFile( "CXX_X64_BINARY",    $CXX_X64_BINARY,    "e" );
 ToFile( "LINK_X64_BINARY",   $LINK_X64_BINARY,   "e" );
 ToFile( "LIBMGR_X64_BINARY", $LIBMGR_X64_BINARY, "e" );
@@ -1686,10 +1674,10 @@ if ( $platform =~ m/darwin/ )
 {
 # MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build,
 # build can assume functions/libraries of that version to be available
-# unless you want to do runtime checks for 10.5 api, you also want to use the 10.7 sdk
 # (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
 # http://developer.apple.com/technotes/tn2002/tn2064.html
-    ToFile( "MACOSX_DEPLOYMENT_TARGET",       "10.4",       "e" );
+    ToFile( "MACOSX_DEPLOYMENT_TARGET",       "@MACOSX_DEPLOYMENT_TARGET@",       "e" );
+    ToFile( "MACOSX_SDK_PATH",       "@MACOSX_SDK_PATH@",       "e" );
 }
 
 #

Modified: openoffice/branches/alg_writerframes/main/setup_native/prj/d.lst
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/prj/d.lst?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/setup_native/prj/d.lst (original)
+++ openoffice/branches/alg_writerframes/main/setup_native/prj/d.lst Wed Mar 19 10:14:42 2014
@@ -32,11 +32,19 @@ mkdir: %_DEST%\bin%_EXT%\osolsmf
 ..\source\mac\*.icns %_DEST%\bin%_EXT%\*.icns
 ..\source\mac\Info.plist.langpack %_DEST%\bin%_EXT%\Info.plist.langpack
 ..\source\mac\ooo\osxdndinstall.png %_DEST%\bin%_EXT%\osl\osxdndinstall.png
+..\source\mac\ooo\osxdndinstall_lang.png %_DEST%\bin%_EXT%\osl\osxdndinstall_lang.png
+..\source\mac\ooo\osxdndinstall_beta.png %_DEST%\bin%_EXT%\osl\osxdndinstall_beta.png
+..\source\mac\ooo\osxdndinstall_lang_beta.png %_DEST%\bin%_EXT%\osl\osxdndinstall_lang_beta.png
 ..\source\mac\ooo\osxdndinstall_nologo.png %_DEST%\bin%_EXT%\osl\osxdndinstall_nologo.png
 ..\source\mac\ooo\DS_Store %_DEST%\bin%_EXT%\osl\DS_Store
+..\source\mac\ooo\DS_Store_Beta %_DEST%\bin%_EXT%\osl\DS_Store_Beta
 ..\source\mac\ooo\DS_Store_Dev %_DEST%\bin%_EXT%\osl\DS_Store_Dev
 ..\source\mac\ooo\DS_Store_Langpack %_DEST%\bin%_EXT%\osl\DS_Store_Langpack
+..\source\mac\ooo\DS_Store_Langpack_Beta %_DEST%\bin%_EXT%\osl\DS_Store_Langpack_Beta
 ..\source\mac\sdk\DS_Store_SDK %_DEST%\bin%_EXT%\osl\DS_Store_SDK
+..\source\mac\sdk\DS_Store_SDK_Beta %_DEST%\bin%_EXT%\osl\DS_Store_SDK_Beta
+..\source\mac\sdk\osxdndinstall_sdk.png %_DEST%\bin%_EXT%\osl\osxdndinstall_sdk.png
+..\source\mac\sdk\osxdndinstall_sdk_beta.png %_DEST%\bin%_EXT%\osl\osxdndinstall_sdk_beta.png
 ..\source\java\openofficeorg_setup.gif %_DEST%\bin%_EXT%\osl\Setup.gif
 ..\source\java\javaversion.dat %_DEST%\bin%_EXT%\javaversion.dat
 ..\source\java\javaversion2.dat %_DEST%\bin%_EXT%\javaversion2.dat

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/mac/Info.plist.langpack
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/mac/Info.plist.langpack?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/setup_native/source/mac/Info.plist.langpack (original)
+++ openoffice/branches/alg_writerframes/main/setup_native/source/mac/Info.plist.langpack Wed Mar 19 10:14:42 2014
@@ -22,6 +22,8 @@
  ***********************************************************-->
 <plist version="1.0">
 <dict>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.7.0</string>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>English</string>
 	<!-- UTI declarations for OS X >= 10.4	-->

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/mac/ooo/DS_Store
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/mac/ooo/DS_Store?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/mac/ooo/DS_Store_Langpack
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/mac/ooo/DS_Store_Langpack?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/mac/ooo/osxdndinstall.png
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/mac/ooo/osxdndinstall.png?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/mac/ooo/osxdndinstall_lang.png
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/mac/ooo/osxdndinstall_lang.png?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/mac/sdk/DS_Store_SDK
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/mac/sdk/DS_Store_SDK?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/mac/sdk/osxdndinstall_sdk.png
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/mac/sdk/osxdndinstall_sdk.png?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/win32/nsis/ooobitmap.bmp
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/win32/nsis/ooobitmap.bmp?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/branches/alg_writerframes/main/setup_native/source/win32/nsis/ooosdkbitmap.bmp
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/setup_native/source/win32/nsis/ooosdkbitmap.bmp?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
Binary files - no diff available.

Modified: openoffice/branches/alg_writerframes/main/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx Wed Mar 19 10:14:42 2014
@@ -42,6 +42,7 @@ public:
         sal_uInt16 nId,
         SfxBindings* pBindings,
         SfxChildWinInfo* pInfo);
+    virtual ~SidebarChildWindow (void);
 
     SFX_DECL_CHILDWINDOW(SidebarChildWindow);
 

Modified: openoffice/branches/alg_writerframes/main/sfx2/inc/sfx2/templdlg.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/inc/sfx2/templdlg.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/inc/sfx2/templdlg.hxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/inc/sfx2/templdlg.hxx Wed Mar 19 10:14:42 2014
@@ -100,7 +100,7 @@ class SFX2_DLLPUBLIC SfxTemplatePanelCon
 {
 public:
     SfxTemplatePanelControl (SfxBindings* pBindings, Window* pParentWindow);
-	~SfxTemplatePanelControl (void);
+	virtual ~SfxTemplatePanelControl (void);
 
     virtual void                Update();
     virtual void                DataChanged( const DataChangedEvent& _rDCEvt );

Modified: openoffice/branches/alg_writerframes/main/sfx2/source/appl/fileobj.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/source/appl/fileobj.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/source/appl/fileobj.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/source/appl/fileobj.cxx Wed Mar 19 10:14:42 2014
@@ -349,7 +349,9 @@ sal_Bool SvFileObject::GetGraphic_Impl( 
 	else if( !pDownLoadData )
 	{
 		pStream->Seek( STREAM_SEEK_TO_BEGIN );
-		nRes = pGF->ImportGraphic( rGrf, aEmptyStr, *pStream, nFilter );
+
+        // #123042# for e.g. SVG the path is needed, see same TaskID in svx for more info
+        nRes = pGF->ImportGraphic( rGrf, sFileNm, *pStream, nFilter );
 	}
 	else
 	{

Modified: openoffice/branches/alg_writerframes/main/sfx2/source/dialog/mgetempl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/source/dialog/mgetempl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/source/dialog/mgetempl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/source/dialog/mgetempl.cxx Wed Mar 19 10:14:42 2014
@@ -494,6 +494,7 @@ void SfxManageStyleSheetPage::Reset( con
 	if ( sCmp != aName )
 		pStyle->SetName( aName );
 	aNameEd.SetText( aName );
+	aNameEd.SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
 
 	if ( aFollowLb.IsEnabled() )
 	{

Modified: openoffice/branches/alg_writerframes/main/sfx2/source/dialog/templdlg.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/source/dialog/templdlg.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/source/dialog/templdlg.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/source/dialog/templdlg.cxx Wed Mar 19 10:14:42 2014
@@ -1849,16 +1849,36 @@ sal_Bool SfxCommonTemplateDialog_Impl::E
 
 	pItems[ nCount++ ] = 0;
 
+    // This unbelievably crude technique is used to detect and handle
+    // destruction of this during the synchronous slot call: store a
+    // pointer to a local bool, initialize it to false and set that it
+    // to true in the destructor.
     Deleted aDeleted;
     pbDeleted = &aDeleted;
+
 	sal_uInt16 nModi = pModifier ? *pModifier : 0;
     const SfxPoolItem* pItem = rDispatcher.Execute(
 		nId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL,
 		pItems, nModi );
 
     // FIXME: Dialog can be destroyed while in Execute() check stack variable for dtor flag!
-    if ( !pItem || aDeleted() )
+    if (aDeleted())
+    {
+        // this has been deleted in the previous synchronous slot
+        // call.  Exit without touching anything.
         return sal_False;
+    }
+    else
+    {
+        // this has not been deleted.  Reset pbDeleted to prevent the
+        // destructor to access the local bool at a later and rather
+        // inconvenient time.  See bugs 124392 and 100110 for more information.
+        pbDeleted = NULL;
+    }
+    if (pItem == NULL)
+    {
+        return sal_False;
+    }
 
 	if ( nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId )
 	{
@@ -1880,10 +1900,6 @@ sal_Bool SfxCommonTemplateDialog_Impl::E
 		}
 	}
     
-    // Reset destroyed flag otherwise we use the pointer in the dtor
-    // where the local stack object is already destroyed. This would
-    // overwrite objects on the stack!! See #i100110
-    pbDeleted = NULL;
     return sal_True;
 }
 

Modified: openoffice/branches/alg_writerframes/main/sfx2/source/inc/templdgi.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/source/inc/templdgi.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/source/inc/templdgi.hxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/source/inc/templdgi.hxx Wed Mar 19 10:14:42 2014
@@ -243,7 +243,7 @@ public:
 
 	SfxCommonTemplateDialog_Impl( SfxBindings* pB, Window*, bool );
 	SfxCommonTemplateDialog_Impl( SfxBindings* pB, Window* );
-	~SfxCommonTemplateDialog_Impl();
+	virtual ~SfxCommonTemplateDialog_Impl();
 
 	DECL_LINK( MenuSelectHdl, Menu * );
 

Modified: openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/DeckLayouter.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/DeckLayouter.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/DeckLayouter.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/DeckLayouter.cxx Wed Mar 19 10:14:42 2014
@@ -212,7 +212,7 @@ sal_Int32 DeckLayouter::PlacePanels (
     // Assign heights and places.
     IterateLayoutItems(iItem,rLayoutItems)
     {
-        if (iItem->mpPanel == NULL)
+        if( !bool(iItem->mpPanel))
             continue;
 
         Panel& rPanel (*iItem->mpPanel);
@@ -305,7 +305,7 @@ void DeckLayouter::GetRequestedSizes (
     IterateLayoutItems(iItem,rLayoutItems)
     {
         ui::LayoutSize aLayoutSize (ui::LayoutSize(0,0,0));
-        if (iItem->mpPanel != NULL)
+        if( bool(iItem->mpPanel))
         {
             if (rLayoutItems.size() == 1
                 && iItem->mpPanel->IsTitleBarOptional())

Modified: openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/SidebarChildWindow.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/SidebarChildWindow.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/SidebarChildWindow.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/SidebarChildWindow.cxx Wed Mar 19 10:14:42 2014
@@ -64,6 +64,13 @@ SidebarChildWindow::SidebarChildWindow (
 
 
 
+SidebarChildWindow::~SidebarChildWindow (void)
+{
+}
+
+
+
+
 sal_Int32 SidebarChildWindow::GetDefaultWidth (Window* pWindow)
 {
     if (pWindow != NULL)

Modified: openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/SidebarController.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/SidebarController.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/SidebarController.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sfx2/source/sidebar/SidebarController.cxx Wed Mar 19 10:14:42 2014
@@ -335,9 +335,9 @@ void SidebarController::BroadcastPropert
 
 void SidebarController::NotifyResize (void)
 {
-    if (mpTabBar == NULL)
+    if( !bool(mpTabBar))
     {
-        OSL_ASSERT(mpTabBar!=NULL);
+        OSL_ASSERT( bool(mpTabBar));
         return;
     }
     
@@ -645,7 +645,7 @@ void SidebarController::SwitchToDeck (
                 rContext);
             bHasPanelSetChanged = true;
         }
-        if (aNewPanels[nWriteIndex] != NULL)
+        if( bool(aNewPanels[nWriteIndex]))
         {
             // Depending on the context we have to change the command
             // for the "more options" dialog.



Mime
View raw message