Page Break, Header/Footer: fixed the line color change if config changes
This commit is contained in:
parent
63ade823e2
commit
dbd83924fb
4 changed files with 10 additions and 12 deletions
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue