[Libreoffice-commits] .: sd/inc sd/source

Katarina Machalkova bubli at kemper.freedesktop.org
Wed Oct 13 11:59:42 PDT 2010


 sd/inc/strmname.h                        |    1 
 sd/source/ui/docshell/docshel4.cxx       |   35 ++++++++++++++++++++++++++++++-
 sd/source/ui/inc/DrawDocShell.hxx        |    1 
 sd/source/ui/slideshow/slideshow.cxx     |   25 ++++++++++++++++++++++
 sd/source/ui/slideshow/slideshowimpl.cxx |    3 +-
 sd/source/ui/unoidl/sddetect.cxx         |    8 ++++---
 sd/source/ui/view/ViewShellBase.cxx      |    1 
 7 files changed, 68 insertions(+), 6 deletions(-)

New commits:
commit 48b23daa89263310851adf6d71dadbc51ecdbcf7
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Wed Oct 13 18:03:02 2010 +0200

    Merged pptx-autoplay-fix.diff from ooo-build

diff --git a/sd/inc/strmname.h b/sd/inc/strmname.h
index ed555b8..f4d717b 100644
--- a/sd/inc/strmname.h
+++ b/sd/inc/strmname.h
@@ -42,6 +42,7 @@ static const String pPreviewName( RTL_CONSTASCII_USTRINGPARAM( "StarDrawTemplate
 // PowerPoint-Filter
 static const String pFilterPowerPoint97( RTL_CONSTASCII_USTRINGPARAM( "MS PowerPoint 97" ));
 static const String pFilterPowerPoint97Template( RTL_CONSTASCII_USTRINGPARAM( "MS PowerPoint 97 Vorlage" ));
+static const String pFilterPowerPoint97AutoPlay( RTL_CONSTASCII_USTRINGPARAM( "MS PowerPoint 97 AutoPlay" ));
 
 // XML content stream
 static const String pStarDrawXMLContent( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ));
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 78aa75c..e5b1d71 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -446,6 +446,37 @@ BOOL DrawDocShell::LoadFrom( SfxMedium& rMedium )
 
 /*************************************************************************
 |*
+|* ImportFrom: load from 3rd party format
+|*
+\************************************************************************/
+
+sal_Bool DrawDocShell::ImportFrom( SfxMedium &rMedium )
+{
+    const sal_Bool bRet=SfxObjectShell::ImportFrom(rMedium);
+
+    SfxItemSet* pSet = rMedium.GetItemSet();
+    if( pSet )
+    {
+        if( SFX_ITEM_SET == pSet->GetItemState(SID_DOC_STARTPRESENTATION)&&
+            ( (SfxBoolItem&) ( pSet->Get( SID_DOC_STARTPRESENTATION ) ) ).GetValue() )
+        {
+            mpDoc->SetStartWithPresentation( true );
+
+            // tell SFX to change viewshell when in preview mode
+            if( IsPreview() )
+            {
+                SfxItemSet *pMediumSet = GetMedium()->GetItemSet();
+                if( pMediumSet )
+                    pMediumSet->Put( SfxUInt16Item( SID_VIEW_ID, 1 ) );
+            }
+        }
+    }
+
+    return bRet;
+}
+
+/*************************************************************************
+|*
 |* ConvertFrom: aus Fremdformat laden
 |*
 \************************************************************************/
@@ -476,7 +507,9 @@ BOOL DrawDocShell::ConvertFrom( SfxMedium& rMedium )
         }
     }
 
-    if( aFilterName == pFilterPowerPoint97 || aFilterName == pFilterPowerPoint97Template)
+    if( aFilterName == pFilterPowerPoint97
+        || aFilterName == pFilterPowerPoint97Template
+        || aFilterName == pFilterPowerPoint97AutoPlay)
     {
         mpDoc->StopWorkStartupDelay();
         bRet = SdPPTFilter( rMedium, *this, sal_True ).Import();
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index 2709340..23b565a 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -88,6 +88,7 @@ public:
     virtual void	        Activate( BOOL bMDI );
     virtual void	        Deactivate( BOOL bMDI );
     virtual BOOL            InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+    virtual sal_Bool        ImportFrom( SfxMedium &rMedium );
     virtual BOOL	        ConvertFrom( SfxMedium &rMedium );
     virtual BOOL	        Save();
     virtual BOOL            SaveAsOwnFormat( SfxMedium& rMedium );
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 3aea523..fd3e2ac 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -33,6 +33,8 @@
 #include <com/sun/star/drawing/framework/XControllerManager.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
 #include <comphelper/serviceinfohelper.hxx>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/util/URL.hpp>
 
 #include <cppuhelper/bootstrap.hxx>
 
@@ -69,6 +71,7 @@ using ::com::sun::star::awt::XWindow;
 using namespace ::sd;
 using namespace ::cppu;
 using namespace ::vos;
+using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::presentation;
 using namespace ::com::sun::star::drawing;
@@ -775,6 +778,28 @@ void SAL_CALL SlideShow::end() throw(RuntimeException)
                     if( pDrawViewShell )
                         pDrawViewShell->SwitchPage( (USHORT)xController->getRestoreSlide() );
                 }
+
+                if( pViewShell->GetDoc()->IsStartWithPresentation() )
+                {
+                    pViewShell->GetDoc()->SetStartWithPresentation( false );
+
+                    Reference<frame::XDispatchProvider> xProvider(pViewShell->GetViewShellBase().GetController()->getFrame(),
+                                                                  UNO_QUERY);
+                    if( xProvider.is() )
+                    {
+                        util::URL aURL;
+                        aURL.Complete = ::rtl::OUString::createFromAscii(".uno:CloseFrame");
+
+                        uno::Reference< frame::XDispatch > xDispatch(
+                            xProvider->queryDispatch(
+                                aURL, ::rtl::OUString(), 0));
+                        if( xDispatch.is() )
+                        {
+                            xDispatch->dispatch(aURL,
+                                                uno::Sequence< beans::PropertyValue >());
+                        }
+                    }
+                }
             }
         }
         mpCurrentViewShellBase = 0;
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 2e55c1b..ec052ba 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -3490,7 +3490,8 @@ void SAL_CALL SlideshowImpl::gotoNextSlide(  ) throw (RuntimeException)
                     if( mpShowWindow )
                     {
                         mpShowWindow->SetEndMode();
-                        pause();
+                        if( !mpViewShell->GetDoc()->IsStartWithPresentation() )
+                            pause();
                     }
                 }
             }
diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
index 969d4b0..d6b445a 100644
--- a/sd/source/ui/unoidl/sddetect.cxx
+++ b/sd/source/ui/unoidl/sddetect.cxx
@@ -355,10 +355,12 @@ SdFilterDetect::~SdFilterDetect()
                                 String aFileName(aMedium.GetName());
                                 aFileName.ToUpperAscii();
 
-                                if( aFileName.SearchAscii( ".POT" ) == STRING_NOTFOUND )
-                                    pFilter = SfxFilter::GetFilterByName( pFilterPowerPoint97);
-                                else
+                                if( aFileName.SearchAscii( ".POT" ) != STRING_NOTFOUND )
                                     pFilter = SfxFilter::GetFilterByName( pFilterPowerPoint97Template );
+                                else if( aFileName.SearchAscii( ".PPS" ) != STRING_NOTFOUND )
+                                    pFilter = SfxFilter::GetFilterByName( pFilterPowerPoint97AutoPlay );
+                                else
+                                    pFilter = SfxFilter::GetFilterByName( pFilterPowerPoint97);
                             }
                         }
                         else
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index ee8d528..5a0e9d2 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -488,7 +488,6 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
                 {
                     if( GetViewFrame() )
                     {
-                        GetDocument()->SetStartWithPresentation( false );
                         GetViewFrame()->GetDispatcher()->Execute(
                             SID_PRESENTATION, SFX_CALLMODE_ASYNCHRON );
                     }


More information about the Libreoffice-commits mailing list