summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-06-25 12:38:25 +0200
committerSzymon Kłos <eszkadev@gmail.com>2015-07-16 09:53:11 +0200
commit0d9ce24f6ca57b19ac224daeb8a15123f026f694 (patch)
treee98b1d7596b190eec32858418ac3c68b029e9d58 /sfx2
parent6f88c8933434043d5627adea0c73e72dcf5aafd2 (diff)
open only if RET_OK
Change-Id: Ib9a62d2540ed2d6fad6efedd1fba59bfa4eb635b
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 7fce0c2a0d6a..b51d6fce0a5a 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1127,23 +1127,26 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
void SfxApplication::OpenRemoteExec_Impl( SfxRequest& rReq )
{
- ScopedVclPtrInstance< RemoteFilesDialog > aDlg((vcl::Window*)NULL, WB_OPEN);
+ ScopedVclPtrInstance< RemoteFilesDialog > aDlg( ( vcl::Window* )NULL, WB_OPEN );
// Filters for test purposes
aDlg->AddFilter("All files", FILTER_ALL);
aDlg->AddFilter("ODT files", "*.odt");
aDlg->AddFilter("ODS files", "*.ods");
- aDlg->Execute();
+ short nResult = aDlg->Execute();
- OUString sFileName = aDlg->GetPath();
+ if( nResult == RET_OK )
+ {
+ OUString sFileName = aDlg->GetPath();
- rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_default") ) );
- rReq.AppendItem( SfxStringItem( SID_REFERER, "private:user" ) );
- rReq.RemoveItem( SID_FILE_NAME );
- rReq.AppendItem( SfxStringItem( SID_FILE_NAME, sFileName ) );
+ rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString( "_default" ) ) );
+ rReq.AppendItem( SfxStringItem( SID_REFERER, "private:user" ) );
+ rReq.RemoveItem( SID_FILE_NAME );
+ rReq.AppendItem( SfxStringItem( SID_FILE_NAME, sFileName ) );
- GetDispatcher_Impl()->Execute( SID_OPENDOC, SfxCallMode::SYNCHRON, *rReq.GetArgs() );
+ GetDispatcher_Impl()->Execute( SID_OPENDOC, SfxCallMode::SYNCHRON, *rReq.GetArgs() );
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */