From 7794baf89e74fc8308c8e1505f47d60b6547465f Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 20 Feb 2012 15:36:29 +0100 Subject: fdo#46073: Implemented soft boundaries only w/o non-printing chars --- sw/source/core/layout/paintfrm.cxx | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 206bdc9bd50c..ba89741d98ad 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -6307,6 +6307,27 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreatePageAreaDelimiterPrimit return aSeq; } +drawinglayer::primitive2d::Primitive2DSequence lcl_CreateRectangleDelimiterPrimitives ( + const SwRect& rRect ) +{ + drawinglayer::primitive2d::Primitive2DSequence aSeq( 1 ); + basegfx::BColor aLineColor = SwViewOption::GetDocBoundariesColor().getBColor(); + + basegfx::B2DPolygon aPolygon; + aPolygon.append( basegfx::B2DPoint( rRect.Left(), rRect.Top() ) ); + aPolygon.append( basegfx::B2DPoint( rRect.Right(), rRect.Top() ) ); + aPolygon.append( basegfx::B2DPoint( rRect.Right(), rRect.Bottom() ) ); + aPolygon.append( basegfx::B2DPoint( rRect.Left(), rRect.Bottom() ) ); + aPolygon.setClosed( true ); + + drawinglayer::primitive2d::PolygonHairlinePrimitive2D* pLine = + new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( + aPolygon, aLineColor ); + aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( pLine ); + + return aSeq; +} + drawinglayer::primitive2d::Primitive2DSequence lcl_CreateColumnAreaDelimiterPrimitives( const SwRect& rRect ) { @@ -6362,7 +6383,10 @@ void SwPageFrm::PaintSubsidiaryLines( const SwPageFrm *, if ( pFtnCont ) aArea.AddBottom( pFtnCont->Frm().Bottom() - aArea.Bottom() ); - ProcessPrimitives( lcl_CreatePageAreaDelimiterPrimitives( aArea ) ); + if ( !pGlobalShell->GetViewOptions()->IsViewMetaChars( ) ) + ProcessPrimitives( lcl_CreatePageAreaDelimiterPrimitives( aArea ) ); + else + ProcessPrimitives( lcl_CreateRectangleDelimiterPrimitives( aArea ) ); } } @@ -6399,7 +6423,10 @@ void SwColumnFrm::PaintSubsidiaryLines( const SwPageFrm *, ::SwAlignRect( aArea, pGlobalShell ); - ProcessPrimitives( lcl_CreateColumnAreaDelimiterPrimitives( aArea ) ); + if ( !pGlobalShell->GetViewOptions()->IsViewMetaChars( ) ) + ProcessPrimitives( lcl_CreateColumnAreaDelimiterPrimitives( aArea ) ); + else + ProcessPrimitives( lcl_CreateRectangleDelimiterPrimitives( aArea ) ); } void SwSectionFrm::PaintSubsidiaryLines( const SwPageFrm * pPage, @@ -6426,7 +6453,10 @@ void SwHeadFootFrm::PaintSubsidiaryLines( const SwPageFrm *, const SwRect & ) co { SwRect aArea( Prt() ); aArea.Pos() += Frm().Pos(); - ProcessPrimitives( lcl_CreatePageAreaDelimiterPrimitives( aArea ) ); + if ( !pGlobalShell->GetViewOptions()->IsViewMetaChars( ) ) + ProcessPrimitives( lcl_CreatePageAreaDelimiterPrimitives( aArea ) ); + else + ProcessPrimitives( lcl_CreateRectangleDelimiterPrimitives( aArea ) ); } } -- cgit v1.2.3