diff options
author | Andre Fische <andre.f.fischer Andre Fischerandre.f.fischer@oracle.com> | 2011-03-11 15:22:17 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-11-28 12:48:33 +0000 |
commit | 22e54a9d0ee80b156ddb74a3d80330d48213ce9e (patch) | |
tree | 1296be7d0060b7203ac530299020e95daa3ee519 /sd/source/ui/dlg/present.cxx | |
parent | 5c3614639cc448e5bdab6ed303de26a5ef9ce894 (diff) |
impress211: #i110990# Fixed remaining problems with display ids and indices.
Conflicts:
sd/source/ui/dlg/present.cxx
Diffstat (limited to 'sd/source/ui/dlg/present.cxx')
-rwxr-xr-x | sd/source/ui/dlg/present.cxx | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index dbe57f0442f5..1fcc07a46e65 100755 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -214,8 +214,9 @@ void SdStartPresentationDlg::InitMonitorSettings() { } - sal_Int32 nSelected (nPrimaryIndex); - const sal_Int32 nDefaultValue ( + sal_Int32 nSelectedIndex (-1); + sal_Int32 nDefaultExternalIndex (-1); + const sal_Int32 nDefaultSelectedDisplay ( ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue()); const String sPlaceHolder( RTL_CONSTASCII_USTRINGPARAM( "%1" ) ); for( sal_Int32 nDisplay = 0; nDisplay < mnMonitors; nDisplay++ ) @@ -229,25 +230,33 @@ void SdStartPresentationDlg::InitMonitorSettings() const sal_uInt32 nEntryIndex (maLBMonitor.GetEntryCount()-1); maLBMonitor.SetEntryData(nEntryIndex, (void*)nDisplay); - // Remember to select the default display. - if (nDefaultValue == nDisplay) - nSelected = nEntryIndex; + // Remember the index of the default selection. + if (nDefaultSelectedDisplay == nDisplay) + nSelectedIndex = nEntryIndex; + + // Remember index of the default display. + if (nDisplay == nExternalIndex) + nDefaultExternalIndex = nEntryIndex; } if( !bUnifiedDisplay ) + { maLBMonitor.InsertEntry( msAllMonitors ); const sal_uInt32 nEntryIndex (maLBMonitor.GetEntryCount()-1); maLBMonitor.SetEntryData(nEntryIndex, (void*)-1); - if (nDefaultValue == -1) - nSelected = nEntryIndex; + if (nDefaultSelectedDisplay == -1) + nSelectedIndex = nEntryIndex; } - if( nSelected <= 0 ) - nSelected = nExternalIndex; - else - nSelected--; + if (nSelectedIndex < 0) + { + if (nExternalIndex < 0) + nSelectedIndex = 0; + else + nSelectedIndex = nDefaultExternalIndex; + } - maLBMonitor.SelectEntryPos( (sal_uInt16)nSelected ); + maLBMonitor.SelectEntryPos((sal_uInt16)nSelectedIndex); } } catch( Exception& ) |