diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-11-22 09:26:07 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-11-22 09:26:07 +0000 |
commit | 9bdaf11977ba0e9fd61308fc1324a0c4901539af (patch) | |
tree | 87244bc7986446dd497ee80bf7fab166d69bf53a /sw/source/ui/fldui/javaedit.cxx | |
parent | f6079e63a5a77f4e0c866a36cb9772c53d2b4d7f (diff) |
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()
Diffstat (limited to 'sw/source/ui/fldui/javaedit.cxx')
-rw-r--r-- | sw/source/ui/fldui/javaedit.cxx | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index cdfdeb19aa..a1aaeca56e 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -4,9 +4,9 @@ * * $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 terms of GNU Lesser General Public License Version 2.1. @@ -53,6 +53,7 @@ #ifndef _MSGBOX_HXX //autogen #include <vcl/msgbox.hxx> #endif +#include <vcl/svapp.hxx> #ifndef SVTOOLS_URIHELPER_HXX #include <svtools/urihelper.hxx> #endif @@ -62,6 +63,9 @@ #ifndef _SFXDOCFILE_HXX #include <sfx2/docfile.hxx> #endif +#ifndef _FILEDLGHELPER_HXX +#include <sfx2/filedlghelper.hxx> +#endif #ifndef _SWDOCSH_HXX #include <docsh.hxx> #endif @@ -117,6 +121,8 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) : aHelpBtn ( this, SW_RES( BTN_POST_HELP ) ), pSh(pWrtSh), + pFileDlg(NULL), + pOldDefDlgParent(NULL), bNew(TRUE), bIsUrl(FALSE) { @@ -161,6 +167,8 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) : SwJavaEditDialog::~SwJavaEditDialog() { delete pMgr; + delete pFileDlg; + Application::SetDefDialogParent( pOldDefDlgParent ); } /*------------------------------------------------------------------------ @@ -302,12 +310,12 @@ void SwJavaEditDialog::SetFld() { aText = aUrlED.GetText(); if(aText.Len()) - { + { SfxMedium* pMedium = pSh->GetView().GetDocShell()->GetMedium(); INetURLObject aAbs; if( pMedium ) aAbs = pMedium->GetURLObject(); - + aText = URIHelper::SmartRel2Abs( aAbs, aText, URIHelper::GetMaybeFileHdl()); } @@ -354,19 +362,33 @@ IMPL_LINK( SwJavaEditDialog, RadioButtonHdl, RadioButton *, pBtn ) IMPL_LINK( SwJavaEditDialog, InsertFileHdl, PushButton *, pBtn ) { - String sFileName; - if( GetFileFilterNameDlg( *pBtn, sFileName )) + if ( !pFileDlg ) + { + 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); - if(INET_PROT_FILE == aINetURL.GetProtocol()) + INetURLObject aINetURL( sFileName ); + if ( INET_PROT_FILE == aINetURL.GetProtocol() ) sFileName = aINetURL.PathToFileName(); } aUrlED.SetText( sFileName ); } + return 0; } - - |