[Libreoffice-commits] core.git: 19 commits - include/sfx2 include/svx sc/source sd/inc sd/source sfx2/source svtools/source svx/source sw/inc sw/source vcl/inc vcl/unx

Michael Stahl mstahl at redhat.com
Fri Nov 13 02:13:14 PST 2015


 include/sfx2/app.hxx                    |    4 
 include/svx/xtable.hxx                  |    1 
 sc/source/core/data/global.cxx          |    1 
 sc/source/ui/formdlg/formula.cxx        |   51 ++++-----
 sc/source/ui/inc/formula.hxx            |    5 
 sc/source/ui/pagedlg/scuitphfedit.cxx   |    6 -
 sc/source/ui/pagedlg/tphfedit.cxx       |    6 -
 sd/inc/drawdoc.hxx                      |    3 
 sd/source/core/drawdoc.cxx              |   10 -
 sd/source/core/pglink.cxx               |    4 
 sfx2/source/appl/app.cxx                |   19 ++-
 sfx2/source/sidebar/ResourceManager.cxx |    4 
 svtools/source/contnr/svlbitm.cxx       |   12 +-
 svtools/source/contnr/treelistbox.cxx   |   44 ++++----
 svx/source/gallery2/gallery1.cxx        |   10 -
 svx/source/svdraw/svdhdl.cxx            |    5 
 svx/source/xoutdev/xtabcolr.cxx         |    2 
 sw/inc/splargs.hxx                      |   13 ++
 sw/inc/view.hxx                         |    1 
 sw/inc/viewsh.hxx                       |    8 -
 sw/source/core/doc/notxtfrm.cxx         |    2 
 sw/source/core/edit/edlingu.cxx         |  164 +++++++++++++++++---------------
 sw/source/core/frmedt/fetab.cxx         |   43 ++++----
 sw/source/core/inc/ptqueue.hxx          |    2 
 sw/source/core/inc/rootfrm.hxx          |   14 +-
 sw/source/core/layout/newfrm.cxx        |   10 -
 sw/source/core/layout/paintfrm.cxx      |   32 +++---
 sw/source/core/layout/tabfrm.cxx        |   28 ++---
 sw/source/core/layout/trvlfrm.cxx       |    8 -
 sw/source/core/layout/virtoutp.cxx      |    8 -
 sw/source/core/txtnode/txtedt.cxx       |   12 +-
 sw/source/core/view/viewsh.cxx          |   10 -
 sw/source/core/view/vnew.cxx            |   11 +-
 sw/source/core/view/vprint.cxx          |   23 ++--
 sw/source/uibase/docvw/edtwin3.cxx      |    2 
 sw/source/uibase/uiview/view.cxx        |    1 
 sw/source/uibase/uiview/viewsrch.cxx    |   72 ++++++--------
 vcl/inc/unx/i18n_status.hxx             |    2 
 vcl/unx/generic/app/i18n_status.cxx     |   18 +--
 39 files changed, 341 insertions(+), 330 deletions(-)

New commits:
commit 5a616ca96c41b1e3d6dc2bca370f0797dfef7511
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 22:28:54 2015 +0100

    sc: loplugin:badstatics: _one_ global pActiveEdWnd is enough
    
    Change-Id: Idb0eacc8c14b2c56e8255c47c8330e5e6572d5de

diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 2b2192f..9f6f843 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -51,8 +51,6 @@
 
 // STATIC DATA -----------------------------------------------------------
 
-static VclPtr<ScEditWindow> pActiveEdWnd = nullptr;
-
 // class ScHFEditPage
 
 ScHFEditPage::ScHFEditPage( vcl::Window*             pParent,
@@ -793,7 +791,7 @@ IMPL_LINK_TYPED( ScHFEditPage, ListHdl_Impl, ListBox&, rList, void )
 
 IMPL_LINK_TYPED( ScHFEditPage, ClickHdl, Button*, pBtn, void )
 {
-    pActiveEdWnd = ::GetScEditWindow();
+    VclPtr<ScEditWindow> pActiveEdWnd = ::GetScEditWindow();
     if ( !pActiveEdWnd )
         return;
 
@@ -824,7 +822,7 @@ IMPL_LINK_TYPED( ScHFEditPage, ClickHdl, Button*, pBtn, void )
 
 IMPL_STATIC_LINK_TYPED( ScHFEditPage, MenuHdl, ScExtIButton&, rBtn, void )
 {
-    pActiveEdWnd = ::GetScEditWindow();
+    VclPtr<ScEditWindow> pActiveEdWnd = ::GetScEditWindow();
     if ( !pActiveEdWnd )
         return;
 
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index b5f8bf8..eab598c 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -48,11 +48,11 @@
 #include <memory>
 
 // STATIC DATA -----------------------------------------------------------
-static VclPtr<ScEditWindow> pActiveEdWnd = nullptr;
+static VclPtr<ScEditWindow> g_pActiveEdWnd = nullptr;
 
 ScEditWindow* GetScEditWindow ()
 {
-    return pActiveEdWnd;
+    return g_pActiveEdWnd;
 }
 
 static void lcl_GetFieldData( ScHeaderFieldData& rData )
@@ -283,7 +283,7 @@ void ScEditWindow::Command( const CommandEvent& rCEvt )
 void ScEditWindow::GetFocus()
 {
     pEdView->ShowCursor();
-    pActiveEdWnd = this;
+    g_pActiveEdWnd = this;
 
     css::uno::Reference< css::accessibility::XAccessible > xTemp = xAcc;
     if (xTemp.is() && pAcc)
commit 5140fe150b2962f2973bd07e770df46fee7ab25d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 22:01:31 2015 +0100

    sc: loplugin:badstatics: clear ScGlobal::xDrawClipDocShellRef
    
    Change-Id: Iede68e39a449ad0ea4a07d0a349c70c523ad6633

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 8e02f7f..2053f55 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -650,6 +650,7 @@ void ScGlobal::Clear()
     ScDocumentPool::DeleteVersionMaps();
 
     DELETEZ(pEmptyOUString);
+    xDrawClipDocShellRef.Clear();
 }
 
 rtl_TextEncoding ScGlobal::GetCharsetValue( const OUString& rCharSet )
commit d5016b013672056f89f908b6cde38183fad145bb
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 22:02:20 2015 +0100

    svx: loplugin:badstatics
    
    Change-Id: Ief31d8153fdbf91cdd29df5ac7801bd88a98542e

diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 10db049..af2be46 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2250,10 +2250,7 @@ SdrCropHdl::SdrCropHdl(
 
 BitmapEx SdrCropHdl::GetHandlesBitmap()
 {
-    static BitmapEx* pModernBitmap = nullptr;
-    if( pModernBitmap == nullptr )
-        pModernBitmap = new BitmapEx(ResId(SIP_SA_CROP_MARKERS, *ImpGetResMgr()));
-    return *pModernBitmap;
+    return BitmapEx(ResId(SIP_SA_CROP_MARKERS, *ImpGetResMgr()));
 }
 
 
diff --git a/svx/source/xoutdev/xtabcolr.cxx b/svx/source/xoutdev/xtabcolr.cxx
index da2f0b3..c0d911b 100644
--- a/svx/source/xoutdev/xtabcolr.cxx
+++ b/svx/source/xoutdev/xtabcolr.cxx
@@ -36,7 +36,7 @@ XColorListRef XColorList::CreateStdColorList()
 
 XColorListRef XColorList::GetStdColorList()
 {
-    static XColorListRef aTable( CreateStdColorList() );
+    XColorListRef aTable( CreateStdColorList() );
     return aTable;
 }
 
commit cc77a2a8f3447b02d33a224df627f6500adc158f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 21:57:52 2015 +0100

    sw: loplugin:badstatics: convert static SwViewShell::mpReplaceBmp
    
    ... and mpErrorBmp to actual members (not just in name only).
    
    Change-Id: Id02553451f1990dbc111e9c842247764bf7554bc

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 8b8875b..254e4ec 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -107,8 +107,8 @@ class SW_DLLPUBLIC SwViewShell : public sw::Ring<SwViewShell>
     // Set SwVisArea in order to enable clean formatting before printing.
     friend void SetSwVisArea( SwViewShell *pSh, const SwRect & );
 
-    static BitmapEx*    mpReplaceBmp;    ///< replaced display of still loaded images
-    static BitmapEx*    mpErrorBmp;      ///< error display of missed images
+    BitmapEx* m_pReplaceBmp; ///< replaced display of still loaded images
+    BitmapEx* m_pErrorBmp;   ///< error display of missed images
 
     static bool mbLstAct;        // true if EndAction of last Shell
                                     // i.e. if the EndActions of the other
@@ -555,8 +555,8 @@ public:
 
     inline bool IsInConstructor() const { return mbInConstructor; }
 
-    static const BitmapEx& GetReplacementBitmap( bool bIsErrorState );
-    static void DeleteReplacementBitmaps();
+    const BitmapEx& GetReplacementBitmap(bool bIsErrorState);
+    void DeleteReplacementBitmaps();
 
     const SwPostItMgr* GetPostItMgr() const { return (const_cast<SwViewShell*>(this))->GetPostItMgr(); }
     SwPostItMgr* GetPostItMgr();
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 5b1532f..9bb0bde 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -139,7 +139,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const OUString &rText,
     pFont->SetUnderline( eUnderline );
     pFont->SetColor( aCol );
 
-    const BitmapEx& rBmp = SwViewShell::GetReplacementBitmap( bDefect );
+    const BitmapEx& rBmp = const_cast<SwViewShell&>(rSh).GetReplacementBitmap(bDefect);
     Graphic::DrawEx( rSh.GetOut(), rText, *pFont, rBmp, rRect.Pos(), rRect.SSize() );
 }
 
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 25bf3c7..54d8a82 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2306,7 +2306,7 @@ void DrawGraphic(
 
     if( bReplaceGrfNum )
     {
-        const BitmapEx& rBmp = SwViewShell::GetReplacementBitmap( false );
+        const BitmapEx& rBmp = rSh.GetReplacementBitmap(false);
         vcl::Font aTmp( pOutDev->GetFont() );
         Graphic::DrawEx( pOutDev, aEmptyOUStr, aTmp, rBmp, rOrg.Pos(), rOrg.SSize() );
     }
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 226b123..bf919a9 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -88,8 +88,6 @@
 bool SwViewShell::mbLstAct = false;
 ShellResource *SwViewShell::mpShellRes = nullptr;
 VclPtr<vcl::Window> SwViewShell::mpCareWindow = nullptr;
-BitmapEx* SwViewShell::mpErrorBmp = nullptr;
-BitmapEx* SwViewShell::mpReplaceBmp = nullptr;
 
 bool bInSizeNotify = false;
 
@@ -2486,12 +2484,12 @@ const BitmapEx& SwViewShell::GetReplacementBitmap( bool bIsErrorState )
     sal_uInt16 nResId = 0;
     if( bIsErrorState )
     {
-        ppRet = &mpErrorBmp;
+        ppRet = &m_pErrorBmp;
         nResId = RID_GRAPHIC_ERRORBMP;
     }
     else
     {
-        ppRet = &mpReplaceBmp;
+        ppRet = &m_pReplaceBmp;
         nResId = RID_GRAPHIC_REPLACEBMP;
     }
 
@@ -2504,8 +2502,8 @@ const BitmapEx& SwViewShell::GetReplacementBitmap( bool bIsErrorState )
 
 void SwViewShell::DeleteReplacementBitmaps()
 {
-    DELETEZ( mpErrorBmp );
-    DELETEZ( mpReplaceBmp );
+    DELETEZ( m_pErrorBmp );
+    DELETEZ( m_pReplaceBmp );
 }
 
 SwPostItMgr* SwViewShell::GetPostItMgr()
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index dd702b5..2b8300c 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -149,7 +149,9 @@ void SwViewShell::Init( const SwViewOption *pNewOpt )
 SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
                         const SwViewOption *pNewOpt, OutputDevice *pOutput,
                         long nFlags )
-    :
+    : m_pReplaceBmp(nullptr)
+    , m_pErrorBmp(nullptr)
+    ,
     maBrowseBorder(),
     mpSfxViewShell( nullptr ),
     mpImp( new SwViewShellImp( this ) ),
@@ -225,8 +227,11 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
 
 /// CTor for further Shells on a document.
 SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow,
-                        OutputDevice *pOutput, long nFlags ) :
-    Ring( &rShell ),
+                        OutputDevice * pOutput, long const nFlags)
+    : Ring( &rShell )
+    , m_pReplaceBmp(nullptr)
+    , m_pErrorBmp(nullptr)
+    ,
     maBrowseBorder( rShell.maBrowseBorder ),
     mpSfxViewShell( nullptr ),
     mpImp( new SwViewShellImp( this ) ),
diff --git a/sw/source/uibase/docvw/edtwin3.cxx b/sw/source/uibase/docvw/edtwin3.cxx
index b8c4279..c69ebfc 100644
--- a/sw/source/uibase/docvw/edtwin3.cxx
+++ b/sw/source/uibase/docvw/edtwin3.cxx
@@ -144,7 +144,7 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt )
         {
             pSh->LockPaint();
             bUnlockPaint = true;
-            SwViewShell::DeleteReplacementBitmaps();
+            pSh->DeleteReplacementBitmaps();
             GetView().InvalidateBorder();               //Scrollbar work
         }
         break;
