[Libreoffice-commits] core.git: extensions/source filter/source include/svtools include/vcl reportdesign/source sfx2/source svtools/source vcl/source winaccessibility/source

Noel Grandin noel at peralex.com
Wed Oct 29 00:37:30 PDT 2014


 extensions/source/bibliography/bibload.cxx               |    1 
 extensions/source/bibliography/general.cxx               |    1 
 extensions/source/bibliography/toolbar.cxx               |    2 
 filter/source/flash/swfdialog.cxx                        |    1 
 filter/source/flash/swfwriter1.cxx                       |    1 
 filter/source/pdf/impdialog.cxx                          |    1 
 filter/source/pdf/impdialog.hxx                          |    2 
 filter/source/pdf/pdfdialog.cxx                          |    1 
 filter/source/pdf/pdfexport.cxx                          |    1 
 filter/source/pdf/pdffilter.hxx                          |    1 
 filter/source/pdf/pdfinteract.hxx                        |    1 
 filter/source/svg/svgdialog.cxx                          |    1 
 filter/source/xsltdialog/xmlfilterdialogcomponent.cxx    |    1 
 filter/source/xsltfilter/LibXSLTTransformer.hxx          |    1 
 filter/source/xsltfilter/OleHandler.hxx                  |    1 
 include/svtools/valueset.hxx                             |    3 
 include/vcl/button.hxx                                   |    2 
 include/vcl/layout.hxx                                   |   26 ++--
 include/vcl/scrbar.hxx                                   |    2 
 include/vcl/window.hxx                                   |   20 +++
 reportdesign/source/ui/dlg/GroupsSorting.cxx             |    2 
 sfx2/source/appl/shutdowniconaqua.mm                     |    1 
 svtools/source/control/valueset.cxx                      |    2 
 vcl/source/window/layout.cxx                             |   90 +++++++--------
 vcl/source/window/window.cxx                             |    2 
 winaccessibility/source/UAccCOM/AccTextBase.cxx          |    1 
 winaccessibility/source/service/AccEventListener.cxx     |    5 
 winaccessibility/source/service/AccTopWindowListener.cxx |    1 
 28 files changed, 93 insertions(+), 81 deletions(-)

New commits:
commit bacee60a5920585feeff58840357aa7ac33e50a7
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Oct 27 14:02:38 2014 +0200

    ref-counting vcl::Window subclasses
    
    Points of discussion
    --------------------
    
    (*) where in the Window destructor should dispose() be called?
       It's a seriously large method.
    
    (*) we're going to need similar typedefs and declarations for every
    single sub-class of vcl::Window, I assume that I will need to create a
    macro to make it less verbose.
    
    TODO
    ----
    
    Update clang plugin to verify that:
    (a) dispose() methods always call their superclass dispose()
    (b) dispose() methods don't forget to clear any references owned
        by that class.
    
    Change-Id: I873d5d5166f811e2f65e49327cc98862559fcf30

diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 8a732cc..3d9f5c2 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -62,7 +62,6 @@
 #include <bibconfig.hxx>
 #include <cppuhelper/implbase4.hxx>
 
-using namespace ::rtl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::beans;
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index 7c2ca8d..26a2512 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -51,7 +51,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::form;
 using namespace ::com::sun::star::sdb;
-using namespace ::rtl;
 
 static OUString lcl_GetColumnName( const Mapping* pMapping, sal_uInt16 nIndexPos )
 {
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 2a5d07b..bf7e81de 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -281,7 +281,7 @@ void BibToolBar::InitListener()
                 pListener=new BibToolBarListener(this,aURL.Complete,nId);
             }
 
-            BibToolBarListenerRef* pxInsert = new Reference<frame::XStatusListener>;
+            BibToolBarListenerRef* pxInsert = new uno::Reference<frame::XStatusListener>;
             (*pxInsert) = pListener;
             aListenerArr.push_back( pxInsert );
             xDisp->addStatusListener(uno::Reference< frame::XStatusListener > (pListener),aURL);
diff --git a/filter/source/flash/swfdialog.cxx b/filter/source/flash/swfdialog.cxx
index 1b5f5fa..2af211d 100644
--- a/filter/source/flash/swfdialog.cxx
+++ b/filter/source/flash/swfdialog.cxx
@@ -29,7 +29,6 @@
 #include <com/sun/star/frame/XController.hpp>
 #include <com/sun/star/view/XSelectionSupplier.hpp>
 
