summaryrefslogtreecommitdiff
path: root/sw/source/core/view/vnew.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/view/vnew.cxx')
-rw-r--r--sw/source/core/view/vnew.cxx66
1 files changed, 36 insertions, 30 deletions
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index bc454c4b0e7b..1a1facac0817 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -47,14 +47,11 @@
#include <ndgrf.hxx>
#include <ndindex.hxx>
#include <accessibilityoptions.hxx>
-
+#include <switerator.hxx>
/*************************************************************************
|*
|* ViewShell::Init()
-|*
-|* Letzte Aenderung MA 14. Jun. 96
-|*
|*************************************************************************/
void ViewShell::Init( const SwViewOption *pNewOpt )
@@ -110,8 +107,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
// --> FME 2005-01-21 #i41075#
// Only setup the printer if we need one:
- const IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
- const bool bBrowseMode = pIDSA->get(IDocumentSettingAccess::BROWSE_MODE);
+ const bool bBrowseMode = pOpt->getBrowseMode();
if( pPDFOut )
InitPrt( pPDFOut );
// <--
@@ -134,12 +130,24 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
GetWin()->SetLineColor();
}
- //Layout erzeugen wenn es noch nicht vorhanden ist.
- SwRootFrm* pRoot = GetDoc()->GetRootFrm();
- if( !pRoot )
- GetDoc()->SetRootFrm( pRoot = new SwRootFrm( pDoc->GetDfltFrmFmt(), this ) );
-
- SizeChgNotify();
+ // Create a new layout, if there is no one available
+ if( !pLayout )
+ {
+ // Here's the code which disables the usage of "multiple" layouts at the moment
+ // If the problems with controls and groups objects are solved,
+ // this code can be removed...
+ ViewShell *pCurrShell = GetDoc()->GetCurrentViewShell();
+ if( pCurrShell )
+ pLayout = pCurrShell->pLayout;
+ // end of "disable multiple layouts"
+ if( !pLayout )
+ {
+ // switched to two step construction because creating the layout in SwRootFrm needs a valid pLayout set
+ pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016
+ pLayout->Init( pDoc->GetDfltFrmFmt() );
+ }
+ }
+ SizeChgNotify(); //swmod 071108
// --> #i31958#
// XForms mode: initialize XForms mode, based on design mode (draw view)
@@ -156,9 +164,6 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
/*************************************************************************
|*
|* ViewShell::ViewShell() CTor fuer die erste Shell.
-|*
-|* Letzte Aenderung MA 29. Aug. 95
-|*
|*************************************************************************/
ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
@@ -239,9 +244,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
/*************************************************************************
|*
|* ViewShell::ViewShell() CTor fuer weitere Shells auf ein Dokument.
-|*
-|* Letzte Aenderung MA 29. Aug. 95
-|*
|*************************************************************************/
ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
@@ -276,9 +278,8 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
bEndActionByVirDev = sal_False;
bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
- // OD 12.12.2002 #103492#
- if ( bPreView )
- pImp->InitPagePreviewLayout();
+ if( nFlags & VSHELLFLAG_SHARELAYOUT ) //swmod 080125
+ pLayout = rShell.pLayout;//swmod 080125
SET_CURR_SHELL( this );
@@ -289,6 +290,10 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
Init( rShell.GetViewOptions() ); //verstellt ggf. das Outdev (InitPrt())
pOut = pOutput;
+ // OD 12.12.2002 #103492#
+ if ( bPreView )
+ pImp->InitPagePreviewLayout();
+
((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))->
SetHiddenFlag( !pOpt->IsShowHiddenField() );
@@ -313,9 +318,6 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
|*
|* ViewShell::~ViewShell()
|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 10. May. 95
-|*
******************************************************************************/
ViewShell::~ViewShell()
@@ -341,9 +343,8 @@ ViewShell::~ViewShell()
{
if( pGNd->IsAnimated() )
{
- SwClientIter aIter( *pGNd );
- for( SwFrm* pFrm = (SwFrm*)aIter.First( TYPE(SwFrm) );
- pFrm; pFrm = (SwFrm*)aIter.Next() )
+ SwIterator<SwFrm,SwGrfNode> aIter( *pGNd );
+ for( SwFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
ASSERT( pFrm->IsNoTxtFrm(), "GraphicNode with Text?" );
((SwNoTxtFrm*)pFrm)->StopAnimation( pOut );
@@ -364,8 +365,8 @@ ViewShell::~ViewShell()
if( !pDoc->release() )
delete pDoc, pDoc = 0;
else
- pDoc->GetRootFrm()->ResetNewLayout();
- }
+ GetLayout()->ResetNewLayout();
+ }//swmod 080317
delete pOpt;
@@ -380,7 +381,12 @@ ViewShell::~ViewShell()
}
if ( pDoc )
+ {
GetLayout()->DeRegisterShell( this );
+ if(pDoc->GetCurrentViewShell()==this)
+ pDoc->SetCurrentViewShell( this->GetNext()!=this ?
+ (ViewShell*)this->GetNext() : NULL );
+ }
delete mpTmpRef;
delete pAccOptions;
@@ -388,7 +394,7 @@ ViewShell::~ViewShell()
sal_Bool ViewShell::HasDrawView() const
{
- return Imp()->HasDrawView();
+ return Imp() ? Imp()->HasDrawView() : 0;
}
void ViewShell::MakeDrawView()