summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/viewsh.hxx7
-rw-r--r--sw/source/core/crsr/crsrsh.cxx9
-rw-r--r--sw/source/core/doc/notxtfrm.cxx69
-rw-r--r--sw/source/core/inc/layact.hxx6
-rw-r--r--sw/source/core/inc/scrrect.hxx128
-rw-r--r--sw/source/core/inc/txtfrm.hxx3
-rw-r--r--sw/source/core/inc/viewimp.hxx63
-rw-r--r--sw/source/core/layout/layact.cxx485
-rw-r--r--sw/source/core/layout/paintfrm.cxx2
-rw-r--r--sw/source/core/layout/tabfrm.cxx3
-rw-r--r--sw/source/core/text/frmpaint.cxx68
-rw-r--r--sw/source/core/view/makefile.mk7
-rw-r--r--sw/source/core/view/scrrect.cxx1195
-rw-r--r--sw/source/core/view/viewimp.cxx19
-rw-r--r--sw/source/core/view/viewsh.cxx58
15 files changed, 66 insertions, 2056 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index afff32a04d..103482b9c5 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -183,9 +183,6 @@ class SW_DLLPUBLIC ViewShell : public Ring
SW_DLLPRIVATE sal_Bool CheckInvalidForPaint( const SwRect & );//Direkt Paint oder lieber
//eine Aktion ausloesen.
- SW_DLLPRIVATE void Scroll(); //Scrollen wenn sich aus der LayAction Scrollmoeglichkeiten
- //ergaben.
-
SW_DLLPRIVATE void PrepareForPrint( const SwPrtOptions &rOptions );
SW_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt );
@@ -233,11 +230,7 @@ public:
void ChgHyphenation() { Reformat(); }
void ChgNumberDigits();
- //Methoden fuer Paint- und Scrollrects, die auf allen Shells im
- //Ring arbeiten.
sal_Bool AddPaintRect( const SwRect &rRect );
- void AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, long nOffs );
- void SetNoNextScroll();
void InvalidateWindows( const SwRect &rRect );
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index efb7c6bd76..819527666b 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* 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
@@ -1773,13 +1773,6 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
}
}
- //Ggf. gescrollten Bereicht korrigieren (Alignment).
- //Nur wenn gescrollt wurde, und wenn keine Selektion existiert.
- if( pFrm && Imp()->IsScrolled() &&
- pShellCrsr->GetNext() == pShellCrsr && !pShellCrsr->HasMark() )
- Imp()->RefreshScrolledArea( aCharRect );
-
-
eMvState = MV_NONE; // Status fuers Crsr-Travelling - GetCrsrOfst
if( pFrm && Imp()->IsAccessible() )
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index a5c058bb4f..3aa5151d9b 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -298,14 +298,6 @@ void SwNoTxtFrm::Paint( const SwRect &rRect ) const
// <--
StopAnimation();
- if ( pSh->Imp()->IsPaintInScroll() && pSh->GetWin() && rRect != Frm() &&
- HasAnimation() )
- {
- pSh->GetWin()->Invalidate( Frm().SVRect() );
- return;
- }
-
-
SfxProgress::EnterLock(); //Keine Progress-Reschedules im Paint (SwapIn)
OutputDevice *pOut = pSh->GetOut();
@@ -802,29 +794,30 @@ void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, OutputDevice* pOut )
{
+
if(!pOut)
return;
- Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
- Rectangle aNewPxRect( aPxRect );
- while( aNewPxRect.Left() < aPxRect.Left() )
- {
- rAlignedGrfArea.Left( rAlignedGrfArea.Left()+1 );
- aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
- }
- while( aNewPxRect.Top() < aPxRect.Top() )
- {
- rAlignedGrfArea.Top( rAlignedGrfArea.Top()+1 );
- aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
- }
- while( aNewPxRect.Bottom() > aPxRect.Bottom() )
- {
- rAlignedGrfArea.Bottom( rAlignedGrfArea.Bottom()-1 );
- aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
- }
- while( aNewPxRect.Right() > aPxRect.Right() )
- {
- rAlignedGrfArea.Right( rAlignedGrfArea.Right()-1 );
- aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ Rectangle aPxRect = pOut->LogicToPixel( rInArea.SVRect() );
+ Rectangle aNewPxRect( aPxRect );
+ while( aNewPxRect.Left() < aPxRect.Left() )
+ {
+ rAlignedGrfArea.Left( rAlignedGrfArea.Left()+1 );
+ aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ }
+ while( aNewPxRect.Top() < aPxRect.Top() )
+ {
+ rAlignedGrfArea.Top( rAlignedGrfArea.Top()+1 );
+ aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ }
+ while( aNewPxRect.Bottom() > aPxRect.Bottom() )
+ {
+ rAlignedGrfArea.Bottom( rAlignedGrfArea.Bottom()-1 );
+ aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
+ }
+ while( aNewPxRect.Right() > aPxRect.Right() )
+ {
+ rAlignedGrfArea.Right( rAlignedGrfArea.Right()-1 );
+ aNewPxRect = pOut->LogicToPixel( rAlignedGrfArea.SVRect() );
}
}
@@ -846,7 +839,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
pOut->GetConnectMetaFile();
const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() );
-
+
/// OD 25.09.2002 #99739# - calculate aligned rectangle from parameter <rGrfArea>.
/// Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
/// the following code.
@@ -861,14 +854,14 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
}
else //if( bIsChart )
- {
- //#i78025# charts own borders are not completely visible
- //the above pixel correction is not correct - at least not for charts
- //so a different pixel correction is choosen here
- //this might be a good idea for all other OLE objects also,
- //but as I cannot oversee the consequences I fix it only for charts for now
- lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
- }
+ {
+ //#i78025# charts own borders are not completely visible
+ //the above pixel correction is not correct - at least not for charts
+ //so a different pixel correction is choosen here
+ //this might be a good idea for all other OLE objects also,
+ //but as I cannot oversee the consequences I fix it only for charts for now
+ lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
+ }
if( pGrfNd )
{
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 439c2e8b28..0d14afe60b 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -108,14 +108,8 @@ class SwLayAction
// OD 14.04.2003 #106346# - new flag for content formatting on interrupt.
sal_Bool mbFormatCntntOnInterrupt;
- // --> OD 2004-06-14 #i28701# - new flag, indicating, if scrolling is
- // allowed during page format
- bool mbScrollingAllowed;
-
#ifdef _LAYACT_CXX
- void _AddScrollRect( const SwCntntFrm *, const SwPageFrm *,
- const SwTwips, const SwTwips );
void PaintCntnt( const SwCntntFrm *, const SwPageFrm *,
const SwRect &rOldRect, long nOldBottom );
BOOL PaintWithoutFlys( const SwRect &, const SwCntntFrm *,
diff --git a/sw/source/core/inc/scrrect.hxx b/sw/source/core/inc/scrrect.hxx
deleted file mode 100644
index e3827e1d17..0000000000
--- a/sw/source/core/inc/scrrect.hxx
+++ /dev/null
@@ -1,128 +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: scrrect.hxx,v $
- * $Revision: 1.6 $
- *
- * 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 _SCRRECT_HXX
-#define _SCRRECT_HXX
-
-#include <svl/svarray.hxx>
-#include "swrect.hxx"
-#include <swtypes.hxx>
-
-class SwStripe
-{
- SwTwips nY;
- SwTwips nHeight;
-public:
- inline SwStripe( SwTwips nPos, SwTwips nHght )
- : nY( nPos ), nHeight( nHght ) {}
- inline SwTwips GetY() const { return nY; }
- inline SwTwips& Y() { return nY; }
- inline SwTwips GetHeight() const { return nHeight; }
- inline SwTwips& Height() { return nHeight; }
- inline SwTwips GetBottom() const { return nHeight ? nY + nHeight - 1 : nY; }
- inline BOOL operator<( const SwStripe &rTst ) const
- { return nY < rTst.nY || ( nY == rTst.nY && nHeight > rTst.nHeight ); }
- inline BOOL operator==( const SwStripe& rTst ) const
- { return nY == rTst.nY && nHeight == rTst.nHeight; }
-};
-
-SV_DECL_VARARR( SwStripeArr, SwStripe, 1, 4 )
-
-class SwStripes : public SwStripeArr, public SwStripe
-{
- SwTwips nMin; // Left minimum
- SwTwips nMax; // Right maximum
-public:
- SwStripes( SwTwips nPos, SwTwips nSize, SwTwips nMn, SwTwips nMx )
- : SwStripe( nPos, nSize ), nMin( nMn ), nMax( nMx ) {}
- SwStripes& Plus( const SwStripes& rOther, BOOL bVert );
- BOOL Recalc( BOOL bVert );
-
- inline SwTwips GetMin() const { return nMin; }
- inline SwTwips GetMax() const { return nMax; }
- inline void SetMin( const SwTwips nNew ) { nMin = nNew; }
- inline void SetMax( const SwTwips nNew ) { nMax = nNew; }
- inline void ChkMin( const SwTwips nNew ) { if( nNew < nMin ) nMin = nNew; }
- inline void ChkMax( const SwTwips nNew ) { if( nNew > nMax ) nMax = nNew; }
- inline SwTwips GetRight() const { return nMax > nMin ? nMax - 1 : nMax; }
- inline SwTwips GetWidth() const { return nMax - nMin; }
-};
-
-class SwScrollColumn
-{
- SwTwips nX;
- SwTwips nWidth;
- SwTwips nOffs;
- BOOL bVertical;
-public:
- inline SwScrollColumn( SwTwips nPos, SwTwips nSz, SwTwips nOff, BOOL bVert )
- : nX( nPos ), nWidth( nSz ), nOffs( nOff ), bVertical( bVert ) {}
- inline SwScrollColumn( const SwScrollColumn& rCol )
- : nX( rCol.nX ), nWidth( rCol.nWidth ),
- nOffs( rCol.nOffs ), bVertical( rCol.bVertical ) {}
- BOOL IsVertical() const { return bVertical; }
- inline BOOL operator<( const SwScrollColumn &rTst ) const
- { return bVertical < rTst.bVertical || ( bVertical == rTst.bVertical &&
- ( nX < rTst.nX || ( nX == rTst.nX && ( nWidth < rTst.nWidth ||
- ( nWidth == rTst.nWidth && nOffs < rTst.nOffs ) ) ) ) ); }
- inline BOOL operator==( const SwScrollColumn &rTst ) const
- { return bVertical == rTst.bVertical && nX == rTst.nX &&
- nWidth == rTst.nWidth && nOffs == rTst.nOffs;}
- inline SwTwips GetX() const { return nX; }
- inline SwTwips GetWidth() const { return nWidth; }
- inline SwTwips GetOffs() const { return nOffs; }
- inline void ClrOffs() { nOffs = 0; }
- inline SwTwips GetRight() const { return nWidth ? nX + nWidth - 1 : nX; }
-};
-
-typedef SwStripes* SwStripesPtr;
-SV_DECL_PTRARR_SORT(SwScrollStripes, SwStripesPtr, 1, 4)
-
-class SwScrollArea : public SwScrollColumn, public SwScrollStripes
-{
-public:
- void SmartInsert( SwStripes* pStripes );
- void Add( SwScrollArea *pScroll );
- inline SwScrollArea( const SwScrollColumn &rCol, SwStripes* pStripes )
- : SwScrollColumn( rCol )
- { Insert( pStripes ); }
- BOOL Compress();
-};
-
-typedef SwScrollArea* SwScrollAreaPtr;
-SV_DECL_PTRARR_SORT(SScrAreas,SwScrollAreaPtr,1,2)
-
-class SwScrollAreas : public SScrAreas
-{
-public:
- void InsertCol( const SwScrollColumn &rCol, SwStripes *pStripes );
-};
-
-
-#endif //_SCRRECT_HXX
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index a704ea2b33..aa5b0f2fa8 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -49,7 +49,6 @@ class SwBorderAttrs;
class SwFrmFmt;
class OutputDevice;
class SwTestFormat;
-class SwStripes;
struct SwCrsrMoveState;
struct SwFillData;
class SwPortionHandler;
@@ -547,8 +546,6 @@ public:
// Stoppt Animationen innerhalb von Numerierungen
void StopAnimation( OutputDevice *pOut );
- void CriticalLines(const OutputDevice& rOut,SwStripes &rStripes,long nOffs);
-
// visit all portions for Accessibility
void VisitPortions( SwPortionHandler& rPH ) const;
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index e4735c0e5c..c9a3aa813e 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -45,7 +45,6 @@ class ViewShell;
class SwFlyFrm;
class SwViewOption;
class SwRegionRects;
-class SwScrollAreas;
class SwFrm;
class SwLayAction;
class SwLayIdle;
@@ -88,8 +87,6 @@ class SwViewImp
SwPageFrm *pFirstVisPage;//Zeigt immer auf die erste sichtbare Seite.
SwRegionRects *pRegion; //Sammler fuer Paintrects aus der LayAction.
- SwScrollAreas *pScrollRects; //Sammler fuer Scrollrects aus der LayAction.
- SwScrollAreas *pScrolledArea;//Sammler der gescrollten Rechtecke.
SwLayAction *pLayAct; //Ist gesetzt wenn ein Action-Objekt existiert
//Wird vom SwLayAction-CTor ein- und vom DTor
@@ -101,17 +98,11 @@ class SwViewImp
mutable const SdrObject * pSdrObjCached;
mutable String sSdrObjCachedComment;
- AutoTimer aScrollTimer; //Fuer das Aufraeumen nach dem Scrollen.
-
BOOL bFirstPageInvalid :1; //Pointer auf erste Seite ungueltig?
- BOOL bNextScroll :1; //Scroll in der folgenden EndAction erlaubt?
- BOOL bScroll :1; //Scroll in der aktuellen EndAction erlaubt?
- BOOL bScrolled :1; //Wurde gescrolled? Dann im Idle aufraeumen.
//BOOL bResetXorVisibility:1; //StartAction/EndAction
//HMHBOOL bShowHdlPaint :1; //LockPaint/UnlockPaint
BOOL bResetHdlHiddenPaint:1;// -- "" --
- BOOL bPaintInScroll :1; //Paint (Update() im ScrollHdl der ViewShell
BOOL bSmoothUpdate :1; //Meber fuer SmoothScroll
BOOL bStopSmooth :1;
@@ -146,21 +137,6 @@ class SwViewImp
void SetFirstVisPage(); //Neue Ermittlung der ersten sichtbaren Seite
- void ResetNextScroll() { bNextScroll = FALSE; }
- void SetNextScroll() { bNextScroll = TRUE; }
- void SetScroll() { bScroll = TRUE; }
- void ResetScrolled() { bScrolled = FALSE; }
- void SetScrolled() { bScrolled = TRUE; }
-
- SwScrollAreas *GetScrollRects() { return pScrollRects; }
- void FlushScrolledArea();
- BOOL _FlushScrolledArea( SwRect& rRect );
- BOOL FlushScrolledArea( SwRect& rRect )
- { if( !pScrolledArea ) return FALSE; return _FlushScrolledArea( rRect ); }
- void _ScrolledRect( const SwRect& rRect, long nOffs );
- void ScrolledRect( const SwRect& rRect, long nOffs )
- { if( pScrolledArea ) _ScrolledRect( rRect, nOffs ); }
-
void StartAction(); //Henkel Anzeigen und verstecken.
void EndAction(); //gerufen von ViewShell::ImplXXXAction
void LockPaint(); //dito, gerufen von ViewShell::ImplLockPaint
@@ -226,32 +202,9 @@ public:
inline SwPageFrm *GetFirstVisPage();
void SetFirstVisPageInvalid() { bFirstPageInvalid = TRUE; }
- //SS'en fuer Paint- und Scrollrects.
BOOL AddPaintRect( const SwRect &rRect );
- void AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, long nOffs );
- void MoveScrollArea();
SwRegionRects *GetRegion() { return pRegion; }
- void DelRegions(); //Loescht Scroll- und PaintRects
-
- //Handler fuer das Refresh von gescrollten Bereichen (Korrektur des
- //Alignments). Ruft das Refresh mit der ScrolledArea.
- //RefreshScrolledArea kann z.B. beim Setzen des Crsr genutzt werden, es
- //wird nur der Anteil des Rect refreshed, der mit der ScrolledArea
- //ueberlappt. Das 'reingereichte Rechteck wird veraendert!
- void RestartScrollTimer() { aScrollTimer.Start(); }
- DECL_LINK( RefreshScrolledHdl, Timer * );
- void _RefreshScrolledArea( const SwRect &rRect );
- void RefreshScrolledArea( SwRect &rRect );
-
- //Wird vom Layout ggf. waehrend einer Action gerufen, wenn der
- //Verdacht besteht, dass es etwas drunter und drueber geht.
- void ResetScroll() { bScroll = FALSE; }
-
- BOOL IsNextScroll() const { return bNextScroll; }
- BOOL IsScroll() const { return bScroll; }
- BOOL IsScrolled() const { return bScrolled; }
-
- BOOL IsPaintInScroll() const { return bPaintInScroll; }
+ void DelRegion();
// neues Interface fuer StarView Drawing
inline BOOL HasDrawView() const { return 0 != pDrawView; }
@@ -365,20 +318,6 @@ public:
void FireAccessibleEvents();
};
-//Kann auf dem Stack angelegt werden, wenn etwas ausgegeben oder
-//gescrolled wird. Handles und sontiges vom Drawing werden im CTor
-//gehidet und im DTor wieder sichtbar gemacht.
-//AW 06-Sep99: Hiding of handles is no longer necessary, removed
-//class SwSaveHdl
-//{
-// SwViewImp *pImp;
-// BOOL bXorVis;
-//public:
-// SwSaveHdl( SwViewImp *pImp );
-// ~SwSaveHdl();
-//};
-
-
inline SwPageFrm *SwViewImp::GetFirstVisPage()
{
if ( bFirstPageInvalid )
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 5eb767a656..4cea4ba668 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -374,149 +374,6 @@ void SwLayAction::PaintCntnt( const SwCntntFrm *pCnt,
/*************************************************************************
|*
-|* SwLayAction::_AddScrollRect()
-|*
-|* Ersterstellung MA 04. Mar. 94
-|* Letzte Aenderung MA 04. Mar. 94
-|*
-|*************************************************************************/
-BOOL MA_FASTCALL lcl_IsOverObj( const SwFrm *pFrm, const SwPageFrm *pPage,
- const SwRect &rRect1, const SwRect &rRect2,
- const SwLayoutFrm *pLay )
-{
- const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
- const SwFlyFrm *pSelfFly = pFrm->FindFlyFrm();
- const BOOL bInCnt = pSelfFly && pSelfFly->IsFlyInCntFrm() ? TRUE : FALSE;
-
- for ( sal_uInt32 j = 0; j < rObjs.Count(); ++j )
- {
- // --> OD 2004-07-07 #i28701# - consider changed type of <SwSortedObjs> entries
- const SwAnchoredObject* pAnchoredObj = rObjs[j];
- const SwRect aRect( pAnchoredObj->GetObjRect() );
- if ( !rRect1.IsOver( aRect ) && !rRect2.IsOver( aRect ) )
- continue; //Keine Ueberlappung, der naechste.
-
- const SwFlyFrm *pFly = pAnchoredObj->ISA(SwFlyFrm)
- ? static_cast<const SwFlyFrm*>(pAnchoredObj) : 0;
-
- //Wenn der Rahmen innerhalb des LayFrm verankert ist, so darf er
- //mitgescrollt werden, wenn er nicht seitlich aus dem Rechteck
- //herausschaut.
- if ( pLay && pFly && pFly->IsLowerOf( pLay ) )
- {
- if ( pFly->Frm().Left() < rRect1.Left() ||
- pFly->Frm().Right()> rRect1.Right() )
- return TRUE;
- continue;
- }
-
- if ( !pSelfFly ) //Nur wenn der Frm in einem Fly steht kann
- return TRUE; //es Einschraenkungen geben.
-
- if ( !pFly ) //Keine Einschraenkung fuer Zeichenobjekte.
- return TRUE;
-
- if ( pFly != pSelfFly )
- {
- //Flys unter dem eigenen nur dann abziehen, wenn sie innerhalb des
- //eigenen stehen.
- //Fuer inhaltsgebundene Flys alle Flys abziehen fuer die gilt, dass
- //pSelfFly nicht innerhalb von ihnen steht.
- if ( bInCnt )
- {
- const SwFlyFrm *pTmp = pSelfFly->GetAnchorFrm()->FindFlyFrm();
- while ( pTmp )
- {
- if ( pTmp == pFly )
- return FALSE;
- else
- pTmp = pTmp->GetAnchorFrm()->FindFlyFrm();
- }
- } else if ( pAnchoredObj->GetDrawObj()->GetOrdNum() <
- pSelfFly->GetVirtDrawObj()->GetOrdNum() )
- {
- const SwFlyFrm *pTmp = pFly;
- do
- { if ( pTmp == pSelfFly )
- return TRUE;
- else
- pTmp = pTmp->GetAnchorFrm()->FindFlyFrm();
- } while ( pTmp );
- } else
- return TRUE;
- }
- }
- return FALSE;
-}
-
-void SwLayAction::_AddScrollRect( const SwCntntFrm *pCntnt,
- const SwPageFrm *pPage,
- const SwTwips nOfst,
- const SwTwips nOldBottom )
-{
- // --> OD 2004-07-01 #i28701# - determine, if scrolling is allowed.
- bool bScroll = mbScrollingAllowed;
- SwRect aPaintRect( pCntnt->PaintArea() );
- SWRECTFN( pCntnt )
-
- // --> OD 2007-11-27 #notes2#
- // if sidebar for notes is present, no scrolling is allowed
- if ( bScroll )
- {
- const SwPostItMgr* pPostItMgr = pImp->GetShell()->GetPostItMgr();
- if ( pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
- {
- bScroll = false;
- }
- }
- // <--
-
- //Wenn altes oder neues Rechteck mit einem Fly ueberlappen, in dem der
- //Cntnt nicht selbst steht, so ist nichts mit Scrollen.
- if ( bScroll && pPage->GetSortedObjs() )
- {
- SwRect aRect( aPaintRect );
- if( bVert )
- aPaintRect.Pos().X() += nOfst;
- else
- aPaintRect.Pos().Y() -= nOfst;
-
- if ( ::lcl_IsOverObj( pCntnt, pPage, aPaintRect, aRect, 0 ) )
- bScroll = false;
-
- if( bVert )
- aPaintRect.Pos().X() -= nOfst;
- else
- aPaintRect.Pos().Y() += nOfst;
- }
- if ( bScroll && pPage->GetFmt()->GetBackground().GetGraphicPos() != GPOS_NONE )
- bScroll = false;
-
- if ( bScroll )
- {
- if( aPaintRect.HasArea() )
- pImp->GetShell()->AddScrollRect( pCntnt, aPaintRect, nOfst );
- if ( pCntnt->IsRetouche() && !pCntnt->GetNext() )
- {
- SwRect aRect( pCntnt->GetUpper()->PaintArea() );
- (aRect.*fnRect->fnSetTop)( (pCntnt->*fnRect->fnGetPrtBottom)() );
- if ( !pImp->GetShell()->AddPaintRect( aRect ) )
- pCntnt->ResetRetouche();
- }
- pCntnt->ResetCompletePaint();
- }
- else if( aPaintRect.HasArea() )
- {
- if( bVert )
- aPaintRect.Pos().X() += nOfst;
- else
- aPaintRect.Pos().Y() -= nOfst;
- PaintCntnt( pCntnt, pPage, aPaintRect, nOldBottom );
- }
-}
-
-/*************************************************************************
-|*
|* SwLayAction::SwLayAction()
|*
|* Ersterstellung MA 30. Oct. 92
@@ -541,8 +398,6 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) :
bUpdateExpFlds = bBrowseActionStop = bActionInProgress = FALSE;
// OD 14.04.2003 #106346# - init new flag <mbFormatCntntOnInterrupt>.
mbFormatCntntOnInterrupt = sal_False;
- // --> OD 2004-06-14 #i28701#
- mbScrollingAllowed = true;
pImp->pLayAct = this; //Anmelden
}
@@ -657,8 +512,6 @@ void SwLayAction::Action()
pRoot->ResetTurboFlag();
pRoot->ResetTurbo();
- if ( IsInput() )
- pImp->GetShell()->SetNoNextScroll();
SetCheckPages( TRUE );
bActionInProgress = FALSE;
@@ -738,34 +591,6 @@ class NotifyLayoutOfPageInProgress
};
// <--
-// --> OD 2004-06-14 #i28701# - local method to determine, if scrolling during
-// the format of the given page is allowed.
-// Scrolling isn't allowed, if the wrapping style of floating screen objects
-// is considered on object positioning and to-paragraph/to-character anchored
-// floating screen objects are registered at the page.
-bool lcl_ScrollingAllowed( const SwPageFrm& _rPageFrm )
-{
- bool bRetScrollAllowed = true;
-
- if ( _rPageFrm.GetSortedObjs() &&
- _rPageFrm.GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) )
- {
- const SwSortedObjs* pObjs = _rPageFrm.GetSortedObjs();
- sal_uInt32 i = 0;
- for ( ; i < pObjs->Count(); ++i )
- {
- SwAnchoredObject* pObj = (*pObjs)[i];
- if ( pObj->ConsiderObjWrapInfluenceOnObjPos() )
- {
- bRetScrollAllowed = false;
- break;
- }
- }
- }
-
- return bRetScrollAllowed;
-}
-
void SwLayAction::InternalAction()
{
ASSERT( pRoot->Lower()->IsPageFrm(), ":-( Keine Seite unterhalb der Root.");
@@ -867,8 +692,6 @@ void SwLayAction::InternalAction()
// <NotifyLayoutOfPageInProgress>
{
NotifyLayoutOfPageInProgress aLayoutOfPageInProgress( *pPage );
- // --> OD 2004-07-01 #i28701# - determine, if scrolling is allowed.
- mbScrollingAllowed = lcl_ScrollingAllowed( *pPage );
while ( !IsInterrupt() && !IsNextCycle() &&
((IS_FLYS && IS_INVAFLY) || pPage->IsInvalid()) )
@@ -1841,219 +1664,6 @@ BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
return bChanged || bTabChanged;
}
-BOOL MA_FASTCALL lcl_AreLowersScrollable( const SwLayoutFrm *pLay )
-{
- const SwFrm *pLow = pLay->Lower();
- while ( pLow )
- {
- if ( pLow->IsCompletePaint() || !pLow->IsValid() || pLow->IsCoveredCell() )
- return FALSE;
- if ( pLow->IsLayoutFrm() && !::lcl_AreLowersScrollable( (SwLayoutFrm*)pLow ))
- return FALSE;
- pLow = pLow->GetNext();
- }
- return TRUE;
-}
-
-SwLayoutFrm * MA_FASTCALL lcl_IsTabScrollable( SwTabFrm *pTab )
-{
- //returnt die erste unveraenderte Zeile, oder 0 wenn nicht
- //gescrollt werden darf.
- if ( !pTab->IsCompletePaint() )
- {
- SwLayoutFrm *pUnchgdRow = 0;
- SwLayoutFrm *pRow = (SwLayoutFrm*)pTab->Lower();
- while ( pRow )
- {
- if ( ::lcl_AreLowersScrollable( pRow ) )
- {
- if ( !pUnchgdRow )
- pUnchgdRow = pRow;
- }
- else
- {
- pUnchgdRow = 0;
- }
-
- pRow = (SwLayoutFrm*)pRow->GetNext();
- }
- return pUnchgdRow;
- }
- return 0;
-}
-
-// OD 2004-05-11 #i28701#
-void lcl_ValidateLowerObjs( SwFrm* pFrm,
- const SwTwips nOfst,
- SwPageFrm *pPage,
- bool bResetOnly );
-
-// OD 2004-05-11 #i28701# - correction: floating screen objects, which are
-// anchored at-fly, have also been to be considered.
-void MA_FASTCALL lcl_ValidateLowers( SwLayoutFrm *pLay, const SwTwips nOfst,
- SwLayoutFrm *pRow, SwPageFrm *pPage,
- BOOL bResetOnly )
-{
- pLay->ResetCompletePaint();
-
- // OD 2004-05-11 #i28701# - consider floating screen objects, which are
- // anchored at-fly.
- if ( pLay->IsFlyFrm() )
- {
- ::lcl_ValidateLowerObjs( pLay, nOfst, pPage, bResetOnly );
- }
-
- SwFrm *pLow = pRow ? pRow : pLay->Lower();
- SwRootFrm *pRootFrm = 0;
-
- while ( pLow )
- {
- if ( !bResetOnly )
- {
- SwRect aOldFrm( pLow->Frm() );
- pLow->Frm().Pos().Y() += nOfst;
- if( pLow->IsAccessibleFrm() )
- {
- if( !pRootFrm )
- pRootFrm = pPage->FindRootFrm();
- if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
- pRootFrm->GetCurrShell() )
- {
- pRootFrm->GetCurrShell()->Imp()->MoveAccessibleFrm( pLow, aOldFrm );
- }
- }
- }
- if ( pLow->IsLayoutFrm() )
- {
- ::lcl_ValidateLowers( (SwLayoutFrm*)pLow, nOfst, 0, pPage, bResetOnly);
- }
- else
- {
- pLow->ResetCompletePaint();
- // OD 2004-05-11 #i28701# - use new local helper method
- // <lcl_ValidateLowerObjs(..)>
- ::lcl_ValidateLowerObjs( pLow, nOfst, pPage, bResetOnly);
- }
- if ( !bResetOnly )
- pLow->Calc(); //#55435# Stabil halten.
- pLow = pLow->GetNext();
- }
-}
-
-// OD 2004-05-11 #i28701# - helper method for <lcl_ValidateLowers(..)> to
-// 'ValidateLowers' for floating screen objects
-void lcl_ValidateLowerObjs( SwFrm* pFrm,
- const SwTwips nOfst,
- SwPageFrm *pPage,
- bool bResetOnly )
-{
- if ( pFrm->GetDrawObjs() )
- {
- // --> OD 2004-10-15 #i26945# - consider layout direction
- SWRECTFN( pFrm )
- // <--
- for ( USHORT i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
- {
- SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
- // --> OD 2004-10-08 #i26945# - check, if the anchor frame, which
- // contains the anchor position, is the given frame
- if ( pAnchoredObj->GetAnchorFrmContainingAnchPos() != pFrm )
- {
- continue;
- }
- if ( pAnchoredObj->ISA(SwFlyFrm) )
- {
- SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
- if ( !bResetOnly )
- {
- // --> OD 2004-10-15 #i26945#
- // - consider layout direction
- // - consider condition for direct move
- const bool bNoDirectMove =
- WEIT_WECH == pFly->Frm().Top() ||
- pFly->ConsiderObjWrapInfluenceOnObjPos();
- if ( !bNoDirectMove )
- {
- (pFly->Frm().*fnRect->fnSubTop)( -nOfst );
- (pFly->Frm().*fnRect->fnAddBottom)( nOfst );
- }
- // <--
- pFly->GetVirtDrawObj()->SetRectsDirty();
- // --> OD 2004-08-17 - also notify view of <SdrObject>
- // instance, which represents the Writer fly frame in the
- // drawing layer
- pFly->GetVirtDrawObj()->SetChanged();
- // <--
- if ( pFly->IsFlyInCntFrm() )
- ((SwFlyInCntFrm*)pFly)->AddRefOfst( nOfst );
- // --> OD 2004-10-15 #i26945# - consider at-character
- // anchored Writer fly frames
- else if( pFly->IsAutoPos() )
- {
- pFly->AddLastCharY( nOfst );
- // OD 2004-05-18 #i28701# - follow-up of #i22341#
- // <mnLastTopOfLine> has also been adjusted.
- pFly->AddLastTopOfLineY( nOfst );
- }
- // <--
- }
- ::lcl_ValidateLowers( pFly, nOfst, 0, pPage, bResetOnly);
- }
- // --> OD 2004-10-15 #i26945# - consider drawing objects
- else
- {
- if ( !bResetOnly )
- {
- pAnchoredObj->AddLastCharY( nOfst );
- pAnchoredObj->AddLastTopOfLineY( nOfst );
- }
- }
- // <--
- pAnchoredObj->InvalidateObjPos();
- }
- }
-}
-
-void MA_FASTCALL lcl_AddScrollRectTab( SwTabFrm *pTab, SwLayoutFrm *pRow,
- const SwRect &rRect,
- const SwTwips nOfst)
-{
- // --> OD 2007-11-27 #notes2#
- // if sidebar for notes is present, no scrolling is allowed
- const SwPageFrm* pPage = pTab->FindPageFrm();
- ASSERT( pPage, "<lcl_AddScrollRectTab(..)> - no page frame found at table frame -> crash" );
- ViewShell* pSh = pPage->GetShell();
- if ( pSh )
- {
- const SwPostItMgr* pPostItMgr = pSh->GetPostItMgr();
- if ( pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
- {
- return;
- }
- }
- // <--
- //Wenn altes oder neues Rechteck mit einem Fly ueberlappen, in dem der
- //Frm nicht selbst steht, so ist nichts mit Scrollen.
- SwRect aRect( rRect );
- // OD 04.11.2002 #104100# - <SWRECTFN( pTab )> not needed.
- if( pTab->IsVertical() )
- aRect.Pos().X() -= nOfst;
- else
- aRect.Pos().Y() += nOfst;
- if ( pPage->GetSortedObjs() )
- {
- if ( ::lcl_IsOverObj( pTab, pPage, rRect, aRect, pTab ) )
- return;
- }
- if ( pPage->GetFmt()->GetBackground().GetGraphicPos() != GPOS_NONE )
- return;
-
- if ( pSh )
- pSh->AddScrollRect( pTab, aRect, nOfst );
- ::lcl_ValidateLowers( pTab, nOfst, pRow, pTab->FindPageFrm(),
- pTab->IsLowersFormatted() );
-}
-
// OD 31.10.2002 #104100#
// NOTE: no adjustments for vertical layout support necessary
BOOL CheckPos( SwFrm *pFrm )
@@ -2096,76 +1706,27 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
if ( !pTab->IsValid() || pTab->IsCompletePaint() || pTab->IsComplete() )
{
if ( pTab->GetPrev() && !pTab->GetPrev()->IsValid() )
- pTab->GetPrev()->SetCompletePaint();
-
- //Potenzielles Scrollrect ist die ganze Tabelle. Da bereits ein
- //Wachstum innerhalb der Tabelle - und damit der Tabelle selbst -
- //stattgefunden haben kann, muss die untere Kante durch die
- //Unterkante der letzten Zeile bestimmt werden.
- SwLayoutFrm* pRow = 0L;
- SwRect aScrollRect( pTab->PaintArea() );
- // --> OD 2004-07-01 #i28701# - check, if scrolling is allowed.
- if ( mbScrollingAllowed &&
- ( IsPaint() || bAddRect ) )
{
- pRow = static_cast<SwLayoutFrm*>(pTab->GetLastLower());
- // OD 31.10.2002 #104100# - vertical layout support
- (aScrollRect.*fnRect->fnSetBottom)( (pRow->Frm().*fnRect->fnGetBottom)() );
- //Die Oberkante wird ggf. durch die erste unveraenderte Zeile bestimmt.
- pRow = ::lcl_IsTabScrollable( pTab );
- if ( pRow && pRow != pTab->Lower() )
- // OD 31.10.2002 #104100# - vertical layout support
- (aScrollRect.*fnRect->fnSetTop)( (pRow->Frm().*fnRect->fnGetTop)() );
+ pTab->GetPrev()->SetCompletePaint();
}
- const SwFrm *pOldUp = pTab->GetUpper();
-
- SwRect aOldRect( pTab->Frm() );
+ const SwRect aOldRect( pTab->Frm() );
pTab->SetLowersFormatted( FALSE );
pTab->Calc();
if ( aOldRect != pTab->Frm() )
+ {
bChanged = TRUE;
- SwRect aPaintFrm = pTab->PaintArea();
+ }
+ const SwRect aPaintFrm = pTab->PaintArea();
if ( IsPaint() && bAddRect )
{
- // --> OD 2004-07-01 #i28701# - check, if scrolling is allowed
- if ( mbScrollingAllowed &&
- pRow && pOldUp == pTab->GetUpper() &&
- pTab->Frm().SSize() == aOldRect.SSize() &&
- // OD 31.10.2002 #104100# - vertical layout support
- (pTab->Frm().*fnRect->fnGetLeft)() == (aOldRect.*fnRect->fnGetLeft)() &&
- pTab->IsAnLower( pRow ) )
- {
- SwTwips nOfst;
- if ( pRow->GetPrev() )
- {
- if ( pRow->GetPrev()->IsValid() ||
- ::CheckPos( pRow->GetPrev() ) )
- {
- // OD 31.10.2002 #104100# - vertical layout support
- nOfst = -(pRow->Frm().*fnRect->fnTopDist)( (pRow->GetPrev()->Frm().*fnRect->fnGetBottom)() );
- }
- else
- nOfst = 0;
- }
- else
- // OD 31.10.2002 #104100# - vertical layout support
- nOfst = (pTab->Frm().*fnRect->fnTopDist)( (aOldRect.*fnRect->fnGetTop)() );
-
- if ( nOfst )
- {
- ::lcl_AddScrollRectTab( pTab, pRow, aScrollRect, nOfst );
- bPainted = TRUE;
- }
- }
-
// OD 01.11.2002 #104100# - add condition <pTab->Frm().HasArea()>
- if ( !pTab->IsCompletePaint() && pTab->IsComplete() &&
+ if ( !pTab->IsCompletePaint() &&
+ pTab->IsComplete() &&
( pTab->Frm().SSize() != pTab->Prt().SSize() ||
// OD 31.10.2002 #104100# - vertical layout support
- (pTab->*fnRect->fnGetLeftMargin)()
- ) &&
+ (pTab->*fnRect->fnGetLeftMargin)() ) &&
pTab->Frm().HasArea()
)
{
@@ -2481,13 +2042,6 @@ void SwLayAction::_FormatCntnt( const SwCntntFrm *pCntnt,
SWRECTFN( pCntnt )
if ( !bDrawObjsOnly && IsPaint() )
{
- const BOOL bPosOnly = !pCntnt->GetValidPosFlag() &&
- !pCntnt->IsCompletePaint() &&
- pCntnt->GetValidSizeFlag() &&
- pCntnt->GetValidPrtAreaFlag() &&
- ( !pCntnt->IsTxtFrm() ||
- !((SwTxtFrm*)pCntnt)->HasAnimation() );
- const SwFrm *pOldUp = pCntnt->GetUpper();
const SwRect aOldRect( pCntnt->UnionFrm() );
const long nOldBottom = (pCntnt->*fnRect->fnGetPrtBottom)();
pCntnt->OptCalc();
@@ -2495,23 +2049,10 @@ void SwLayAction::_FormatCntnt( const SwCntntFrm *pCntnt,
return;
if( (*fnRect->fnYDiff)( (pCntnt->Frm().*fnRect->fnGetBottom)(),
(aOldRect.*fnRect->fnGetBottom)() ) < 0 )
- pCntnt->SetRetouche();
- const SwRect aNewRect( pCntnt->UnionFrm() );
- if ( bPosOnly &&
- (aNewRect.*fnRect->fnGetTop)() != (aOldRect.*fnRect->fnGetTop)() &&
- !pCntnt->IsInTab() && !pCntnt->IsInSct() &&
- ( !pCntnt->GetPrev() || !pCntnt->GetPrev()->IsTabFrm() ) &&
- pOldUp == pCntnt->GetUpper() &&
- (aNewRect.*fnRect->fnGetLeft)() == (aOldRect.*fnRect->fnGetLeft)() &&
- aNewRect.SSize() == aOldRect.SSize()
- )
{
- _AddScrollRect( pCntnt, pPage, (*fnRect->fnYDiff)(
- (pCntnt->Frm().*fnRect->fnGetTop)(),
- (aOldRect.*fnRect->fnGetTop)() ), nOldBottom );
+ pCntnt->SetRetouche();
}
- else
- PaintCntnt( pCntnt, pCntnt->FindPageFrm(), aOldRect, nOldBottom);
+ PaintCntnt( pCntnt, pCntnt->FindPageFrm(), aOldRect, nOldBottom);
}
else
{
@@ -2910,7 +2451,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
{
--pSh->nStartAction;
- if ( pSh->Imp()->GetRegion() || pSh->Imp()->GetScrollRects() )
+ if ( pSh->Imp()->GetRegion() )
bActions = TRUE;
else
{
@@ -2956,9 +2497,9 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
//fix(18176):
SwViewImp *pViewImp = pSh->Imp();
BOOL bUnlock = FALSE;
- if ( pViewImp->GetRegion() || pViewImp->GetScrollRects() )
+ if ( pViewImp->GetRegion() )
{
- pViewImp->DelRegions();
+ pViewImp->DelRegion();
//Fuer Repaint mit virtuellem Device sorgen.
pSh->LockPaint();
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 06f3f34f60..fc0f501a9b 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2809,7 +2809,7 @@ void SwRootFrm::Paint( const SwRect& rRect ) const
aAction.Action();
((SwRootFrm*)this)->ResetTurboFlag();
if ( !pSh->ActionPend() )
- pSh->Imp()->DelRegions();
+ pSh->Imp()->DelRegion();
}
SwRect aRect( rRect );
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 2041797e54..0878159c63 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -2795,9 +2795,6 @@ void SwTabFrm::MakeAll()
}
else if ( GetFollow() == GetNext() )
((SwTabFrm*)GetFollow())->MoveFwd( TRUE, FALSE );
- ViewShell *pSh;
- if ( 0 != (pSh = GetShell()) )
- pSh->Imp()->ResetScroll();
}
continue;
}
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index f796f0f957..5570768f97 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -62,7 +62,6 @@
#include <redlnitr.hxx> // SwRedlineItr
#include <swmodule.hxx> // SW_MOD
#include <tabfrm.hxx> // SwTabFrm (Redlining)
-#include <scrrect.hxx>
#include <SwGrammarMarkUp.hxx>
// --> FME 2004-06-08 #i12836# enhanced pdf export
@@ -751,70 +750,3 @@ void SwTxtFrm::Paint( const SwRect &rRect ) const
}
}
-void SwTxtFrm::CriticalLines( const OutputDevice& rOut, SwStripes &rStripes,
- long nOffs)
-{
- ASSERT( ! IsVertical() || ! IsSwapped(),
- "SwTxtFrm::CriticalLines with swapped frame" );
- SWRECTFN( this )
- long nFrmHeight;
-
- GetFormatted();
- if( HasPara() )
- {
- const long nTopMargin = (this->*fnRect->fnGetTopMargin)();
- SwStripe aStripe( (Frm().*fnRect->fnGetTop)(), nTopMargin );
- if ( nTopMargin )
- {
- rStripes.Insert( aStripe, rStripes.Count() );
- // OD 06.11.2002 #104171#,#103931# - consider vertical layout
- if ( bVert )
- aStripe.Y() -= nTopMargin;
- else
- // OD 06.11.2002 #104171#,#103931# - *add* top margin to Y.
- aStripe.Y() += nTopMargin;
- }
- SwLineLayout* pLay = GetPara();
- do
- {
- SwTwips nBase = aStripe.GetY() +
- ( bVert ? -pLay->GetAscent() : pLay->GetAscent() );
-
- long nLogToPixBase, nLogToPixSum, nLogToPixOffs;
-
- if ( bVert )
- {
- nLogToPixBase = rOut.LogicToPixel( Point( nBase, 0 ) ).X();
- nLogToPixSum = rOut.LogicToPixel( Point( nBase + nOffs, 0 ) ).X();
- nLogToPixOffs = -rOut.LogicToPixel( Size( nOffs, 0 ) ).Width();
- }
- else
- {
- nLogToPixBase = rOut.LogicToPixel( Point( 0, nBase ) ).Y();
- nLogToPixSum = rOut.LogicToPixel( Point( 0, nBase - nOffs ) ).Y();
- nLogToPixOffs = rOut.LogicToPixel( Size( 0, nOffs ) ).Height();
- }
-
- if( nLogToPixBase != nLogToPixSum + nLogToPixOffs )
- {
- aStripe.Height() = pLay->GetRealHeight();
- rStripes.Insert( aStripe, rStripes.Count() );
- }
- aStripe.Y() += ( bVert ? -pLay->GetRealHeight() :
- pLay->GetRealHeight() );
- pLay = pLay->GetNext();
- } while( pLay );
-
- const long nBottomMargin = (this->*fnRect->fnGetBottomMargin)();
- if( nBottomMargin )
- {
-
- aStripe.Height() = nBottomMargin;
- rStripes.Insert( aStripe, rStripes.Count() );
- }
- }
- else if( 0 != (nFrmHeight = (Frm().*fnRect->fnGetHeight)() ))
- rStripes.Insert( SwStripe( (Frm().*fnRect->fnGetTop)(), nFrmHeight ),
- rStripes.Count() );
-}
-
diff --git a/sw/source/core/view/makefile.mk b/sw/source/core/view/makefile.mk
index 56cfb7d6ed..86b8871f96 100644
--- a/sw/source/core/view/makefile.mk
+++ b/sw/source/core/view/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# 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
@@ -44,7 +44,6 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES = \
- $(SLO)$/scrrect.obj \
$(SLO)$/vdraw.obj \
$(SLO)$/viewimp.obj \
$(SLO)$/viewsh.obj \
@@ -52,10 +51,10 @@ SLOFILES = \
$(SLO)$/vnew.obj \
$(SLO)$/vprint.obj \
$(SLO)$/pagepreviewlayout.obj
-
+
EXCEPTIONSFILES = \
$(SLO)$/pagepreviewlayout.obj
-
+
# --- Targets -------------------------------------------------------
diff --git a/sw/source/core/view/scrrect.cxx b/sw/source/core/view/scrrect.cxx
deleted file mode 100644
index 87b718425d..0000000000
--- a/sw/source/core/view/scrrect.cxx
+++ /dev/null
@@ -1,1195 +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: scrrect.cxx,v $
- * $Revision: 1.23 $
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-
-
-#include <viewimp.hxx>
-#include <viewsh.hxx>
-#include <viewopt.hxx>
-#include <vcl/window.hxx>
-#include <scrrect.hxx> // SwScrollRect, SwScrollRects
-// OD 18.02.2003 #107562# - <SwAlignRect> for <ViewShell::Scroll()>
-#include <frmtool.hxx>
-#ifndef _CURSOR_HXX //autogen
-#include <vcl/cursor.hxx>
-#endif
-#include <vcl/virdev.hxx>
-#ifndef _APP_HXX //autogen
-#include <vcl/svapp.hxx>
-#endif
-#include <txtfrm.hxx>
-#include "crsrsh.hxx"
-#include "rootfrm.hxx"
-#include "pagefrm.hxx"
-
-// OD 12.11.2002 #96272# - include declaration for <SetMappingForVirtDev>
-#include "setmapvirtdev.hxx"
-#include <IDocumentDrawModelAccess.hxx>
-
-// #i75172#
-#include "dview.hxx"
-
-DBG_NAME(RefreshTimer)
-
-SV_IMPL_VARARR(SwStripeArr,SwStripe);
-SV_IMPL_OP_PTRARR_SORT(SwScrollStripes, SwStripesPtr);
-SV_IMPL_OP_PTRARR_SORT(SScrAreas, SwScrollAreaPtr);
-
-/*****************************************************************************
-|*
-|* ViewShell::AddScrollRect()
-|*
-|* Creation MA 07. Mar. 94
-|* Last change AMA 20. July 00
-|*
-|* Description
-|* ViewShell::AddScrollRect(..) passes a registration from a scrolling frame or
-|* rectangle to all ViewShells and SwViewImps respectively.
-|*
-******************************************************************************/
-
-void ViewShell::AddScrollRect( const SwFrm *pFrm, const SwRect &rRect,
- long nOfs )
-{
- ASSERT( pFrm, "Where is my friend, the frame?" );
- BOOL bScrollOn = TRUE;
-
-#ifdef NOSCROLL
- //Auch im Product per speziellem Compilat abschaltbar.
- bScrollOn = FALSE;
-#endif
-
- if( bScrollOn && Imp()->IsScroll() && nOfs <= SHRT_MAX && nOfs >= SHRT_MIN )
- {
- ViewShell *pSh = this;
- do
- {
- pSh->Imp()->AddScrollRect( pFrm, rRect, nOfs );
- pSh = (ViewShell*)pSh->GetNext();
- } while ( pSh != this );
- }
- else
- AddPaintRect( rRect );
-}
-
-/******************************************************************************
-|*
-|* ViewShell::Scroll()
-|*
-|* Ersterstellung MA 07. Mar. 94
-|* Last change AMA 21. July 00
-|*
-|* Description
-|* ViewShell::Scroll() scrolls all rectangles in the pScrollRects-list and
-|* transfers the critical lines by calling SwViewImp::MoveScrollArea(..).
-|*
-******************************************************************************/
-#include <svx/sdrpaintwindow.hxx>
-#include <svx/sdr/overlay/overlaymanager.hxx>
-
-void ViewShell::Scroll()
-{
- SwScrollAreas *pScrollRects = Imp()->GetScrollRects();
- if ( pScrollRects )
- {
- bPaintWorks = FALSE;
- ASSERT( pScrollRects->Count(), "ScrollRects ohne ScrollRects." );
-
- //Abgleichen der Region mit den Scroll-Bereichen!!!
- //Wenn eines der Scroll-Rechtecke ungueltig wird, so muss
- //der PaintMode wahrscheinlich auf PAINT_BACKGROUND umgeschaltet
- //werden.
-
- //Auf die Richtung kommt es an:
- //- Bei einem pos. Ofst muss von hinten nach vorn gescrollt werden.
- //- Bei einem neg. Ofst muss von vorn nach hinten gescrollt werden.
- BOOL bPositive = (*pScrollRects)[0]->GetOffs() > 0;
- if( (*pScrollRects)[0]->IsVertical() )
- bPositive = !bPositive;
- int i = bPositive ? pScrollRects->Count()-1 : 0;
-
- for ( ; bPositive ?
- i >= 0 :
- i < (int)pScrollRects->Count();
- bPositive ?
- --i :
- ++i )
- {
- const SwScrollArea &rScroll = *(*pScrollRects)[ sal::static_int_cast<USHORT>(i) ];
- if( rScroll.Count() )
- {
- int j = bPositive ? rScroll.Count()-1 : 0;
- for ( ; bPositive ? j >= 0 : j < (int)rScroll.Count();
- bPositive ? --j : ++j )
- {
- const SwStripes& rStripes = *rScroll[ sal::static_int_cast<USHORT>(j) ];
- if( rScroll.IsVertical() )
- {
- Rectangle aRectangle( rStripes.GetY() -
- rStripes.GetHeight() + rScroll.GetOffs(),
- rStripes.GetMin(),
- rStripes.GetY() + rScroll.GetOffs(),
- rStripes.GetMax() );
- // OD 18.02.2003 #107562# - align rectangle for scrolling
- SwRect aAlignedScrollRect( aRectangle );
- ::SwAlignRect( aAlignedScrollRect, this );
-
- // #i68597# when scrolling, let DrawingLayer know about refreshed areas,
- // even when no DL objects are in the area. This is needed to allow
- // fully buffered overlay.
- const Rectangle aSourceRect(aAlignedScrollRect.SVRect());
- const Rectangle aTargetRect(
- aSourceRect.Left() - rScroll.GetOffs(), aSourceRect.Top(),
- aSourceRect.Right() - rScroll.GetOffs(), aSourceRect.Bottom());
-
- if(GetWin())
- {
- // SCROLL_NOWINDOWINVALIDATE okay since AddPaintRect below adds the to-be-invalidated region
- GetWin()->Scroll( -rScroll.GetOffs(), 0, aSourceRect, SCROLL_CHILDREN | SCROLL_NOWINDOWINVALIDATE );
- }
-
- // #i68597# if buffered overlay, the buffered content needs to be scrolled directly
- {
- SdrPaintWindow* pPaintWindow = GetDrawView()->GetPaintWindow(0);
-
- if(pPaintWindow)
- {
- sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager();
-
- if(pOverlayManager)
- {
- pOverlayManager->copyArea(aTargetRect.TopLeft(), aSourceRect.TopLeft(), aSourceRect.GetSize());
- }
- }
- }
-
- SwRect aRect( aRectangle );
- Imp()->ScrolledRect( aRect, -rScroll.GetOffs() );
- if ( bPositive )
- aRect.Right( aRect.Left() + rScroll.GetOffs()-1 );
- else
- aRect.Left( aRect.Right() - rScroll.GetOffs() );
- Imp()->AddPaintRect( aRect );
- }
- else
- {
- Rectangle aRectangle( rStripes.GetMin(),
- rStripes.GetY() - rScroll.GetOffs(),
- rStripes.GetRight(),
- rStripes.GetBottom() - rScroll.GetOffs() );
- // OD 18.02.2003 #107562# - use aligned rectangle for scrolling
- SwRect aAlignedScrollRect( aRectangle );
- ::SwAlignRect( aAlignedScrollRect, this );
-
- // #i68597# when scrolling, let DrawingLayer know about refreshed areas,
- // even when no DL objects are in the area. This is needed to allow
- // fully buffered overlay.
- const Rectangle aSourceRect(aAlignedScrollRect.SVRect());
- const Rectangle aTargetRect(
- aSourceRect.Left(), aSourceRect.Top() + rScroll.GetOffs(),
- aSourceRect.Right(), aSourceRect.Bottom() + rScroll.GetOffs());
-
- if(GetWin())
- {
- // SCROLL_NOWINDOWINVALIDATE okay since AddPaintRect below adds the to-be-invalidated region
- GetWin()->Scroll( 0, rScroll.GetOffs(), aSourceRect, SCROLL_CHILDREN | SCROLL_NOWINDOWINVALIDATE );
- }
-
- // #i68597# if buffered overlay, the buffered content needs to be scrolled directly
- {
- SdrPaintWindow* pPaintWindow = GetDrawView()->GetPaintWindow(0);
-
- if(pPaintWindow)
- {
- sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager();
-
- if(pOverlayManager)
- {
- pOverlayManager->copyArea(aTargetRect.TopLeft(), aSourceRect.TopLeft(), aSourceRect.GetSize());
- }
- }
- }
-
- SwRect aRect( aRectangle );
- Imp()->ScrolledRect( aRect, rScroll.GetOffs() );
- if ( bPositive )
- aRect.Bottom( aRect.Top() + rScroll.GetOffs()-1 );
- else
- aRect.Top( aRect.Bottom() + rScroll.GetOffs() );
- Imp()->AddPaintRect( aRect );
- }
- }
- }
- }
- if ( !Imp()->IsScrolled() )
- Imp()->SetScrolled();
-
- Imp()->MoveScrollArea();
- bPaintWorks = TRUE;
- }
-}
-
-/******************************************************************************
-|*
-|* ViewShell::SetNoNextScroll()
-|*
-|* Ersterstellung MA 08. Mar. 94
-|* Letzte Aenderung MA 08. Mar. 94
-|*
-******************************************************************************/
-
-void ViewShell::SetNoNextScroll()
-{
- ViewShell *pSh = this;
- do
- { pSh->Imp()->ResetNextScroll();
- pSh = (ViewShell*)pSh->GetNext();
-
- } while ( pSh != this );
-}
-
-/******************************************************************************
-|*
-|* SwViewImp::AddScrollRect()
-|*
-|* Ersterstellung MA 07. Mar. 94
-|* Last change AMA 21. July 00
-|*
-|* Adds a scrollable rectangle and his critical lines to the list.
-|*
-******************************************************************************/
-
-void SwViewImp::AddScrollRect( const SwFrm *pFrm, const SwRect &rRect,
- long nOffs )
-{
- ASSERT( nOffs != 0, "Scrollen ohne Ofst." );
- SwRect aRect( rRect );
- BOOL bVert = pFrm->IsVertical();
- if( bVert )
- aRect.Pos().X() += nOffs;
- else
- aRect.Pos().Y() -= nOffs;
- if( aRect.IsOver( pSh->VisArea() ) )
- {
- ASSERT( pSh->GetWin(), "Scrolling without outputdevice" );
- aRect._Intersection( pSh->VisArea() );
- SwStripes *pStr;
- if ( !pScrollRects )
- pScrollRects = new SwScrollAreas;
- if( bVert )
- {
- aRect.Pos().X() -= nOffs;
- pStr = new SwStripes( aRect.Right(), aRect.Width(),
- aRect.Top(), aRect.Bottom() );
- if( pFrm->IsTxtFrm() )
- ((SwTxtFrm*)pFrm)->CriticalLines(*pSh->GetWin(), *pStr, nOffs );
- else
- pStr->Insert( SwStripe( aRect.Right(), aRect.Width() ), 0 );
- pScrollRects->InsertCol( SwScrollColumn( pFrm->Frm().Top(),
- pFrm->Frm().Height(), nOffs, bVert ), pStr);
- }
- else
- {
- aRect.Pos().Y() += nOffs;
- pStr = new SwStripes( aRect.Top(), aRect.Height(),
- aRect.Left(), aRect.Right() );
- if( pFrm->IsTxtFrm() )
- ((SwTxtFrm*)pFrm)->CriticalLines(*pSh->GetWin(), *pStr, nOffs );
- else
- pStr->Insert( SwStripe( aRect.Top(), aRect.Height() ), 0 );
- pScrollRects->InsertCol( SwScrollColumn( pFrm->Frm().Left(),
- pFrm->Frm().Width(), nOffs, bVert ), pStr );
- }
- }
- else
- AddPaintRect( rRect );
-}
-
-/******************************************************************************
-|*
-|* SwViewImp::MoveScrollArea()
-|*
-|* Creation AMA 10. July 00
-|* Last change AMA 21. July 00
-|*
-|* Transfers the areas after scrolling to the scrolled list, but only those
-|* parts with critical lines.
-|*
-******************************************************************************/
-
-void SwViewImp::MoveScrollArea()
-{
- if( !pScrolledArea )
- pScrolledArea = new SwScrollAreas;
- for( USHORT nIdx = 0; nIdx < pScrollRects->Count(); ++nIdx )
- {
- SwScrollArea *pScr = (*pScrollRects)[ nIdx ];
- if( pScr->Compress() )
- delete pScr;
- else
- {
- USHORT nIndx;
- if( pScrolledArea->Seek_Entry( pScr, &nIndx ) )
- pScrolledArea->GetObject(nIndx)->Add( pScr );
- else
- pScrolledArea->Insert( pScr );
- }
- }
- delete pScrollRects;
- pScrollRects = NULL;
-}
-
-/******************************************************************************
-|*
-|* SwViewImp::FlushScrolledArea()
-|*
-|* Creation AMA 10. July 00
-|* Last change AMA 21. July 00
-|*
-|* Flushes the scrolled critical lines, that is transfer them to AddPaintRect()
-|* and remove them from the list.
-|*
-******************************************************************************/
-
-void SwViewImp::FlushScrolledArea()
-{
- USHORT nCount = pScrolledArea->Count();
- while( nCount )
- {
- SwScrollArea* pScroll = (*pScrolledArea)[--nCount];
- USHORT nCnt = pScroll->Count();
- while( nCnt )
- {
- SwStripes* pStripes = (*pScroll)[--nCnt];
- if( pScroll->IsVertical() )
- {
- SwRect aRect( 0, pStripes->GetMin(), 0, pStripes->GetWidth() );
- for( USHORT i = 0; i < pStripes->Count(); ++i )
- {
- long nWidth = (*pStripes)[i].GetHeight();
- aRect.Left( (*pStripes)[i].GetY() - nWidth + 1 );
- aRect.Width( nWidth );
- AddPaintRect( aRect );
- }
- }
- {
- SwRect aRect( pStripes->GetMin(), 0, pStripes->GetWidth(), 0 );
- for( USHORT i = 0; i < pStripes->Count(); ++i )
- {
- aRect.Top( (*pStripes)[i].GetY() );
- aRect.Height( (*pStripes)[i].GetHeight() );
- AddPaintRect( aRect );
- }
- }
- pScroll->Remove( nCnt );
- delete pStripes;
- }
- pScrolledArea->Remove( nCount );
- delete pScroll;
- }
- delete pScrolledArea;
- pScrolledArea = NULL;
-}
-
-/******************************************************************************
-|*
-|* SwViewImp::_FlushScrolledArea(..)
-|*
-|* Creation AMA 10. July 00
-|* Last change AMA 21. July 00
-|*
-|* The critical lines, which overlaps with the given rectangle, will be united
-|* with the rectangle and removed from the list.
-|*
-******************************************************************************/
-
-BOOL SwViewImp::_FlushScrolledArea( SwRect& rRect )
-{
- BOOL bRet = FALSE;
- for( USHORT i = pScrolledArea->Count(); i; )
- {
- SwScrollArea* pScroll = (*pScrolledArea)[--i];
- for( USHORT j = pScroll->Count(); j; )
- {
- SwStripes* pStripes = (*pScroll)[--j];
- if( pStripes->Count() )
- {
- if( pScroll->IsVertical() )
- {
- SwRect aRect( pStripes->GetY() - pStripes->GetHeight(),
- pStripes->GetMin(), pStripes->GetHeight(),
- pStripes->GetWidth() );
- if( rRect.IsOver( aRect ) )
- {
- for( USHORT nI = pStripes->Count(); nI; )
- {
- long nWidth = (*pStripes)[--nI].GetHeight();
- aRect.Left( (*pStripes)[nI].GetY() - nWidth + 1 );
- aRect.Width( nWidth );
- if( rRect.IsOver( aRect ) )
- {
- rRect.Union( aRect );
- bRet = TRUE;
- pStripes->Remove( nI );
- nI = pStripes->Count();
- }
- }
- }
- }
- else
- {
- SwRect aRect( pStripes->GetMin(), pStripes->GetY(),
- pStripes->GetWidth(), pStripes->GetHeight() );
- if( rRect.IsOver( aRect ) )
- {
- for( USHORT nI = pStripes->Count(); nI; )
- {
- aRect.Top( (*pStripes)[--nI].GetY() );
- aRect.Height( (*pStripes)[nI].GetHeight() );
- if( rRect.IsOver( aRect ) )
- {
- rRect.Union( aRect );
- bRet = TRUE;
- pStripes->Remove( nI );
- nI = pStripes->Count();
- }
- }
- }
- }
- }
- if( !pStripes->Count() )
- {
- pScroll->Remove( j );
- delete pStripes;
- }
- }
- if( !pScroll->Count() )
- {
- pScrolledArea->Remove( pScroll );
- delete pScroll;
- }
- }
- if( !pScrolledArea->Count() )
- {
- DELETEZ( pScrolledArea );
- SetNextScroll();
- }
- return bRet;
-}
-
-/******************************************************************************
-|*
-|* SwViewImp::RefreshScrolledHdl(..)
-|*
-|* Creation MA 06. Oct. 94
-|* Last change AMA 21. July 00
-|*
-|* Every timerstop one of the critical lines will be painted.
-|*
-******************************************************************************/
-
-IMPL_LINK( SwViewImp, RefreshScrolledHdl, Timer *, EMPTYARG )
-{
- DBG_PROFSTART( RefreshTimer );
-
- if ( !IsScrolled() )
- { DBG_PROFSTOP( RefreshTimer );
- return 0;
- }
-
- SET_CURR_SHELL( GetShell() );
-
- //Kein Refresh wenn eine Selektion besteht.
- if ( GetShell()->IsA( TYPE(SwCrsrShell) ) &&
- (((SwCrsrShell*)GetShell())->HasSelection() ||
- ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1))
- {
- DBG_PROFSTOP( RefreshTimer );
- return 0;
- }
-
- if( pScrolledArea )
- {
- const SwRect aRect( GetShell()->VisArea() );
- BOOL bNoRefresh = GetShell()->IsA( TYPE(SwCrsrShell) ) &&
- ( ((SwCrsrShell*)GetShell())->HasSelection() ||
- ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1 );
- if( pScrolledArea->Count() )
- {
- SwScrollArea* pScroll = pScrolledArea->GetObject(0);
- ASSERT( pScroll->Count(), "Empty scrollarea" );
- // OD 21.10.2003 #112616# - for savety reason:
- // react, if precondition named in assertion isn't hold
- if ( pScroll->Count() )
- {
- SwStripes* pStripes = pScroll->GetObject(0);
- // OD 20.10.2003 #112616# - consider also first stripe
- ASSERT( pStripes->Count(), "Empty scrollstripes" );
- // OD 21.10.2003 #112616# - for savety reason:
- // react, if precondition named in assertion isn't hold
- if ( pStripes->Count() )
- {
- const SwStripe &rStripe = pStripes->GetObject(0);
- SwRect aTmpRect = pScroll->IsVertical() ?
- SwRect( rStripe.GetY() - rStripe.GetHeight(), pScroll->GetX(),
- rStripe.GetHeight(), pScroll->GetWidth() ) :
- SwRect( pScroll->GetX(), rStripe.GetY(),
- pScroll->GetWidth(), rStripe.GetHeight() );
- if( aTmpRect.IsOver( aRect ) )
- {
- // SwSaveHdl aSaveHdl( this );
- if( !bNoRefresh )
- _RefreshScrolledArea( aTmpRect );
- }
- // OD 20.10.2003 #112616# - consider also first stripe
- pStripes->Remove( 0 );
- }
- if( pStripes->Count() < 1 )
- {
- pScroll->Remove( USHORT(0) );
- delete pStripes;
- }
- }
- if( !pScroll->Count() )
- {
- pScrolledArea->Remove( pScroll );
- delete pScroll;
- }
- }
- if( !pScrolledArea->Count() )
- {
- delete pScrolledArea;
- pScrolledArea = 0;
- }
- }
-
- //All done?
- if( !pScrolledArea || !pScrolledArea->Count()
- )
- {
- ResetScrolled();
- SetNextScroll();
- aScrollTimer.Stop();
- }
-
- DBG_PROFSTOP( RefreshTimer );
- return 0;
-}
-
-/******************************************************************************
-|*
-|* SwViewImp::_ScrolledRect(..)
-|*
-|* Creation AMA 20. July 00
-|* Last change AMA 21. July 00
-|*
-|* handles the problem of scrolled criticals lines, when they are a part of
-|* a scrolling area again. In this case, their rectangle has to move to the
-|* right position.
-|*
-******************************************************************************/
-
-void SwViewImp::_ScrolledRect( const SwRect& rRect, long nOffs )
-{
- for( USHORT i = pScrolledArea->Count(); i; )
- {
- SwScrollArea* pScroll = (*pScrolledArea)[--i];
- ASSERT( pScroll->Count() == 1, "Missing scrollarea compression 1" );
- SwStripes* pStripes = (*pScroll)[0];
- if( pStripes->Count() )
- {
- SwRect aRect = pScroll->IsVertical() ?
- SwRect( pStripes->GetY() - pStripes->GetHeight(),
- pStripes->GetMin(), pStripes->GetHeight(),
- pStripes->GetWidth() ) :
- SwRect( pStripes->GetMin(), pStripes->GetY(),
- pStripes->GetWidth(), pStripes->GetHeight() );
-
- if( rRect.IsOver( aRect ) )
- {
- BOOL bRecalc = FALSE;
- for( USHORT nI = pStripes->Count(); nI; )
- {
- if( pScroll->IsVertical() )
- {
- long nWidth = (*pStripes)[--nI].GetHeight();
- aRect.Left( (*pStripes)[nI].GetY() - nWidth + 1 );
- aRect.Width( nWidth );
- }
- else
- {
- aRect.Top( (*pStripes)[--nI].GetY() );
- aRect.Height( (*pStripes)[nI].GetHeight() );
- }
- if( rRect.IsInside( aRect ) )
- {
- (*pStripes)[nI].Y() += nOffs;
- bRecalc = TRUE;
- }
- }
- if( bRecalc )
- pStripes->Recalc( pScroll->IsVertical() );
- }
- }
- }
-}
-
-/******************************************************************************
-|*
-|* SwViewImp::_RefreshScrolledArea()
-|*
-******************************************************************************/
-
-//Berechnen der Hoehe fuer das virtuelle Device, Breite und maximaler
-//Speicherbedarf sind vorgegeben.
-#define MAXKB 180L
-
-static void lcl_CalcVirtHeight( OutputDevice *pOut, Size &rSz )
-{
- char nBytes;
- const ULONG nColorCount = pOut->GetColorCount();
- if( 256 >= nColorCount ) // 2^8
- nBytes = 1;
- else
- if( USHRT_MAX >= nColorCount ) // 2^16
- nBytes = 2;
- else
- if( 16777216 >= nColorCount ) // 2^24
- nBytes = 3;
- else
- nBytes = 4; // 2^n
-
- rSz = pOut->LogicToPixel( rSz );
-
- long nKB = MAXKB * 1000;
- nKB /= nBytes;
- if ( rSz.Width() > 0 )
- rSz.Height() = nKB / rSz.Width();
- else
- rSz.Height() = nKB;
-
- rSz = pOut->PixelToLogic( rSz );
-}
-
-void SwViewImp::_RefreshScrolledArea( const SwRect &rRect )
-{
- SwRect aScRect( rRect );
- aScRect.Intersection( GetShell()->VisArea() );
-
- if( aScRect.IsEmpty() )
- return;
-
- BOOL bShowCrsr = FALSE;
- Window *pWin = GetShell()->GetWin();
- if ( pWin && pWin->GetCursor() && pWin->GetCursor()->IsVisible() )
- {
- bShowCrsr = TRUE;
- pWin->GetCursor()->Hide();
- }
-
- //Virtuelles Device erzeugen und einstellen.
- // --> OD 2007-08-16 #i80720#
- // rename variable <pOld> to <pCurrentOut>
- OutputDevice* pCurrentOut = GetShell()->GetOut();
- VirtualDevice *pVout = new VirtualDevice( *pCurrentOut );
- MapMode aMapMode( pCurrentOut->GetMapMode() );
- pVout->SetMapMode( aMapMode );
- Size aSize( aScRect.Width(), 0 );
- lcl_CalcVirtHeight( pCurrentOut, aSize );
- if ( aSize.Height() > aScRect.Height() )
- aSize.Height() = aScRect.Height() + 50;
-
- //unten in der Schleife lassen wir die Rechtecke ein wenig ueberlappen,
- //das muss auch bei der Groesse beruecksichtigt werden.
- aSize = pCurrentOut->LogicToPixel( aSize );
- aSize.Width() += 4; aSize.Height() += 4;
- aSize = pCurrentOut->PixelToLogic( aSize );
- // <--
-
- const SwRootFrm* pLayout = GetShell()->GetLayout();
-
- // #i75172# Avoid VDev if PreRendering is active
- static bool bDoNotUseVDev(GetDrawView()->IsBufferedOutputAllowed());
-
- // --> OD 2007-08-16 #i80720#
- // Enlarge paint rectangle also in case that "own" virtual device <pVout>
- // isn't used. Refactor code a little bit to achieve this.
- const bool bApplyVDev = !bDoNotUseVDev && pVout->SetOutputSize( aSize );
-
- {
- if ( bApplyVDev )
- {
- // --> OD 2007-08-16 #i80720#
- // rename variable <pOld> to <pCurrentOut>
- pVout->SetLineColor( pCurrentOut->GetLineColor() );
- pVout->SetFillColor( pCurrentOut->GetFillColor() );
- // <--
- }
-
- // #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev
- const Region aRepaintRegion(aScRect.SVRect());
- GetShell()->DLPrePaint2(aRepaintRegion);
-
- //Virtuelles Device in die ViewShell 'selektieren'
- // --> OD 2007-08-16 #i80720#
- // remember current output device at this place
- OutputDevice* pOldOut = GetShell()->GetOut();
- // <--
- if ( bApplyVDev )
- {
- GetShell()->pOut = pVout;
- }
-
- const SwFrm *pPg = GetFirstVisPage();
- do
- {
- SwRect aRect( pPg->Frm() );
- if ( aRect.IsOver( aScRect ) )
- {
- aRect._Intersection( aScRect );
- do
- {
- Rectangle aTmp( aRect.SVRect() );
- long nTmp = aTmp.Top() + aSize.Height();
- if ( aTmp.Bottom() > nTmp )
- aTmp.Bottom() = nTmp;
-
- aTmp = pOldOut->LogicToPixel( aTmp );
- if( aRect.Top() > pPg->Frm().Top() )
- aTmp.Top() -= 2;
- if( aRect.Top() + aRect.Height() < pPg->Frm().Top()
- + pPg->Frm().Height() )
- aTmp.Bottom() += 2;
- if( aRect.Left() > pPg->Frm().Left() )
- aTmp.Left() -= 2;
- if( aRect.Left() + aRect.Width() < pPg->Frm().Left()
- + pPg->Frm().Width() )
- aTmp.Right() += 2;
- aTmp = pOldOut->PixelToLogic( aTmp );
- SwRect aTmp2( aTmp );
-
- if ( bApplyVDev )
- {
- // OD 12.11.2002 #96272# - use method to set mapping
- //Point aOrigin( aTmp2.Pos() );
- //aOrigin.X() = -aOrigin.X(); aOrigin.Y() = -aOrigin.Y();
- //aMapMode.SetOrigin( aOrigin );
- ::SetMappingForVirtDev( aTmp2.Pos(), &aMapMode, pOldOut, pVout );
- pVout->SetMapMode( aMapMode );
- }
-
- pLayout->Paint( aTmp2 );
- if ( bApplyVDev )
- {
- pOldOut->DrawOutDev( aTmp2.Pos(), aTmp2.SSize(),
- aTmp2.Pos(), aTmp2.SSize(), *pVout );
- }
-
- aRect.Top( aRect.Top() + aSize.Height() );
- aScRect.Top( aRect.Top() );
-
- } while ( aRect.Height() > 0 );
- }
- pPg = pPg->GetNext();
-
- } while ( pPg && pPg->Frm().IsOver( GetShell()->VisArea() ) );
-
- if ( bApplyVDev )
- {
- GetShell()->pOut = pOldOut;
- }
- delete pVout;
-
- // #i72754# end Pre/PostPaint encapsulation when pOut is back and content is painted
- GetShell()->DLPostPaint2(true);
- }
- // <--
-
- if ( bShowCrsr )
- pWin->GetCursor()->Show();
-}
-
-/******************************************************************************
-|*
-|* SwViewImp::RefreshScrolledArea()
-|*
-|* Ersterstellung MA 06. Oct. 94
-|* Letzte Aenderung MA 19. Apr. 95
-|*
-******************************************************************************/
-
-void SwViewImp::RefreshScrolledArea( SwRect &rRect )
-{
- // --> OD 2007-07-24 #123003# - make code robust
- // avoid recursive call
- static bool bRunning( false );
-
- if ( bRunning )
- {
- ASSERT( false, "<SwViewImp::RefreshScrolledArea(..)> - recursive method call - please inform OD" );
- return;
- }
- // <--
-
- //1. Wird auch von der CrsrShell gerufen, um ggf. den Bereich, in den der
- //Crsr gesetzt wird (Absatz, ganze Zeile bei einer Tabelle) aufzufrischen.
- //Allerdings kann es dann natuerlich sein, dass das Rechteck ueberhaupt
- //nicht mit aufzufrischenden Bereichen ueberlappt.
- //2. Kein Refresh wenn eine Selektion besteht.
- if( (GetShell()->IsA( TYPE(SwCrsrShell) ) &&
- (((SwCrsrShell*)GetShell())->HasSelection() ||
- ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1)))
- {
- return;
- }
-
- // --> OD 2007-07-27 #123003#
- bRunning = true;
- // <--
-
- if( pScrolledArea && pScrolledArea->Count() &&
- !( ( GetShell()->IsA( TYPE(SwCrsrShell) ) &&
- ( ((SwCrsrShell*)GetShell())->HasSelection() ||
- ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1) ) ) )
- {
- for( USHORT i = pScrolledArea->Count(); i; )
- {
- SwScrollArea* pScroll = (*pScrolledArea)[--i];
- for( USHORT j = pScroll->Count(); j; )
- {
- SwStripes* pStripes = (*pScroll)[--j];
- if( pStripes->Count() )
- {
- SwRect aRect = pScroll->IsVertical() ?
- SwRect( pStripes->GetY() - pStripes->GetHeight(),
- pStripes->GetMin(), pStripes->GetHeight(),
- pStripes->GetWidth() ) :
- SwRect( pStripes->GetMin(), pStripes->GetY(),
- pStripes->GetWidth(), pStripes->GetHeight() );
- if( rRect.IsOver( aRect ) )
- {
- for( USHORT nI = pStripes->Count(); nI; )
- {
- if( pScroll->IsVertical() )
- {
- long nWidth = (*pStripes)[--nI].GetHeight();
- aRect.Left( (*pStripes)[nI].GetY() -nWidth +1 );
- aRect.Width( nWidth );
- }
- else
- {
- aRect.Top( (*pStripes)[--nI].GetY() );
- aRect.Height( (*pStripes)[nI].GetHeight() );
- }
- if( rRect.IsOver( aRect ) )
- {
- pStripes->Remove( nI );
- _RefreshScrolledArea( aRect );
- }
- }
- }
- }
- if( !pStripes->Count() )
- {
- pScroll->Remove( j );
- delete pStripes;
- }
- }
- if( !pScroll->Count() )
- {
- pScrolledArea->Remove( pScroll );
- delete pScroll;
- }
- //Ist da jemand ungeduldig?
- //Nur Mouse und Keyboard, weil wir sonst von jeder billigen
- //Uhr unterbrochen werden.
- if( GetpApp()->AnyInput( INPUT_MOUSEANDKEYBOARD ) )
- break;
- }
- }
-
- //All done?
- if( !pScrolledArea || !pScrolledArea->Count() )
- {
- ResetScrolled();
- SetNextScroll();
- aScrollTimer.Stop();
- }
-
- // --> OD 2007-07-24 #123003#
- bRunning = false;
- // <--
-}
-
-SwStripes& SwStripes::Plus( const SwStripes& rOther, BOOL bVert )
-{
- if( !Count() )
- {
- Insert( &rOther, 0 );
- SetMin( rOther.GetMin() );
- SetMax( rOther.GetMax() );
- return *this;
- }
-
- long nCnt = rOther.Count();
- if( nCnt )
- {
- ChkMin( rOther.GetMin() );
- ChkMax( rOther.GetMax() );
- USHORT nStart = 0;
- if( bVert )
- for( USHORT nIdx = 0; nIdx < nCnt; ++nIdx )
- {
- const SwStripe& rAdd = rOther[ nIdx ];
- long nBottom = rAdd.GetY() - rAdd.GetHeight();
- USHORT nCount = Count();
- USHORT nTmpY = nStart;
- while( nTmpY < nCount )
- {
- SwStripe& rChk = GetObject( nTmpY );
- if( rChk.GetY() - rChk.GetHeight() < rAdd.GetY() )
- break;
- else
- ++nTmpY;
- }
- USHORT nB = nTmpY;
- while( nB < nCount )
- {
- const SwStripe& rChk = GetObject( nB );
- if( rChk.GetY() <= nBottom )
- break;
- else
- ++nB;
- }
- nStart = nTmpY;
- if( nTmpY == nB )
- Insert( rAdd, nTmpY );
- else
- {
- long nChkBottom = rAdd.GetY() - rAdd.GetHeight();;
- const SwStripe& rChkB = GetObject( nB - 1 );
- long nTmp = rChkB.GetY() - rChkB.GetHeight();
- if( nTmp < nChkBottom )
- nChkBottom = nTmp;
- SwStripe& rChk = GetObject( nTmpY );
- if( rAdd.GetY() > rChk.GetY() )
- rChk.Y() = rAdd.GetY();
- rChk.Height() = rChk.GetY() - nChkBottom;
- nChkBottom = nB - nTmpY - 1;
- if( nChkBottom )
- Remove( nTmpY + 1, (USHORT)nChkBottom );
- }
- }
- else
- {
- for( USHORT nIdx = 0; nIdx < nCnt; ++nIdx )
- {
- const SwStripe& rAdd = rOther[ nIdx ];
- long nBottom = rAdd.GetY() + rAdd.GetHeight();
- USHORT nCount = Count();
- USHORT nTmpY = nStart;
- while( nTmpY < nCount )
- {
- SwStripe& rChk = GetObject( nTmpY );
- if( rChk.GetY() + rChk.GetHeight() > rAdd.GetY() )
- break;
- else
- ++nTmpY;
- }
- USHORT nB = nTmpY;
- while( nB < nCount )
- {
- const SwStripe& rChk = GetObject( nB );
- if( rChk.GetY() >= nBottom )
- break;
- else
- ++nB;
- }
- nStart = nTmpY;
- if( nTmpY == nB )
- Insert( rAdd, nTmpY );
- else
- {
- long nChkBottom = rAdd.GetY() + rAdd.GetHeight();;
- const SwStripe& rChkB = GetObject( nB - 1 );
- long nTmp = rChkB.GetY() + rChkB.GetHeight();
- if( nTmp > nChkBottom )
- nChkBottom = nTmp;
- SwStripe& rChk = GetObject( nTmpY );
- if( rAdd.GetY() < rChk.GetY() )
- rChk.Y() = rAdd.GetY();
- rChk.Height() = nChkBottom - rChk.GetY();
- nChkBottom = nB - nTmpY - 1;
- if( nChkBottom )
- Remove( nTmpY + 1, (USHORT)nChkBottom );
- }
- }
- }
- }
- return *this;
-}
-
-BOOL SwStripes::Recalc( BOOL bVert )
-{
- if( !Count() )
- return TRUE;
- Y() = GetObject(0).GetY();
- if( bVert )
- {
- long nTmpMin = GetObject(0).GetY() - GetObject(0).Height();
- for( USHORT nIdx = 1; nIdx < Count(); )
- {
- const SwStripe& rStr = GetObject(nIdx++);
- if( GetY() < rStr.GetY() )
- Y() = rStr.GetY();
- if( nTmpMin > rStr.GetY() - rStr.GetHeight() )
- nTmpMin = rStr.GetY() - rStr.GetHeight();
- }
- Height() = GetY() - nTmpMin;
- }
- else
- {
- long nTmpMax = GetObject(0).GetY() + GetObject(0).Height();
- for( USHORT nIdx = 1; nIdx < Count(); )
- {
- const SwStripe& rStr = GetObject(nIdx++);
- if( GetY() > rStr.GetY() )
- Y() = rStr.GetY();
- if( nTmpMax < rStr.GetY() + rStr.GetHeight() )
- nTmpMax = rStr.GetY() + rStr.GetHeight();
- }
- Height() = nTmpMax - GetY();
- }
- return FALSE;
-}
-
-BOOL SwScrollArea::Compress()
-{
- if( !Count() )
- return TRUE;
- for( USHORT nIdx = Count() - 1; nIdx > 0; --nIdx )
- {
- GetObject(0)->Plus( *GetObject(nIdx), IsVertical() );
- delete GetObject( nIdx );
- Remove( nIdx, 1 );
- }
- ClrOffs();
- return GetObject(0)->Recalc( IsVertical() );
-}
-
-void SwScrollArea::Add( SwScrollArea *pScroll )
-{
- ASSERT( pScroll->Count() == 1, "Missing scrollarea compression 2" );
- ASSERT( Count() == 1, "Missing scrollarea compression 3" );
- GetObject(0)->Plus( *pScroll->GetObject(0), IsVertical() );
- GetObject(0)->Recalc( IsVertical() );
- delete pScroll->GetObject( 0 );
- pScroll->Remove( (USHORT)0, 1 );
- delete pScroll;
-}
-
-/******************************************************************************
-|*
-|* SwScrollAreas::Insert(..)
-|*
-******************************************************************************/
-
-void SwScrollAreas::InsertCol( const SwScrollColumn &rCol,
- SwStripes *pStripes )
-{
- SwScrollArea *pTmp = new SwScrollArea( rCol, pStripes );
- USHORT nIdx;
- if( Seek_Entry( pTmp, &nIdx ) )
- {
- GetObject( nIdx )->SmartInsert( pStripes );
- delete pTmp;
- }
- else
- Insert( pTmp );
-}
-
-
-void SwScrollArea::SmartInsert( SwStripes* pStripes )
-{
- ASSERT( pStripes, "Insert empty scrollstripe?" );
- BOOL bNotInserted = TRUE;
- if( IsVertical() )
- for( USHORT nIdx = 0; nIdx < Count() && bNotInserted; )
- {
- SwStripes* pTmp = GetObject( nIdx++ );
- if( pTmp->GetY() - pTmp->GetHeight() == pStripes->GetY() )
- {
- pTmp->Height() += pStripes->GetHeight();
- pTmp->ChkMin( pStripes->GetMin() );
- pTmp->ChkMax( pStripes->GetMax() );
- if( pStripes->Count() )
- pTmp->Insert( (SwStripeArr*)pStripes, pTmp->Count(), 0 );
- bNotInserted = FALSE;
- }
- else if( pTmp->GetY() == pStripes->GetY() - pStripes->GetHeight() )
- {
- pTmp->Height() += pStripes->GetHeight();
- pTmp->Y() = pStripes->GetY();
- pTmp->ChkMin( pStripes->GetMin() );
- pTmp->ChkMax( pStripes->GetMax() );
- if( pStripes->Count() )
- pTmp->Insert( (SwStripeArr*)pStripes, 0, 0 );
- bNotInserted = FALSE;
- }
- }
- else
- for( USHORT nIdx = 0; nIdx < Count() && bNotInserted; )
- {
- SwStripes* pTmp = GetObject( nIdx++ );
- if( pTmp->GetY() + pTmp->GetHeight() == pStripes->GetY() )
- {
- pTmp->Height() += pStripes->GetHeight();
- pTmp->ChkMin( pStripes->GetMin() );
- pTmp->ChkMax( pStripes->GetMax() );
- if( pStripes->Count() )
- pTmp->Insert( (SwStripeArr*)pStripes, pTmp->Count(), 0 );
- bNotInserted = FALSE;
- }
- else if( pTmp->GetY() == pStripes->GetY() + pStripes->GetHeight() )
- {
- pTmp->Height() += pStripes->GetHeight();
- pTmp->Y() = pStripes->GetY();
- pTmp->ChkMin( pStripes->GetMin() );
- pTmp->ChkMax( pStripes->GetMax() );
- if( pStripes->Count() )
- pTmp->Insert( (SwStripeArr*)pStripes, 0, 0 );
- bNotInserted = FALSE;
- }
- }
- if( !bNotInserted || !Insert( pStripes ) )
- delete pStripes;
-}
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 5eb6ba17a2..2045e4df3b 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -32,7 +32,6 @@
#include "precompiled_sw.hxx"
-#include "scrrect.hxx"
#include "crsrsh.hxx"
#include "rootfrm.hxx"
#include "pagefrm.hxx"
@@ -129,8 +128,6 @@ SwViewImp::SwViewImp( ViewShell *pParent ) :
pSdrPageView( 0 ),
pFirstVisPage( 0 ),
pRegion( 0 ),
- pScrollRects( 0 ),
- pScrolledArea( 0 ),
pLayAct( 0 ),
pIdleAct( 0 ),
pAccMap( 0 ),
@@ -141,13 +138,9 @@ SwViewImp::SwViewImp( ViewShell *pParent ) :
{
//bResetXorVisibility =
//HMHbShowHdlPaint =
- bResetHdlHiddenPaint = bScrolled =
- bPaintInScroll = bSmoothUpdate = bStopSmooth = bStopPrt = FALSE;
- bFirstPageInvalid = bScroll = bNextScroll = TRUE;
-
- aScrollTimer.SetTimeout( 1500 );
- aScrollTimer.SetTimeoutHdl( LINK( this, SwViewImp, RefreshScrolledHdl));
- aScrollTimer.Stop();
+ bResetHdlHiddenPaint =
+ bSmoothUpdate = bStopSmooth = bStopPrt = FALSE;
+ bFirstPageInvalid = TRUE;
}
/******************************************************************************
@@ -172,8 +165,7 @@ SwViewImp::~SwViewImp()
delete pDrawView;
- DelRegions();
- delete pScrolledArea;
+ DelRegion();
ASSERT( !pLayAct, "Have action for the rest of your life." );
ASSERT( !pIdleAct,"Be idle for the rest of your life." );
@@ -188,10 +180,9 @@ SwViewImp::~SwViewImp()
|*
******************************************************************************/
-void SwViewImp::DelRegions()
+void SwViewImp::DelRegion()
{
DELETEZ(pRegion);
- DELETEZ(pScrollRects);
}
/******************************************************************************
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 7d280ff1b6..7c5b44a00f 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -219,28 +219,18 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
Imp()->StartAction();
if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
- Imp()->DelRegions();
+ Imp()->DelRegion();
const BOOL bExtraData = ::IsExtraData( GetDoc() );
if ( !bIdleEnd )
{
- if ( Imp()->IsNextScroll() && !bExtraData )
- Imp()->SetScroll();
- else
- {
- if ( bExtraData )
- Imp()->bScroll = FALSE;
- Imp()->SetNextScroll();
- Imp()->ResetScroll();
- }
SwLayAction aAction( GetLayout(), Imp() );
aAction.SetComplete( FALSE );
if ( nLockPaint )
aAction.SetPaint( FALSE );
aAction.SetInputType( INPUT_KEYBOARD );
aAction.Action();
- Imp()->SetScroll();
}
if ( bIsShellForCheckViewLayout )
@@ -249,8 +239,9 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
//Wenn wir selbst keine Paints erzeugen, so warten wir auf das Paint
//vom System. Dann ist das Clipping korrekt gesetzt; Beispiel: verschieben
//eines DrawObjektes.
- if ( Imp()->GetRegion() || Imp()->GetScrollRects() ||
- aInvalidRect.HasArea() || bExtraData )
+ if ( Imp()->GetRegion() ||
+ aInvalidRect.HasArea() ||
+ bExtraData )
{
if ( !nLockPaint )
{
@@ -274,15 +265,10 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
// Mitte eine Selektion und mit einem anderen Cursor an linken
// rechten Rand springen. Ohne ShowCrsr verschwindet die
// Selektion
- BOOL bShowCrsr = (pRegion || Imp()->GetScrollRects()) &&
- IsA( TYPE(SwCrsrShell) );
+ BOOL bShowCrsr = pRegion && IsA( TYPE(SwCrsrShell) );
if( bShowCrsr )
((SwCrsrShell*)this)->HideCrsrs();
- Scroll();
- if ( bPaintsFromSystem && Imp()->pScrolledArea )
- Imp()->FlushScrolledArea();
-
if ( pRegion )
{
SwRootFrm* pLayout = GetLayout();
@@ -411,14 +397,14 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
delete pVout;
delete pRegion;
- Imp()->DelRegions();
+ Imp()->DelRegion();
}
if( bShowCrsr )
((SwCrsrShell*)this)->ShowCrsrs( TRUE );
}
else
{
- Imp()->DelRegions();
+ Imp()->DelRegion();
bPaintWorks = TRUE;
}
}
@@ -438,13 +424,6 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
UISizeNotify();
++nStartAction;
-#ifdef DBG_UTIL
- // test option 'No Scroll' suppresses the automatic repair of the scrolled area
- if ( !GetViewOptions()->IsTest8() )
-#endif
- if ( Imp()->IsScrolled() )
- Imp()->RestartScrollTimer();
-
if( Imp()->IsAccessible() )
Imp()->FireAccessibleEvents();
}
@@ -1199,12 +1178,10 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
//vom RootFrm::Paint erzeugt worden sein.
if ( !bInEndAction &&
Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea() )
- Imp()->DelRegions();
+ Imp()->DelRegion();
SET_CURR_SHELL( this );
- //SwSaveHdl aSaveHdl( Imp() );
-
bool bScrolled = false;
SwPostItMgr* pPostItMgr = GetPostItMgr();
@@ -1334,9 +1311,7 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
Imp()->GetDrawView()->VisAreaChanged( GetWin() );
Imp()->GetDrawView()->SetActualWin( GetWin() );
}
- Imp()->bPaintInScroll = TRUE;
GetWin()->Update();
- Imp()->bPaintInScroll = FALSE;
if ( !bScrolled && pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() )
pPostItMgr->CorrectPositions();
@@ -1836,9 +1811,8 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect )
//nicht ankommen.
//Ergo: Alles selbst machen (siehe ImplEndAction())
if ( Imp()->GetRegion() && Imp()->GetRegion()->GetOrigin() != VisArea())
- Imp()->DelRegions();
+ Imp()->DelRegion();
- Imp()->ResetScroll();
SwLayAction aAction( GetLayout(), Imp() );
aAction.SetComplete( FALSE );
// We increment the action counter to avoid a recursive call of actions
@@ -1864,7 +1838,7 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect )
}
if ( bStop )
{
- Imp()->DelRegions();
+ Imp()->DelRegion();
pRegion = 0;
}
}
@@ -1909,7 +1883,7 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect )
}
else
bRet = FALSE;
- Imp()->DelRegions();
+ Imp()->DelRegion();
}
else
bRet = FALSE;
@@ -1960,17 +1934,7 @@ void ViewShell::Paint(const Rectangle &rRect)
{
if( GetWin() && GetWin()->IsVisible() )
{
- //Wenn mit dem Paint ein Bereich betroffen ist, der vorher gescrolled
- //wurde, so wiederholen wir das Paint mit dem Gesamtbereich. Nur so
- //koennen wir sicherstellen, das (nicht mal kurzfristig) durch das Paint
- //keine Alignmentfehler sichtbar werden.
SwRect aRect( rRect );
- if ( Imp()->IsScrolled() && Imp()->FlushScrolledArea( aRect ) )
- {
- GetWin()->Invalidate( aRect.SVRect() );
- return;
- }
-
if ( bPaintInProgress ) //Schutz gegen doppelte Paints!
{
GetWin()->Invalidate( rRect );