commit f723a62cb5e0e37e56f341f4641ab3fd05bbc8dd
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 22:00:15 2015 +0100

    sw: loplugin:badstatics: actually these are harmless
    
    ... but there's no point in them being static either.
    
    Change-Id: I49931289560da9de7a2e79577e525872d316cc4e

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 359c135..25bf3c7 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -6106,7 +6106,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
 
     static vcl::DeleteOnDeinit< drawinglayer::primitive2d::DiscreteShadow > shadowMaskObj
         ( new drawinglayer::primitive2d::DiscreteShadow( SW_RES( BMP_PAGE_SHADOW_MASK ) ));
-    static drawinglayer::primitive2d::DiscreteShadow& shadowMask = *shadowMaskObj.get();
+    drawinglayer::primitive2d::DiscreteShadow& shadowMask = *shadowMaskObj.get();
     static vcl::DeleteOnDeinit< BitmapEx > aPageTopRightShadowObj( new BitmapEx );
     static vcl::DeleteOnDeinit< BitmapEx > aPageBottomRightShadowObj( new BitmapEx );
     static vcl::DeleteOnDeinit< BitmapEx > aPageBottomLeftShadowObj( new BitmapEx );
@@ -6115,14 +6115,14 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
     static vcl::DeleteOnDeinit< BitmapEx > aPageTopShadowBaseObj( new BitmapEx );
     static vcl::DeleteOnDeinit< BitmapEx > aPageTopLeftShadowObj( new BitmapEx );
     static vcl::DeleteOnDeinit< BitmapEx > aPageLeftShadowBaseObj( new BitmapEx );
-    static BitmapEx& aPageTopRightShadow = *aPageTopRightShadowObj.get();
-    static BitmapEx& aPageBottomRightShadow = *aPageBottomRightShadowObj.get();
-    static BitmapEx& aPageBottomLeftShadow = *aPageBottomLeftShadowObj.get();
-    static BitmapEx& aPageBottomShadow = *aPageBottomShadowBaseObj.get();
-    static BitmapEx& aPageRightShadow = *aPageRightShadowBaseObj.get();
-    static BitmapEx& aPageTopShadow = *aPageTopShadowBaseObj.get();
-    static BitmapEx& aPageTopLeftShadow = *aPageTopLeftShadowObj.get();
-    static BitmapEx& aPageLeftShadow = *aPageLeftShadowBaseObj.get();
+    BitmapEx& aPageTopRightShadow = *aPageTopRightShadowObj.get();
+    BitmapEx& aPageBottomRightShadow = *aPageBottomRightShadowObj.get();
+    BitmapEx& aPageBottomLeftShadow = *aPageBottomLeftShadowObj.get();
+    BitmapEx& aPageBottomShadow = *aPageBottomShadowBaseObj.get();
+    BitmapEx& aPageRightShadow = *aPageRightShadowBaseObj.get();
+    BitmapEx& aPageTopShadow = *aPageTopShadowBaseObj.get();
+    BitmapEx& aPageTopLeftShadow = *aPageTopLeftShadowObj.get();
+    BitmapEx& aPageLeftShadow = *aPageLeftShadowBaseObj.get();
     static Color aShadowColor( COL_AUTO );
 
     SwRect aAlignedPageRect( _rPageRect );
commit 306d4f0b6df1df4a92613d17bdc4fcfb306e7854
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 15:47:28 2015 +0100

    sw: loplugin:badstatics: remove static SwView::m_pSrchDlg
    
    ... and associated copypasta
    
    Change-Id: I59a34da48727c84953ed460c11718d261fc3c5a1

diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 873b311..229f393 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -154,7 +154,6 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
     friend class SwClipboardChangeListener;
 
     // search & replace
-    static VclPtr<SvxSearchDialog>  m_pSrchDlg;
     static SvxSearchItem           *m_pSrchItem;
 
     static sal_uInt16       m_nMoveType; // for buttons below the scrollbar (viewmdi)
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 35e5ebc..1c2de7c 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -132,7 +132,6 @@ bool            SwView::m_bExtra      = false;
 bool            SwView::m_bFound      = false;
 bool            SwView::m_bJustOpened = false;
 
-VclPtr<SvxSearchDialog> SwView::m_pSrchDlg    = nullptr;
 SearchAttrItemList*     SwView::m_pSrchList   = nullptr;
 SearchAttrItemList*     SwView::m_pReplList   = nullptr;
 
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 7d7ebd5..154b08c 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -187,16 +187,16 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
             DELETEZ( m_pSrchList );
             DELETEZ( m_pReplList );
 
-            m_pSrchDlg = GetSearchDialog();
-            if (m_pSrchDlg)
+            SvxSearchDialog *const pSrchDlg(GetSearchDialog());
+            if (pSrchDlg)
             {
                 // We will remember the search-/replace items.
-                const SearchAttrItemList* pList = m_pSrchDlg->GetSearchItemList();
+                const SearchAttrItemList* pList = pSrchDlg->GetSearchItemList();
                 if( pList && pList->Count() )
                     m_pSrchList = new SearchAttrItemList( *pList );
 
-                if( nullptr != (pList = m_pSrchDlg->GetReplaceItemList() ) &&
-                    pList->Count() )
+                pList = pSrchDlg->GetReplaceItemList();
+                if (nullptr != pList && pList->Count())
                     m_pReplList = new SearchAttrItemList( *pList );
             }
         }
@@ -210,18 +210,18 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
                     SwView::SetMoveType(NID_SRCH_REP);
             }
 
-            m_pSrchDlg = GetSearchDialog();
-            if (m_pSrchDlg)
+            SvxSearchDialog * pSrchDlg(GetSearchDialog());
+            if (pSrchDlg)
             {
                 DELETEZ( m_pSrchList );
                 DELETEZ( m_pReplList );
 
-                const SearchAttrItemList* pList = m_pSrchDlg->GetSearchItemList();
+                const SearchAttrItemList* pList = pSrchDlg->GetSearchItemList();
                 if( pList && pList->Count() )
                     m_pSrchList = new SearchAttrItemList( *pList );
 
-                if( nullptr != (pList = m_pSrchDlg->GetReplaceItemList() ) &&
-                    pList->Count() )
+                pList = pSrchDlg->GetReplaceItemList();
+                if (nullptr != pList && pList->Count())
                     m_pReplList = new SearchAttrItemList( *pList );
             }
 
@@ -255,13 +255,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
                 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
 #if HAVE_FEATURE_DESKTOP
                 {
-                    const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
-                    SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>( GetViewFrame()->GetChildWindow(nChildId) );
-                    if ( pDlgWrp )
+                    pSrchDlg = GetSearchDialog();
+                    if (pSrchDlg)
                     {
-                        m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow());
-                        m_pSrchDlg->SetDocWin(m_pEditWin);
-                        m_pSrchDlg->SetSrchFlag(false);
+                        pSrchDlg->SetDocWin(m_pEditWin);
+                        pSrchDlg->SetSrchFlag(false);
                     }
                 }
 #endif
@@ -287,14 +285,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
                 rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
 #if HAVE_FEATURE_DESKTOP
                 {
-                    const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
-                    SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId));
-
-                    if ( pDlgWrp )
+                    pSrchDlg = GetSearchDialog();
+                    if (pSrchDlg)
                     {
-                        m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow());
-                        m_pSrchDlg->SetDocWin(m_pEditWin);
-                        m_pSrchDlg->SetSrchFlag(false);
+                        pSrchDlg->SetDocWin(m_pEditWin);
+                        pSrchDlg->SetSrchFlag(false);
                     }
                 }
 #endif
@@ -348,14 +343,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
                 }
 #if HAVE_FEATURE_DESKTOP
                 {
-                    const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
-                    SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId));
-
-                    if ( pDlgWrp )
+                    pSrchDlg = GetSearchDialog();
+                    if (pSrchDlg)
                     {
-                        m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow());
-                        m_pSrchDlg->SetDocWin(m_pEditWin);
-                        m_pSrchDlg->SetSrchFlag(false);
+                        pSrchDlg->SetDocWin(m_pEditWin);
+                        pSrchDlg->SetSrchFlag(false);
                     }
                 }
 #endif
@@ -416,19 +408,17 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
                     {
                         OUString aText( SW_RES( STR_NB_REPLACED ) );
                         aText = aText.replaceFirst("XX", OUString::number( nFound ));
-                        vcl::Window* pParentWindow = GetParentWindow( m_pSrchDlg );
+                        pSrchDlg = GetSearchDialog();
+                        vcl::Window* pParentWindow = GetParentWindow(pSrchDlg);
                         ScopedVclPtr<InfoBox>::Create( pParentWindow, aText )->Execute();
                     }
                 }
 #if HAVE_FEATURE_DESKTOP
-                const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
-                SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId));
-
-                if ( pDlgWrp )
+                pSrchDlg = GetSearchDialog();
+                if (pSrchDlg)
                 {
-                    m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow());
-                    m_pSrchDlg->SetDocWin(m_pEditWin);
-                    m_pSrchDlg->SetSrchFlag(false);
+                    pSrchDlg->SetDocWin(m_pEditWin);
+                    pSrchDlg->SetSrchFlag(false);
                 }
 #endif
                 break;
@@ -883,10 +873,10 @@ SvxSearchDialog* SwView::GetSearchDialog()
 #if HAVE_FEATURE_DESKTOP
     const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
     SvxSearchDialogWrapper *pWrp = static_cast<SvxSearchDialogWrapper*>( SfxViewFrame::Current()->GetChildWindow(nId) );
-    m_pSrchDlg = pWrp ? pWrp->getDialog () : nullptr;
-    return m_pSrchDlg;
+    auto pSrchDlg = (pWrp) ? pWrp->getDialog() : nullptr;
+    return pSrchDlg;
 #else
-    return NULL;
+    return nullptr;
 #endif
 }
 
commit 0ab6b1fc6e84b4f5f3a9c0b93b999aa320a70a0e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 21:55:33 2015 +0100

    sw: shove 2 global variables into SwHyphIter
    
    Change-Id: I0cb6112b0353a5fd0b4dd571d65f2d656e39ba74

diff --git a/sw/inc/splargs.hxx b/sw/inc/splargs.hxx
index dd1e736..33fe942 100644
--- a/sw/inc/splargs.hxx
+++ b/sw/inc/splargs.hxx
@@ -22,12 +22,15 @@
 #include <i18nlangtag/lang.h>
 #include <tools/solar.h>
 #include <tools/gen.hxx>
-#include <limits.h>
 
 #include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
 #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
 #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
 
+#include <functional>
+#include <limits.h>
+
+class SwTextFrm;
 class SwTextNode;
 class SwIndex;
 namespace vcl { class Font; }
@@ -152,6 +155,14 @@ public:
     }
 };
 
+
+namespace sw {
+
+SwTextFrm *
+SwHyphIterCacheLastTxtFrm(SwTextNode *, std::function<SwTextFrm * ()>);
+
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 92a2d99..49d3202 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -155,11 +155,16 @@ public:
 
 class SwHyphIter : public SwLinguIter
 {
+    // With that we save a GetFrm() in Hyphenate //TODO: does it actually matter?
+    const SwTextNode *m_pLastNode;
+    SwTextFrm  *m_pLastFrm;
+    friend SwTextFrm * sw::SwHyphIterCacheLastTxtFrm(SwTextNode *, std::function<SwTextFrm * ()>);
+
     bool bOldIdle;
     static void DelSoftHyph( SwPaM &rPam );
 
 public:
-    SwHyphIter() : bOldIdle(false) {}
+    SwHyphIter() : m_pLastNode(nullptr), m_pLastFrm(nullptr), bOldIdle(false) {}
 
     void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd );
     void End();
@@ -177,11 +182,6 @@ static SwSpellIter* g_pSpellIter = nullptr;
 static SwConvIter*  g_pConvIter = nullptr;
 static SwHyphIter*  g_pHyphIter = nullptr;
 
-// With that we save a GetFrm() in Hyphenate.
-// Caution: There are external declaration to these pointers in txtedt.cxx!
-const SwTextNode *pLinguNode;
-      SwTextFrm  *pLinguFrm;
-
 SwLinguIter::SwLinguIter()
     : pSh(nullptr)
     , pStart(nullptr)
@@ -249,9 +249,6 @@ void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart,
     }
 
     pCrsr->SetMark();
-
-    pLinguFrm = nullptr;
-    pLinguNode = nullptr;
 }
 
 void SwLinguIter::_End(bool bRestoreSelection)
@@ -572,6 +569,23 @@ void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos )
     pCrsr->SetMark();
 }
 
+namespace sw {
+
+SwTextFrm *
+SwHyphIterCacheLastTxtFrm(SwTextNode *const pNode,
+        std::function<SwTextFrm * ()> const create)
+{
+    assert(g_pHyphIter);
+    if (pNode != g_pHyphIter->m_pLastNode || !g_pHyphIter->m_pLastFrm)
+    {
+        g_pHyphIter->m_pLastNode = pNode;
+        g_pHyphIter->m_pLastFrm = create();
+    }
+    return g_pHyphIter->m_pLastFrm;
+}
+
+}
+
 bool SwEditShell::HasLastSentenceGotGrammarChecked()
 {
     bool bTextWasGrammarChecked = false;
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 342538e..e8e060f 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1618,12 +1618,12 @@ bool SwTextNode::Hyphenate( SwInterHyphInfo &rHyphInf )
         return false;
     }
 
-    if( pLinguNode != this )
-    {
-        pLinguNode = this;
-        pLinguFrm = static_cast<SwTextFrm*>(getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), rHyphInf.GetCrsrPos() ));
-    }
-    SwTextFrm *pFrm = pLinguFrm;
+    SwTextFrm *pFrm = ::sw::SwHyphIterCacheLastTxtFrm(this,
+        [&rHyphInf, this]() {
+            return static_cast<SwTextFrm*>(this->getLayoutFrm(
+                this->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(),
+                rHyphInf.GetCrsrPos()));
+        });
     if( pFrm )
         pFrm = &(pFrm->GetFrmAtOfst( rHyphInf.nStart ));
     else
commit 655248f1b504af18782caaa5b903623145ab80e5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 20:58:46 2015 +0100

    sd: rename static variable SdDrawDocument::pDocLockedInsertingLinks
    
    Change-Id: I6092d64f0e64d295253505b27c9aee7874d9ecce

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index e6765254..6343217 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -467,7 +467,8 @@ public:
 
 public:
 
-    SAL_DLLPRIVATE static SdDrawDocument* pDocLockedInsertingLinks;  // static to prevent recursions while resolving links
+    /// static to prevent recursions while resolving links
+    SAL_DLLPRIVATE static SdDrawDocument* s_pDocLockedInsertingLinks;
 
     /** Create and insert a set of two new pages: a standard (draw) page and
         the associated notes page.  The new pages are inserted directly
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 91cb397..6702e9d 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -112,7 +112,7 @@ using ::com::sun::star::lang::XMultiServiceFactory;
 using ::com::sun::star::beans::PropertyValue;
 
 
-SdDrawDocument* SdDrawDocument::pDocLockedInsertingLinks = nullptr;
+SdDrawDocument* SdDrawDocument::s_pDocLockedInsertingLinks = nullptr;
 
 PresentationSettings::PresentationSettings()
 :   mbAll( true ),
@@ -692,14 +692,14 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
 /** updates all links, only links in this document should by resolved */
 void SdDrawDocument::UpdateAllLinks()
 {
-    if ( !pDocLockedInsertingLinks && pLinkManager && !pLinkManager->GetLinks().empty() )
+    if (!s_pDocLockedInsertingLinks && pLinkManager && !pLinkManager->GetLinks().empty())
     {
-        pDocLockedInsertingLinks = this; // lock inserting links. only links in this document should by resolved
+        s_pDocLockedInsertingLinks = this; // lock inserting links. only links in this document should by resolved
 
         pLinkManager->UpdateAllLinks();  // query box: update all links?
 
-        if( pDocLockedInsertingLinks == this )
-            pDocLockedInsertingLinks = nullptr;  // unlock inserting links
+        if (s_pDocLockedInsertingLinks == this)
+            s_pDocLockedInsertingLinks = nullptr;  // unlock inserting links
     }
 }
 
diff --git a/sd/source/core/pglink.cxx b/sd/source/core/pglink.cxx
index c68b625..6f54c58 100644
--- a/sd/source/core/pglink.cxx
+++ b/sd/source/core/pglink.cxx
@@ -96,7 +96,7 @@ SdPageLink::~SdPageLink()
             bool bNoDialogs = false;
             bool bCopy = false;
 
-            if( pDoc->pDocLockedInsertingLinks )
+            if (pDoc->s_pDocLockedInsertingLinks)
             {
                 // resolving links while loading pDoc
                 bNoDialogs = true;
@@ -106,7 +106,7 @@ SdPageLink::~SdPageLink()
             pDoc->InsertBookmarkAsPage(aBookmarkList, nullptr, bLink, bReplace,
                                        nInsertPos, bNoDialogs, nullptr, bCopy, true, true);
 
-            if( !pDoc->pDocLockedInsertingLinks )
+            if (!pDoc->s_pDocLockedInsertingLinks)
                 pDoc->CloseBookmarkDoc();
         }
     }
commit cd3b8cc57d0e0f77da32438e95c3ab1cf79338bc
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Nov 12 14:01:36 2015 +0100

    sw: rename some more global variables
    
    Change-Id: I6f4d0bb57c5d82984ff29b621dc4570f453be31d

diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 8068b67..d529b64 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -72,15 +72,15 @@ inline bool IsSame( long nA, long nB ) { return  std::abs(nA-nB) <= COLFUZZY; }
 
 // table column cache
 SwTabCols *pLastCols   = nullptr;
-const SwTable   *pColumnCacheLastTable  = nullptr;
-const SwTabFrm  *pColumnCacheLastTabFrm = nullptr;
-const SwFrm     *pColumnCacheLastCellFrm = nullptr;
+const SwTable   *g_pColumnCacheLastTable  = nullptr;
+const SwTabFrm  *g_pColumnCacheLastTabFrm = nullptr;
+const SwFrm     *g_pColumnCacheLastCellFrm = nullptr;
 
 // table row cache
 SwTabCols *pLastRows   = nullptr;
