diff options
author | Andre Fische <andre.f.fischer Andre Fischerandre.f.fischer@oracle.com> | 2011-03-09 11:16:39 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-11-28 12:48:32 +0000 |
commit | 8bcf6ba5586818f4100113a6b685e891de84a5ea (patch) | |
tree | 4b26d1b7f2dbdc7905d7b74e239d2bea2952f52e /sd | |
parent | cbb599f657acc1953ef77d4f4fd895f75f9c7dad (diff) |
impress211: #i110990# Fixed slide show spanning multiple displays on Windows.
Conflicts:
sd/source/ui/dlg/present.cxx
sd/source/ui/slideshow/slideshow.cxx
Diffstat (limited to 'sd')
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/dlg/present.cxx | 21 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshow.cxx | 20 |
2 files changed, 18 insertions, 23 deletions
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index 7fe5a740d1f9..e606dfa4f191 100644..100755 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -214,6 +214,9 @@ void SdStartPresentationDlg::InitMonitorSettings() { } + sal_Int32 nSelected (nPrimaryIndex); + const sal_Int32 nDefaultValue ( + ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue()); const String sPlaceHolder( RTL_CONSTASCII_USTRINGPARAM( "%1" ) ); for( sal_Int32 nDisplay = 0; nDisplay < mnMonitors; nDisplay++ ) { @@ -221,12 +224,24 @@ void SdStartPresentationDlg::InitMonitorSettings() const String aNumber( String::CreateFromInt32( nDisplay + 1 ) ); aName.SearchAndReplace( sPlaceHolder, aNumber ); maLBMonitor.InsertEntry( aName ); + + // Store display index together with name. + const USHORT nEntryIndex (maLBMonitor.GetEntryCount()-1); + maLBMonitor.SetEntryData(nEntryIndex, (void*)nDisplay); + + // Remember to select the default display. + if (nDefaultValue == nDisplay) + nSelected = nEntryIndex; } - if( bUnifiedDisplay ) + if( !bUnifiedDisplay ) maLBMonitor.InsertEntry( msAllMonitors ); + const USHORT nEntryIndex (maLBMonitor.GetEntryCount()-1); + maLBMonitor.SetEntryData(nEntryIndex, (void*)-1); + if (nDefaultValue == -1) + nSelected = nEntryIndex; + } - sal_Int32 nSelected = ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue(); if( nSelected <= 0 ) nSelected = nExternalIndex; else @@ -262,7 +277,7 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr ) sal_uInt16 nPos = maLBMonitor.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) - rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, nPos + 1 ) ); + rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, (sal_Int32)maLBMonitor.GetEntryData(nPos)) ); nPos = aLbCustomshow.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index bd64cad418d7..3b4ca7d68d96 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -1293,26 +1293,6 @@ sal_Int32 SlideShow::GetDisplay() if( pOptions ) nDisplay = pOptions->GetDisplay(); - if (nDisplay <= 0 ) - { - try - { - Reference<XMultiServiceFactory > xFactory( - ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW); - Reference<XPropertySet> xMonitorProperties( - xFactory->createInstance( "com.sun.star.awt.DisplayAccess" ), - UNO_QUERY_THROW); - xMonitorProperties->getPropertyValue("ExternalDisplay") >>= nDisplay; - } - catch( Exception& ) - { - } - } - else - { - nDisplay--; - } - return nDisplay; } |