summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-01-04 15:20:22 +0100
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-01-04 15:22:43 +0100
commitdbd83924fb5b30c0a4ba280d2d61a0f17b166453 (patch)
treec6f83e2f1844b41101edb11d39f0529ab58e7859 /sw
parent63ade823e2d854b60df76790e3628a5ab78f653a (diff)
Page Break, Header/Footer: fixed the line color change if config changes
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/docvw/DashedLine.cxx8
-rw-r--r--sw/source/ui/docvw/HeaderFooterWin.cxx3
-rw-r--r--sw/source/ui/docvw/PageBreakWin.cxx7
-rw-r--r--sw/source/ui/inc/DashedLine.hxx4
4 files changed, 10 insertions, 12 deletions
diff --git a/sw/source/ui/docvw/DashedLine.cxx b/sw/source/ui/docvw/DashedLine.cxx
index 04707336bec3..3cb66b1e1418 100644
--- a/sw/source/ui/docvw/DashedLine.cxx
+++ b/sw/source/ui/docvw/DashedLine.cxx
@@ -36,9 +36,9 @@
#include <svx/sdr/contact/objectcontacttools.hxx>
#include <vcl/svapp.hxx>
-SwDashedLine::SwDashedLine( Window* pParent, const basegfx::BColor& rColor ) :
+SwDashedLine::SwDashedLine( Window* pParent, Color& ( *pColorFn )() ) :
FixedLine( pParent, WB_DIALOGCONTROL | WB_HORZ ),
- m_aColor( rColor )
+ m_pColorFn( pColorFn )
{
}
@@ -69,7 +69,7 @@ void SwDashedLine::Paint( const Rectangle& )
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
std::vector< double > aStrokePattern;
- basegfx::BColor aColor = m_aColor;
+ basegfx::BColor aColor = m_pColorFn().getBColor();
if ( rSettings.GetHighContrastMode( ) )
{
// Only a solid line in high contrast mode
@@ -103,7 +103,7 @@ void SwDashedLine::Paint( const Rectangle& )
drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D * pLine =
new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D (
basegfx::B2DPolyPolygon( aPolygon ),
- drawinglayer::attribute::LineAttribute( m_aColor ),
+ drawinglayer::attribute::LineAttribute( m_pColorFn().getBColor() ),
drawinglayer::attribute::StrokeAttribute( aStrokePattern ) );
aSeq[ aSeq.getLength() - 1 ] = drawinglayer::primitive2d::Primitive2DReference( pLine );
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 70e5b3d0c01c..ff7d50eddf80 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -163,8 +163,7 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
SetMapMode( MapMode ( MAP_PIXEL ) );
// Create the line control
- basegfx::BColor aColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
- m_pLine = new SwDashedLine( GetEditWin(), aColor );
+ m_pLine = new SwDashedLine( GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor );
m_pLine->SetZOrder( this, WINDOW_ZORDER_BEFOR );
// Create and set the PopupMenu
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx
index 300aa4d14fd2..aa1085cb28a9 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -120,8 +120,8 @@ namespace
SwPageBreakWin* m_pWin;
public:
- SwBreakDashedLine( Window* pParent, const BColor& rColor, SwPageBreakWin* pWin ) :
- SwDashedLine( pParent, rColor ),
+ SwBreakDashedLine( Window* pParent, Color& ( *pColorFn )(), SwPageBreakWin* pWin ) :
+ SwDashedLine( pParent, pColorFn ),
m_pWin( pWin ) {};
virtual void MouseMove( const MouseEvent& rMEvt );
@@ -171,8 +171,7 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm )
SetMapMode( MapMode ( MAP_PIXEL ) );
// Create the line control
- BColor aColor = SwViewOption::GetPageBreakColor().getBColor();
- m_pLine = new SwBreakDashedLine( GetEditWin(), aColor, this );
+ m_pLine = new SwBreakDashedLine( GetEditWin(), &SwViewOption::GetPageBreakColor, this );
// Create the popup menu
m_pPopupMenu = new PopupMenu( SW_RES( MN_PAGEBREAK_BUTTON ) );
diff --git a/sw/source/ui/inc/DashedLine.hxx b/sw/source/ui/inc/DashedLine.hxx
index 671024a3666a..21719ea9c152 100644
--- a/sw/source/ui/inc/DashedLine.hxx
+++ b/sw/source/ui/inc/DashedLine.hxx
@@ -35,10 +35,10 @@
*/
class SwDashedLine : public FixedLine
{
- basegfx::BColor m_aColor;
+ Color& (*m_pColorFn)();
public:
- SwDashedLine( Window* pParent, const basegfx::BColor& rColor );
+ SwDashedLine( Window* pParent, Color& ( *pColorFn )() );
~SwDashedLine( );
virtual void Paint( const Rectangle& rRect );