diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-03-23 11:22:15 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-03-23 11:22:15 +0100 |
commit | 7e675a6d3e002c361765ac73a5ff64d3ab676bb2 (patch) | |
tree | cb9e335fa80eae8c6e0f28b58aa307625bd4b8f9 | |
parent | 96e54e6b4c84966c661721cd90c1dad3777fb641 (diff) | |
parent | 268c37577d063020397ebc4fb024818de87e1a56 (diff) |
CWS-TOOLING: integrate CWS sw33bf02
38 files changed, 420 insertions, 2218 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index b7a2b0cb53..b272292f82 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -536,10 +536,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/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index aef62c8cc9..ad783f1235 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -488,6 +488,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/inc/viewsh.hxx b/sw/inc/viewsh.hxx index c2ca76b45b..4ed3eab196 100644..100755 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -189,9 +189,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 SwPrintData &rOptions ); SW_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt ); @@ -238,11 +235,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 ); @@ -368,11 +361,11 @@ public: // printing of one page. // bIsPDFExport == true is: do PDF Export (no printing!) - sal_Bool PrintOrPDFExport( OutputDevice *pOutDev, const SwPrtOptions &rPrintData, + sal_Bool PrintOrPDFExport( OutputDevice *pOutDev, const SwPrtOptions &rPrintData, sal_Int32 nRenderer /* offset in vector of pages to print */ ); // printing of one brochure page - void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData, + void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData, sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ ); // printing for OLE 2.0 diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index 34820899d9..abcc7936b2 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -37,6 +37,10 @@ // --> OD 2007-10-31 #i83479# #include <IDocumentListItems.hxx> // <-- +// --> OD 2010-01-13 #b6912256# +#include <svl/svstdarr.hxx> +#include <doc.hxx> +// <-- // --> OD 2008-02-19 #refactorlists# SwNodeNum::SwNodeNum( SwTxtNode* pTxtNode ) @@ -489,8 +493,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/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index c499929cc4..5a032d6021 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -392,10 +392,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 <bInFrontOfLabel> flag is no longer + // reflected in the return value <bRet>. + const bool bResetOfInFrontOfLabel = SetInFrontOfLabel( FALSE ); bRet = pShellCrsr->LeftRight( bLeft, nCnt, nMode, bVisualAllowed, - bSkipHidden, - !IsOverwriteCrsr() ) || bRet; + bSkipHidden, !IsOverwriteCrsr() ); + if ( !bRet && bLeft && bResetOfInFrontOfLabel ) + { + // undo reset of <bInFrontOfLabel> flag + SetInFrontOfLabel( TRUE ); + } + // <-- } if( bRet ) @@ -1770,13 +1778,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/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index ecbfcedf73..681dd7a04c 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1005,9 +1005,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/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 77624c51ad..5b301c61ba 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -966,6 +966,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() ) @@ -986,6 +1009,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; @@ -1040,6 +1070,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; @@ -1056,18 +1095,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; diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index d30bf44689..98cb4114ce 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -651,14 +651,14 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, // Anker noch nicht gesetzt ? RndStdIds eAnchorId = pAnchor ? pAnchor->GetAnchorId() : pFmt->GetAnchor().GetAnchorId(); - if( !pAnchor || - ((FLY_AT_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_AT_PAGE != pAnchor->GetAnchorId() && + !pAnchor->GetCntntAnchor() ) || + ( FLY_AT_PAGE == pAnchor->GetAnchorId() && + !pAnchor->GetCntntAnchor() && + pAnchor->GetPageNum() == 0 ) ) { // dann setze ihn, wird im Undo gebraucht SwFmtAnchor aAnch( pFmt->GetAnchor() ); @@ -672,15 +672,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_AT_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_AT_PAGE != eAnchorId || + ( FLY_AT_PAGE == eAnchorId && + ( !pAnchor || + aAnch.GetPageNum() == 0 ) ) ) + { aAnch.SetAnchor( &rAnchPos ); + } } + // <-- pFmt->SetFmtAttr( aAnch ); } else diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 2652811c0a..3c1d88c700 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -295,14 +295,6 @@ void SwNoTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ // <-- 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(); @@ -799,6 +791,7 @@ 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() ); @@ -843,7 +836,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons pOut->GetConnectMetaFile(); const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() ); - + /// OD 25.09.2002 #99739# - calculate aligned rectangle from parameter <rGrfArea>. /// Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in /// the following code. @@ -865,7 +858,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons //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 ) { @@ -913,8 +906,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; } } @@ -953,8 +947,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/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 85cfd3fac5..b5a446c457 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -295,9 +295,9 @@ namespace drawinglayer } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////////////// -// AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed -// since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj. -// For paint, that offset is used by setting at the OutputDevice; for primitives this is +// AW: own sdr::contact::ViewContact (VC) sdr::contact::ViewObjectContact (VOC) needed +// since offset is defined different from SdrVirtObj's sdr::contact::ViewContactOfVirtObj. +// For paint, that offset is used by setting at the OutputDevice; for primitives this is // not possible since we have no OutputDevice, but define the geometry itself. namespace sdr @@ -318,7 +318,7 @@ namespace sdr { } virtual ~VCOfSwVirtFlyDrawObj(); - + // access to SwVirtFlyDrawObj SwVirtFlyDrawObj& GetSwVirtFlyDrawObj() const { @@ -347,7 +347,7 @@ namespace sdr { const drawinglayer::primitive2d::Primitive2DReference xPrimitive( new drawinglayer::primitive2d::SwVirtFlyDrawObjPrimitive( - GetSwVirtFlyDrawObj(), + GetSwVirtFlyDrawObj(), aOuterRange)); xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xPrimitive, 1); @@ -378,8 +378,8 @@ basegfx::B2DRange SwVirtFlyDrawObj::getOuterBound() const { const Rectangle aOuterRectangle(pFlyFrame->Frm().Pos(), pFlyFrame->Frm().SSize()); - if(!aOuterRectangle.IsEmpty() - && RECT_EMPTY != aOuterRectangle.Right() + if(!aOuterRectangle.IsEmpty() + && RECT_EMPTY != aOuterRectangle.Right() && RECT_EMPTY != aOuterRectangle.Bottom()) { aOuterRange.expand(basegfx::B2DTuple(aOuterRectangle.Left(), aOuterRectangle.Top())); @@ -404,8 +404,8 @@ basegfx::B2DRange SwVirtFlyDrawObj::getInnerBound() const { const Rectangle aInnerRectangle(pFlyFrame->Frm().Pos() + pFlyFrame->Prt().Pos(), pFlyFrame->Prt().SSize()); - if(!aInnerRectangle.IsEmpty() - && RECT_EMPTY != aInnerRectangle.Right() + if(!aInnerRectangle.IsEmpty() + && RECT_EMPTY != aInnerRectangle.Right() && RECT_EMPTY != aInnerRectangle.Bottom()) { aInnerRange.expand(basegfx::B2DTuple(aInnerRectangle.Left(), aInnerRectangle.Top())); @@ -491,7 +491,7 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const if(bDrawObject) { - if(!pFlyFrm->IsFlyInCntFrm()) + if(!pFlyFrm->IsFlyInCntFrm()) { // it is also necessary to restore the VCL MapMode from ViewInformation since e.g. // the VCL PixelRenderer resets it at the used OutputDevice. Unfortunately, this @@ -500,10 +500,10 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const pOut->Push(PUSH_MAPMODE); pOut->SetMapMode(pShell->getPrePostMapMode()); - + // paint the FlyFrame (use standard VCL-Paint) pFlyFrm->Paint(GetFlyFrm()->Frm()); - + pOut->Pop(); } } @@ -556,6 +556,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/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 98fd9ae091..d0011f521e 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -72,9 +72,11 @@ // --> OD 2006-03-06 #125892# #include <HandleAnchorNodeChg.hxx> // <-- - #include <frmatr.hxx> - +// --> OD 2009-12-29 #i89920# +#include <fmtsrnd.hxx> +#include <editeng/opaqitem.hxx> +// <-- using ::rtl::OUString; using namespace ::com::sun::star; @@ -908,67 +910,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_AT_PAGE != ((SwFmtAnchor*)pItem)->GetAnchorId())) - { - pSet = new SfxItemSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); - pSet->Put( SwFmtAnchor( FLY_AT_PARA )); - pFlyAttrSet = pSet; - } + SfxItemSet rFlyAttrSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); + rFlyAttrSet.Put( SwFmtAnchor( FLY_AT_PARA )); + // --> 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 <SwDoc::Insert(..)> + 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 <SwDrawFrmFmt> 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<SwContact*>(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/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index e09b8066de..eecb8047c2 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1182,9 +1182,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); @@ -1201,39 +1199,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<const SwTxtFrm*>(pCntntFrm); + if ( pTxtFrm ) + { + SwPosition* pPos = + new SwPosition( *(pTxtFrm->GetTxtNode()) ); + Point aTmpPt( rPt ); + if ( pTxtFrm->GetKeyCrsrOfst( pPos, aTmpPt ) ) + { + SwRect aCursorCharRect; + if ( pTxtFrm->GetCharRect( aCursorCharRect, *pPos ) ) + { + if ( aCursorCharRect.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 cca7261c1a..6cd65bf6d9 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -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/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index b7b360395d..25bc565727 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -105,14 +105,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 b880f3ed33..0000000000 --- a/sw/source/core/inc/scrrect.hxx +++ /dev/null @@ -1,125 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SCRRECT_HXX -#define _SCRRECT_HXX - -#include <svl/svarray.hxx> -#include "swrect.hxx" -#include <swtypes.hxx> - -class SwStripe -{ - SwTwips nY; - SwTwips nHeight; -public: - inline SwStripe( SwTwips nPos, SwTwips nHght ) - : nY( nPos ), nHeight( nHght ) {} - inline SwTwips GetY() const { return nY; } - inline SwTwips& Y() { return nY; } - inline SwTwips GetHeight() const { return nHeight; } - inline SwTwips& Height() { return nHeight; } - inline SwTwips GetBottom() const { return nHeight ? nY + nHeight - 1 : nY; } - inline BOOL operator<( const SwStripe &rTst ) const - { return nY < rTst.nY || ( nY == rTst.nY && nHeight > rTst.nHeight ); } - inline BOOL operator==( const SwStripe& rTst ) const - { return nY == rTst.nY && nHeight == rTst.nHeight; } -}; - -SV_DECL_VARARR( SwStripeArr, SwStripe, 1, 4 ) - -class SwStripes : public SwStripeArr, public SwStripe -{ - SwTwips nMin; // Left minimum - SwTwips nMax; // Right maximum -public: - SwStripes( SwTwips nPos, SwTwips nSize, SwTwips nMn, SwTwips nMx ) - : SwStripe( nPos, nSize ), nMin( nMn ), nMax( nMx ) {} - SwStripes& Plus( const SwStripes& rOther, BOOL bVert ); - BOOL Recalc( BOOL bVert ); - - inline SwTwips GetMin() const { return nMin; } - inline SwTwips GetMax() const { return nMax; } - inline void SetMin( const SwTwips nNew ) { nMin = nNew; } - inline void SetMax( const SwTwips nNew ) { nMax = nNew; } - inline void ChkMin( const SwTwips nNew ) { if( nNew < nMin ) nMin = nNew; } - inline void ChkMax( const SwTwips nNew ) { if( nNew > nMax ) nMax = nNew; } - inline SwTwips GetRight() const { return nMax > nMin ? nMax - 1 : nMax; } - inline SwTwips GetWidth() const { return nMax - nMin; } -}; - -class SwScrollColumn -{ - SwTwips nX; - SwTwips nWidth; - SwTwips nOffs; - BOOL bVertical; -public: - inline SwScrollColumn( SwTwips nPos, SwTwips nSz, SwTwips nOff, BOOL bVert ) - : nX( nPos ), nWidth( nSz ), nOffs( nOff ), bVertical( bVert ) {} - inline SwScrollColumn( const SwScrollColumn& rCol ) - : nX( rCol.nX ), nWidth( rCol.nWidth ), - nOffs( rCol.nOffs ), bVertical( rCol.bVertical ) {} - BOOL IsVertical() const { return bVertical; } - inline BOOL operator<( const SwScrollColumn &rTst ) const - { return bVertical < rTst.bVertical || ( bVertical == rTst.bVertical && - ( nX < rTst.nX || ( nX == rTst.nX && ( nWidth < rTst.nWidth || - ( nWidth == rTst.nWidth && nOffs < rTst.nOffs ) ) ) ) ); } - inline BOOL operator==( const SwScrollColumn &rTst ) const - { return bVertical == rTst.bVertical && nX == rTst.nX && - nWidth == rTst.nWidth && nOffs == rTst.nOffs;} - inline SwTwips GetX() const { return nX; } - inline SwTwips GetWidth() const { return nWidth; } - inline SwTwips GetOffs() const { return nOffs; } - inline void ClrOffs() { nOffs = 0; } - inline SwTwips GetRight() const { return nWidth ? nX + nWidth - 1 : nX; } -}; - -typedef SwStripes* SwStripesPtr; -SV_DECL_PTRARR_SORT(SwScrollStripes, SwStripesPtr, 1, 4) - -class SwScrollArea : public SwScrollColumn, public SwScrollStripes -{ -public: - void SmartInsert( SwStripes* pStripes ); - void Add( SwScrollArea *pScroll ); - inline SwScrollArea( const SwScrollColumn &rCol, SwStripes* pStripes ) - : SwScrollColumn( rCol ) - { Insert( pStripes ); } - BOOL Compress(); -}; - -typedef SwScrollArea* SwScrollAreaPtr; -SV_DECL_PTRARR_SORT(SScrAreas,SwScrollAreaPtr,1,2) - -class SwScrollAreas : public SScrAreas -{ -public: - void InsertCol( const SwScrollColumn &rCol, SwStripes *pStripes ); -}; - - -#endif //_SCRRECT_HXX diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index bde145fc06..bdaadecf64 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -46,7 +46,6 @@ class SwBorderAttrs; class SwFrmFmt; class OutputDevice; class SwTestFormat; -class SwStripes; struct SwCrsrMoveState; struct SwFillData; class SwPortionHandler; @@ -544,8 +543,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 5092ede30e..5403ffe89d 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -42,7 +42,6 @@ class ViewShell; class SwFlyFrm; class SwViewOption; class SwRegionRects; -class SwScrollAreas; class SwFrm; class SwLayAction; class SwLayIdle; @@ -86,8 +85,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 @@ -99,17 +96,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; @@ -144,21 +135,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 @@ -224,32 +200,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; } @@ -364,20 +317,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/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index a1ad57fad5..3118e73c14 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2727,10 +2727,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(); @@ -2802,7 +2815,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_PARA ); + SetFmtAttr( aAnchorAttr ); + MakeFrms(); + return; + } + // <-- + } if( pFrm->GetDrawObjs() ) { diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index a742b97a45..d516598eca 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -510,10 +510,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 + //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 + //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; { @@ -2127,13 +2127,15 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways ) // OD 30.10.2002 #97265# - no <CheckPageDesc(..)> 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; diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index ea7fbdecaf..32be148927 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -371,149 +371,6 @@ void SwLayAction::PaintCntnt( const SwCntntFrm *pCnt, /************************************************************************* |* -|* SwLayAction::_AddScrollRect() -|* -|* Ersterstellung MA 04. Mar. 94 -|* Letzte Aenderung MA 04. Mar. 94 -|* -|*************************************************************************/ -BOOL MA_FASTCALL lcl_IsOverObj( const SwFrm *pFrm, const SwPageFrm *pPage, - const SwRect &rRect1, const SwRect &rRect2, - const SwLayoutFrm *pLay ) -{ - const SwSortedObjs &rObjs = *pPage->GetSortedObjs(); - const SwFlyFrm *pSelfFly = pFrm->FindFlyFrm(); - const BOOL bInCnt = pSelfFly && pSelfFly->IsFlyInCntFrm() ? TRUE : FALSE; - - for ( sal_uInt32 j = 0; j < rObjs.Count(); ++j ) - { - // --> OD 2004-07-07 #i28701# - consider changed type of <SwSortedObjs> entries - const SwAnchoredObject* pAnchoredObj = rObjs[j]; - const SwRect aRect( pAnchoredObj->GetObjRect() ); - if ( !rRect1.IsOver( aRect ) && !rRect2.IsOver( aRect ) ) - continue; //Keine Ueberlappung, der naechste. - - const SwFlyFrm *pFly = pAnchoredObj->ISA(SwFlyFrm) - ? static_cast<const SwFlyFrm*>(pAnchoredObj) : 0; - - //Wenn der Rahmen innerhalb des LayFrm verankert ist, so darf er - //mitgescrollt werden, wenn er nicht seitlich aus dem Rechteck - //herausschaut. - if ( pLay && pFly && pFly->IsLowerOf( pLay ) ) - { - if ( pFly->Frm().Left() < rRect1.Left() || - pFly->Frm().Right()> rRect1.Right() ) - return TRUE; - continue; - } - - if ( !pSelfFly ) //Nur wenn der Frm in einem Fly steht kann - return TRUE; //es Einschraenkungen geben. - - if ( !pFly ) //Keine Einschraenkung fuer Zeichenobjekte. - return TRUE; - - if ( pFly != pSelfFly ) - { - //Flys unter dem eigenen nur dann abziehen, wenn sie innerhalb des - //eigenen stehen. - //Fuer inhaltsgebundene Flys alle Flys abziehen fuer die gilt, dass - //pSelfFly nicht innerhalb von ihnen steht. - if ( bInCnt ) - { - const SwFlyFrm *pTmp = pSelfFly->GetAnchorFrm()->FindFlyFrm(); - while ( pTmp ) - { - if ( pTmp == pFly ) - return FALSE; - else - pTmp = pTmp->GetAnchorFrm()->FindFlyFrm(); - } - } else if ( pAnchoredObj->GetDrawObj()->GetOrdNum() < - pSelfFly->GetVirtDrawObj()->GetOrdNum() ) - { - const SwFlyFrm *pTmp = pFly; - do - { if ( pTmp == pSelfFly ) - return TRUE; - else - pTmp = pTmp->GetAnchorFrm()->FindFlyFrm(); - } while ( pTmp ); - } else - return TRUE; - } - } - return FALSE; -} - -void SwLayAction::_AddScrollRect( const SwCntntFrm *pCntnt, - const SwPageFrm *pPage, - const SwTwips nOfst, - const SwTwips nOldBottom ) -{ - // --> OD 2004-07-01 #i28701# - determine, if scrolling is allowed. - bool bScroll = mbScrollingAllowed; - SwRect aPaintRect( pCntnt->PaintArea() ); - SWRECTFN( pCntnt ) - - // --> OD 2007-11-27 #notes2# - // if sidebar for notes is present, no scrolling is allowed - if ( bScroll ) - { - const SwPostItMgr* pPostItMgr = pImp->GetShell()->GetPostItMgr(); - if ( pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ) - { - bScroll = false; - } - } - // <-- - - //Wenn altes oder neues Rechteck mit einem Fly ueberlappen, in dem der - //Cntnt nicht selbst steht, so ist nichts mit Scrollen. - if ( bScroll && pPage->GetSortedObjs() ) - { - SwRect aRect( aPaintRect ); - if( bVert ) - aPaintRect.Pos().X() += nOfst; - else - aPaintRect.Pos().Y() -= nOfst; - - if ( ::lcl_IsOverObj( pCntnt, pPage, aPaintRect, aRect, 0 ) ) - bScroll = false; - - if( bVert ) - aPaintRect.Pos().X() -= nOfst; - else - aPaintRect.Pos().Y() += nOfst; - } - if ( bScroll && pPage->GetFmt()->GetBackground().GetGraphicPos() != GPOS_NONE ) - bScroll = false; - - if ( bScroll ) - { - if( aPaintRect.HasArea() ) - pImp->GetShell()->AddScrollRect( pCntnt, aPaintRect, nOfst ); - if ( pCntnt->IsRetouche() && !pCntnt->GetNext() ) - { - SwRect aRect( pCntnt->GetUpper()->PaintArea() ); - (aRect.*fnRect->fnSetTop)( (pCntnt->*fnRect->fnGetPrtBottom)() ); - if ( !pImp->GetShell()->AddPaintRect( aRect ) ) - pCntnt->ResetRetouche(); - } - pCntnt->ResetCompletePaint(); - } - else if( aPaintRect.HasArea() ) - { - if( bVert ) - aPaintRect.Pos().X() += nOfst; - else - aPaintRect.Pos().Y() -= nOfst; - PaintCntnt( pCntnt, pPage, aPaintRect, nOldBottom ); - } -} - -/************************************************************************* -|* |* SwLayAction::SwLayAction() |* |* Ersterstellung MA 30. Oct. 92 @@ -538,8 +395,6 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) : bUpdateExpFlds = bBrowseActionStop = bActionInProgress = FALSE; // OD 14.04.2003 #106346# - init new flag <mbFormatCntntOnInterrupt>. mbFormatCntntOnInterrupt = sal_False; - // --> OD 2004-06-14 #i28701# - mbScrollingAllowed = true; pImp->pLayAct = this; //Anmelden } @@ -654,8 +509,6 @@ void SwLayAction::Action() pRoot->ResetTurboFlag(); pRoot->ResetTurbo(); - if ( IsInput() ) - pImp->GetShell()->SetNoNextScroll(); SetCheckPages( TRUE ); bActionInProgress = FALSE; @@ -735,34 +588,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."); @@ -864,8 +689,6 @@ void SwLayAction::InternalAction() // <NotifyLayoutOfPageInProgress> { NotifyLayoutOfPageInProgress aLayoutOfPageInProgress( *pPage ); - // --> OD 2004-07-01 #i28701# - determine, if scrolling is allowed. - mbScrollingAllowed = lcl_ScrollingAllowed( *pPage ); while ( !IsInterrupt() && !IsNextCycle() && ((IS_FLYS && IS_INVAFLY) || pPage->IsInvalid()) ) @@ -1838,219 +1661,6 @@ BOOL SwLayAction::FormatLayoutFly( SwFlyFrm* pFly ) return bChanged || bTabChanged; } -BOOL MA_FASTCALL lcl_AreLowersScrollable( const SwLayoutFrm *pLay ) -{ - const SwFrm *pLow = pLay->Lower(); - while ( pLow ) - { - if ( pLow->IsCompletePaint() || !pLow->IsValid() || pLow->IsCoveredCell() ) - return FALSE; - if ( pLow->IsLayoutFrm() && !::lcl_AreLowersScrollable( (SwLayoutFrm*)pLow )) - return FALSE; - pLow = pLow->GetNext(); - } - return TRUE; -} - -SwLayoutFrm * MA_FASTCALL lcl_IsTabScrollable( SwTabFrm *pTab ) -{ - //returnt die erste unveraenderte Zeile, oder 0 wenn nicht - //gescrollt werden darf. - if ( !pTab->IsCompletePaint() ) - { - SwLayoutFrm *pUnchgdRow = 0; - SwLayoutFrm *pRow = (SwLayoutFrm*)pTab->Lower(); - while ( pRow ) - { - if ( ::lcl_AreLowersScrollable( pRow ) ) - { - if ( !pUnchgdRow ) - pUnchgdRow = pRow; - } - else - { - pUnchgdRow = 0; - } - - pRow = (SwLayoutFrm*)pRow->GetNext(); - } - return pUnchgdRow; - } - return 0; -} - -// OD 2004-05-11 #i28701# -void lcl_ValidateLowerObjs( SwFrm* pFrm, - const SwTwips nOfst, - SwPageFrm *pPage, - bool bResetOnly ); - -// OD 2004-05-11 #i28701# - correction: floating screen objects, which are -// anchored at-fly, have also been to be considered. -void MA_FASTCALL lcl_ValidateLowers( SwLayoutFrm *pLay, const SwTwips nOfst, - SwLayoutFrm *pRow, SwPageFrm *pPage, - BOOL bResetOnly ) -{ - pLay->ResetCompletePaint(); - - // OD 2004-05-11 #i28701# - consider floating screen objects, which are - // anchored at-fly. - if ( pLay->IsFlyFrm() ) - { - ::lcl_ValidateLowerObjs( pLay, nOfst, pPage, bResetOnly ); - } - - SwFrm *pLow = pRow ? pRow : pLay->Lower(); - SwRootFrm *pRootFrm = 0; - - while ( pLow ) - { - if ( !bResetOnly ) - { - SwRect aOldFrm( pLow->Frm() ); - pLow->Frm().Pos().Y() += nOfst; - if( pLow->IsAccessibleFrm() ) - { - if( !pRootFrm ) - pRootFrm = pPage->FindRootFrm(); - if( pRootFrm && pRootFrm->IsAnyShellAccessible() && - pRootFrm->GetCurrShell() ) - { - pRootFrm->GetCurrShell()->Imp()->MoveAccessibleFrm( pLow, aOldFrm ); - } - } - } - if ( pLow->IsLayoutFrm() ) - { - ::lcl_ValidateLowers( (SwLayoutFrm*)pLow, nOfst, 0, pPage, bResetOnly); - } - else - { - pLow->ResetCompletePaint(); - // OD 2004-05-11 #i28701# - use new local helper method - // <lcl_ValidateLowerObjs(..)> - ::lcl_ValidateLowerObjs( pLow, nOfst, pPage, bResetOnly); - } - if ( !bResetOnly ) - pLow->Calc(); //#55435# Stabil halten. - pLow = pLow->GetNext(); - } -} - -// OD 2004-05-11 #i28701# - helper method for <lcl_ValidateLowers(..)> to -// 'ValidateLowers' for floating screen objects -void lcl_ValidateLowerObjs( SwFrm* pFrm, - const SwTwips nOfst, - SwPageFrm *pPage, - bool bResetOnly ) -{ - if ( pFrm->GetDrawObjs() ) - { - // --> OD 2004-10-15 #i26945# - consider layout direction - SWRECTFN( pFrm ) - // <-- - for ( USHORT i = 0; i < pFrm->GetDrawObjs()->Count(); ++i ) - { - SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i]; - // --> OD 2004-10-08 #i26945# - check, if the anchor frame, which - // contains the anchor position, is the given frame - if ( pAnchoredObj->GetAnchorFrmContainingAnchPos() != pFrm ) - { - continue; - } - if ( pAnchoredObj->ISA(SwFlyFrm) ) - { - SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj); - if ( !bResetOnly ) - { - // --> OD 2004-10-15 #i26945# - // - consider layout direction - // - consider condition for direct move - const bool bNoDirectMove = - WEIT_WECH == pFly->Frm().Top() || - pFly->ConsiderObjWrapInfluenceOnObjPos(); - if ( !bNoDirectMove ) - { - (pFly->Frm().*fnRect->fnSubTop)( -nOfst ); - (pFly->Frm().*fnRect->fnAddBottom)( nOfst ); - } - // <-- - pFly->GetVirtDrawObj()->SetRectsDirty(); - // --> OD 2004-08-17 - also notify view of <SdrObject> - // instance, which represents the Writer fly frame in the - // drawing layer - pFly->GetVirtDrawObj()->SetChanged(); - // <-- - if ( pFly->IsFlyInCntFrm() ) - ((SwFlyInCntFrm*)pFly)->AddRefOfst( nOfst ); - // --> OD 2004-10-15 #i26945# - consider at-character - // anchored Writer fly frames - else if( pFly->IsAutoPos() ) - { - pFly->AddLastCharY( nOfst ); - // OD 2004-05-18 #i28701# - follow-up of #i22341# - // <mnLastTopOfLine> has also been adjusted. - pFly->AddLastTopOfLineY( nOfst ); - } - // <-- - } - ::lcl_ValidateLowers( pFly, nOfst, 0, pPage, bResetOnly); - } - // --> OD 2004-10-15 #i26945# - consider drawing objects - else - { - if ( !bResetOnly ) - { - pAnchoredObj->AddLastCharY( nOfst ); - pAnchoredObj->AddLastTopOfLineY( nOfst ); - } - } - // <-- - pAnchoredObj->InvalidateObjPos(); - } - } -} - -void MA_FASTCALL lcl_AddScrollRectTab( SwTabFrm *pTab, SwLayoutFrm *pRow, - const SwRect &rRect, - const SwTwips nOfst) -{ - // --> OD 2007-11-27 #notes2# - // if sidebar for notes is present, no scrolling is allowed - const SwPageFrm* pPage = pTab->FindPageFrm(); - ASSERT( pPage, "<lcl_AddScrollRectTab(..)> - no page frame found at table frame -> crash" ); - ViewShell* pSh = pPage->GetShell(); - if ( pSh ) - { - const SwPostItMgr* pPostItMgr = pSh->GetPostItMgr(); - if ( pPostItMgr && pPostItMgr->HasNotes() && pPostItMgr->ShowNotes() ) - { - return; - } - } - // <-- - //Wenn altes oder neues Rechteck mit einem Fly ueberlappen, in dem der - //Frm nicht selbst steht, so ist nichts mit Scrollen. - SwRect aRect( rRect ); - // OD 04.11.2002 #104100# - <SWRECTFN( pTab )> not needed. - if( pTab->IsVertical() ) - aRect.Pos().X() -= nOfst; - else - aRect.Pos().Y() += nOfst; - if ( pPage->GetSortedObjs() ) - { - if ( ::lcl_IsOverObj( pTab, pPage, rRect, aRect, pTab ) ) - return; - } - if ( pPage->GetFmt()->GetBackground().GetGraphicPos() != GPOS_NONE ) - return; - - if ( pSh ) - pSh->AddScrollRect( pTab, aRect, nOfst ); - ::lcl_ValidateLowers( pTab, nOfst, pRow, pTab->FindPageFrm(), - pTab->IsLowersFormatted() ); -} - // OD 31.10.2002 #104100# // NOTE: no adjustments for vertical layout support necessary BOOL CheckPos( SwFrm *pFrm ) @@ -2093,76 +1703,27 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect ) if ( !pTab->IsValid() || pTab->IsCompletePaint() || pTab->IsComplete() ) { if ( pTab->GetPrev() && !pTab->GetPrev()->IsValid() ) - pTab->GetPrev()->SetCompletePaint(); - - //Potenzielles Scrollrect ist die ganze Tabelle. Da bereits ein - //Wachstum innerhalb der Tabelle - und damit der Tabelle selbst - - //stattgefunden haben kann, muss die untere Kante durch die - //Unterkante der letzten Zeile bestimmt werden. - SwLayoutFrm* pRow = 0L; - SwRect aScrollRect( pTab->PaintArea() ); - // --> OD 2004-07-01 #i28701# - check, if scrolling is allowed. - if ( mbScrollingAllowed && - ( IsPaint() || bAddRect ) ) { - pRow = static_cast<SwLayoutFrm*>(pTab->GetLastLower()); - // OD 31.10.2002 #104100# - vertical layout support - (aScrollRect.*fnRect->fnSetBottom)( (pRow->Frm().*fnRect->fnGetBottom)() ); - //Die Oberkante wird ggf. durch die erste unveraenderte Zeile bestimmt. - pRow = ::lcl_IsTabScrollable( pTab ); - if ( pRow && pRow != pTab->Lower() ) - // OD 31.10.2002 #104100# - vertical layout support - (aScrollRect.*fnRect->fnSetTop)( (pRow->Frm().*fnRect->fnGetTop)() ); + pTab->GetPrev()->SetCompletePaint(); } - const SwFrm *pOldUp = pTab->GetUpper(); - - SwRect aOldRect( pTab->Frm() ); + const SwRect aOldRect( pTab->Frm() ); pTab->SetLowersFormatted( FALSE ); pTab->Calc(); if ( aOldRect != pTab->Frm() ) + { bChanged = TRUE; - SwRect aPaintFrm = pTab->PaintArea(); + } + const SwRect aPaintFrm = pTab->PaintArea(); if ( IsPaint() && bAddRect ) { - // --> OD 2004-07-01 #i28701# - check, if scrolling is allowed - if ( mbScrollingAllowed && - pRow && pOldUp == pTab->GetUpper() && - pTab->Frm().SSize() == aOldRect.SSize() && - // OD 31.10.2002 #104100# - vertical layout support - (pTab->Frm().*fnRect->fnGetLeft)() == (aOldRect.*fnRect->fnGetLeft)() && - pTab->IsAnLower( pRow ) ) - { - SwTwips nOfst; - if ( pRow->GetPrev() ) - { - if ( pRow->GetPrev()->IsValid() || - ::CheckPos( pRow->GetPrev() ) ) - { - // OD 31.10.2002 #104100# - vertical layout support - nOfst = -(pRow->Frm().*fnRect->fnTopDist)( (pRow->GetPrev()->Frm().*fnRect->fnGetBottom)() ); - } - else - nOfst = 0; - } - else - // OD 31.10.2002 #104100# - vertical layout support - nOfst = (pTab->Frm().*fnRect->fnTopDist)( (aOldRect.*fnRect->fnGetTop)() ); - - if ( nOfst ) - { - ::lcl_AddScrollRectTab( pTab, pRow, aScrollRect, nOfst ); - bPainted = TRUE; - } - } - // OD 01.11.2002 #104100# - add condition <pTab->Frm().HasArea()> - if ( !pTab->IsCompletePaint() && pTab->IsComplete() && + if ( !pTab->IsCompletePaint() && + pTab->IsComplete() && ( pTab->Frm().SSize() != pTab->Prt().SSize() || // OD 31.10.2002 #104100# - vertical layout support - (pTab->*fnRect->fnGetLeftMargin)() - ) && + (pTab->*fnRect->fnGetLeftMargin)() ) && pTab->Frm().HasArea() ) { @@ -2478,13 +2039,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(); @@ -2492,23 +2046,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 { @@ -2907,7 +2448,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) : { --pSh->nStartAction; - if ( pSh->Imp()->GetRegion() || pSh->Imp()->GetScrollRects() ) + if ( pSh->Imp()->GetRegion() ) bActions = TRUE; else { @@ -2953,9 +2494,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 d4ce26c6ae..c231312dc9 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1645,7 +1645,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(); @@ -2804,7 +2804,7 @@ void SwRootFrm::Paint( const SwRect& rRect, const SwPrtOptions *pPrintData ) con 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 2e9ed33e49..e1ec505964 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -2790,9 +2790,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 36ebd8ee72..e8fc5b382b 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -59,7 +59,6 @@ #include <redlnitr.hxx> // SwRedlineItr #include <swmodule.hxx> // SW_MOD #include <tabfrm.hxx> // SwTabFrm (Redlining) -#include <scrrect.hxx> #include <SwGrammarMarkUp.hxx> // --> FME 2004-06-08 #i12836# enhanced pdf export @@ -748,70 +747,3 @@ void SwTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ ) } } -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/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 9d4b913cfb..0b7029065f 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -628,23 +628,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<xub_StrLen>(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<xub_StrLen>(nFound) ) ) + { + nFound++; + } - return nFound; + return nFound <= STRING_LEN + ? static_cast<xub_StrLen>(nFound) + : STRING_LEN; + // <-- } /************************************************************************* diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 78a0f3bb5e..40b04898ba 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -481,6 +481,7 @@ static sal_Char __READONLY_DATA sStandardString[] = "Dies ist der Teststring"; pScrFont = pPrtFont; FontMetric aMet = pPrt->GetFontMetric( ); + bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet(); if ( USHRT_MAX == nGuessedLeading ) @@ -2417,21 +2418,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 ) ) @@ -2442,7 +2440,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 ); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 9a9dbcb6a5..7481a3ec79 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2886,6 +2886,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<USHORT>(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/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 5d0a0d8e76..70863d4f02 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -236,13 +236,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 ) { diff --git a/sw/source/core/view/makefile.mk b/sw/source/core/view/makefile.mk index aa010e6b60..7a0f19c956 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 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,6 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- SLOFILES = \ - $(SLO)$/scrrect.obj \ $(SLO)$/vdraw.obj \ $(SLO)$/viewimp.obj \ $(SLO)$/viewsh.obj \ @@ -48,10 +47,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 b3d44821d2..0000000000 --- a/sw/source/core/view/scrrect.cxx +++ /dev/null @@ -1,1192 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" - - -#include <viewimp.hxx> -#include <viewsh.hxx> -#include <viewopt.hxx> -#include <vcl/window.hxx> -#include <scrrect.hxx> // SwScrollRect, SwScrollRects -// OD 18.02.2003 #107562# - <SwAlignRect> for <ViewShell::Scroll()> -#include <frmtool.hxx> -#ifndef _CURSOR_HXX //autogen -#include <vcl/cursor.hxx> -#endif -#include <vcl/virdev.hxx> -#ifndef _APP_HXX //autogen -#include <vcl/svapp.hxx> -#endif -#include <txtfrm.hxx> -#include "crsrsh.hxx" -#include "rootfrm.hxx" -#include "pagefrm.hxx" - -// OD 12.11.2002 #96272# - include declaration for <SetMappingForVirtDev> -#include "setmapvirtdev.hxx" -#include <IDocumentDrawModelAccess.hxx> - -// #i75172# -#include "dview.hxx" - -DBG_NAME(RefreshTimer) - -SV_IMPL_VARARR(SwStripeArr,SwStripe); -SV_IMPL_OP_PTRARR_SORT(SwScrollStripes, SwStripesPtr); -SV_IMPL_OP_PTRARR_SORT(SScrAreas, SwScrollAreaPtr); - -/***************************************************************************** -|* -|* ViewShell::AddScrollRect() -|* -|* Creation MA 07. Mar. 94 -|* Last change AMA 20. July 00 -|* -|* Description -|* ViewShell::AddScrollRect(..) passes a registration from a scrolling frame or -|* rectangle to all ViewShells and SwViewImps respectively. -|* -******************************************************************************/ - -void ViewShell::AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, - long nOfs ) -{ - ASSERT( pFrm, "Where is my friend, the frame?" ); - BOOL bScrollOn = TRUE; - -#ifdef NOSCROLL - //Auch im Product per speziellem Compilat abschaltbar. - bScrollOn = FALSE; -#endif - - if( bScrollOn && Imp()->IsScroll() && nOfs <= SHRT_MAX && nOfs >= SHRT_MIN ) - { - ViewShell *pSh = this; - do - { - pSh->Imp()->AddScrollRect( pFrm, rRect, nOfs ); - pSh = (ViewShell*)pSh->GetNext(); - } while ( pSh != this ); - } - else - AddPaintRect( rRect ); -} - -/****************************************************************************** -|* -|* ViewShell::Scroll() -|* -|* Ersterstellung MA 07. Mar. 94 -|* Last change AMA 21. July 00 -|* -|* Description -|* ViewShell::Scroll() scrolls all rectangles in the pScrollRects-list and -|* transfers the critical lines by calling SwViewImp::MoveScrollArea(..). -|* -******************************************************************************/ -#include <svx/sdrpaintwindow.hxx> -#include <svx/sdr/overlay/overlaymanager.hxx> - -void ViewShell::Scroll() -{ - SwScrollAreas *pScrollRects = Imp()->GetScrollRects(); - if ( pScrollRects ) - { - bPaintWorks = FALSE; - ASSERT( pScrollRects->Count(), "ScrollRects ohne ScrollRects." ); - - //Abgleichen der Region mit den Scroll-Bereichen!!! - //Wenn eines der Scroll-Rechtecke ungueltig wird, so muss - //der PaintMode wahrscheinlich auf PAINT_BACKGROUND umgeschaltet - //werden. - - //Auf die Richtung kommt es an: - //- Bei einem pos. Ofst muss von hinten nach vorn gescrollt werden. - //- Bei einem neg. Ofst muss von vorn nach hinten gescrollt werden. - BOOL bPositive = (*pScrollRects)[0]->GetOffs() > 0; - if( (*pScrollRects)[0]->IsVertical() ) - bPositive = !bPositive; - int i = bPositive ? pScrollRects->Count()-1 : 0; - - for ( ; bPositive ? - i >= 0 : - i < (int)pScrollRects->Count(); - bPositive ? - --i : - ++i ) - { - const SwScrollArea &rScroll = *(*pScrollRects)[ sal::static_int_cast<USHORT>(i) ]; - if( rScroll.Count() ) - { - int j = bPositive ? rScroll.Count()-1 : 0; - for ( ; bPositive ? j >= 0 : j < (int)rScroll.Count(); - bPositive ? --j : ++j ) - { - const SwStripes& rStripes = *rScroll[ sal::static_int_cast<USHORT>(j) ]; - if( rScroll.IsVertical() ) - { - Rectangle aRectangle( rStripes.GetY() - - rStripes.GetHeight() + rScroll.GetOffs(), - rStripes.GetMin(), - rStripes.GetY() + rScroll.GetOffs(), - rStripes.GetMax() ); - // OD 18.02.2003 #107562# - align rectangle for scrolling - SwRect aAlignedScrollRect( aRectangle ); - ::SwAlignRect( aAlignedScrollRect, this ); - - // #i68597# when scrolling, let DrawingLayer know about refreshed areas, - // even when no DL objects are in the area. This is needed to allow - // fully buffered overlay. - const Rectangle aSourceRect(aAlignedScrollRect.SVRect()); - const Rectangle aTargetRect( - aSourceRect.Left() - rScroll.GetOffs(), aSourceRect.Top(), - aSourceRect.Right() - rScroll.GetOffs(), aSourceRect.Bottom()); - - if(GetWin()) - { - // SCROLL_NOWINDOWINVALIDATE okay since AddPaintRect below adds the to-be-invalidated region - GetWin()->Scroll( -rScroll.GetOffs(), 0, aSourceRect, SCROLL_CHILDREN | SCROLL_NOWINDOWINVALIDATE ); - } - - // #i68597# if buffered overlay, the buffered content needs to be scrolled directly - { - SdrPaintWindow* pPaintWindow = GetDrawView()->GetPaintWindow(0); - - if(pPaintWindow) - { - sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager(); - - if(pOverlayManager) - { - pOverlayManager->copyArea(aTargetRect.TopLeft(), aSourceRect.TopLeft(), aSourceRect.GetSize()); - } - } - } - - SwRect aRect( aRectangle ); - Imp()->ScrolledRect( aRect, -rScroll.GetOffs() ); - if ( bPositive ) - aRect.Right( aRect.Left() + rScroll.GetOffs()-1 ); - else - aRect.Left( aRect.Right() - rScroll.GetOffs() ); - Imp()->AddPaintRect( aRect ); - } - else - { - Rectangle aRectangle( rStripes.GetMin(), - rStripes.GetY() - rScroll.GetOffs(), - rStripes.GetRight(), - rStripes.GetBottom() - rScroll.GetOffs() ); - // OD 18.02.2003 #107562# - use aligned rectangle for scrolling - SwRect aAlignedScrollRect( aRectangle ); - ::SwAlignRect( aAlignedScrollRect, this ); - - // #i68597# when scrolling, let DrawingLayer know about refreshed areas, - // even when no DL objects are in the area. This is needed to allow - // fully buffered overlay. - const Rectangle aSourceRect(aAlignedScrollRect.SVRect()); - const Rectangle aTargetRect( - aSourceRect.Left(), aSourceRect.Top() + rScroll.GetOffs(), - aSourceRect.Right(), aSourceRect.Bottom() + rScroll.GetOffs()); - - if(GetWin()) - { - // SCROLL_NOWINDOWINVALIDATE okay since AddPaintRect below adds the to-be-invalidated region - GetWin()->Scroll( 0, rScroll.GetOffs(), aSourceRect, SCROLL_CHILDREN | SCROLL_NOWINDOWINVALIDATE ); - } - - // #i68597# if buffered overlay, the buffered content needs to be scrolled directly - { - SdrPaintWindow* pPaintWindow = GetDrawView()->GetPaintWindow(0); - - if(pPaintWindow) - { - sdr::overlay::OverlayManager* pOverlayManager = pPaintWindow->GetOverlayManager(); - - if(pOverlayManager) - { - pOverlayManager->copyArea(aTargetRect.TopLeft(), aSourceRect.TopLeft(), aSourceRect.GetSize()); - } - } - } - - SwRect aRect( aRectangle ); - Imp()->ScrolledRect( aRect, rScroll.GetOffs() ); - if ( bPositive ) - aRect.Bottom( aRect.Top() + rScroll.GetOffs()-1 ); - else - aRect.Top( aRect.Bottom() + rScroll.GetOffs() ); - Imp()->AddPaintRect( aRect ); - } - } - } - } - if ( !Imp()->IsScrolled() ) - Imp()->SetScrolled(); - - Imp()->MoveScrollArea(); - bPaintWorks = TRUE; - } -} - -/****************************************************************************** -|* -|* ViewShell::SetNoNextScroll() -|* -|* Ersterstellung MA 08. Mar. 94 -|* Letzte Aenderung MA 08. Mar. 94 -|* -******************************************************************************/ - -void ViewShell::SetNoNextScroll() -{ - ViewShell *pSh = this; - do - { pSh->Imp()->ResetNextScroll(); - pSh = (ViewShell*)pSh->GetNext(); - - } while ( pSh != this ); -} - -/****************************************************************************** -|* -|* SwViewImp::AddScrollRect() -|* -|* Ersterstellung MA 07. Mar. 94 -|* Last change AMA 21. July 00 -|* -|* Adds a scrollable rectangle and his critical lines to the list. -|* -******************************************************************************/ - -void SwViewImp::AddScrollRect( const SwFrm *pFrm, const SwRect &rRect, - long nOffs ) -{ - ASSERT( nOffs != 0, "Scrollen ohne Ofst." ); - SwRect aRect( rRect ); - BOOL bVert = pFrm->IsVertical(); - if( bVert ) - aRect.Pos().X() += nOffs; - else - aRect.Pos().Y() -= nOffs; - if( aRect.IsOver( pSh->VisArea() ) ) - { - ASSERT( pSh->GetWin(), "Scrolling without outputdevice" ); - aRect._Intersection( pSh->VisArea() ); - SwStripes *pStr; - if ( !pScrollRects ) - pScrollRects = new SwScrollAreas; - if( bVert ) - { - aRect.Pos().X() -= nOffs; - pStr = new SwStripes( aRect.Right(), aRect.Width(), - aRect.Top(), aRect.Bottom() ); - if( pFrm->IsTxtFrm() ) - ((SwTxtFrm*)pFrm)->CriticalLines(*pSh->GetWin(), *pStr, nOffs ); - else - pStr->Insert( SwStripe( aRect.Right(), aRect.Width() ), 0 ); - pScrollRects->InsertCol( SwScrollColumn( pFrm->Frm().Top(), - pFrm->Frm().Height(), nOffs, bVert ), pStr); - } - else - { - aRect.Pos().Y() += nOffs; - pStr = new SwStripes( aRect.Top(), aRect.Height(), - aRect.Left(), aRect.Right() ); - if( pFrm->IsTxtFrm() ) - ((SwTxtFrm*)pFrm)->CriticalLines(*pSh->GetWin(), *pStr, nOffs ); - else - pStr->Insert( SwStripe( aRect.Top(), aRect.Height() ), 0 ); - pScrollRects->InsertCol( SwScrollColumn( pFrm->Frm().Left(), - pFrm->Frm().Width(), nOffs, bVert ), pStr ); - } - } - else - AddPaintRect( rRect ); -} - -/****************************************************************************** -|* -|* SwViewImp::MoveScrollArea() -|* -|* Creation AMA 10. July 00 -|* Last change AMA 21. July 00 -|* -|* Transfers the areas after scrolling to the scrolled list, but only those -|* parts with critical lines. -|* -******************************************************************************/ - -void SwViewImp::MoveScrollArea() -{ - if( !pScrolledArea ) - pScrolledArea = new SwScrollAreas; - for( USHORT nIdx = 0; nIdx < pScrollRects->Count(); ++nIdx ) - { - SwScrollArea *pScr = (*pScrollRects)[ nIdx ]; - if( pScr->Compress() ) - delete pScr; - else - { - USHORT nIndx; - if( pScrolledArea->Seek_Entry( pScr, &nIndx ) ) - pScrolledArea->GetObject(nIndx)->Add( pScr ); - else - pScrolledArea->Insert( pScr ); - } - } - delete pScrollRects; - pScrollRects = NULL; -} - -/****************************************************************************** -|* -|* SwViewImp::FlushScrolledArea() -|* -|* Creation AMA 10. July 00 -|* Last change AMA 21. July 00 -|* -|* Flushes the scrolled critical lines, that is transfer them to AddPaintRect() -|* and remove them from the list. -|* -******************************************************************************/ - -void SwViewImp::FlushScrolledArea() -{ - USHORT nCount = pScrolledArea->Count(); - while( nCount ) - { - SwScrollArea* pScroll = (*pScrolledArea)[--nCount]; - USHORT nCnt = pScroll->Count(); - while( nCnt ) - { - SwStripes* pStripes = (*pScroll)[--nCnt]; - if( pScroll->IsVertical() ) - { - SwRect aRect( 0, pStripes->GetMin(), 0, pStripes->GetWidth() ); - for( USHORT i = 0; i < pStripes->Count(); ++i ) - { - long nWidth = (*pStripes)[i].GetHeight(); - aRect.Left( (*pStripes)[i].GetY() - nWidth + 1 ); - aRect.Width( nWidth ); - AddPaintRect( aRect ); - } - } - { - SwRect aRect( pStripes->GetMin(), 0, pStripes->GetWidth(), 0 ); - for( USHORT i = 0; i < pStripes->Count(); ++i ) - { - aRect.Top( (*pStripes)[i].GetY() ); - aRect.Height( (*pStripes)[i].GetHeight() ); - AddPaintRect( aRect ); - } - } - pScroll->Remove( nCnt ); - delete pStripes; - } - pScrolledArea->Remove( nCount ); - delete pScroll; - } - delete pScrolledArea; - pScrolledArea = NULL; -} - -/****************************************************************************** -|* -|* SwViewImp::_FlushScrolledArea(..) -|* -|* Creation AMA 10. July 00 -|* Last change AMA 21. July 00 -|* -|* The critical lines, which overlaps with the given rectangle, will be united -|* with the rectangle and removed from the list. -|* -******************************************************************************/ - -BOOL SwViewImp::_FlushScrolledArea( SwRect& rRect ) -{ - BOOL bRet = FALSE; - for( USHORT i = pScrolledArea->Count(); i; ) - { - SwScrollArea* pScroll = (*pScrolledArea)[--i]; - for( USHORT j = pScroll->Count(); j; ) - { - SwStripes* pStripes = (*pScroll)[--j]; - if( pStripes->Count() ) - { - if( pScroll->IsVertical() ) - { - SwRect aRect( pStripes->GetY() - pStripes->GetHeight(), - pStripes->GetMin(), pStripes->GetHeight(), - pStripes->GetWidth() ); - if( rRect.IsOver( aRect ) ) - { - for( USHORT nI = pStripes->Count(); nI; ) - { - long nWidth = (*pStripes)[--nI].GetHeight(); - aRect.Left( (*pStripes)[nI].GetY() - nWidth + 1 ); - aRect.Width( nWidth ); - if( rRect.IsOver( aRect ) ) - { - rRect.Union( aRect ); - bRet = TRUE; - pStripes->Remove( nI ); - nI = pStripes->Count(); - } - } - } - } - else - { - SwRect aRect( pStripes->GetMin(), pStripes->GetY(), - pStripes->GetWidth(), pStripes->GetHeight() ); - if( rRect.IsOver( aRect ) ) - { - for( USHORT nI = pStripes->Count(); nI; ) - { - aRect.Top( (*pStripes)[--nI].GetY() ); - aRect.Height( (*pStripes)[nI].GetHeight() ); - if( rRect.IsOver( aRect ) ) - { - rRect.Union( aRect ); - bRet = TRUE; - pStripes->Remove( nI ); - nI = pStripes->Count(); - } - } - } - } - } - if( !pStripes->Count() ) - { - pScroll->Remove( j ); - delete pStripes; - } - } - if( !pScroll->Count() ) - { - pScrolledArea->Remove( pScroll ); - delete pScroll; - } - } - if( !pScrolledArea->Count() ) - { - DELETEZ( pScrolledArea ); - SetNextScroll(); - } - return bRet; -} - -/****************************************************************************** -|* -|* SwViewImp::RefreshScrolledHdl(..) -|* -|* Creation MA 06. Oct. 94 -|* Last change AMA 21. July 00 -|* -|* Every timerstop one of the critical lines will be painted. -|* -******************************************************************************/ - -IMPL_LINK( SwViewImp, RefreshScrolledHdl, Timer *, EMPTYARG ) -{ - DBG_PROFSTART( RefreshTimer ); - - if ( !IsScrolled() ) - { DBG_PROFSTOP( RefreshTimer ); - return 0; - } - - SET_CURR_SHELL( GetShell() ); - - //Kein Refresh wenn eine Selektion besteht. - if ( GetShell()->IsA( TYPE(SwCrsrShell) ) && - (((SwCrsrShell*)GetShell())->HasSelection() || - ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1)) - { - DBG_PROFSTOP( RefreshTimer ); - return 0; - } - - if( pScrolledArea ) - { - const SwRect aRect( GetShell()->VisArea() ); - BOOL bNoRefresh = GetShell()->IsA( TYPE(SwCrsrShell) ) && - ( ((SwCrsrShell*)GetShell())->HasSelection() || - ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1 ); - if( pScrolledArea->Count() ) - { - SwScrollArea* pScroll = pScrolledArea->GetObject(0); - ASSERT( pScroll->Count(), "Empty scrollarea" ); - // OD 21.10.2003 #112616# - for savety reason: - // react, if precondition named in assertion isn't hold - if ( pScroll->Count() ) - { - SwStripes* pStripes = pScroll->GetObject(0); - // OD 20.10.2003 #112616# - consider also first stripe - ASSERT( pStripes->Count(), "Empty scrollstripes" ); - // OD 21.10.2003 #112616# - for savety reason: - // react, if precondition named in assertion isn't hold - if ( pStripes->Count() ) - { - const SwStripe &rStripe = pStripes->GetObject(0); - SwRect aTmpRect = pScroll->IsVertical() ? - SwRect( rStripe.GetY() - rStripe.GetHeight(), pScroll->GetX(), - rStripe.GetHeight(), pScroll->GetWidth() ) : - SwRect( pScroll->GetX(), rStripe.GetY(), - pScroll->GetWidth(), rStripe.GetHeight() ); - if( aTmpRect.IsOver( aRect ) ) - { - // SwSaveHdl aSaveHdl( this ); - if( !bNoRefresh ) - _RefreshScrolledArea( aTmpRect ); - } - // OD 20.10.2003 #112616# - consider also first stripe - pStripes->Remove( 0 ); - } - if( pStripes->Count() < 1 ) - { - pScroll->Remove( USHORT(0) ); - delete pStripes; - } - } - if( !pScroll->Count() ) - { - pScrolledArea->Remove( pScroll ); - delete pScroll; - } - } - if( !pScrolledArea->Count() ) - { - delete pScrolledArea; - pScrolledArea = 0; - } - } - - //All done? - if( !pScrolledArea || !pScrolledArea->Count() - ) - { - ResetScrolled(); - SetNextScroll(); - aScrollTimer.Stop(); - } - - DBG_PROFSTOP( RefreshTimer ); - return 0; -} - -/****************************************************************************** -|* -|* SwViewImp::_ScrolledRect(..) -|* -|* Creation AMA 20. July 00 -|* Last change AMA 21. July 00 -|* -|* handles the problem of scrolled criticals lines, when they are a part of -|* a scrolling area again. In this case, their rectangle has to move to the -|* right position. -|* -******************************************************************************/ - -void SwViewImp::_ScrolledRect( const SwRect& rRect, long nOffs ) -{ - for( USHORT i = pScrolledArea->Count(); i; ) - { - SwScrollArea* pScroll = (*pScrolledArea)[--i]; - ASSERT( pScroll->Count() == 1, "Missing scrollarea compression 1" ); - SwStripes* pStripes = (*pScroll)[0]; - if( pStripes->Count() ) - { - SwRect aRect = pScroll->IsVertical() ? - SwRect( pStripes->GetY() - pStripes->GetHeight(), - pStripes->GetMin(), pStripes->GetHeight(), - pStripes->GetWidth() ) : - SwRect( pStripes->GetMin(), pStripes->GetY(), - pStripes->GetWidth(), pStripes->GetHeight() ); - - if( rRect.IsOver( aRect ) ) - { - BOOL bRecalc = FALSE; - for( USHORT nI = pStripes->Count(); nI; ) - { - if( pScroll->IsVertical() ) - { - long nWidth = (*pStripes)[--nI].GetHeight(); - aRect.Left( (*pStripes)[nI].GetY() - nWidth + 1 ); - aRect.Width( nWidth ); - } - else - { - aRect.Top( (*pStripes)[--nI].GetY() ); - aRect.Height( (*pStripes)[nI].GetHeight() ); - } - if( rRect.IsInside( aRect ) ) - { - (*pStripes)[nI].Y() += nOffs; - bRecalc = TRUE; - } - } - if( bRecalc ) - pStripes->Recalc( pScroll->IsVertical() ); - } - } - } -} - -/****************************************************************************** -|* -|* SwViewImp::_RefreshScrolledArea() -|* -******************************************************************************/ - -//Berechnen der Hoehe fuer das virtuelle Device, Breite und maximaler -//Speicherbedarf sind vorgegeben. -#define MAXKB 180L - -static void lcl_CalcVirtHeight( OutputDevice *pOut, Size &rSz ) -{ - char nBytes; - const ULONG nColorCount = pOut->GetColorCount(); - if( 256 >= nColorCount ) // 2^8 - nBytes = 1; - else - if( USHRT_MAX >= nColorCount ) // 2^16 - nBytes = 2; - else - if( 16777216 >= nColorCount ) // 2^24 - nBytes = 3; - else - nBytes = 4; // 2^n - - rSz = pOut->LogicToPixel( rSz ); - - long nKB = MAXKB * 1000; - nKB /= nBytes; - if ( rSz.Width() > 0 ) - rSz.Height() = nKB / rSz.Width(); - else - rSz.Height() = nKB; - - rSz = pOut->PixelToLogic( rSz ); -} - -void SwViewImp::_RefreshScrolledArea( const SwRect &rRect ) -{ - SwRect aScRect( rRect ); - aScRect.Intersection( GetShell()->VisArea() ); - - if( aScRect.IsEmpty() ) - return; - - BOOL bShowCrsr = FALSE; - Window *pWin = GetShell()->GetWin(); - if ( pWin && pWin->GetCursor() && pWin->GetCursor()->IsVisible() ) - { - bShowCrsr = TRUE; - pWin->GetCursor()->Hide(); - } - - //Virtuelles Device erzeugen und einstellen. - // --> OD 2007-08-16 #i80720# - // rename variable <pOld> to <pCurrentOut> - OutputDevice* pCurrentOut = GetShell()->GetOut(); - VirtualDevice *pVout = new VirtualDevice( *pCurrentOut ); - MapMode aMapMode( pCurrentOut->GetMapMode() ); - pVout->SetMapMode( aMapMode ); - Size aSize( aScRect.Width(), 0 ); - lcl_CalcVirtHeight( pCurrentOut, aSize ); - if ( aSize.Height() > aScRect.Height() ) - aSize.Height() = aScRect.Height() + 50; - - //unten in der Schleife lassen wir die Rechtecke ein wenig ueberlappen, - //das muss auch bei der Groesse beruecksichtigt werden. - aSize = pCurrentOut->LogicToPixel( aSize ); - aSize.Width() += 4; aSize.Height() += 4; - aSize = pCurrentOut->PixelToLogic( aSize ); - // <-- - - const SwRootFrm* pLayout = GetShell()->GetLayout(); - - // #i75172# Avoid VDev if PreRendering is active - static bool bDoNotUseVDev(GetDrawView()->IsBufferedOutputAllowed()); - - // --> OD 2007-08-16 #i80720# - // Enlarge paint rectangle also in case that "own" virtual device <pVout> - // isn't used. Refactor code a little bit to achieve this. - const bool bApplyVDev = !bDoNotUseVDev && pVout->SetOutputSize( aSize ); - - { - if ( bApplyVDev ) - { - // --> OD 2007-08-16 #i80720# - // rename variable <pOld> to <pCurrentOut> - pVout->SetLineColor( pCurrentOut->GetLineColor() ); - pVout->SetFillColor( pCurrentOut->GetFillColor() ); - // <-- - } - - // #i72754# start Pre/PostPaint encapsulation before pOut is changed to the buffering VDev - const Region aRepaintRegion(aScRect.SVRect()); - GetShell()->DLPrePaint2(aRepaintRegion); - - //Virtuelles Device in die ViewShell 'selektieren' - // --> OD 2007-08-16 #i80720# - // remember current output device at this place - OutputDevice* pOldOut = GetShell()->GetOut(); - // <-- - if ( bApplyVDev ) - { - GetShell()->pOut = pVout; - } - - const SwFrm *pPg = GetFirstVisPage(); - do - { - SwRect aRect( pPg->Frm() ); - if ( aRect.IsOver( aScRect ) ) - { - aRect._Intersection( aScRect ); - do - { - Rectangle aTmp( aRect.SVRect() ); - long nTmp = aTmp.Top() + aSize.Height(); - if ( aTmp.Bottom() > nTmp ) - aTmp.Bottom() = nTmp; - - aTmp = pOldOut->LogicToPixel( aTmp ); - if( aRect.Top() > pPg->Frm().Top() ) - aTmp.Top() -= 2; - if( aRect.Top() + aRect.Height() < pPg->Frm().Top() - + pPg->Frm().Height() ) - aTmp.Bottom() += 2; - if( aRect.Left() > pPg->Frm().Left() ) - aTmp.Left() -= 2; - if( aRect.Left() + aRect.Width() < pPg->Frm().Left() - + pPg->Frm().Width() ) - aTmp.Right() += 2; - aTmp = pOldOut->PixelToLogic( aTmp ); - SwRect aTmp2( aTmp ); - - if ( bApplyVDev ) - { - // OD 12.11.2002 #96272# - use method to set mapping - //Point aOrigin( aTmp2.Pos() ); - //aOrigin.X() = -aOrigin.X(); aOrigin.Y() = -aOrigin.Y(); - //aMapMode.SetOrigin( aOrigin ); - ::SetMappingForVirtDev( aTmp2.Pos(), &aMapMode, pOldOut, pVout ); - pVout->SetMapMode( aMapMode ); - } - - pLayout->Paint( aTmp2 ); - if ( bApplyVDev ) - { - pOldOut->DrawOutDev( aTmp2.Pos(), aTmp2.SSize(), - aTmp2.Pos(), aTmp2.SSize(), *pVout ); - } - - aRect.Top( aRect.Top() + aSize.Height() ); - aScRect.Top( aRect.Top() ); - - } while ( aRect.Height() > 0 ); - } - pPg = pPg->GetNext(); - - } while ( pPg && pPg->Frm().IsOver( GetShell()->VisArea() ) ); - - if ( bApplyVDev ) - { - GetShell()->pOut = pOldOut; - } - delete pVout; - - // #i72754# end Pre/PostPaint encapsulation when pOut is back and content is painted - GetShell()->DLPostPaint2(true); - } - // <-- - - if ( bShowCrsr ) - pWin->GetCursor()->Show(); -} - -/****************************************************************************** -|* -|* SwViewImp::RefreshScrolledArea() -|* -|* Ersterstellung MA 06. Oct. 94 -|* Letzte Aenderung MA 19. Apr. 95 -|* -******************************************************************************/ - -void SwViewImp::RefreshScrolledArea( SwRect &rRect ) -{ - // --> OD 2007-07-24 #123003# - make code robust - // avoid recursive call - static bool bRunning( false ); - - if ( bRunning ) - { - ASSERT( false, "<SwViewImp::RefreshScrolledArea(..)> - recursive method call - please inform OD" ); - return; - } - // <-- - - //1. Wird auch von der CrsrShell gerufen, um ggf. den Bereich, in den der - //Crsr gesetzt wird (Absatz, ganze Zeile bei einer Tabelle) aufzufrischen. - //Allerdings kann es dann natuerlich sein, dass das Rechteck ueberhaupt - //nicht mit aufzufrischenden Bereichen ueberlappt. - //2. Kein Refresh wenn eine Selektion besteht. - if( (GetShell()->IsA( TYPE(SwCrsrShell) ) && - (((SwCrsrShell*)GetShell())->HasSelection() || - ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1))) - { - return; - } - - // --> OD 2007-07-27 #123003# - bRunning = true; - // <-- - - if( pScrolledArea && pScrolledArea->Count() && - !( ( GetShell()->IsA( TYPE(SwCrsrShell) ) && - ( ((SwCrsrShell*)GetShell())->HasSelection() || - ((SwCrsrShell*)GetShell())->GetCrsrCnt() > 1) ) ) ) - { - for( USHORT i = pScrolledArea->Count(); i; ) - { - SwScrollArea* pScroll = (*pScrolledArea)[--i]; - for( USHORT j = pScroll->Count(); j; ) - { - SwStripes* pStripes = (*pScroll)[--j]; - if( pStripes->Count() ) - { - SwRect aRect = pScroll->IsVertical() ? - SwRect( pStripes->GetY() - pStripes->GetHeight(), - pStripes->GetMin(), pStripes->GetHeight(), - pStripes->GetWidth() ) : - SwRect( pStripes->GetMin(), pStripes->GetY(), - pStripes->GetWidth(), pStripes->GetHeight() ); - if( rRect.IsOver( aRect ) ) - { - for( USHORT nI = pStripes->Count(); nI; ) - { - if( pScroll->IsVertical() ) - { - long nWidth = (*pStripes)[--nI].GetHeight(); - aRect.Left( (*pStripes)[nI].GetY() -nWidth +1 ); - aRect.Width( nWidth ); - } - else - { - aRect.Top( (*pStripes)[--nI].GetY() ); - aRect.Height( (*pStripes)[nI].GetHeight() ); - } - if( rRect.IsOver( aRect ) ) - { - pStripes->Remove( nI ); - _RefreshScrolledArea( aRect ); - } - } - } - } - if( !pStripes->Count() ) - { - pScroll->Remove( j ); - delete pStripes; - } - } - if( !pScroll->Count() ) - { - pScrolledArea->Remove( pScroll ); - delete pScroll; - } - //Ist da jemand ungeduldig? - //Nur Mouse und Keyboard, weil wir sonst von jeder billigen - //Uhr unterbrochen werden. - if( GetpApp()->AnyInput( INPUT_MOUSEANDKEYBOARD ) ) - break; - } - } - - //All done? - if( !pScrolledArea || !pScrolledArea->Count() ) - { - ResetScrolled(); - SetNextScroll(); - aScrollTimer.Stop(); - } - - // --> OD 2007-07-24 #123003# - bRunning = false; - // <-- -} - -SwStripes& SwStripes::Plus( const SwStripes& rOther, BOOL bVert ) -{ - if( !Count() ) - { - Insert( &rOther, 0 ); - SetMin( rOther.GetMin() ); - SetMax( rOther.GetMax() ); - return *this; - } - - long nCnt = rOther.Count(); - if( nCnt ) - { - ChkMin( rOther.GetMin() ); - ChkMax( rOther.GetMax() ); - USHORT nStart = 0; - if( bVert ) - for( USHORT nIdx = 0; nIdx < nCnt; ++nIdx ) - { - const SwStripe& rAdd = rOther[ nIdx ]; - long nBottom = rAdd.GetY() - rAdd.GetHeight(); - USHORT nCount = Count(); - USHORT nTmpY = nStart; - while( nTmpY < nCount ) - { - SwStripe& rChk = GetObject( nTmpY ); - if( rChk.GetY() - rChk.GetHeight() < rAdd.GetY() ) - break; - else - ++nTmpY; - } - USHORT nB = nTmpY; - while( nB < nCount ) - { - const SwStripe& rChk = GetObject( nB ); - if( rChk.GetY() <= nBottom ) - break; - else - ++nB; - } - nStart = nTmpY; - if( nTmpY == nB ) - Insert( rAdd, nTmpY ); - else - { - long nChkBottom = rAdd.GetY() - rAdd.GetHeight();; - const SwStripe& rChkB = GetObject( nB - 1 ); - long nTmp = rChkB.GetY() - rChkB.GetHeight(); - if( nTmp < nChkBottom ) - nChkBottom = nTmp; - SwStripe& rChk = GetObject( nTmpY ); - if( rAdd.GetY() > rChk.GetY() ) - rChk.Y() = rAdd.GetY(); - rChk.Height() = rChk.GetY() - nChkBottom; - nChkBottom = nB - nTmpY - 1; - if( nChkBottom ) - Remove( nTmpY + 1, (USHORT)nChkBottom ); - } - } - else - { - for( USHORT nIdx = 0; nIdx < nCnt; ++nIdx ) - { - const SwStripe& rAdd = rOther[ nIdx ]; - long nBottom = rAdd.GetY() + rAdd.GetHeight(); - USHORT nCount = Count(); - USHORT nTmpY = nStart; - while( nTmpY < nCount ) - { - SwStripe& rChk = GetObject( nTmpY ); - if( rChk.GetY() + rChk.GetHeight() > rAdd.GetY() ) - break; - else - ++nTmpY; - } - USHORT nB = nTmpY; - while( nB < nCount ) - { - const SwStripe& rChk = GetObject( nB ); - if( rChk.GetY() >= nBottom ) - break; - else - ++nB; - } - nStart = nTmpY; - if( nTmpY == nB ) - Insert( rAdd, nTmpY ); - else - { - long nChkBottom = rAdd.GetY() + rAdd.GetHeight();; - const SwStripe& rChkB = GetObject( nB - 1 ); - long nTmp = rChkB.GetY() + rChkB.GetHeight(); - if( nTmp > nChkBottom ) - nChkBottom = nTmp; - SwStripe& rChk = GetObject( nTmpY ); - if( rAdd.GetY() < rChk.GetY() ) - rChk.Y() = rAdd.GetY(); - rChk.Height() = nChkBottom - rChk.GetY(); - nChkBottom = nB - nTmpY - 1; - if( nChkBottom ) - Remove( nTmpY + 1, (USHORT)nChkBottom ); - } - } - } - } - return *this; -} - -BOOL SwStripes::Recalc( BOOL bVert ) -{ - if( !Count() ) - return TRUE; - Y() = GetObject(0).GetY(); - if( bVert ) - { - long nTmpMin = GetObject(0).GetY() - GetObject(0).Height(); - for( USHORT nIdx = 1; nIdx < Count(); ) - { - const SwStripe& rStr = GetObject(nIdx++); - if( GetY() < rStr.GetY() ) - Y() = rStr.GetY(); - if( nTmpMin > rStr.GetY() - rStr.GetHeight() ) - nTmpMin = rStr.GetY() - rStr.GetHeight(); - } - Height() = GetY() - nTmpMin; - } - else - { - long nTmpMax = GetObject(0).GetY() + GetObject(0).Height(); - for( USHORT nIdx = 1; nIdx < Count(); ) - { - const SwStripe& rStr = GetObject(nIdx++); - if( GetY() > rStr.GetY() ) - Y() = rStr.GetY(); - if( nTmpMax < rStr.GetY() + rStr.GetHeight() ) - nTmpMax = rStr.GetY() + rStr.GetHeight(); - } - Height() = nTmpMax - GetY(); - } - return FALSE; -} - -BOOL SwScrollArea::Compress() -{ - if( !Count() ) - return TRUE; - for( USHORT nIdx = Count() - 1; nIdx > 0; --nIdx ) - { - GetObject(0)->Plus( *GetObject(nIdx), IsVertical() ); - delete GetObject( nIdx ); - Remove( nIdx, 1 ); - } - ClrOffs(); - return GetObject(0)->Recalc( IsVertical() ); -} - -void SwScrollArea::Add( SwScrollArea *pScroll ) -{ - ASSERT( pScroll->Count() == 1, "Missing scrollarea compression 2" ); - ASSERT( Count() == 1, "Missing scrollarea compression 3" ); - GetObject(0)->Plus( *pScroll->GetObject(0), IsVertical() ); - GetObject(0)->Recalc( IsVertical() ); - delete pScroll->GetObject( 0 ); - pScroll->Remove( (USHORT)0, 1 ); - delete pScroll; -} - -/****************************************************************************** -|* -|* SwScrollAreas::Insert(..) -|* -******************************************************************************/ - -void SwScrollAreas::InsertCol( const SwScrollColumn &rCol, - SwStripes *pStripes ) -{ - SwScrollArea *pTmp = new SwScrollArea( rCol, pStripes ); - USHORT nIdx; - if( Seek_Entry( pTmp, &nIdx ) ) - { - GetObject( nIdx )->SmartInsert( pStripes ); - delete pTmp; - } - else - Insert( pTmp ); -} - - -void SwScrollArea::SmartInsert( SwStripes* pStripes ) -{ - ASSERT( pStripes, "Insert empty scrollstripe?" ); - BOOL bNotInserted = TRUE; - if( IsVertical() ) - for( USHORT nIdx = 0; nIdx < Count() && bNotInserted; ) - { - SwStripes* pTmp = GetObject( nIdx++ ); - if( pTmp->GetY() - pTmp->GetHeight() == pStripes->GetY() ) - { - pTmp->Height() += pStripes->GetHeight(); - pTmp->ChkMin( pStripes->GetMin() ); - pTmp->ChkMax( pStripes->GetMax() ); - if( pStripes->Count() ) - pTmp->Insert( (SwStripeArr*)pStripes, pTmp->Count(), 0 ); - bNotInserted = FALSE; - } - else if( pTmp->GetY() == pStripes->GetY() - pStripes->GetHeight() ) - { - pTmp->Height() += pStripes->GetHeight(); - pTmp->Y() = pStripes->GetY(); - pTmp->ChkMin( pStripes->GetMin() ); - pTmp->ChkMax( pStripes->GetMax() ); - if( pStripes->Count() ) - pTmp->Insert( (SwStripeArr*)pStripes, 0, 0 ); - bNotInserted = FALSE; - } - } - else - for( USHORT nIdx = 0; nIdx < Count() && bNotInserted; ) - { - SwStripes* pTmp = GetObject( nIdx++ ); - if( pTmp->GetY() + pTmp->GetHeight() == pStripes->GetY() ) - { - pTmp->Height() += pStripes->GetHeight(); - pTmp->ChkMin( pStripes->GetMin() ); - pTmp->ChkMax( pStripes->GetMax() ); - if( pStripes->Count() ) - pTmp->Insert( (SwStripeArr*)pStripes, pTmp->Count(), 0 ); - bNotInserted = FALSE; - } - else if( pTmp->GetY() == pStripes->GetY() + pStripes->GetHeight() ) - { - pTmp->Height() += pStripes->GetHeight(); - pTmp->Y() = pStripes->GetY(); - pTmp->ChkMin( pStripes->GetMin() ); - pTmp->ChkMax( pStripes->GetMax() ); - if( pStripes->Count() ) - pTmp->Insert( (SwStripeArr*)pStripes, 0, 0 ); - bNotInserted = FALSE; - } - } - if( !bNotInserted || !Insert( pStripes ) ) - delete pStripes; -} diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index ac63ccb5d7..ac92c83d85 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -29,7 +29,6 @@ #include "precompiled_sw.hxx" -#include "scrrect.hxx" #include "crsrsh.hxx" #include "rootfrm.hxx" #include "pagefrm.hxx" @@ -126,8 +125,6 @@ SwViewImp::SwViewImp( ViewShell *pParent ) : pSdrPageView( 0 ), pFirstVisPage( 0 ), pRegion( 0 ), - pScrollRects( 0 ), - pScrolledArea( 0 ), pLayAct( 0 ), pIdleAct( 0 ), pAccMap( 0 ), @@ -138,13 +135,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; } /****************************************************************************** @@ -169,8 +162,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." ); @@ -185,10 +177,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 8236d0292f..d8db3117c3 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -216,28 +216,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 ) @@ -246,8 +236,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 ) { @@ -271,15 +262,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(); @@ -408,14 +394,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; } } @@ -435,13 +421,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(); } @@ -1196,12 +1175,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(); @@ -1331,9 +1308,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(); @@ -1833,9 +1808,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 @@ -1861,7 +1835,7 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect ) } if ( bStop ) { - Imp()->DelRegions(); + Imp()->DelRegion(); pRegion = 0; } } @@ -1906,7 +1880,7 @@ BOOL ViewShell::CheckInvalidForPaint( const SwRect &rRect ) } else bRet = FALSE; - Imp()->DelRegions(); + Imp()->DelRegion(); } else bRet = FALSE; @@ -1957,17 +1931,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 ); diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 560ac9a5af..b80b567ebf 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -763,6 +763,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 ); @@ -773,6 +777,9 @@ BOOL SwDocShell::ConvertTo( SfxMedium& rMedium ) { pWrtShell->Pop(FALSE); pWrtShell->EndAllAction(); + // --> OD 2009-12-31 #i106906# + pWrtShell->LockView( bFormerLockView ); + // <-- } } else diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index 58d168426a..487d83b6f0 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -546,7 +546,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam } pDStyle->GetCollection()->SetDerivedFrom( pColl ); pDStyle->PresetParent( rParent ); - + //#outline level,add by zhaojianwei /*When a new paragraph style is created based on a "to outline style assigned" paragraph style, the outline level attribute and the list @@ -557,7 +557,7 @@ USHORT SwDocShell::Edit( const String &rName, const String &rParent, USHORT nFam SwNumRuleItem aItem(aEmptyStr); pDStyle->GetCollection()->SetFmtAttr( aItem ); pDStyle->GetCollection()->SetAttrOutlineLevel( 0 ); - } + } //<-end,zhaojianwei } @@ -1017,18 +1017,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 ); diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 69a7c19460..04819c586e 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -2635,7 +2635,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 ) @@ -2696,7 +2698,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; @@ -3635,7 +3637,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) } else { - // creating a temp. bookmark without undo + // creating a temp. bookmark without undo BOOL bUndo = rSh.DoesUndo(); rSh.DoUndo( FALSE ); BOOL bIsModified = rSh.IsModified(); @@ -3645,7 +3647,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) ::rtl::OUString(), ::rtl::OUString(), IDocumentMarkAccess::DDE_BOOKMARK); - if(pMark) + if(pMark) { sName = pMark->GetName(); bDelBookmrk = TRUE; @@ -3753,8 +3755,8 @@ BOOL SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) } ::rtl::OUString sMarkName = pMark->GetName(); - // remove mark - pServerObject->SetNoServer(); // this removes the connection between SwServerObject and mark + // remove mark + pServerObject->SetNoServer(); // this removes the connection between SwServerObject and mark // N.B. ppMark was not loaded from file and cannot have xml:id pMarkAccess->deleteMark(ppMark); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index d484af64aa..3df214e304 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -3364,11 +3364,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 ) + // --> 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() ) diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx index eb5258f373..ec0cd2a6c2 100644 --- a/sw/source/ui/shells/grfshex.cxx +++ b/sw/source/ui/shells/grfshex.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -153,7 +153,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 8d67a14603..f35e5570f1 100644 --- a/sw/source/ui/uiview/viewdraw.cxx +++ b/sw/source/ui/uiview/viewdraw.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -171,7 +171,7 @@ void SwView::ExecDraw(SfxRequest& rReq) // TODO: unmark all other pWrtShell->EnterStdMode(); - pWrtShell->SwFEShell::Insert( *pObj, 0, 0, &aStartPos ); + pWrtShell->SwFEShell::InsertDrawObj( *pObj, aStartPos ); } } } @@ -218,7 +218,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 (); } } @@ -243,8 +243,8 @@ void SwView::ExecDraw(SfxRequest& rReq) } //deselect if same shape is selected again (but different custom shapes do have same slot id) - if ( bDeselect || (nSlotId == nDrawSfxId && - (!pStringItem || (pStringItem->GetValue() == sDrawCustom)) + if ( bDeselect || (nSlotId == nDrawSfxId && + (!pStringItem || (pStringItem->GetValue() == sDrawCustom)) && (nSlotId != SID_DRAW_CS_ID) ) ) { if (GetDrawFuncPtr()) @@ -418,7 +418,7 @@ void SwView::ExitDraw() NoRotate(); if(pShell) - { + { //#126062 # the shell may be invalid at close/reload/SwitchToViewShell SfxDispatcher* pDispatch = GetViewFrame()->GetDispatcher(); USHORT nIdx = 0; @@ -428,7 +428,7 @@ void SwView::ExitDraw() pTest = pDispatch->GetShell(nIdx++); } while( pTest && pTest != this && pTest != pShell); - if(pTest == pShell && + if(pTest == pShell && // don't call LeaveSelFrmMode() etc. for the below, // because objects may still be selected: !pShell->ISA(SwDrawBaseShell) && diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 3036f903e4..f340c2d513 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -1378,10 +1378,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; |