[Libreoffice-commits] core.git: 27 commits - avmedia/source basctl/source chart2/source cui/source include/sfx2 include/svx include/vcl sfx2/source starmath/source svx/source sw/inc sw/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Wed May 13 19:37:11 PDT 2015


 avmedia/source/viewer/mediawindow_impl.cxx               |  395 +++-----
 avmedia/source/viewer/mediawindow_impl.hxx               |  200 +---
 basctl/source/basicide/baside2.cxx                       |   59 -
 basctl/source/basicide/baside2.hxx                       |    4 
 basctl/source/basicide/baside2b.cxx                      |  220 +---
 basctl/source/basicide/baside3.cxx                       |   46 
 basctl/source/basicide/linenumberwindow.cxx              |   20 
 basctl/source/basicide/linenumberwindow.hxx              |    2 
 basctl/source/dlged/dlged.cxx                            |   38 
 basctl/source/inc/baside3.hxx                            |    2 
 basctl/source/inc/dlged.hxx                              |    3 
 chart2/source/controller/main/ChartController.hxx        |   30 
 chart2/source/controller/main/ChartController_Window.cxx |   22 
 chart2/source/controller/main/ChartWindow.cxx            |    6 
 cui/source/dialogs/about.cxx                             |   34 
 cui/source/dialogs/colorpicker.cxx                       |  735 ++++++++-------
 cui/source/dialogs/cuicharmap.cxx                        |   37 
 cui/source/dialogs/cuigrfflt.cxx                         |   24 
 cui/source/dialogs/hangulhanjadlg.cxx                    |   76 -
 cui/source/dialogs/hlmarkwn.cxx                          |   14 
 cui/source/dialogs/thesdlg.cxx                           |    9 
 cui/source/inc/about.hxx                                 |    2 
 cui/source/inc/cuicharmap.hxx                            |    5 
 cui/source/inc/cuigrfflt.hxx                             |   25 
 cui/source/inc/grfpage.hxx                               |    2 
 cui/source/tabpages/backgrnd.cxx                         |  193 +--
 cui/source/tabpages/grfpage.cxx                          |   28 
 cui/source/tabpages/numfmt.cxx                           |   35 
 cui/source/tabpages/numpages.cxx                         |  162 +--
 cui/source/tabpages/tabstpge.cxx                         |  156 +--
 include/sfx2/templateabstractview.hxx                    |    2 
 include/sfx2/thumbnailview.hxx                           |   14 
 include/svx/charmap.hxx                                  |    9 
 include/vcl/outdevstate.hxx                              |    3 
 sfx2/source/control/templateabstractview.cxx             |    3 
 sfx2/source/control/thumbnailview.cxx                    |   59 -
 sfx2/source/dialog/backingwindow.cxx                     |   34 
 sfx2/source/dialog/backingwindow.hxx                     |  107 +-
 sfx2/source/dialog/dockwin.cxx                           |  207 +---
 sfx2/source/dialog/infobar.cxx                           |    8 
 sfx2/source/dialog/titledockwin.cxx                      |  112 +-
 sfx2/source/doc/doctemplates.cxx                         |   70 -
 sfx2/source/doc/new.cxx                                  |  139 +-
 sfx2/source/inc/preview.hxx                              |   10 
 sfx2/source/sidebar/Deck.cxx                             |   99 --
 sfx2/source/sidebar/Deck.hxx                             |   32 
 sfx2/source/sidebar/DeckTitleBar.cxx                     |   12 
 sfx2/source/sidebar/DeckTitleBar.hxx                     |   22 
 sfx2/source/sidebar/DrawHelper.cxx                       |  160 +--
 sfx2/source/sidebar/DrawHelper.hxx                       |   36 
 sfx2/source/sidebar/MenuButton.cxx                       |   34 
 sfx2/source/sidebar/Panel.cxx                            |   26 
 sfx2/source/sidebar/PanelTitleBar.cxx                    |   25 
 sfx2/source/sidebar/PanelTitleBar.hxx                    |   22 
 sfx2/source/sidebar/SidebarToolBox.cxx                   |   35 
 sfx2/source/sidebar/TabBar.cxx                           |   71 -
 sfx2/source/sidebar/TabItem.cxx                          |   22 
 sfx2/source/sidebar/TitleBar.cxx                         |  106 --
 sfx2/source/sidebar/TitleBar.hxx                         |   37 
 starmath/source/ElementsDockingWindow.cxx                |   70 -
 starmath/source/dialog.cxx                               |   57 -
 svx/source/fmcomp/gridctrl.cxx                           |   36 
 sw/inc/SidebarWin.hxx                                    |    2 
 sw/source/uibase/docvw/AnnotationMenuButton.cxx          |  155 +--
 sw/source/uibase/docvw/DashedLine.cxx                    |   56 -
 sw/source/uibase/docvw/HeaderFooterWin.cxx               |  352 +++----
 sw/source/uibase/docvw/PageBreakWin.cxx                  |   94 -
 sw/source/uibase/docvw/SidebarTxtControl.cxx             |   42 
 sw/source/uibase/docvw/SidebarWin.cxx                    |   68 -
 69 files changed, 2251 insertions(+), 2781 deletions(-)

New commits:
commit 41df7db9459c61cc03dda0dfb344b8ac7bf901cb
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 14 11:36:07 2015 +0900

    refactor sw Sidebar classes to use RenderContext
    
    Change-Id: I09a4abd8fb34470c4c365aa1f604accd80631ab3

diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index 8790c62..92ec2d4 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -182,7 +182,7 @@ class SwSidebarWin : public vcl::Window
     protected:
         virtual void    DataChanged( const DataChangedEvent& aEvent) SAL_OVERRIDE;
         virtual void    LoseFocus() SAL_OVERRIDE;
-        virtual void    Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
+        virtual void    Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
         virtual void    GetFocus() SAL_OVERRIDE;
         virtual VclPtr<MenuButton> CreateMenuButton() = 0;
 
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index cfa3dc3..046cf49 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -36,24 +36,22 @@
 
 namespace sw { namespace annotation {
 
-Color ColorFromAlphaColor( const sal_uInt8 aTransparency,
-                           const Color &aFront,
-                           const Color &aBack )
+Color ColorFromAlphaColor(const sal_uInt8 aTransparency, const Color& aFront, const Color& aBack)
 {
-    return Color((sal_uInt8)(aFront.GetRed()    * aTransparency/(double)255 + aBack.GetRed()    * (1-aTransparency/(double)255)),
-                 (sal_uInt8)(aFront.GetGreen()  * aTransparency/(double)255 + aBack.GetGreen()  * (1-aTransparency/(double)255)),
-                 (sal_uInt8)(aFront.GetBlue()   * aTransparency/(double)255 + aBack.GetBlue()   * (1-aTransparency/(double)255)));
+    return Color(sal_uInt8(aFront.GetRed()   * aTransparency / 255.0 + aBack.GetRed()   * (1 - aTransparency / 255.0)),
+                 sal_uInt8(aFront.GetGreen() * aTransparency / 255.0 + aBack.GetGreen() * (1 - aTransparency / 255.0)),
+                 sal_uInt8(aFront.GetBlue()  * aTransparency / 255.0 + aBack.GetBlue()  * (1 - aTransparency / 255.0)));
 }
 
-AnnotationMenuButton::AnnotationMenuButton( sw::sidebarwindows::SwSidebarWin& rSidebarWin )
-    : MenuButton( &rSidebarWin )
-    , mrSidebarWin( rSidebarWin )
+AnnotationMenuButton::AnnotationMenuButton(sw::sidebarwindows::SwSidebarWin& rSidebarWin)
+    : MenuButton(&rSidebarWin)
+    , mrSidebarWin(rSidebarWin)
 {
-    AddEventListener( LINK( &mrSidebarWin, sw::sidebarwindows::SwSidebarWin, WindowEventListener ) );
+    AddEventListener(LINK(&mrSidebarWin, sw::sidebarwindows::SwSidebarWin, WindowEventListener));
 
-    SetAccessibleName( SW_RES( STR_ACCESS_ANNOTATION_BUTTON_NAME ) );
-    SetAccessibleDescription( SW_RES( STR_ACCESS_ANNOTATION_BUTTON_DESC ) );
-    SetQuickHelpText( GetAccessibleDescription() );
+    SetAccessibleName(SW_RES(STR_ACCESS_ANNOTATION_BUTTON_NAME));
+    SetAccessibleDescription(SW_RES(STR_ACCESS_ANNOTATION_BUTTON_DESC));
+    SetQuickHelpText(GetAccessibleDescription());
 }
 
 AnnotationMenuButton::~AnnotationMenuButton()
@@ -63,7 +61,7 @@ AnnotationMenuButton::~AnnotationMenuButton()
 
 void AnnotationMenuButton::dispose()
 {
-    RemoveEventListener( LINK( &mrSidebarWin, sw::sidebarwindows::SwSidebarWin, WindowEventListener ) );
+    RemoveEventListener(LINK(&mrSidebarWin, sw::sidebarwindows::SwSidebarWin, WindowEventListener));
     MenuButton::dispose();
 }
 
@@ -74,138 +72,135 @@ void AnnotationMenuButton::Select()
 
 void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
 {
-    PopupMenu* pButtonPopup( GetPopupMenu() );
-    if ( mrSidebarWin.IsReadOnly() )
+    PopupMenu* pButtonPopup(GetPopupMenu());
+    if (mrSidebarWin.IsReadOnly())
     {
-        pButtonPopup->EnableItem( FN_REPLY, false );
-        pButtonPopup->EnableItem( FN_DELETE_COMMENT, false );
-        pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, false );
-        pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, false );
-        pButtonPopup->EnableItem( FN_FORMAT_ALL_NOTES, false );
+        pButtonPopup->EnableItem(FN_REPLY, false );
+        pButtonPopup->EnableItem(FN_DELETE_COMMENT, false );
+        pButtonPopup->EnableItem(FN_DELETE_NOTE_AUTHOR, false );
+        pButtonPopup->EnableItem(FN_DELETE_ALL_NOTES, false );
+        pButtonPopup->EnableItem(FN_FORMAT_ALL_NOTES, false );
     }
     else
     {
-        pButtonPopup->EnableItem( FN_DELETE_COMMENT, !mrSidebarWin.IsProtected() );
-        pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, true );
-        pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, true );
-        pButtonPopup->EnableItem( FN_FORMAT_ALL_NOTES, true );
+        pButtonPopup->EnableItem(FN_DELETE_COMMENT, !mrSidebarWin.IsProtected() );
+        pButtonPopup->EnableItem(FN_DELETE_NOTE_AUTHOR, true );
+        pButtonPopup->EnableItem(FN_DELETE_ALL_NOTES, true );
+        pButtonPopup->EnableItem(FN_FORMAT_ALL_NOTES, true );
     }
 
-    if ( mrSidebarWin.IsProtected() )
+    if (mrSidebarWin.IsProtected())
     {
-        pButtonPopup->EnableItem( FN_REPLY, false );
+        pButtonPopup->EnableItem(FN_REPLY, false);
     }
     else
     {
         SvtUserOptions aUserOpt;
         OUString sAuthor;
-        if ( (sAuthor = aUserOpt.GetFullName()).isEmpty() )
+        if ((sAuthor = aUserOpt.GetFullName()).isEmpty())
         {
-            if ( (sAuthor = aUserOpt.GetID()).isEmpty() )
+            if ((sAuthor = aUserOpt.GetID()).isEmpty())
             {
-                sAuthor = SW_RES( STR_REDLINE_UNKNOWN_AUTHOR );
+                sAuthor = SW_RES(STR_REDLINE_UNKNOWN_AUTHOR);
             }
         }
         // do not allow to reply to ourself and no answer possible if this note is in a protected section
-        if ( sAuthor == mrSidebarWin.GetAuthor() )
+        if (sAuthor == mrSidebarWin.GetAuthor())
         {
-            pButtonPopup->EnableItem( FN_REPLY, false );
+            pButtonPopup->EnableItem(FN_REPLY, false);
         }
         else
         {
-            pButtonPopup->EnableItem( FN_REPLY, true );
+            pButtonPopup->EnableItem(FN_REPLY, true);
         }
     }
 
-    MenuButton::MouseButtonDown( rMEvt );
+    MenuButton::MouseButtonDown(rMEvt);
 }
 
