summaryrefslogtreecommitdiff
path: root/sd/source/ui/slideshow
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-11 14:59:39 +0200
committerNoel Grandin <noel@peralex.com>2012-12-13 05:20:59 +0200
commitdde234b6955a421d51d2b37e4fc3972c660146f0 (patch)
treed9f5824ccb30141c3d3742e2229b3bf83ffd116b /sd/source/ui/slideshow
parent37b6871fa1fb12c4b2b45db5f3e6ac583577f538 (diff)
fdo#46808, remove awt::DisplayAccess service.
This service was never documented in an IDL file. All it did was provide a wrapper around some VCL module API. Now that we can link the VCL stuff into SD and SDEXT, just access the API directly. Change-Id: Ic0ba34c2bca797baa7319878d98cfe3a4ec59d4d
Diffstat (limited to 'sd/source/ui/slideshow')
-rw-r--r--sd/source/ui/slideshow/SlideShowRestarter.cxx22
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx23
2 files changed, 4 insertions, 41 deletions
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.cxx b/sd/source/ui/slideshow/SlideShowRestarter.cxx
index ad452d80d67e..90ed5146ac6e 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.cxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.cxx
@@ -42,7 +42,7 @@ SlideShowRestarter::SlideShowRestarter (
: mnEventId(0),
mpSlideShow(rpSlideShow),
mpViewShellBase(pViewShellBase),
- mnDisplayCount(GetDisplayCount()),
+ mnDisplayCount(Application::GetScreenCount()),
mpDispatcher(pViewShellBase->GetViewFrame()->GetDispatcher()),
mnCurrentSlideNumber(0)
{
@@ -77,30 +77,12 @@ void SlideShowRestarter::Restart (bool bForce)
LINK(this, SlideShowRestarter, EndPresentation));
}
-sal_Int32 SlideShowRestarter::GetDisplayCount (void)
-{
- const Reference<XComponentContext> xContext (
- ::comphelper::getProcessComponentContext() );
- Reference<XMultiComponentFactory> xFactory (
- xContext->getServiceManager(), UNO_QUERY);
- if ( ! xFactory.is())
- return 0;
-
- Reference<com::sun::star::container::XIndexAccess> xIndexAccess (
- xFactory->createInstanceWithContext("com.sun.star.awt.DisplayAccess",xContext),
- UNO_QUERY);
- if ( ! xIndexAccess.is())
- return 0;
-
- return xIndexAccess->getCount();
-}
-
IMPL_LINK_NOARG(SlideShowRestarter, EndPresentation)
{
mnEventId = 0;
if (mpSlideShow.is())
{
- if (mnDisplayCount!=GetDisplayCount())
+ if (mnDisplayCount != (sal_Int32)Application::GetScreenCount())
{
mpSlideShow->end();
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 9980082e99b3..af2033e8560b 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -101,25 +101,6 @@ namespace {
private:
::boost::shared_ptr<SlideShowRestarter> mpRestarter;
};
-
- /** Return the default display id (or -1 when that can not be
- determined.)
- */
- sal_Int32 GetExternalDisplay (void)
- {
- try
- {
- Reference< XMultiServiceFactory > xFactory(::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
- Reference< XPropertySet > xMonProps(xFactory->createInstance( "com.sun.star.awt.DisplayAccess" ), UNO_QUERY_THROW );
- sal_Int32 nPrimaryIndex (-1);
- if (xMonProps->getPropertyValue( "ExternalDisplay" ) >>= nPrimaryIndex)
- return nPrimaryIndex;
- }
- catch( Exception& )
- {
- }
- return -1;
- }
}
@@ -573,7 +554,7 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const
{
// Convert value to true display id.
if (nDisplay == 0)
- nDisplay = GetExternalDisplay();
+ nDisplay = Application::GetDisplayExternalScreen();
else if (nDisplay < 0)
nDisplay = -1;
else
@@ -665,7 +646,7 @@ Any SAL_CALL SlideShow::getPropertyValue( const OUString& PropertyName ) throw(U
SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
const sal_Int32 nDisplay (pOptions->GetDisplay());
// Convert true display id to the previously used schema.
- if (nDisplay == GetExternalDisplay())
+ if (nDisplay == (sal_Int32)Application::GetDisplayExternalScreen())
return Any(sal_Int32(0));
else if (nDisplay < 0)
return Any(sal_Int32(-1));