-using namespace ::rtl;
 using namespace ::vcl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index 13b38c1..e2c34c1 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -40,7 +40,6 @@
 
 using namespace ::swf;
 using namespace ::std;
-using namespace ::rtl;
 using namespace ::com::sun::star::i18n;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index b2e6cec..20e0350 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -54,6 +54,7 @@ PDFFilterResId::PDFFilterResId( sal_uInt32 nId ) : ResId( nId, getPDFFilterResMg
 
 
 using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
 
 
 // tabbed PDF dialog implementation
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index 244d4b9..42f5c2a 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -167,7 +167,7 @@ public:
 
     ImpPDFTabDialog( vcl::Window* pParent,
                      Sequence< PropertyValue >& rFilterData,
-                     const Reference< XComponent >& rDoc
+                     const css::uno::Reference< XComponent >& rDoc
                      );
     virtual ~ImpPDFTabDialog();
 
diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx
index 02d6a8e..9db0eb6 100644
--- a/filter/source/pdf/pdfdialog.cxx
+++ b/filter/source/pdf/pdfdialog.cxx
@@ -25,7 +25,6 @@
 #include <svl/solar.hrc>
 #include <com/sun/star/view/XRenderable.hpp>
 
-using namespace ::rtl;
 using namespace ::vcl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 749dbb8..9fdc626 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -76,7 +76,6 @@
 #include "com/sun/star/graphic/XGraphicProvider.hpp"
 #include <boost/scoped_ptr.hpp>
 
-using namespace ::rtl;
 using namespace ::vcl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
diff --git a/filter/source/pdf/pdffilter.hxx b/filter/source/pdf/pdffilter.hxx
index 584405a..c4b28fa 100644
--- a/filter/source/pdf/pdffilter.hxx
+++ b/filter/source/pdf/pdffilter.hxx
@@ -44,7 +44,6 @@
 #include <unotools/ucbstreamhelper.hxx>
 #include <unotools/streamwrap.hxx>
 
-using namespace ::rtl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
diff --git a/filter/source/pdf/pdfinteract.hxx b/filter/source/pdf/pdfinteract.hxx
index cbe46a1..fc4d852 100644
--- a/filter/source/pdf/pdfinteract.hxx
+++ b/filter/source/pdf/pdfinteract.hxx
@@ -25,7 +25,6 @@
 #include "com/sun/star/lang/XMultiServiceFactory.hpp"
 #include "com/sun/star/task/XInteractionHandler2.hpp"
 
-using namespace ::rtl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
diff --git a/filter/source/svg/svgdialog.cxx b/filter/source/svg/svgdialog.cxx
index ee307a3..3243eb5 100644
--- a/filter/source/svg/svgdialog.cxx
+++ b/filter/source/svg/svgdialog.cxx
@@ -32,7 +32,6 @@
 #define SVG_DIALOG_IMPLEMENTATION_NAME  SVG_DIALOG_SERVICE_NAME
 #define SVG_FILTER_DATA_NAME            "FilterData"
 
-using namespace ::rtl;
 using namespace ::vcl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index 6e55c26..7c62fd8 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -44,7 +44,6 @@
 
 #include "xmlfiltersettingsdialog.hxx"
 
-using namespace ::rtl;
 using namespace ::cppu;
 using namespace ::osl;
 using namespace ::com::sun::star::uno;
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.hxx b/filter/source/xsltfilter/LibXSLTTransformer.hxx
index cfdead8..cc078b9 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.hxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.hxx
@@ -37,7 +37,6 @@
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/xml/xslt/XXSLTTransformer.hpp>
 
-using namespace ::rtl;
 using namespace ::cppu;
 using namespace ::osl;
 using namespace ::com::sun::star::beans;
diff --git a/filter/source/xsltfilter/OleHandler.hxx b/filter/source/xsltfilter/OleHandler.hxx
index 799226f..d1d9ad8 100644
--- a/filter/source/xsltfilter/OleHandler.hxx
+++ b/filter/source/xsltfilter/OleHandler.hxx
@@ -41,7 +41,6 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::io;
-using namespace ::rtl;
 
 namespace XSLT
 {
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index e82a4b4..4ddc64d 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -177,7 +177,6 @@ to be set (before Show) with SetStyle().
 *************************************************************************/
 
 typedef std::vector<ValueSetItem*> ValueItemList;
-typedef boost::scoped_ptr<ScrollBar> ScrollBarPtr;
 typedef boost::scoped_ptr<ValueSetItem> ValueSetItemPtr;
 
 // - ValueSet types -
@@ -202,7 +201,7 @@ private:
     Timer           maTimer;
     ValueItemList   mItemList;
     ValueSetItemPtr mpNoneItem;
-    ScrollBarPtr    mpScrollBar;
+    boost::scoped_ptr<ScrollBar> mpScrollBar;
     Rectangle       maNoneItemRect;
     Rectangle       maItemListRect;
     long            mnItemWidth;
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 6c9384c..9f5142a 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -566,6 +566,8 @@ public:
     virtual void    KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
 };
 
+typedef rtl::Reference<DisclosureButton> DisclosureButtonPtr;
+
 #endif // INCLUDED_VCL_BUTTON_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 0eed7cb..88f1887 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -513,29 +513,29 @@ public:
     VclExpander(vcl::Window *pParent)
         : VclBin(pParent)
         , m_bResizeTopLevel(true)
-        , m_aDisclosureButton(this)
+        , m_pDisclosureButton(new DisclosureButton(this))
     {
-        m_aDisclosureButton.SetToggleHdl(LINK(this, VclExpander, ClickHdl));
-        m_aDisclosureButton.Show();
+        m_pDisclosureButton->SetToggleHdl(LINK(this, VclExpander, ClickHdl));
+        m_pDisclosureButton->Show();
     }
     virtual vcl::Window *get_child() SAL_OVERRIDE;
     virtual const vcl::Window *get_child() const SAL_OVERRIDE;
     virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
     bool get_expanded() const
     {
-        return m_aDisclosureButton.IsChecked();
+        return m_pDisclosureButton->IsChecked();
     }
     void set_expanded(bool bExpanded)
     {
-        m_aDisclosureButton.Check(bExpanded);
+        m_pDisclosureButton->Check(bExpanded);
     }
     void set_label(const OUString& rLabel)
     {
-        m_aDisclosureButton.SetText(rLabel);
+        m_pDisclosureButton->SetText(rLabel);
     }
     OUString get_label() const
     {
-        return m_aDisclosureButton.GetText();
+        return m_pDisclosureButton->GetText();
     }
     virtual void StateChanged(StateChangedType nType) SAL_OVERRIDE;
     void  SetExpandedHdl( const Link& rLink ) { maExpandedHdl = rLink; }
@@ -543,9 +543,10 @@ public:
 protected:
     virtual Size calculateRequisition() const SAL_OVERRIDE;
     virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE;
+    void dispose() SAL_OVERRIDE { m_pDisclosureButton.clear(); VclBin::dispose(); }
 private:
     bool m_bResizeTopLevel;
-    DisclosureButton m_aDisclosureButton;
+    DisclosureButtonPtr m_pDisclosureButton;
     Link maExpandedHdl;
     DECL_DLLPRIVATE_LINK(ClickHdl, DisclosureButton* pBtn);
 };
@@ -557,8 +558,8 @@ public:
     virtual vcl::Window *get_child() SAL_OVERRIDE;
     virtual const vcl::Window *get_child() const SAL_OVERRIDE;
     virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
-    ScrollBar& getVertScrollBar() { return m_aVScroll; }
-    ScrollBar& getHorzScrollBar() { return m_aHScroll; }
+    ScrollBar& getVertScrollBar() { return *m_pVScroll.get(); }
+    ScrollBar& getHorzScrollBar() { return *m_pHScroll.get(); }
     Size getVisibleChildSize() const;
     //set to true to disable the built-in scrolling callbacks to allow the user
     //to override it
@@ -569,10 +570,11 @@ protected:
     DECL_LINK(ScrollBarHdl, void *);
     void InitScrollBars(const Size &rRequest);
     virtual bool Notify(NotifyEvent& rNEvt) SAL_OVERRIDE;
+    void dispose() SAL_OVERRIDE { m_pVScroll.clear(); m_pHScroll.clear(); VclBin::dispose(); }
 private:
     bool m_bUserManagedScrolling;
-    ScrollBar m_aVScroll;
-    ScrollBar m_aHScroll;
+    ScrollBarPtr m_pVScroll;
+    ScrollBarPtr m_pHScroll;
     ScrollBarBox m_aScrollBarBox;
 };
 