-void AnnotationMenuButton::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& /*rRect*/ )
+void AnnotationMenuButton::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/)
 {
-    if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
-        SetFillColor(COL_BLACK);
+    bool bHighContrast = rRenderContext.GetSettings().GetStyleSettings().GetHighContrastMode();
+
+    if (bHighContrast)
+        rRenderContext.SetFillColor(COL_BLACK);
     else
-        SetFillColor( mrSidebarWin.ColorDark() );
-    SetLineColor();
-    const Rectangle aRect( Rectangle( Point( 0, 0 ), PixelToLogic( GetSizePixel() ) ) );
-    DrawRect( aRect );
+        rRenderContext.SetFillColor(mrSidebarWin.ColorDark());
+    rRenderContext.SetLineColor();
+    const Rectangle aRect(Rectangle(Point(0, 0), rRenderContext.PixelToLogic(GetSizePixel())));
+    rRenderContext.DrawRect(aRect);
 
-    if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+    if (bHighContrast)
     {
         //draw rect around button
-        SetFillColor(COL_BLACK);
-        SetLineColor(COL_WHITE);
+        rRenderContext.SetFillColor(COL_BLACK);
+        rRenderContext.SetLineColor(COL_WHITE);
     }
     else
     {
         //draw button
         Gradient aGradient;
-        if ( IsMouseOver() )
-            aGradient = Gradient( GradientStyle_LINEAR,
-                                  ColorFromAlphaColor( 80, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark() ),
-                                  ColorFromAlphaColor( 15, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark() ));
+        if (IsMouseOver())
+            aGradient = Gradient(GradientStyle_LINEAR,
+                                 ColorFromAlphaColor(80, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark()),
+                                 ColorFromAlphaColor(15, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark()));
         else
-            aGradient = Gradient( GradientStyle_LINEAR,
-                                  ColorFromAlphaColor( 15, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark() ),
-                                  ColorFromAlphaColor( 80, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark() ));
-        DrawGradient( aRect, aGradient );
+            aGradient = Gradient(GradientStyle_LINEAR,
+                                 ColorFromAlphaColor(15, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark()),
+                                 ColorFromAlphaColor(80, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark()));
+        rRenderContext.DrawGradient(aRect, aGradient);
 
         //draw rect around button
-        SetFillColor();
-        SetLineColor( ColorFromAlphaColor( 90, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark() ));
+        rRenderContext.SetFillColor();
+        rRenderContext.SetLineColor(ColorFromAlphaColor(90, mrSidebarWin.ColorAnchor(), mrSidebarWin.ColorDark()));
     }
-    DrawRect( aRect );
+    rRenderContext.DrawRect(aRect);
 
-    if ( mrSidebarWin.IsPreview() )
+    if (mrSidebarWin.IsPreview())
     {
-        vcl::Font aOldFont( mrSidebarWin.GetFont() );
+        vcl::Font aOldFont(mrSidebarWin.GetFont());
         vcl::Font aFont(aOldFont);
-        Color aCol( COL_BLACK);
-        aFont.SetColor( aCol );
+        Color aCol(COL_BLACK);
+        aFont.SetColor(aCol);
         aFont.SetHeight(200);
         aFont.SetWeight(WEIGHT_MEDIUM);
-        SetFont( aFont );
-        DrawText(  aRect ,
-                   OUString("Edit Note"),
-                   TEXT_DRAW_CENTER );
-        SetFont( aOldFont );
+        rRenderContext.SetFont(aFont);
+        rRenderContext.DrawText(aRect, OUString("Edit Note"), TEXT_DRAW_CENTER);
+        rRenderContext.SetFont(aOldFont);
     }
     else
     {
-        Rectangle aSymbolRect( aRect );
+        Rectangle aSymbolRect(aRect);
         // 25% distance to the left and right button border
-        const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth()*250)+500)/1000;
-        aSymbolRect.Left()+=nBorderDistanceLeftAndRight;
-        aSymbolRect.Right()-=nBorderDistanceLeftAndRight;
+        const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth() * 250) + 500) / 1000;
+        aSymbolRect.Left() += nBorderDistanceLeftAndRight;
+        aSymbolRect.Right() -= nBorderDistanceLeftAndRight;
         // 40% distance to the top button border
-        const long nBorderDistanceTop = ((aSymbolRect.GetHeight()*400)+500)/1000;
+        const long nBorderDistanceTop = ((aSymbolRect.GetHeight() * 400) + 500) / 1000;
         aSymbolRect.Top()+=nBorderDistanceTop;
         // 15% distance to the bottom button border
-        const long nBorderDistanceBottom = ((aSymbolRect.GetHeight()*150)+500)/1000;
-        aSymbolRect.Bottom()-=nBorderDistanceBottom;
-        DecorationView aDecoView( this );
-        aDecoView.DrawSymbol( aSymbolRect, SymbolType::SPIN_DOWN,
-                              ( Application::GetSettings().GetStyleSettings().GetHighContrastMode()
-                                ? Color( COL_WHITE )
-                                : Color( COL_BLACK ) ) );
+        const long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000;
+        aSymbolRect.Bottom() -= nBorderDistanceBottom;
+        DecorationView aDecoView(&rRenderContext);
+        aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, (bHighContrast ? Color(COL_WHITE) : Color(COL_BLACK)));
     }
 }
 
-void AnnotationMenuButton::KeyInput( const KeyEvent& rKeyEvt )
+void AnnotationMenuButton::KeyInput(const KeyEvent& rKeyEvt)
 {
     const vcl::KeyCode& rKeyCode = rKeyEvt.GetKeyCode();
     const sal_uInt16 nKey = rKeyCode.GetCode();
-    if ( nKey == KEY_TAB )
+    if (nKey == KEY_TAB)
     {
         mrSidebarWin.ActivatePostIt();
         mrSidebarWin.GrabFocus();
     }
     else
     {
-        MenuButton::KeyInput( rKeyEvt );
+        MenuButton::KeyInput(rKeyEvt);
     }
 }
 
-} } // end of namespace sw::annotation
+}} // end of namespace sw::annotation
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/docvw/DashedLine.cxx b/sw/source/uibase/docvw/DashedLine.cxx
index 8dc146c..ad08175 100644
--- a/sw/source/uibase/docvw/DashedLine.cxx
+++ b/sw/source/uibase/docvw/DashedLine.cxx
@@ -29,31 +29,30 @@ SwDashedLine::~SwDashedLine( )
 {
 }
 
-void SwDashedLine::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
+void SwDashedLine::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
 {
     const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
     boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
-        drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
-                    *this, aNewViewInfos ));
+        drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos));
 
     // Compute the start and end points
-    const Rectangle aRect( Rectangle( Point( 0, 0 ), PixelToLogic( GetSizePixel() ) ) );
-    double nHalfWidth = double( aRect.Top() + aRect.Bottom() ) / 2.0;
+    const Rectangle aRect(Rectangle(Point(0, 0), rRenderContext.PixelToLogic(GetSizePixel())));
+    double nHalfWidth = double(aRect.Top() + aRect.Bottom()) / 2.0;
 
-    basegfx::B2DPoint aStart( double( aRect.Left() ), nHalfWidth );
-    basegfx::B2DPoint aEnd( double( aRect.Right() ), nHalfWidth );
+    basegfx::B2DPoint aStart(double(aRect.Left()), nHalfWidth);
+    basegfx::B2DPoint aEnd(double(aRect.Right()), nHalfWidth);
 
     basegfx::B2DPolygon aPolygon;
-    aPolygon.append( aStart );
-    aPolygon.append( aEnd );
+    aPolygon.append(aStart);
+    aPolygon.append(aEnd);
 
-    drawinglayer::primitive2d::Primitive2DSequence aSeq( 1 );
+    drawinglayer::primitive2d::Primitive2DSequence aSeq(1);
 
     const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
 
-    std::vector< double > aStrokePattern;
+    std::vector<double> aStrokePattern;
     basegfx::BColor aColor = m_pColorFn().getBColor();
-    if ( rSettings.GetHighContrastMode( ) )
+    if (rSettings.GetHighContrastMode())
     {
         // Only a solid line in high contrast mode
         aColor = rSettings.GetDialogTextColor().getBColor();
@@ -61,37 +60,36 @@ void SwDashedLine::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangl
     else
     {
         // Get a color for the contrast
-        basegfx::BColor aHslLine = basegfx::tools::rgb2hsl( aColor );
+        basegfx::BColor aHslLine = basegfx::tools::rgb2hsl(aColor);
         double nLuminance = aHslLine.getZ();
-        nLuminance += ( 1.0 - nLuminance ) * 0.75;
-        if ( aHslLine.getZ() > 0.7 )
+        nLuminance += (1.0 - nLuminance) * 0.75;
+        if (aHslLine.getZ() > 0.7)
             nLuminance = aHslLine.getZ() * 0.7;
-        aHslLine.setZ( nLuminance );
-        const basegfx::BColor aOtherColor = basegfx::tools::hsl2rgb( aHslLine );
+        aHslLine.setZ(nLuminance);
+        const basegfx::BColor aOtherColor = basegfx::tools::hsl2rgb(aHslLine);
 
         // Compute the plain line
         drawinglayer::primitive2d::PolygonHairlinePrimitive2D * pPlainLine =
-            new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
-                    aPolygon, aOtherColor );
+            new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPolygon, aOtherColor);
 
-        aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( pPlainLine );
+        aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(pPlainLine);
         // Dashed line in twips
-        aStrokePattern.push_back( 3 );
-        aStrokePattern.push_back( 3 );
+        aStrokePattern.push_back(3);
+        aStrokePattern.push_back(3);
 
-        aSeq.realloc( 2 );
+        aSeq.realloc(2);
     }
 
     // Compute the dashed line primitive
     drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D * pLine =
-            new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D (
-                basegfx::B2DPolyPolygon( aPolygon ),
-                drawinglayer::attribute::LineAttribute( m_pColorFn().getBColor() ),
-                drawinglayer::attribute::StrokeAttribute( aStrokePattern ) );
+            new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D(
+                basegfx::B2DPolyPolygon(aPolygon),
+                drawinglayer::attribute::LineAttribute(m_pColorFn().getBColor()),
+                drawinglayer::attribute::StrokeAttribute(aStrokePattern));
 
-    aSeq[ aSeq.getLength() - 1 ] = drawinglayer::primitive2d::Primitive2DReference( pLine );
+    aSeq[aSeq.getLength() - 1] = drawinglayer::primitive2d::Primitive2DReference(pLine);
 
-    pProcessor->process( aSeq );
+    pProcessor->process(aSeq);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 3f8b568..7ee871d 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -136,35 +136,32 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
     m_aFadeTimer( )
 {
     // Get the font and configure it
-    vcl::Font aFont = GetSettings().GetStyleSettings().GetToolFont();
-    SetZoomedPointFont( aFont );
-
-    // Use pixels for the rest of the drawing
-    SetMapMode( MapMode ( MAP_PIXEL ) );
+    vcl::Font aFont = Application::GetSettings().GetStyleSettings().GetToolFont();
+    SetZoomedPointFont(aFont);
 
     // Create the line control
-    m_pLine = VclPtr<SwDashedLine>::Create( GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor );
-    m_pLine->SetZOrder( this, WINDOW_ZORDER_BEFOR );
+    m_pLine = VclPtr<SwDashedLine>::Create(GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor);
+    m_pLine->SetZOrder(this, WINDOW_ZORDER_BEFOR);
 
     // Create and set the PopupMenu
-    m_pPopupMenu = new PopupMenu( SW_RES( MN_HEADERFOOTER_BUTTON ) );
+    m_pPopupMenu = new PopupMenu(SW_RES(MN_HEADERFOOTER_BUTTON));
 
     // Rewrite the menu entries' text
-    if ( m_bIsHeader )
+    if (m_bIsHeader)
     {
-        m_pPopupMenu->SetItemText( FN_HEADERFOOTER_EDIT, SW_RESSTR( STR_FORMAT_HEADER ) );
-        m_pPopupMenu->SetItemText( FN_HEADERFOOTER_DELETE, SW_RESSTR( STR_DELETE_HEADER ) );
+        m_pPopupMenu->SetItemText(FN_HEADERFOOTER_EDIT, SW_RESSTR(STR_FORMAT_HEADER));
+        m_pPopupMenu->SetItemText(FN_HEADERFOOTER_DELETE, SW_RESSTR(STR_DELETE_HEADER));
     }
     else
     {
-        m_pPopupMenu->SetItemText( FN_HEADERFOOTER_EDIT, SW_RESSTR( STR_FORMAT_FOOTER ) );
-        m_pPopupMenu->SetItemText( FN_HEADERFOOTER_DELETE, SW_RESSTR( STR_DELETE_FOOTER ) );
+        m_pPopupMenu->SetItemText(FN_HEADERFOOTER_EDIT, SW_RESSTR(STR_FORMAT_FOOTER));
+        m_pPopupMenu->SetItemText(FN_HEADERFOOTER_DELETE, SW_RESSTR(STR_DELETE_FOOTER));
     }
 
-    SetPopupMenu( m_pPopupMenu );
+    SetPopupMenu(m_pPopupMenu);
 
-    m_aFadeTimer.SetTimeout( 50 );
-    m_aFadeTimer.SetTimeoutHdl( LINK( this, SwHeaderFooterWin, FadeHandler ) );
+    m_aFadeTimer.SetTimeout(50);
+    m_aFadeTimer.SetTimeoutHdl(LINK(this, SwHeaderFooterWin, FadeHandler));
 }
 
 SwHeaderFooterWin::~SwHeaderFooterWin( )
@@ -184,148 +181,146 @@ const SwPageFrm* SwHeaderFooterWin::GetPageFrame( )
     return static_cast< const SwPageFrm * >( GetFrame( ) );
 }
 
