Kaydet (Commit) 11c63d0f authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS asyncdialogs (1.11.150); FILE MERGED

2006/09/20 14:30:30 pb 1.11.150.2: RESYNC: (1.11-1.12); FILE MERGED
2006/03/13 08:01:02 pb 1.11.150.1: fix: #i57125# FileDialogHelper instead getFileFilterNameDlg()
üst e4b4d358
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: javaedit.cxx,v $ * $RCSfile: javaedit.cxx,v $
* *
* $Revision: 1.12 $ * $Revision: 1.13 $
* *
* last change: $Author: obo $ $Date: 2006-09-16 23:00:08 $ * last change: $Author: vg $ $Date: 2006-11-22 10:26:07 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#ifndef _MSGBOX_HXX //autogen #ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
#endif #endif
#include <vcl/svapp.hxx>
#ifndef SVTOOLS_URIHELPER_HXX #ifndef SVTOOLS_URIHELPER_HXX
#include <svtools/urihelper.hxx> #include <svtools/urihelper.hxx>
#endif #endif
...@@ -62,6 +63,9 @@ ...@@ -62,6 +63,9 @@
#ifndef _SFXDOCFILE_HXX #ifndef _SFXDOCFILE_HXX
#include <sfx2/docfile.hxx> #include <sfx2/docfile.hxx>
#endif #endif
#ifndef _FILEDLGHELPER_HXX
#include <sfx2/filedlghelper.hxx>
#endif
#ifndef _SWDOCSH_HXX #ifndef _SWDOCSH_HXX
#include <docsh.hxx> #include <docsh.hxx>
#endif #endif
...@@ -117,6 +121,8 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) : ...@@ -117,6 +121,8 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) :
aHelpBtn ( this, SW_RES( BTN_POST_HELP ) ), aHelpBtn ( this, SW_RES( BTN_POST_HELP ) ),
pSh(pWrtSh), pSh(pWrtSh),
pFileDlg(NULL),
pOldDefDlgParent(NULL),
bNew(TRUE), bNew(TRUE),
bIsUrl(FALSE) bIsUrl(FALSE)
{ {
...@@ -161,6 +167,8 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) : ...@@ -161,6 +167,8 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) :
SwJavaEditDialog::~SwJavaEditDialog() SwJavaEditDialog::~SwJavaEditDialog()
{ {
delete pMgr; delete pMgr;
delete pFileDlg;
Application::SetDefDialogParent( pOldDefDlgParent );
} }
/*------------------------------------------------------------------------ /*------------------------------------------------------------------------
...@@ -354,19 +362,33 @@ IMPL_LINK( SwJavaEditDialog, RadioButtonHdl, RadioButton *, pBtn ) ...@@ -354,19 +362,33 @@ IMPL_LINK( SwJavaEditDialog, RadioButtonHdl, RadioButton *, pBtn )
IMPL_LINK( SwJavaEditDialog, InsertFileHdl, PushButton *, pBtn ) IMPL_LINK( SwJavaEditDialog, InsertFileHdl, PushButton *, pBtn )
{ {
String sFileName; if ( !pFileDlg )
if( GetFileFilterNameDlg( *pBtn, sFileName )) {
pOldDefDlgParent = Application::GetDefDialogParent();
Application::SetDefDialogParent( pBtn );
pFileDlg = new ::sfx2::FileDialogHelper(
(SFXWB_INSERT | WB_3DLOOK), String::CreateFromAscii("swriter") );
}
pFileDlg->StartExecuteModal( LINK( this, SwJavaEditDialog, DlgClosedHdl ) );
return 0;
}
IMPL_LINK( SwJavaEditDialog, DlgClosedHdl, sfx2::FileDialogHelper *, EMPTYARG )
{
if ( pFileDlg->GetError() == ERRCODE_NONE )
{ {
if(sFileName.Len()) String sFileName = pFileDlg->GetPath();
if ( sFileName.Len() > 0 )
{ {
INetURLObject aINetURL(sFileName); INetURLObject aINetURL( sFileName );
if(INET_PROT_FILE == aINetURL.GetProtocol()) if ( INET_PROT_FILE == aINetURL.GetProtocol() )
sFileName = aINetURL.PathToFileName(); sFileName = aINetURL.PathToFileName();
} }
aUrlED.SetText( sFileName ); aUrlED.SetText( sFileName );
} }
return 0; return 0;
} }
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