Kaydet (Commit) 8bcf6ba5 authored tarafından Andre Fische's avatar Andre Fische Kaydeden (comit) Michael Meeks

impress211: #i110990# Fixed slide show spanning multiple displays on Windows.

Conflicts:
	sd/source/ui/dlg/present.cxx
	sd/source/ui/slideshow/slideshow.cxx
üst cbb599f6
......@@ -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 )
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment