Kaydet (Commit) 7f39e291 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS asyncdialogs (1.41.26); FILE MERGED

2006/09/20 19:12:05 pb 1.41.26.3: RESYNC: (1.43-1.44); FILE MERGED
2006/08/30 14:12:11 pb 1.41.26.2: RESYNC: (1.41-1.43); FILE MERGED
2006/06/28 10:48:21 pb 1.41.26.1: fix: #i57125# use of InsertDocumentsDialog() replaced
üst 6d0a25a0
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: view.cxx,v $ * $RCSfile: view.cxx,v $
* *
* $Revision: 1.44 $ * $Revision: 1.45 $
* *
* last change: $Author: obo $ $Date: 2006-09-17 07:57:08 $ * last change: $Author: vg $ $Date: 2006-11-22 10:40:41 $
* *
* 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.
...@@ -113,6 +113,12 @@ ...@@ -113,6 +113,12 @@
#ifndef _SFX_DOCFILT_HACK_HXX #ifndef _SFX_DOCFILT_HACK_HXX
#include <sfx2/docfilt.hxx> #include <sfx2/docfilt.hxx>
#endif #endif
#ifndef _SFX_DOCINSERT_HXX
#include <sfx2/docinsert.hxx>
#endif
#ifndef _FILEDLGHELPER_HXX
#include <sfx2/filedlghelper.hxx>
#endif
#ifndef _SVX_ZOOMITEM_HXX //autogen #ifndef _SVX_ZOOMITEM_HXX //autogen
#include <svx/zoomitem.hxx> #include <svx/zoomitem.hxx>
...@@ -773,6 +779,22 @@ SmCmdBoxWrapper::~SmCmdBoxWrapper() ...@@ -773,6 +779,22 @@ SmCmdBoxWrapper::~SmCmdBoxWrapper()
/**************************************************************************/ /**************************************************************************/
struct SmViewShell_Impl
{
sfx2::DocumentInserter* pDocInserter;
SfxRequest* pRequest;
SmViewShell_Impl() :
pDocInserter( NULL )
, pRequest( NULL )
{}
~SmViewShell_Impl()
{
delete pDocInserter;
delete pRequest;
}
};
TYPEINIT1( SmViewShell, SfxViewShell ); TYPEINIT1( SmViewShell, SfxViewShell );
...@@ -1620,25 +1642,13 @@ void SmViewShell::Execute(SfxRequest& rReq) ...@@ -1620,25 +1642,13 @@ void SmViewShell::Execute(SfxRequest& rReq)
case SID_INSERT_FORMULA: case SID_INSERT_FORMULA:
{ {
SmDocShell *pDoc = GetDoc(); delete pImpl->pRequest;
SfxMedium *pMedium = SFX_APP()-> pImpl->pRequest = new SfxRequest( rReq );
InsertDocumentDialog( 0, pDoc->GetFactory().GetFactoryName() ); delete pImpl->pDocInserter;
pImpl->pDocInserter =
if (pMedium != NULL) new ::sfx2::DocumentInserter( 0, GetDoc()->GetFactory().GetFactoryName(), 0 );
{ pImpl->pDocInserter->StartExecuteModal( LINK( this, SmViewShell, DialogClosedHdl ) );
if (pMedium->IsStorage()) return ;
Insert(*pMedium);
else
InsertFrom(*pMedium);
delete pMedium;
pDoc->UpdateText();
pDoc->ArrangeFormula();
pDoc->Repaint();
// Fenster anpassen, neuzeichnen, ModifyCount erhoehen,...
GetViewFrame()->GetBindings().Invalidate(SID_GAPHIC_SM);
}
rReq.SetReturnValue(SfxBoolItem(rReq.GetSlot(), TRUE));
} }
break; break;
...@@ -1864,11 +1874,12 @@ void SmViewShell::GetState(SfxItemSet &rSet) ...@@ -1864,11 +1874,12 @@ void SmViewShell::GetState(SfxItemSet &rSet)
SmViewShell::SmViewShell(SfxViewFrame *pFrame, SfxViewShell *): SmViewShell::SmViewShell(SfxViewFrame *pFrame, SfxViewShell *):
SfxViewShell(pFrame, SFX_VIEW_DISABLE_ACCELS | SFX_VIEW_MAXIMIZE_FIRST | SFX_VIEW_HAS_PRINTOPTIONS | SFX_VIEW_CAN_PRINT), SfxViewShell(pFrame, SFX_VIEW_DISABLE_ACCELS | SFX_VIEW_MAXIMIZE_FIRST | SFX_VIEW_HAS_PRINTOPTIONS | SFX_VIEW_CAN_PRINT),
aGraphic(this), aGraphic(this),
aGraphicController(aGraphic, SID_GAPHIC_SM, pFrame->GetBindings()) aGraphicController(aGraphic, SID_GAPHIC_SM, pFrame->GetBindings()),
pImpl( new SmViewShell_Impl )
{ {
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::SmViewShell" ); RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::SmViewShell" );
pViewFrame = &pFrame->GetWindow(); // pViewFrame = &pFrame->GetWindow();
SetStatusText(String()); SetStatusText(String());
SetWindow(&aGraphic); SetWindow(&aGraphic);
...@@ -1890,6 +1901,7 @@ SmViewShell::~SmViewShell() ...@@ -1890,6 +1901,7 @@ SmViewShell::~SmViewShell()
SmEditWindow *pEditWin = GetEditWindow(); SmEditWindow *pEditWin = GetEditWindow();
if (pEditWin) if (pEditWin)
pEditWin->DeleteEditView( *this ); pEditWin->DeleteEditView( *this );
delete pImpl;
} }
void SmViewShell::Deactivate( BOOL bIsMDIActivate ) void SmViewShell::Deactivate( BOOL bIsMDIActivate )
...@@ -1925,4 +1937,37 @@ void SmViewShell::Activate( BOOL bIsMDIActivate ) ...@@ -1925,4 +1937,37 @@ void SmViewShell::Activate( BOOL bIsMDIActivate )
} }
} }
//------------------------------------------------------------------
IMPL_LINK( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
{
DBG_ASSERT( _pFileDlg, "SmViewShell::DialogClosedHdl(): no file dialog" );
DBG_ASSERT( pImpl->pDocInserter, "ScDocShell::DialogClosedHdl(): no document inserter" );
if ( ERRCODE_NONE == _pFileDlg->GetError() )
{
USHORT nSlot = pImpl->pRequest->GetSlot();
SfxMedium* pMedium = pImpl->pDocInserter->CreateMedium();
if ( pMedium != NULL )
{
if ( pMedium->IsStorage() )
Insert( *pMedium );
else
InsertFrom( *pMedium );
delete pMedium;
SmDocShell* pDoc = GetDoc();
pDoc->UpdateText();
pDoc->ArrangeFormula();
pDoc->Repaint();
// adjust window, repaint, increment ModifyCount,...
GetViewFrame()->GetBindings().Invalidate(SID_GAPHIC_SM);
}
}
pImpl->pRequest->SetReturnValue( SfxBoolItem( pImpl->pRequest->GetSlot(), TRUE ) );
pImpl->pRequest->Done();
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