diff --git a/include/vcl/scrbar.hxx b/include/vcl/scrbar.hxx
index 65bbca0..db0a673 100644
--- a/include/vcl/scrbar.hxx
+++ b/include/vcl/scrbar.hxx
@@ -141,6 +141,8 @@ public:
     virtual Size    GetOptimalSize() const SAL_OVERRIDE;
 };
 
+typedef rtl::Reference<ScrollBar> ScrollBarPtr;
+
 
 // - ScrollBarBox -
 
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 44ab2c0..ec51588 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -36,6 +36,7 @@
 #include <vcl/region.hxx>
 #include <vcl/salnativewidgets.hxx>
 #include <rtl/ustring.hxx>
+#include <rtl/ref.hxx>
 #include <cppuhelper/weakref.hxx>
 #include <com/sun/star/uno/Reference.hxx>
 #include <boost/shared_ptr.hpp>
@@ -399,6 +400,8 @@ private:
     // OutputDevice
     ::OutputDevice* mpOutputDevice;
 
+    mutable int mnRefCnt;        // reference count
+
 #ifdef DBG_UTIL
     friend const char* ::ImplDbgCheckWindow( const void* pObj );
 #endif
@@ -478,8 +481,25 @@ public:
 
     SAL_DLLPRIVATE static void          ImplCalcSymbolRect( Rectangle& rRect );
 
+private:
+    template<typename T> friend class ::rtl::Reference;
+
+    inline void acquire() const
+    {
+        mnRefCnt++;
+    }
+
+    inline void release() const
+    {
+        if (!--mnRefCnt)
+            delete const_cast<Window*>(this);
+    }
+
 protected:
 
+    /** This is intended to be used to clear any locally held references to other Window-subclass objects */
+    virtual void dispose() {}
+
     SAL_DLLPRIVATE void                 ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
 
     SAL_DLLPRIVATE Point                ImplOutputToFrame( const Point& rPos );
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index 121a944..aa86925 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -182,7 +182,7 @@ OFieldExpressionControl::OFieldExpressionControl(OGroupsSortingDialog* _pParentD
 
 OFieldExpressionControl::~OFieldExpressionControl()
 {
-    acquire();
+    WeakImplHelper1::acquire();
     uno::Reference< report::XGroups > xGroups = m_pParent->getGroups();
     xGroups->removeContainerListener(this);
 
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index da34fcd..d69a207 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -44,7 +44,6 @@
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 
-using namespace ::rtl;
 using namespace ::osl;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::task;
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index a0d8446..f0d6457 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -344,7 +344,7 @@ void ValueSet::Format()
     long        nOff;
     long        nNoneHeight;
     long        nNoneSpace;
-    ScrollBarPtr pDeletedScrollBar(NULL);
+    boost::scoped_ptr<ScrollBar> pDeletedScrollBar(NULL);
 
     // consider the scrolling
     if ( nStyle & WB_VSCROLL )
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 1709f34..5f5ad67 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1460,7 +1460,7 @@ const vcl::Window *VclExpander::get_child() const
 {
     const WindowImpl* pWindowImpl = ImplGetWindowImpl();
 
-    assert(pWindowImpl->mpFirstChild == &m_aDisclosureButton);
+    assert(pWindowImpl->mpFirstChild == m_pDisclosureButton.get());
 
     return pWindowImpl->mpFirstChild->GetWindow(WINDOW_NEXT);
 }
@@ -1479,10 +1479,10 @@ Size VclExpander::calculateRequisition() const
     const vcl::Window *pChild = get_child();
     const vcl::Window *pLabel = pChild != pWindowImpl->mpLastChild ? pWindowImpl->mpLastChild : NULL;
 
-    if (pChild && pChild->IsVisible() && m_aDisclosureButton.IsChecked())
+    if (pChild && pChild->IsVisible() && m_pDisclosureButton->IsChecked())
         aRet = getLayoutRequisition(*pChild);
 
-    Size aExpanderSize = getLayoutRequisition(m_aDisclosureButton);
+    Size aExpanderSize = getLayoutRequisition(*m_pDisclosureButton.get());
 
     if (pLabel && pLabel->IsVisible())
     {
@@ -1516,7 +1516,7 @@ void VclExpander::setAllocation(const Size &rAllocation)
     vcl::Window *pChild = get_child();
     vcl::Window *pLabel = pChild != pWindowImpl->mpLastChild ? pWindowImpl->mpLastChild : NULL;
 
-    Size aButtonSize = getLayoutRequisition(m_aDisclosureButton);
+    Size aButtonSize = getLayoutRequisition(*m_pDisclosureButton.get());
     Size aLabelSize;
     Size aExpanderSize = aButtonSize;
     if (pLabel && pLabel->IsVisible())
@@ -1534,7 +1534,7 @@ void VclExpander::setAllocation(const Size &rAllocation)
 
     long nExtraExpanderHeight = aExpanderSize.Height() - aButtonSize.Height();
     Point aButtonPos(aChildPos.X(), aChildPos.Y() + nExtraExpanderHeight/2);
-    setLayoutAllocation(m_aDisclosureButton, aButtonPos, aButtonSize);
+    setLayoutAllocation(*m_pDisclosureButton.get(), aButtonPos, aButtonSize);
 
     if (pLabel && pLabel->IsVisible())
     {
@@ -1552,7 +1552,7 @@ void VclExpander::setAllocation(const Size &rAllocation)
 
     if (pChild && pChild->IsVisible())
     {
-        if (!m_aDisclosureButton.IsChecked())
+        if (!m_pDisclosureButton->IsChecked())
             aAllocation = Size();
         setLayoutAllocation(*pChild, aChildPos, aAllocation);
     }
@@ -1577,7 +1577,7 @@ void VclExpander::StateChanged(StateChangedType nType)
     {
         vcl::Window *pChild = get_child();
         if (pChild)
-            pChild->Show(m_aDisclosureButton.IsChecked());
+            pChild->Show(m_pDisclosureButton->IsChecked());
     }
 }
 
@@ -1599,15 +1599,15 @@ IMPL_LINK( VclExpander, ClickHdl, DisclosureButton*, pBtn )
 VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent, WinBits nStyle)
     : VclBin(pParent, nStyle)
     , m_bUserManagedScrolling(false)
-    , m_aVScroll(this, WB_HIDE | WB_VERT)
-    , m_aHScroll(this, WB_HIDE | WB_HORZ)
+    , m_pVScroll(new ScrollBar(this, WB_HIDE | WB_VERT))
+    , m_pHScroll(new ScrollBar(this, WB_HIDE | WB_HORZ))
     , m_aScrollBarBox(this, WB_HIDE)
 {
     SetType(WINDOW_SCROLLWINDOW);
 
     Link aLink( LINK( this, VclScrolledWindow, ScrollBarHdl ) );
-    m_aVScroll.SetScrollHdl(aLink);
-    m_aHScroll.SetScrollHdl(aLink);
+    m_pVScroll->SetScrollHdl(aLink);
+    m_pHScroll->SetScrollHdl(aLink);
 }
 
 IMPL_LINK_NOARG(VclScrolledWindow, ScrollBarHdl)
@@ -1625,14 +1625,14 @@ IMPL_LINK_NOARG(VclScrolledWindow, ScrollBarHdl)
 
     Point aWinPos;
 
-    if (m_aHScroll.IsVisible())
+    if (m_pHScroll->IsVisible())
     {
-        aWinPos.X() = -m_aHScroll.GetThumbPos();
+        aWinPos.X() = -m_pHScroll->GetThumbPos();
     }
 
-    if (m_aVScroll.IsVisible())
+    if (m_pVScroll->IsVisible())
     {
-        aWinPos.Y() = -m_aVScroll.GetThumbPos();
+        aWinPos.Y() = -m_pVScroll->GetThumbPos();
     }
 
     pChild->SetPosPixel(aWinPos);
@@ -1661,10 +1661,10 @@ Size VclScrolledWindow::calculateRequisition() const
         aRet = getLayoutRequisition(*pChild);
 
     if (GetStyle() & WB_VSCROLL)
-        aRet.Width() += getLayoutRequisition(m_aVScroll).Width();
+        aRet.Width() += getLayoutRequisition(*m_pVScroll.get()).Width();
 
     if (GetStyle() & WB_HSCROLL)
-        aRet.Height() += getLayoutRequisition(m_aHScroll).Height();
+        aRet.Height() += getLayoutRequisition(*m_pHScroll.get()).Height();
 
     return aRet;
 }
@@ -1677,18 +1677,18 @@ void VclScrolledWindow::InitScrollBars(const Size &rRequest)
 
     Size aOutSize(getVisibleChildSize());
 
-    if (m_aVScroll.IsVisible())
+    if (m_pVScroll->IsVisible())
     {
-        m_aVScroll.SetRangeMax(rRequest.Height());
-        m_aVScroll.SetVisibleSize(aOutSize.Height());
-        m_aVScroll.SetPageSize(16);
+        m_pVScroll->SetRangeMax(rRequest.Height());
+        m_pVScroll->SetVisibleSize(aOutSize.Height());
+        m_pVScroll->SetPageSize(16);
     }
 
-    if (m_aHScroll.IsVisible())
+    if (m_pHScroll->IsVisible())
     {
-        m_aHScroll.SetRangeMax(rRequest.Width());
-        m_aHScroll.SetVisibleSize(aOutSize.Width());
-        m_aHScroll.SetPageSize(16);
+        m_pHScroll->SetRangeMax(rRequest.Width());
+        m_pHScroll->SetVisibleSize(aOutSize.Width());
+        m_pHScroll->SetPageSize(16);
     }
 }
 
@@ -1706,51 +1706,51 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation)
     // vert. ScrollBar
     if (GetStyle() & WB_AUTOVSCROLL)
     {
-        m_aVScroll.Show(nAvailHeight < aChildReq.Height());
+        m_pVScroll->Show(nAvailHeight < aChildReq.Height());
     }
 
-    if (m_aVScroll.IsVisible())
-        nAvailWidth -= getLayoutRequisition(m_aVScroll).Width();
+    if (m_pVScroll->IsVisible())
+        nAvailWidth -= getLayoutRequisition(*m_pVScroll.get()).Width();
 
     // horz. ScrollBar
     if (GetStyle() & WB_AUTOHSCROLL)
     {
         bool bShowHScroll = nAvailWidth < aChildReq.Width();
-        m_aHScroll.Show(bShowHScroll);
+        m_pHScroll->Show(bShowHScroll);
 
         if (bShowHScroll)
-            nAvailHeight -= getLayoutRequisition(m_aHScroll).Height();
+            nAvailHeight -= getLayoutRequisition(*m_pHScroll.get()).Height();
 
         if (GetStyle() & WB_AUTOVSCROLL)
-            m_aVScroll.Show(nAvailHeight < aChildReq.Height());
+            m_pVScroll->Show(nAvailHeight < aChildReq.Height());
     }
 
     Size aInnerSize(aChildAllocation);
     long nScrollBarWidth = 0, nScrollBarHeight = 0;
 
-    if (m_aVScroll.IsVisible())
+    if (m_pVScroll->IsVisible())
     {
-        nScrollBarWidth = getLayoutRequisition(m_aVScroll).Width();
+        nScrollBarWidth = getLayoutRequisition(*m_pVScroll.get()).Width();
         Point aScrollPos(rAllocation.Width() - nScrollBarWidth, 0);
         Size aScrollSize(nScrollBarWidth, rAllocation.Height());
-        setLayoutAllocation(m_aVScroll, aScrollPos, aScrollSize);
+        setLayoutAllocation(*m_pVScroll.get(), aScrollPos, aScrollSize);
         aChildAllocation.Width() -= nScrollBarWidth;
         aInnerSize.Width() -= nScrollBarWidth;
         aChildAllocation.Height() = aChildReq.Height();
     }
 
-    if (m_aHScroll.IsVisible())
+    if (m_pHScroll->IsVisible())
     {
-        nScrollBarHeight = getLayoutRequisition(m_aHScroll).Height();
+        nScrollBarHeight = getLayoutRequisition(*m_pHScroll.get()).Height();
         Point aScrollPos(0, rAllocation.Height() - nScrollBarHeight);
         Size aScrollSize(rAllocation.Width(), nScrollBarHeight);
-        setLayoutAllocation(m_aHScroll, aScrollPos, aScrollSize);
+        setLayoutAllocation(*m_pHScroll.get(), aScrollPos, aScrollSize);
         aChildAllocation.Height() -= nScrollBarHeight;
         aInnerSize.Height() -= nScrollBarHeight;
         aChildAllocation.Width() = aChildReq.Width();
     }
 