-void SwHeaderFooterWin::SetOffset( Point aOffset, long nXLineStart, long nXLineEnd )
+void SwHeaderFooterWin::SetOffset(Point aOffset, long nXLineStart, long nXLineEnd)
 {
     // Compute the text to show
     const SwPageDesc* pDesc = GetPageFrame()->GetPageDesc();
     bool bIsFirst = !pDesc->IsFirstShared() && GetPageFrame()->OnFirstPage();
     bool bIsLeft  = !pDesc->IsHeaderShared() && !GetPageFrame()->OnRightPage();
     bool bIsRight = !pDesc->IsHeaderShared() && GetPageFrame()->OnRightPage();
-    m_sLabel = SW_RESSTR( STR_HEADER_TITLE );
-    if ( !m_bIsHeader )
-        m_sLabel = bIsFirst ? SW_RESSTR( STR_FIRST_FOOTER_TITLE )
-            : bIsLeft  ? SW_RESSTR( STR_LEFT_FOOTER_TITLE )
-            : bIsRight ? SW_RESSTR( STR_RIGHT_FOOTER_TITLE )
-            : SW_RESSTR( STR_FOOTER_TITLE );
+    m_sLabel = SW_RESSTR(STR_HEADER_TITLE);
+    if (!m_bIsHeader)
+        m_sLabel = bIsFirst ? SW_RESSTR(STR_FIRST_FOOTER_TITLE)
+            : bIsLeft  ? SW_RESSTR(STR_LEFT_FOOTER_TITLE)
+            : bIsRight ? SW_RESSTR(STR_RIGHT_FOOTER_TITLE)
+            : SW_RESSTR(STR_FOOTER_TITLE );
     else
-        m_sLabel = bIsFirst ? SW_RESSTR( STR_FIRST_HEADER_TITLE )
-            : bIsLeft  ? SW_RESSTR( STR_LEFT_HEADER_TITLE )
-            : bIsRight ? SW_RESSTR( STR_RIGHT_HEADER_TITLE )
-            : SW_RESSTR( STR_HEADER_TITLE );
+        m_sLabel = bIsFirst ? SW_RESSTR(STR_FIRST_HEADER_TITLE)
+            : bIsLeft  ? SW_RESSTR(STR_LEFT_HEADER_TITLE)
+            : bIsRight ? SW_RESSTR(STR_RIGHT_HEADER_TITLE)
+            : SW_RESSTR(STR_HEADER_TITLE);
 
-    sal_Int32 nPos = m_sLabel.lastIndexOf( "%1" );
-    m_sLabel = m_sLabel.replaceAt( nPos, 2, pDesc->GetName() );
+    sal_Int32 nPos = m_sLabel.lastIndexOf("%1");
+    m_sLabel = m_sLabel.replaceAt(nPos, 2, pDesc->GetName());
 
     // Compute the text size and get the box position & size from it
     Rectangle aTextRect;
-    GetTextBoundRect( aTextRect, OUString( m_sLabel ) );
-    Rectangle aTextPxRect = LogicToPixel( aTextRect );
-    FontMetric aFontMetric = GetFontMetric( GetFont() );
-    Size  aBoxSize ( aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
-                     aFontMetric.GetLineHeight() + TEXT_PADDING  * 2 );
+    GetTextBoundRect(aTextRect, OUString(m_sLabel));
+    Rectangle aTextPxRect = LogicToPixel(aTextRect);
+    FontMetric aFontMetric = GetFontMetric(GetFont());
+    Size aBoxSize (aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
+                   aFontMetric.GetLineHeight() + TEXT_PADDING  * 2 );
 
     long nYFooterOff = 0;
-    if ( !m_bIsHeader )
+    if (!m_bIsHeader)
         nYFooterOff = aBoxSize.Height();
 
-    Point aBoxPos( aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
-                   aOffset.Y() - nYFooterOff );
+    Point aBoxPos(aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
+                  aOffset.Y() - nYFooterOff);
 
-    if ( AllSettings::GetLayoutRTL() )
+    if (AllSettings::GetLayoutRTL())
     {
         aBoxPos.setX( aOffset.X() + BOX_DISTANCE );
     }
 
     // Set the position & Size of the window
-    SetPosSizePixel( aBoxPos, aBoxSize );
+    SetPosSizePixel(aBoxPos, aBoxSize);
 
     double nYLinePos = aBoxPos.Y();
-    if ( !m_bIsHeader )
+    if (!m_bIsHeader)
         nYLinePos += aBoxSize.Height();
-    Point aLinePos( nXLineStart, nYLinePos );
-    Size aLineSize( nXLineEnd - nXLineStart, 1 );
-    m_pLine->SetPosSizePixel( aLinePos, aLineSize );
+    Point aLinePos(nXLineStart, nYLinePos);
+    Size aLineSize(nXLineEnd - nXLineStart, 1);
+    m_pLine->SetPosSizePixel(aLinePos, aLineSize);
 }
 
-void SwHeaderFooterWin::ShowAll( bool bShow )
+void SwHeaderFooterWin::ShowAll(bool bShow)
 {
-    if ( !PopupMenu::IsInExecute() )
+    if (!PopupMenu::IsInExecute())
     {
         m_bIsAppearing = bShow;
 
-        if ( m_aFadeTimer.IsActive( ) )
+        if (m_aFadeTimer.IsActive())
             m_aFadeTimer.Stop();
-        m_aFadeTimer.Start( );
+        m_aFadeTimer.Start();
     }
 }
 
 bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const
 {
-    Rectangle aRect( GetPosPixel(), GetSizePixel() );
-    if ( aRect.IsInside( rDocPt ) )
+    Rectangle aRect(GetPosPixel(), GetSizePixel());
+    if (aRect.IsInside(rDocPt))
         return true;
 
-    Rectangle aLineRect( m_pLine->GetPosPixel(), m_pLine->GetSizePixel() );
-    if ( aLineRect.IsInside( rDocPt ) )
+    Rectangle aLineRect(m_pLine->GetPosPixel(), m_pLine->GetSizePixel());
+    if (aLineRect.IsInside(rDocPt))
         return true;
 
     return false;
 }
 
-void SwHeaderFooterWin::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
+void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
 {
-    const Rectangle aRect( Rectangle( Point( 0, 0 ), PixelToLogic( GetSizePixel() ) ) );
-    drawinglayer::primitive2d::Primitive2DSequence aSeq( 3 );
+    // Use pixels for the rest of the drawing
+    SetMapMode(MapMode(MAP_PIXEL));
 
-    B2DPolygon aPolygon = lcl_GetPolygon( aRect, m_bIsHeader );
+    const Rectangle aRect(Rectangle(Point(0, 0), rRenderContext.PixelToLogic(GetSizePixel())));
+    drawinglayer::primitive2d::Primitive2DSequence aSeq(3);
+
+    B2DPolygon aPolygon = lcl_GetPolygon(aRect, m_bIsHeader);
 
     // Colors
     basegfx::BColor aLineColor = SwViewOption::GetHeaderFooterMarkColor().getBColor();
-    basegfx::BColor aFillColor = lcl_GetFillColor( aLineColor );
-    basegfx::BColor aLighterColor = lcl_GetLighterGradientColor( aFillColor );
+    basegfx::BColor aFillColor = lcl_GetFillColor(aLineColor);
+    basegfx::BColor aLighterColor = lcl_GetLighterGradientColor(aFillColor);
 
     const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
-    if ( rSettings.GetHighContrastMode() )
+    if (rSettings.GetHighContrastMode())
     {
-        aFillColor = rSettings.GetDialogColor( ).getBColor();
-        aLineColor = rSettings.GetDialogTextColor( ).getBColor();
+        aFillColor = rSettings.GetDialogColor().getBColor();
+        aLineColor = rSettings.GetDialogTextColor().getBColor();
 
-        aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
-                B2DPolyPolygon( aPolygon ), aFillColor ) );
+        aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
+                    new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), aFillColor));
     }
     else
     {
-        B2DRectangle aGradientRect( aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom() );
+        B2DRectangle aGradientRect(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
         double nAngle = M_PI;
-        if ( m_bIsHeader )
+        if (m_bIsHeader)
             nAngle = 0;
-        FillGradientAttribute aFillAttrs( GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, nAngle,
-                aLighterColor, aFillColor, 10 );
-        aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::FillGradientPrimitive2D(
-                aGradientRect, aFillAttrs ) );
+        FillGradientAttribute aFillAttrs(GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor, 10);
+        aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
+                    new drawinglayer::primitive2d::FillGradientPrimitive2D(aGradientRect, aFillAttrs));
     }
 
     // Create the border lines primitive
-    aSeq[1] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
-            aPolygon, aLineColor ) );
+    aSeq[1] = drawinglayer::primitive2d::Primitive2DReference(
+                new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPolygon, aLineColor));
 
     // Create the text primitive
     B2DVector aFontSize;
-    FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(
-           aFontSize, GetFont(), false, false );
+    FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, rRenderContext.GetFont(), false, false);
 
-    FontMetric aFontMetric = GetFontMetric( GetFont() );
+    FontMetric aFontMetric = rRenderContext.GetFontMetric(rRenderContext.GetFont());
     double nTextOffsetY = aFontMetric.GetAscent() + TEXT_PADDING;
-    Point aTextPos( TEXT_PADDING, nTextOffsetY );
+    Point aTextPos(TEXT_PADDING, nTextOffsetY);
 
-    basegfx::B2DHomMatrix aTextMatrix( createScaleTranslateB2DHomMatrix(
-                aFontSize.getX(), aFontSize.getY(),
-                double( aTextPos.X() ), double( aTextPos.Y() ) ) );
+    basegfx::B2DHomMatrix aTextMatrix(createScaleTranslateB2DHomMatrix(
+                                            aFontSize.getX(), aFontSize.getY(),
+                                            double(aTextPos.X()), double(aTextPos.Y())));
 
-    aSeq[2] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
-                aTextMatrix,
-                OUString( m_sLabel ), 0, m_sLabel.getLength(),
-                std::vector< double >( ),
-                aFontAttr,
-                com::sun::star::lang::Locale(),
-                aLineColor ) );
+    aSeq[2] = drawinglayer::primitive2d::Primitive2DReference(
+                    new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+                        aTextMatrix, OUString(m_sLabel), 0, m_sLabel.getLength(),
+                        std::vector<double>(), aFontAttr, css::lang::Locale(), aLineColor));
 
     // Create the 'plus' or 'arrow' primitive
-    B2DRectangle aSignArea( B2DPoint( aRect.Right() - BUTTON_WIDTH, 0.0 ),
-                            B2DSize( aRect.Right(), aRect.getHeight() ) );
+    B2DRectangle aSignArea(B2DPoint(aRect.Right() - BUTTON_WIDTH, 0.0),
+                           B2DSize(aRect.Right(), aRect.getHeight()));
 
     B2DPolygon aSign;
-    if ( IsEmptyHeaderFooter( ) )
+    if (IsEmptyHeaderFooter())
     {
         // Create the + polygon
         double nLeft = aSignArea.getMinX() + TEXT_PADDING;
@@ -335,57 +330,58 @@ void SwHeaderFooterWin::Paint( vcl::RenderContext& /*rRenderContext*/, const Rec
         double nTop = aSignArea.getCenterY() - nHalfW;
         double nBottom = aSignArea.getCenterY() + nHalfW;
 
-        aSign.append( B2DPoint( nLeft, aSignArea.getCenterY() - 1.0 ) );
-        aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() - 1.0 ) );
-        aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, nTop ) );
-        aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, nTop ) );
-        aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() - 1.0 ) );
-        aSign.append( B2DPoint( nRight, aSignArea.getCenterY() - 1.0 ) );
-        aSign.append( B2DPoint( nRight, aSignArea.getCenterY() + 1.0 ) );
-        aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() + 1.0 ) );
-        aSign.append( B2DPoint( aSignArea.getCenterX() + 1.0, nBottom ) );
-        aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, nBottom ) );
-        aSign.append( B2DPoint( aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() + 1.0  ) );
-        aSign.append( B2DPoint( nLeft, aSignArea.getCenterY() + 1.0  ) );
-        aSign.setClosed( true );
+        aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() - 1.0));
+        aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() - 1.0));
+        aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nTop));
+        aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nTop));
+        aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() - 1.0));
+        aSign.append(B2DPoint(nRight, aSignArea.getCenterY() - 1.0));
+        aSign.append(B2DPoint(nRight, aSignArea.getCenterY() + 1.0));
+        aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() + 1.0));
+        aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nBottom));
+        aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nBottom));
+        aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() + 1.0));
+        aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() + 1.0));
+        aSign.setClosed(true);
     }
     else
     {
         // Create the v polygon
-        B2DPoint aLeft( aSignArea.getMinX() + TEXT_PADDING, aSignArea.getCenterY() );
-        B2DPoint aRight( aSignArea.getMaxX() - TEXT_PADDING, aSignArea.getCenterY() );
-        B2DPoint aBottom( ( aLeft.getX() + aRight.getX() ) / 2.0, aLeft.getY() + 4.0 );
-        aSign.append( aLeft );
-        aSign.append( aRight );
-        aSign.append( aBottom );
-        aSign.setClosed( true );
+        B2DPoint aLeft(aSignArea.getMinX() + TEXT_PADDING, aSignArea.getCenterY());
+        B2DPoint aRight(aSignArea.getMaxX() - TEXT_PADDING, aSignArea.getCenterY());
+        B2DPoint aBottom((aLeft.getX() + aRight.getX()) / 2.0, aLeft.getY() + 4.0);
+        aSign.append(aLeft);
+        aSign.append(aRight);
+        aSign.append(aBottom);
+        aSign.setClosed(true);
     }
 
-    BColor aSignColor = Color( COL_BLACK ).getBColor( );
-    if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
-        aSignColor = Color( COL_WHITE ).getBColor( );
+    BColor aSignColor = Color(COL_BLACK).getBColor();
+    if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+        aSignColor = Color(COL_WHITE).getBColor();
 
-    aSeq.realloc( aSeq.getLength() + 1 );
-    aSeq[ aSeq.getLength() - 1 ] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
-            B2DPolyPolygon( aSign ), aSignColor ) );
+    aSeq.realloc(aSeq.getLength() + 1);
+    aSeq[aSeq.getLength() - 1] = drawinglayer::primitive2d::Primitive2DReference(
+                                    new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+                                        B2DPolyPolygon(aSign), aSignColor));
 
     // Create the processor and process the primitives
     const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
     boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
-        drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
-                    *this, aNewViewInfos ));
+        drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos));
 
     // TODO Ghost it all if needed
