Kaydet (Commit) f1589f76 authored tarafından Michael Stahl's avatar Michael Stahl

rhbz#1079672: FileDialogHelper: don't hand out stale preview Graphic

The maGraphic is updated from a timer, and if you double-click on a file
then the dialog may exit with the previous file still previewed in
maGraphic, so the wrong image is returned by the dialog.

Change-Id: I99094d85d8d68d5c8a842f52e7039dbbbf095995
üst 414a6e4e
...@@ -789,23 +789,20 @@ ErrCode FileDialogHelper_Impl::getGraphic( Graphic& rGraphic ) const ...@@ -789,23 +789,20 @@ ErrCode FileDialogHelper_Impl::getGraphic( Graphic& rGraphic ) const
{ {
ErrCode nRet = ERRCODE_NONE; ErrCode nRet = ERRCODE_NONE;
if ( ! maGraphic ) // rhbz#1079672 do not return maGraphic, it need not be the selected file
{
OUString aPath;;
Sequence < OUString > aPathSeq = mxFileDlg->getFiles();
if ( aPathSeq.getLength() == 1 ) OUString aPath;;
{ Sequence<OUString> aPathSeq = mxFileDlg->getFiles();
aPath = aPathSeq[0];
}
if ( !aPath.isEmpty() ) if (aPathSeq.getLength() == 1)
nRet = getGraphic( aPath, rGraphic ); {
else aPath = aPathSeq[0];
nRet = ERRCODE_IO_GENERAL;
} }
if (!aPath.isEmpty())
nRet = getGraphic(aPath, rGraphic);
else else
rGraphic = maGraphic; nRet = ERRCODE_IO_GENERAL;
return nRet; return nRet;
} }
......
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