diff options
author | Henning Brinkmann <hbrinkm@openoffice.org> | 2011-03-16 11:59:36 +0100 |
---|---|---|
committer | Henning Brinkmann <hbrinkm@openoffice.org> | 2011-03-16 11:59:36 +0100 |
commit | 58d84f86704715d548f7137e6b014db0da44040a (patch) | |
tree | 1361bbbbf869b29e01394ee79a0a2288bec2eceb /sw | |
parent | f24ceb2d452fd0056c3fb36088872eecffd187a8 (diff) | |
parent | 970ab411dd018c7c6159f073aca5927de8c52980 (diff) |
merged from outgoing
Diffstat (limited to 'sw')
-rwxr-xr-x[-rw-r--r--] | sw/source/core/inc/viewimp.hxx | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/layout/paintfrm.cxx | 120 | ||||
-rwxr-xr-x[-rw-r--r--] | sw/source/core/view/vdraw.cxx | 5 |
3 files changed, 82 insertions, 47 deletions
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index 3959a815eaa2..67a1edd7c8e1 100644..100755 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -215,11 +215,13 @@ public: // direction at the outliner of the draw view for painting layers <hell> // and <heaven>. // OD 25.06.2003 #108784# - correct type of 1st parameter + // OD #i76669# - added parameter <pRedirector> void PaintLayer( const SdrLayerID _nLayerID, SwPrintData const*const pPrintData, const SwRect& _rRect, const Color* _pPageBackgrdColor = 0, - const bool _bIsPageRightToLeft = false ) const; + const bool _bIsPageRightToLeft = false, + sdr::contact::ViewObjectContactRedirector* pRedirector = 0 ) const; //wird als Link an die DrawEngine uebergeben, entscheidet was wie //gepaintet wird oder nicht. diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index e0f4914da529..ed8fa0b31a4d 100644..100755 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2706,6 +2706,49 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori ) // FUNCTIONS USED FOR COLLAPSING TABLE BORDER LINES END // +// --> OD #i76669# +#include <svx/sdr/contact/viewobjectcontactredirector.hxx> +#include <svx/sdr/contact/viewobjectcontact.hxx> + +namespace +{ + class SwViewObjectContactRedirector : public ::sdr::contact::ViewObjectContactRedirector + { + private: + const ViewShell& mrViewShell; + + public: + SwViewObjectContactRedirector( const ViewShell& rSh ) + : mrViewShell( rSh ) + {}; + + virtual ~SwViewObjectContactRedirector() + {} + + virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence( + const sdr::contact::ViewObjectContact& rOriginal, + const sdr::contact::DisplayInfo& rDisplayInfo) + { + sal_Bool bPaint( sal_True ); + + SdrObject* pObj = rOriginal.GetViewContact().TryToGetSdrObject(); + if ( pObj ) + { + bPaint = SwFlyFrm::IsPaint( pObj, &mrViewShell ); + } + + if ( !bPaint ) + { + return drawinglayer::primitive2d::Primitive2DSequence(); + } + + return sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence( + rOriginal, rDisplayInfo ); + } + }; + +} // end of anonymous namespace +// <-- /************************************************************************* |* @@ -2727,7 +2770,7 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori ) void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const { - ASSERT( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." ); + ASSERT( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." ); PROTOCOL( this, PROT_FILE_INIT, 0, 0) @@ -2766,8 +2809,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const // --> OD 2008-10-07 #i92745# // Extend check on certain states of the 'current' <ViewShell> instance to // all existing <ViewShell> instances. -// if ( !pSh->IsInEndAction() && !pSh->IsPaintInProgress() && -// (!pSh->Imp()->IsAction() || !pSh->Imp()->GetLayAction().IsActionInProgress() ) ) bool bPerformLayoutAction( true ); { ViewShell* pTmpViewShell = pSh; @@ -2822,10 +2863,11 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const // #i68597# const bool bGridPainting(pSh->GetWin() && pSh->Imp()->HasDrawView() && pSh->Imp()->GetDrawView()->IsGridVisible()); - // --> OD 2008-05-16 #i84659# -// while ( pPage && !::IsShortCut( aRect, pPage->Frm() ) ) - while ( pPage ) + // --> OD #i76669# + SwViewObjectContactRedirector aSwRedirector( *pSh ); // <-- + + while ( pPage ) { const bool bPaintRightShadow = !bBookMode || (pPage == Lower()) || (!bLTR && !pPage->OnRightPage()) || (bLTR && pPage->OnRightPage()); const bool bRightSidebar = pPage->SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT; @@ -2836,12 +2878,10 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, aPaintRect, bRightSidebar ); if ( aRect.IsOver( aPaintRect ) ) - // <-- { if ( pSh->GetWin() ) { pSubsLines = new SwSubsRects; - // OD 18.11.2002 #99672# - create array for special sub-lines pSpecSubsLines = new SwSubsRects; } @@ -2852,15 +2892,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const // marks), if painting on a window and the paint is trigger by an // end action. The inefficient and simple enlargement of the // paint area is replaced by this invalidation. - // if ( bExtraData ) - // { - // //Ja, das ist grob, aber wie macht man es besser? - // SWRECTFN( pPage ) - // (aPaintRect.*fnRect->fnSetLeftAndWidth)( - // (pPage->Frm().*fnRect->fnGetLeft)(), - // (pPage->Frm().*fnRect->fnGetWidth)() ); - // aPaintRect._Intersection( pSh->VisArea() ); - // } if ( bExtraData && pSh->GetWin() && pSh->IsInEndAction() ) { @@ -2921,32 +2952,31 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const if ( pSh->Imp()->HasDrawView() ) { pLines->LockLines( sal_True ); - // OD 29.08.2002 #102450# - add 3rd parameter - // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); - pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), pPrintData, aPaintRect, - &aPageBackgrdColor, (pPage->IsRightToLeft() ? true : false) ); + pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), + pPrintData, + aPaintRect, + &aPageBackgrdColor, + (pPage->IsRightToLeft() ? true : false), + &aSwRedirector ); pLines->PaintLines( pSh->GetOut() ); pLines->LockLines( sal_False ); } if( pSh->GetWin() ) { - // OD 18.11.2002 #99672# - collect sub-lines + // collect sub-lines pPage->RefreshSubsidiary( aPaintRect ); - // OD 18.11.2002 #99672# - paint special sub-lines + // paint special sub-lines pSpecSubsLines->PaintSubsidiary( pSh->GetOut(), NULL ); } pPage->Paint( aPaintRect ); - // OD 20.12.2002 #94627# - no paint of page border and shadow, if - // writer is in place mode. + // no paint of page border and shadow, if writer is in place mode. if( pSh->GetWin() && pSh->GetDoc()->GetDocShell() && !pSh->GetDoc()->GetDocShell()->IsInPlaceActive() ) { - // OD 12.02.2003 #i9719#, #105645# - use new method - // <SwPageFrm::PaintBorderAndShadow(..)>. SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintRightShadow, bRightSidebar ); SwPageFrm::PaintNotesSidebar( pPage->Frm(), pSh, pPage->GetPhyPageNum(), bRightSidebar); } @@ -2957,9 +2987,12 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const { /// OD 29.08.2002 #102450# - add 3rd parameter // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. - pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(), pPrintData, aPaintRect, + pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(), + pPrintData, + aPaintRect, &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false) ); + (pPage->IsRightToLeft() ? true : false), + &aSwRedirector ); } if ( bExtraData ) @@ -6424,21 +6457,20 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const SwRect aRetouchePart( rRetouche ); if ( aRetouchePart.HasArea() ) { - // OD 30.08.2002 #102450# - // determine background color of page for <PaintLayer> method - // calls, painting <hell> or <heaven> const Color aPageBackgrdColor = pPage->GetDrawBackgrdColor(); - // OD 29.08.2002 #102450# - // add 3rd parameter to <PaintLayer> method calls - // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); + // --> OD #i76669# + SwViewObjectContactRedirector aSwRedirector( *pSh ); + // <-- pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), 0, aRetouchePart, &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false) ); + (pPage->IsRightToLeft() ? true : false), + &aSwRedirector ); pSh->Imp()->PaintLayer( pIDDMA->GetHeavenId(), 0, aRetouchePart, &aPageBackgrdColor, - (pPage->IsRightToLeft() ? true : false) ); + (pPage->IsRightToLeft() ? true : false), + &aSwRedirector ); } SetRetouche(); @@ -6679,22 +6711,22 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap ) // OD 09.12.2002 #103045# - determine page, fly frame is on const SwPageFrm* pFlyPage = pFly->FindPageFrm(); - // OD 30.08.2002 #102450# - // determine color of page, the fly frame is on, for <PaintLayer> method - // calls, painting <hell> or <heaven> const Color aPageBackgrdColor = pFlyPage->GetDrawBackgrdColor(); - // OD 30.08.2002 #102450# - add 3rd parameter - // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction. const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess(); + // --> OD #i76669# + SwViewObjectContactRedirector aSwRedirector( *pSh ); + // <-- pImp->PaintLayer( pIDDMA->GetHellId(), 0, aOut, &aPageBackgrdColor, - (pFlyPage->IsRightToLeft() ? true : false) ); + (pFlyPage->IsRightToLeft() ? true : false), + &aSwRedirector ); pLines->PaintLines( &aDev ); if ( pFly->IsFlyInCntFrm() ) pFly->Paint( aOut ); pLines->PaintLines( &aDev ); /// OD 30.08.2002 #102450# - add 3rd parameter pImp->PaintLayer( pIDDMA->GetHeavenId(), 0, aOut, &aPageBackgrdColor, - (pFlyPage->IsRightToLeft() ? true : false) ); + (pFlyPage->IsRightToLeft() ? true : false), + &aSwRedirector ); pLines->PaintLines( &aDev ); DELETEZ( pLines ); pFlyOnlyDraw = 0; diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index c9581d26251f..cec333d0397d 100644..100755 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -182,7 +182,8 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, SwPrintData const*const pPrintData, const SwRect& , const Color* _pPageBackgrdColor, - const bool _bIsPageRightToLeft ) const + const bool _bIsPageRightToLeft, + sdr::contact::ViewObjectContactRedirector* pRedirector ) const { if ( HasDrawView() ) { @@ -232,7 +233,7 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, SdrView &rSdrView = const_cast< SdrView & >(GetPageView()->GetView()); rSdrView.setHideDraw( !pPrintData->IsPrintDraw() ); } - GetPageView()->DrawLayer(_nLayerID, pOutDev); + GetPageView()->DrawLayer( _nLayerID, pOutDev, pRedirector ); pOutDev->Pop(); // OD 29.08.2002 #102450# |