-    drawinglayer::primitive2d::Primitive2DSequence aGhostedSeq( 1 );
-    double nFadeRate = double( m_nFadeRate ) / 100.0;
+    drawinglayer::primitive2d::Primitive2DSequence aGhostedSeq(1);
+    double nFadeRate = double(m_nFadeRate) / 100.0;
+
     const basegfx::BColorModifierSharedPtr aBColorModifier(
-        new basegfx::BColorModifier_interpolate(
-            Color( COL_WHITE ).getBColor(),
-            1.0 - nFadeRate));
-    aGhostedSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
-                aSeq, aBColorModifier ) );
+        new basegfx::BColorModifier_interpolate(Color(COL_WHITE).getBColor(),
+                                                1.0 - nFadeRate));
 
-    pProcessor->process( aGhostedSeq );
+    aGhostedSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
+                        new drawinglayer::primitive2d::ModifiedColorPrimitive2D(aSeq, aBColorModifier));
+
+    pProcessor->process(aGhostedSeq);
 }
 
 bool SwHeaderFooterWin::IsEmptyHeaderFooter( )
@@ -420,11 +416,11 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot )
     switch ( nSlot )
     {
         case FN_HEADERFOOTER_EDIT:
-            {
-                OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
-                rView.GetDocShell()->FormatPage(rStyleName, sPageId, rSh);
-            }
-            break;
+        {
+            OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
+            rView.GetDocShell()->FormatPage(rStyleName, sPageId, rSh);
+        }
+        break;
         case FN_HEADERFOOTER_BORDERBACK:
             {
                 const SwPageDesc* pDesc = GetPageFrame()->GetPageDesc();
@@ -440,47 +436,47 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot )
                        SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
                        RES_SHADOW, RES_SHADOW, 0 );
 
-                aSet.Put( pHFFmt->GetAttrSet() );
-
-                // Create a box info item... needed by the dialog
-                SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
-                const SfxPoolItem *pBoxInfo;
-                if ( SfxItemState::SET == pHFFmt->GetAttrSet().GetItemState( SID_ATTR_BORDER_INNER,
-                                                        true, &pBoxInfo) )
-                    aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo);
-
-                aBoxInfo.SetTable( false );
-                aBoxInfo.SetDist( true);
-                aBoxInfo.SetMinDist( false );
-                aBoxInfo.SetDefDist( MIN_BORDER_DIST );
-                aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE );
-                aSet.Put( aBoxInfo );
-
-                if ( svx::ShowBorderBackgroundDlg( this, &aSet, true ) )
-                {
-                    const SfxPoolItem* pItem;
-                    if ( SfxItemState::SET == aSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) {
-                        pHFFmt->SetFmtAttr( *pItem );
-                        rView.GetDocShell()->SetModified(true);
-                    }
-
-                    if ( SfxItemState::SET == aSet.GetItemState( RES_BOX, false, &pItem ) ) {
-                        pHFFmt->SetFmtAttr( *pItem );
-                        rView.GetDocShell()->SetModified(true);
-                    }
-
-                    if ( SfxItemState::SET == aSet.GetItemState( RES_SHADOW, false, &pItem ) ) {
-                        pHFFmt->SetFmtAttr( *pItem );
-                        rView.GetDocShell()->SetModified(true);
-                    }
+            aSet.Put( pHFFmt->GetAttrSet() );
+
+            // Create a box info item... needed by the dialog
+            SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
+            const SfxPoolItem *pBoxInfo;
+            if ( SfxItemState::SET == pHFFmt->GetAttrSet().GetItemState( SID_ATTR_BORDER_INNER,
+                                                    true, &pBoxInfo) )
+                aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo);
+
+            aBoxInfo.SetTable( false );
+            aBoxInfo.SetDist( true);
+            aBoxInfo.SetMinDist( false );
+            aBoxInfo.SetDefDist( MIN_BORDER_DIST );
+            aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE );
+            aSet.Put( aBoxInfo );
+
+            if ( svx::ShowBorderBackgroundDlg( this, &aSet, true ) )
+            {
+                const SfxPoolItem* pItem;
+                if ( SfxItemState::SET == aSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) {
+                    pHFFmt->SetFmtAttr( *pItem );
+                    rView.GetDocShell()->SetModified(true);
+                }
+
+                if ( SfxItemState::SET == aSet.GetItemState( RES_BOX, false, &pItem ) ) {
+                    pHFFmt->SetFmtAttr( *pItem );
+                    rView.GetDocShell()->SetModified(true);
+                }
+
+                if ( SfxItemState::SET == aSet.GetItemState( RES_SHADOW, false, &pItem ) ) {
+                    pHFFmt->SetFmtAttr( *pItem );
+                    rView.GetDocShell()->SetModified(true);
                 }
             }
-            break;
+        }
+        break;
         case FN_HEADERFOOTER_DELETE:
-            {
-                rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
-            }
-            break;
+        {
+            rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
+        }
+        break;
         default:
             break;
     }
@@ -493,7 +489,7 @@ void SwHeaderFooterWin::SetReadonly( bool bReadonly )
 
 void SwHeaderFooterWin::MouseButtonDown( const MouseEvent& rMEvt )
 {
-    if ( IsEmptyHeaderFooter( ) )
+    if (IsEmptyHeaderFooter())
     {
         SwView& rView = GetEditWin()->GetView();
         SwWrtShell& rSh = rView.GetWrtShell();
@@ -505,32 +501,32 @@ void SwHeaderFooterWin::MouseButtonDown( const MouseEvent& rMEvt )
         MenuButton::MouseButtonDown( rMEvt );
 }
 
-void SwHeaderFooterWin::Select( )
+void SwHeaderFooterWin::Select()
 {
-    ExecuteCommand( GetCurItemId() );
+    ExecuteCommand(GetCurItemId());
 }
 
 IMPL_LINK_NOARG_TYPED(SwHeaderFooterWin, FadeHandler, Timer *, void)
 {
-    if ( m_bIsAppearing && m_nFadeRate > 0 )
+    if (m_bIsAppearing && m_nFadeRate > 0)
         m_nFadeRate -= 25;
-    else if ( !m_bIsAppearing && m_nFadeRate < 100 )
+    else if (!m_bIsAppearing && m_nFadeRate < 100)
         m_nFadeRate += 25;
 
-    if ( m_nFadeRate != 100 && !IsVisible() )
+    if (m_nFadeRate != 100 && !IsVisible())
     {
-        Show( true );
-        m_pLine->Show( true );
+        Show(true);
+        m_pLine->Show(true);
     }
-    else if ( m_nFadeRate == 100 && IsVisible( ) )
+    else if (m_nFadeRate == 100 && IsVisible())
     {
-        Show( false );
-        m_pLine->Show( false );
+        Show(false);
+        m_pLine->Show(false);
     }
     else
         Invalidate();
 
-    if ( IsVisible( ) && m_nFadeRate > 0 && m_nFadeRate < 100 )
+    if (IsVisible() && m_nFadeRate > 0 && m_nFadeRate < 100)
         m_aFadeTimer.Start();
 }
 
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 226d46d..6808871 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -135,86 +135,86 @@ void SwPageBreakWin::dispose()
     MenuButton::dispose();
 }
 
-void SwPageBreakWin::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& )
+void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
 {
-    const Rectangle aRect( Rectangle( Point( 0, 0 ), PixelToLogic( GetSizePixel() ) ) );
+    const Rectangle aRect(Rectangle(Point(0, 0), rRenderContext.PixelToLogic(GetSizePixel())));
 
     // Properly paint the control
     BColor aColor = SwViewOption::GetPageBreakColor().getBColor();
 
-    BColor aHslLine = rgb2hsl( aColor );
+    BColor aHslLine = rgb2hsl(aColor);
     double nLuminance = aHslLine.getZ();
-    nLuminance += ( 1.0 - nLuminance ) * 0.75;
+    nLuminance += (1.0 - nLuminance) * 0.75;
     if ( aHslLine.getZ() > 0.7 )
         nLuminance = aHslLine.getZ() * 0.7;
-    aHslLine.setZ( nLuminance );
-    BColor aOtherColor = hsl2rgb( aHslLine );
+    aHslLine.setZ(nLuminance);
+    BColor aOtherColor = hsl2rgb(aHslLine);
 
     const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
-    if ( rSettings.GetHighContrastMode( ) )
+    if (rSettings.GetHighContrastMode())
     {
         aColor = rSettings.GetDialogTextColor().getBColor();
-        aOtherColor = rSettings.GetDialogColor( ).getBColor();
+        aOtherColor = rSettings.GetDialogColor().getBColor();
     }
 
     bool bRtl = AllSettings::GetLayoutRTL();
 
-    drawinglayer::primitive2d::Primitive2DSequence aSeq( 3 );
-    B2DRectangle aBRect( double( aRect.Left() ), double( aRect.Top( ) ),
-           double( aRect.Right() ), double( aRect.Bottom( ) ) );
-    B2DPolygon aPolygon = createPolygonFromRect( aBRect, 3.0 / BUTTON_WIDTH, 3.0 / BUTTON_HEIGHT );
+    drawinglayer::primitive2d::Primitive2DSequence aSeq(3);
+    B2DRectangle aBRect(double(aRect.Left()), double(aRect.Top()),
+                        double(aRect.Right()), double(aRect.Bottom()));
+    B2DPolygon aPolygon = createPolygonFromRect(aBRect, 3.0 / BUTTON_WIDTH, 3.0 / BUTTON_HEIGHT);
 
     // Create the polygon primitives
-    aSeq[0] = Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
-            B2DPolyPolygon( aPolygon ), aOtherColor ) );
-    aSeq[1] = Primitive2DReference( new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
-            aPolygon, aColor ) );
+    aSeq[0] = Primitive2DReference(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+                                        B2DPolyPolygon(aPolygon), aOtherColor));
+    aSeq[1] = Primitive2DReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+                                        aPolygon, aColor));
 
     // Create the primitive for the image
-    Image aImg( SW_RES( IMG_PAGE_BREAK ) );
+    Image aImg(SW_RES(IMG_PAGE_BREAK));
     double nImgOfstX = 3.0;
-    if ( bRtl )
+    if (bRtl)
         nImgOfstX = aRect.Right() - aImg.GetSizePixel().Width() - 3.0;
-    aSeq[2] = Primitive2DReference( new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D(
-            aImg.GetBitmapEx(), B2DPoint( nImgOfstX, 1.0 ) ) );
+    aSeq[2] = Primitive2DReference(new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D(
+                                        aImg.GetBitmapEx(), B2DPoint(nImgOfstX, 1.0)));
 
-    double nTop = double( aRect.getHeight() ) / 2.0;
+    double nTop = double(aRect.getHeight()) / 2.0;
     double nBottom = nTop + 4.0;
-    double nLeft = aRect.getWidth( ) - ARROW_WIDTH - 6.0;
-    if ( bRtl )
+    double nLeft = aRect.getWidth() - ARROW_WIDTH - 6.0;
+    if (bRtl)
         nLeft = ARROW_WIDTH - 2.0;
     double nRight = nLeft + 8.0;
 
     B2DPolygon aTriangle;
-    aTriangle.append( B2DPoint( nLeft, nTop ) );
-    aTriangle.append( B2DPoint( nRight, nTop ) );
-    aTriangle.append( B2DPoint( ( nLeft + nRight ) / 2.0, nBottom ) );
-    aTriangle.setClosed( true );
-
-    BColor aTriangleColor = Color( COL_BLACK ).getBColor( );
-    if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
-        aTriangleColor = Color( COL_WHITE ).getBColor( );
-
-    aSeq.realloc( aSeq.getLength() + 1 );
-    aSeq[ aSeq.getLength() - 1 ] = Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
-               B2DPolyPolygon( aTriangle ), aTriangleColor ) );
-
-    Primitive2DSequence aGhostedSeq( 1 );
-    double nFadeRate = double( m_nFadeRate ) / 100.0;
+    aTriangle.append(B2DPoint(nLeft, nTop));
+    aTriangle.append(B2DPoint(nRight, nTop));
+    aTriangle.append(B2DPoint((nLeft + nRight) / 2.0, nBottom));
+    aTriangle.setClosed(true);
+
+    BColor aTriangleColor = Color(COL_BLACK).getBColor();
+    if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
+        aTriangleColor = Color(COL_WHITE).getBColor();
+
+    aSeq.realloc(aSeq.getLength() + 1);
+    aSeq[aSeq.getLength() - 1] = Primitive2DReference(
+                                    new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+                                        B2DPolyPolygon(aTriangle), aTriangleColor));
+
+    Primitive2DSequence aGhostedSeq(1);
+    double nFadeRate = double(m_nFadeRate) / 100.0;
     const basegfx::BColorModifierSharedPtr aBColorModifier(
-        new basegfx::BColorModifier_interpolate(
-            Color( COL_WHITE ).getBColor(),
-            1.0 - nFadeRate));
-    aGhostedSeq[0] = Primitive2DReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
-                aSeq, aBColorModifier ) );
+                new basegfx::BColorModifier_interpolate(Color(COL_WHITE).getBColor(),
+                                                        1.0 - nFadeRate));
+    aGhostedSeq[0] = Primitive2DReference(
+                        new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
+                            aSeq, aBColorModifier));
 
     // Create the processor and process the primitives
     const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
     boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
-        drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
-                    *this, aNewViewInfos ));
+        drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos));
 
-    pProcessor->process( aGhostedSeq );
+    pProcessor->process(aGhostedSeq);
 }
 
 void SwPageBreakWin::Select( )