-    if (m_aVScroll.IsVisible() && m_aHScroll.IsVisible())
+    if (m_pVScroll->IsVisible() && m_pHScroll->IsVisible())
     {
         Point aBoxPos(aInnerSize.Width(), aInnerSize.Height());
         m_aScrollBarBox.SetPosSizePixel(aBoxPos, Size(nScrollBarWidth, nScrollBarHeight));
@@ -1774,18 +1774,18 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation)
 Size VclScrolledWindow::getVisibleChildSize() const
 {
     Size aRet(GetSizePixel());
-    if (m_aVScroll.IsVisible())
-        aRet.Width() -= m_aVScroll.GetSizePixel().Width();
-    if (m_aHScroll.IsVisible())
-        aRet.Height() -= m_aHScroll.GetSizePixel().Height();
+    if (m_pVScroll->IsVisible())
+        aRet.Width() -= m_pVScroll->GetSizePixel().Width();
+    if (m_pHScroll->IsVisible())
+        aRet.Height() -= m_pHScroll->GetSizePixel().Height();
     return aRet;
 }
 
 bool VclScrolledWindow::set_property(const OString &rKey, const OString &rValue)
 {
     bool bRet = VclBin::set_property(rKey, rValue);
-    m_aVScroll.Show((GetStyle() & WB_VSCROLL) != 0);
-    m_aHScroll.Show((GetStyle() & WB_HSCROLL) != 0);
+    m_pVScroll->Show((GetStyle() & WB_VSCROLL) != 0);
+    m_pHScroll->Show((GetStyle() & WB_HSCROLL) != 0);
     return bRet;
 }
 
@@ -1800,7 +1800,7 @@ bool VclScrolledWindow::Notify(NotifyEvent& rNEvt)
             const CommandWheelData* pData = rCEvt.GetWheelData();
             if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
             {
-                nDone = HandleScrollCommand(rCEvt, &m_aHScroll, &m_aVScroll);
+                nDone = HandleScrollCommand(rCEvt, m_pHScroll.get(), m_pVScroll.get());
             }
         }
     }
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index e03f989..a8617ae 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -137,6 +137,8 @@ Window::~Window()
 
     DBG_ASSERT( !mpWindowImpl->mbInDtor, "~Window - already in DTOR!" );
 
+    dispose();
+
     // remove Key and Mouse events issued by Application::PostKey/MouseEvent
     Application::RemoveMouseAndKeyEvents( this );
 
diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx b/winaccessibility/source/UAccCOM/AccTextBase.cxx
index d73f8e3..156ef30 100644
--- a/winaccessibility/source/UAccCOM/AccTextBase.cxx
+++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx
@@ -36,7 +36,6 @@
 
 using namespace com::sun::star::accessibility;
 using namespace com::sun::star::uno;
-using namespace rtl;
 
 
 // Construction/Destruction
diff --git a/winaccessibility/source/service/AccEventListener.cxx b/winaccessibility/source/service/AccEventListener.cxx
index 7874f47..7b88116 100644
--- a/winaccessibility/source/service/AccEventListener.cxx
+++ b/winaccessibility/source/service/AccEventListener.cxx
@@ -40,7 +40,6 @@
 
 using namespace com::sun::star::uno;
 using namespace com::sun::star::accessibility;
-using namespace rtl;
 using namespace cppu;
 
 AccEventListener::AccEventListener(com::sun::star::accessibility::XAccessible* pAcc,
@@ -202,7 +201,7 @@ void AccEventListener::FireStatePropertyChange(short /*state*/, bool set )
  */
 short AccEventListener::GetRole()
 {
-    Reference<com::sun::star::accessibility::XAccessibleContext> const
+    css::uno::Reference<com::sun::star::accessibility::XAccessibleContext> const
         xContext(m_xAccessible->getAccessibleContext());
     if(xContext.is())
     {
@@ -235,7 +234,7 @@ void AccEventListener::RemoveMeFromBroadcaster()
         }
         try
         {
-            Reference<XAccessibleEventBroadcaster> const xBroadcaster(
+            css::uno::Reference<XAccessibleEventBroadcaster> const xBroadcaster(
                     m_xAccessible->getAccessibleContext(), UNO_QUERY);
             if (xBroadcaster.is())
             {
diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx
index ef89bfb..e18c0c3 100644
--- a/winaccessibility/source/service/AccTopWindowListener.cxx
+++ b/winaccessibility/source/service/AccTopWindowListener.cxx
@@ -41,7 +41,6 @@ using namespace com::sun::star::uno;
 using namespace com::sun::star::lang;
 using namespace com::sun::star::bridge;
 using namespace com::sun::star::awt;
-using namespace rtl;
 using namespace cppu;
 
 /**


More information about the Libreoffice-commits mailing list