diff options
-rw-r--r-- | sd/source/ui/dlg/present.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/dlg/present.src | 4 | ||||
-rw-r--r-- | sd/source/ui/inc/present.hrc | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/present.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshow.cxx | 2 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterScreen.cxx | 39 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterScreen.hxx | 7 |
7 files changed, 34 insertions, 34 deletions
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index b83cad717bba..3aea637d29c8 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -90,7 +90,7 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow, rOutAttrs ( rInAttrs ), mnMonitors ( 0 ), - msPrimaryMonitor( SdResId(STR_PRIMARY_MONITOR ) ), + msExternalMonitor( SdResId(STR_EXTERNAL_MONITOR ) ), msMonitor( SdResId( STR_MONITOR ) ), msAllMonitors( SdResId( STR_ALL_MONITORS ) ) { @@ -200,14 +200,14 @@ void SdStartPresentationDlg::InitMonitorSettings() else { sal_Bool bUnifiedDisplay = false; - sal_Int32 nPrimaryIndex = 0; + sal_Int32 nExternalIndex = 0; Reference< XPropertySet > xMonProps( xMultiMon, UNO_QUERY ); if( xMonProps.is() ) try { const OUString sPropName1( "IsUnifiedDisplay" ); xMonProps->getPropertyValue( sPropName1 ) >>= bUnifiedDisplay; - const OUString sPropName2( "DefaultDisplay" ); - xMonProps->getPropertyValue( sPropName2 ) >>= nPrimaryIndex; + const OUString sPropName2( "ExternalDisplay" ); + xMonProps->getPropertyValue( sPropName2 ) >>= nExternalIndex; } catch( Exception& ) { @@ -216,7 +216,7 @@ void SdStartPresentationDlg::InitMonitorSettings() const String sPlaceHolder( RTL_CONSTASCII_USTRINGPARAM( "%1" ) ); for( sal_Int32 nDisplay = 0; nDisplay < mnMonitors; nDisplay++ ) { - String aName( nDisplay == nPrimaryIndex ? msPrimaryMonitor : msMonitor ); + String aName( nDisplay == nExternalIndex ? msExternalMonitor : msMonitor ); const String aNumber( String::CreateFromInt32( nDisplay + 1 ) ); aName.SearchAndReplace( sPlaceHolder, aNumber ); maLBMonitor.InsertEntry( aName ); @@ -227,7 +227,7 @@ void SdStartPresentationDlg::InitMonitorSettings() sal_Int32 nSelected = ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue(); if( nSelected <= 0 ) - nSelected = nPrimaryIndex; + nSelected = nExternalIndex; else nSelected--; diff --git a/sd/source/ui/dlg/present.src b/sd/source/ui/dlg/present.src index 6ee3fd86540f..3f3888f89c16 100644 --- a/sd/source/ui/dlg/present.src +++ b/sd/source/ui/dlg/present.src @@ -274,9 +274,9 @@ ModalDialog DLG_START_PRESENTATION ClipChildren = TRUE; }; - String STR_PRIMARY_MONITOR + String STR_EXTERNAL_MONITOR { - Text [ en-US ] = "Display %1 (primary)"; + Text [ en-US ] = "Display %1 (external)"; }; String STR_MONITOR diff --git a/sd/source/ui/inc/present.hrc b/sd/source/ui/inc/present.hrc index fc4d3b68d9f4..1d028beaddc7 100644 --- a/sd/source/ui/inc/present.hrc +++ b/sd/source/ui/inc/present.hrc @@ -59,7 +59,7 @@ #define FT_MONITOR 10 #define LB_MONITOR 11 -#define STR_PRIMARY_MONITOR 1 +#define STR_EXTERNAL_MONITOR 1 #define STR_MONITOR 2 #define STR_ALL_MONITORS 3 diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx index e02f75d93d1a..2a19777b6eef 100644 --- a/sd/source/ui/inc/present.hxx +++ b/sd/source/ui/inc/present.hxx @@ -81,7 +81,7 @@ private: const SfxItemSet& rOutAttrs; sal_Int32 mnMonitors; - String msPrimaryMonitor; + String msExternalMonitor; String msMonitor; String msAllMonitors; diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index ffd8cef911d8..ad9fbfb1c1aa 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -1298,7 +1298,7 @@ sal_Int32 SlideShow::GetDisplay() Reference<XPropertySet> xMonitorProperties( xFactory->createInstance( "com.sun.star.awt.DisplayAccess" ), UNO_QUERY_THROW); - xMonitorProperties->getPropertyValue("DefaultDisplay") >>= nDisplay; + xMonitorProperties->getPropertyValue("ExternalDisplay") >>= nDisplay; } catch( Exception& ) { diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx index 1d8d8eba37ab..d6e505711f23 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -433,21 +433,20 @@ void PresenterScreen::SwitchMonitors() Reference<XPresentationSupplier> xPS ( mxModel, UNO_QUERY_THROW); Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW); - sal_Int32 nDefaultDisplay = 0; - sal_Int32 nScreen = GetScreenNumber (xPresentation); - - if (nScreen == -1) // only a single display somehow + // Get the existing presenter console screen, we want to switch the + // presentation to use that instead. + sal_Int32 nNewScreen = GetPresenterScreenNumber (xPresentation); + if (nNewScreen < 0) return; - sal_Int32 nNewScreen = GetPresenterScreenFromScreen (nScreen); - + // Adapt that display number to be the 'default' setting of 0 if it matches + sal_Int32 nDefaultDisplay = 0; Reference<beans::XPropertySet> xDisplayProperties = GetDisplayAccess(); xDisplayProperties->getPropertyValue(A2S("DefaultDisplay")) >>= nDefaultDisplay; - if (nNewScreen == nDefaultDisplay) nNewScreen = 0; // screen zero is best == the primary display else - nNewScreen++; + nNewScreen++; // otherwise we store screens offset by one. // Set the new presentation display Reference<beans::XPropertySet> xProperties (xPresentation, UNO_QUERY_THROW); @@ -458,20 +457,22 @@ void PresenterScreen::SwitchMonitors() } } -sal_Int32 PresenterScreen::GetScreenNumber ( +// FIXME: really VCL should hold the current 'external' and 'built-in' +// display states, and hide them behind some attractive API, and +// the PresenterConsole should link VCL directly ... +sal_Int32 PresenterScreen::GetPresenterScreenNumber ( const Reference<presentation::XPresentation2>& rxPresentation) const { - // Determine the screen on which the full screen presentation is being - // displayed. sal_Int32 nScreenNumber (0); sal_Int32 nScreenCount (1); - fprintf (stderr, "New foo!\n"); try { Reference<beans::XPropertySet> xProperties (rxPresentation, UNO_QUERY); if ( ! xProperties.is()) return -1; + // Determine the screen on which the full screen presentation is being + // displayed. sal_Int32 nDisplayNumber (-1); if ( ! (xProperties->getPropertyValue(A2S("Display")) >>= nDisplayNumber)) return -1; @@ -487,7 +488,7 @@ sal_Int32 PresenterScreen::GetScreenNumber ( // Instantiate the DisplayAccess service to find out which // screen number that is. if (nDisplayNumber <= 0 && xDisplayProperties.is()) - xDisplayProperties->getPropertyValue(A2S("DefaultDisplay")) >>= nScreenNumber; + xDisplayProperties->getPropertyValue(A2S("ExternalDisplay")) >>= nScreenNumber; } // We still have to determine the number of screens to decide @@ -513,7 +514,7 @@ sal_Int32 PresenterScreen::GetScreenNumber ( OUString(RTL_CONSTASCII_USTRINGPARAM("Presenter/StartAlways"))) >>= bStartAlways) { if (bStartAlways) - return nScreenNumber; + return GetPresenterScreenFromScreen(nScreenNumber); } return -1; } @@ -525,7 +526,7 @@ sal_Int32 PresenterScreen::GetScreenNumber ( // the default instead. } - return nScreenNumber; + return GetPresenterScreenFromScreen(nScreenNumber); } sal_Int32 PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen ) const @@ -558,17 +559,15 @@ Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId ( { // A negative value means that the presentation spans all available // displays. That leaves no room for the presenter. - const sal_Int32 nScreenNumber(GetScreenNumber(rxPresentation)); - if (nScreenNumber < 0) + const sal_Int32 nScreen(GetPresenterScreenNumber(rxPresentation)); + if (nScreen < 0) return NULL; - sal_Int32 nPresenterScreenNumber = GetPresenterScreenFromScreen (nScreenNumber); - return ResourceId::create( Reference<XComponentContext>(mxContextWeak), PresenterHelper::msFullScreenPaneURL +A2S("?FullScreen=true&ScreenNumber=") - + OUString::valueOf(nPresenterScreenNumber)); + + OUString::valueOf(nScreen)); } void PresenterScreen::RequestShutdownPresenterScreen (void) diff --git a/sdext/source/presenter/PresenterScreen.hxx b/sdext/source/presenter/PresenterScreen.hxx index 40f99a210e8d..20a9735fa335 100644 --- a/sdext/source/presenter/PresenterScreen.hxx +++ b/sdext/source/presenter/PresenterScreen.hxx @@ -224,13 +224,14 @@ private: const double nRight, const double nBottom); - /** Return the screen number on which to display the presentation itself + /** Return the built-in screen number on the presentation will normally + display the presenter console. @return Returns -1 when the presenter screen can or shall not be displayed. */ - sal_Int32 GetScreenNumber ( - const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const; + sal_Int32 GetPresenterScreenNumber ( + const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const; sal_Int32 GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen ) const; |