@@ -466,7 +466,7 @@ IMPL_LINK_NOARG_TYPED(SwPageBreakWin, FadeHandler, Timer *, void)
         Invalidate();
     }
 
-    if ( IsVisible( ) && m_nFadeRate > 0 && m_nFadeRate < 100 )
+    if (IsVisible( ) && m_nFadeRate > 0 && m_nFadeRate < 100)
         m_aFadeTimer.Start();
 }
 
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index 5807f27..4181df6 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -151,43 +151,37 @@ void SidebarTxtControl::Draw(OutputDevice* pDev, const Point& rPt, const Size& r
     }
 }
 
-void SidebarTxtControl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect)
+void SidebarTxtControl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
 {
-    if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+    if (!rRenderContext.GetSettings().GetStyleSettings().GetHighContrastMode())
     {
-        if ( mrSidebarWin.IsMouseOverSidebarWin() ||
-             HasFocus() )
+        if (mrSidebarWin.IsMouseOverSidebarWin() || HasFocus())
         {
-            DrawGradient( Rectangle( Point(0,0), PixelToLogic(GetSizePixel()) ),
-                          Gradient( GradientStyle_LINEAR,
-                                    mrSidebarWin.ColorDark(),
-                                    mrSidebarWin.ColorDark() ) );
+            rRenderContext.DrawGradient(Rectangle(Point(0,0), rRenderContext.PixelToLogic(GetSizePixel())),
+                                        Gradient(GradientStyle_LINEAR, mrSidebarWin.ColorDark(), mrSidebarWin.ColorDark()));
         }
         else
         {
-            DrawGradient( Rectangle( Point(0,0), PixelToLogic(GetSizePixel()) ),
-                          Gradient( GradientStyle_LINEAR,
-                                    mrSidebarWin.ColorLight(),
-                                    mrSidebarWin.ColorDark()));
+            rRenderContext.DrawGradient(Rectangle(Point(0,0), rRenderContext.PixelToLogic(GetSizePixel())),
+                           Gradient(GradientStyle_LINEAR, mrSidebarWin.ColorLight(), mrSidebarWin.ColorDark()));
         }
     }
 
-    if ( GetTextView() )
+    if (GetTextView())
     {
-        GetTextView()->Paint( rRect );
+        GetTextView()->Paint(rRect, &rRenderContext);
     }
 
-    if ( mrSidebarWin.GetLayoutStatus()==SwPostItHelper::DELETED )
+    if (mrSidebarWin.GetLayoutStatus() == SwPostItHelper::DELETED)
     {
-        SetLineColor(mrSidebarWin.GetChangeColor());
-        DrawLine( PixelToLogic( GetPosPixel() ),
-                  PixelToLogic( GetPosPixel() +
-                                Point( GetSizePixel().Width(),
-                                       GetSizePixel().Height() ) ) );
-        DrawLine( PixelToLogic( GetPosPixel() +
-                                Point( GetSizePixel().Width(),0) ),
-                  PixelToLogic( GetPosPixel() +
-                                Point( 0, GetSizePixel().Height() ) ) );
+        rRenderContext.SetLineColor(mrSidebarWin.GetChangeColor());
+        rRenderContext.DrawLine(rRenderContext.PixelToLogic(GetPosPixel()),
+                                rRenderContext.PixelToLogic(GetPosPixel() + Point(GetSizePixel().Width(),
+                                                                                  GetSizePixel().Height())));
+        rRenderContext.DrawLine(rRenderContext.PixelToLogic(GetPosPixel() + Point(GetSizePixel().Width(),
+                                                                                  0)),
+                                rRenderContext.PixelToLogic(GetPosPixel() + Point(0,
+                                                                                  GetSizePixel().Height())));
     }
 }
 
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 27a5229..e48896e 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -89,14 +89,14 @@ namespace sw { namespace sidebarwindows {
 #define POSTIT_META_HEIGHT  (sal_Int32)     30
 #define POSTIT_MINIMUMSIZE_WITHOUT_META     50
 
-SwSidebarWin::SwSidebarWin( SwEditWin& rEditWin,
-                            WinBits nBits,
-                            SwPostItMgr& aMgr,
-                            SwPostItBits aBits,
-                            SwSidebarItem& rSidebarItem )
+SwSidebarWin::SwSidebarWin(SwEditWin& rEditWin,
+                           WinBits nBits,
+                           SwPostItMgr& aMgr,
+                           SwPostItBits aBits,
+                           SwSidebarItem& rSidebarItem)
     : Window(&rEditWin, nBits)
     , mrMgr(aMgr)
-    , mrView( rEditWin.GetView() )
+    , mrView(rEditWin.GetView())
     , nFlags(aBits)
     , mnEventId(0)
     , mpOutlinerView(0)
@@ -106,23 +106,23 @@ SwSidebarWin::SwSidebarWin( SwEditWin& rEditWin,
     , mpMetadataAuthor(0)
     , mpMetadataDate(0)
     , mpMenuButton(0)
-    , mpAnchor( NULL )
-    , mpShadow( NULL )
-    , mpTextRangeOverlay( NULL )
+    , mpAnchor(NULL)
+    , mpShadow(NULL)
+    , mpTextRangeOverlay(NULL)
     , mColorAnchor()
     , mColorDark()
     , mColorLight()
     , mChangeColor()
-    , meSidebarPosition( sw::sidebarwindows::SidebarPosition::NONE )
+    , meSidebarPosition(sw::sidebarwindows::SidebarPosition::NONE)
     , mPosSize()
     , mAnchorRect()
-    , mPageBorder( 0 )
-    , mbMouseOver( false )
-    , mLayoutStatus( SwPostItHelper::INVISIBLE )
-    , mbReadonly( false )
-    , mbIsFollow( false )
-    , mrSidebarItem( rSidebarItem )
-    , mpAnchorFrm( rSidebarItem.maLayoutInfo.mpAnchorFrm )
+    , mPageBorder(0)
+    , mbMouseOver(false)
+    , mLayoutStatus(SwPostItHelper::INVISIBLE)
+    , mbReadonly(false)
+    , mbIsFollow(false)
+    , mrSidebarItem(rSidebarItem)
+    , mpAnchorFrm(rSidebarItem.maLayoutInfo.mpAnchorFrm)
 {
     mpShadow = ShadowOverlayObject::CreateShadowOverlayObject( mrView );
     if ( mpShadow )
@@ -208,29 +208,29 @@ void SwSidebarWin::dispose()
     vcl::Window::dispose();
 }
 
-void SwSidebarWin::Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect)
+void SwSidebarWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
 {
     Window::Paint(rRenderContext, rRect);
 
-    if (mpMetadataAuthor->IsVisible() )
+    if (mpMetadataAuthor->IsVisible())
     {
         //draw left over space
-        if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+        if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
         {
-            SetFillColor(COL_BLACK);
+            rRenderContext.SetFillColor(COL_BLACK);
         }
         else
         {
-            SetFillColor(mColorDark);
+            rRenderContext.SetFillColor(mColorDark);
         }
-        SetLineColor();
-        DrawRect( PixelToLogic(
-                Rectangle( Point( mpMetadataAuthor->GetPosPixel().X() +
-                                    mpMetadataAuthor->GetSizePixel().Width(),
-                                  mpMetadataAuthor->GetPosPixel().Y() ),
-                           Size( GetMetaButtonAreaWidth(),
-                                 mpMetadataAuthor->GetSizePixel().Height() +
-                                    mpMetadataDate->GetSizePixel().Height() ) ) ) );
+
+        rRenderContext.SetLineColor();
+        Rectangle aRectangle(Point(mpMetadataAuthor->GetPosPixel().X() + mpMetadataAuthor->GetSizePixel().Width(),
+                                   mpMetadataAuthor->GetPosPixel().Y()),
+                             Size(GetMetaButtonAreaWidth(),
+                                  mpMetadataAuthor->GetSizePixel().Height() + mpMetadataDate->GetSizePixel().Height()));
+
+        rRenderContext.DrawRect(PixelToLogic(aRectangle));
     }
 }
 
@@ -302,12 +302,8 @@ void SwSidebarWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, s
     }
 }
 
-void SwSidebarWin::SetPosSizePixelRect( long nX,
-                                        long nY,
-                                        long nWidth,
-                                        long nHeight,
-                                        const SwRect& aAnchorRect,
-                                        const long aPageBorder)
+void SwSidebarWin::SetPosSizePixelRect(long nX, long nY, long nWidth, long nHeight,
+                                       const SwRect& aAnchorRect, const long aPageBorder)
 {
     mPosSize = Rectangle(Point(nX,nY),Size(nWidth,nHeight));
     mAnchorRect = aAnchorRect;
commit 7587cf88c9a19325d6aa2c4e75a599e476826840
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 14 09:56:59 2015 +0900

    refacor starmath dialogs to use RenderContext
    
    Change-Id: I077fb1fbb3a5b55c50b61235ef9f0315c342faa4

diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index f48fd37..686c60c 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -236,24 +236,20 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet)
     m_pSaveOnlyUsedSymbols->Check(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS))).GetValue());
 }
 
-
 VclPtr<SfxTabPage> SmPrintOptionsTabPage::Create(vcl::Window* pWindow, const SfxItemSet& rSet)
 {
     return VclPtr<SmPrintOptionsTabPage>::Create(pWindow, rSet).get();
 }
 
-/**************************************************************************/
-
-
 void SmShowFont::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect )
 {
     Window::Paint(rRenderContext, rRect);
 
-    OUString   Text (GetFont().GetName());
-    Size    TextSize(GetTextWidth(Text), GetTextHeight());
+    OUString sText(rRenderContext.GetFont().GetName());
+    Size TextSize(rRenderContext.GetTextWidth(sText), rRenderContext.GetTextHeight());
 
-    DrawText(Point((GetOutputSize().Width()  - TextSize.Width())  / 2,
-                   (GetOutputSize().Height() - TextSize.Height()) / 2), Text);
+    rRenderContext.DrawText(Point((GetOutputSize().Width()  - TextSize.Width())  / 2,
+                                  (GetOutputSize().Height() - TextSize.Height()) / 2), sText);
 }
 
 VCL_BUILDER_DECL_FACTORY(SmShowFont)
@@ -321,7 +317,6 @@ IMPL_LINK( SmFontDialog, AttrChangeHdl, CheckBox *, /*pCheckBox*/ )
     return 0;
 }
 
-
 void SmFontDialog::SetFont(const vcl::Font &rFont)
 {
     Face = rFont;
@@ -1167,39 +1162,39 @@ Point SmShowSymbolSetWindow::OffsetPoint(const Point &rPoint) const
     return Point(rPoint.X() + nXOffset, rPoint.Y() + nYOffset);
 }
 
-void SmShowSymbolSetWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle&)
+void SmShowSymbolSetWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
 {
-    Push(PushFlags::MAPMODE);
+    rRenderContext.Push(PushFlags::MAPMODE);
 
     // set MapUnit for which 'nLen' has been calculated
-    SetMapMode(MapMode(MAP_PIXEL));
+    rRenderContext.SetMapMode(MapMode(MAP_PIXEL));
 
-    sal_uInt16 v        = sal::static_int_cast< sal_uInt16 >((m_pVScrollBar->GetThumbPos() * nColumns));
+    sal_uInt16 v = sal::static_int_cast< sal_uInt16 >((m_pVScrollBar->GetThumbPos() * nColumns));
     size_t nSymbols = aSymbolSet.size();
 
-    Color aTxtColor( GetTextColor() );
+    Color aTxtColor(rRenderContext.GetTextColor());
     for (sal_uInt16 i = v; i < nSymbols ; i++)
     {
-        SmSym     aSymbol (*aSymbolSet[i]);
-        vcl::Font aFont   (aSymbol.GetFace());
+        SmSym aSymbol(*aSymbolSet[i]);
+        vcl::Font aFont(aSymbol.GetFace());
         aFont.SetAlign(ALIGN_TOP);
 
         // taking a FontSize which is a bit smaller (compared to nLen) in order to have a buffer
         // (hopefully enough for left and right, too)
         aFont.SetSize(Size(0, nLen - (nLen / 3)));
-        SetFont(aFont);
+        rRenderContext.SetFont(aFont);
         // keep text color
-        SetTextColor( aTxtColor );
+        rRenderContext.SetTextColor(aTxtColor);
 
-        int   nIV   = i - v;
+        int nIV = i - v;
         sal_UCS4 cChar = aSymbol.GetCharacter();
         OUString aText(&cChar, 1);
-        Size  aSize( GetTextWidth( aText ), GetTextHeight());
+        Size  aSize(rRenderContext.GetTextWidth( aText ), rRenderContext.GetTextHeight());
 
         Point aPoint((nIV % nColumns) * nLen + (nLen - aSize.Width()) / 2,
-                       (nIV / nColumns) * nLen + (nLen - aSize.Height()) / 2);
+                     (nIV / nColumns) * nLen + (nLen - aSize.Height()) / 2);
 
-        DrawText(OffsetPoint(aPoint), aText);
+        rRenderContext.DrawText(OffsetPoint(aPoint), aText);
     }
 
     if (nSelectSymbol != SYMBOL_NONE)
@@ -1211,7 +1206,7 @@ void SmShowSymbolSetWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const
 
     }
 
-    Pop();
+    rRenderContext.Pop();
 }
 
 
@@ -1423,15 +1418,15 @@ void SmShowSymbol::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rR
 {
     Control::Paint(rRenderContext, rRect);
 
-    vcl::Font aFont(GetFont());
+    vcl::Font aFont(rRenderContext.GetFont());
     setFontSize(aFont);
-    SetFont(aFont);
+    rRenderContext.SetFont(aFont);
 
     const OUString &rText = GetText();
-    Size            aTextSize(GetTextWidth(rText), GetTextHeight());
+    Size aTextSize(GetTextWidth(rText), GetTextHeight());
 
-    DrawText(Point((GetOutputSize().Width()  - aTextSize.Width())  / 2,
-                   (GetOutputSize().Height() * 7/10)), rText);
+    rRenderContext.DrawText(Point((GetOutputSize().Width()  - aTextSize.Width())  / 2,
+                                  (GetOutputSize().Height() * 7/10)), rText);
 }
 
 
@@ -1713,10 +1708,10 @@ void SmShowChar::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRec
         sal_UCS4 cChar = aText.iterateCodePoints( &nPos );
         (void) cChar;
 #endif
-        Size aTextSize(GetTextWidth(aText), GetTextHeight());
+        Size aTextSize(rRenderContext.GetTextWidth(aText), rRenderContext.GetTextHeight());
 
-        DrawText(Point((GetOutputSize().Width()  - aTextSize.Width())  / 2,
-                       (GetOutputSize().Height() * 7/10)), aText);
+        rRenderContext.DrawText(Point((GetOutputSize().Width()  - aTextSize.Width())  / 2,
+                                      (GetOutputSize().Height() * 7/10)), aText);
     }
 }
 
commit 53025c3225cb287717fbf9e568544d632e35c997
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 14 09:56:13 2015 +0900

    cleanup charmap
    
    Change-Id: If0ea0c5ea2c241eb25d89089dd3a9d240de3d346

diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 2576292..d50382e 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -88,10 +88,7 @@ protected:
     virtual void    StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
 
-
-    virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
-
-
+    virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() SAL_OVERRIDE;
 
 private:
     typedef std::map<sal_Int32, std::shared_ptr<svx::SvxShowCharSetItem> > ItemsMap;
@@ -100,8 +97,8 @@ private:
     Link<>          aSelectHdl;
     Link<>          aHighHdl;
     Link<>          aPreSelectHdl;
-    svx::SvxShowCharSetVirtualAcc*    m_pAccessible;
-    ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xAccessible;
+    svx::SvxShowCharSetVirtualAcc* m_pAccessible;
+    css::uno::Reference<css::accessibility::XAccessible> m_xAccessible;
     long            nX;
     long            nY;
     long            m_nXGap;
commit 6558878d0b6ccf5558ae18ffc5dbfa6489a12428
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 14 09:55:43 2015 +0900

    refacotr DbGridControl::NavigationBar to use RenderContext
    
    Change-Id: I0675158d83d37706be60dab430e6b9f7ea749bc7

diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 7c9b026..25e44b3 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -722,27 +722,29 @@ void DbGridControl::NavigationBar::Paint(vcl::RenderContext& rRenderContext, con
     Point aAbsolutePos = m_aAbsolute->GetPosPixel();
     Size  aAbsoluteSize = m_aAbsolute->GetSizePixel();
 
-    DrawLine(Point(aAbsolutePos.X() - 1, 0 ),
-             Point(aAbsolutePos.X() - 1, aAbsolutePos.Y() + aAbsoluteSize.Height()));
+    rRenderContext.DrawLine(Point(aAbsolutePos.X() - 1, 0 ),
+                            Point(aAbsolutePos.X() - 1, aAbsolutePos.Y() + aAbsoluteSize.Height()));
 
-    DrawLine(Point(aAbsolutePos.X() + aAbsoluteSize.Width() + 1, 0 ),
-             Point(aAbsolutePos.X() + aAbsoluteSize.Width() + 1, aAbsolutePos.Y() + aAbsoluteSize.Height()));
+    rRenderContext.DrawLine(Point(aAbsolutePos.X() + aAbsoluteSize.Width() + 1, 0 ),
+                            Point(aAbsolutePos.X() + aAbsoluteSize.Width() + 1, aAbsolutePos.Y() + aAbsoluteSize.Height()));
 }
 
 void DbGridControl::NavigationBar::StateChanged( StateChangedType nType )
 {
     Control::StateChanged( nType );
 
-    vcl::Window* pWindows[] = {  m_aRecordText.get(),
-                            m_aAbsolute.get(),
-                            m_aRecordOf.get(),
-                            m_aRecordCount.get(),
-                            m_aFirstBtn.get(),
-                            m_aPrevBtn.get(),
-                            m_aNextBtn.get(),
-                            m_aLastBtn.get(),
-                            m_aNewBtn.get()
-                        };
+    vcl::Window* pWindows[] =
+    {
+        m_aRecordText.get(),
+        m_aAbsolute.get(),
+        m_aRecordOf.get(),
+        m_aRecordCount.get(),
+        m_aFirstBtn.get(),
+        m_aPrevBtn.get(),
+        m_aNextBtn.get(),
+        m_aLastBtn.get(),
+        m_aNewBtn.get()
+    };
 
     switch ( nType )
     {
@@ -759,9 +761,9 @@ void DbGridControl::NavigationBar::StateChanged( StateChangedType nType )
             Fraction aZoom = GetZoom();
 
             // not all of these controls need to know the new zoom, but to be sure ...
-            vcl::Font aFont( GetSettings().GetStyleSettings().GetFieldFont() );
-            if ( IsControlFont() )
-                aFont.Merge( GetControlFont() );
+            vcl::Font aFont(GetSettings().GetStyleSettings().GetFieldFont());
+            if (IsControlFont())
+                aFont.Merge(GetControlFont());
 
             for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
             {
commit efd4f9b9ac16160bd458531b5cf493cb09c246c8
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 14 09:55:04 2015 +0900

    refacotr InfoBar to use RenderContext
    
    Change-Id: I03422badbf1c97b41ab1e7b1b007336e49285f3d

diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index 3c2c197..e6b63c8 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -60,14 +60,14 @@ public:
 
     virtual ~SfxCloseButton() {}
 
-    virtual void Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) SAL_OVERRIDE;
+    virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
 };
 
-void SfxCloseButton::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle&)
+void SfxCloseButton::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
 {
     const ViewInformation2D aNewViewInfos;
     const unique_ptr<BaseProcessor2D> pProcessor(
-        createBaseProcessor2DFromOutputDevice(*this, aNewViewInfos));
+                createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos));
 
     const Rectangle aRect(Point(0, 0), PixelToLogic(GetSizePixel()));
 
@@ -163,7 +163,7 @@ void SfxInfoBarWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle
 {
     const ViewInformation2D aNewViewInfos;
     const unique_ptr<BaseProcessor2D> pProcessor(
-        createBaseProcessor2DFromOutputDevice(*this, aNewViewInfos));
+                createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos));
 
     const Rectangle aRect(Point(0, 0), PixelToLogic(GetSizePixel()));
 
commit 9345eb201db7e796f977fab222a6fd7ed01d6ad8
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 14 09:54:40 2015 +0900

    refactor SfxDockingWindow to use RenderContext
    
    Change-Id: I7e5c27966960b589310aac51ca0ae9da50e37e3a

diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index fec3dba..80613ce 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -212,8 +212,8 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* pParentWnd ,
     SetHideNotDelete( true );
 }
 
-SfxChildWindow*  SfxDockingWrapper::CreateImpl(
-vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo )
+SfxChildWindow* SfxDockingWrapper::CreateImpl(vcl::Window *pParent, sal_uInt16 nId,
+                                              SfxBindings *pBindings, SfxChildWinInfo* pInfo)
 {
     SfxChildWindow *pWin = new SfxDockingWrapper(pParent, nId, pBindings, pInfo);
     return pWin;
@@ -239,15 +239,10 @@ SfxChildWinInfo  SfxDockingWrapper::GetInfo() const
     return aInfo;
 };
 
-SfxTitleDockingWindow::SfxTitleDockingWindow( SfxBindings* pBind ,
-                                              SfxChildWindow* pChildWin ,
-                                              vcl::Window* pParent ,
-                                              WinBits nBits ) :
-                          SfxDockingWindow( pBind ,
-                                            pChildWin ,
-                                            pParent ,
-                                            nBits ),
-                          m_pWrappedWindow(0)
+SfxTitleDockingWindow::SfxTitleDockingWindow(SfxBindings* pBind, SfxChildWindow* pChildWin,
+                                             vcl::Window* pParent, WinBits nBits)
+    : SfxDockingWindow(pBind, pChildWin, pParent, nBits)
+    , m_pWrappedWindow(nullptr)
 {
 }
 
@@ -349,8 +344,7 @@ static SfxWorkWindow* lcl_getWorkWindowFromXFrame( const uno::Reference< frame::
         return NULL;
 }
 
-/*
-    Factory function used by the framework layout manager to "create" a docking window with a special name.
+/** Factory function used by the framework layout manager to "create" a docking window with a special name.
     The string rDockingWindowName MUST BE a valid ID! The ID is pre-defined by a certain slot range located
     in sfxsids.hrc (currently SID_DOCKWIN_START = 9800).
 */
@@ -375,8 +369,7 @@ void SAL_CALL SfxDockingWindowFactory( const uno::Reference< frame::XFrame >& rF
     }
 }
 
-/*
-    Function used by the framework layout manager to determine the visibility state of a docking window with
+/** Function used by the framework layout manager to determine the visibility state of a docking window with
     a special name. The string rDockingWindowName MUST BE a valid ID! The ID is pre-defined by a certain slot
     range located in sfxsids.hrc (currently SID_DOCKWIN_START = 9800).
 */
@@ -437,16 +430,13 @@ friend class SfxDockingWindow;
                         { eDockAlignment = eAlign; }
 };
 
-
-
-void SfxDockingWindow::Resize()
-
 /*  [Description]
 
     This virtual method of the class FloatingWindow keeps track of changes in
     FloatingSize. If this method is overridden by a derived class,
     then the SfxFloatingWindow: Resize() must also be called.
 */
+void SfxDockingWindow::Resize()
 {
     DockingWindow::Resize();
     Invalidate();
@@ -487,10 +477,6 @@ void SfxDockingWindow::Resize()
     }
 }
 
-
-
-bool SfxDockingWindow::PrepareToggleFloatingMode()
-
 /*  [Description]
 
     This virtual method of the class DockingWindow makes it possible to
@@ -499,7 +485,7 @@ bool SfxDockingWindow::PrepareToggleFloatingMode()
     then the SfxDockingWindow::PrepareToggleFloatingMode() must be called
     afterwards, if not FALSE is returned.
 */
-
+bool SfxDockingWindow::PrepareToggleFloatingMode()
 {
     if (!pImp || !pImp->bConstructed)
         return true;
@@ -540,10 +526,6 @@ bool SfxDockingWindow::PrepareToggleFloatingMode()
     return true;
 }
 
-
-
-void SfxDockingWindow::ToggleFloatingMode()
-
 /*  [Description]
 
     This virtual method of the DockingWindow class sets the internal data of
@@ -553,6 +535,7 @@ void SfxDockingWindow::ToggleFloatingMode()
     method is overridden by a derived class, then first the
     SfxDockingWindow::ToggleFloatingMode() must be called.
 */
+void SfxDockingWindow::ToggleFloatingMode()
 {
     if ( !pImp || !pImp->bConstructed || !pMgr )
         return;                                 // No Handler call
@@ -626,10 +609,6 @@ void SfxDockingWindow::ToggleFloatingMode()
     pWorkWin->ConfigChild_Impl( eIdent, SfxDockingConfig::TOGGLEFLOATMODE, pMgr->GetType() );
 }
 
-
-
-void SfxDockingWindow::StartDocking()
-
 /*  [Description]
 
     This virtual method of the DockingWindow class takes the inner and outer
@@ -637,6 +616,7 @@ void SfxDockingWindow::StartDocking()
     a derived class, then SfxDockingWindow:StartDocking() has to be called at
     the end.
 */
+void SfxDockingWindow::StartDocking()
 {
     if ( !pImp || !pImp->bConstructed || !pMgr )
         return;
@@ -657,10 +637,6 @@ void SfxDockingWindow::StartDocking()
     }
 }
 
-
-
-bool SfxDockingWindow::Docking( const Point& rPos, Rectangle& rRect )
-
 /*  [Description]
 
     This virtual method of the DockingWindow class calculates the current
@@ -668,6 +644,7 @@ bool SfxDockingWindow::Docking( const Point& rPos, Rectangle& rRect )
     is used, the behavior can be influenced by the derived classes (see below).
     This method should if possible not be overwritten.
 */
+bool SfxDockingWindow::Docking( const Point& rPos, Rectangle& rRect )
 {
     if ( Application::IsInModalMode() )
         return true;
@@ -760,16 +737,11 @@ bool SfxDockingWindow::Docking( const Point& rPos, Rectangle& rRect )
     return bFloatMode;
 }
 
-
-
-void SfxDockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode )
-
-/*  [Description]
-
-    Virtual method of the DockingWindow class ensures the correct alignment on
+/** Virtual method of the DockingWindow class ensures the correct alignment on
     the parent window. If this method is overridden by a derived class, then
     SfxDockingWindow::EndDocking() must be called first.
 */
+void SfxDockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode )
 {
     if ( !pImp || !pImp->bConstructed || IsDockingCanceled() || !pMgr )
         return;
@@ -833,10 +805,6 @@ void SfxDockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode )
     SetAlignment( IsFloatingMode() ? SfxChildAlignment::NOALIGNMENT : pImp->GetDockAlignment() );
 }
 
