summaryrefslogtreecommitdiff
path: root/sw/source/core/view/viewimp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/view/viewimp.cxx')
-rw-r--r--sw/source/core/view/viewimp.cxx192
1 files changed, 24 insertions, 168 deletions
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 200691a81546..c3ca3f655ae1 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,6 @@
#include "rootfrm.hxx"
#include "pagefrm.hxx"
#include "viewimp.hxx"
-#include "errhdl.hxx"
#include "viewopt.hxx"
#include "flyfrm.hxx"
#include "frmfmt.hxx"
@@ -46,7 +46,6 @@
#include <svx/svdpage.hxx>
#include <accmap.hxx>
-// OD 12.12.2002 #103492#
#include <pagepreviewlayout.hxx>
#include <comcore.hrc>
@@ -56,19 +55,10 @@
#include <IDocumentDeviceAccess.hxx>
#include <IDocumentSettingAccess.hxx>
-/*************************************************************************
-|*
-|* SwViewImp::Init()
-|*
-|* Ersterstellung MA 25. Jul. 94
-|* Letzte Aenderung MA 03. Nov. 95
-|*
-|*************************************************************************/
-
void SwViewImp::Init( const SwViewOption *pNewOpt )
{
- ASSERT( pDrawView, "SwViewImp::Init without DrawView" );
- //Jetzt die PageView erzeugen wenn sie noch nicht existiert.
+ OSL_ENSURE( pDrawView, "SwViewImp::Init without DrawView" );
+ //Now create the page view if it does not exist.
SwRootFrm *pRoot = pSh->GetLayout(); //swmod 071108//swmod 071225
if ( !pSdrPageView )
{
@@ -80,8 +70,7 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
pRoot->GetDrawPage()->SetSize( pRoot->Frm().SSize() );
pSdrPageView = pDrawView->ShowSdrPage( pRoot->GetDrawPage());
- // OD 26.06.2003 #108784# - notify drawing page view about invisible
- // layers.
+ // notify drawing page view about invisible layers.
pIDDMA->NotifyInvisibleLayers( *pSdrPageView );
}
pDrawView->SetDragStripes( pNewOpt->IsCrossHair() );
@@ -110,15 +99,6 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
pDrawView->SetMarkHdlSizePixel(pNewOpt->IsBigMarkHdl() ? 9 : 7);
}
-/*************************************************************************
-|*
-|* SwViewImp::SwViewImp() CTor fuer die Core-Internas
-|*
-|* Ersterstellung MA 25. Jul. 94
-|* Letzte Aenderung MA 06. Sep. 96
-|*
-|*************************************************************************/
-
SwViewImp::SwViewImp( ViewShell *pParent ) :
pSh( pParent ),
pDrawView( 0 ),
@@ -130,33 +110,19 @@ SwViewImp::SwViewImp( ViewShell *pParent ) :
pAccMap( 0 ),
pSdrObjCached(NULL),
nRestoreActions( 0 ),
- // OD 12.12.2002 #103492#
mpPgPrevwLayout( 0 )
{
- //bResetXorVisibility =
- //HMHbShowHdlPaint =
bResetHdlHiddenPaint =
bSmoothUpdate = bStopSmooth = bStopPrt = sal_False;
bFirstPageInvalid = sal_True;
}
-/******************************************************************************
-|*
-|* SwViewImp::~SwViewImp()
-|*
-|* Ersterstellung MA 25. Jul. 94
-|* Letzte Aenderung MA 16. Dec. 94
-|*
-******************************************************************************/
-
SwViewImp::~SwViewImp()
{
delete pAccMap;
- // OD 12.12.2002 #103492#
delete mpPgPrevwLayout;
- //JP 29.03.96: nach ShowSdrPage muss auch HideSdrPage gemacht werden!!!
if( pDrawView )
pDrawView->HideSdrPage();
@@ -164,33 +130,15 @@ SwViewImp::~SwViewImp()
DelRegion();
- ASSERT( !pLayAct, "Have action for the rest of your life." );
- ASSERT( !pIdleAct,"Be idle for the rest of your life." );
+ OSL_ENSURE( !pLayAct, "Have action for the rest of your life." );
+ OSL_ENSURE( !pIdleAct,"Be idle for the rest of your life." );
}
-/******************************************************************************
-|*
-|* SwViewImp::DelRegions()
-|*
-|* Ersterstellung MA 14. Apr. 94
-|* Letzte Aenderung MA 14. Apr. 94
-|*
-******************************************************************************/
-
void SwViewImp::DelRegion()
{
DELETEZ(pRegion);
}
-/******************************************************************************
-|*
-|* SwViewImp::AddPaintRect()
-|*
-|* Ersterstellung MA ??
-|* Letzte Aenderung MA 27. Jul. 94
-|*
-******************************************************************************/
-
sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
{
if ( rRect.IsOver( pSh->VisArea() ) )
@@ -203,31 +151,12 @@ sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
return sal_False;
}
-
-/******************************************************************************
-|*
-|* ViewImp::CheckWaitCrsr()
-|*
-|* Ersterstellung MA 10. Aug. 94
-|* Letzte Aenderung MA 10. Aug. 94
-|*
-******************************************************************************/
-
void SwViewImp::CheckWaitCrsr()
{
if ( pLayAct )
pLayAct->CheckWaitCrsr();
}
-/******************************************************************************
-|*
-|* ViewImp::IsCalcLayoutProgress()
-|*
-|* Ersterstellung MA 12. Aug. 94
-|* Letzte Aenderung MA 12. Aug. 94
-|*
-******************************************************************************/
-
sal_Bool SwViewImp::IsCalcLayoutProgress() const
{
if ( pLayAct )
@@ -235,15 +164,6 @@ sal_Bool SwViewImp::IsCalcLayoutProgress() const
return sal_False;
}
-/******************************************************************************
-|*
-|* ViewImp::IsUpdateExpFlds()
-|*
-|* Ersterstellung MA 28. Mar. 96
-|* Letzte Aenderung MA 28. Mar. 96
-|*
-******************************************************************************/
-
sal_Bool SwViewImp::IsUpdateExpFlds()
{
if ( pLayAct && pLayAct->IsCalcLayout() )
@@ -254,24 +174,12 @@ sal_Bool SwViewImp::IsUpdateExpFlds()
return sal_False;
}
-
-/******************************************************************************
-|*
-|* SwViewImp::SetFirstVisPage(), ImplGetFirstVisPage();
-|*
-|* Ersterstellung MA 21. Sep. 93
-|* Letzte Aenderung MA 08. Mar. 94
-|*
-******************************************************************************/
-
void SwViewImp::SetFirstVisPage()
{
if ( pSh->bDocSizeChgd && pSh->VisArea().Top() > pSh->GetLayout()->Frm().Height() )
{
- //Wir stecken in einer Action und die VisArea sitzt wegen
- //Loeschoperationen hinter der erste sichtbaren Seite.
- //Damit nicht zu heftig Formatiert wird, liefern wir die letzte Seite
- //zurueck.
+ //We are in an "Action", and the VisArea is behind the first visible page due
+ //to delete operations. To prevent expensive formatting, return the last page
pFirstVisPage = (SwPageFrm*)pSh->GetLayout()->Lower();
while ( pFirstVisPage && pFirstVisPage->GetNext() )
pFirstVisPage = (SwPageFrm*)pFirstVisPage->GetNext();
@@ -282,17 +190,17 @@ void SwViewImp::SetFirstVisPage()
const bool bBookMode = pSwViewOption->IsViewLayoutBookMode();
SwPageFrm *pPage = (SwPageFrm*)pSh->GetLayout()->Lower();
- SwRect aPageRect = pPage->Frm();
+ SwRect aPageRect = pPage->GetBoundRect();
while ( pPage && !aPageRect.IsOver( pSh->VisArea() ) )
{
pPage = (SwPageFrm*)pPage->GetNext();
if ( pPage )
{
- aPageRect = pPage->Frm();
+ aPageRect = pPage->GetBoundRect();
if ( bBookMode && pPage->IsEmptyPage() )
{
const SwPageFrm& rFormatPage = pPage->GetFormatPage();
- aPageRect.SSize() = rFormatPage.Frm().SSize();
+ aPageRect.SSize() = rFormatPage.GetBoundRect().SSize();
}
}
}
@@ -301,15 +209,6 @@ void SwViewImp::SetFirstVisPage()
bFirstPageInvalid = sal_False;
}
-/******************************************************************************
-|*
-|* SwViewImp::MakeDrawView();
-|*
-|* Ersterstellung AMA 01. Nov. 95
-|* Letzte Aenderung AMA 01. Nov. 95
-|*
-******************************************************************************/
-
void SwViewImp::MakeDrawView()
{
IDocumentDrawModelAccess* pIDDMA = GetShell()->getIDocumentDrawModelAccess();
@@ -334,7 +233,6 @@ void SwViewImp::MakeDrawView()
if(!pOutDevForDrawView)
{
- // pOutDevForDrawView = (OutputDevice*)GetShell()->getIDocumentDeviceAccess()->getPrinter( false );
pOutDevForDrawView = GetShell()->GetOut();
}
@@ -345,22 +243,10 @@ void SwViewImp::MakeDrawView()
const SwViewOption* pSwViewOption = GetShell()->GetViewOptions();
Init(pSwViewOption);
- // #i68597# If document is read-only, we will not profit from overlay,
- // so switch it off.
+ // #i68597# If document is read-only, we will not profit from overlay, so switch it off.
if(pDrawView && pDrawView->IsBufferedOverlayAllowed())
{
- bool bIsReadOnly(pSwViewOption->IsReadonly());
-
-#ifdef DBG_UTIL
- // add test possibilities
- static bool bAlwaysActivateForTest(false);
- if(bAlwaysActivateForTest && bIsReadOnly)
- {
- bIsReadOnly = false;
- }
-#endif
-
- if(bIsReadOnly)
+ if(pSwViewOption->IsReadonly())
{
pDrawView->SetBufferedOverlayAllowed(false);
}
@@ -368,15 +254,6 @@ void SwViewImp::MakeDrawView()
}
}
-/******************************************************************************
-|*
-|* SwViewImp::GetRetoucheColor()
-|*
-|* Ersterstellung MA 24. Jun. 98
-|* Letzte Aenderung MA 24. Jun. 98
-|*
-******************************************************************************/
-
Color SwViewImp::GetRetoucheColor() const
{
Color aRet( COL_TRANSPARENT );
@@ -395,15 +272,9 @@ Color SwViewImp::GetRetoucheColor() const
return aRet;
}
-/** create page preview layout
-
- OD 12.12.2002 #103492#
-
- @author OD
-*/
void SwViewImp::InitPagePreviewLayout()
{
- ASSERT( pSh->GetLayout(), "no layout - page preview layout can not be created.");
+ OSL_ENSURE( pSh->GetLayout(), "no layout - page preview layout can not be created.");
if ( pSh->GetLayout() )
mpPgPrevwLayout = new SwPagePreviewLayout( *pSh, *(pSh->GetLayout()) );
}
@@ -413,8 +284,8 @@ void SwViewImp::UpdateAccessible()
// We require a layout and an XModel to be accessible.
IDocumentLayoutAccess* pIDLA = GetShell()->getIDocumentLayoutAccess();
Window *pWin = GetShell()->GetWin();
- ASSERT( GetShell()->GetLayout(), "no layout, no access" ); //swmod 071108//swmod 071225
- ASSERT( pWin, "no window, no access" );
+ OSL_ENSURE( GetShell()->GetLayout(), "no layout, no access" ); //swmod 071108//swmod 071225
+ OSL_ENSURE( pWin, "no window, no access" );
if( IsAccessible() && pIDLA->GetCurrentViewShell() && pWin ) //swmod 071108//swmod 071225
GetAccessibleMap().GetDocumentView();
@@ -424,7 +295,7 @@ void SwViewImp::DisposeAccessible( const SwFrm *pFrm,
const SdrObject *pObj,
sal_Bool bRecursive )
{
- ASSERT( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
+ OSL_ENSURE( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
ViewShell *pVSh = GetShell();
ViewShell *pTmp = pVSh;
do
@@ -438,7 +309,7 @@ void SwViewImp::DisposeAccessible( const SwFrm *pFrm,
void SwViewImp::MoveAccessible( const SwFrm *pFrm, const SdrObject *pObj,
const SwRect& rOldFrm )
{
- ASSERT( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
+ OSL_ENSURE( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
ViewShell *pVSh = GetShell();
ViewShell *pTmp = pVSh;
do
@@ -452,7 +323,7 @@ void SwViewImp::MoveAccessible( const SwFrm *pFrm, const SdrObject *pObj,
void SwViewImp::InvalidateAccessibleFrmContent( const SwFrm *pFrm )
{
- ASSERT( pFrm->IsAccessibleFrm(), "frame is not accessible" );
+ OSL_ENSURE( pFrm->IsAccessibleFrm(), "frame is not accessible" );
ViewShell *pVSh = GetShell();
ViewShell *pTmp = pVSh;
do
@@ -503,12 +374,7 @@ void SwViewImp::InvalidateAccessibleRelationSet( const SwFlyFrm *pMaster,
} while ( pTmp != pVSh );
}
- /** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
-
- OD 2005-12-01 #i27138#
-
- @author OD
-*/
+// #i27138# invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
void SwViewImp::_InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtFrm,
const SwTxtFrm* _pToTxtFrm )
{
@@ -539,12 +405,7 @@ void SwViewImp::_InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxt
} while ( pTmp != pVSh );
}
-/** invalidate text selection for paragraphs
-
- OD 2005-12-12 #i27301#
-
- @author OD
-*/
+//#i27301# invalidate text selection for paragraphs
void SwViewImp::_InvalidateAccessibleParaTextSelection()
{
ViewShell* pVSh = GetShell();
@@ -560,12 +421,7 @@ void SwViewImp::_InvalidateAccessibleParaTextSelection()
} while ( pTmp != pVSh );
}
-/** invalidate attributes for paragraphs
-
- OD 2009-01-06 #i88069#
-
- @author OD
-*/
+//#i88069# invalidate attributes for paragraphs
void SwViewImp::_InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
{
ViewShell* pVSh = GetShell();
@@ -581,7 +437,6 @@ void SwViewImp::_InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm )
} while ( pTmp != pVSh );
}
-// OD 15.01.2003 #103492# - method signature change due to new page preview functionality
void SwViewImp::UpdateAccessiblePreview( const std::vector<PrevwPage*>& _rPrevwPages,
const Fraction& _rScale,
const SwPageFrm* _pSelectedPageFrm,
@@ -600,7 +455,7 @@ void SwViewImp::InvalidateAccessiblePreViewSelection( sal_uInt16 nSelPage )
SwAccessibleMap *SwViewImp::CreateAccessibleMap()
{
- ASSERT( !pAccMap, "accessible map exists" )
+ OSL_ENSURE( !pAccMap, "accessible map exists" );
pAccMap = new SwAccessibleMap( GetShell() );
return pAccMap;
}
@@ -618,3 +473,4 @@ IMPL_LINK(SwViewImp, SetStopPrt, void *, EMPTYARG)
return 0;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */