summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-22 12:23:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-22 12:56:13 +0100
commit368e94ce33bb4de1d2c0348082a349331a17f332 (patch)
tree80fe83b549a507cf97e42c09850fbc72187ea8e8
parenta1b0b68c0f1fe2467cddf021e09123085d043de2 (diff)
merge all three ShowSlideShow impls together
Change-Id: If82f6313b258a79d59fbe34ab7846db5f9f45f76
-rw-r--r--sd/source/ui/inc/slideshow.hxx5
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx29
-rw-r--r--sd/source/ui/view/drviewse.cxx42
-rw-r--r--sd/source/ui/view/outlnvs2.cxx30
4 files changed, 33 insertions, 73 deletions
diff --git a/sd/source/ui/inc/slideshow.hxx b/sd/source/ui/inc/slideshow.hxx
index a309c82a8de2..be44a51f926e 100644
--- a/sd/source/ui/inc/slideshow.hxx
+++ b/sd/source/ui/inc/slideshow.hxx
@@ -214,6 +214,11 @@ private:
sal_Int32 mnInPlaceConfigEvent;
};
+namespace slideshowhelp
+{
+ void ShowSlideShow(SfxRequest& rReq, SdDrawDocument &rDoc);
+}
+
}
#endif /* _SD_SLIDESHOW_HXX */
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 79c409ce4657..53f077bafaa6 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -884,34 +884,7 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
void SlotManager::ShowSlideShow( SfxRequest& rReq)
{
- Reference< XPresentation2 > xPresentation( mrSlideSorter.GetModel().GetDocument()->getPresentation() );
- if( xPresentation.is() )
- {
- if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
- {
- if( (SID_PRESENTATION == rReq.GetSlot() ) )
- {
- Sequence< PropertyValue > aArguments(1);
- PropertyValue aPage;
- OUString sValue("0");
-
- aPage.Name = "FirstPage";
- aPage.Value <<= sValue;
-
- aArguments[0] = aPage;
-
- xPresentation->startWithArguments( aArguments );
- }
- else
- {
- xPresentation->start();
- }
- }
- else
- {
- xPresentation->rehearseTimings();
- }
- }
+ slideshowhelp::ShowSlideShow(rReq, *mrSlideSorter.GetModel().GetDocument());
}
void SlotManager::RenameSlide (void)
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index f23b16807977..4793653455a4 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1641,38 +1641,46 @@ void DrawViewShell::ShowUIControls (bool bVisible)
maTabControl.Show (bVisible);
}
-void DrawViewShell::ShowSlideShow(SfxRequest& rReq)
+namespace slideshowhelp
{
- Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
- if( xPresentation.is() )
+ void ShowSlideShow(SfxRequest& rReq, SdDrawDocument &rDoc)
{
- if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
+ Reference< XPresentation2 > xPresentation( rDoc.getPresentation() );
+ if( xPresentation.is() )
{
- if( (SID_PRESENTATION == rReq.GetSlot() ) )
+ if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
{
- Sequence< PropertyValue > aArguments(1);
- PropertyValue aPage;
- OUString sValue("0");
+ if( (SID_PRESENTATION == rReq.GetSlot() ) )
+ {
+ Sequence< PropertyValue > aArguments(1);
+ PropertyValue aPage;
+ OUString sValue("0");
- aPage.Name = "FirstPage";
- aPage.Value <<= sValue;
+ aPage.Name = "FirstPage";
+ aPage.Value <<= sValue;
- aArguments[0] = aPage;
+ aArguments[0] = aPage;
- xPresentation->startWithArguments( aArguments );
+ xPresentation->startWithArguments( aArguments );
+ }
+ else
+ {
+ xPresentation->start();
+ }
}
else
{
- xPresentation->start();
+ xPresentation->rehearseTimings();
}
}
- else
- {
- xPresentation->rehearseTimings();
- }
}
}
+void DrawViewShell::ShowSlideShow(SfxRequest& rReq)
+{
+ slideshowhelp::ShowSlideShow(rReq, *GetDoc());
+}
+
void DrawViewShell::StopSlideShow (bool /*bCloseFrame*/)
{
Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 23ead9a52797..6bdb2b33656d 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -63,6 +63,7 @@
#include "sdabstdlg.hxx"
#include "framework/FrameworkHelper.hxx"
#include "DrawViewShell.hxx"
+#include "slideshow.hxx"
#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star::uno;
@@ -334,34 +335,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
void OutlineViewShell::ShowSlideShow(SfxRequest& rReq)
{
- Reference< XPresentation2 > xPresentation( GetDoc()->getPresentation() );
- if( xPresentation.is() )
- {
- if( ( SID_REHEARSE_TIMINGS != rReq.GetSlot() ) )
- {
- if( (SID_PRESENTATION == rReq.GetSlot() ) )
- {
- Sequence< PropertyValue > aArguments(1);
- PropertyValue aPage;
- OUString sValue("0");
-
- aPage.Name = "FirstPage";
- aPage.Value <<= sValue;
-
- aArguments[0] = aPage;
-
- xPresentation->startWithArguments( aArguments );
- }
- else
- {
- xPresentation->start();
- }
- }
- else
- {
- xPresentation->rehearseTimings();
- }
- }
+ slideshowhelp::ShowSlideShow(rReq, *GetDoc());
}
void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)