diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-11 14:50:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-11 14:58:20 +0100 |
commit | 1fbda7a5eda2c3ef2b0bd779ae81c38d83714503 (patch) | |
tree | 7f9df18fe2ffc20451728fef7b1d73278f63a30b | |
parent | 7a5dc88e055800af51ed7f5967c455c85a117741 (diff) |
Changing scanners has no effect
I guess no-one ever tested with multiple scanners but it just happens that my
laptops webcam is presented as a (non-functional) scanner alongside the real
one
(cherry picked from commit ab713ba1ffd00952ef8957f9b524e4e44f382f13)
Conflicts:
extensions/source/scanner/sanedlg.cxx
Change-Id: Ie36651cfc867027ef19e272dbabe46de6c4261ee
-rw-r--r-- | extensions/source/scanner/sanedlg.cxx | 12 | ||||
-rw-r--r-- | extensions/source/scanner/sanedlg.src | 1 |
2 files changed, 6 insertions, 7 deletions
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index eb25a2104290..a39a7ad19f20 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -160,8 +160,8 @@ void SaneDlg::InitDevices() maDeviceBox.InsertEntry( Sane::GetName( i ) ); if( Sane::CountDevices() ) { - mrSane.Open( 0 ); - maDeviceBox.SelectEntry( Sane::GetName( 0 ) ); + mrSane.Open(0); + maDeviceBox.SelectEntryPos(0); } } @@ -490,12 +490,12 @@ IMPL_LINK( SaneDlg, SelectHdl, ListBox*, pListBox ) { if( pListBox == &maDeviceBox && Sane::IsSane() && Sane::CountDevices() ) { - OUString aNewDevice = maDeviceBox.GetSelectEntry(); - int nNumber; - if( aNewDevice == Sane::GetName( nNumber = mrSane.GetDeviceNumber() ) ) + int nNewNumber = maDeviceBox.GetSelectEntryPos(); + int nOldNumber = mrSane.GetDeviceNumber(); + if (nNewNumber != nOldNumber) { mrSane.Close(); - mrSane.Open( nNumber ); + mrSane.Open(nNewNumber); InitFields(); } } diff --git a/extensions/source/scanner/sanedlg.src b/extensions/source/scanner/sanedlg.src index 242d1eab167a..03ef49daf179 100644 --- a/extensions/source/scanner/sanedlg.src +++ b/extensions/source/scanner/sanedlg.src @@ -141,7 +141,6 @@ ModalDialog RID_SANE_DIALOG HelpID = "extensions:ListBox:RID_SANE_DIALOG:RID_DEVICE_BOX"; Border = TRUE ; Dropdown = TRUE ; - Sort = TRUE ; Pos = MAP_APPFONT ( SECOND_COLUMN + 70 , 6 ) ; Size = MAP_APPFONT ( 60 , 80 ) ; }; |