[Libreoffice-commits] .: 4 commits - svx/inc svx/source sw/inc sw/Library_sw.mk sw/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Tue Sep 6 02:28:40 PDT 2011
svx/inc/svx/svdobj.hxx | 3
svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx | 10
svx/source/sdr/contact/viewcontactofsdrcircobj.cxx | 17
svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx | 10
svx/source/sdr/contact/viewcontactofsdrpathobj.cxx | 13
svx/source/sdr/contact/viewcontactofsdrrectobj.cxx | 12
svx/source/svdraw/svdobj.cxx | 1
sw/Library_sw.mk | 1
sw/inc/comcore.hrc | 3
sw/source/core/doc/notxtfrm.cxx | 7
sw/source/core/inc/bodyfrm.hxx | 1
sw/source/core/inc/frame.hxx | 5
sw/source/core/inc/ftnfrm.hxx | 2
sw/source/core/inc/hffrm.hxx | 1
sw/source/core/inc/layfrm.hxx | 2
sw/source/core/inc/pagefrm.hxx | 3
sw/source/core/layout/paintfrm.cxx | 286 +++++++-------
sw/source/core/layout/wsfrm.cxx | 19
sw/source/core/text/frmpaint.cxx | 6
sw/source/core/view/viewsh.cxx | 1
sw/source/ui/app/app.src | 10
sw/source/ui/docvw/HeaderFooterWin.cxx | 131 ++++++
sw/source/ui/docvw/docvw.hrc | 3
sw/source/ui/docvw/docvw.src | 10
sw/source/ui/docvw/edtwin.cxx | 92 ----
sw/source/ui/inc/HeaderFooterWin.hxx | 55 ++
sw/source/ui/inc/edtwin.hxx | 28 -
27 files changed, 382 insertions(+), 350 deletions(-)
New commits:
commit ec6905bf855a9226aa0e3143fdbf15bff306cb69
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date: Tue Sep 6 11:16:01 2011 +0200
Header/Footer: enhanced the document subsidiary lines
+ Implemented http://wiki.services.openoffice.org/wiki/DocumentBorder#Option_3
+ Show the text boundaries for the currently edited area, e.g. don't
show the header and footer boundaries when editing the main body
+ Included the footnote boundaries into the main body ones as it's the
same editing area
+ Reimplemented the painting of the manual page breaks. These are
hidden when editing headers/footers and are be toggled with the
non-printing characters instead of the document boundaries.
diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx
index 42b77f3..1513cc1 100644
--- a/sw/source/core/inc/bodyfrm.hxx
+++ b/sw/source/core/inc/bodyfrm.hxx
@@ -45,6 +45,7 @@ public:
SwBodyFrm( SwFrmFmt*, SwFrm* );
virtual void Paint( const SwRect&, const SwPrintData *pPrintData = NULL ) const;
+ virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm)
};
diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx
index 7a79725..4c9d755 100644
--- a/sw/source/core/inc/ftnfrm.hxx
+++ b/sw/source/core/inc/ftnfrm.hxx
@@ -84,6 +84,8 @@ public:
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
+ virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
+
sal_Bool operator<( const SwTxtFtn* pTxtFtn ) const;
#if OSL_DEBUG_LEVEL > 1
diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx
index 39f09e9..dcf9a2b 100644
--- a/sw/source/core/inc/hffrm.hxx
+++ b/sw/source/core/inc/hffrm.hxx
@@ -46,6 +46,7 @@ public:
sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
virtual SwTwips ShrinkFrm( SwTwips,
sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
+ virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
};
class SwHeaderFrm: public SwHeadFootFrm
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 600c72b..a939033 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -70,7 +70,7 @@ public:
// --> #i28701#
TYPEINFO();
- void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
+ virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const;
void RefreshLaySubsidiary( const SwPageFrm*, const SwRect& ) const;
void RefreshExtraData( const SwRect & ) const;
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index dfb0cef..d45d4be 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -209,7 +209,8 @@ public:
void PaintGrid( OutputDevice* pOut, SwRect &rRect ) const;
sal_Bool HasGrid() const { return bHasGrid; }
- void PaintDecorators( OutputDevice* pOut ) const;
+ void PaintDecorators( ) const;
+ void PaintBreak() const;
//Zeilennummern usw malen
void RefreshExtraData( const SwRect & ) const;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 62825b4..6d65e84 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -87,6 +87,8 @@
#include <svx/svdogrp.hxx>
#include <sortedobjs.hxx>
#include <EnhancedPDFExportHelper.hxx>
+#include <bodyfrm.hxx>
+#include <hffrm.hxx>
// <--
// --> OD #i76669#
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
@@ -2987,7 +2989,8 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
if ( bExtraData )
pPage->RefreshExtraData( aPaintRect );
- pPage->PaintDecorators( pSh->GetOut() );
+ pPage->PaintDecorators( );
+ pPage->PaintBreak( );
if ( pSh->GetWin() )
{
@@ -3310,7 +3313,48 @@ drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPr
return aSeq;
}
-void SwPageFrm::PaintDecorators( OutputDevice *pOut ) const
+void SwPageFrm::PaintBreak( ) const
+{
+ const SwFrm* pBodyFrm = Lower();
+ while ( pBodyFrm && !pBodyFrm->IsBodyFrm() )
+ pBodyFrm = pBodyFrm->GetNext();
+
+ if ( pBodyFrm )
+ {
+ const SwCntntFrm *pCnt = static_cast< const SwLayoutFrm* >( pBodyFrm )->ContainsCntnt();
+ if ( pCnt && pCnt->IsPageBreak( sal_True ))
+ {
+ // Paint the break only if:
+ // * Not in header footer edition, to avoid conflicts with the
+ // header/footer marker
+ // * Non-printing characters are shown, as this is more consistent
+ // with other formatting marks
+ if ( !pGlobalShell->IsHeaderFooterEdit() &&
+ pGlobalShell->GetViewOptions()->IsShowHiddenChar( ) )
+ {
+ SwRect aRect( pCnt->Prt() );
+ aRect.Pos() += pCnt->Frm().Pos();
+
+ basegfx::B2DPolygon aLine;
+ aLine.append( basegfx::B2DPoint( double( aRect.Left() ), double( aRect.Top() ) ) );
+ aLine.append( basegfx::B2DPoint( double( aRect.Right() ), double( aRect.Top() ) ) );
+
+ basegfx::BColor aLineColor = SwViewOption::GetPageBreakColor().getBColor();
+
+ drawinglayer::primitive2d::PolygonHairlinePrimitive2D* pLine =
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aLine, aLineColor );
+
+ drawinglayer::primitive2d::Primitive2DSequence aSeq( 1 );
+ aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( pLine );
+
+ ProcessPrimitives( aSeq );
+ }
+ }
+ }
+}
+
+void SwPageFrm::PaintDecorators( ) const
{
SwWrtShell* pWrtSh = dynamic_cast< SwWrtShell* >( pGlobalShell );
if ( pWrtSh )
@@ -3331,7 +3375,7 @@ void SwPageFrm::PaintDecorators( OutputDevice *pOut ) const
drawinglayer::processor2d::BaseProcessor2D* pProcessor = CreateProcessor2D();
// Line thickness in px
- long nHalfThickness = pOut->LogicToPixel( Point( 0, LINE_HALF_THICKNESS ) ).Y();
+ long nHalfThickness = pGlobalShell->GetOut()->LogicToPixel( Point( 0, LINE_HALF_THICKNESS ) ).Y();
// Header
const SwFrm* pHeaderFrm = Lower();
@@ -3342,8 +3386,8 @@ void SwPageFrm::PaintDecorators( OutputDevice *pOut ) const
long nXOff = std::min( aBodyRect.Right(), rVisArea.Right() );
// FIXME there are cases where the label isn't show but should be
- long nHeaderYOff = pHeaderFrm->Frm().Bottom();
- if ( rVisArea.IsInside( Point( rVisArea.Left(), pHeaderFrm->Frm().Bottom() ) ) )
+ long nHeaderYOff = aBodyRect.Top();
+ if ( rVisArea.IsInside( Point( rVisArea.Left(), nHeaderYOff ) ) )
{
Point nOutputOff = rEditWin.LogicToPixel( Point( nXOff, nHeaderYOff + nHalfThickness ) );
rEditWin.AddHeaderFooterControl( pPageDesc, true, nOutputOff );
@@ -3353,15 +3397,17 @@ void SwPageFrm::PaintDecorators( OutputDevice *pOut ) const
this, double( nHeaderYOff ) ) );
// Footer
- const SwFrm* pFooterFrm = Lower();
- while ( pFooterFrm->GetNext() )
- pFooterFrm = pFooterFrm->GetNext();
- if ( !pFooterFrm->IsFooterFrm() )
- pFooterFrm = NULL;
+ const SwFrm* pFtnContFrm = Lower();
+ while ( pFtnContFrm->GetNext() )
+ {
+ if ( pFtnContFrm->IsFtnContFrm() )
+ aBodyRect.AddBottom( pFtnContFrm->Frm().Bottom() - aBodyRect.Bottom() );
+ pFtnContFrm = pFtnContFrm->GetNext();
+ }
// FIXME there are cases where the label isn't show but should be
- long nFooterYOff = pFooterFrm->Frm().Top();
- if ( rVisArea.IsInside( Point( rVisArea.Left(), pFooterFrm->Frm().Top() ) ) )
+ long nFooterYOff = aBodyRect.Bottom();
+ if ( rVisArea.IsInside( Point( rVisArea.Left(), nFooterYOff ) ) )
{
Point nOutputOff = rEditWin.LogicToPixel( Point( nXOff, nFooterYOff - nHalfThickness ) );
rEditWin.AddHeaderFooterControl( pPageDesc, false, nOutputOff );
@@ -6167,6 +6213,82 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
}
}
+drawinglayer::primitive2d::Primitive2DSequence lcl_CreatePageAreaDelimiterPrimitives(
+ const SwRect& rRect )
+{
+ drawinglayer::primitive2d::Primitive2DSequence aSeq( 4 );
+
+ basegfx::BColor aLineColor = SwViewOption::GetDocBoundariesColor().getBColor();
+ double nLineLength = 200.0; // in Twips
+
+ Point aPoints[] = { rRect.TopLeft(), rRect.TopRight(), rRect.BottomRight(), rRect.BottomLeft() };
+ int aXOffDirs[] = { -1, 1, 1, -1 };
+ int aYOffDirs[] = { -1, -1, 1, 1 };
+
+ // Actually loop over the corners to create the two lines
+ for ( int i = 0; i < 4; i++ )
+ {
+ basegfx::B2DVector aHorizVector( double( aXOffDirs[i] ), 0.0 );
+ basegfx::B2DVector aVertVector( 0.0, double( aYOffDirs[i] ) );
+
+ basegfx::B2DPoint aBPoint( aPoints[i].X(), aPoints[i].Y() );
+
+ basegfx::B2DPolygon aPolygon;
+ aPolygon.append( aBPoint + aHorizVector * nLineLength );
+ aPolygon.append( aBPoint );
+ aPolygon.append( aBPoint + aVertVector * nLineLength );
+
+ drawinglayer::primitive2d::PolygonHairlinePrimitive2D* pLine =
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aPolygon, aLineColor );
+ aSeq[i] = drawinglayer::primitive2d::Primitive2DReference( pLine );
+ }
+
+ return aSeq;
+}
+
+void SwBodyFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
+ const SwRect &/*rRect*/ ) const
+{
+ if ( !pGlobalShell->IsHeaderFooterEdit() )
+ {
+ SwRect aArea( Frm() );
+
+ // TODO include the footnote area if any
+ const SwFrm* pLay = pPage->Lower();
+ const SwFrm* pFtnCont = NULL;
+ while ( pLay->GetNext() && !pFtnCont )
+ {
+ if ( pLay->IsFtnContFrm( ) )
+ pFtnCont = pLay;
+ pLay = pLay->GetNext();
+ }
+
+ if ( pFtnCont )
+ aArea.AddBottom( pFtnCont->Frm().Bottom() - aArea.Bottom() );
+
+ ProcessPrimitives( lcl_CreatePageAreaDelimiterPrimitives( aArea ) );
+ }
+}
+
+void SwHeadFootFrm::PaintSubsidiaryLines( const SwPageFrm *, const SwRect & ) const
+{
+ if ( pGlobalShell->IsHeaderFooterEdit() )
+ {
+ SwRect aArea( Prt() );
+ aArea.Pos() += Frm().Pos();
+ ProcessPrimitives( lcl_CreatePageAreaDelimiterPrimitives( aArea ) );
+ }
+}
+
+/** This method is overridden in order to have no subsidiary lines
+ around the footnotes.
+ */
+void SwFtnFrm::PaintSubsidiaryLines( const SwPageFrm *,
+ const SwRect & ) const
+{
+}
+
void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
const SwRect &rRect ) const
{
@@ -6247,8 +6369,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
if ( pCnt )
{
// OD 05.11.2002 #102406# - adjust setting of <bBreak>.
- bBreak = pCnt->IsPageBreak( sal_True ) ||
- ( IsColBodyFrm() && pCnt->IsColBreak( sal_True ) );
+ bBreak = ( IsColBodyFrm() && pCnt->IsColBreak( sal_True ) );
}
}
commit cb3c09c32367a5b0c4c765ba0da75291c9367aa9
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date: Mon Sep 5 16:16:32 2011 +0200
Header/Footer: revert objects ghosting to keep writer WYSIWYG
This reverts commits:
* 7d700ecf81c00981df9780da07408192dfa4a4b3
* 523ff0444022c9f435c93140c7c89fa2c657bb50
* f7da7938c53f0ce185760e01e7de91cdf5268078
* 28d1c25092ddefdf90d0554532b7611698b2d18e
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index afa9c9b..72964cf 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -483,7 +483,6 @@ protected:
// beim Clone wird das Flag nicht mitkopiert!
// Das Flag ist persistent.
unsigned bEmptyPresObj : 1; // Leeres Praesentationsobjekt (Draw)
- unsigned mbGhosted : 1; // FIXME find a better way to ghost writer drawing objects
// sal_True=Objekt ist als Objekt der MasterPage nicht sichtbar
unsigned bNotVisibleAsMaster : 1;
@@ -1037,8 +1036,6 @@ public:
sal_Bool IsEmptyPresObj() const { return bEmptyPresObj; }
void SetNotVisibleAsMaster(sal_Bool bFlg) { bNotVisibleAsMaster=bFlg; }
sal_Bool IsNotVisibleAsMaster() const { return bNotVisibleAsMaster; }
- void SetGhosted( sal_Bool bGhosted ) { mbGhosted = bGhosted; }
- sal_Bool IsGhosted() const { return mbGhosted; }
// #i25616#
sal_Bool LineIsOutsideGeometry() const { return mbLineIsOutsideGeometry; }
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 50205c2..45cd620 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -45,7 +45,6 @@
#include <svx/xfltrit.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -172,15 +171,6 @@ namespace sdr
}
}
- if (rCaptionObj.IsGhosted())
- {
- const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
- const basegfx::BColorModifier aBColorModifier(aRGBWhite, 0.5, basegfx::BCOLORMODIFYMODE_INTERPOLATE);
- const drawinglayer::primitive2d::Primitive2DReference xGhostedRef(
- new drawinglayer::primitive2d::ModifiedColorPrimitive2D(xRetval, aBColorModifier));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xGhostedRef, 1);
- }
-
return xRetval;
}
} // end of namespace contact
diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
index 03fcc43..dd41ddc 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
@@ -36,7 +36,6 @@
#include <svl/itemset.hxx>
#include <svx/sxciaitm.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
-#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -79,8 +78,6 @@ namespace sdr
// create primitive data
const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier());
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
-
// always create primitives to allow the decomposition of SdrEllipsePrimitive2D
// or SdrEllipseSegmentPrimitive2D to create needed invisible elements for HitTest
// and/or BoundRect
@@ -91,7 +88,7 @@ namespace sdr
aObjectMatrix,
aAttribute));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
else
{
@@ -111,18 +108,8 @@ namespace sdr
bCloseSegment,
bCloseUsingCenter));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
- if (GetCircObj().IsGhosted())
- {
- const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
- const basegfx::BColorModifier aBColorModifier(aRGBWhite, 0.5, basegfx::BCOLORMODIFYMODE_INTERPOLATE);
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::ModifiedColorPrimitive2D(xRetval, aBColorModifier));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
- return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index db4094c..16d7174 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -39,7 +39,6 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/obj3d.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
-#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -234,15 +233,6 @@ namespace sdr
drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
false, aObjectRange));
- if (GetCustomShapeObj().IsGhosted())
- {
- const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
- const basegfx::BColorModifier aBColorModifier(aRGBWhite, 0.5, basegfx::BCOLORMODIFYMODE_INTERPOLATE);
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::ModifiedColorPrimitive2D(xRetval, aBColorModifier));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
return xRetval;
}
} // end of namespace contact
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 34c1b99..46a8d46 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -35,7 +35,6 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/sdr/primitive2d/sdrpathprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
-#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -138,17 +137,7 @@ namespace sdr
aAttribute,
aUnitPolyPolygon));
- drawinglayer::primitive2d::Primitive2DSequence xRetval(&xReference, 1);
-
- if (GetPathObj().IsGhosted())
- {
- const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
- const basegfx::BColorModifier aBColorModifier(aRGBWhite, 0.5, basegfx::BCOLORMODIFYMODE_INTERPOLATE);
- const drawinglayer::primitive2d::Primitive2DReference xGhostedRef(
- new drawinglayer::primitive2d::ModifiedColorPrimitive2D(xRetval, aBColorModifier));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xGhostedRef, 1);
- }
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index fd6a688..cfa44f4 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -37,7 +37,6 @@
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/svdmodel.hxx>
-#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -96,17 +95,8 @@ namespace sdr
fCornerRadiusY,
// #i105856# use fill for HitTest when TextFrame and not PickThrough
GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
- drawinglayer::primitive2d::Primitive2DSequence xRetVal(&xReference, 1);
- if ( GetRectObj().IsGhosted( ) )
- {
- const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
- const basegfx::BColorModifier aBColorModifier(aRGBWhite, 0.5, basegfx::BCOLORMODIFYMODE_INTERPOLATE);
- const drawinglayer::primitive2d::Primitive2DReference xGhostedRef(
- new drawinglayer::primitive2d::ModifiedColorPrimitive2D(xRetVal, aBColorModifier));
- xRetVal = drawinglayer::primitive2d::Primitive2DSequence(&xGhostedRef, 1);
- }
- return xRetVal;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 4aea972..77e458f 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -387,7 +387,6 @@ SdrObject::SdrObject()
bNoPrint =sal_False;
bEmptyPresObj =sal_False;
bNotVisibleAsMaster=sal_False;
- mbGhosted = sal_False;
bClosedObj =sal_False;
mbVisible = true;
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 77f99db..21f6d44 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -248,10 +248,6 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
return;
const ViewShell* pSh = getRootFrm()->GetCurrShell();
- OutputDevice *pOut = pSh->GetOut();
-
- sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pOut );
-
if( !pSh->GetViewOptions()->IsGraphic() )
{
StopAnimation();
@@ -266,7 +262,6 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
aTxt = FindFlyFrm()->GetFmt()->GetName();
lcl_PaintReplacement( Frm(), aTxt, *pSh, this, sal_False );
}
- pOut->SetDrawMode( nOldDrawMode );
return;
}
@@ -277,6 +272,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
SfxProgress::EnterLock(); //Keine Progress-Reschedules im Paint (SwapIn)
+ OutputDevice *pOut = pSh->GetOut();
pOut->Push();
sal_Bool bClip = sal_True;
PolyPolygon aPoly;
@@ -333,7 +329,6 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
pGrfNd->SetFrameInPaint( sal_False );
pOut->Pop();
- pOut->SetDrawMode( nOldDrawMode );
SfxProgress::LeaveLock();
}
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index b4e4453..e0dfeec 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -526,8 +526,7 @@ public:
const sal_Bool bLowerMode = sal_False,
const sal_Bool bLowerBorder = sal_False ) const;
void PaintBorderLine( const SwRect&, const SwRect&, const SwPageFrm*,
- const Color *pColor, const editeng::SvxBorderStyle = editeng::SOLID,
- sal_Bool bGhosted = sal_False ) const;
+ const Color *pColor, const editeng::SvxBorderStyle = editeng::SOLID ) const;
drawinglayer::processor2d::BaseProcessor2D * CreateProcessor2D( ) const;
void ProcessPrimitives( const drawinglayer::primitive2d::Primitive2DSequence& rSequence ) const;
@@ -912,8 +911,6 @@ public:
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
void dumpChildrenAsXml(xmlTextWriterPtr writer);
bool IsCollapse() const;
-
- sal_uInt64 SetHeaderFooterEditMask( OutputDevice* pOut ) const;
};
inline sal_Bool SwFrm::IsInDocBody() const
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 3428219..62825b4 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -87,10 +87,6 @@
#include <svx/svdogrp.hxx>
#include <sortedobjs.hxx>
#include <EnhancedPDFExportHelper.hxx>
-#include <fesh.hxx>
-#include <svx/svdpage.hxx>
-#include <hffrm.hxx>
-#include <fmtpdsc.hxx>
// <--
// --> OD #i76669#
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
@@ -174,14 +170,13 @@ class SwLineRect : public SwRect
{
Color aColor;
SvxBorderStyle nStyle;
- sal_Bool bGhosted;
const SwTabFrm *pTab;
sal_uInt8 nSubColor; //Hilfslinien einfaerben
sal_Bool bPainted; //schon gepaintet?
sal_uInt8 nLock; //Um die Linien zum Hell-Layer abzugrenzen.
public:
SwLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderStyle nStyle,
- const SwTabFrm *pT , const sal_uInt8 nSCol, sal_Bool bGhost );
+ const SwTabFrm *pT , const sal_uInt8 nSCol );
const Color *GetColor() const { return &aColor;}
SvxBorderStyle GetStyle() const { return nStyle; }
@@ -194,8 +189,7 @@ public:
}
sal_Bool IsPainted() const { return bPainted; }
sal_Bool IsLocked() const { return nLock != 0; }
- sal_uInt8 GetSubColor() const { return nSubColor;}
- sal_Bool IsGhosted() const { return bGhosted; }
+ sal_uInt8 GetSubColor() const { return nSubColor;}
sal_Bool MakeUnion( const SwRect &rRect );
};
@@ -208,7 +202,7 @@ class SwLineRects : public SwLRects
public:
SwLineRects() : nLastCount( 0 ) {}
void AddLineRect( const SwRect& rRect, const Color *pColor, const SvxBorderStyle nStyle,
- const SwTabFrm *pTab, const sal_uInt8 nSCol, sal_Bool bGhosted );
+ const SwTabFrm *pTab, const sal_uInt8 nSCol );
void ConnectEdges( OutputDevice *pOut );
void PaintLines ( OutputDevice *pOut );
void LockLines( sal_Bool bLock );
@@ -423,10 +417,9 @@ SwSavePaintStatics::~SwSavePaintStatics()
SV_IMPL_VARARR( SwLRects, SwLineRect );
SwLineRect::SwLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderStyle nStyl,
- const SwTabFrm *pT, const sal_uInt8 nSCol, sal_Bool bGhost ) :
+ const SwTabFrm *pT, const sal_uInt8 nSCol ) :
SwRect( rRect ),
nStyle( nStyl ),
- bGhosted( bGhost ),
pTab( pT ),
nSubColor( nSCol ),
bPainted( sal_False ),
@@ -474,7 +467,7 @@ sal_Bool SwLineRect::MakeUnion( const SwRect &rRect )
}
void SwLineRects::AddLineRect( const SwRect &rRect, const Color *pCol, const SvxBorderStyle nStyle,
- const SwTabFrm *pTab, const sal_uInt8 nSCol, sal_Bool bGhosted )
+ const SwTabFrm *pTab, const sal_uInt8 nSCol )
{
//Rueckwaerts durch, weil Linien die zusammengefasst werden koennen i.d.R.
//im gleichen Kontext gepaintet werden.
@@ -492,7 +485,7 @@ void SwLineRects::AddLineRect( const SwRect &rRect, const Color *pCol, const Svx
return;
}
}
- Insert( SwLineRect( rRect, pCol, nStyle, pTab, nSCol, bGhosted ), Count() );
+ Insert( SwLineRect( rRect, pCol, nStyle, pTab, nSCol ), Count() );
}
void SwLineRects::ConnectEdges( OutputDevice *pOut )
@@ -600,7 +593,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
continue;
const sal_uInt16 nTmpFree = Free();
Insert( SwLineRect( aIns, rL1.GetColor(), SOLID,
- rL1.GetTab(), SUBCOL_TAB, sal_False ), Count() );
+ rL1.GetTab(), SUBCOL_TAB ), Count() );
if ( !nTmpFree )
{
--i;
@@ -641,7 +634,7 @@ void SwLineRects::ConnectEdges( OutputDevice *pOut )
continue;
const sal_uInt16 nTmpFree = Free();
Insert( SwLineRect( aIns, rL1.GetColor(), SOLID,
- rL1.GetTab(), SUBCOL_TAB, sal_False ), Count() );
+ rL1.GetTab(), SUBCOL_TAB ), Count() );
if ( !nTmpFree )
{
--i;
@@ -669,7 +662,7 @@ inline void SwSubsRects::Ins( const SwRect &rRect, const sal_uInt8 nSCol )
{
// Lines that are shorted than the largest line width won't be inserted
if ( rRect.Height() > DEF_LINE_WIDTH_4 || rRect.Width() > DEF_LINE_WIDTH_4 )
- Insert( SwLineRect( rRect, 0, SOLID, 0, nSCol, sal_False ), Count());
+ Insert( SwLineRect( rRect, 0, SOLID, 0, nSCol ), Count());
}
void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
@@ -724,7 +717,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
SwRect aNewSubsRect( aSubsLineRect );
aNewSubsRect.Bottom( nTmp );
Insert( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0,
- aSubsLineRect.GetSubColor(), sal_False ), Count());
+ aSubsLineRect.GetSubColor() ), Count());
}
nTmp = rLine.Bottom()+nPixelSzH+1;
if ( aSubsLineRect.Bottom() > nTmp )
@@ -732,7 +725,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
SwRect aNewSubsRect( aSubsLineRect );
aNewSubsRect.Top( nTmp );
Insert( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0,
- aSubsLineRect.GetSubColor(), sal_False ), Count());
+ aSubsLineRect.GetSubColor() ), Count());
}
Remove( i, 1 );
--i;
@@ -750,7 +743,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
SwRect aNewSubsRect( aSubsLineRect );
aNewSubsRect.Right( nTmp );
Insert( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0,
- aSubsLineRect.GetSubColor(), sal_False ), Count());
+ aSubsLineRect.GetSubColor() ), Count());
}
nTmp = rLine.Right()+nPixelSzW+1;
if ( aSubsLineRect.Right() > nTmp )
@@ -758,7 +751,7 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const SwLineRects &rRects )
SwRect aNewSubsRect( aSubsLineRect );
aNewSubsRect.Left( nTmp );
Insert( SwLineRect( aNewSubsRect, 0, aSubsLineRect.GetStyle(), 0,
- aSubsLineRect.GetSubColor(), sal_False ), Count());
+ aSubsLineRect.GetSubColor() ), Count());
}
Remove( i, 1 );
--i;
@@ -836,14 +829,6 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
for ( i = 0; i < Count(); ++i )
{
SwLineRect &rLRect = operator[](i);
- sal_uLong nDrawMode = pOut->GetDrawMode();
-
- if ( rLRect.IsGhosted() )
- {
- pOut->SetDrawMode( DRAWMODE_GHOSTEDLINE | DRAWMODE_GHOSTEDFILL |
- DRAWMODE_GHOSTEDTEXT | DRAWMODE_GHOSTEDBITMAP |
- DRAWMODE_GHOSTEDGRADIENT );
- }
if ( rLRect.IsPainted() )
continue;
@@ -903,8 +888,6 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
}
else
bPaint2nd = sal_True;
-
- pOut->SetDrawMode( nDrawMode );
}
if ( bPaint2nd )
for ( i = 0; i < Count(); ++i )
@@ -2957,30 +2940,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
if ( pSh->Imp()->HasDrawView() )
{
- // Loop over the drawing object to mark them as in or outside a group
- if ( !pGlobalShell->GetViewOptions()->IsPDFExport() &&
- !pGlobalShell->GetViewOptions()->IsPrinting() &&
- !pGlobalShell->IsPreView() )
- {
- SdrObjList* pObjs = pSh->Imp()->GetPageView()->GetObjList();
- for ( sal_uInt32 i = 0; pObjs && i < pObjs->GetObjCount(); i++ )
- {
- SdrObject* pDrawObj = pObjs->GetObj( i );
- const SwContact* pContact = ::GetUserCall( pDrawObj );
- const SwAnchoredObject* pObj = pContact->GetAnchoredObj( pDrawObj );
-
- const SwFrm* pAnchorFrm = pObj ? pObj->GetAnchorFrm() : NULL;
- bool bInHeaderFooter = false;
-
- // Handle all non anchored as character objects... others are handled elsewere
- if ( pAnchorFrm )
- bInHeaderFooter = pAnchorFrm->FindFooterOrHeader() != NULL;
- bool bHeaderFooterEdit = pSh->IsHeaderFooterEdit();
-
- pDrawObj->SetGhosted( bHeaderFooterEdit ^ bInHeaderFooter );
- }
- }
-
pLines->LockLines( sal_True );
const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
pSh->Imp()->PaintLayer( pIDDMA->GetHellId(),
@@ -3615,8 +3574,6 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
aRect._Intersection( Frm() );
OutputDevice* pOut = pGlobalShell->GetOut();
- sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pOut );
-
pOut->Push( PUSH_CLIPREGION );
pOut->SetClipRegion();
const SwPageFrm* pPage = FindPageFrm();
@@ -3824,8 +3781,6 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
pOut->Pop();
- pOut->SetDrawMode( nOldDrawMode );
-
if ( pProgress && pNoTxt )
pProgress->Reschedule();
}
@@ -3837,7 +3792,6 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
- sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pGlobalShell->GetOut() );
if ( pGlobalShell->GetViewOptions()->IsTable() )
{
// #i29550#
@@ -3874,8 +3828,6 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
DrawRect( pGlobalShell->GetOut(), aTabOutRect, COL_LIGHTGRAY );
}
((SwTabFrm*)this)->ResetComplete();
-
- pGlobalShell->GetOut()->SetDrawMode( nOldDrawMode );
}
/*************************************************************************
@@ -4099,8 +4051,7 @@ void SwFrm::PaintBorderLine( const SwRect& rRect,
const SwRect& rOutRect,
const SwPageFrm *pPage,
const Color *pColor,
- const SvxBorderStyle nStyle,
- sal_Bool bGhosted ) const
+ const SvxBorderStyle nStyle ) const
{
if ( !rOutRect.IsOver( rRect ) )
return;
@@ -4123,10 +4074,10 @@ void SwFrm::PaintBorderLine( const SwRect& rRect,
SwRegionRects aRegion( aOut, 4, 1 );
::lcl_SubtractFlys( this, pPage, aOut, aRegion );
for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
- pLines->AddLineRect( aRegion[i], pColor, nStyle, pTab, nSubCol, bGhosted );
+ pLines->AddLineRect( aRegion[i], pColor, nStyle, pTab, nSubCol );
}
else
- pLines->AddLineRect( aOut, pColor, nStyle, pTab, nSubCol, bGhosted );
+ pLines->AddLineRect( aOut, pColor, nStyle, pTab, nSubCol );
}
/*************************************************************************
@@ -4940,22 +4891,8 @@ void SwFtnContFrm::PaintLine( const SwRect& rRect,
: SwRect( Point( nX, Frm().Pos().Y() + rInf.GetTopDist() ),
Size( nWidth, rInf.GetLineWidth()));
if ( aLineRect.HasArea() )
- {
- ViewShell* pShell = getRootFrm()->GetCurrShell();
-
- sal_Bool bGhosted = sal_False;
- if ( !pShell->IsPreView() &&
- !pShell->GetViewOptions()->IsPDFExport() &&
- !pShell->GetViewOptions()->IsPrinting() )
- {
- bool bInHdrFtr = FindFooterOrHeader( ) != NULL;
- bool bEditHdrFtr = pShell->IsHeaderFooterEdit();
- bGhosted = ( bInHdrFtr && !bEditHdrFtr ) || ( !bInHdrFtr && bEditHdrFtr );
- }
-
PaintBorderLine( rRect, aLineRect , pPage, &rInf.GetLineColor(),
- rInf.GetLineStyle(), bGhosted );
- }
+ rInf.GetLineStyle() );
}
/*************************************************************************
@@ -5009,26 +4946,13 @@ void SwLayoutFrm::PaintColLines( const SwRect &rRect, const SwFmtCol &rFmtCol,
(aRect.*fnRect->fnSubLeft)( nPenHalf + nPixelSzW );
(aRect.*fnRect->fnAddRight)( nPenHalf + nPixelSzW );
SwRectGet fnGetX = IsRightToLeft() ? fnRect->fnGetLeft : fnRect->fnGetRight;
-
- sal_Bool bGhosted = sal_False;
-
- ViewShell* pShell = getRootFrm()->GetCurrShell();
- if ( !pShell->IsPreView() &&
- !pShell->GetViewOptions()->IsPDFExport() &&
- !pShell->GetViewOptions()->IsPrinting() )
- {
- bool bInHdrFtr = FindFooterOrHeader( ) != NULL;
- bool bEditHdrFtr = pShell->IsHeaderFooterEdit();
- bGhosted = ( bInHdrFtr && !bEditHdrFtr ) || ( !bInHdrFtr && bEditHdrFtr );
- }
-
while ( pCol->GetNext() )
{
(aLineRect.*fnRect->fnSetPosX)
( (pCol->Frm().*fnGetX)() - nPenHalf );
if ( aRect.IsOver( aLineRect ) )
PaintBorderLine( aRect, aLineRect , pPage, &rFmtCol.GetLineColor(),
- rFmtCol.GetLineStyle(), bGhosted );
+ rFmtCol.GetLineStyle() );
pCol = pCol->GetNext();
}
}
@@ -5927,9 +5851,6 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
aRect.Intersection( rRect );
OutputDevice *pOut = pSh->GetOut();
- sal_uInt64 nOldDrawMode = pOut->GetDrawMode();
- if ( !IsPageFrm() && !IsRootFrm() )
- SetHeaderFooterEditMask( pOut );
if ( aRect.HasArea() )
{
@@ -5968,7 +5889,6 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
if( pCol )
delete pNewItem;
}
- pOut->SetDrawMode( nOldDrawMode );
}
else
bLowMode = bLowerMode ? sal_True : sal_False;
@@ -6239,7 +6159,7 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
SwRect aRect( aP1, aP2 );
// OD 18.11.2002 #99672# - use parameter <_pSubsLines> instead of
// global variable <pSubsLines>.
- _pSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor, sal_False );
+ _pSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor );
}
aP1 = aP2;
aP1.*pDirPt += 1;
@@ -6378,14 +6298,14 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
if ( aOriginal.Left() == aOut.Left() )
{
const SwRect aRect( aOut.Pos(), aLB );
- pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor, sal_False );
+ pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor );
}
// OD 14.11.2002 #104821# - in vertical layout set page/column break at right
if ( aOriginal.Right() == nRight )
{
const SwRect aRect( aRT, aRB );
pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0,
- (bBreak && bVert) ? SUBCOL_BREAK : nSubColor, sal_False );
+ (bBreak && bVert) ? SUBCOL_BREAK : nSubColor );
}
}
// OD 14.11.2002 #104822# - adjust control for drawing top and bottom lines
@@ -6396,12 +6316,12 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
// OD 14.11.2002 #104821# - in horizontal layout set page/column break at top
const SwRect aRect( aOut.Pos(), aRT );
pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0,
- (bBreak && !bVert) ? SUBCOL_BREAK : nSubColor, sal_False );
+ (bBreak && !bVert) ? SUBCOL_BREAK : nSubColor );
}
if ( aOriginal.Bottom() == nBottom )
{
const SwRect aRect( aLB, aRB );
- pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor, sal_False );
+ pUsedSubsLines->AddLineRect( aRect, 0, SOLID, 0, nSubColor );
}
}
}
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index b7f5f97..dc3e131 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -132,25 +132,6 @@ void SwFrm::RegisterToFormat( SwFmt& rFmt )
rFmt.Add( this );
}
-sal_uInt64 SwFrm::SetHeaderFooterEditMask( OutputDevice* pOut ) const
-{
- sal_uInt64 nOldDrawMode = pOut->GetDrawMode();
- ViewShell* pShell = getRootFrm()->GetCurrShell();
- if ( !pShell->IsPreView() &&
- !pShell->GetViewOptions()->IsPDFExport() &&
- !pShell->GetViewOptions()->IsPrinting() )
- {
- bool bInHdrFtr = FindFooterOrHeader( ) != NULL;
- bool bEditHdrFtr = pShell->IsHeaderFooterEdit();
- if ( ( bInHdrFtr && !bEditHdrFtr ) || ( !bInHdrFtr && bEditHdrFtr ) )
- pOut->SetDrawMode( DRAWMODE_GHOSTEDLINE | DRAWMODE_GHOSTEDFILL |
- DRAWMODE_GHOSTEDTEXT | DRAWMODE_GHOSTEDBITMAP |
- DRAWMODE_GHOSTEDGRADIENT );
- }
-
- return nOldDrawMode;
-}
-
void SwFrm::CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse )
{
if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) )
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index eb1eaaa..ccae785 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -567,7 +567,6 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
// Don't show the paragraph mark for collapsed paragraphs, when they are hidden
if ( EmptyHeight( ) > 1 )
{
- sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pSh->GetOut() );
const XubString aTmp( CH_PAR );
SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 );
aDrawInf.SetLeft( rRect.Left() );
@@ -583,7 +582,6 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
aDrawInf.SetSnapToGrid( sal_False );
pFnt->_DrawText( aDrawInf );
- pSh->GetOut()->SetDrawMode( nOldDrawMode );
}
delete pClip;
}
@@ -699,8 +697,6 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
OutputDevice* pOut = aInf.GetOut();
const sal_Bool bOnWin = pSh->GetWin() != 0;
- sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pOut );
-
SwSaveClip aClip( bOnWin || IsUndersized() ? pOut : 0 );
// Ausgabeschleife: Fuer jede Zeile ... (die noch zu sehen ist) ...
@@ -732,8 +728,6 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if( rRepaint.HasArea() )
rRepaint.Clear();
- pOut->SetDrawMode( nOldDrawMode );
-
UNDO_SWAP( this )
(SwRect&)rRect = aOldRect;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 92481ed..912a327 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -77,7 +77,6 @@
#include "../../ui/inc/view.hxx"
#include <PostItMgr.hxx>
#include <vcl/virdev.hxx>
-#include <rootfrm.hxx>
#include <vcl/svapp.hxx>
commit 849d47326d4359fb55685260869df68672739c17
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date: Mon Sep 5 15:45:15 2011 +0200
Header/Footers: SwPageDesc as a member of SwHeaderFooterWin
diff --git a/sw/inc/comcore.hrc b/sw/inc/comcore.hrc
index 7166ab1..494baae 100644
--- a/sw/inc/comcore.hrc
+++ b/sw/inc/comcore.hrc
@@ -84,9 +84,6 @@
#define STR_TABLE_NAME (RC_COMCORE_BEGIN + 46)
#define STR_PARAGRAPH_UNDO (RC_COMCORE_BEGIN + 47)
-#define STR_HEADER (RC_COMCORE_BEGIN + 48)
-#define STR_FOOTER (RC_COMCORE_BEGIN + 49)
-
// defines for the Autoformat Redline Comments
#define STR_AUTOFMTREDL_DEL_EMPTY_PARA 0
#define STR_AUTOFMTREDL_USE_REPLACE 1
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 0da3ea7..3428219 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3368,10 +3368,7 @@ void SwPageFrm::PaintDecorators( OutputDevice *pOut ) const
!pGlobalShell->IsPreView() &&
pGlobalShell->IsHeaderFooterEdit( ) )
{
- const rtl::OUString& rStyleName = GetPageDesc()->GetName();
- rtl::OUString aHeaderText = ResId::toString( SW_RES( STR_HEADER ) );
- sal_Int32 nPos = aHeaderText.lastIndexOf( rtl::OUString::createFromAscii( "%1" ) );
- aHeaderText = aHeaderText.replaceAt( nPos, 2, rStyleName );
+ SwPageDesc* pPageDesc = const_cast< SwPageDesc* >( GetPageDesc( ) );
drawinglayer::processor2d::BaseProcessor2D* pProcessor = CreateProcessor2D();
// Line thickness in px
@@ -3390,7 +3387,7 @@ void SwPageFrm::PaintDecorators( OutputDevice *pOut ) const
if ( rVisArea.IsInside( Point( rVisArea.Left(), pHeaderFrm->Frm().Bottom() ) ) )
{
Point nOutputOff = rEditWin.LogicToPixel( Point( nXOff, nHeaderYOff + nHalfThickness ) );
- rEditWin.AddHeaderFooterControl( aHeaderText, true, nOutputOff );
+ rEditWin.AddHeaderFooterControl( pPageDesc, true, nOutputOff );
}
pProcessor->process( lcl_CreateHeaderFooterSeparatorPrimitives(
@@ -3403,16 +3400,12 @@ void SwPageFrm::PaintDecorators( OutputDevice *pOut ) const
if ( !pFooterFrm->IsFooterFrm() )
pFooterFrm = NULL;
- rtl::OUString aFooterText = ResId::toString( SW_RES( STR_FOOTER ) );
- nPos = aFooterText.lastIndexOf( rtl::OUString::createFromAscii( "%1" ) );
- aFooterText = aFooterText.replaceAt( nPos, 2, rStyleName );
-
// FIXME there are cases where the label isn't show but should be
long nFooterYOff = pFooterFrm->Frm().Top();
if ( rVisArea.IsInside( Point( rVisArea.Left(), pFooterFrm->Frm().Top() ) ) )
{
Point nOutputOff = rEditWin.LogicToPixel( Point( nXOff, nFooterYOff - nHalfThickness ) );
- rEditWin.AddHeaderFooterControl( aFooterText, false, nOutputOff );
+ rEditWin.AddHeaderFooterControl( pPageDesc, false, nOutputOff );
}
pProcessor->process( lcl_CreateHeaderFooterSeparatorPrimitives(
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index ac126a5..094d38b 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -410,16 +410,6 @@ String STR_EMPTYPAGE
Text [ en-US ] = "blank page" ;
};
-String STR_HEADER
-{
- Text [ en-US ] = "Header (%1)" ;
-};
-
-String STR_FOOTER
-{
- Text [ en-US ] = "Footer (%1)" ;
-};
-
QueryBox MSG_CLPBRD_CLEAR
{
BUTTONS = WB_YES_NO ;
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 77b15e4..68a1fe5 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -26,6 +26,7 @@
* instead of those above.
*/
+#include <docvw.hrc>
#include <edtwin.hxx>
#include <HeaderFooterWin.hxx>
#include <viewopt.hxx>
@@ -39,10 +40,11 @@
// the WB_MOVABLE flag is used here to avoid the window to appear on all desktops (on linux)
// and the WB_OWNERDRAWDECORATION prevents the system to draw the window decorations.
//
-SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const rtl::OUString& sLabel, bool bHeader, Point aOffset ) :
+SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, SwPageDesc* pPageDesc, bool bHeader, Point aOffset ) :
FloatingWindow( pEditWin, WB_SYSTEMWINDOW | WB_NOBORDER | WB_NOSHADOW | WB_MOVEABLE | WB_OWNERDRAWDECORATION ),
m_pEditWin( pEditWin ),
- m_sText( sLabel ),
+ m_sLabel( ),
+ m_pPageDesc( pPageDesc ),
m_bIsHeader( bHeader )
{
// Get the font and configure it
@@ -52,9 +54,16 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const rtl::OUString&
// Use pixels for the rest of the drawing
SetMapMode( MapMode ( MAP_PIXEL ) );
- // Compute the position & size of the window
+ // Compute the text to show
+ m_sLabel = ResId::toString( SW_RES( STR_HEADER_TITLE ) );
+ if ( !m_bIsHeader )
+ m_sLabel = ResId::toString( SW_RES( STR_FOOTER_TITLE ) );
+ sal_Int32 nPos = m_sLabel.lastIndexOf( rtl::OUString::createFromAscii( "%1" ) );
+ m_sLabel = m_sLabel.replaceAt( nPos, 2, m_pPageDesc->GetName() );
+
+ // Compute the text size and get the box position & size from it
Rectangle aTextRect;
- GetTextBoundRect( aTextRect, String( sLabel ) );
+ GetTextBoundRect( aTextRect, String( m_sLabel ) );
Rectangle aTextPxRect = LogicToPixel( aTextRect );
Size aBoxSize ( aTextPxRect.GetWidth() + TEXT_PADDING * 2,
@@ -116,7 +125,7 @@ void SwHeaderFooterWin::Paint( const Rectangle& rRect )
// Draw the text
SetTextColor( Color( aLineColor ) );
DrawText( Point( rRect.Left() + TEXT_PADDING, rRect.Top() + TEXT_PADDING ),
- String( m_sText ) );
+ String( m_sLabel ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/docvw.hrc b/sw/source/ui/docvw/docvw.hrc
index 9a8987c..136bbc1 100644
--- a/sw/source/ui/docvw/docvw.hrc
+++ b/sw/source/ui/docvw/docvw.hrc
@@ -81,6 +81,9 @@
#define STR_SMARTTAG_CLICK (RC_DOCVW_BEGIN + 21)
+#define STR_HEADER_TITLE (RC_DOCVW_BEGIN + 22)
+#define STR_FOOTER_TITLE (RC_DOCVW_BEGIN + 23)
+
#define MSG_READONLY_CONTENT (RC_DOCVW_BEGIN + 1)
#define DOCVW_ACT_END STR_SMARTTAG_CLICK
diff --git a/sw/source/ui/docvw/docvw.src b/sw/source/ui/docvw/docvw.src
index b4f57bb..ec01a8f 100644
--- a/sw/source/ui/docvw/docvw.src
+++ b/sw/source/ui/docvw/docvw.src
@@ -291,3 +291,13 @@ String STR_SMARTTAG_CLICK
Text [ en-US ] = "%s-click to open Smart Tag menu" ;
};
+String STR_HEADER_TITLE
+{
+ Text [ en-US ] = "Header (%1)" ;
+};
+
+String STR_FOOTER_TITLE
+{
+ Text [ en-US ] = "Footer (%1)" ;
+};
+
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index a42966a..481b362 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -119,6 +119,7 @@
#include <breakit.hxx>
#include <checkit.hxx>
#include <HeaderFooterWin.hxx>
+#include <pagedesc.hxx>
#include <helpid.h>
#include <cmdid.h>
@@ -5680,9 +5681,9 @@ Selection SwEditWin::GetSurroundingTextSelection() const
}
}
-void SwEditWin::AddHeaderFooterControl( const rtl::OUString& sLabel, bool bHeader, Point aOffset )
+void SwEditWin::AddHeaderFooterControl( SwPageDesc* pPageDesc, bool bHeader, Point aOffset )
{
- boost::shared_ptr< SwHeaderFooterWin > pNewControl( new SwHeaderFooterWin( this, sLabel, bHeader, aOffset ) );
+ boost::shared_ptr< SwHeaderFooterWin > pNewControl( new SwHeaderFooterWin( this, pPageDesc, bHeader, aOffset ) );
pNewControl->Show( );
aHeadFootControls.push_back( pNewControl );
}
diff --git a/sw/source/ui/inc/HeaderFooterWin.hxx b/sw/source/ui/inc/HeaderFooterWin.hxx
index b41fd09..9f59f14 100644
--- a/sw/source/ui/inc/HeaderFooterWin.hxx
+++ b/sw/source/ui/inc/HeaderFooterWin.hxx
@@ -28,6 +28,8 @@
#ifndef _HEADERFOOTERWINDOW_HXX
#define _HEADERFOOTERWINDOW_HXX
+#include <pagedesc.hxx>
+
#include <vcl/floatwin.hxx>
/** Class for the header and footer separator control window.
@@ -37,12 +39,13 @@
*/
class SwHeaderFooterWin : public FloatingWindow
{
- SwEditWin* m_pEditWin;
- const rtl::OUString m_sText;
- bool m_bIsHeader;
+ SwEditWin* m_pEditWin;
+ rtl::OUString m_sLabel;
+ SwPageDesc* m_pPageDesc;
+ bool m_bIsHeader;
public:
- SwHeaderFooterWin( SwEditWin* pEditWin, const rtl::OUString& sLabel, bool bHeader, Point aOffset );
+ SwHeaderFooterWin( SwEditWin* pEditWin, SwPageDesc* pPageDesc, bool bHeader, Point aOffset );
virtual void Paint( const Rectangle& rRect );
};
diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx
index 5eade2a..53c525e 100644
--- a/sw/source/ui/inc/edtwin.hxx
+++ b/sw/source/ui/inc/edtwin.hxx
@@ -55,6 +55,7 @@ struct SwApplyTemplate;
struct QuickHelpData;
class SdrDropMarkerOverlay;
class SwHeaderFooterWin;
+class SwPageDesc;
/*--------------------------------------------------------------------
Description: input window
@@ -311,7 +312,7 @@ public:
void SetUseInputLanguage( sal_Bool bNew );
sal_Bool IsUseInputLanguage() const { return bUseInputLanguage; }
- void AddHeaderFooterControl( const rtl::OUString& sLabel, bool bHeader, Point aOffset );
+ void AddHeaderFooterControl( SwPageDesc* pPageDesc, bool bHeader, Point aOffset );
void ClearHeaderFooterControls( );
SwEditWin(Window *pParent, SwView &);
commit 2f150822d854d8fb5df5a7f32cefd6cd623824a1
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date: Mon Sep 5 15:01:31 2011 +0200
Header/Footer: moved the SwHeaderFooterWin to separate {h,c}xx files
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 0636bdf..35b2b03 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -589,6 +589,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/ui/docvw/SidebarTxtControlAcc \
sw/source/ui/docvw/SidebarWin \
sw/source/ui/docvw/SidebarWinAcc \
+ sw/source/ui/docvw/HeaderFooterWin \
sw/source/ui/docvw/edtdd \
sw/source/ui/docvw/edtwin \
sw/source/ui/docvw/edtwin2 \
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
new file mode 100644
index 0000000..77b15e4
--- /dev/null
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 SUSE <cbosdonnat at suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <edtwin.hxx>
+#include <HeaderFooterWin.hxx>
+#include <viewopt.hxx>
+
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/color/bcolortools.hxx>
+
+#define TEXT_PADDING 7
+#define BOX_DISTANCE 10
+
+// the WB_MOVABLE flag is used here to avoid the window to appear on all desktops (on linux)
+// and the WB_OWNERDRAWDECORATION prevents the system to draw the window decorations.
+//
+SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const rtl::OUString& sLabel, bool bHeader, Point aOffset ) :
+ FloatingWindow( pEditWin, WB_SYSTEMWINDOW | WB_NOBORDER | WB_NOSHADOW | WB_MOVEABLE | WB_OWNERDRAWDECORATION ),
+ m_pEditWin( pEditWin ),
+ m_sText( sLabel ),
+ m_bIsHeader( bHeader )
+{
+ // Get the font and configure it
+ Font aFont = GetSettings().GetStyleSettings().GetToolFont();
+ SetZoomedPointFont( aFont );
+
+ // Use pixels for the rest of the drawing
+ SetMapMode( MapMode ( MAP_PIXEL ) );
+
+ // Compute the position & size of the window
+ Rectangle aTextRect;
+ GetTextBoundRect( aTextRect, String( sLabel ) );
+ Rectangle aTextPxRect = LogicToPixel( aTextRect );
+
+ Size aBoxSize ( aTextPxRect.GetWidth() + TEXT_PADDING * 2,
+ aTextPxRect.GetHeight() + TEXT_PADDING * 2 );
+
+ long nYFooterOff = 0;
+ if ( !bHeader )
+ nYFooterOff = aBoxSize.Height();
+
+ Size aPosOffset ( pEditWin->GetOutOffXPixel(), pEditWin->GetOutOffYPixel() );
+ Point aBoxPos( aPosOffset.Width() + aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
+ aPosOffset.Height() + aOffset.Y() - nYFooterOff );
+
+ // Set the position & Size of the window
+ SetPosSizePixel( aBoxPos, aBoxSize );
+
+ // TODO Add the list_add.png picture
+}
+
+void SwHeaderFooterWin::Paint( const Rectangle& rRect )
+{
+ // Colors
+ basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
+ basegfx::BColor aHslLine = basegfx::tools::rgb2hsl( aLineColor );
+ double nLuminance = aHslLine.getZ() * 2.5;
+ if ( nLuminance == 0 )
+ nLuminance = 0.5;
+ else if ( nLuminance >= 1.0 )
+ nLuminance = aHslLine.getZ() * 0.4;
+ aHslLine.setZ( nLuminance );
+ basegfx::BColor aFillColor = basegfx::tools::hsl2rgb( aHslLine );
+
+ // Draw the background rect
+ SetFillColor( Color ( aFillColor ) );
+ SetLineColor( Color ( aFillColor ) );
+ DrawRect( rRect );
+
+ // Draw the lines around the rect
+ SetLineColor( Color( aLineColor ) );
+ basegfx::B2DPolygon aPolygon;
+ aPolygon.append( basegfx::B2DPoint( rRect.Left(), rRect.Top() ) );
+ aPolygon.append( basegfx::B2DPoint( rRect.Left(), rRect.Bottom() ) );
+ DrawPolyLine( aPolygon, 1.0 );
+
+ aPolygon.clear();
+ aPolygon.append( basegfx::B2DPoint( rRect.Right(), rRect.Top() ) );
+ aPolygon.append( basegfx::B2DPoint( rRect.Right(), rRect.Bottom() ) );
+ DrawPolyLine( aPolygon, 1.0 );
+
+ long nYLine = rRect.Bottom();
+ if ( !m_bIsHeader )
+ nYLine = rRect.Top();
+ aPolygon.clear();
+ aPolygon.append( basegfx::B2DPoint( rRect.Left(), nYLine ) );
+ aPolygon.append( basegfx::B2DPoint( rRect.Right(), nYLine ) );
+ DrawPolyLine( aPolygon, 1.0 );
+
+
+ // Draw the text
+ SetTextColor( Color( aLineColor ) );
+ DrawText( Point( rRect.Left() + TEXT_PADDING, rRect.Top() + TEXT_PADDING ),
+ String( m_sText ) );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 4263150..a42966a 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -118,6 +118,7 @@
#include <crsskip.hxx>
#include <breakit.hxx>
#include <checkit.hxx>
+#include <HeaderFooterWin.hxx>
#include <helpid.h>
#include <cmdid.h>
@@ -5679,95 +5680,9 @@ Selection SwEditWin::GetSurroundingTextSelection() const
}
}
-#define TEXT_PADDING 7
-#define BOX_DISTANCE 10
-
-// the WB_MOVABLE flag is used here to avoid the window to appear on all desktops (on linux)
-// and the WB_OWNERDRAWDECORATION prevents the system to draw the window decorations.
-//
-SwHeaderFooterControl::SwHeaderFooterControl( Window* pParent, const rtl::OUString& sLabel, bool bHeader, Point aOffset, Size aPosOffset ) :
- FloatingWindow( pParent, WB_SYSTEMWINDOW | WB_NOBORDER | WB_NOSHADOW | WB_MOVEABLE | WB_OWNERDRAWDECORATION ),
- m_sText( sLabel ),
- m_bIsHeader( bHeader ),
- m_aPosOffset( aPosOffset )
-{
- // Get the font and configure it
- Font aFont = GetSettings().GetStyleSettings().GetToolFont();
- SetZoomedPointFont( aFont );
-
- // Use pixels for the rest of the drawing
- SetMapMode( MapMode ( MAP_PIXEL ) );
-
- // Compute the position & size of the window
- Rectangle aTextRect;
- GetTextBoundRect( aTextRect, String( sLabel ) );
- Rectangle aTextPxRect = LogicToPixel( aTextRect );
-
- Size aBoxSize ( aTextPxRect.GetWidth() + TEXT_PADDING * 2,
- aTextPxRect.GetHeight() + TEXT_PADDING * 2 );
-
- long nYFooterOff = 0;
- if ( !bHeader )
- nYFooterOff = aBoxSize.Height();
-
- Point aBoxPos( m_aPosOffset.Width() + aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
- m_aPosOffset.Height() + aOffset.Y() - nYFooterOff );
-
- // Set the position & Size of the window
- SetPosSizePixel( aBoxPos, aBoxSize );
-
- // TODO Add the list_add.png picture
-}
-
-void SwHeaderFooterControl::Paint( const Rectangle& rRect )
-{
- // Colors
- basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
- basegfx::BColor aHslLine = basegfx::tools::rgb2hsl( aLineColor );
- double nLuminance = aHslLine.getZ() * 2.5;
- if ( nLuminance == 0 )
- nLuminance = 0.5;
- else if ( nLuminance >= 1.0 )
- nLuminance = aHslLine.getZ() * 0.4;
- aHslLine.setZ( nLuminance );
- basegfx::BColor aFillColor = basegfx::tools::hsl2rgb( aHslLine );
-
- // Draw the background rect
- SetFillColor( Color ( aFillColor ) );
- SetLineColor( Color ( aFillColor ) );
- DrawRect( rRect );
-
- // Draw the lines around the rect
- SetLineColor( Color( aLineColor ) );
- basegfx::B2DPolygon aPolygon;
- aPolygon.append( basegfx::B2DPoint( rRect.Left(), rRect.Top() ) );
- aPolygon.append( basegfx::B2DPoint( rRect.Left(), rRect.Bottom() ) );
- DrawPolyLine( aPolygon, 1.0 );
-
- aPolygon.clear();
- aPolygon.append( basegfx::B2DPoint( rRect.Right(), rRect.Top() ) );
- aPolygon.append( basegfx::B2DPoint( rRect.Right(), rRect.Bottom() ) );
- DrawPolyLine( aPolygon, 1.0 );
-
- long nYLine = rRect.Bottom();
- if ( !m_bIsHeader )
- nYLine = rRect.Top();
- aPolygon.clear();
- aPolygon.append( basegfx::B2DPoint( rRect.Left(), nYLine ) );
- aPolygon.append( basegfx::B2DPoint( rRect.Right(), nYLine ) );
- DrawPolyLine( aPolygon, 1.0 );
-
-
- // Draw the text
- SetTextColor( Color( aLineColor ) );
- DrawText( Point( rRect.Left() + TEXT_PADDING, rRect.Top() + TEXT_PADDING ),
- String( m_sText ) );
-}
-
void SwEditWin::AddHeaderFooterControl( const rtl::OUString& sLabel, bool bHeader, Point aOffset )
{
- SwHeaderFooterControl::Pointer pNewControl( new SwHeaderFooterControl( this, sLabel, bHeader, aOffset,
- Size( GetOutOffXPixel(), GetOutOffYPixel() ) ) );
+ boost::shared_ptr< SwHeaderFooterWin > pNewControl( new SwHeaderFooterWin( this, sLabel, bHeader, aOffset ) );
pNewControl->Show( );
aHeadFootControls.push_back( pNewControl );
}
diff --git a/sw/source/ui/inc/HeaderFooterWin.hxx b/sw/source/ui/inc/HeaderFooterWin.hxx
new file mode 100644
index 0000000..b41fd09
--- /dev/null
+++ b/sw/source/ui/inc/HeaderFooterWin.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 SUSE <cbosdonnat at suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _HEADERFOOTERWINDOW_HXX
+#define _HEADERFOOTERWINDOW_HXX
+
+#include <vcl/floatwin.hxx>
+
+/** Class for the header and footer separator control window.
+
+ This control is showing the header / footer style name and provides
+ a few useful actions to the user.
+ */
+class SwHeaderFooterWin : public FloatingWindow
+{
+ SwEditWin* m_pEditWin;
+ const rtl::OUString m_sText;
+ bool m_bIsHeader;
+
+public:
+ SwHeaderFooterWin( SwEditWin* pEditWin, const rtl::OUString& sLabel, bool bHeader, Point aOffset );
+
+ virtual void Paint( const Rectangle& rRect );
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx
index 96b1f7f..5eade2a 100644
--- a/sw/source/ui/inc/edtwin.hxx
+++ b/sw/source/ui/inc/edtwin.hxx
@@ -32,7 +32,6 @@
#include <tools/link.hxx>
#include <vcl/timer.hxx>
#include <vcl/window.hxx>
-#include <vcl/floatwin.hxx>
#include <svtools/transfer.hxx>
#include <swevent.hxx>
@@ -54,31 +53,13 @@ class SvxAutoCorrect;
class SwPaM;
struct SwApplyTemplate;
struct QuickHelpData;
-class SdrDropMarkerOverlay;
+class SdrDropMarkerOverlay;
+class SwHeaderFooterWin;
/*--------------------------------------------------------------------
Description: input window
--------------------------------------------------------------------*/
-/** Class for the header and footer separator control window.
-
- This control is showing the header / footer style name and provides
- a few useful actions to the user.
- */
-class SwHeaderFooterControl : public FloatingWindow
-{
- const rtl::OUString m_sText;
- bool m_bIsHeader;
- Size m_aPosOffset;
-
-public:
- SwHeaderFooterControl( Window* pParent, const rtl::OUString& sLabel, bool bHeader, Point aOffset, Size aOffsetPos );
-
- virtual void Paint( const Rectangle& rRect );
-
- typedef boost::shared_ptr< SwHeaderFooterControl > Pointer;
-};
-
/** Window class for the Writer edit area, this is the one handling mouse
and keyboard events and doing the final painting of the document from
the buffered layout.
@@ -175,7 +156,7 @@ friend void PageNumNotify( ViewShell* pVwSh,
sal_uInt16 nKS_NUMDOWN_Count; // #i23725#
sal_uInt16 nKS_NUMINDENTINC_Count;
- std::vector< SwHeaderFooterControl::Pointer > aHeadFootControls;
+ std::vector< boost::shared_ptr< SwHeaderFooterWin >> aHeadFootControls;
void LeaveArea(const Point &);
void JustifyAreaTimer();
More information about the Libreoffice-commits
mailing list