summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndre Fischer <andre.f.fischer <Andre Fischer<andre.f.fischer@oracle.com>2011-03-09 11:16:39 +0100
committerAndre Fischer <andre.f.fischer <Andre Fischer<andre.f.fischer@oracle.com>2011-03-09 11:16:39 +0100
commit7fbb985bf869c69e98adf330eaa576e818bcd94e (patch)
tree497b4611c8dd7aa0cb26e1f9cf716354d9b37a8b /sd
parent971211f8e19173684b99e41f7229f7f33f680307 (diff)
impress211: #i110990# Fixed slide show spanning multiple displays on Windows.
Diffstat (limited to 'sd')
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/present.cxx22
-rwxr-xr-xsd/source/ui/slideshow/slideshow.cxx22
2 files changed, 18 insertions, 26 deletions
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index 473d2f4b452b..402ae8fd8a4d 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,16 +224,27 @@ 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( !bMultiscreen )
+ {
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 = nPrimaryIndex;
- else
- nSelected--;
maLBMonitor.SelectEntryPos( (USHORT)nSelected );
}
@@ -262,7 +276,7 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr )
USHORT 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 70777d8a06db..aa25d77691f7 100755
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -1228,28 +1228,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(
- OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.DisplayAccess"))),
- UNO_QUERY_THROW);
- const OUString sPropertyName (RTL_CONSTASCII_USTRINGPARAM("DefaultDisplay"));
- xMonitorProperties->getPropertyValue(sPropertyName) >>= nDisplay;
- }
- catch( Exception& )
- {
- }
- }
- else
- {
- nDisplay--;
- }
-
return nDisplay;
}