-const SwTable   *pRowCacheLastTable  = nullptr;
-const SwTabFrm  *pRowCacheLastTabFrm = nullptr;
-const SwFrm     *pRowCacheLastCellFrm = nullptr;
+const SwTable   *g_pRowCacheLastTable  = nullptr;
+const SwTabFrm  *g_pRowCacheLastTabFrm = nullptr;
+const SwFrm     *g_pRowCacheLastCellFrm = nullptr;
 
 class TableWait
 {
@@ -523,7 +523,7 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
     if ( pLastCols )
     {
         bool bDel = true;
-        if ( pColumnCacheLastTable == pTab->GetTable() )
+        if (g_pColumnCacheLastTable == pTab->GetTable())
         {
             bDel = false;
             SWRECTFN( pTab )
@@ -534,17 +534,17 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
             const sal_uLong nRightMax = (pTab->Frm().*fnRect->fnGetRight)() -
                                     (pPage->Frm().*fnRect->fnGetLeft)();
 
-            if ( pColumnCacheLastTabFrm != pTab )
+            if (g_pColumnCacheLastTabFrm != pTab)
             {
                 // if TabFrm was changed, we only shift a little bit
                 // as the width is the same
-                SWRECTFNX( pColumnCacheLastTabFrm )
-                if( (pColumnCacheLastTabFrm->Frm().*fnRectX->fnGetWidth)() ==
+                SWRECTFNX( g_pColumnCacheLastTabFrm )
+                if ((g_pColumnCacheLastTabFrm->Frm().*fnRectX->fnGetWidth)() ==
                     (pTab->Frm().*fnRect->fnGetWidth)() )
                 {
                     pLastCols->SetLeftMin( nLeftMin );
 
-                    pColumnCacheLastTabFrm = pTab;
+                    g_pColumnCacheLastTabFrm = pTab;
                 }
                 else
                     bDel = true;
@@ -556,11 +556,11 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
                  pLastCols->GetRight   () == (sal_uInt16)(pTab->Prt().*fnRect->fnGetRight)()&&
                  pLastCols->GetRightMax() == (sal_uInt16)nRightMax - pLastCols->GetLeftMin() )
             {
-                if ( pColumnCacheLastCellFrm != pBox )
+                if (g_pColumnCacheLastCellFrm != pBox)
                 {
                     pTab->GetTable()->GetTabCols( *pLastCols,
                                         static_cast<const SwCellFrm*>(pBox)->GetTabBox(), true);
-                    pColumnCacheLastCellFrm = pBox;
+                    g_pColumnCacheLastCellFrm = pBox;
                 }
                 rToFill = *pLastCols;
             }
@@ -575,9 +575,9 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
         SwDoc::GetTabCols( rToFill, nullptr, static_cast<const SwCellFrm*>(pBox) );
 
         pLastCols   = new SwTabCols( rToFill );
-        pColumnCacheLastTable  = pTab->GetTable();
-        pColumnCacheLastTabFrm = pTab;
-        pColumnCacheLastCellFrm= pBox;
+        g_pColumnCacheLastTable  = pTab->GetTable();
+        g_pColumnCacheLastTabFrm = pTab;
+        g_pColumnCacheLastCellFrm= pBox;
     }
 
 #if OSL_DEBUG_LEVEL > 1
@@ -596,7 +596,7 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
     if ( pLastRows )
     {
         bool bDel = true;
-        if ( pRowCacheLastTable == pTab->GetTable() )
+        if (g_pRowCacheLastTable == pTab->GetTable())
         {
             bDel = false;
             SWRECTFN( pTab )
@@ -608,8 +608,7 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
             const long nRight    = (pTab->Prt().*fnRect->fnGetHeight)();
             const long nRightMax = bVert ? nRight : LONG_MAX;
 
-            if ( pRowCacheLastTabFrm != pTab ||
-                 pRowCacheLastCellFrm != pBox )
+            if (g_pRowCacheLastTabFrm != pTab || g_pRowCacheLastCellFrm != pBox)
                 bDel = true;
 
             if ( !bDel &&
@@ -631,9 +630,9 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
         SwDoc::GetTabRows( rToFill, nullptr, static_cast<const SwCellFrm*>(pBox) );
 
         pLastRows   = new SwTabCols( rToFill );
-        pRowCacheLastTable  = pTab->GetTable();
-        pRowCacheLastTabFrm = pTab;
-        pRowCacheLastCellFrm= pBox;
+        g_pRowCacheLastTable = pTab->GetTable();
+        g_pRowCacheLastTabFrm = pTab;
+        g_pRowCacheLastCellFrm = pBox;
     }
 }
 
diff --git a/sw/source/core/inc/ptqueue.hxx b/sw/source/core/inc/ptqueue.hxx
index 096786b..311ed32 100644
--- a/sw/source/core/inc/ptqueue.hxx
+++ b/sw/source/core/inc/ptqueue.hxx
@@ -45,7 +45,7 @@ class SwRect;
 class SwPaintQueue
 {
 public:
-    static SwQueuedPaint *pQueue;
+    static SwQueuedPaint *s_pPaintQueue;
 
     static void Add( SwViewShell *pSh, const SwRect &rNew );
     static void Remove( SwViewShell *pSh );
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 91a0919..7feb3c6 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -60,8 +60,8 @@ class SwRootFrm: public SwLayoutFrm
     friend inline void SetLastPage( SwPageFrm* );
 
     // For creating and destroying of the virtual output device manager
-    friend void _FrmInit(); // Creates mpVout
-    friend void _FrmFinit(); // Destroys mpVout
+    friend void _FrmInit(); // Creates s_pVout
+    friend void _FrmFinit(); // Destroys s_pVout
 
     std::vector<SwRect> maPageRects;// returns the current rectangle for each page frame
                                     // the rectangle is extended to the top/bottom/left/right
@@ -74,9 +74,9 @@ class SwRootFrm: public SwLayoutFrm
 
     bool    mbNeedGrammarCheck;     // true when sth needs to be checked (not necessarily started yet!)
 
-    static SwLayVout     *mpVout;
-    static bool           mbInPaint; // Protection against double Paints
-    static bool           mbNoVirDev;// No virt. Device for SystemPaints
+    static SwLayVout     *s_pVout;
+    static bool           s_isInPaint; // Protection against double Paints
+    static bool           s_isNoVirDev;// No virt. Device for SystemPaints
 
     bool    mbCheckSuperfluous   :1; // Search for empty Pages?
     bool    mbIdleFormat         :1; // Trigger Idle Formatter?
@@ -328,9 +328,9 @@ public:
     const SwPageFrm *GetLastPage() const { return mpLastPage; }
           SwPageFrm *GetLastPage()       { return mpLastPage; }
 
-    static bool IsInPaint() { return mbInPaint; }
+    static bool IsInPaint() { return s_isInPaint; }
 
-    static void SetNoVirDev( const bool bNew ) { mbNoVirDev = bNew; }
+    static void SetNoVirDev(const bool bNew) { s_isNoVirDev = bNew; }
 
     inline long GetBrowseWidth() const;
     inline void InvalidateBrowseWidth();
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index d4af159..aaa21b3 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -39,9 +39,9 @@
 #include <IDocumentFieldsAccess.hxx>
 #include <DocumentLayoutManager.hxx>
 
-SwLayVout     *SwRootFrm::mpVout = nullptr;
-bool           SwRootFrm::mbInPaint = false;
-bool           SwRootFrm::mbNoVirDev = false;
+SwLayVout     *SwRootFrm::s_pVout = nullptr;
+bool           SwRootFrm::s_isInPaint = false;
+bool           SwRootFrm::s_isNoVirDev = false;
 
 SwCache *SwFrm::mpCache = nullptr;
 
@@ -343,7 +343,7 @@ sal_uInt32 SwFrm::mnLastFrmId=0;
 
 void _FrmInit()
 {
-    SwRootFrm::mpVout = new SwLayVout();
+    SwRootFrm::s_pVout = new SwLayVout();
     SwCache *pNew = new SwCache( 100
 #ifdef DBG_UTIL
     , "static SwBorderAttrs::pCache"
@@ -363,7 +363,7 @@ void _FrmFinit()
             OSL_ENSURE( !pObj, "Who didn't deregister?");
         }
 #endif
-    delete SwRootFrm::mpVout;
+    delete SwRootFrm::s_pVout;
     delete SwFrm::GetCachePtr();
 }
 
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 15a04af..359c135 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3187,14 +3187,14 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
         {
             return;
         }
-        if ( SwRootFrm::mbInPaint )
+        if (SwRootFrm::s_isInPaint)
         {
             SwPaintQueue::Add( pSh, rRect );
             return;
         }
     }
     else
-        SwRootFrm::mbInPaint = bResetRootPaint = true;
+        SwRootFrm::s_isInPaint = bResetRootPaint = true;
 
     SwSavePaintStatics *pStatics = nullptr;
     if ( gProp.pSGlobalShell )
@@ -3344,7 +3344,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
                     // 2nd parameter is no longer <const> and will be set to the
                     // rectangle the virtual output device is calculated from <aPaintRect>,
                     // if the virtual output is used.
-                    mpVout->Enter( pSh, aPaintRect, !mbNoVirDev );
+                    s_pVout->Enter(pSh, aPaintRect, !s_isNoVirDev);
 
                     // OD 27.09.2002 #103636# - adjust paint rectangle to pixel size
                     // Thus, all objects overlapping on pixel level with the unadjusted
@@ -3353,7 +3353,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
                 }
 
                 // maybe this can be put in the above scope. Since we are not sure, just leave it ATM
-                mpVout->SetOrgRect( aPaintRect );
+                s_pVout->SetOrgRect( aPaintRect );
 
                 // OD 29.08.2002 #102450#
                 // determine background color of page for <PaintLayer> method
@@ -3425,7 +3425,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
                     pPage->RefreshExtraData( aPaintRect );
 
                 DELETEZ(gProp.pBLines);
-                mpVout->Leave();
+                s_pVout->Leave();
 
                 // #i68597#
                 // needed to move grid painting inside Begin/EndDrawLayer bounds and to change
@@ -3514,7 +3514,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
     DELETEZ( gProp.pSLines );
 
     if ( bResetRootPaint )
-        SwRootFrm::mbInPaint = false;
+        SwRootFrm::s_isInPaint = false;
     if ( pStatics )
         delete pStatics;
     else
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 06cc87d..495dab2 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -122,12 +122,12 @@ SwTabFrm::SwTabFrm( SwTabFrm &rTab )
     rTab.SetFollow( this );
 }
 
-extern const SwTable   *pColumnCacheLastTable;
-extern const SwTabFrm  *pColumnCacheLastTabFrm;
-extern const SwFrm     *pColumnCacheLastCellFrm;
-extern const SwTable   *pRowCacheLastTable;
-extern const SwTabFrm  *pRowCacheLastTabFrm;
-extern const SwFrm     *pRowCacheLastCellFrm;
+extern const SwTable   *g_pColumnCacheLastTable;
+extern const SwTabFrm  *g_pColumnCacheLastTabFrm;
+extern const SwFrm     *g_pColumnCacheLastCellFrm;
+extern const SwTable   *g_pRowCacheLastTable;
+extern const SwTabFrm  *g_pRowCacheLastTabFrm;
+extern const SwFrm     *g_pRowCacheLastCellFrm;
 
 //return the SwTabFrm (if any) that this SwTabFrm is a follow flow line for
 SwTabFrm* SwTabFrm::GetFollowFlowLineFor()
@@ -155,14 +155,14 @@ void SwTabFrm::DestroyImpl()
     // makes use of these global pointers. Obviously
     // this code did not consider that a TabFrm can be
     // deleted.
-    if ( this == pColumnCacheLastTabFrm )
-    {
-        pColumnCacheLastTable  = nullptr;
-        pColumnCacheLastTabFrm = nullptr;
-        pColumnCacheLastCellFrm= nullptr;
-        pRowCacheLastTable  = nullptr;
-        pRowCacheLastTabFrm = nullptr;
-        pRowCacheLastCellFrm= nullptr;
+    if (this == g_pColumnCacheLastTabFrm)
+    {
+        g_pColumnCacheLastTable  = nullptr;
+        g_pColumnCacheLastTabFrm = nullptr;
+        g_pColumnCacheLastCellFrm = nullptr;
+        g_pRowCacheLastTable  = nullptr;
+        g_pRowCacheLastTabFrm = nullptr;
+        g_pRowCacheLastCellFrm = nullptr;
     }
 
     SwLayoutFrm::DestroyImpl();
diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx
index 28b2d6f..36beac8 100644
--- a/sw/source/core/layout/virtoutp.cxx
+++ b/sw/source/core/layout/virtoutp.cxx
@@ -54,9 +54,9 @@ inline DbgRect::DbgRect( OutputDevice *pOutDev, const Rectangle &rRect,
 
 bool SwRootFrm::FlushVout()
 {
-    if( SwRootFrm::mpVout->IsFlushable() )
+    if (SwRootFrm::s_pVout->IsFlushable())
     {
-        SwRootFrm::mpVout->_Flush();
+        SwRootFrm::s_pVout->_Flush();
         return true;
     }
     return false;
@@ -64,8 +64,8 @@ bool SwRootFrm::FlushVout()
 
 bool SwRootFrm::HasSameRect( const SwRect& rRect )
 {
-    if( SwRootFrm::mpVout->IsFlushable() )
-        return ( rRect == SwRootFrm::mpVout->GetOrgRect() );
+    if (SwRootFrm::s_pVout->IsFlushable())
+        return ( rRect == SwRootFrm::s_pVout->GetOrgRect() );
     return false;
 }
 
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 34d2aa2..f42c0de 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -91,7 +91,7 @@ public:
     {}
 };
 
-SwQueuedPaint *SwPaintQueue::pQueue = nullptr;
+SwQueuedPaint *SwPaintQueue::s_pPaintQueue = nullptr;
 
 // saves some settings from the draw view
 class SwDrawViewSave
@@ -106,7 +106,7 @@ public:
 void SwPaintQueue::Add( SwViewShell *pNew, const SwRect &rNew )
 {
     SwQueuedPaint *pPt;
-    if ( nullptr != (pPt = pQueue) )
+    if (nullptr != (pPt = s_pPaintQueue))
     {
         while ( pPt->pSh != pNew && pPt->pNext )
             pPt = pPt->pNext;
@@ -120,14 +120,14 @@ void SwPaintQueue::Add( SwViewShell *pNew, const SwRect &rNew )
     if ( pPt )
         pPt->pNext = pNQ;
     else
-        pQueue = pNQ;
+        s_pPaintQueue = pNQ;
 }
 
 void SwPaintQueue::Repaint()
 {
-    if ( !SwRootFrm::IsInPaint() && pQueue )
+    if (!SwRootFrm::IsInPaint() && s_pPaintQueue)
     {
-        SwQueuedPaint *pPt = pQueue;
+        SwQueuedPaint *pPt = s_pPaintQueue;
         do
         {   SwViewShell *pSh = pPt->pSh;
             SET_CURR_SHELL( pSh );
@@ -146,17 +146,18 @@ void SwPaintQueue::Repaint()
         } while ( pPt );
 
         do
-        {   pPt = pQueue;
-            pQueue = pQueue->pNext;
+        {
+            pPt = s_pPaintQueue;
+            s_pPaintQueue = s_pPaintQueue->pNext;
             delete pPt;
-        } while ( pQueue );
+        } while (s_pPaintQueue);
     }
 }
 
 void SwPaintQueue::Remove( SwViewShell *pSh )
 {
     SwQueuedPaint *pPt;
-    if ( nullptr != (pPt = pQueue) )
+    if (nullptr != (pPt = s_pPaintQueue))
     {
         SwQueuedPaint *pPrev = nullptr;
         while ( pPt && pPt->pSh != pSh )
@@ -168,8 +169,8 @@ void SwPaintQueue::Remove( SwViewShell *pSh )
         {
             if ( pPrev )
                 pPrev->pNext = pPt->pNext;
-            else if ( pPt == pQueue )
-                pQueue = nullptr;
+            else if (pPt == s_pPaintQueue)
+                s_pPaintQueue = nullptr;
             delete pPt;
         }
     }
commit c6d796c3bfc969f232f7a9a92fb9be105e3bf7f1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 17:59:31 2015 +0100

    sw: rename some global variables
    
    Change-Id: I6520e47198a3da4e72fc77c6a6955afac410c7fa

diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 8e30a11..92a2d99 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -173,9 +173,9 @@ public:
     void ShowSelection();
 };
 
-static SwSpellIter* pSpellIter = nullptr;
-static SwConvIter*  pConvIter = nullptr;
-static SwHyphIter*  pHyphIter = nullptr;
+static SwSpellIter* g_pSpellIter = nullptr;
+static SwConvIter*  g_pConvIter = nullptr;
+static SwHyphIter*  g_pHyphIter = nullptr;
 
 // With that we save a GetFrm() in Hyphenate.
 // Caution: There are external declaration to these pointers in txtedt.cxx!
@@ -575,9 +575,9 @@ void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos )
 bool SwEditShell::HasLastSentenceGotGrammarChecked()
 {
     bool bTextWasGrammarChecked = false;
-    if (pSpellIter)
+    if (g_pSpellIter)
     {
-        svx::SpellPortions aLastPortions( pSpellIter->GetLastPortions() );
+        svx::SpellPortions aLastPortions( g_pSpellIter->GetLastPortions() );
         for (size_t i = 0;  i < aLastPortions.size() && !bTextWasGrammarChecked;  ++i)
         {
             // bIsGrammarError is also true if the text was only checked but no
@@ -592,12 +592,12 @@ bool SwEditShell::HasLastSentenceGotGrammarChecked()
 
 bool SwEditShell::HasConvIter()
 {
-    return nullptr != pConvIter;
+    return nullptr != g_pConvIter;
 }
 
 bool SwEditShell::HasHyphIter()
 {
-    return nullptr != pHyphIter;
+    return nullptr != g_pHyphIter;
 }
 
 void SwEditShell::SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd )
@@ -615,18 +615,18 @@ void SwEditShell::SpellStart(
     SwLinguIter *pLinguIter = nullptr;
 
     // do not spell if interactive spelling is active elsewhere
-    if (!pConvArgs && !pSpellIter)
+    if (!pConvArgs && !g_pSpellIter)
     {
-        OSL_ENSURE( !pSpellIter, "wer ist da schon am spellen?" );
-        pSpellIter = new SwSpellIter;
-        pLinguIter = pSpellIter;
+        OSL_ENSURE( !g_pSpellIter, "wer ist da schon am spellen?" );
+        g_pSpellIter = new SwSpellIter;
+        pLinguIter = g_pSpellIter;
     }
     // do not do text conversion if it is active elsewhere
-    if (pConvArgs && !pConvIter)
+    if (pConvArgs && !g_pConvIter)
     {
-        OSL_ENSURE( !pConvIter, "text conversion already active!" );
-        pConvIter = new SwConvIter( *pConvArgs );
-        pLinguIter = pConvIter;
+        OSL_ENSURE( !g_pConvIter, "text conversion already active!" );
+        g_pConvIter = new SwConvIter( *pConvArgs );
+        pLinguIter = g_pConvIter;
     }
 
     if (pLinguIter)
@@ -641,25 +641,25 @@ void SwEditShell::SpellStart(
         pLinguIter->SetCurrX( pTmp );
     }
 
-    if (!pConvArgs && pSpellIter)
-        pSpellIter->Start( this, eStart, eEnd );
-    if (pConvArgs && pConvIter)
-        pConvIter->Start( this, eStart, eEnd );
+    if (!pConvArgs && g_pSpellIter)
+        g_pSpellIter->Start( this, eStart, eEnd );
+    if (pConvArgs && g_pConvIter)
+        g_pConvIter->Start( this, eStart, eEnd );
 }
 
 void SwEditShell::SpellEnd( SwConversionArgs *pConvArgs, bool bRestoreSelection )
 {
-    if (!pConvArgs && pSpellIter && pSpellIter->GetSh() == this)
+    if (!pConvArgs && g_pSpellIter && g_pSpellIter->GetSh() == this)
     {
-        OSL_ENSURE( pSpellIter, "wo ist mein Iterator?" );
-        pSpellIter->_End(bRestoreSelection);
-        delete pSpellIter, pSpellIter = nullptr;
+        OSL_ENSURE( g_pSpellIter, "where is my Iterator?" );
+        g_pSpellIter->_End(bRestoreSelection);
+        delete g_pSpellIter, g_pSpellIter = nullptr;
     }
-    if (pConvArgs && pConvIter && pConvIter->GetSh() == this)
+    if (pConvArgs && g_pConvIter && g_pConvIter->GetSh() == this)
     {
-        OSL_ENSURE( pConvIter, "wo ist mein Iterator?" );
-        pConvIter->_End();
-        delete pConvIter, pConvIter = nullptr;
+        OSL_ENSURE( g_pConvIter, "where is my Iterator?" );
+        g_pConvIter->_End();
+        delete g_pConvIter, g_pConvIter = nullptr;
     }
 }
 
@@ -670,8 +670,8 @@ uno::Any SwEditShell::SpellContinue(
 {
     uno::Any aRes;
 
-    if ((!pConvArgs && pSpellIter->GetSh() != this) ||
-        ( pConvArgs && pConvIter->GetSh() != this))
+    if ((!pConvArgs && g_pSpellIter->GetSh() != this) ||
+        ( pConvArgs && g_pConvIter->GetSh() != this))
         return aRes;
 
     if( pPageCnt && !*pPageCnt )
@@ -683,8 +683,8 @@ uno::Any SwEditShell::SpellContinue(
             ::StartProgress( STR_STATSTR_SPELL, 0, nEndPage, GetDoc()->GetDocShell() );
     }
 
-    OSL_ENSURE(  pConvArgs || pSpellIter, "SpellIter missing" );
-    OSL_ENSURE( !pConvArgs || pConvIter,  "ConvIter missing" );
+    OSL_ENSURE(  pConvArgs || g_pSpellIter, "SpellIter missing" );
+    OSL_ENSURE( !pConvArgs || g_pConvIter,  "ConvIter missing" );
     //JP 18.07.95: prevent displaying selection on error messages. NO StartAction so that all
     //             Paints are also disabled.
     ++mnStartAction;
@@ -692,12 +692,12 @@ uno::Any SwEditShell::SpellContinue(
     uno::Reference< uno::XInterface >  xRet;
     if (pConvArgs)
     {
-        pConvIter->Continue( pPageCnt, pPageSt ) >>= aRet;
+        g_pConvIter->Continue( pPageCnt, pPageSt ) >>= aRet;
         aRes <<= aRet;
     }
     else
     {
-        pSpellIter->Continue( pPageCnt, pPageSt ) >>= xRet;
+        g_pSpellIter->Continue( pPageCnt, pPageSt ) >>= xRet;
         aRes <<= xRet;
     }
     --mnStartAction;
@@ -736,23 +736,23 @@ uno::Any SwEditShell::SpellContinue(
  */
 void SwEditShell::HyphStart( SwDocPositions eStart, SwDocPositions eEnd )
 {
-    // do not hyphenate if interactive hyphenationg is active elsewhere
-    if (!pHyphIter)
+    // do not hyphenate if interactive hyphenation is active elsewhere
+    if (!g_pHyphIter)
     {
-        OSL_ENSURE( !pHyphIter, "wer ist da schon am hyphinieren?" );
-        pHyphIter = new SwHyphIter;
-        pHyphIter->Start( this, eStart, eEnd );
+        OSL_ENSURE( !g_pHyphIter, "who is already hyphenating?" );
+        g_pHyphIter = new SwHyphIter;
+        g_pHyphIter->Start( this, eStart, eEnd );
     }
 }
 
 /// restore selections
 void SwEditShell::HyphEnd()
 {
-    if (pHyphIter->GetSh() == this)
+    if (g_pHyphIter->GetSh() == this)
     {
-        OSL_ENSURE( pHyphIter, "No Iterator" );
-        pHyphIter->End();
-        delete pHyphIter, pHyphIter = nullptr;
+        OSL_ENSURE( g_pHyphIter, "No Iterator" );
+        g_pHyphIter->End();
+        delete g_pHyphIter, g_pHyphIter = nullptr;
     }
 }
 
@@ -760,7 +760,7 @@ void SwEditShell::HyphEnd()
 uno::Reference< uno::XInterface >
     SwEditShell::HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt )
 {
-    if (pHyphIter->GetSh() != this)
+    if (g_pHyphIter->GetSh() != this)
         return nullptr;
 
     if( pPageCnt && !*pPageCnt && !*pPageSt )
@@ -776,16 +776,16 @@ uno::Reference< uno::XInterface >
             *pPageSt = 1;
     }
 
-    OSL_ENSURE( pHyphIter, "No Iterator" );
+    OSL_ENSURE( g_pHyphIter, "No Iterator" );
     //JP 18.07.95: prevent displaying selection on error messages. NO StartAction so that all
     //             Paints are also disabled.
     ++mnStartAction;
     uno::Reference< uno::XInterface >  xRet;
-    pHyphIter->Continue( pPageCnt, pPageSt ) >>= xRet;
+    g_pHyphIter->Continue( pPageCnt, pPageSt ) >>= xRet;
     --mnStartAction;
 
     if( xRet.is() )
-        pHyphIter->ShowSelection();
+        g_pHyphIter->ShowSelection();
 
     return xRet;
 }
@@ -796,21 +796,21 @@ uno::Reference< uno::XInterface >
  */
 void SwEditShell::InsertSoftHyph( const sal_Int32 nHyphPos )
 {
-    OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" );
-    pHyphIter->InsertSoftHyph( nHyphPos );
+    OSL_ENSURE( g_pHyphIter, "where is my Iterator?" );
+    g_pHyphIter->InsertSoftHyph( nHyphPos );
 }
 
 /// ignore hyphenation
 void SwEditShell::HyphIgnore()
 {
-    OSL_ENSURE( pHyphIter, "No Iterator" );
+    OSL_ENSURE( g_pHyphIter, "No Iterator" );
     //JP 18.07.95: prevent displaying selection on error messages. NO StartAction so that all
     //             Paints are also disabled.
     ++mnStartAction;
-    pHyphIter->Ignore();
+    g_pHyphIter->Ignore();
     --mnStartAction;
 
-    pHyphIter->ShowSelection();
+    g_pHyphIter->ShowSelection();
 }
 
 /** Get a list of potential corrections for misspelled word.
@@ -1055,10 +1055,10 @@ bool SwEditShell::GetGrammarCorrection(
 
 bool SwEditShell::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCheck)
 {
-    OSL_ENSURE(  pSpellIter, "SpellIter missing" );
-    if(!pSpellIter)
+    OSL_ENSURE(  g_pSpellIter, "SpellIter missing" );
+    if (!g_pSpellIter)
         return false;
-    bool bRet = pSpellIter->SpellSentence(rPortions, bIsGrammarCheck);
+    bool bRet = g_pSpellIter->SpellSentence(rPortions, bIsGrammarCheck);
 
     // make Selection visible - this should simply move the
     // cursor to the end of the sentence
@@ -1070,10 +1070,10 @@ bool SwEditShell::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh
 ///make SpellIter start with the current sentence when called next time
 void SwEditShell::PutSpellingToSentenceStart()
 {
-    OSL_ENSURE(  pSpellIter, "SpellIter missing" );
-    if(!pSpellIter)
+    OSL_ENSURE(  g_pSpellIter, "SpellIter missing" );
+    if (!g_pSpellIter)
         return;
-    pSpellIter->ToSentenceStart();
+    g_pSpellIter->ToSentenceStart();
 }
 
 static sal_uInt32 lcl_CountRedlines(const svx::SpellPortions& rLastPortions)
@@ -1092,10 +1092,10 @@ void SwEditShell::MoveContinuationPosToEndOfCheckedSentence()
 {
     // give hint that continuation position for spell/grammar checking is
     // at the end of this sentence
-    if (pSpellIter)
+    if (g_pSpellIter)
     {
-        pSpellIter->SetCurr( new SwPosition( *pSpellIter->GetCurrX() ) );
-        pSpellIter->ContinueAfterThisSentence();
+        g_pSpellIter->SetCurr( new SwPosition( *g_pSpellIter->GetCurrX() ) );
+        g_pSpellIter->ContinueAfterThisSentence();
     }
 }
 
@@ -1104,12 +1104,12 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b
     // Note: rNewPortions.size() == 0 is valid and happens when the whole
     // sentence got removed in the dialog
 
-    OSL_ENSURE(  pSpellIter, "SpellIter missing" );
-    if(pSpellIter &&
-       pSpellIter->GetLastPortions().size() > 0)    // no portions -> no text to be changed
+    OSL_ENSURE(  g_pSpellIter, "SpellIter missing" );
+    if (g_pSpellIter &&
+        g_pSpellIter->GetLastPortions().size() > 0) // no portions -> no text to be changed
     {
-        const SpellPortions& rLastPortions = pSpellIter->GetLastPortions();
-        const SpellContentPositions  rLastPositions = pSpellIter->GetLastPositions();
+        const SpellPortions& rLastPortions = g_pSpellIter->GetLastPortions();
+        const SpellContentPositions  rLastPositions = g_pSpellIter->GetLastPositions();
         OSL_ENSURE(rLastPortions.size() > 0 &&
                 rLastPortions.size() == rLastPositions.size(),
                 "last vectors of spelling results are not set or not equal");
@@ -1245,7 +1245,7 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b
             GoStartSentence();
         }
         // set continuation position for spell/grammar checking to the end of this sentence
-        pSpellIter->SetCurr( new SwPosition( *pCrsr->Start() ) );
+        g_pSpellIter->SetCurr( new SwPosition(*pCrsr->Start()) );
 
         mpDoc->GetIDocumentUndoRedo().EndUndo( UNDO_UI_TEXT_CORRECTION, nullptr );
         EndAction();
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index ecf536e..ce71823 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -136,7 +136,7 @@ public:
         }
 };
 
-static SwCrsrOszControl aOszCtrl = { nullptr, nullptr, nullptr };
+static SwCrsrOszControl g_OszCtrl = { nullptr, nullptr, nullptr };
 
 /** Searches the ContentFrm owning the PrtArea containing the point. */
 bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
@@ -534,7 +534,7 @@ bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
                             SwCrsrMoveState* pCMS, bool ) const
 {
     vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut();
-    aOszCtrl.Entry( this );
+    g_OszCtrl.Entry( this );
 
     //If the Points lies inside the Fly, we try hard to set the Crsr inside it.
     //However if the Point sits inside a Fly which is completely located inside
@@ -561,7 +561,7 @@ bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
             if ( pFly && pFly->Frm().IsInside( rPoint ) &&
                  Frm().IsInside( pFly->Frm() ) )
             {
-                if ( aOszCtrl.ChkOsz( pFly ) )
+                if (g_OszCtrl.ChkOsz(pFly))
                     break;
                 bRet = pFly->GetCrsrOfst( pPos, rPoint, pCMS );
                 if ( bRet )
@@ -602,7 +602,7 @@ bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
             bRet = true;
         }
     }
-    aOszCtrl.Exit( this );
+    g_OszCtrl.Exit( this );
     return bRet;
 }
 
commit ccde2360d5c29bb99008cfae5ab3675bee4ca46c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 17:15:08 2015 +0100

    sc: let's make ScFormulaDlg::pDoc and aCursorPos ordinary members
    
    <erAck> mst__: I see no immediately compelling reason why that shouldn't
    be a member variable
    
    Change-Id: I307259337cb068c5c7e397a1f57cf8e7c92b0e12

diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index d303bcf..7e8262e 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -58,9 +58,6 @@
 using namespace formula;
 using namespace com::sun::star;
 
-ScDocument* ScFormulaDlg::s_pDoc = nullptr;
-ScAddress ScFormulaDlg::aCursorPos;
-
 //      init/ shared functions for dialog
 
 ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
@@ -91,13 +88,13 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
         }
     }
 
-    if (s_pDoc == nullptr)
-        s_pDoc = pViewData->GetDocument();
-    m_xParser.set(ScServiceProvider::MakeInstance(SC_SERVICE_FORMULAPARS, static_cast<ScDocShell*>(s_pDoc->GetDocumentShell())),uno::UNO_QUERY);
+    if (m_pDoc == nullptr)
+        m_pDoc = pViewData->GetDocument();
+    m_xParser.set(ScServiceProvider::MakeInstance(SC_SERVICE_FORMULAPARS, static_cast<ScDocShell*>(m_pDoc->GetDocumentShell())),uno::UNO_QUERY);
     uno::Reference< beans::XPropertySet> xSet(m_xParser,uno::UNO_QUERY);
     xSet->setPropertyValue(SC_UNO_COMPILEFAP, uno::makeAny(sal_True));
 
-    m_xOpCodeMapper.set(ScServiceProvider::MakeInstance(SC_SERVICE_OPCODEMAPPER, static_cast<ScDocShell*>(s_pDoc->GetDocumentShell())),uno::UNO_QUERY);
+    m_xOpCodeMapper.set(ScServiceProvider::MakeInstance(SC_SERVICE_OPCODEMAPPER, static_cast<ScDocShell*>(m_pDoc->GetDocumentShell())),uno::UNO_QUERY);
 
     ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(pScViewShell);
 
@@ -119,11 +116,11 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
     {
         pScMod->SetRefInputHdl(pScMod->GetInputHdl());
 
-        s_pDoc = pViewData->GetDocument();
+        m_pDoc = pViewData->GetDocument();
         SCCOL nCol = pViewData->GetCurX();
         SCROW nRow = pViewData->GetCurY();
         SCTAB nTab = pViewData->GetTabNo();
-        aCursorPos = ScAddress( nCol, nRow, nTab );
+        m_CursorPos = ScAddress( nCol, nRow, nTab );
 
         pScMod->InitFormEditData();                             // create new
         pData = pScMod->GetFormEditData();
@@ -137,7 +134,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
         // edit if formula exists
 
         OUString aFormula;
-        s_pDoc->GetFormula( nCol, nRow, nTab, aFormula );
+        m_pDoc->GetFormula( nCol, nRow, nTab, aFormula );
         bool bEdit   = ( aFormula.getLength() > 1 );
         bool bMatrix = false;
         if ( bEdit )
@@ -201,7 +198,7 @@ void ScFormulaDlg::fill()
     if (pData)
     {
         //  data exists -> restore state (after switch)
-        //  don't reinitialise pDoc and aCursorPos
+        //  don't reinitialise m_pDoc and m_CursorPos
         //pDoc = pViewData->GetDocument();
         if(IsInputHdl(pData->GetInputHandler()))
         {
@@ -307,7 +304,7 @@ bool ScFormulaDlg::Close()
 
 bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult )
 {
-    std::unique_ptr<ScSimpleFormulaCalculator> pFCell(new ScSimpleFormulaCalculator(s_pDoc, aCursorPos, rStrExp));
+    std::unique_ptr<ScSimpleFormulaCalculator> pFCell(new ScSimpleFormulaCalculator(m_pDoc, m_CursorPos, rStrExp));
     pFCell->SetLimitString(true);
 
     // HACK! to avoid neither #REF! from ColRowNames
@@ -324,7 +321,7 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult
             aBraced.append('(');
             aBraced.append(rStrExp);
             aBraced.append(')');
-            pFCell.reset(new ScSimpleFormulaCalculator(s_pDoc, aCursorPos, aBraced.makeStringAndClear()));
+            pFCell.reset(new ScSimpleFormulaCalculator(m_pDoc, m_CursorPos, aBraced.makeStringAndClear()));
             pFCell->SetLimitString(true);
         }
         else
@@ -334,7 +331,7 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult
     sal_uInt16 nErrCode = pFCell->GetErrCode();
     if ( nErrCode == 0 || pFCell->IsMatrix() )
     {
-        SvNumberFormatter& aFormatter = *(s_pDoc->GetFormatTable());
+        SvNumberFormatter& aFormatter = *(m_pDoc->GetFormatTable());
         Color* pColor;
         if ( pFCell->IsValue() )
         {
@@ -392,7 +389,7 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
         }
 
         OUString      aRefStr;
-        bool bOtherDoc = (pRefDoc != s_pDoc && pRefDoc->GetDocumentShell()->HasName());
+        bool bOtherDoc = (pRefDoc != m_pDoc && pRefDoc->GetDocumentShell()->HasName());
         if ( bOtherDoc )
         {
             //  reference to other document - wie inputhdl.cxx
@@ -419,16 +416,16 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
             // position.
             ScTokenArray aArray;
             ScComplexRefData aRefData;
-            aRefData.InitRangeRel(rRef, aCursorPos);
+            aRefData.InitRangeRel(rRef, m_CursorPos);
             bool bSingle = aRefData.Ref1 == aRefData.Ref2;
-            if (aCursorPos.Tab() != rRef.aStart.Tab())
+            if (m_CursorPos.Tab() != rRef.aStart.Tab())
                 aRefData.Ref1.SetFlag3D(true);
             if (bSingle)
                 aArray.AddSingleReference(aRefData.Ref1);
             else
                 aArray.AddDoubleReference(aRefData);
-            ScCompiler aComp(s_pDoc, aCursorPos, aArray);
-            aComp.SetGrammar(s_pDoc->GetGrammar());
+            ScCompiler aComp(m_pDoc, m_CursorPos, aArray);
+            aComp.SetGrammar(m_pDoc->GetGrammar());
             OUStringBuffer aBuf;
             aComp.CreateStringFromTokenArray(aBuf);
             aRefStr = aBuf.makeStringAndClear();
@@ -441,7 +438,7 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
 bool ScFormulaDlg::IsRefInputMode() const
 {
     const IFunctionDescription* pDesc = getCurrentFunctionDescription();
-    bool bRef = (pDesc && (pDesc->getSuppressedArgumentCount() > 0)) && (s_pDoc != nullptr);
+    bool bRef = (pDesc && (pDesc->getSuppressedArgumentCount() > 0)) && (m_pDoc != nullptr);
     return bRef;
 }
 
@@ -449,7 +446,7 @@ bool ScFormulaDlg::IsDocAllowed(SfxObjectShell* pDocSh) const
 {
     //  not allowed: different from this doc, and no name
     //  pDocSh is always a ScDocShell
-    if ( pDocSh && &static_cast<ScDocShell*>(pDocSh)->GetDocument() != s_pDoc && !pDocSh->HasName() )
+    if (pDocSh && &static_cast<ScDocShell*>(pDocSh)->GetDocument() != m_pDoc && !pDocSh->HasName())
         return false;
 
     return true;        // everything else is allowed
@@ -552,7 +549,7 @@ void ScFormulaDlg::deleteFormData()
 }
 void ScFormulaDlg::clear()
 {
-    s_pDoc = nullptr;
+    m_pDoc = nullptr;
 
     //restore reference inputhandler
     ScModule* pScMod = SC_MOD();
@@ -580,12 +577,12 @@ void ScFormulaDlg::switchBack()
     if ( pScViewShell )
     {
         ScViewData& rVD=pScViewShell->GetViewData();
-        SCTAB nExecTab = aCursorPos.Tab();
+        SCTAB nExecTab = m_CursorPos.Tab();
         if ( nExecTab != rVD.GetTabNo() )
             pScViewShell->SetTabNo( nExecTab );
 
-        SCROW nRow=aCursorPos.Row();
-        SCCOL nCol=aCursorPos.Col();
+        SCROW nRow = m_CursorPos.Row();
+        SCCOL nCol = m_CursorPos.Col();
 
         if(rVD.GetCurX()!=nCol || rVD.GetCurY()!=nRow)
             pScViewShell->SetCursor(nCol,nRow);
@@ -648,13 +645,13 @@ uno::Reference< sheet::XFormulaOpCodeMapper> ScFormulaDlg::getFormulaOpCodeMappe
 
 table::CellAddress ScFormulaDlg::getReferencePosition() const
 {
-    return table::CellAddress(aCursorPos.Tab(),aCursorPos.Col(),aCursorPos.Row());
+    return table::CellAddress(m_CursorPos.Tab(), m_CursorPos.Col(), m_CursorPos.Row());
 }
 
 ::std::unique_ptr<formula::FormulaTokenArray> ScFormulaDlg::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
 {
     ::std::unique_ptr<formula::FormulaTokenArray> pArray(new ScTokenArray());
-    pArray->Fill(_aTokenList, s_pDoc->GetSharedStringPool(), s_pDoc->GetExternalRefManager());
+    pArray->Fill(_aTokenList, m_pDoc->GetSharedStringPool(), m_pDoc->GetExternalRefManager());
     return pArray;
 }
 
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index 5eb6a65..3ebdb61 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -47,8 +47,9 @@ class ScFormulaDlg : public formula::FormulaDlg,
     css::uno::Reference< css::sheet::XFormulaParser>          m_xParser;
     css::uno::Reference< css::sheet::XFormulaOpCodeMapper>    m_xOpCodeMapper;
 
-    static ScDocument*  s_pDoc;
-    static ScAddress    aCursorPos;
+    ScDocument*  m_pDoc;
+    ScAddress    m_CursorPos;
+
 public:
                     ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
                         vcl::Window* pParent, ScViewData* pViewData ,formula::IFunctionManager* _pFunctionMgr);
commit e3a8d361f71cad0b8a0344f9525b62119fdf1004
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 16:56:10 2015 +0100

    sc: rename static member ScFormulaDlg::pDoc
    
    Change-Id: I6dc352bf0bcfef18b39926986929d0ba96d2f3cc

diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 5e1c7e2..d303bcf 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -58,7 +58,7 @@
 using namespace formula;
 using namespace com::sun::star;
 
-ScDocument* ScFormulaDlg::pDoc = nullptr;
+ScDocument* ScFormulaDlg::s_pDoc = nullptr;
 ScAddress ScFormulaDlg::aCursorPos;
 
 //      init/ shared functions for dialog
@@ -91,13 +91,13 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
         }
     }
 
-    if ( pDoc == nullptr )
-        pDoc = pViewData->GetDocument();
-    m_xParser.set(ScServiceProvider::MakeInstance(SC_SERVICE_FORMULAPARS, static_cast<ScDocShell*>(pDoc->GetDocumentShell())),uno::UNO_QUERY);
+    if (s_pDoc == nullptr)
+        s_pDoc = pViewData->GetDocument();
+    m_xParser.set(ScServiceProvider::MakeInstance(SC_SERVICE_FORMULAPARS, static_cast<ScDocShell*>(s_pDoc->GetDocumentShell())),uno::UNO_QUERY);
     uno::Reference< beans::XPropertySet> xSet(m_xParser,uno::UNO_QUERY);
     xSet->setPropertyValue(SC_UNO_COMPILEFAP, uno::makeAny(sal_True));
 
-    m_xOpCodeMapper.set(ScServiceProvider::MakeInstance(SC_SERVICE_OPCODEMAPPER, static_cast<ScDocShell*>(pDoc->GetDocumentShell())),uno::UNO_QUERY);
+    m_xOpCodeMapper.set(ScServiceProvider::MakeInstance(SC_SERVICE_OPCODEMAPPER, static_cast<ScDocShell*>(s_pDoc->GetDocumentShell())),uno::UNO_QUERY);
 
     ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(pScViewShell);
 
@@ -119,7 +119,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
     {
         pScMod->SetRefInputHdl(pScMod->GetInputHdl());
 
-        pDoc = pViewData->GetDocument();
+        s_pDoc = pViewData->GetDocument();
         SCCOL nCol = pViewData->GetCurX();
         SCROW nRow = pViewData->GetCurY();
         SCTAB nTab = pViewData->GetTabNo();
@@ -137,7 +137,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
         // edit if formula exists
 
         OUString aFormula;
-        pDoc->GetFormula( nCol, nRow, nTab, aFormula );
+        s_pDoc->GetFormula( nCol, nRow, nTab, aFormula );
         bool bEdit   = ( aFormula.getLength() > 1 );
         bool bMatrix = false;
         if ( bEdit )
@@ -307,7 +307,7 @@ bool ScFormulaDlg::Close()
 
 bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult )
 {
-    std::unique_ptr<ScSimpleFormulaCalculator> pFCell( new ScSimpleFormulaCalculator( pDoc, aCursorPos, rStrExp ) );
+    std::unique_ptr<ScSimpleFormulaCalculator> pFCell(new ScSimpleFormulaCalculator(s_pDoc, aCursorPos, rStrExp));
     pFCell->SetLimitString(true);
 
     // HACK! to avoid neither #REF! from ColRowNames
@@ -324,7 +324,7 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult
             aBraced.append('(');
             aBraced.append(rStrExp);
             aBraced.append(')');
-            pFCell.reset( new ScSimpleFormulaCalculator( pDoc, aCursorPos, aBraced.makeStringAndClear() ) );
+            pFCell.reset(new ScSimpleFormulaCalculator(s_pDoc, aCursorPos, aBraced.makeStringAndClear()));
             pFCell->SetLimitString(true);
         }
         else
@@ -334,7 +334,7 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult
     sal_uInt16 nErrCode = pFCell->GetErrCode();
     if ( nErrCode == 0 || pFCell->IsMatrix() )
     {
-        SvNumberFormatter& aFormatter = *(pDoc->GetFormatTable());
+        SvNumberFormatter& aFormatter = *(s_pDoc->GetFormatTable());
         Color* pColor;
         if ( pFCell->IsValue() )
         {
@@ -392,7 +392,7 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
         }
 
         OUString      aRefStr;
-        bool bOtherDoc = ( pRefDoc != pDoc && pRefDoc->GetDocumentShell()->HasName() );
+        bool bOtherDoc = (pRefDoc != s_pDoc && pRefDoc->GetDocumentShell()->HasName());
         if ( bOtherDoc )
         {
             //  reference to other document - wie inputhdl.cxx
@@ -427,8 +427,8 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
                 aArray.AddSingleReference(aRefData.Ref1);
             else
                 aArray.AddDoubleReference(aRefData);
-            ScCompiler aComp(pDoc, aCursorPos, aArray);
-            aComp.SetGrammar(pDoc->GetGrammar());
+            ScCompiler aComp(s_pDoc, aCursorPos, aArray);
+            aComp.SetGrammar(s_pDoc->GetGrammar());
             OUStringBuffer aBuf;
             aComp.CreateStringFromTokenArray(aBuf);
             aRefStr = aBuf.makeStringAndClear();
@@ -441,7 +441,7 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
 bool ScFormulaDlg::IsRefInputMode() const
 {
     const IFunctionDescription* pDesc = getCurrentFunctionDescription();
-    bool bRef = (pDesc && (pDesc->getSuppressedArgumentCount() > 0)) && (pDoc!=nullptr);
+    bool bRef = (pDesc && (pDesc->getSuppressedArgumentCount() > 0)) && (s_pDoc != nullptr);
     return bRef;
 }
 
@@ -449,7 +449,7 @@ bool ScFormulaDlg::IsDocAllowed(SfxObjectShell* pDocSh) const
 {
     //  not allowed: different from this doc, and no name
     //  pDocSh is always a ScDocShell
-    if ( pDocSh && &static_cast<ScDocShell*>(pDocSh)->GetDocument() != pDoc && !pDocSh->HasName() )
+    if ( pDocSh && &static_cast<ScDocShell*>(pDocSh)->GetDocument() != s_pDoc && !pDocSh->HasName() )
         return false;
 
     return true;        // everything else is allowed
@@ -552,7 +552,7 @@ void ScFormulaDlg::deleteFormData()
 }
 void ScFormulaDlg::clear()
 {
-    pDoc = nullptr;
+    s_pDoc = nullptr;
 
     //restore reference inputhandler
     ScModule* pScMod = SC_MOD();
@@ -654,7 +654,7 @@ table::CellAddress ScFormulaDlg::getReferencePosition() const
 ::std::unique_ptr<formula::FormulaTokenArray> ScFormulaDlg::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
 {
     ::std::unique_ptr<formula::FormulaTokenArray> pArray(new ScTokenArray());
-    pArray->Fill(_aTokenList, pDoc->GetSharedStringPool(), pDoc->GetExternalRefManager());
+    pArray->Fill(_aTokenList, s_pDoc->GetSharedStringPool(), s_pDoc->GetExternalRefManager());
     return pArray;
 }
 
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index 7efa759..5eb6a65 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -47,7 +47,7 @@ class ScFormulaDlg : public formula::FormulaDlg,
     css::uno::Reference< css::sheet::XFormulaParser>          m_xParser;
     css::uno::Reference< css::sheet::XFormulaOpCodeMapper>    m_xOpCodeMapper;
 
-    static ScDocument*  pDoc;
+    static ScDocument*  s_pDoc;
     static ScAddress    aCursorPos;
 public:
                     ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
commit 7397dbb9b9b08fc0187889b1346fb6c7c8fc0f17
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 16:52:20 2015 +0100

    svx: rename static variable
    
    Change-Id: I98246395bb0de7444864ce35d1cbdd4711b5bfeb

diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 4f5d371..eb847b8 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -182,18 +182,18 @@ Gallery::~Gallery()
 
 Gallery* Gallery::GetGalleryInstance()
 {
-    static Gallery* pGallery = nullptr;
+    static Gallery* s_pGallery = nullptr;
 
-    if( !pGallery )
+    if (!s_pGallery)
     {
         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
-        if( !pGallery )
+        if (!s_pGallery)
         {
-            pGallery = new Gallery( SvtPathOptions().GetGalleryPath() );
+            s_pGallery = new Gallery( SvtPathOptions().GetGalleryPath() );
         }
     }
 
-    return pGallery;
+    return s_pGallery;
 }
 
 void Gallery::ImplLoad( const OUString& rMultiPath )
commit e0cdf0c53bfddea0ced075cc0ada10ef638c1795
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 16:49:57 2015 +0100

    svx: remove unused typedef
    
    Change-Id: I3d892ba544e1c3e569e3c1968e034836dde5b555

diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx
index 14589b5..9217d18 100644
--- a/include/svx/xtable.hxx
+++ b/include/svx/xtable.hxx
@@ -171,7 +171,6 @@ class SVX_DLLPUBLIC XPropertyList : public cppu::OWeakObject
     SAL_DLLPRIVATE void operator delete(void *);
 protected:
     typedef ::std::vector< XPropertyEntry* > XPropertyEntryList_impl;
-    typedef ::std::vector< Bitmap* > BitmapList_impl;
 
     XPropertyListType   meType;
     OUString            maName; // not persistent
commit c60ee62c2de57a6fca7d731062ca7c4146377fa1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 13:12:13 2015 +0100

    sfx2: rename static variable SfxApplication::pApp etc.
    
    Change-Id: I69bb8ab014864ad77448785dfcd291d7c51a0cef

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 0d9e8e3..d00aa95 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -115,8 +115,6 @@ class SfxObjectShellLock;
 
 class SFX2_DLLPUBLIC SfxApplication: public SfxShell
 {
-    SAL_DLLPRIVATE static SfxApplication* pApp;
-
     SfxAppData_Impl*            pAppData_Impl;
 
     DECL_DLLPRIVATE_LINK_TYPED( GlobalBasicErrorHdl_Impl, StarBASIC*, bool );
@@ -135,7 +133,7 @@ public:
                                 SfxApplication();
                                 virtual ~SfxApplication();
     static SfxApplication*      GetOrCreate();
-    static SfxApplication*      Get() { return pApp;}
+    static SfxApplication*      Get();
 
     // Resource Manager
     static ResMgr*              GetSfxResManager();
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index ee91a5c..aaba69d 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -121,8 +121,8 @@
 
 using namespace ::com::sun::star;
 
-// Static member
-SfxApplication* SfxApplication::pApp = nullptr;
+static SfxApplication* g_pSfxApplication = nullptr;
+
 #if HAVE_FEATURE_SCRIPTING
 static BasicDLL*       pBasic   = nullptr;
 #endif
@@ -142,20 +142,25 @@ namespace
 #include <sfx2/imagemgr.hxx>
 #include "fwkhelper.hxx"
 
+SfxApplication* SfxApplication::Get()
+{
+    return g_pSfxApplication;
+}
+
 SfxApplication* SfxApplication::GetOrCreate()
 {
     // SFX on demand
     ::osl::MutexGuard aGuard(theApplicationMutex::get());
-    if (!pApp)
+    if (!g_pSfxApplication)
     {
         SAL_INFO( "sfx.appl", "SfxApplication::SetApp" );
 
-        pApp = new SfxApplication;
+        g_pSfxApplication = new SfxApplication;
 
         // at the moment a bug may occur when Initialize_Impl returns FALSE,
         // but this is only temporary because all code that may cause such
         // a fault will be moved outside the SFX
-        pApp->Initialize_Impl();
+        g_pSfxApplication->Initialize_Impl();
 
         ::framework::SetImageProducer( GetImage );
         ::framework::SetRefreshToolbars( RefreshToolbars );
@@ -176,7 +181,7 @@ SfxApplication* SfxApplication::GetOrCreate()
             Help::DisableBalloonHelp();
 #endif
     }
-    return pApp;
+    return g_pSfxApplication;
 }
 
 SfxApplication::SfxApplication()
@@ -243,7 +248,7 @@ SfxApplication::~SfxApplication()
 #endif
 
     delete pAppData_Impl;
-    pApp = nullptr;
+    g_pSfxApplication = nullptr;
 }
 
 
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index 71ee473..7fef3f9 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -58,8 +58,8 @@ bool getBool(utl::OConfigurationNode const & aNode, const char* pNodeName)
 
 ResourceManager& ResourceManager::Instance()
 {
-    static ResourceManager maInstance;
-    return maInstance;
+    static ResourceManager s_SidebarResourceManagerInstance;
+    return s_SidebarResourceManagerInstance;
 }
 
 ResourceManager::ResourceManager()
commit c4787618a1edb57c371215ce2b88eae3cc84f9f6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 12:53:44 2015 +0100

    svtools: make this condition readable
    
    Change-Id: I3dfa3f5933010adb4c9277aac441a8c8a7c9c4b6

diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index b575ecf..540f5b0 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1314,9 +1314,9 @@ nAction
     EnableSelectionAsDropTarget();
 
 #ifndef UNX
-    if ((nAction == DND_ACTION_MOVE) && ((g_pDDTarget &&
-        ((g_pDDTarget->GetModel()) != (this->GetModel()))) ||
-        !g_pDDTarget))
+    if (   (nAction == DND_ACTION_MOVE)
+        && (   (g_pDDTarget && (g_pDDTarget->GetModel() != this->GetModel()))
+            || !g_pDDTarget))
     {
         RemoveSelection();
     }
commit 457a744e27948a08cba387270fb835d785b1422c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 12:50:49 2015 +0100

    svtools: remove pointless sal_uLong cast
    
    Change-Id: Icb37c70535fec579effddf39f2e60e4418c9d98e

diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 1db200b..b575ecf 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1314,8 +1314,8 @@ nAction
     EnableSelectionAsDropTarget();
 
 #ifndef UNX
-    if ((nAction == DND_ACTION_MOVE) && ( (g_pDDTarget &&
-        ((sal_uLong)(g_pDDTarget->GetModel())!=(sal_uLong)(this->GetModel()))) ||
+    if ((nAction == DND_ACTION_MOVE) && ((g_pDDTarget &&
+        ((g_pDDTarget->GetModel()) != (this->GetModel()))) ||
         !g_pDDTarget))
     {
         RemoveSelection();
commit ddd7259e6ac97a7a2840762060639a39f76a156c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 12:40:54 2015 +0100

    svtools: rename global variables
    
    Change-Id: I3745d31135062778ce5ec618f1d491fb21a540f6

diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 8301c17..1c50788 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -223,14 +223,14 @@ void SvLBoxString::InitViewData(
     long nTextWidth;
     if (pView->GetEntryCount() > 100)
     {
-        static SvTreeListBox *pPreviousView = nullptr;
-        static float fApproximateCharWidth = 0.0;
-        if (pPreviousView != pView)
+        static SvTreeListBox *s_pPreviousView = nullptr;
+        static float s_fApproximateCharWidth = 0.0;
+        if (s_pPreviousView != pView)
         {
-            pPreviousView = pView;
-            fApproximateCharWidth = pView->approximate_char_width();
+            s_pPreviousView = pView;
+            s_fApproximateCharWidth = pView->approximate_char_width();
         }
-        nTextWidth = maText.getLength() * fApproximateCharWidth;
+        nTextWidth = maText.getLength() * s_fApproximateCharWidth;
     }
     else
         nTextWidth = pView->GetTextWidth(maText);
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index b3fcfa1..1db200b 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -48,8 +48,8 @@
 using namespace css::accessibility;
 
 // Drag&Drop
-static VclPtr<SvTreeListBox> pDDSource;
-static VclPtr<SvTreeListBox> pDDTarget;
+static VclPtr<SvTreeListBox> g_pDDSource;
+static VclPtr<SvTreeListBox> g_pDDTarget;
 
 #define SVLBOX_ACC_RETURN 1
 #define SVLBOX_ACC_ESCAPE 2
@@ -758,7 +758,7 @@ void SvTreeListBox::RemoveSelection()
 
 SvTreeListBox* SvTreeListBox::GetSourceView()
 {
-    return pDDSource;
+    return g_pDDSource;
 }
 
 void SvTreeListBox::RecalcViewData()
@@ -1158,7 +1158,7 @@ sal_Int8 SvTreeListBox::AcceptDrop( const AcceptDropEvent& rEvt )
 {
     sal_Int8 nRet = DND_ACTION_NONE;
 
-    if( rEvt.mbLeaving || !CheckDragAndDropMode( pDDSource, rEvt.mnAction ) )
+    if (rEvt.mbLeaving || !CheckDragAndDropMode(g_pDDSource, rEvt.mnAction))
     {
         ImplShowTargetEmphasis( pTargetEntry, false );
     }
@@ -1175,10 +1175,10 @@ sal_Int8 SvTreeListBox::AcceptDrop( const AcceptDropEvent& rEvt )
         }
         else
         {
-            DBG_ASSERT( pDDSource, "SvTreeListBox::QueryDrop(): SourceBox == 0" );
-            if( !( pEntry && pDDSource->GetModel() == this->GetModel()
+            DBG_ASSERT(g_pDDSource, "SvTreeListBox::QueryDrop(): SourceBox == 0");
+            if (!( pEntry && g_pDDSource->GetModel() == this->GetModel()
                     && DND_ACTION_MOVE == rEvt.mnAction
-                    && ( pEntry->nEntryFlags & SvTLEntryFlags::DISABLE_DROP ) ))
+                    && (pEntry->nEntryFlags & SvTLEntryFlags::DISABLE_DROP)))
             {
                 if( NotifyAcceptDrop( pEntry ))
                     nRet = rEvt.mnAction;
@@ -1204,7 +1204,7 @@ sal_Int8 SvTreeListBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox
     pSourceView->EnableSelectionAsDropTarget();
 
     ImplShowTargetEmphasis( pTargetEntry, false );
-    pDDTarget = this;
+    g_pDDTarget = this;
 
     TransferableDataHelper aData( rEvt.maDropEvent.Transferable );
 
@@ -1222,17 +1222,17 @@ sal_Int8 SvTreeListBox::ExecuteDrop( const ExecuteDropEvent& rEvt, SvTreeListBox
 
         if( DND_ACTION_COPY == rEvt.mnAction )
         {
-            if ( CopySelection( pDDSource, pTarget ) )
+            if (CopySelection(g_pDDSource, pTarget))
                 nRet = rEvt.mnAction;
         }
         else if( DND_ACTION_MOVE == rEvt.mnAction )
         {
-            if ( MoveSelection( pDDSource, pTarget ) )
+            if (MoveSelection(g_pDDSource, pTarget))
                 nRet = rEvt.mnAction;
         }
         else if( DND_ACTION_COPYMOVE == rEvt.mnAction )
         {
-            if ( MoveSelectionCopyFallbackPossible( pDDSource, pTarget, true ) )
+            if (MoveSelectionCopyFallbackPossible(g_pDDSource, pTarget, true))
                 nRet = rEvt.mnAction;
         }
     }
@@ -1250,8 +1250,8 @@ sal_Int8 SvTreeListBox::ExecuteDrop( const ExecuteDropEvent& rEvt )
  */
 void SvTreeListBox::SetupDragOrigin()
 {
-    pDDSource = this;
-    pDDTarget = nullptr;
+    g_pDDSource = this;
+    g_pDDTarget = nullptr;
 }
 
 void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel )
@@ -1314,17 +1314,17 @@ nAction
     EnableSelectionAsDropTarget();
 
 #ifndef UNX
-    if( (nAction == DND_ACTION_MOVE) && ( (pDDTarget &&
-        ((sal_uLong)(pDDTarget->GetModel())!=(sal_uLong)(this->GetModel()))) ||
-        !pDDTarget ))
+    if ((nAction == DND_ACTION_MOVE) && ( (g_pDDTarget &&
+        ((sal_uLong)(g_pDDTarget->GetModel())!=(sal_uLong)(this->GetModel()))) ||
+        !g_pDDTarget))
     {
         RemoveSelection();
     }
 #endif
 
     ImplShowTargetEmphasis( pTargetEntry, false );
-    pDDSource = nullptr;
-    pDDTarget = nullptr;
+    g_pDDSource = nullptr;
+    g_pDDTarget = nullptr;
     pTargetEntry = nullptr;
     nDragDropMode = nOldDragMode;
 }
@@ -1526,10 +1526,10 @@ void SvTreeListBox::dispose()
 
         SvTreeListBox::RemoveBoxFromDDList_Impl( *this );
 
-        if( this == pDDSource )
-            pDDSource = nullptr;
-        if( this == pDDTarget )
-            pDDTarget = nullptr;
+        if (this == g_pDDSource)
+            g_pDDSource = nullptr;
+        if (this == g_pDDTarget)
+            g_pDDTarget = nullptr;
         delete mpImpl;
         mpImpl = nullptr;
     }
commit 27756a94605fb1cfd0bd40fae0b2d4bac4546742
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Nov 11 13:07:33 2015 +0100

    vcl: rename static variable I18NStatus::pInstance
    
    Change-Id: Ic162dd2d9a97e7d311921fad7d4d2bdf4b81293b

diff --git a/vcl/inc/unx/i18n_status.hxx b/vcl/inc/unx/i18n_status.hxx
index cd6d875..e0929db 100644
--- a/vcl/inc/unx/i18n_status.hxx
+++ b/vcl/inc/unx/i18n_status.hxx
@@ -65,8 +65,6 @@ private:
     I18NStatus();
     ~I18NStatus();
 
-    static I18NStatus* pInstance;
-
     static bool getStatusWindowMode();
 
 public:
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index 207a4b4..4142825 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -493,24 +493,24 @@ IMPL_LINK_TYPED( IIIMPStatusWindow, SelectHdl, MenuButton*, pBtn, void )
  *  I18NStatus
  */
 
-I18NStatus* I18NStatus::pInstance = nullptr;
+static I18NStatus* g_pI18NStatusInstance = nullptr;
 
 I18NStatus& I18NStatus::get()
 {
-    if( ! pInstance )
-        pInstance = new I18NStatus();
-    return *pInstance;
+    if (!g_pI18NStatusInstance)
+        g_pI18NStatusInstance = new I18NStatus();
+    return *g_pI18NStatusInstance;
 }
 
 bool I18NStatus::exists()
 {
-    return pInstance != nullptr;
+    return g_pI18NStatusInstance != nullptr;
 }
 
 void I18NStatus::free()
 {
-    if( pInstance )
-        delete pInstance, pInstance = nullptr;
+    if (g_pI18NStatusInstance)
+        delete g_pI18NStatusInstance, g_pI18NStatusInstance = nullptr;
 }
 
 I18NStatus::I18NStatus() :
@@ -522,8 +522,8 @@ I18NStatus::I18NStatus() :
 I18NStatus::~I18NStatus()
 {
     m_pStatusWindow.disposeAndClear();
-    if( pInstance == this )
-        pInstance = nullptr;
+    if( g_pI18NStatusInstance == this )
+        g_pI18NStatusInstance = nullptr;
 }
 
 void I18NStatus::setParent( SalFrame* pParent )


More information about the Libreoffice-commits mailing list