From f013c8cb61251b156ce7d1a166875d39373344d6 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Mon, 28 Dec 2009 13:49:39 +0100 Subject: sw33bf02: #i105535# method - handle unexpected situation for to-frame anchored fly frames - Save determination of content node for to-frame anchored fly frame - If no fly frame for to-frame anchored fly frame is found, fallback to to-paragraph anchored fly frame. --- sw/source/core/layout/atrfrm.cxx | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'sw') diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 5560a5c07309..879710e88f09 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2718,10 +2718,23 @@ void SwFlyFrmFmt::MakeFrms() //die Suche vom StartNode zum FrameFormat sein. SwNodeIndex aIdx( aAnchorAttr.GetCntntAnchor()->nNode ); SwCntntNode *pCNd = GetDoc()->GetNodes().GoNext( &aIdx ); - SwClientIter aIter( *pCNd ); - if ( aIter.First( TYPE(SwFrm) ) ) - pModify = pCNd; - else + // --> OD 2009-12-28 #i105535# + if ( pCNd == 0 ) + { + pCNd = aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode(); + } + if ( pCNd ) + // <-- + { + SwClientIter aIter( *pCNd ); + if ( aIter.First( TYPE(SwFrm) ) ) + { + pModify = pCNd; + } + } + // --> OD 2009-12-28 #i105535# + if ( pModify == 0 ) + // <-- { const SwNodeIndex &rIdx = aAnchorAttr.GetCntntAnchor()->nNode; SwSpzFrmFmts& rFmts = *GetDoc()->GetSpzFrmFmts(); @@ -2793,7 +2806,24 @@ void SwFlyFrmFmt::MakeFrms() !((SwCntntFrm*)pFrm)->IsFollow(); if ( FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrm->IsFlyFrm() ) - pFrm = pFrm->FindFlyFrm(); + { + // --> OD 2009-12-28 #i105535# + // fallback to anchor type at-paragraph, if no fly frame is found. +// pFrm = pFrm->FindFlyFrm(); + SwFrm* pFlyFrm = pFrm->FindFlyFrm(); + if ( pFlyFrm ) + { + pFrm = pFlyFrm; + } + else + { + aAnchorAttr.SetType( FLY_AT_CNTNT ); + SetFmtAttr( aAnchorAttr ); + MakeFrms(); + return; + } + // <-- + } if( pFrm->GetDrawObjs() ) { -- cgit From 91928bce2b1cb1bdc9ed7ba31fa843bacb74fff3 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Mon, 28 Dec 2009 13:53:06 +0100 Subject: sw33bf02: #i105535# method - no update of anchor attribute for frame styles. --- sw/source/ui/app/docst.cxx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'sw') diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index 953ab1b8b8f7..e4ae8dddb012 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -1019,18 +1019,10 @@ USHORT SwDocShell::UpdateStyle(const String &rName, USHORT nFamily, SwWrtShell* pCurrWrtShell->StartAllAction(); pCurrWrtShell->GetFlyFrmAttr( aSet ); - // JP 10.06.98: nur automatische Orientierungen uebernehmen -/* #61359# jetzt auch wieder alle Orientierungen - * const SfxPoolItem* pItem; - if( SFX_ITEM_SET == aSet.GetItemState( RES_VERT_ORIENT, - FALSE, &pItem ) && - text::VertOrientation::NONE == ((SwFmtVertOrient*)pItem)->GetVertOrient()) - aSet.ClearItem( RES_VERT_ORIENT ); - - if( SFX_ITEM_SET == aSet.GetItemState( RES_HORI_ORIENT, - FALSE, &pItem ) && - text::HoriOrientation::NONE == ((SwFmtHoriOrient*)pItem)->GetHoriOrient()) - aSet.ClearItem( RES_HORI_ORIENT );*/ + // --> OD 2009-12-28 #i105535# + // no update of anchor attribute + aSet.ClearItem( RES_ANCHOR ); + // <-- pFrm->SetFmtAttr( aSet ); -- cgit From 14e83655b8655251aa30c96e9d33fd7c1b9ffa2e Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Mon, 28 Dec 2009 14:51:02 +0100 Subject: sw33bf02: #i104291# method - adjustments avoid overflow. --- sw/source/core/text/txtfrm.cxx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'sw') diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 7df571159c38..abeb06a579db 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -633,23 +633,34 @@ void SwTxtFrm::HideAndShowObjects() *************************************************************************/ xub_StrLen SwTxtFrm::FindBrk( const XubString &rTxt, - const xub_StrLen nStart, const xub_StrLen nEnd ) const + const xub_StrLen nStart, + const xub_StrLen nEnd ) const { - xub_StrLen nFound = nStart; + // --> OD 2009-12-28 #i104291# - applying patch to avoid overflow. + unsigned long nFound = nStart; const xub_StrLen nEndLine = Min( nEnd, rTxt.Len() ); // Wir ueberlesen erst alle Blanks am Anfang der Zeile (vgl. Bug 2235). - while( nFound <= nEndLine && ' ' == rTxt.GetChar( nFound ) ) - ++nFound; + while( nFound <= nEndLine && + ' ' == rTxt.GetChar( static_cast(nFound) ) ) + { + nFound++; + } // Eine knifflige Sache mit den TxtAttr-Dummy-Zeichen (hier "$"): // "Dr.$Meyer" am Anfang der zweiten Zeile. Dahinter ein Blank eingegeben // und das Wort rutscht nicht in die erste Zeile, obwohl es ginge. // Aus diesem Grund nehmen wir das Dummy-Zeichen noch mit. - while( nFound <= nEndLine && ' ' != rTxt.GetChar( nFound ) ) - ++nFound; + while( nFound <= nEndLine && + ' ' != rTxt.GetChar( static_cast(nFound) ) ) + { + nFound++; + } - return nFound; + return nFound <= STRING_LEN + ? static_cast(nFound) + : STRING_LEN; + // <-- } /************************************************************************* -- cgit From 8e731fdfd5706a2efebee757cfd453c8982ae7dc Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Tue, 29 Dec 2009 09:19:13 +0100 Subject: sw33bf02: #i104750 removal of "scrolling instead of painting optimization" --- sw/inc/viewsh.hxx | 7 - sw/source/core/crsr/crsrsh.cxx | 7 - sw/source/core/doc/notxtfrm.cxx | 67 +- sw/source/core/inc/layact.hxx | 6 - sw/source/core/inc/scrrect.hxx | 128 ---- sw/source/core/inc/txtfrm.hxx | 3 - sw/source/core/inc/viewimp.hxx | 63 +- sw/source/core/layout/layact.cxx | 485 +-------------- sw/source/core/layout/paintfrm.cxx | 2 +- sw/source/core/layout/tabfrm.cxx | 3 - sw/source/core/text/frmpaint.cxx | 68 -- sw/source/core/view/makefile.mk | 7 +- sw/source/core/view/scrrect.cxx | 1195 ------------------------------------ sw/source/core/view/viewimp.cxx | 19 +- sw/source/core/view/viewsh.cxx | 58 +- 15 files changed, 64 insertions(+), 2054 deletions(-) delete mode 100644 sw/source/core/inc/scrrect.hxx delete mode 100644 sw/source/core/view/scrrect.cxx (limited to 'sw') diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index f12b3ecbe9bc..33f8fcea94b3 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 3637cc19354d..3be6f84956fd 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -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 54139e06c340..d4ad970727a9 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() ); } } @@ -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 ad4c7730d07c..bf111e129de4 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 f5e987617c0b..000000000000 --- 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SCRRECT_HXX -#define _SCRRECT_HXX - -#include -#include "swrect.hxx" -#include - -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 79cd2a1a574c..4ce0b66b188d 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 eba323bd52a2..7fa7eab22871 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 18d03bb167d0..b187db871eb7 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -372,149 +372,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 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(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() @@ -541,8 +398,6 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) : bUpdateExpFlds = bBrowseActionStop = bActionInProgress = FALSE; // OD 14.04.2003 #106346# - init new flag . 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 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( pLow, nOfst, pPage, bResetOnly); - } - if ( !bResetOnly ) - pLow->Calc(); //#55435# Stabil halten. - pLow = pLow->GetNext(); - } -} - -// OD 2004-05-11 #i28701# - helper method for 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(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 - // 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# - // 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, " - 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# - 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(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 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 a52423e24bc1..44d5af0f84b2 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 61f08281e5f9..aff6ca369d46 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 05c142e1fd84..0f560d80dc98 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -62,7 +62,6 @@ #include // SwRedlineItr #include // SW_MOD #include // SwTabFrm (Redlining) -#include #include // --> 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 56cfb7d6ed26..86b8871f9641 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 f70bb1a52470..000000000000 --- 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" - - -#include -#include -#include -#include -#include // SwScrollRect, SwScrollRects -// OD 18.02.2003 #107562# - for -#include -#ifndef _CURSOR_HXX //autogen -#include -#endif -#include -#ifndef _APP_HXX //autogen -#include -#endif -#include -#include "crsrsh.hxx" -#include "rootfrm.hxx" -#include "pagefrm.hxx" - -// OD 12.11.2002 #96272# - include declaration for -#include "setmapvirtdev.hxx" -#include - -// #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 -#include - -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(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(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 to - 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 - // 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 to - 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, " - 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 7bb1aabe07c8..3e80e663f15e 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 cd80439877f6..bad21186ac42 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 ); -- cgit From d7d854b1c4f70f57f29261d6a942bdb29ebcee8c Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Tue, 29 Dec 2009 11:44:13 +0100 Subject: sw33bf02: #i105901# method - skip character cells for all script types --- sw/source/core/txtnode/fntcache.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'sw') diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 7aec6d4e9884..f99b745b9c14 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2420,21 +2420,18 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf ) sal_uInt16 nItrMode = i18n::CharacterIteratorMode::SKIPCELL; sal_Int32 nDone = 0; LanguageType aLang = LANGUAGE_NONE; - sal_Bool bSkipCell = sal_False; + bool bSkipCharacterCells = false; xub_StrLen nIdx = rInf.GetIdx(); xub_StrLen nLastIdx = nIdx; const xub_StrLen nEnd = rInf.GetIdx() + rInf.GetLen(); - // skip character cells for complex scripts - // --> OD 2009-10-14 #i105571# - skip also character cells for CJK - if ( rInf.GetFont() && - ( SW_CTL == rInf.GetFont()->GetActual() || - SW_CJK == rInf.GetFont()->GetActual() ) && - pBreakIt->GetBreakIter().is() ) + // --> OD 2009-12-29 #i105901# + // skip character cells for all script types + if ( pBreakIt->GetBreakIter().is() ) // <-- { aLang = rInf.GetFont()->GetLanguage(); - bSkipCell = sal_True; + bSkipCharacterCells = true; } while ( ( nRight < long( rInf.GetOfst() ) ) && ( nIdx < nEnd ) ) @@ -2445,7 +2442,7 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf ) // go to next character (cell). nLastIdx = nIdx; - if ( bSkipCell ) + if ( bSkipCharacterCells ) { nIdx = (xub_StrLen)pBreakIt->GetBreakIter()->nextCharacters( rInf.GetText(), nIdx, pBreakIt->GetLocale( aLang ), nItrMode, 1, nDone ); -- cgit From 5d57f18e6f0b14a1bf2c0f418a9cd6f64e06781b Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Wed, 30 Dec 2009 15:04:27 +0100 Subject: sw33bf02: #i89920# Improvement of selection of objects in background --- sw/source/core/draw/dflyobj.cxx | 5 +++ sw/source/core/frmedt/feshview.cxx | 86 +++++++++++++++++++++++++++----------- sw/source/core/inc/dflyobj.hxx | 1 + sw/source/ui/docvw/edtwin.cxx | 23 +++++----- 4 files changed, 80 insertions(+), 35 deletions(-) (limited to 'sw') diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 15ca46ca2456..c97c0a079745 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -566,6 +566,11 @@ const Rectangle& __EXPORT SwVirtFlyDrawObj::GetCurrentBoundRect() const return aOutRect; } +const Rectangle& __EXPORT SwVirtFlyDrawObj::GetLastBoundRect() const +{ + return GetCurrentBoundRect(); +} + void __EXPORT SwVirtFlyDrawObj::RecalcBoundRect() { diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index d465abc4403e..80e150248c75 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1185,9 +1185,7 @@ bool SwFEShell::IsObjSelectable( const Point& rPt ) } // #107513# -// Test if there is a draw object at that position and if it should be selected. -// The 'should' is aimed at Writer text fly frames which may be in front of -// the draw object. +// Test if there is a object at that position and if it should be selected. sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) { SET_CURR_SHELL(this); @@ -1204,39 +1202,79 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) bRet = pDrawView->PickObj(rPt, pDrawView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMARKABLE); pDrawView->SetHitTolerancePixel(nOld); - if(bRet && pObj) + if ( bRet && pObj ) { const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess(); - if( pObj->GetLayer() == pIDDMA->GetHellId() ) + // --> OD 2009-12-30 #i89920# + // Do not select object in background which is overlapping this text + // at the given position. + bool bObjInBackground( false ); { - const SwFrm *pPageFrm = GetLayout()->Lower(); - while( pPageFrm && !pPageFrm->Frm().IsInside( rPt ) ) + if ( pObj->GetLayer() == pIDDMA->GetHellId() ) { - if ( rPt.Y() < pPageFrm->Frm().Top() ) - pPageFrm = 0; - else - pPageFrm = pPageFrm->GetNext(); + const SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj ); + const SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt(); + const SwFmtSurround& rSurround = rFmt.GetSurround(); + if ( rSurround.GetSurround() == SURROUND_THROUGHT ) + { + bObjInBackground = true; + } } + } + if ( bObjInBackground ) + { + const SwPageFrm* pPageFrm = GetLayout()->GetPageAtPos( rPt ); if( pPageFrm ) { - SwRect aTmp( pPageFrm->Prt() ); - aTmp += pPageFrm->Frm().Pos(); - if( aTmp.IsInside( rPt ) ) - return sal_False; + const SwCntntFrm* pCntntFrm( pPageFrm->ContainsCntnt() ); + while ( pCntntFrm ) + { + if ( pCntntFrm->UnionFrm().IsInside( rPt ) ) + { + const SwTxtFrm* pTxtFrm = + dynamic_cast(pCntntFrm); + if ( pTxtFrm ) + { + SwPosition* pPos = + new SwPosition( *(pTxtFrm->GetTxtNode()) ); + Point aTmpPt( rPt ); + if ( pTxtFrm->GetKeyCrsrOfst( pPos, aTmpPt ) ) + { + SwRect aCharRect; + if ( pTxtFrm->GetCharRect( aCharRect, *pPos ) ) + { + if ( aCharRect.IsOver( SwRect( pObj->GetLastBoundRect() ) ) ) + { + bRet = sal_False; + } + } + } + } + else + { + bRet = sal_False; + } + break; + } + + pCntntFrm = pCntntFrm->GetNextCntntFrm(); + } } } - - const SdrPage* pPage = pIDDMA->GetDrawModel()->GetPage(0); - // --> FME 2005-04-18 #i20965# Use GetOrdNum() instead of GetOrdNumDirect() - // because ordnums might be wrong - for(sal_uInt32 a(pObj->GetOrdNum() + 1); bRet && a < pPage->GetObjCount(); a++) - { // <-- - SdrObject *pCandidate = pPage->GetObj(a); - if(pCandidate->ISA(SwVirtFlyDrawObj) && ((SwVirtFlyDrawObj*)pCandidate)->GetCurrentBoundRect().IsInside(rPt)) + if ( bRet ) + { + const SdrPage* pPage = pIDDMA->GetDrawModel()->GetPage(0); + for(sal_uInt32 a(pObj->GetOrdNum() + 1); bRet && a < pPage->GetObjCount(); a++) { - bRet = sal_False; + SdrObject *pCandidate = pPage->GetObj(a); + + if (pCandidate->ISA(SwVirtFlyDrawObj) && + ( (SwVirtFlyDrawObj*)pCandidate)->GetCurrentBoundRect().IsInside(rPt) ) + { + bRet = sal_False; + } } } } diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index 292be49df7b4..2d5f8299a229 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -100,6 +100,7 @@ public: //Wir nehemen die Groessenbehandlung vollstaendig selbst in die Hand. virtual const Rectangle& GetCurrentBoundRect() const; + virtual const Rectangle& GetLastBoundRect() const; virtual void RecalcBoundRect(); virtual void RecalcSnapRect(); virtual const Rectangle& GetSnapRect() const; diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 5bef2edb398f..6e7c393d8c6a 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -2882,7 +2882,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) !bExecDrawTextLink) { // #107513# - // Test if there is a draw object at that position and if it should be selected. + // Test if there is a object at that position and if it should be selected. sal_Bool bShould = rSh.ShouldObjectBeSelected(aDocPos); if(bShould) @@ -3153,7 +3153,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( rSh.IsSelFrmMode() ) rSh.SelectObj(aDocPos, SW_ADD_SELECT | SW_ENTER_GROUP); else - { if ( rSh.SelectObj( aDocPos, SW_ADD_SELECT | SW_ENTER_GROUP ) ) + { + if ( rSh.SelectObj( aDocPos, SW_ADD_SELECT | SW_ENTER_GROUP ) ) { rSh.EnterSelFrmMode( &aDocPos ); SwEditWin::nDDStartPosY = aDocPos.Y(); @@ -3366,11 +3367,16 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) bNoInterrupt = bTmpNoInterrupt; } - if( !bOverURLGrf && !bOnlyText ) + if ( !bOverURLGrf && !bOnlyText ) { - const int nSelType = rSh.GetSelectionType(); - if( nSelType == nsSelectionType::SEL_OLE || - nSelType == nsSelectionType::SEL_GRF ) + const SelectionType nSelType = rSh.GetSelectionType(); + // --> OD 2009-12-30 #i89920# + // Check in general, if an object is selectable at given position. + // Thus, also text fly frames in background become selectable via Ctrl-Click. + if ( nSelType & nsSelectionType::SEL_OLE || + nSelType & nsSelectionType::SEL_GRF || + rSh.IsObjSelectable( aDocPos ) ) + // <-- { MV_KONTEXT( &rSh ); if( !rSh.IsFrmSelected() ) @@ -3379,11 +3385,6 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) bCallBase = FALSE; } } - // nicht mehr hier zuruecksetzen, damit -- falls durch MouseMove - // bei gedrueckter Ctrl-Taste eine Mehrfachselektion erfolgen soll, - // im Drag nicht die vorherige Selektion aufgehoben wird. -// if(bModePushed) -// rSh.PopMode(FALSE); break; } } -- cgit From ace587b93a77488eba22fea1fc90ab576a4dde6c Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Wed, 30 Dec 2009 15:07:06 +0100 Subject: sw33bf02: #i89920# method - adjustment of object's attributes - renaming of method. - setting object's wrapping style to WRAP_THROUGH. - bringing object into foreground. --- sw/inc/fesh.hxx | 8 ++--- sw/source/core/crsr/crstrvl.cxx | 6 ++-- sw/source/core/frmedt/fefly1.cxx | 73 ++++++++++++++++------------------------ sw/source/ui/dochdl/swdtflvr.cxx | 6 ++-- sw/source/ui/shells/grfshex.cxx | 2 +- sw/source/ui/uiview/viewdraw.cxx | 4 +-- 6 files changed, 43 insertions(+), 56 deletions(-) (limited to 'sw') diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index e75d4baec8d0..0146b91d0571 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -539,10 +539,10 @@ public: const SfxItemSet* pFlyAttrSet = 0, const SfxItemSet* pGrfAttrSet = 0, SwFrmFmt* = 0 ); - //Einfuegen eines DrawObjectes. Das Object muss bereits im DrawModel - // angemeldet sein. - void Insert( SdrObject& rDrawObj, const SfxItemSet* pFlyAttrSet = 0, - SwFrmFmt* = 0, const Point* = 0 ); + + // Insertion of a drawing object which have to be already inserted in the DrawModel + void InsertDrawObj( SdrObject& rDrawObj, + const Point& rInsertPosition ); BOOL ReplaceSdrObj( const String& rGrfName, const String& rFltName, const Graphic* pGrf = 0 ); diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index b315e31bae48..39f041c66b66 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1008,9 +1008,9 @@ BOOL SwCrsrShell::IsPageAtPos( const Point &rPt ) const } BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, - SwContentAtPos& rCntntAtPos, - BOOL bSetCrsr, - SwRect* pFldRect ) + SwContentAtPos& rCntntAtPos, + BOOL bSetCrsr, + SwRect* pFldRect ) { SET_CURR_SHELL( this ); BOOL bRet = FALSE; diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index a8a19c95f5ab..29b2fe64f30b 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -75,9 +75,11 @@ // --> OD 2006-03-06 #125892# #include // <-- - #include - +// --> OD 2009-12-29 #i89920# +#include +#include +// <-- using ::rtl::OUString; using namespace ::com::sun::star; @@ -899,67 +901,50 @@ SwFlyFrmFmt* SwFEShell::InsertObject( const svt::EmbeddedObjectRef& xObj, } -void SwFEShell::Insert( SdrObject& rDrawObj, - const SfxItemSet* pFlyAttrSet, - SwFrmFmt* pFrmFmt, const Point* pPt ) +void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, + const Point& rInsertPosition ) { - SwDrawFrmFmt* pFmt = 0; SET_CURR_SHELL( this ); - if( pPt ) - { - SfxItemSet* pSet = 0; - const SfxPoolItem* pItem; - if( !pFlyAttrSet || - !pFlyAttrSet->GetItemState( RES_ANCHOR, sal_False, &pItem ) || - FLY_PAGE != ((SwFmtAnchor*)pItem)->GetAnchorId() ) - { - pSet = new SfxItemSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); - pSet->Put( SwFmtAnchor( FLY_AT_CNTNT )); - pFlyAttrSet = pSet; - } + SfxItemSet rFlyAttrSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); + rFlyAttrSet.Put( SwFmtAnchor( FLY_AT_CNTNT )); + // --> OD 2009-12-29 #i89920# + rFlyAttrSet.Put( SwFmtSurround( SURROUND_THROUGHT ) ); + rDrawObj.SetLayer( getIDocumentDrawModelAccess()->GetHeavenId() ); + // <-- + // find anchor position + SwPaM aPam( pDoc->GetNodes() ); + { SwCrsrMoveState aState( MV_SETONLYTEXT ); - SwPaM aPam( pDoc->GetNodes() ); - Point aTmpPt( *pPt ); + Point aTmpPt( rInsertPosition ); getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( aPam.GetPoint(), aTmpPt, &aState ); - SwFrm* pFrm = aPam.GetCntntNode()->GetFrm( 0, 0, sal_False ); - const Point aRelPos( pPt->X() - pFrm->Frm().Left(), - pPt->Y() - pFrm->Frm().Top() ); - // OD 2004-04-05 #i26791# - direct object positioning for + const SwFrm* pFrm = aPam.GetCntntNode()->GetFrm( 0, 0, sal_False ); + const Point aRelPos( rInsertPosition.X() - pFrm->Frm().Left(), + rInsertPosition.Y() - pFrm->Frm().Top() ); rDrawObj.SetRelativePos( aRelPos ); - ::lcl_FindAnchorPos( *GetDoc(), *pPt, *pFrm, *(SfxItemSet*)pFlyAttrSet ); - pFmt = GetDoc()->Insert( aPam, rDrawObj, pFlyAttrSet, pFrmFmt ); - if( pSet ) - delete pSet; - } - else - { - StartAllAction(); - FOREACHPAM_START( this ) - pFmt = GetDoc()->Insert(*PCURCRSR, rDrawObj, - pFlyAttrSet, pFrmFmt ); - ASSERT( pFmt, "Doc->Insert(sdrobj) failed." ); - - FOREACHPAM_END() - EndAllAction(); + ::lcl_FindAnchorPos( *GetDoc(), rInsertPosition, *pFrm, rFlyAttrSet ); } + // insert drawing object into the document creating a new instance + SwDrawFrmFmt* pFmt = GetDoc()->Insert( aPam, rDrawObj, &rFlyAttrSet, 0 ); - // --> OD 2005-01-07 #i40085# - follow-up of #i35635# // move object to visible layer SwContact* pContact = static_cast(rDrawObj.GetUserCall()); if ( pContact ) { pContact->MoveObjToVisibleLayer( &rDrawObj ); } - // <-- - if( pFmt ) - // das DrawObject selektieren + if ( pFmt ) + { + // select drawing object Imp()->GetDrawView()->MarkObj( &rDrawObj, Imp()->GetPageView(), - sal_False, sal_False ); + sal_False, sal_False ); + } else + { GetLayout()->SetAssertFlyPages(); + } } /*********************************************************************** diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 64d894acfdb2..493c1c067426 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -2658,7 +2658,9 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData, if(pFmView) { const OXFormsDescriptor &rDesc = OXFormsTransferable::extractDescriptor(rData); if(0 != (pObj = pFmView->CreateXFormsControl(rDesc))) - rSh.SwFEShell::Insert( *pObj, 0, 0, pDragPt ); + { + rSh.SwFEShell::InsertDrawObj( *pObj, *pDragPt ); + } } } else if( nWh ) @@ -2719,7 +2721,7 @@ int SwTransferable::_PasteDBData( TransferableDataHelper& rData, if (pFmView && bHaveColumnDescriptor) { if ( 0 != (pObj = pFmView->CreateFieldControl( OColumnTransferable::extractColumnDescriptor(rData) ) ) ) - rSh.SwFEShell::Insert( *pObj, 0, 0, pDragPt ); + rSh.SwFEShell::InsertDrawObj( *pObj, *pDragPt ); } } nRet = 1; diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx index 9ee02b74e591..8d9ab4f27943 100644 --- a/sw/source/ui/shells/grfshex.cxx +++ b/sw/source/ui/shells/grfshex.cxx @@ -161,7 +161,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq ) pObj->setURL( aURL ); rSh.EnterStdMode(); - rSh.SwFEShell::Insert( *pObj, 0, 0, &aPos ); + rSh.SwFEShell::InsertDrawObj( *pObj, aPos ); bRet = true; if( pWindow ) diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx index 328b5a3d06ca..a12beb994d61 100644 --- a/sw/source/ui/uiview/viewdraw.cxx +++ b/sw/source/ui/uiview/viewdraw.cxx @@ -174,7 +174,7 @@ void SwView::ExecDraw(SfxRequest& rReq) // TODO: unmark all other pWrtShell->EnterStdMode(); - pWrtShell->SwFEShell::Insert( *pObj, 0, 0, &aStartPos ); + pWrtShell->SwFEShell::InsertDrawObj( *pObj, aStartPos ); } } } @@ -221,7 +221,7 @@ void SwView::ExecDraw(SfxRequest& rReq) aSize = Size( 2835, 2835 ); pWrtShell->EnterStdMode(); - pWrtShell->SwFEShell::Insert( *pObj, 0, 0, &aPos ); + pWrtShell->SwFEShell::InsertDrawObj( *pObj, aPos ); rReq.Ignore (); } } -- cgit From 4944c8c648b9d2b914d57fa83a47d57076c0473c Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Wed, 30 Dec 2009 17:20:32 +0100 Subject: sw33bf02: #i107447# method - do not reflect reset of flag in return value on normal cursor move. --- sw/source/core/crsr/crsrsh.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sw') diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 3be6f84956fd..6c121a890ef3 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -395,10 +395,18 @@ BOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, else { const BOOL bSkipHidden = !GetViewOptions()->IsShowHiddenChar(); - bRet = SetInFrontOfLabel( FALSE ); + // --> OD 2009-12-30 #i107447# + // To avoid loop the reset of flag is no longer + // reflected in the return value . + const bool bResetOfInFrontOfLabel = SetInFrontOfLabel( FALSE ); bRet = pShellCrsr->LeftRight( bLeft, nCnt, nMode, bVisualAllowed, - bSkipHidden, - !IsOverwriteCrsr() ) || bRet; + bSkipHidden, !IsOverwriteCrsr() ); + if ( !bRet && bLeft && bResetOfInFrontOfLabel ) + { + // undo reset of flag + SetInFrontOfLabel( TRUE ); + } + // <-- } if( bRet ) -- cgit From 19dee7433c8d36f0632fab2e6ed6ed88834e6df7 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 31 Dec 2009 09:33:47 +0100 Subject: sw33bf02: #i89920# adjustment of fix due to compiler warning --- sw/source/core/frmedt/feshview.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw') diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 80e150248c75..9983eb80642d 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1240,10 +1240,10 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt) Point aTmpPt( rPt ); if ( pTxtFrm->GetKeyCrsrOfst( pPos, aTmpPt ) ) { - SwRect aCharRect; - if ( pTxtFrm->GetCharRect( aCharRect, *pPos ) ) + SwRect aCursorCharRect; + if ( pTxtFrm->GetCharRect( aCursorCharRect, *pPos ) ) { - if ( aCharRect.IsOver( SwRect( pObj->GetLastBoundRect() ) ) ) + if ( aCursorCharRect.IsOver( SwRect( pObj->GetLastBoundRect() ) ) ) { bRet = sal_False; } -- cgit From 62ee0f6d9597990fa9f29912a045573b72c59f1c Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 31 Dec 2009 10:05:48 +0100 Subject: sw33bf02: #i106906# method - lock view during action to avoid jump to cursor --- sw/source/ui/app/docsh.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sw') diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 8a119ddd5140..f69a891a7d4b 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -767,6 +767,10 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) if ( pWrtShell ) { SwWait aWait( *this, TRUE ); + // --> OD 2009-12-31 #i106906# + const sal_Bool bFormerLockView = pWrtShell->IsViewLocked(); + pWrtShell->LockView( sal_True ); + // <-- pWrtShell->StartAllAction(); pWrtShell->Push(); SwWriter aWrt( rMedium, *pWrtShell, TRUE ); @@ -777,6 +781,9 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) { pWrtShell->Pop(FALSE); pWrtShell->EndAllAction(); + // --> OD 2009-12-31 #i106906# + pWrtShell->LockView( bFormerLockView ); + // <-- } } else -- cgit From 3ec21c0b69dc696e108163d09d34d770c3f21d14 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 31 Dec 2009 10:59:35 +0100 Subject: sw33bf02: #i106452# method - check page description not only in situations with sections --- sw/source/core/layout/flowfrm.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'sw') diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 108dadf23ec8..84411f30d5eb 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -513,10 +513,10 @@ BOOL SwFlowFrm::PasteTree( SwFrm *pStart, SwLayoutFrm *pParent, SwFrm *pSibling, pParent->pLower = pStart; else //Modified for #i100782#,04/03/2009 - //If the pParent has more than 1 child nodes, former design will - //ignore them directly without any collection work. It will make some - //dangling pointers. This lead the crash... - //The new design will find the last child of pParent in loop way, and + //If the pParent has more than 1 child nodes, former design will + //ignore them directly without any collection work. It will make some + //dangling pointers. This lead the crash... + //The new design will find the last child of pParent in loop way, and //add the pStart after the last child. // pParent->Lower()->pNext = pStart; { @@ -2130,13 +2130,15 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways ) // OD 30.10.2002 #97265# - no in online layout if ( !pNewPage->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) { - //Bei Sections kann es passieren, das wir gleich in den Follow geflutscht - //sind. Dadurch wird nicht vom GetLeaf fuer die richtige Seite gesorgt. - //Das muessen wir fuer diesen Fall pruefen. - if ( !bSamePage && pNewUpper->IsInSct() && + // --> OD 2009-12-31 #i106452# + // check page description not only in situation with sections. + if ( !bSamePage && ( rThis.GetAttrSet()->GetPageDesc().GetPageDesc() || pOldPage->GetPageDesc()->GetFollow() != pNewPage->GetPageDesc() ) ) + { SwFrm::CheckPageDescs( pNewPage, FALSE ); + } + // <-- } } return bSamePage; -- cgit From 7b9039d7fef05044cc1f51485e8845a2a3f76089 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Mon, 4 Jan 2010 13:30:37 +0100 Subject: sw33bf02: #i105243# Output of graphic in Writer with corresponding PDF handling --- sw/source/core/doc/notxtfrm.cxx | 10 ++++++---- sw/source/core/layout/paintfrm.cxx | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'sw') diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index d4ad970727a9..6c37169902df 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -909,8 +909,9 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr )) { - rGrfObj.Draw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), - &aGrfAttr ); + rGrfObj.DrawWithPDFHandling( *pOut, + aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), + &aGrfAttr ); bContinue = FALSE; } } @@ -949,8 +950,9 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons 0, GRFMGR_DRAW_STANDARD, pVout ); } else - rGrfObj.Draw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), - &aGrfAttr ); + rGrfObj.DrawWithPDFHandling( *pOut, + aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), + &aGrfAttr ); } else { diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 44d5af0f84b2..7597c880a0e1 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1649,7 +1649,7 @@ void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut, /// Because for drawing a graphic left-top-corner and size coordinations are /// used, these coordinations have to be determined on pixel level. ::SwAlignGrfRect( &aAlignedGrfRect, *pOut ); - pGrf->Draw( pOut, aAlignedGrfRect.Pos(), aAlignedGrfRect.SSize() ); + pGrf->DrawWithPDFHandling( *pOut, aAlignedGrfRect.Pos(), aAlignedGrfRect.SSize() ); if ( bNotInside ) pOut->Pop(); -- cgit From a1c9cd02be2ed42c77eb959f234c01804704b1d5 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Tue, 5 Jan 2010 14:19:09 +0100 Subject: sw33bf02: #b6884103# correct consideration of actual indent when starting new list. --- sw/inc/ndtxt.hxx | 4 ++++ sw/source/core/txtnode/ndtxt.cxx | 45 ++++++++++++++++++++++++++++++++++++++++ sw/source/ui/wrtsh/wrtsh1.cxx | 11 ++++++---- 3 files changed, 56 insertions(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index d4d59afa3d9c..3cd195724670 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -484,6 +484,10 @@ public: */ BOOL GetFirstLineOfsWithNum( short& rFirstOffset ) const; + // --> OD 2010-01-05 #b6884103# + SwTwips GetAdditionalIndentForStartingNewList() const; + // <-- + // --> OD 2008-12-02 #i96772# void ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const; // <-- diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index a779898d4aaa..81971372ee10 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2889,6 +2889,51 @@ BOOL SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const return bRet; } +// --> OD 2010-01-05 #b6884103# +SwTwips SwTxtNode::GetAdditionalIndentForStartingNewList() const +{ + SwTwips nAdditionalIndent = 0; + + const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L; + if ( pRule ) + { + const SwNumFmt& rFmt = pRule->Get(static_cast(GetActualListLevel())); + if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) + { + nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft(); + + if (getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING)) + { + nAdditionalIndent = nAdditionalIndent - + GetSwAttrSet().GetLRSpace().GetTxtFirstLineOfst(); + } + } + else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) + { + if ( AreListLevelIndentsApplicable() ) + { + nAdditionalIndent = rFmt.GetIndentAt() + rFmt.GetFirstLineIndent(); + } + else + { + nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft(); + if (getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING)) + { + nAdditionalIndent = nAdditionalIndent - + GetSwAttrSet().GetLRSpace().GetTxtFirstLineOfst(); + } + } + } + } + else + { + nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft(); + } + + return nAdditionalIndent; +} +// <-- + // --> OD 2008-12-02 #i96772# void SwTxtNode::ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const { diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 2b924933f1cc..7b0268cc57a2 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -1379,10 +1379,13 @@ void SwWrtShell::NumOrBulletOn(BOOL bNum) if ( pTxtNode && ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) { - short nTxtNodeFirstLineOffset( 0 ); - pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset ); - const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() + - nTxtNodeFirstLineOffset; + // --> OD 2010-01-05 #b6884103# +// short nTxtNodeFirstLineOffset( 0 ); +// pTxtNode->GetFirstLineOfsWithNum( nTxtNodeFirstLineOffset ); +// const SwTwips nTxtNodeIndent = pTxtNode->GetLeftMarginForTabCalculation() + +// nTxtNodeFirstLineOffset; + const SwTwips nTxtNodeIndent = pTxtNode->GetAdditionalIndentForStartingNewList(); + // <-- if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 ) { const SwTwips nIndentChange = nTxtNodeIndent + nWidthOfTabs; -- cgit From 8b6c7d5ba4409eabb39cd56e6e2f3db019f90b34 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 7 Jan 2010 09:46:58 +0100 Subject: sw33bf02: #i107834# [patch from CMC] - method keep "faked" font properties at font metric --- sw/source/core/txtnode/fntcache.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sw') diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index f99b745b9c14..919c8091b700 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -484,6 +484,11 @@ static sal_Char __READONLY_DATA sStandardString[] = "Dies ist der Teststring"; pScrFont = pPrtFont; FontMetric aMet = pPrt->GetFontMetric( ); + //Don't loose "faked" properties of the logical font that don't truly + //exist in the physical font metrics which vcl which fake up for us + aMet.SetWeight(pScrFont->GetWeight()); + aMet.SetItalic(pScrFont->GetItalic()); + bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet(); if ( USHRT_MAX == nGuessedLeading ) @@ -523,6 +528,11 @@ static sal_Char __READONLY_DATA sStandardString[] = "Dies ist der Teststring"; pPrt->SetFont( aFnt2 ); aMet = pPrt->GetFontMetric( ); + //Don't loose "faked" properties of the logical font that don't + //truly exist in the physical font metrics which vcl which fake + //up for us + aMet.SetWeight(aFnt2.GetWeight()); + aMet.SetItalic(aFnt2.GetItalic()); } const XubString aStandardStr( sStandardString, -- cgit From c3436b84cde501fee0f8ddde012f5c81d20a1760 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 7 Jan 2010 14:40:30 +0100 Subject: sw33bf02: #i107811# method - Assure that at-page anchored fly frames have a page num or a content anchor set. --- sw/source/core/doc/doclay.cxx | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'sw') diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index b97d1fbcd642..889037daadca 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -659,14 +659,14 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, // Anker noch nicht gesetzt ? RndStdIds eAnchorId = pAnchor ? pAnchor->GetAnchorId() : pFmt->GetAnchor().GetAnchorId(); - if( !pAnchor || - (FLY_PAGE != pAnchor->GetAnchorId() && - //Nur Page und nicht: -// FLY_AT_CNTNT == pAnchor->GetAnchorId() || -// FLY_IN_CNTNT == pAnchor->GetAnchorId() || -// FLY_AT_FLY == pAnchor->GetAnchorId() || -// FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) && - !pAnchor->GetCntntAnchor() )) + // --> OD 2010-01-07 #i107811# + // Assure that at-page anchored fly frames have a page num or a content anchor set. + if ( !pAnchor || + ( FLY_PAGE != pAnchor->GetAnchorId() && + !pAnchor->GetCntntAnchor() ) || + ( FLY_PAGE == pAnchor->GetAnchorId() && + !pAnchor->GetCntntAnchor() && + pAnchor->GetPageNum() == 0 ) ) { // dann setze ihn, wird im Undo gebraucht SwFmtAnchor aAnch( pFmt->GetAnchor() ); @@ -680,15 +680,20 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, { if( eRequestId != aAnch.GetAnchorId() && SFX_ITEM_SET != pFmt->GetItemState( RES_ANCHOR, sal_True ) ) + { aAnch.SetType( eRequestId ); + } eAnchorId = aAnch.GetAnchorId(); - if ( FLY_PAGE != eAnchorId ) - //Nur Page und nicht: -// if( FLY_AT_CNTNT == eAnchorId || FLY_IN_CNTNT == eAnchorId || -// FLY_AT_FLY == eAnchorId || FLY_AUTO_CNTNT == eAnchorId ) + if ( FLY_PAGE != eAnchorId || + ( FLY_PAGE == eAnchorId && + ( !pAnchor || + aAnch.GetPageNum() == 0 ) ) ) + { aAnch.SetAnchor( &rAnchPos ); + } } + // <-- pFmt->SetFmtAttr( aAnch ); } else -- cgit From b7ecc322a4e36a8882cbf107186ac46c55a4950b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 13 Jan 2010 13:03:53 +0100 Subject: #i107826#: apply patch from cmc --- sw/source/core/doc/doccomp.cxx | 52 ++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 12 deletions(-) (limited to 'sw') diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 047b5b2dc582..6b32eebc35ce 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -969,6 +969,29 @@ BOOL SwCompareLine::Compare( const CompareLine& rLine ) const return CompareNode( rNode, ((SwCompareLine&)rLine).rNode ); } +namespace +{ + static String SimpleTableToText(const SwNode &rNode) + { + String sRet; + const SwNode* pEndNd = rNode.EndOfSectionNode(); + SwNodeIndex aIdx( rNode ); + while (&aIdx.GetNode() != pEndNd) + { + if (aIdx.GetNode().IsTxtNode()) + { + if (sRet.Len()) + { + sRet.Append( '\n' ); + } + sRet.Append( aIdx.GetNode().GetTxtNode()->GetExpandTxt() ); + } + aIdx++; + } + return sRet; + } +} + BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) { if( rSrcNd.GetNodeType() != rDstNd.GetNodeType() ) @@ -989,6 +1012,13 @@ BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) bRet = ( rTSrcNd.EndOfSectionIndex() - rTSrcNd.GetIndex() ) == ( rTDstNd.EndOfSectionIndex() - rTDstNd.GetIndex() ); + + // --> #i107826#: compare actual table content + if (bRet) + { + bRet = (SimpleTableToText(rSrcNd) == SimpleTableToText(rDstNd)); + } + // <-- } break; @@ -1043,6 +1073,15 @@ BOOL SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) case ND_ENDNODE: bRet = rSrcNd.StartOfSectionNode()->GetNodeType() == rDstNd.StartOfSectionNode()->GetNodeType(); + + // --> #i107826#: compare actual table content + if (bRet && rSrcNd.StartOfSectionNode()->GetNodeType() == ND_TABLENODE) + { + bRet = CompareNode( + *rSrcNd.StartOfSectionNode(), *rDstNd.StartOfSectionNode()); + } + // <-- + break; } return bRet; @@ -1059,18 +1098,7 @@ String SwCompareLine::GetText() const case ND_TABLENODE: { - const SwNode* pEndNd = rNode.EndOfSectionNode(); - SwNodeIndex aIdx( rNode ); - while( &aIdx.GetNode() != pEndNd ) - { - if( aIdx.GetNode().IsTxtNode() ) - { - if( sRet.Len() ) - sRet.Append( '\n' ); - sRet.Append( ((SwTxtNode&)rNode).GetExpandTxt() ); - } - aIdx++; - } + sRet = SimpleTableToText(rNode); sRet.InsertAscii( "Tabelle: ", 0 ); } break; -- cgit From bed6ae689e836a3c2494dec840bb7946a409619b Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Wed, 13 Jan 2010 15:57:11 +0100 Subject: sw33bf02: #b6912256# - assure consistent Writer core attributes if list styles are deleted via UNO-API --- sw/source/core/SwNumberTree/SwNodeNum.cxx | 19 ++++++++++++++++++- sw/source/core/unocore/unocrsrhelper.cxx | 10 ++++------ 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'sw') diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index 171c4de9208d..c13b396e76f4 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -40,6 +40,10 @@ // --> OD 2007-10-31 #i83479# #include // <-- +// --> OD 2010-01-13 #b6912256# +#include +#include +// <-- // --> OD 2008-02-19 #refactorlists# SwNodeNum::SwNodeNum( SwTxtNode* pTxtNode ) @@ -492,8 +496,21 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum ) SwTxtNode* pTxtNode( rNodeNum.GetTxtNode() ); if ( pTxtNode ) { - // --> OD 2008-03-13 #refactorlists# pTxtNode->RemoveFromList(); + // --> OD 2010-01-13 #b6912256# + // clear all list attributes and the list style + SvUShortsSort aResetAttrsArray; + aResetAttrsArray.Insert( RES_PARATR_LIST_ID ); + aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL ); + aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART ); + aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE ); + aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); + aResetAttrsArray.Insert( RES_PARATR_NUMRULE ); + SwPaM aPam( *pTxtNode ); + pTxtNode->GetDoc()->ResetAttrs( aPam, sal_False, + &aResetAttrsArray, + false ); + // <-- } } } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 4f4c7c2658b5..d64281038bb3 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -231,13 +231,11 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry // <-- case FN_NUMBER_NEWSTART: { + // a multi selection is not considered const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode(); - // --> OD 2006-10-19 #134160# - make code robust: - // consider case that PaM doesn't denote a text node - const SwNumRule* pRule = pTxtNd ? pTxtNd->GetNumRule() : 0; + // --> OD 2010-01-13 #b6912256# + if ( pTxtNd && pTxtNd->IsInList() ) // <-- - // hier wird Multiselektion nicht beruecksichtigt - if( pRule ) { if( pAny ) { @@ -518,7 +516,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry } eNewState = aCharStyles.getLength() ? - PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE;; + PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE;; if(pAny) (*pAny) <<= aCharStyles; } -- cgit From 6deb65760e2787c0b22cf774701f265b7443c379 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Thu, 4 Feb 2010 15:40:20 +0100 Subject: sw33bf02: correction needed to general changes between DEV300_m68 and DEV300_m71 --- sw/inc/viewsh.hxx | 2 +- sw/source/core/doc/doclay.cxx | 8 ++++---- sw/source/core/frmedt/fefly1.cxx | 2 +- sw/source/core/layout/atrfrm.cxx | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sw') diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 8dceafbcfc64..e8f03899f3ec 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -192,7 +192,7 @@ class SW_DLLPUBLIC ViewShell : public Ring SW_DLLPRIVATE sal_Bool CheckInvalidForPaint( const SwRect & );//Direkt Paint oder lieber //eine Aktion ausloesen. - SW_DLLPRIVATE void PrepareForPrint( const SwPrtOptions &rOptions ); + SW_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions ); SW_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index e826c182d735..75c74a32a1da 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -657,9 +657,9 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, // --> OD 2010-01-07 #i107811# // Assure that at-page anchored fly frames have a page num or a content anchor set. if ( !pAnchor || - ( FLY_PAGE != pAnchor->GetAnchorId() && + ( FLY_AT_PAGE != pAnchor->GetAnchorId() && !pAnchor->GetCntntAnchor() ) || - ( FLY_PAGE == pAnchor->GetAnchorId() && + ( FLY_AT_PAGE == pAnchor->GetAnchorId() && !pAnchor->GetCntntAnchor() && pAnchor->GetPageNum() == 0 ) ) { @@ -680,8 +680,8 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, } eAnchorId = aAnch.GetAnchorId(); - if ( FLY_PAGE != eAnchorId || - ( FLY_PAGE == eAnchorId && + if ( FLY_AT_PAGE != eAnchorId || + ( FLY_AT_PAGE == eAnchorId && ( !pAnchor || aAnch.GetPageNum() == 0 ) ) ) { diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 5bf9c1e7c17f..ed41bd69cc2c 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -919,7 +919,7 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, SET_CURR_SHELL( this ); SfxItemSet rFlyAttrSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); - rFlyAttrSet.Put( SwFmtAnchor( FLY_AT_CNTNT )); + rFlyAttrSet.Put( SwFmtAnchor( FLY_AT_PARA )); // --> OD 2009-12-29 #i89920# rFlyAttrSet.Put( SwFmtSurround( SURROUND_THROUGHT ) ); rDrawObj.SetLayer( getIDocumentDrawModelAccess()->GetHeavenId() ); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 13bbb5e82a10..3e480b67352d 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2829,7 +2829,7 @@ void SwFlyFrmFmt::MakeFrms() } else { - aAnchorAttr.SetType( FLY_AT_CNTNT ); + aAnchorAttr.SetType( FLY_AT_PARA ); SetFmtAttr( aAnchorAttr ); MakeFrms(); return; -- cgit From 9bba964993fe859b40a5c125406653ee3ade122e Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Mon, 15 Feb 2010 09:41:19 +0100 Subject: sw33bf02: #i107834# - remove applied patch for deeper investigation --- sw/source/core/txtnode/fntcache.cxx | 9 --------- 1 file changed, 9 deletions(-) (limited to 'sw') diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 919c8091b700..b61476bdf4cf 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -484,10 +484,6 @@ static sal_Char __READONLY_DATA sStandardString[] = "Dies ist der Teststring"; pScrFont = pPrtFont; FontMetric aMet = pPrt->GetFontMetric( ); - //Don't loose "faked" properties of the logical font that don't truly - //exist in the physical font metrics which vcl which fake up for us - aMet.SetWeight(pScrFont->GetWeight()); - aMet.SetItalic(pScrFont->GetItalic()); bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet(); @@ -528,11 +524,6 @@ static sal_Char __READONLY_DATA sStandardString[] = "Dies ist der Teststring"; pPrt->SetFont( aFnt2 ); aMet = pPrt->GetFontMetric( ); - //Don't loose "faked" properties of the logical font that don't - //truly exist in the physical font metrics which vcl which fake - //up for us - aMet.SetWeight(aFnt2.GetWeight()); - aMet.SetItalic(aFnt2.GetItalic()); } const XubString aStandardStr( sStandardString, -- cgit From 5a413f4d4535240e257092f1cb9ff63aa284d79b Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Wed, 10 Mar 2010 21:33:47 +0100 Subject: sw33bf02: adjustments due to merge with DEV300_m74 --- sw/source/core/frmedt/fefly1.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 2b8131294500..a0d9141778cb 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -75,7 +75,7 @@ #include // --> OD 2009-12-29 #i89920# #include -#include +#include // <-- using ::rtl::OUString; -- cgit