-
-
-void SfxDockingWindow::Resizing( Size& /*rSize*/ )
-
 /*  [Description]
 
     Virtual method of the DockingWindow class. Here, the interactive resize in
@@ -844,26 +812,22 @@ void SfxDockingWindow::Resizing( Size& /*rSize*/ )
     values for width and / or height. The base implementation prevents that the
     output size is smaller than one set with SetMinOutputSizePixel().
 */
-
+void SfxDockingWindow::Resizing( Size& /*rSize*/ )
 {
 
 }
 
+/*  [Description]
 
-
+    Constructor for the SfxDockingWindow class. A SfxChildWindow will be
+    required because the docking is implemented in Sfx through SfxChildWindows.
+*/
 SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
     vcl::Window* pParent, WinBits nWinBits) :
     DockingWindow (pParent, nWinBits),
     pBindings(pBindinx),
     pMgr(pCW),
     pImp(NULL)
-
-/*  [Description]
-
-    Constructor for the SfxDockingWindow class. A SfxChildWindow will be
-    required because the docking is implemented in Sfx through SfxChildWindows.
-*/
-
 {
     if ( !GetHelpId().isEmpty() )
     {
@@ -900,21 +864,15 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
     pImp->aMoveIdle.SetIdleHdl(LINK(this,SfxDockingWindow,TimerHdl));
 }
 
-
-
+/** Constructor for the SfxDockingWindow class. A SfxChildWindow will be
+    required because the docking is implemented in Sfx through SfxChildWindows.
+*/
 SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
     vcl::Window* pParent, const ResId& rResId) :
     DockingWindow(pParent, rResId),
     pBindings(pBindinx),
     pMgr(pCW),
     pImp(NULL)
-
-/*  [Description]
-
-    Constructor for the SfxDockingWindow class. A SfxChildWindow will be
-    required because the docking is implemented in Sfx through SfxChildWindows.
-*/
-
 {
     if ( !GetHelpId().isEmpty() )
     {
@@ -951,18 +909,15 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
     pImp->aMoveIdle.SetIdleHdl(LINK(this,SfxDockingWindow,TimerHdl));
 }
 
+/** Constructor for the SfxDockingWindow class. A SfxChildWindow will be
+    required because the docking is implemented in Sfx through SfxChildWindows.
+*/
 SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
     vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription)
     : DockingWindow(pParent, rID, rUIXMLDescription)
     , pBindings(pBindinx)
     , pMgr(pCW)
     , pImp(NULL)
-
-/*  [Description]
-
-    Constructor for the SfxDockingWindow class. A SfxChildWindow will be
-    required because the docking is implemented in Sfx through SfxChildWindows.
-*/
 {
     if ( !GetHelpId().isEmpty() )
     {
@@ -999,14 +954,12 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
     pImp->aMoveIdle.SetIdleHdl(LINK(this,SfxDockingWindow,TimerHdl));
 }
 
-void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo)
-/*  [Description]
-
-    Initialization of the SfxDockingDialog class via a SfxChildWinInfo.
+/** Initialization of the SfxDockingDialog class via a SfxChildWinInfo.
     The initialization is done only in a 2nd step after the constructor, this
     constructor should be called from the derived class or from the
     SfxChildWindows.
 */
+void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo)
 {
     if ( !pMgr )
     {
@@ -1227,17 +1180,13 @@ void SfxDockingWindow::Initialize_Impl()
     pImp->bConstructed = true;
 }
 
-void SfxDockingWindow::FillInfo(SfxChildWinInfo& rInfo) const
-
-/*  [Description]
-
-    Fills a SfxChildWinInfo with specific data from SfxDockingWindow,
+/** Fills a SfxChildWinInfo with specific data from SfxDockingWindow,
     so that it can be written in the INI file. It is assumed that rinfo
     receives all other possible relevant data in the ChildWindow class.
     Insertions are marked with size and the ZoomIn flag.
     If this method is overridden, the base implementation must be called first.
 */
-
+void SfxDockingWindow::FillInfo(SfxChildWinInfo& rInfo) const
 {
     if (!pMgr || !pImp)
         return;
@@ -1270,8 +1219,6 @@ void SfxDockingWindow::FillInfo(SfxChildWinInfo& rInfo) const
     rInfo.aExtraString += ")";
 }
 
-
-
 SfxDockingWindow::~SfxDockingWindow()
 {
     disposeOnce();
@@ -1295,13 +1242,7 @@ void SfxDockingWindow::ReleaseChildWindow_Impl()
     pMgr=NULL;
 }
 
-
-
-SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, Rectangle& rRect)
-
-/*  [Description]
-
-    This method calculates a resulting alignment for the given mouse position
+/** This method calculates a resulting alignment for the given mouse position
     and tracking rectangle. When changing the alignment it can also be that
     the tracking rectangle is changed, so that an altered rectangle is
     returned. The user of this class can influence behaviour of this method,
@@ -1312,7 +1253,7 @@ SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, Rectangle&
 
     is overridden (see below).
 */
-
+SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, Rectangle& rRect)
 {
     // calculate hypothetical sizes for different modes
     Size aFloatingSize(CalcDockingSize(SfxChildAlignment::NOALIGNMENT));
@@ -1654,13 +1595,7 @@ SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, Rectangle&
     return eDockAlign;
 }
 
-
-
-Size SfxDockingWindow::CalcDockingSize(SfxChildAlignment eAlign)
-
-/*  [Description]
-
-    Virtual method of the SfxDockingWindow class. This method determines how
+/** Virtual method of the SfxDockingWindow class. This method determines how
     the size of the DockingWindows changes depending on the alignment. The base
     implementation uses the floating mode, the size of the marked Floating
     Size. For horizontal alignment, the width will be the width of the outer
@@ -1670,7 +1605,7 @@ Size SfxDockingWindow::CalcDockingSize(SfxChildAlignment eAlign)
     this could changed by a to intervening derived class. The docking size must
     be the same for Left/Right and Top/Bottom.
 */
-
+Size SfxDockingWindow::CalcDockingSize(SfxChildAlignment eAlign)
 {
     // Note: if the resizing is also possible in the docked state, then the
     // Floating-size does also have to be adjusted?
@@ -1703,33 +1638,22 @@ Size SfxDockingWindow::CalcDockingSize(SfxChildAlignment eAlign)
     return aSize;
 }
 
-
-
-SfxChildAlignment SfxDockingWindow::CheckAlignment(SfxChildAlignment,
-    SfxChildAlignment eAlign)
-
-/*  [Description]
-
-    Virtual method of the SfxDockingWindow class. Here a derived class can
+/** Virtual method of the SfxDockingWindow class. Here a derived class can
     disallow certain alignments. The base implementation does not
     prohibit alignment.
 */
-
+SfxChildAlignment SfxDockingWindow::CheckAlignment(SfxChildAlignment,
+    SfxChildAlignment eAlign)
 {
     return eAlign;
 }
 
-
-
-bool SfxDockingWindow::Close()
-
-/*  [Description]
-
-    The window is closed when the ChildWindow is destroyed by running the
+/** The window is closed when the ChildWindow is destroyed by running the
     ChildWindow-slots. If this is method is overridden by a derived class
     method, then the SfxDockingDialogWindow: Close() must be called afterwards
     if the Close() was not cancelled with "return sal_False".
 */
+bool SfxDockingWindow::Close()
 {
     // Execute with Parameters, since Toggle is ignored by some ChildWindows.
     if ( !pMgr )
@@ -1741,89 +1665,68 @@ bool SfxDockingWindow::Close()
     return true;
 }
 
-
-
-void SfxDockingWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle& /*rRect*/)
-
-/*  [Description]
-
-    Returns a boundary line to the docked edge and a frame when the Window is in
+/** Returns a boundary line to the docked edge and a frame when the Window is in
     a docked state. In this way SVLOOK is considered.
 */
-
+void SfxDockingWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/)
 {
-    if ( pImp->bSplitable || IsFloatingMode() )
+    if (pImp->bSplitable || IsFloatingMode())
         return;
 
-    Rectangle aRect = Rectangle(Point(0, 0),
-                                GetOutputSizePixel());
+    Rectangle aRect = Rectangle(Point(0, 0), rRenderContext.GetOutputSizePixel());
     switch (GetAlignment())
     {
         case SfxChildAlignment::TOP:
         {
-            DrawLine(aRect.BottomLeft(), aRect.BottomRight());
+            rRenderContext.DrawLine(aRect.BottomLeft(), aRect.BottomRight());
             aRect.Bottom()--;
             break;
         }
 
         case SfxChildAlignment::BOTTOM:
         {
-            DrawLine(aRect.TopLeft(), aRect.TopRight());
+            rRenderContext.DrawLine(aRect.TopLeft(), aRect.TopRight());
             aRect.Top()++;
             break;
         }
 
         case SfxChildAlignment::LEFT:
         {
-            DrawLine(aRect.TopRight(), aRect.BottomRight());
+            rRenderContext.DrawLine(aRect.TopRight(), aRect.BottomRight());
             aRect.Right()--;
             break;
         }
 
         case SfxChildAlignment::RIGHT:
         {
-            DrawLine(aRect.TopLeft(), aRect.BottomLeft());
+            rRenderContext.DrawLine(aRect.TopLeft(), aRect.BottomLeft());
             aRect.Left()++;
             break;
         }
-              default:
-                  break;
+
+        default:
+            break;
     }
 
-    DecorationView aView( this );
-    aView.DrawFrame( aRect, DrawFrameStyle::Out );
+    DecorationView aView(&rRenderContext);
+    aView.DrawFrame(aRect, DrawFrameStyle::Out);
 }
 
-
-
-void SfxDockingWindow::SetMinOutputSizePixel( const Size& rSize )
-
-/*  [Description]
-
-    With this method, a minimal OutputSize be can set, that is queried in
+/** With this method, a minimal OutputSize be can set, that is queried in
     the Resizing()-Handler.
 */
-
+void SfxDockingWindow::SetMinOutputSizePixel( const Size& rSize )
 {
     pImp->aMinSize = rSize;
     DockingWindow::SetMinOutputSizePixel( rSize );
 }
 
-
-
+/** Set the minimum size which is returned.*/
 Size SfxDockingWindow::GetMinOutputSizePixel() const
-
-/*  [Description]
-
-    Set the minimum size which is returned.
-*/
-
 {
     return pImp->aMinSize;
 }
 
-
-
 bool SfxDockingWindow::Notify( NotifyEvent& rEvt )
 {
     if ( rEvt.GetType() == MouseNotifyEvent::GETFOCUS )
commit 3ea96f7b7656afd6274c255a671d58aca7524547
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 14 09:53:31 2015 +0900

    refactor TitledDockingWindow to use RenderContext
    
    Change-Id: Ie30f61871b27d84c1fbb570d5ae9a8cfaa901d28

diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index 339a086..8b579df 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -141,25 +141,47 @@ namespace sfx2
     }
 
 
