summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2009-11-30 12:56:04 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2009-11-30 12:56:04 +0100
commit419e42ede0639d5ed3098356a3613fc065d27c63 (patch)
tree120975bffa3a0a3b1c56635d1c1b4e4a34a00e17 /sfx2
parent3aa7d26a8c5d6a09f2653b701d905c3ac7d260b8 (diff)
[CWS autorecovery] merged SfxTopViewFrame into SfxViewFrame
SfxTopViewFrame was the only class deriving from the abstract class SfxViewFrame, so both can effectively be treated as one class. This change was done to make subsequent refactorings easier.
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/bindings.hxx3
-rw-r--r--sfx2/inc/sfx2/shell.hxx1
-rw-r--r--sfx2/inc/sfx2/topfrm.hxx84
-rw-r--r--sfx2/inc/sfx2/viewfrm.hxx43
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx4
-rw-r--r--sfx2/prj/d.lst1
-rw-r--r--sfx2/sdi/frmslots.sdi14
-rw-r--r--sfx2/sdi/makefile.mk1
-rw-r--r--sfx2/sdi/mdislots.sdi48
-rw-r--r--sfx2/sdi/sfxslots.sdi1
-rw-r--r--sfx2/source/appl/app.cxx2
-rw-r--r--sfx2/source/appl/appbas.cxx2
-rw-r--r--sfx2/source/appl/appdde.cxx4
-rw-r--r--sfx2/source/appl/appmisc.cxx2
-rw-r--r--sfx2/source/appl/appopen.cxx12
-rw-r--r--sfx2/source/appl/appreg.cxx3
-rw-r--r--sfx2/source/appl/appserv.cxx2
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx2
-rw-r--r--sfx2/source/appl/workwin.cxx2
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx2
-rw-r--r--sfx2/source/control/bindings.cxx4
-rw-r--r--sfx2/source/control/dispatch.cxx29
-rw-r--r--sfx2/source/doc/objcont.cxx2
-rw-r--r--sfx2/source/doc/objserv.cxx9
-rw-r--r--sfx2/source/doc/objxtor.cxx12
-rwxr-xr-xsfx2/source/doc/printhelper.cxx6
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx16
-rw-r--r--sfx2/source/inc/objshimp.hxx1
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sfx2/source/view/impviewframe.hxx87
-rw-r--r--sfx2/source/view/ipclient.cxx2
-rw-r--r--sfx2/source/view/topfrm.cxx335
-rw-r--r--sfx2/source/view/viewfrm.cxx364
-rw-r--r--sfx2/source/view/viewsh.cxx2
34 files changed, 397 insertions, 707 deletions
diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx
index ee981d7d7ce1..be2a71b5611d 100644
--- a/sfx2/inc/sfx2/bindings.hxx
+++ b/sfx2/inc/sfx2/bindings.hxx
@@ -99,8 +99,7 @@ class SFX2_DLLPUBLIC SfxBindings: public SfxBroadcaster
der Klasse SfxBindings. Sie wird von der SfxApplication automatisch
angelegt und zerst"ort. Instanzen werden aber i.d.R. "uber das
Makro <SFX_BINDINGS> oder den zugeh"origen <SfxViewFrame> besorgt
- werden. Bestimmte SfxViewFrame Subklassen (z.B. <SfxInPlaceFrame>)
- legen ihre eigene Instanz der SfxBindings an.
+ werden.
Die SfxBindings verwalten alle in den an ihr angemeldeten Controllern
gebundenen Slot-Ids und cachen die jeweiligen <Slot-Server>
diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx
index 69169a6d3d10..4a41149c41ba 100644
--- a/sfx2/inc/sfx2/shell.hxx
+++ b/sfx2/inc/sfx2/shell.hxx
@@ -89,7 +89,6 @@ enum SfxInterfaceId
SFX_INTERFACE_NONE,
SFX_INTERFACE_SFXAPP,
SFX_INTERFACE_SFXDOCSH,
- SFX_INTERFACE_SFXTOPFRM,
SFX_INTERFACE_SFXIPFRM,
SFX_INTERFACE_SFXVIEWSH,
SFX_INTERFACE_SFXVIEWFRM,
diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx
deleted file mode 100644
index eedfbb550228..000000000000
--- a/sfx2/inc/sfx2/topfrm.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: topfrm.hxx,v $
- * $Revision: 1.4 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SFX_TOPFRM_HXX
-#define _SFX_TOPFRM_HXX
-
-#include "sal/config.h"
-#include "sfx2/dllapi.h"
-#include "sal/types.h"
-#include <com/sun/star/uno/Reference.h>
-#include <vcl/dockwin.hxx>
-#include <vcl/wrkwin.hxx>
-
-#include <sfx2/frame.hxx>
-#include <sfx2/viewfrm.hxx>
-
-class SfxViewShell;
-namespace svtools { class AsynchronLink; }
-
-// class SfxTopViewFrame -------------------------------------------------
-
-class SfxTopViewFrame_Impl;
-class SFX2_DLLPUBLIC SfxTopViewFrame : public SfxViewFrame
-{
-friend class SfxTopWindow_Impl;
-friend class SfxTopViewFrame_Impl;
-
- SfxTopViewFrame_Impl* pImp;
- svtools::AsynchronLink* pCloser;
-
-protected:
-
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- virtual void Activate( BOOL bUI );
- virtual void Deactivate( BOOL bUI );
- virtual BOOL Close();
- virtual ~SfxTopViewFrame();
-
-public:
- TYPEINFO();
- SFX_DECL_INTERFACE(SFX_INTERFACE_SFXTOPFRM)
-
- SfxTopViewFrame( SfxFrame* pFrame, SfxObjectShell *pDoc=NULL, USHORT nViewId=0 );
-
- virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
- SAL_DLLPRIVATE virtual BOOL SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder );
- virtual String UpdateTitle();
-
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE void Exec_Impl(SfxRequest &);
- SAL_DLLPRIVATE void GetState_Impl(SfxItemSet &);
- SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &);
- SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &);
-//#endif
-};
-
-#endif // #ifndef _SFX_TOPFRM_HXX
-
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index 7b73682c636a..d95bcf9eb2d5 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -61,6 +61,10 @@ namespace sfx2
{
class SvLinkSource;
}
+namespace svtools
+{
+ class AsynchronLink;
+}
#ifndef SFX_DECL_OBJECTSHELL_DEFINED
#define SFX_DECL_OBJECTSHELL_DEFINED
@@ -129,6 +133,7 @@ Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder );
Rectangle & operator -= ( Rectangle & rRect, const SvBorder & rBorder );
+DBG_NAMEEX(SfxViewFrame)
class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener
{
struct SfxViewFrame_Impl* pImp;
@@ -143,11 +148,13 @@ private:
SAL_DLLPRIVATE void Construct_Impl( SfxObjectShell *pObjSh=NULL );
#endif
+// SfxViewFrame( SfxBindings&, SfxFrame*, SfxObjectShell *pDoc, sal_uInt32 nType );
+// SfxViewFrame( SfxObjectShell&, SfxBindings&, SfxFrame* p = NULL, sal_uInt32 nType = NULL );
+// SfxViewFrame( const SfxViewFrame &, SfxBindings &, SfxFrame *pFrame );
+
protected:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- SAL_DLLPRIVATE void SetWindow_Impl( Window *pWin );
-
#ifndef _SFX_HXX
SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE );
SAL_DLLPRIVATE void KillDispatcher_Impl();
@@ -156,28 +163,20 @@ protected:
virtual ~SfxViewFrame();
public:
+ SfxViewFrame( SfxFrame* pFrame, SfxObjectShell *pDoc = NULL, USHORT nViewId = 0 );
+
TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM)
- SfxViewFrame( SfxBindings&, SfxFrame*, SfxObjectShell *pDoc=0, sal_uInt32 nType = 0 );
- SfxViewFrame(SfxObjectShell&, SfxBindings&, SfxFrame*p=0, sal_uInt32 nType = 0);
- SfxViewFrame(
- const SfxViewFrame &, SfxBindings &, SfxFrame *pFrame);
-
static void SetViewFrame( SfxViewFrame* );
static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc,
USHORT nViewId=0,
BOOL bHidden=FALSE );
static SfxViewFrame* Current();
- static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0,
- TypeId aType = 0,
- BOOL bOnlyVisible = TRUE );
- static SfxViewFrame* GetNext( const SfxViewFrame& rPrev,
- const SfxObjectShell* pDoc = 0,
- TypeId aType = 0 ,
- BOOL bOnlyVisible = TRUE );
- static USHORT Count(TypeId = 0);
+ static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE );
+ static SfxViewFrame* GetNext( const SfxViewFrame& rPrev, const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE );
+ static USHORT Count();
void DoActivate(BOOL bMDI, SfxViewFrame *pOld=NULL);
void DoDeactivate(BOOL bMDI, SfxViewFrame *pOld=NULL);
@@ -189,8 +188,7 @@ public:
SfxBindings& GetBindings() { return *pBindings; }
const SfxBindings& GetBindings() const { return *pBindings; }
Window& GetWindow() const;
- virtual void SetZoomFactor( const Fraction &rZoomX,
- const Fraction &rZoomY ) = 0;
+ virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
SfxProgress* GetProgress() const;
#ifdef ENABLE_INIMANAGER//MUSTINI
@@ -214,6 +212,8 @@ public:
void ToTop();
void Enable( BOOL bEnable );
virtual BOOL Close();
+ virtual void Activate( BOOL bUI );
+ virtual void Deactivate( BOOL bUI );
// DDE-Interface
virtual long DdeExecute( const String& rCmd );
@@ -225,10 +225,10 @@ public:
const ::com::sun::star::uno::Any & rValue );
virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
- virtual void ShowStatusText( const String& rText );
- virtual void HideStatusText();
+ void ShowStatusText( const String& rText );
+ void HideStatusText();
- virtual String UpdateTitle();
+ String UpdateTitle();
// interne Handler
SAL_DLLPRIVATE virtual BOOL SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder );
@@ -302,6 +302,9 @@ public:
SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl( USHORT nId );
SAL_DLLPRIVATE void AddDispatchMacroToBasic_Impl(const ::rtl::OUString& sMacro);
+ SAL_DLLPRIVATE void Exec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &);
//#endif
private:
SAL_DLLPRIVATE SfxViewShell* LoadNewView_Impl( const USHORT i_nNewViewNo, SfxViewShell* i_pOldShell );
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 9b4e66ff84c6..3d5681e7f468 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -160,11 +160,7 @@ class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener
{
#ifdef _SFXVIEWSH_HXX
friend class SfxViewFrame;
-friend class SfxTopViewFrame;
friend class SfxPlugInFrame;
-friend class SfxInternalFrame;
-friend class SfxExternalTopViewFrame_Impl;
-friend class SfxOfficeDocController;
friend class SfxBaseController;
#endif
diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst
index 77acce9a7be9..ed411940ed0a 100644
--- a/sfx2/prj/d.lst
+++ b/sfx2/prj/d.lst
@@ -57,7 +57,6 @@ mkdir: %_DEST%\inc%_EXT%\sfx2
..\inc\sfx2\imgdef.hxx %_DEST%\inc%_EXT%\sfx2\imgdef.hxx
..\inc\sfx2\ipclient.hxx %_DEST%\inc%_EXT%\sfx2\ipclient.hxx
..\inc\sfx2\macrconf.hxx %_DEST%\inc%_EXT%\sfx2\macrconf.hxx
-..\inc\sfx2\topfrm.hxx %_DEST%\inc%_EXT%\sfx2\topfrm.hxx
..\inc\sfx2\mgetempl.hxx %_DEST%\inc%_EXT%\sfx2\mgetempl.hxx
..\inc\mieclip.hxx %_DEST%\inc%_EXT%\sfx2\mieclip.hxx
..\inc\sfx2\minarray.hxx %_DEST%\inc%_EXT%\sfx2\minarray.hxx
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index f1431a325773..00165e55886b 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -441,11 +441,23 @@ interface TopWindow : BrowseWindow
shell SfxViewFrame
{
- import BrowseWindow [Automation];
+ import TopWindow [Automation];
SID_FORMATMENUSTATE
[
StateMethod = MiscState_Impl ;
]
+
+ SID_ACTIVATE // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ SID_SHOWPOPUPS
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
}
diff --git a/sfx2/sdi/makefile.mk b/sfx2/sdi/makefile.mk
index f8def0a3c23c..3e353b67b9f1 100644
--- a/sfx2/sdi/makefile.mk
+++ b/sfx2/sdi/makefile.mk
@@ -54,7 +54,6 @@ SVSDI1DEPEND= \
appslots.sdi \
sfxslots.sdi \
docslots.sdi \
- mdislots.sdi \
viwslots.sdi \
frmslots.sdi
diff --git a/sfx2/sdi/mdislots.sdi b/sfx2/sdi/mdislots.sdi
deleted file mode 100644
index 88ffba45051e..000000000000
--- a/sfx2/sdi/mdislots.sdi
+++ /dev/null
@@ -1,48 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile
- *
- * $Revision$
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-shell SfxTopViewFrame : SfxViewFrame
-{
- import TopWindow [Automation];
-
- SID_ACTIVATE // ole(no) api(final/play/rec)
- [
- ExecMethod = Exec_Impl ;
- StateMethod = GetState_Impl ;
- ]
-
- SID_SHOWPOPUPS
- [
- ExecMethod = Exec_Impl ;
- StateMethod = GetState_Impl ;
- ]
-}
-
diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi
index e439e8c776a0..a5a76df5f13d 100644
--- a/sfx2/sdi/sfxslots.sdi
+++ b/sfx2/sdi/sfxslots.sdi
@@ -132,7 +132,6 @@ TypeLibFile( "sfxslots.tlb" )
include "docslots.sdi"
include "frmslots.sdi"
include "viwslots.sdi"
- include "mdislots.sdi"
include "appslots.sdi"
}
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index a4aaa8465ada..2c2f406affa3 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -111,7 +111,7 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/genlink.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "appdata.hxx"
#include "openflag.hxx"
#include "app.hrc"
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 37ba123b2aca..042ab05318b5 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -354,7 +354,7 @@ void SfxApplication::EnterBasicCall()
}
// die SbxObjects der SfxShells auf den Stacks der Frames erzeugen
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(0,0,sal_False);
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(0,sal_False);
pFrame;
pFrame = SfxViewFrame::GetNext(*pFrame,0,0,sal_False) )
{
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index ec26ead8a792..0fe1bb32162c 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -49,7 +49,7 @@
#include "appdata.hxx"
#include <sfx2/objsh.hxx>
#include <sfx2/viewfrm.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include "sfxtypes.hxx"
#include <sfx2/sfxsids.hrc>
@@ -632,7 +632,7 @@ String ImplDdeService::Topics()
SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
while( pShell )
{
- if( SfxViewFrame::GetFirst( pShell, TYPE(SfxTopViewFrame) ))
+ if( SfxViewFrame::GetFirst( pShell ) )
{
if( sRet.Len() )
sRet += '\t';
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index e9e0cb386ed8..06f5ce5454a7 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -89,7 +89,7 @@
#include <sfx2/templdlg.hxx>
#include <sfx2/module.hxx>
#include <sfx2/msgpool.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "openflag.hxx"
#include <sfx2/viewsh.hxx>
#include <sfx2/objface.hxx>
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index f5f0d1bb139b..f0d5e2322ba6 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -104,7 +104,7 @@
#include "sfxresid.hxx"
#include <sfx2/viewsh.hxx>
#include "app.hrc"
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/filedlghelper.hxx>
@@ -196,7 +196,7 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded
// Vergleiche anhand der URLs
INetURLObject aUrl( xDoc->GetMedium()->GetName() );
if ( !aUrl.HasError() && aUrl == aUrlToFind &&
- (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, 0, TRUE )) &&
+ (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, TRUE )) &&
!xDoc->IsLoading())
{
break;
@@ -213,12 +213,10 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded
DBG_ASSERT(
!bForbidVisible, "Unsichtbares kann nicht aktiviert werden" );
- SfxTopViewFrame *pFrame;
- for( pFrame = (SfxTopViewFrame*)
- SfxViewFrame::GetFirst( xDoc, TYPE(SfxTopViewFrame) );
+ SfxViewFrame* pFrame;
+ for( pFrame = SfxViewFrame::GetFirst( xDoc );
pFrame && !pFrame->IsVisible_Impl();
- pFrame = (SfxTopViewFrame*)
- SfxViewFrame::GetNext( *pFrame, xDoc, TYPE(SfxTopViewFrame) ) ) ;
+ pFrame = SfxViewFrame::GetNext( *pFrame, xDoc ) ) ;
if ( pFrame )
{
SfxViewFrame *pCur = SfxViewFrame::Current();
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index aa5205f739c4..83ba8ddff705 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -46,7 +46,7 @@
#include "stbitem.hxx"
#include <sfx2/navigat.hxx>
#include <sfx2/module.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "partwnd.hxx"
#include <sfx2/sfxsids.hrc>
#include "recfloat.hxx"
@@ -62,7 +62,6 @@ void SfxApplication::Registrations_Impl()
SfxApplication::RegisterInterface();
SfxModule::RegisterInterface();
SfxViewFrame::RegisterInterface();
- SfxTopViewFrame::RegisterInterface();
SfxObjectShell::RegisterInterface();
SfxViewShell::RegisterInterface();
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 24498c19516f..268fdcdf386a 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -131,7 +131,7 @@
#include "minfitem.hxx"
#include <sfx2/event.hxx>
#include <sfx2/module.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "sfxpicklist.hxx"
#include "imestatuswindow.hxx"
#include <sfx2/sfxdlg.hxx>
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 91227e3e34ec..96d7cc295cac 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -449,7 +449,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
return;
// ignore hidden documents
- if ( !SfxViewFrame::GetFirst( pDocSh, 0, TRUE ) )
+ if ( !SfxViewFrame::GetFirst( pDocSh, TRUE ) )
return;
::rtl::OUString aTitle = pDocSh->GetTitle(SFX_TITLE_PICKLIST);
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index d2338a9c7226..c1780cd7be5f 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -41,7 +41,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/app.hxx>
#include "workwin.hxx"
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "arrdecl.hxx"
#include <sfx2/viewfrm.hxx>
#include <sfx2/module.hxx>
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 358c226d6c4a..ab82e498e72b 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -127,7 +127,7 @@ using namespace ::vos;
#include <sfx2/doctempl.hxx>
#include <sfx2/frame.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "helper.hxx"
#include "fltlst.hxx"
#include <sfx2/request.hxx>
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 3a2796aba995..edf19cafb179 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -71,7 +71,7 @@
#include <sfx2/unoctitm.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/sfxuno.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/msgpool.hxx>
@@ -2349,7 +2349,7 @@ SystemWindow* SfxBindings::GetSystemWindow() const
SfxViewFrame *pFrame = pDispatcher->GetFrame();
while ( pFrame->GetParentViewFrame_Impl() )
pFrame = pFrame->GetParentViewFrame_Impl();
- SfxTopViewFrame* pTop = PTR_CAST( SfxTopViewFrame, pFrame->GetTopViewFrame() );
+ SfxViewFrame* pTop = pFrame->GetTopViewFrame();
return pTop->GetFrame()->GetTopWindow_Impl();
}
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 6cd32f4b24f8..a2697c4fe947 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -79,7 +79,7 @@
#include <sfx2/docfac.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/module.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/mnumgr.hxx>
@@ -1676,7 +1676,7 @@ void SfxDispatcher::SetMenu_Impl()
{
if ( pImp->pFrame )
{
- SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() );
+ SfxViewFrame* pTop = pImp->pFrame->GetTopViewFrame();
if ( pTop && pTop->GetBindings().GetDispatcher() == this )
{
SfxFrame* pFrm = pTop->GetFrame();
@@ -1732,7 +1732,7 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce )
if ( !bUpdate || pImp->pFrame->GetFrame()->IsClosing_Impl() )
return 0;
- SfxTopViewFrame* pTop = pImp->pFrame ? PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() ) : NULL;
+ SfxViewFrame* pTop = pImp->pFrame ? pImp->pFrame->GetTopViewFrame() : NULL;
sal_Bool bUIActive = pTop && pTop->GetBindings().GetDispatcher() == this;
if ( !bUIActive && pTop && GetBindings() == &pTop->GetBindings() )
@@ -2911,7 +2911,7 @@ void SfxDispatcher::HideUI( sal_Bool bHide )
pImp->bNoUI = bHide;
if ( pImp->pFrame )
{
- SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() );
+ SfxViewFrame* pTop = pImp->pFrame->GetTopViewFrame();
if ( pTop && pTop->GetBindings().GetDispatcher() == this )
{
SfxFrame* pFrm = pTop->GetFrame();
@@ -3160,27 +3160,6 @@ void SfxDispatcher::InvalidateBindings_Impl( sal_Bool bModify )
pFrame;
pFrame = SfxViewFrame::GetNext( *pFrame ) )
pFrame->GetBindings().InvalidateAll(bModify);
-/*
- // alle Bindings sind betroffen
- for ( SfxInPlaceFrame *pIPFrame = (SfxInPlaceFrame*)
- SfxViewFrame::GetFirst(0, TYPE(SfxInPlaceFrame));
- pIPFrame;
- pIPFrame = (SfxInPlaceFrame*)
- SfxViewFrame::GetNext(*pIPFrame, 0, TYPE(SfxInPlaceFrame)) )
- pIPFrame->GetBindings().InvalidateAll(bModify);
-
- for ( SfxPlugInFrame *pPIFrame = (SfxPlugInFrame*)
- SfxViewFrame::GetFirst(0, TYPE(SfxPlugInFrame));
- pPIFrame;
- pPIFrame = (SfxPlugInFrame*)
- SfxViewFrame::GetNext(*pPIFrame, 0, TYPE(SfxPlugInFrame)) )
- pPIFrame->GetBindings().InvalidateAll(bModify);
-
- for ( SfxTask* pTask = SfxTask::GetFirst(); pTask;
- pTask = SfxTask::GetNext( *pTask ) )
- if ( !pTask->IsExternal() )
- pTask->GetBindings()->InvalidateAll(bModify);
-*/
}
else
{
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index e1890be33223..4faa96c3d9c9 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -76,7 +76,7 @@
#include "sfxhelp.hxx"
#include <sfx2/dispatch.hxx>
#include <sfx2/printer.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "basmgr.hxx"
#include <sfx2/doctempl.hxx>
#include "doc.hrc"
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 8a8512a37af0..e80ab038c26b 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -88,7 +88,7 @@
#include "sfxtypes.hxx"
//#include "interno.hxx"
#include <sfx2/module.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "versdlg.hxx"
#include "doc.hrc"
#include <sfx2/docfac.hxx>
@@ -140,8 +140,6 @@ public:
#define SfxObjectShell
#include "sfxslots.hxx"
-svtools::AsynchronLink* pPendingCloser = 0;
-
//=========================================================================
@@ -283,7 +281,7 @@ void SfxObjectShell::PrintExec_Impl(SfxRequest &rReq)
void SfxObjectShell::PrintState_Impl(SfxItemSet &rSet)
{
bool bPrinting = false;
- SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame));
+ SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this );
if ( pFrame )
{
SfxPrinter *pPrinter = pFrame->GetViewShell()->GetPrinter();
@@ -1218,8 +1216,7 @@ void SfxObjectShell::ExecView_Impl(SfxRequest &rReq)
{
case SID_ACTIVATE:
{
- SfxViewFrame *pFrame =
- SfxViewFrame::GetFirst( this, TYPE(SfxTopViewFrame), TRUE );
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, TRUE );
if ( pFrame )
pFrame->GetFrame()->Appear();
rReq.SetReturnValue( SfxObjectItem( 0, pFrame ) );
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index d637083d2f4a..2adda6d209fd 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -134,7 +134,6 @@ DBG_NAME(SfxObjectShell)
#define DocumentInfo
#include "sfxslots.hxx"
-extern svtools::AsynchronLink* pPendingCloser;
static WeakReference< XInterface > s_xCurrentComponent;
//=========================================================================
@@ -251,7 +250,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,pFrame( 0 )
,pTbxConfig( 0 )
,eFlags( SFXOBJECTSHELL_UNDEFINED )
- ,pCloser( 0 )
,bReadOnlyUI( sal_False )
,bHiddenLockedByAPI( sal_False )
,bInCloseEvent( sal_False )
@@ -271,9 +269,6 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
SfxObjectShell_Impl::~SfxObjectShell_Impl()
{
- if ( pPendingCloser == pCloser )
- pPendingCloser = 0;
- delete pCloser;
delete pBasicManager;
}
@@ -489,7 +484,7 @@ SfxObjectShell* SfxObjectShell::GetFirst
continue;
if ( ( !pType || pSh->IsA(*pType) ) &&
- ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, 0, sal_True )))
+ ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, sal_True )))
return pSh;
}
@@ -522,7 +517,7 @@ SfxObjectShell* SfxObjectShell::GetNext
continue;
if ( ( !pType || pSh->IsA(*pType) ) &&
- ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, 0, sal_True )))
+ ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, sal_True )))
return pSh;
}
return 0;
@@ -566,8 +561,7 @@ sal_uInt16 SfxObjectShell::PrepareClose
return sal_False;
// prepare views for closing
- for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst(
- this, TYPE(SfxViewFrame));
+ for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
pFrm; pFrm = SfxViewFrame::GetNext( *pFrm, this ) )
{
DBG_ASSERT(pFrm->GetViewShell(),"KeineShell");
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index cd8e28ee771c..0c8f1e63835a 100755
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -269,7 +269,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro
// Printer beschaffen
SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
+ SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0;
if ( !pViewFrm )
return uno::Sequence< beans::PropertyValue >();
@@ -320,7 +320,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
{
// alten Printer beschaffen
SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
+ SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0;
if ( !pViewFrm )
return;
@@ -583,7 +583,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// get view for sfx printing capabilities
SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
+ SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0;
if ( !pViewFrm )
return;
SfxViewShell* pView = pViewFrm->GetViewShell();
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index ce78ddb50799..0c2c6a54442f 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -118,7 +118,7 @@
#include <sfx2/evntconf.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/app.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "appdata.hxx"
#include <sfx2/docfac.hxx>
#include <sfx2/fcontnr.hxx>
@@ -361,8 +361,10 @@ SfxOwnFramesLocker::SfxOwnFramesLocker( SfxObjectShell* pObjectShell )
if ( !pObjectShell )
return;
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pObjectShell, TYPE(SfxTopViewFrame) ); pFrame;
- pFrame = SfxViewFrame::GetNext(*pFrame, pObjectShell, TYPE(SfxTopViewFrame) ) )
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pObjectShell );
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pObjectShell )
+ )
{
SfxFrame* pSfxFrame = pFrame->GetFrame();
if ( pSfxFrame )
@@ -2937,7 +2939,7 @@ uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData()
{
SfxViewFrame *pActFrame = SfxViewFrame::Current();
if ( !pActFrame || pActFrame->GetObjectShell() != m_pData->m_pObjectShell )
- pActFrame = SfxViewFrame::GetFirst(m_pData->m_pObjectShell, TYPE(SfxTopViewFrame));
+ pActFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell );
if ( !pActFrame || !pActFrame->GetViewShell() )
// currently no frame for this document at all or View is under construction
@@ -2958,8 +2960,8 @@ uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData()
sal_Int32 nCount = 0;
uno::Sequence < beans::PropertyValue > aSeq;
::com::sun::star::uno::Any aAny;
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(m_pData->m_pObjectShell, TYPE(SfxTopViewFrame) ); pFrame;
- pFrame = SfxViewFrame::GetNext(*pFrame, m_pData->m_pObjectShell, TYPE(SfxTopViewFrame) ) )
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell ); pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, m_pData->m_pObjectShell ) )
{
BOOL bIsActive = ( pFrame == pActFrame );
pFrame->GetViewShell()->WriteUserDataSequence( aSeq );
@@ -3391,7 +3393,7 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz
if ( !m_pData->m_pObjectShell.Is() )
throw uno::Exception(); // TODO: error handling
- SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False );
+ SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False );
if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame()->IsInPlace() )
{
Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame()->GetFrameInterface()->getContainerWindow() );
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index 9e5bc0cc8ce1..be19b263115e 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -143,7 +143,6 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
SfxFrame* pFrame;
SfxToolBoxConfig* pTbxConfig;
SfxObjectShellFlags eFlags;
- svtools::AsynchronLink* pCloser;
String aBaseURL;
sal_Bool bReadOnlyUI;
SvRefBaseRef xHeaderAttributes;
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 8b0380010a18..ca09048fe082 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -80,7 +80,7 @@
#include <sfx2/fcontnr.hxx>
#include "impframe.hxx"
#include <sfx2/appuno.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "workwin.hxx"
#include <sfx2/sfxuno.hxx>
#include <sfx2/msgpool.hxx>
diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx
new file mode 100644
index 000000000000..9b57237ae5bc
--- /dev/null
+++ b/sfx2/source/view/impviewframe.hxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef SFX2_IMPVIEWFRAME_HXX
+#define SFX2_IMPVIEWFRAME_HXX
+
+struct SfxViewFrame_Impl
+{
+ SvBorder aBorder;
+ Size aMargin;
+ Size aSize;
+ String aFrameTitle;
+ TypeId aLastType;
+ String aActualURL;
+ SfxFrame* pFrame;
+ svtools::AsynchronLink* pReloader;
+ Window* pWindow;
+ SfxViewFrame* pActiveChild;
+ Window* pFocusWin;
+ sal_uInt16 nDocViewNo;
+ sal_uInt16 nCurViewId;
+ sal_Bool bResizeInToOut:1;
+ sal_Bool bDontOverwriteResizeInToOut:1;
+ sal_Bool bObjLocked:1;
+ sal_Bool bReloading:1;
+ sal_Bool bIsDowning:1;
+ sal_Bool bInCtor:1;
+ sal_Bool bModal:1;
+ sal_Bool bEnabled:1;
+ sal_Bool bWindowWasEnabled:1;
+ sal_Bool bActive;
+ String aFactoryName;
+
+ SfxViewFrame_Impl()
+ : pReloader(0 )
+ , pWindow( 0 )
+ , bWindowWasEnabled(sal_True)
+ , bActive( sal_False )
+ {}
+
+ ~SfxViewFrame_Impl()
+ {
+ delete pReloader;
+ }
+};
+
+class SfxTopViewWin_Impl : public Window
+{
+ BOOL bActive;
+ SfxViewFrame* pFrame;
+
+public:
+ SfxTopViewWin_Impl( SfxViewFrame* p, Window& rParent, WinBits nBits=0 ) :
+ Window( &rParent, nBits | WB_BORDER | WB_CLIPCHILDREN ),
+ bActive( FALSE ),
+ pFrame( p )
+ {
+ p->GetFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER );
+ }
+
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+};
+
+#endif SFX2_IMPVIEWFRAME_HXX
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index f025a373f1ae..51752e25c81a 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -60,7 +60,7 @@
#include <sfx2/dispatch.hxx>
#include "workwin.hxx"
#include "guisaveas.hxx"
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <cppuhelper/implbase5.hxx>
#include <vcl/salbtype.hxx>
#include <svtools/ehdl.hxx>
diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx
index 5913503e6254..b1e7180dc5e8 100644
--- a/sfx2/source/view/topfrm.cxx
+++ b/sfx2/source/view/topfrm.cxx
@@ -33,7 +33,7 @@
#ifndef GCC
#endif
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/signaturestate.hxx>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
@@ -99,6 +99,7 @@
#include "statcach.hxx"
#include <sfx2/event.hxx>
#include "impframe.hxx"
+#include "impviewframe.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -110,11 +111,6 @@ using ::com::sun::star::document::XViewDataSupplier;
//------------------------------------------------------------------------
-#define SfxTopViewFrame
-#include "sfxslots.hxx"
-
-DBG_NAME(SfxTopViewFrame)
-
#include <comphelper/sequenceashashmap.hxx>
static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService )
{
@@ -298,27 +294,6 @@ void SfxTopWindow_Impl::DoResize()
pFrame->Resize();
}
-class SfxTopViewWin_Impl : public Window
-{
-friend class SfxInternalFrame;
-
- BOOL bActive;
- SfxTopViewFrame* pFrame;
-
-public:
- SfxTopViewWin_Impl( SfxTopViewFrame* p,
- Window *pParent, WinBits nBits=0 ) :
- Window( pParent, nBits | WB_BORDER | WB_CLIPCHILDREN ),
- bActive( FALSE ),
- pFrame( p )
- {
- p->GetFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER );
- }
-
- virtual void Resize();
- virtual void StateChanged( StateChangedType nStateChange );
-};
-
//--------------------------------------------------------------------
void SfxTopViewWin_Impl::StateChanged( StateChangedType nStateChange )
{
@@ -343,18 +318,11 @@ void SfxTopViewWin_Impl::Resize()
class SfxTopViewFrame_Impl
{
public:
- sal_Bool bActive;
- Window* pWindow;
- String aFactoryName;
SfxTopViewFrame_Impl()
- : bActive( sal_False )
- , pWindow( 0 )
{}
};
-static svtools::AsynchronLink* pPendingCloser = 0;
-
static String _getTabString()
{
String result;
@@ -808,10 +776,10 @@ sal_Bool SfxFrame::InsertDocument_Impl( SfxObjectShell& rDoc )
if ( nPluginMode && ( nPluginMode != 2 ) )
SetInPlace_Impl( TRUE );
- SfxViewFrame* pViewFrame = new SfxTopViewFrame( this, &rDoc, nViewId );
+ SfxViewFrame* pViewFrame = new SfxViewFrame( this, &rDoc, nViewId );
if ( !pViewFrame->GetViewShell() )
{
- OSL_ENSURE( false, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxTopViewFrame!" );
+ OSL_ENSURE( false, "SfxFrame::InsertDocument_Impl: something went wrong while creating the SfxViewFrame!" );
pViewFrame->DoClose();
return sal_False;
}
@@ -931,19 +899,12 @@ long SfxViewFrameClose_Impl( void* /*pObj*/, void* pArg )
return 0;
}
-TYPEINIT1(SfxTopViewFrame, SfxViewFrame);
-
//--------------------------------------------------------------------
-SFX_IMPL_INTERFACE(SfxTopViewFrame,SfxViewFrame,SfxResId(0))
-{
-}
-
-//--------------------------------------------------------------------
-String SfxTopViewFrame::UpdateTitle()
+String SfxViewFrame::UpdateTitle()
/* [Beschreibung]
- Mit dieser Methode kann der SfxTopViewFrame gezwungen werden, sich sofort
+ Mit dieser Methode kann der SfxViewFrame gezwungen werden, sich sofort
den neuen Titel vom der <SfxObjectShell> zu besorgen.
[Anmerkung]
@@ -964,11 +925,9 @@ String SfxTopViewFrame::UpdateTitle()
switch( ( (SfxSimpleHint&) rHint ).GetId() )
{
case SFX_HINT_TITLECHANGED:
- for ( SfxTopViewFrame *pTop = (SfxTopViewFrame*)
- SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame));
+ for ( SfxViewFrame *pTop = SfxViewFrame::GetFirst( this );
pTop;
- pTop = (SfxTopViewFrame*)
- SfxViewFrame::GetNext(this, TYPE(SfxTopViewFrame));
+ pTop = SfxViewFrame::GetNext( this );
{
pTop->UpdateTitle();
... pTop->GetName() ...
@@ -981,12 +940,61 @@ String SfxTopViewFrame::UpdateTitle()
*/
{
- DBG_CHKTHIS(SfxTopViewFrame, 0);
+ DBG_CHKTHIS(SfxViewFrame, 0);
const SfxObjectFactory &rFact = GetObjectShell()->GetFactory();
pImp->aFactoryName = String::CreateFromAscii( rFact.GetShortName() );
- String aTitle = SfxViewFrame::UpdateTitle();
+ SfxObjectShell *pObjSh = GetObjectShell();
+ if ( !pObjSh )
+ return String();
+
+// if ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+// // kein UpdateTitle mit Embedded-ObjectShell
+// return String();
+
+ const SfxMedium *pMedium = pObjSh->GetMedium();
+ String aURL;
+ GetFrame(); // -Wall required??
+ if ( pObjSh->HasName() )
+ {
+ INetURLObject aTmp( pMedium->GetName() );
+ aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
+ }
+
+ if ( aURL != pImp->aActualURL )
+ // URL hat sich ge"andert
+ pImp->aActualURL = aURL;
+
+ // gibt es noch eine weitere View?
+ sal_uInt16 nViews=0;
+ for ( SfxViewFrame *pView= GetFirst(pObjSh);
+ pView && nViews<2;
+ pView = GetNext(*pView,pObjSh) )
+ if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) &&
+ !IsDowning_Impl())
+ nViews++;
+
+ // Titel des Fensters
+ String aTitle;
+ if ( nViews == 2 || pImp->nDocViewNo > 1 )
+ // dann die Nummer dranh"angen
+ aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo );
+ else
+ aTitle = pObjSh->UpdateTitle();
+
+ // Name des SbxObjects
+ String aSbxName = pObjSh->SfxShell::GetName();
+ if ( IsVisible_Impl() )
+ {
+ aSbxName += ':';
+ aSbxName += String::CreateFromInt32(pImp->nDocViewNo);
+ }
+
+ SetName( aSbxName );
+ pImp->aFrameTitle = aTitle;
+ GetBindings().Invalidate( SID_FRAMETITLE );
+ GetBindings().Invalidate( SID_CURRENT_URL );
::rtl::OUString aProductName;
::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName;
@@ -1017,200 +1025,7 @@ String SfxTopViewFrame::UpdateTitle()
return aTitle;
}
-//--------------------------------------------------------------------
-void SfxTopViewFrame::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
-{
- {DBG_CHKTHIS(SfxTopViewFrame, 0);}
-
- if( IsDowning_Impl())
- return;
-
- // we know only SimpleHints
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
- {
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
- {
- case SFX_HINT_MODECHANGED:
- case SFX_HINT_TITLECHANGED:
- // when the document changes its title, change views too
- UpdateTitle();
- break;
-
- case SFX_HINT_DEINITIALIZING:
- // on all other changes force repaint
- GetFrame()->DoClose();
- return;
- }
- }
-
- SfxViewFrame::Notify( rBC, rHint );
-}
-
-//--------------------------------------------------------------------
-sal_Bool SfxTopViewFrame::Close()
-{
- {DBG_CHKTHIS(SfxTopViewFrame, 0);}
-
- // Modaler Dialog oben ??
-// if ( pImp->GetModalDialog() )
-// return sal_False;
-
- // eigentliches Schlie\sen
- if ( SfxViewFrame::Close() )
- {
- if (SfxViewFrame::Current() == this)
- SfxViewFrame::SetViewFrame(0);
-
- // Da der Dispatcher leer ger"aumt wird, kann man ihn auch nicht mehr
- // vern"unftig verwenden - also besser still legen
- GetDispatcher()->Lock(sal_True);
- delete this;
-
- return sal_True;
- }
-
- return sal_False;
-}
-
-SfxTopViewFrame::SfxTopViewFrame
-(
- SfxFrame* pFrame,
- SfxObjectShell* pObjShell,
- sal_uInt16 nViewId
-)
-
-/* [Beschreibung]
-
- Ctor des SfxTopViewFrame f"ur eine <SfxObjectShell> aus der Ressource.
- Die 'nViewId' der zu erzeugenden <SfxViewShell> kann angegeben werden
- (default ist die zuerst registrierte SfxViewShell-Subklasse).
-*/
-
- : SfxViewFrame( *(new SfxBindings), pFrame, pObjShell, SFXFRAME_HASTITLE )
-{
- DBG_CTOR(SfxTopViewFrame, 0);
-
- pCloser = 0;
- pImp = new SfxTopViewFrame_Impl;
-
-//(mba)/task if ( !pFrame->GetTask() )
- {
- pImp->pWindow = new SfxTopViewWin_Impl( this, &pFrame->GetWindow() );
- pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() );
- SetWindow_Impl( pImp->pWindow );
- pFrame->SetOwnsBindings_Impl( sal_True );
- pFrame->CreateWorkWindow_Impl();
- }
-
- sal_uInt32 nType = SFXFRAME_OWNSDOCUMENT | SFXFRAME_HASTITLE;
- if ( pObjShell && pObjShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
- nType |= SFXFRAME_EXTERNAL;
- GetFrame()->SetFrameType_Impl( GetFrame()->GetFrameType() | nType );
-
- if ( GetFrame()->IsInPlace() )
- {
- LockAdjustPosSizePixel();
- }
-
- if ( pObjShell && !SwitchToViewShell_Impl( nViewId ) )
- {
- // TODO: better error handling? Under which conditions can this fail?
- return;
- }
-
- if ( GetFrame()->IsInPlace() )
- {
- UnlockAdjustPosSizePixel();
- }
- else if ( GetViewShell() && GetViewShell()->UseObjectSize() )
- {
- // initiale Gr"o\se festlegen
- // Zuerst die logischen Koordinaten von IP-Objekt und EditWindow
- // ber"ucksichtigen
- LockAdjustPosSizePixel();
- ForceInnerResize_Impl( TRUE );
-
- Window *pWindow = GetViewShell()->GetWindow();
-
- // Da in den Applikationen bei der R"ucktransformation immer die
- // Eckpunkte tranformiert werden und nicht die Size (um die Ecken
- // alignen zu k"onnen), transformieren wir hier auch die Punkte, um
- // m"oglichst wenig Rundungsfehler zu erhalten.
-/*
- Rectangle aRect = pWindow->LogicToLogic( GetObjectShell()->GetVisArea(),
- GetObjectShell()->GetMapUnit(),
- pWindow->GetMapMode() );
-*/
- Rectangle aRect = pWindow->LogicToPixel( GetObjectShell()->GetVisArea() );
- Size aSize = aRect.GetSize();
- GetViewShell()->GetWindow()->SetSizePixel( aSize );
- DoAdjustPosSizePixel(GetViewShell(), Point(), aSize );
- }
-}
-
-//------------------------------------------------------------------------
-SfxTopViewFrame::~SfxTopViewFrame()
-{
- DBG_DTOR(SfxTopViewFrame, 0);
-
- SetDowning_Impl();
-
- if ( SfxViewFrame::Current() == this )
- SfxViewFrame::SetViewFrame(NULL);
-
- ReleaseObjectShell_Impl();
- if ( pPendingCloser == pCloser )
- pPendingCloser = 0;
- delete pCloser;
- if ( GetFrame()->OwnsBindings_Impl() )
- // Die Bindings l"oscht der Frame!
- KillDispatcher_Impl();
-
- delete pImp->pWindow;
- delete pImp;
-}
-
-//------------------------------------------------------------------------
-sal_Bool SfxTopViewFrame::SetBorderPixelImpl( const SfxViewShell *pVSh, const SvBorder &rBorder )
-{
- if( SfxViewFrame::SetBorderPixelImpl( GetViewShell(), rBorder ) )
- {
- if ( IsResizeInToOut_Impl() && !GetFrame()->IsInPlace() )
- {
- Size aSize = pVSh->GetWindow()->GetOutputSizePixel();
- if ( aSize.Width() && aSize.Height() )
- {
- aSize.Width() += rBorder.Left() + rBorder.Right();
- aSize.Height() += rBorder.Top() + rBorder.Bottom();
-
- Size aOldSize = GetWindow().GetOutputSizePixel();
- GetWindow().SetOutputSizePixel( aSize );
- Window* pParent = &GetWindow();
- while ( pParent->GetParent() )
- pParent = pParent->GetParent();
- Size aOuterSize = pParent->GetOutputSizePixel();
- aOuterSize.Width() += ( aSize.Width() - aOldSize.Width() );
- aOuterSize.Height() += ( aSize.Height() - aOldSize.Height() );
- pParent->SetOutputSizePixel( aOuterSize );
- }
- }
- else
- {
- Point aPoint;
- Rectangle aEditArea( aPoint, GetWindow().GetOutputSizePixel() );
- aEditArea.Left() += rBorder.Left();
- aEditArea.Right() -= rBorder.Right();
- aEditArea.Top() += rBorder.Top();
- aEditArea.Bottom() -= rBorder.Bottom();
- pVSh->GetWindow()->SetPosSizePixel( aEditArea.TopLeft(), aEditArea.GetSize() );
- }
- return sal_True;
-
- }
- return sal_False;
-}
-
-void SfxTopViewFrame::Exec_Impl(SfxRequest &rReq )
+void SfxViewFrame::Exec_Impl(SfxRequest &rReq )
{
// Wenn gerade die Shells ausgetauscht werden...
if ( !GetObjectShell() || !GetViewShell() )
@@ -1304,10 +1119,9 @@ void SfxTopViewFrame::Exec_Impl(SfxRequest &rReq )
// weitere Views auf dasselbe Doc?
SfxObjectShell *pDocSh = GetObjectShell();
int bOther = sal_False;
- for ( const SfxTopViewFrame *pFrame =
- (SfxTopViewFrame *)SfxViewFrame::GetFirst( pDocSh, TYPE(SfxTopViewFrame) );
+ for ( const SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh );
!bOther && pFrame;
- pFrame = (SfxTopViewFrame *)SfxViewFrame::GetNext( *pFrame, pDocSh, TYPE(SfxTopViewFrame) ) )
+ pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) )
bOther = (pFrame != this);
// Doc braucht nur gefragt zu werden, wenn keine weitere View
@@ -1339,7 +1153,7 @@ void SfxTopViewFrame::Exec_Impl(SfxRequest &rReq )
rReq.Done();
}
-void SfxTopViewFrame::GetState_Impl( SfxItemSet &rSet )
+void SfxViewFrame::GetState_Impl( SfxItemSet &rSet )
{
SfxObjectShell *pDocSh = GetObjectShell();
@@ -1388,6 +1202,17 @@ void SfxTopViewFrame::GetState_Impl( SfxItemSet &rSet )
break;
}
+ case SID_OBJECT:
+ if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() )
+ {
+ uno::Any aAny;
+ aAny <<= GetViewShell()->GetVerbs();
+ rSet.Put( SfxUnoAnyItem( USHORT( SID_OBJECT ), aAny ) );
+ }
+ else
+ rSet.DisableItem( SID_OBJECT );
+ break;
+
default:
DBG_ERROR( "invalid message-id" );
}
@@ -1396,14 +1221,14 @@ void SfxTopViewFrame::GetState_Impl( SfxItemSet &rSet )
}
}
-void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest )
+void SfxViewFrame::INetExecute_Impl( SfxRequest &rRequest )
{
sal_uInt16 nSlotId = rRequest.GetSlot();
switch( nSlotId )
{
case SID_BROWSE_FORWARD:
case SID_BROWSE_BACKWARD:
- OSL_ENSURE( false, "SfxTopViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" );
+ OSL_ENSURE( false, "SfxViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" );
break;
case SID_CREATELINK:
{
@@ -1430,7 +1255,7 @@ void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest )
rRequest.Done();
}
-void SfxTopViewFrame::INetState_Impl( SfxItemSet &rItemSet )
+void SfxViewFrame::INetState_Impl( SfxItemSet &rItemSet )
{
rItemSet.DisableItem( SID_BROWSE_FORWARD );
rItemSet.DisableItem( SID_BROWSE_BACKWARD );
@@ -1443,12 +1268,12 @@ void SfxTopViewFrame::INetState_Impl( SfxItemSet &rItemSet )
rItemSet.DisableItem( SID_CREATELINK );
}
-void SfxTopViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY )
+void SfxViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY )
{
GetViewShell()->SetZoomFactor( rZoomX, rZoomY );
}
-void SfxTopViewFrame::Activate( sal_Bool bMDI )
+void SfxViewFrame::Activate( sal_Bool bMDI )
{
DBG_ASSERT(GetViewShell(), "Keine Shell");
if ( bMDI )
@@ -1456,7 +1281,7 @@ void SfxTopViewFrame::Activate( sal_Bool bMDI )
//(mba): hier evtl. wie in Beanframe NotifyEvent ?!
}
-void SfxTopViewFrame::Deactivate( sal_Bool bMDI )
+void SfxViewFrame::Deactivate( sal_Bool bMDI )
{
DBG_ASSERT(GetViewShell(), "Keine Shell");
if ( bMDI )
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 7c2cb939c375..fb657e8a0406 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -131,7 +131,7 @@ namespace css = ::com::sun::star;
#include <sfx2/docfile.hxx>
#include <sfx2/module.hxx>
#include <sfx2/msgpool.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "viewimp.hxx"
#include <sfx2/sfxbasecontroller.hxx>
#include <sfx2/sfx.hrc>
@@ -144,11 +144,14 @@ namespace css = ::com::sun::star;
#include "macro.hxx"
#include "minfitem.hxx"
#include "../appl/app.hrc"
+#include "impviewframe.hxx"
+
//-------------------------------------------------------------------------
DBG_NAME(SfxViewFrame)
#define SfxViewFrame
#include "sfxslots.hxx"
+#undef SfxViewFrame
//-------------------------------------------------------------------------
@@ -166,43 +169,6 @@ TYPEINIT1(SfxViewFrameItem, SfxPoolItem);
//=========================================================================
-struct SfxViewFrame_Impl
-{
- SvBorder aBorder;
- Size aMargin;
- Size aSize;
- String aFrameTitle;
- TypeId aLastType;
- String aActualURL;
- SfxFrame* pFrame;
- svtools::AsynchronLink* pReloader;
- //SfxInPlaceFrame* pIPFrame;
- Window* pWindow;
- SfxViewFrame* pActiveChild;
- Window* pFocusWin;
- sal_uInt16 nDocViewNo;
- sal_uInt16 nCurViewId;
- sal_Bool bResizeInToOut:1;
- sal_Bool bDontOverwriteResizeInToOut:1;
- sal_Bool bObjLocked:1;
- sal_Bool bReloading:1;
- sal_Bool bIsDowning:1;
- sal_Bool bInCtor:1;
- sal_Bool bModal:1;
- sal_Bool bEnabled:1;
- sal_Bool bWindowWasEnabled:1;
-
- SfxViewFrame_Impl()
- : pReloader(0 )
- , bWindowWasEnabled(sal_True)
- {}
-
- ~SfxViewFrame_Impl()
- {
- delete pReloader;
- }
-};
-
//-------------------------------------------------------------------------
void SfxViewFrame::SetDowning_Impl()
{
@@ -618,7 +584,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
OSL_ENSURE( xFrame.is(), "SfxViewFrame::ExecReload_Impl: no XFrame?!" );
aViewFrames.push_back( ViewDescriptor( xFrame, pView->GetCurViewId() ) );
- pView = (SfxTopViewFrame*)GetNext( *pView, xOldObj, TYPE( SfxTopViewFrame ) );
+ pView = GetNext( *pView, xOldObj );
}
DELETEZ( xOldObj->Get_Impl()->pReloadTimer );
@@ -1128,104 +1094,6 @@ void SfxViewFrame::ReleaseObjectShell_Impl()
GetDispatcher()->SetDisableFlags( 0 );
}
-//-------------------------------------------------------------------------
-
-String SfxViewFrame::UpdateTitle()
-
-/* [Beschreibung]
-
- Mit dieser Methode kann der SfxMDIFrame gezwungen werden, sich sofort
- den neuen Titel vom der <SfxObjectShell> zu besorgen.
-
- [Anmerkung]
-
- Dies ist z.B. dann notwendig, wenn man der SfxObjectShell als SfxListener
- zuh"ort und dort auf den <SfxSimpleHint> SFX_HINT_TITLECHANGED reagieren
- m"ochte, um dann die Titel seiner Views abzufragen. Diese Views (SfxMDIFrames)
- jedoch sind ebenfalls SfxListener und da die Reihenfolge der Benachrichtigung
- nicht feststeht, mu\s deren Titel-Update vorab erzwungen werden.
-
-
- [Beispiel]
-
- void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
- {
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
- {
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
- {
- case SFX_HINT_TITLECHANGED:
- for ( SfxMDIFrame *pMDI = (SfxMDIFrame*)
- SfxViewFrame::GetFirst(this, TYPE(SfxMDIFrame));
- pMDI;
- pMDI = (SfxMDIFrame*)
- SfxViewFrame::GetNext(this, TYPE(SfxMDIFrame));
- {
- pMDI->UpdateTitle();
- ... pMDI->GetName() ...
- }
- break;
- ...
- }
- }
- }
-*/
-
-{
- SfxObjectShell *pObjSh = GetObjectShell();
- if ( !pObjSh )
- return String();
-
-// if ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
-// // kein UpdateTitle mit Embedded-ObjectShell
-// return String();
-
- const SfxMedium *pMedium = pObjSh->GetMedium();
- String aURL;
- GetFrame(); // -Wall required??
- if ( pObjSh->HasName() )
- {
- INetURLObject aTmp( pMedium->GetName() );
- aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
- }
-
- if ( aURL != pImp->aActualURL )
- // URL hat sich ge"andert
- pImp->aActualURL = aURL;
-
- // gibt es noch eine weitere View?
- sal_uInt16 nViews=0;
- for ( SfxViewFrame *pView= GetFirst(pObjSh);
- pView && nViews<2;
- pView = GetNext(*pView,pObjSh) )
- if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) &&
- !IsDowning_Impl())
- nViews++;
-
- // Titel des Fensters
- String aTitle;
- if ( nViews == 2 || pImp->nDocViewNo > 1 )
- // dann die Nummer dranh"angen
- aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo );
- else
- aTitle = pObjSh->UpdateTitle();
-
- // Name des SbxObjects
- String aSbxName = pObjSh->SfxShell::GetName();
- if ( IsVisible_Impl() )
- {
- aSbxName += ':';
- aSbxName += String::CreateFromInt32(pImp->nDocViewNo);
- }
-
- SetName( aSbxName );
- pImp->aFrameTitle = aTitle;
- GetBindings().Invalidate( SID_FRAMETITLE );
- GetBindings().Invalidate( SID_CURRENT_URL );
- return aTitle;
-}
-
-
//--------------------------------------------------------------------
sal_Bool SfxViewFrame::Close()
{
@@ -1237,7 +1105,15 @@ sal_Bool SfxViewFrame::Close()
// auch nicht mehr automatisch gespeichert werden!
if ( GetViewShell() )
GetViewShell()->DiscardClients_Impl();
- Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
+ Broadcast( SfxSimpleHint( SFX_HINT_DYING ) );
+
+ if (SfxViewFrame::Current() == this)
+ SfxViewFrame::SetViewFrame( NULL );
+
+ // Da der Dispatcher leer ger"aumt wird, kann man ihn auch nicht mehr
+ // vern"unftig verwenden - also besser still legen
+ GetDispatcher()->Lock(sal_True);
+ delete this;
return sal_True;
}
@@ -1366,12 +1242,43 @@ void SfxViewFrame::InvalidateBorderImpl( const SfxViewShell* pSh )
//------------------------------------------------------------------------
sal_Bool SfxViewFrame::SetBorderPixelImpl
(
- const SfxViewShell* /*pSh*/,
+ const SfxViewShell* pVSh,
const SvBorder& rBorder
)
{
pImp->aBorder = rBorder;
+
+ if ( IsResizeInToOut_Impl() && !GetFrame()->IsInPlace() )
+ {
+ Size aSize = pVSh->GetWindow()->GetOutputSizePixel();
+ if ( aSize.Width() && aSize.Height() )
+ {
+ aSize.Width() += rBorder.Left() + rBorder.Right();
+ aSize.Height() += rBorder.Top() + rBorder.Bottom();
+
+ Size aOldSize = GetWindow().GetOutputSizePixel();
+ GetWindow().SetOutputSizePixel( aSize );
+ Window* pParent = &GetWindow();
+ while ( pParent->GetParent() )
+ pParent = pParent->GetParent();
+ Size aOuterSize = pParent->GetOutputSizePixel();
+ aOuterSize.Width() += ( aSize.Width() - aOldSize.Width() );
+ aOuterSize.Height() += ( aSize.Height() - aOldSize.Height() );
+ pParent->SetOutputSizePixel( aOuterSize );
+ }
+ }
+ else
+ {
+ Point aPoint;
+ Rectangle aEditArea( aPoint, GetWindow().GetOutputSizePixel() );
+ aEditArea.Left() += rBorder.Left();
+ aEditArea.Right() -= rBorder.Right();
+ aEditArea.Top() += rBorder.Top();
+ aEditArea.Bottom() -= rBorder.Bottom();
+ pVSh->GetWindow()->SetPosSizePixel( aEditArea.TopLeft(), aEditArea.GetSize() );
+ }
+
return sal_True;
}
@@ -1389,15 +1296,22 @@ const SvBorder& SfxViewFrame::GetBorderPixelImpl
void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
{DBG_CHKTHIS(SfxViewFrame, 0);}
- if ( !xObjSh.Is() )
+
+ if( IsDowning_Impl())
return;
+ // we know only SimpleHints
if ( rHint.IsA(TYPE(SfxSimpleHint)) )
{
switch( ( (SfxSimpleHint&) rHint ).GetId() )
{
case SFX_HINT_MODECHANGED:
{
+ UpdateTitle();
+
+ if ( !xObjSh.Is() )
+ break;
+
// r/o Umschaltung?
SfxBindings& rBind = GetBindings();
rBind.Invalidate( SID_RELOAD );
@@ -1442,10 +1356,9 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case SFX_HINT_DYING:
case SFX_HINT_DEINITIALIZING:
// when the Object is being deleted, destroy the view too
+ GetFrame()->DoClose();
if ( xObjSh.Is() )
ReleaseObjectShell_Impl();
- else
- GetFrame()->DoClose();
break;
}
@@ -1470,6 +1383,9 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case SFX_EVENT_OPENDOC:
case SFX_EVENT_CREATEDOC:
{
+ if ( !xObjSh.Is() )
+ break;
+
SfxBindings& rBind = GetBindings();
rBind.Invalidate( SID_RELOAD );
rBind.Invalidate( SID_EDITDOC );
@@ -1556,53 +1472,84 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
pImp->bInCtor = sal_False;
}
-//------------------------------------------------------------------------
-SfxViewFrame::SfxViewFrame( SfxObjectShell &rObjShell, SfxBindings &rBindings,
- SfxFrame* pParent, sal_uInt32 nType )
-:
- pImp( new SfxViewFrame_Impl ),
- pDispatcher(0),
- pBindings(&rBindings),
- nAdjustPosPixelLock( 0 )
-{
- DBG_CTOR(SfxViewFrame, 0);
-
- SetFrame_Impl( pParent );
- pImp->pFrame->SetCurrentViewFrame_Impl( this );
- GetFrame()->SetFrameType_Impl( GetFrameType() | nType );
- Construct_Impl( &rObjShell );
-}
+SfxViewFrame::SfxViewFrame
+(
+ SfxFrame* pFrame,
+ SfxObjectShell* pObjShell,
+ sal_uInt16 nViewId
+)
-//------------------------------------------------------------------------
-SfxViewFrame::SfxViewFrame(const SfxViewFrame &rCopy, SfxBindings &rBindings,
- SfxFrame *pFrame )
-:
- pImp( new SfxViewFrame_Impl ),
- pDispatcher(0),
- pBindings(&rBindings),
- nAdjustPosPixelLock( 0 )
-{
- DBG_CTOR(SfxViewFrame, 0);
+/* [Beschreibung]
- SetFrame_Impl( pFrame );
- pImp->pFrame->SetCurrentViewFrame_Impl( this );
- GetFrame()->SetFrameType_Impl( rCopy.GetFrameType() );
- Construct_Impl( rCopy.GetObjectShell() );
-}
+ Ctor des SfxViewFrame f"ur eine <SfxObjectShell> aus der Ressource.
+ Die 'nViewId' der zu erzeugenden <SfxViewShell> kann angegeben werden
+ (default ist die zuerst registrierte SfxViewShell-Subklasse).
+*/
-SfxViewFrame::SfxViewFrame( SfxBindings& rBindings, SfxFrame *pFrame,
- SfxObjectShell *pDoc, sal_uInt32 nType )
: pImp( new SfxViewFrame_Impl )
, pDispatcher(0)
- , pBindings(&rBindings)
+ , pBindings( new SfxBindings )
, nAdjustPosPixelLock( 0 )
{
- DBG_CTOR(SfxViewFrame, 0);
+ DBG_CTOR( SfxViewFrame, NULL );
SetFrame_Impl( pFrame );
pImp->pFrame->SetCurrentViewFrame_Impl( this );
- GetFrame()->SetFrameType_Impl( GetFrameType() | nType );
- Construct_Impl( pDoc);
+ GetFrame()->SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE );
+ Construct_Impl( pObjShell );
+
+//(mba)/task if ( !pFrame->GetTask() )
+ {
+ pImp->pWindow = new SfxTopViewWin_Impl( this, pFrame->GetWindow() );
+ pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() );
+ pFrame->SetOwnsBindings_Impl( sal_True );
+ pFrame->CreateWorkWindow_Impl();
+ }
+
+ sal_uInt32 nType = SFXFRAME_OWNSDOCUMENT | SFXFRAME_HASTITLE;
+ if ( pObjShell && pObjShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+ nType |= SFXFRAME_EXTERNAL;
+ GetFrame()->SetFrameType_Impl( GetFrame()->GetFrameType() | nType );
+
+ if ( GetFrame()->IsInPlace() )
+ {
+ LockAdjustPosSizePixel();
+ }
+
+ if ( pObjShell && !SwitchToViewShell_Impl( nViewId ) )
+ {
+ // TODO: better error handling? Under which conditions can this fail?
+ return;
+ }
+
+ if ( GetFrame()->IsInPlace() )
+ {
+ UnlockAdjustPosSizePixel();
+ }
+ else if ( GetViewShell() && GetViewShell()->UseObjectSize() )
+ {
+ // initiale Gr"o\se festlegen
+ // Zuerst die logischen Koordinaten von IP-Objekt und EditWindow
+ // ber"ucksichtigen
+ LockAdjustPosSizePixel();
+ ForceInnerResize_Impl( TRUE );
+
+ Window *pWindow = GetViewShell()->GetWindow();
+
+ // Da in den Applikationen bei der R"ucktransformation immer die
+ // Eckpunkte tranformiert werden und nicht die Size (um die Ecken
+ // alignen zu k"onnen), transformieren wir hier auch die Punkte, um
+ // m"oglichst wenig Rundungsfehler zu erhalten.
+/*
+ Rectangle aRect = pWindow->LogicToLogic( GetObjectShell()->GetVisArea(),
+ GetObjectShell()->GetMapUnit(),
+ pWindow->GetMapMode() );
+*/
+ Rectangle aRect = pWindow->LogicToPixel( GetObjectShell()->GetVisArea() );
+ Size aSize = aRect.GetSize();
+ GetViewShell()->GetWindow()->SetSizePixel( aSize );
+ DoAdjustPosSizePixel(GetViewShell(), Point(), aSize );
+ }
}
//------------------------------------------------------------------------
@@ -1610,6 +1557,19 @@ SfxViewFrame::~SfxViewFrame()
{
DBG_DTOR(SfxViewFrame, 0);
+ SetDowning_Impl();
+
+ if ( SfxViewFrame::Current() == this )
+ SfxViewFrame::SetViewFrame( NULL );
+
+ ReleaseObjectShell_Impl();
+
+ if ( GetFrame()->OwnsBindings_Impl() )
+ // Die Bindings l"oscht der Frame!
+ KillDispatcher_Impl();
+
+ delete pImp->pWindow;
+
if ( GetFrame() && GetFrame()->GetCurrentViewFrame() == this )
GetFrame()->SetCurrentViewFrame_Impl( NULL );
@@ -1653,12 +1613,11 @@ SfxViewFrame* SfxViewFrame::Current()
}
//--------------------------------------------------------------------
-sal_uInt16 SfxViewFrame::Count(TypeId aType)
+sal_uInt16 SfxViewFrame::Count()
/* [Beschreibung]
- Liefert die Anzahl der sichtbaren <SfxViewFrame>-Instanzen vom Typ
- 'aType' bzw. aller sichtbaren, falls 'aType==0' (default).
+ Liefert die Anzahl der sichtbaren <SfxViewFrame>-Instanzen.
*/
{
@@ -1669,8 +1628,7 @@ sal_uInt16 SfxViewFrame::Count(TypeId aType)
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
SfxViewFrame *pFrame = rFrames[i];
- if ( ( !aType || pFrame->IsA(aType) ) &&
- pFrame->IsVisible_Impl() )
+ if ( pFrame->IsVisible_Impl() )
++nFound;
}
return nFound;
@@ -1681,7 +1639,6 @@ sal_uInt16 SfxViewFrame::Count(TypeId aType)
SfxViewFrame* SfxViewFrame::GetFirst
(
const SfxObjectShell* pDoc,
- TypeId aType,
sal_Bool bOnlyIfVisible
)
{
@@ -1692,9 +1649,9 @@ SfxViewFrame* SfxViewFrame::GetFirst
for ( sal_uInt16 nPos = 0; nPos < rFrames.Count(); ++nPos )
{
SfxViewFrame *pFrame = rFrames.GetObject(nPos);
- if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) &&
- ( !aType || pFrame->IsA(aType) ) &&
- ( !bOnlyIfVisible || pFrame->IsVisible_Impl()) )
+ if ( ( !pDoc || pDoc == pFrame->GetObjectShell() )
+ && ( !bOnlyIfVisible || pFrame->IsVisible_Impl() )
+ )
return pFrame;
}
@@ -1707,7 +1664,6 @@ SfxViewFrame* SfxViewFrame::GetNext
(
const SfxViewFrame& rPrev,
const SfxObjectShell* pDoc,
- TypeId aType,
sal_Bool bOnlyIfVisible
)
{
@@ -1724,9 +1680,9 @@ SfxViewFrame* SfxViewFrame::GetNext
for ( ++nPos; nPos < rFrames.Count(); ++nPos )
{
SfxViewFrame *pFrame = rFrames.GetObject(nPos);
- if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) &&
- ( !aType || pFrame->IsA(aType) ) &&
- ( !bOnlyIfVisible || pFrame->IsVisible_Impl()) )
+ if ( ( !pDoc || pDoc == pFrame->GetObjectShell() )
+ && ( !bOnlyIfVisible || pFrame->IsVisible_Impl() )
+ )
return pFrame;
}
return 0;
@@ -2625,19 +2581,6 @@ void SfxViewFrame::StateView_Impl
}
//-------------------------------------------------------------------------
-void SfxViewFrame::GetState_Impl( SfxItemSet &rSet )
-{
- if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() )
- {
- uno::Any aAny;
- aAny <<= GetViewShell()->GetVerbs();
- rSet.Put( SfxUnoAnyItem( USHORT( SID_OBJECT ), aAny ) );
- }
- else
- rSet.DisableItem( SID_OBJECT );
-}
-
-//-------------------------------------------------------------------------
void SfxViewFrame::ToTop()
{
GetFrame()->Appear();
@@ -2676,13 +2619,6 @@ SfxViewFrame* SfxViewFrame::GetTopViewFrame() const
return GetFrame()->GetTopFrame()->GetCurrentViewFrame();
}
-//-------------------------------------------------------------------------
-
-void SfxViewFrame::SetWindow_Impl( Window *pWin )
-{
- pImp->pWindow = pWin;
-}
-
Window& SfxViewFrame::GetWindow() const
{
return pImp->pWindow ? *pImp->pWindow : GetFrame()->GetWindow();
@@ -3122,7 +3058,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
case SID_WIN_FULLSCREEN:
{
SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot(), FALSE);
- SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, GetTopViewFrame() );
+ SfxViewFrame *pTop = GetTopViewFrame();
if ( pTop )
{
WorkWindow* pWork = (WorkWindow*) pTop->GetFrame()->GetTopWindow_Impl();
@@ -3273,7 +3209,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
case SID_WIN_FULLSCREEN:
{
- SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, GetTopViewFrame() );
+ SfxViewFrame* pTop = GetTopViewFrame();
if ( pTop )
{
WorkWindow* pWork = (WorkWindow*) pTop->GetFrame()->GetTopWindow_Impl();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 755859dcdcd7..50e71c3e3ce2 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -84,7 +84,7 @@
#include "view.hrc"
#include "sfxlocal.hrc"
#include <sfx2/sfxbasecontroller.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "mailmodelapi.hxx"
#include <sfx2/event.hxx>
#include <sfx2/fcontnr.hxx>