[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Jan 4 06:24:12 PST 2012


 sw/source/ui/docvw/DashedLine.cxx      |    8 ++++----
 sw/source/ui/docvw/HeaderFooterWin.cxx |    3 +--
 sw/source/ui/docvw/PageBreakWin.cxx    |    7 +++----
 sw/source/ui/inc/DashedLine.hxx        |    4 ++--
 4 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 3b5a556fe6b1de0e71af2fae554e48b0553e750c
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Wed Jan 4 15:20:22 2012 +0100

    Page Break, Header/Footer: fixed the line color change if config changes

diff --git a/sw/source/ui/docvw/DashedLine.cxx b/sw/source/ui/docvw/DashedLine.cxx
index 0470733..3cb66b1 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 df39978..180b975 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 7c1f00e..4799320 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -160,8 +160,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 );
@@ -206,8 +206,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 671024a..21719ea 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 );


More information about the Libreoffice-commits mailing list