summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorKatarina Machalkova <kmachalkova@suse.cz>2010-10-13 18:03:02 +0200
committerKatarina Machalkova <kmachalkova@suse.cz>2010-10-13 19:57:59 +0200
commit6fdcfcc10dd6d46bc3c954d0a18a39161f04a221 (patch)
tree6f2c594df74205ed241bf3ddf34a9741833856bb /sd
parent80b08615105490fb3a8b9790f932d1f1a1ae2bce (diff)
Merged pptx-autoplay-fix.diff from ooo-build
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/strmname.h1
-rw-r--r--sd/source/ui/docshell/docshel4.cxx35
-rw-r--r--sd/source/ui/inc/DrawDocShell.hxx1
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx25
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx3
-rw-r--r--sd/source/ui/unoidl/sddetect.cxx8
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx1
7 files changed, 68 insertions, 6 deletions
diff --git a/sd/inc/strmname.h b/sd/inc/strmname.h
index 0d4823aeffce..ebddf8e5c47e 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 c97c77efa35a..e30eaadd1b5d 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 4ad4b0d09392..224f4294e26f 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 ecb02895867c..5b30155d9bd5 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 5dd97682ffd6..222d05a0e522 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 0a33244e1435..d0ed7c96bf0e 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 ee32592d2c1c..9fdcdff78a0b 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 );
}