-    void TitledDockingWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& i_rArea )
+    void TitledDockingWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle& i_rArea)
     {
-        if ( m_bLayoutPending )
+        const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
+
+        // Setup defaults
+        {
+            // Font
+            vcl::Font aFont = rStyleSettings.GetAppFont();
+            if (IsControlFont())
+                aFont.Merge(GetControlFont());
+            SetZoomedPointFont(aFont);
+
+            // Color.
+            Color aColor;
+
+            if (IsControlForeground())
+                aColor = GetControlForeground();
+            else
+                aColor = rStyleSettings.GetButtonTextColor();
+
+            rRenderContext.SetTextColor(aColor);
+            rRenderContext.SetTextFillColor();
+        }
+
+        if (m_bLayoutPending)
             impl_layout();
 
         SfxDockingWindow::Paint(rRenderContext, i_rArea);
 
-        Push( PushFlags::FONT | PushFlags::FILLCOLOR | PushFlags::LINECOLOR );
+        rRenderContext.Push(PushFlags::FONT | PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
 
-        SetFillColor( GetSettings().GetStyleSettings().GetDialogColor() );
-        SetLineColor();
+        rRenderContext.SetFillColor(rStyleSettings.GetDialogColor());
+        rRenderContext.SetLineColor();
 
         // bold font
-        vcl::Font aFont( GetFont() );
-        aFont.SetWeight( WEIGHT_BOLD );
-        SetFont( aFont );
+        vcl::Font aFont(rRenderContext.GetFont());
+        aFont.SetWeight(WEIGHT_BOLD);
+        rRenderContext.SetFont(aFont);
 
         // Set border values.
-        Size aWindowSize( GetOutputSizePixel() );
+        Size aWindowSize(rRenderContext.GetOutputSizePixel());
         int nOuterLeft = 0;
         int nInnerLeft = nOuterLeft + m_aBorder.Left() - 1;
         int nOuterRight = aWindowSize.Width() - 1;
@@ -169,42 +191,38 @@ namespace sfx2
         int nInnerBottom = nOuterBottom - m_aBorder.Bottom() + 1;
 
         // Paint title bar background.
-        Rectangle aTitleBarBox( Rectangle(
-            nOuterLeft,
-            0,
-            nOuterRight,
-            nInnerTop-1
-        ) );
-        DrawRect( aTitleBarBox );
-
-        if ( nInnerLeft > nOuterLeft )
-            DrawRect( Rectangle( nOuterLeft, nInnerTop, nInnerLeft, nInnerBottom ) );
-        if ( nOuterRight > nInnerRight )
-            DrawRect( Rectangle( nInnerRight, nInnerTop, nOuterRight, nInnerBottom ) );
-        if ( nInnerBottom < nOuterBottom )
-            DrawRect( Rectangle( nOuterLeft, nInnerBottom, nOuterRight, nOuterBottom ) );
+        Rectangle aTitleBarBox(Rectangle(nOuterLeft, 0, nOuterRight, nInnerTop - 1));
+        rRenderContext.DrawRect(aTitleBarBox);
+
+        if (nInnerLeft > nOuterLeft)
+            rRenderContext.DrawRect(Rectangle(nOuterLeft, nInnerTop, nInnerLeft, nInnerBottom));
+        if (nOuterRight > nInnerRight)
+            rRenderContext.DrawRect(Rectangle(nInnerRight, nInnerTop, nOuterRight, nInnerBottom));
+        if (nInnerBottom < nOuterBottom)
+            rRenderContext.DrawRect(Rectangle(nOuterLeft, nInnerBottom, nOuterRight, nOuterBottom));
 
         // Paint bevel border.
-        SetFillColor();
-        SetLineColor( GetSettings().GetStyleSettings().GetShadowColor() );
-        if ( m_aBorder.Top() > 0 )
-            DrawLine( Point( nInnerLeft, nInnerTop ), Point( nInnerLeft, nInnerBottom ) );
-        if ( m_aBorder.Left() > 0 )
-            DrawLine( Point( nInnerLeft, nInnerTop ), Point( nInnerRight, nInnerTop ) );
-
-        SetLineColor( GetSettings().GetStyleSettings().GetLightColor() );
-        if ( m_aBorder.Bottom() > 0 )
-            DrawLine( Point( nInnerRight, nInnerBottom ), Point( nInnerLeft, nInnerBottom ) );
-        if ( m_aBorder.Right() > 0 )
-            DrawLine( Point( nInnerRight, nInnerBottom ), Point( nInnerRight, nInnerTop ) );
+        rRenderContext.SetFillColor();
+        rRenderContext.SetLineColor(rStyleSettings.GetShadowColor());
+        if (m_aBorder.Top() > 0)
+            rRenderContext.DrawLine(Point(nInnerLeft, nInnerTop), Point(nInnerLeft, nInnerBottom));
+        if (m_aBorder.Left() > 0)
+            rRenderContext.DrawLine(Point(nInnerLeft, nInnerTop), Point(nInnerRight, nInnerTop));
+
+        rRenderContext.SetLineColor(rStyleSettings.GetLightColor());
+        if (m_aBorder.Bottom() > 0)
+            rRenderContext.DrawLine(Point(nInnerRight, nInnerBottom), Point(nInnerLeft, nInnerBottom));
+        if (m_aBorder.Right() > 0)
+            rRenderContext.DrawLine(Point(nInnerRight, nInnerBottom), Point(nInnerRight, nInnerTop));
 
         // Paint title bar text.
-        SetLineColor( GetSettings().GetStyleSettings().GetActiveTextColor() );
+        rRenderContext.SetLineColor(rStyleSettings.GetActiveTextColor());
         aTitleBarBox.Left() += 3;
-        DrawText( aTitleBarBox, impl_getTitle(), TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+        rRenderContext.DrawText(aTitleBarBox, impl_getTitle(),
+                               TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK);
 
         // Restore original values of the output device.
-        Pop();
+        rRenderContext.Pop();
     }
 
 
@@ -276,7 +294,6 @@ namespace sfx2
         SfxDockingWindow::StateChanged( i_nType );
     }
 
-    //------------------------------------------------------------------------------------------------------------------
     void TitledDockingWindow::EndDocking( const Rectangle& i_rRect, bool i_bFloatMode )
     {
         SfxDockingWindow::EndDocking( i_rRect, i_bFloatMode );
@@ -299,23 +316,6 @@ namespace sfx2
             case DataChangedEventType::FONTS:
             case DataChangedEventType::FONTSUBSTITUTION:
             {
-                const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
-                // Font.
-                vcl::Font aFont = rStyleSettings.GetAppFont();
-                if ( IsControlFont() )
-                    aFont.Merge( GetControlFont() );
-                SetZoomedPointFont( aFont );
-
-                // Color.
-                Color aColor;
-                if ( IsControlForeground() )
-                    aColor = GetControlForeground();
-                else
-                    aColor = rStyleSettings.GetButtonTextColor();
-                SetTextColor( aColor );
-                SetTextFillColor();
-
                 impl_scheduleLayout();
                 Invalidate();
             }
commit 35cae85529a10aa691aba5038464de9e6b72c5bf
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu May 14 09:52:13 2015 +0900

    refactor PreviewWindow to use RenderContext
    
    Change-Id: I9e14bd9f6d359fad4b83b3243758b1a5db0d60b2

diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 09f0fbe..cb8b103 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -40,7 +40,7 @@
 #include <sfx2/printer.hxx>
 #include <vcl/waitobj.hxx>
 
-void SfxPreviewBase_Impl::SetObjectShell( SfxObjectShell* pObj )
+void SfxPreviewBase_Impl::SetObjectShell(SfxObjectShell* pObj)
 {
     std::shared_ptr<GDIMetaFile> xFile = pObj
         ? pObj->GetPreviewMetaFile()
@@ -49,8 +49,7 @@ void SfxPreviewBase_Impl::SetObjectShell( SfxObjectShell* pObj )
     Invalidate();
 }
 
-SfxPreviewBase_Impl::SfxPreviewBase_Impl(
-    vcl::Window* pParent, WinBits nStyle)
+SfxPreviewBase_Impl::SfxPreviewBase_Impl(vcl::Window* pParent, WinBits nStyle)
     : Window(pParent, nStyle)
     , xMetaFile()
 {
@@ -66,59 +65,59 @@ Size SfxPreviewBase_Impl::GetOptimalSize() const
     return LogicToPixel(Size(127, 129), MAP_APPFONT);
 }
 
-void SfxPreviewWin_Impl::ImpPaint(
-    const Rectangle&, GDIMetaFile* pFile, vcl::Window* pWindow )
+void SfxPreviewWin_Impl::ImpPaint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/, GDIMetaFile* pFile)
 {
-    pWindow->SetLineColor();
-    Color aLightGrayCol( COL_LIGHTGRAY );
-    pWindow->SetFillColor( aLightGrayCol );
-    pWindow->DrawRect( Rectangle( Point( 0,0 ), pWindow->GetOutputSize() ) );
-
-    Size aTmpSize = pFile ? pFile->GetPrefSize() : Size(1,1 );
-    DBG_ASSERT( aTmpSize.Height()*aTmpSize.Width(),
-        "size of first page is 0, override GetFirstPageSize or set vis-area!" );
+    rRenderContext.SetLineColor();
+    Color aLightGrayCol(COL_LIGHTGRAY);
+    rRenderContext.SetFillColor(aLightGrayCol);
+    rRenderContext.DrawRect(Rectangle(Point(0,0), rRenderContext.GetOutputSize()));
+
+    Size aTmpSize = pFile ? pFile->GetPrefSize() : Size(1, 1);
+    DBG_ASSERT(aTmpSize.Height() * aTmpSize.Width(), "size of first page is 0, override GetFirstPageSize or set vis-area!");
+
 #define FRAME 4
-    long nWidth = pWindow->GetOutputSize().Width() - 2*FRAME;
-    long nHeight = pWindow->GetOutputSize().Height() - 2*FRAME;
+
+    long nWidth = rRenderContext.GetOutputSize().Width() - 2 * FRAME;
+    long nHeight = rRenderContext.GetOutputSize().Height() - 2 * FRAME;
     if (nWidth <= 0 || nHeight <= 0)
         return;
 
-    double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
-    double dRatioPreV=((double) nWidth ) / nHeight;
+    double dRatio = double(aTmpSize.Width()) / aTmpSize.Height();
+    double dRatioPreV = double(nWidth) / nHeight;
     Size aSize;
     Point aPoint;
-    if (dRatio>dRatioPreV)
+    if (dRatio > dRatioPreV)
     {
-        aSize=Size(nWidth, (sal_uInt16)(nWidth/dRatio));
-        aPoint=Point( 0, (sal_uInt16)((nHeight-aSize.Height())/2));
+        aSize = Size(nWidth, sal_uInt16(nWidth / dRatio));
+        aPoint = Point(0, sal_uInt16((nHeight - aSize.Height()) / 2));
     }
     else
     {
-        aSize=Size((sal_uInt16)(nHeight*dRatio), nHeight);
-        aPoint=Point((sal_uInt16)((nWidth-aSize.Width())/2),0);
+        aSize = Size(sal_uInt16(nHeight * dRatio), nHeight);
+        aPoint = Point(sal_uInt16((nWidth - aSize.Width()) / 2), 0);
     }
-    Point bPoint=Point(nWidth,nHeight)-aPoint;
+    Point bPoint = Point(nWidth, nHeight) - aPoint;
 
-    if ( pFile )
+    if (pFile)
     {
-        Color aBlackCol( COL_BLACK );
-        Color aWhiteCol( COL_WHITE );
-        pWindow->SetLineColor( aBlackCol );
-        pWindow->SetFillColor( aWhiteCol );
-        pWindow->DrawRect( Rectangle( aPoint + Point( FRAME, FRAME ), bPoint + Point( FRAME, FRAME ) ) );
+        Color aBlackCol(COL_BLACK);
+        Color aWhiteCol(COL_WHITE);
+        rRenderContext.SetLineColor(aBlackCol);
+        rRenderContext.SetFillColor(aWhiteCol);
+        rRenderContext.DrawRect(Rectangle(aPoint + Point(FRAME, FRAME), bPoint + Point(FRAME, FRAME)));
         pFile->WindStart();
-        pFile->Play( pWindow, aPoint + Point( FRAME, FRAME ), aSize  );
+        pFile->Play(&rRenderContext, aPoint + Point(FRAME, FRAME), aSize);
     }
 }
 
-void SfxPreviewWin_Impl::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect )
+void SfxPreviewWin_Impl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
 {
-    ImpPaint( rRect, xMetaFile.get(), this );
+    ImpPaint(rRenderContext, rRect, xMetaFile.get());
 }
 
 VCL_BUILDER_DECL_FACTORY(SfxPreviewWin)
 {
-    (void)rMap;
+    (void) rMap;
     rRet = VclPtr<SfxPreviewWin_Impl>::Create(pParent, 0);
 }
 
@@ -148,21 +147,21 @@ class SfxNewFileDialog_Impl
 
     DECL_LINK_TYPED( Update, Idle *, void );
 
-    DECL_LINK( RegionSelect, ListBox * );
-    DECL_LINK(TemplateSelect, void *);
-    DECL_LINK( DoubleClick, ListBox * );
-    DECL_LINK( Expand, void * );
-    DECL_LINK(LoadFile, void *);
+    DECL_LINK(RegionSelect, ListBox*);
+    DECL_LINK(TemplateSelect, void*);
+    DECL_LINK(DoubleClick, ListBox*);
+    DECL_LINK(Expand, void*);
+    DECL_LINK(LoadFile, void*);
     sal_uInt16  GetSelectedTemplatePos() const;
 
 public:
 
-    SfxNewFileDialog_Impl( SfxNewFileDialog* pAntiImplP, sal_uInt16 nFlags );
+    SfxNewFileDialog_Impl(SfxNewFileDialog* pAntiImplP, sal_uInt16 nFlags);
     ~SfxNewFileDialog_Impl();
 
-        // Returns sal_False if '- No -' is set as a template
-        // Template name can only be obtained if IsTemplate() is TRUE
-        // erfragt werden
+    // Returns sal_False if '- No -' is set as a template
+    // Template name can only be obtained if IsTemplate() is TRUE
+    // erfragt werden
     bool IsTemplate() const;
     OUString GetTemplateFileName() const;
 
@@ -170,29 +169,29 @@ public:
     void             SetTemplateFlags(SfxTemplateFlags nSet);
 };
 
-IMPL_LINK_NOARG_TYPED(SfxNewFileDialog_Impl, Update, Idle *, void)
+IMPL_LINK_NOARG_TYPED(SfxNewFileDialog_Impl, Update, Idle*, void)
 {
-    if ( xDocShell.Is() )
+    if (xDocShell.Is())
     {
-        if ( xDocShell->GetProgress() )
+        if (xDocShell->GetProgress())
             return;
         xDocShell.Clear();
     }
 
     const sal_uInt16 nEntry = GetSelectedTemplatePos();
-    if(!nEntry)
+    if (!nEntry)
     {
         m_pPreviewWin->Invalidate();
         m_pPreviewWin->SetObjectShell( 0);
         return;
     }
 
-    if ( m_pMoreBt->get_expanded() && (nFlags & SFXWB_PREVIEW) == SFXWB_PREVIEW)
+    if (m_pMoreBt->get_expanded() && (nFlags & SFXWB_PREVIEW) == SFXWB_PREVIEW)
     {
 
-        OUString aFileName = aTemplates.GetPath( m_pRegionLb->GetSelectEntryPos(), nEntry-1);
-        INetURLObject aTestObj( aFileName );
-        if( aTestObj.GetProtocol() == INetProtocol::NotValid )
+        OUString aFileName = aTemplates.GetPath(m_pRegionLb->GetSelectEntryPos(), nEntry - 1);
+        INetURLObject aTestObj(aFileName);
+        if (aTestObj.GetProtocol() == INetProtocol::NotValid)
         {
             // temp. fix until Templates are managed by UCB compatible service
             // does NOT work with locally cached components !
@@ -201,51 +200,47 @@ IMPL_LINK_NOARG_TYPED(SfxNewFileDialog_Impl, Update, Idle *, void)
             aFileName = aTemp;
         }
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list