ScopedVclPtr: needs an = operator to make life flow.

Without this, assigning to a ScopedVclPtr instance thus:

    pScopedVclPtr = new Foo();

constructed a new intermediate ScopedVCLPtr, used a default assignment
operator, unhelpfully disposing the new Foo before it could make it to
pScopedVclPtr => add operator, and hide problematic constructors.

Change-Id: Icc0da962938bf115eac0c24a6a76cfeb66ddf23a
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx
index c75d421..3e0de76 100644
--- a/include/vcl/vclptr.hxx
+++ b/include/vcl/vclptr.hxx
@@ -81,7 +81,6 @@ namespace vcl { class Window; }
template <class reference_type>
class VclPtr
{

    ::rtl::Reference<reference_type> m_rInnerRef;

public:
@@ -211,7 +210,6 @@ public:
        return (m_rInnerRef < handle.m_rInnerRef);
    }


    /** Needed to place VclPtr's into STL collection.
     */
    inline bool SAL_CALL operator> (const VclPtr<reference_type> & handle) const
@@ -231,20 +229,28 @@ public:
        : VclPtr<reference_type>()
    {}


    /** Constructor...
    /** Constructor
     */
    inline ScopedVclPtr (reference_type * pBody)
        : VclPtr<reference_type>(pBody)
    {}


    /** Copy constructor...
     */
    inline ScopedVclPtr (const VclPtr<reference_type> & handle)
        : VclPtr<reference_type>(handle)
    {}

    /**
       Assignment that releases the last reference.
     */
    inline ScopedVclPtr<reference_type>& SAL_CALL operator= (reference_type * pBody)
    {
        VclPtr<reference_type>::disposeAndClear();
        VclPtr<reference_type>::set(pBody);
        return *this;
    }

    /** Up-casting conversion constructor: Copies interface reference.

        Does not work for up-casts to ambiguous bases.  For the special case of
@@ -265,7 +271,11 @@ public:
    {
        VclPtr<reference_type>::disposeAndClear();
    }

private:
    // Most likely we don't want this default copy-construtor.
    ScopedVclPtr (const ScopedVclPtr<reference_type> &) SAL_DELETED_FUNCTION;
    // And certainly we don't want a default assignment operator.
    ScopedVclPtr<reference_type>& SAL_CALL operator= (const ScopedVclPtr<reference_type> &) SAL_DELETED_FUNCTION;
};

#endif // INCLUDED_VCL_PTR_HXX
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 9ff0df6..4a65042 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -159,6 +159,7 @@ public:
private:
    void            ImplTrack( const Point& rScreenPos );

    virtual void    dispose() SAL_OVERRIDE;
    virtual void    MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
    virtual void    Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
    virtual void    Paint( const Rectangle& rRect ) SAL_OVERRIDE;
@@ -176,6 +177,11 @@ ImplTabSizer::ImplTabSizer( TabBar* pParent, WinBits nWinStyle )
    SetSizePixel(Size(7 * nScaleFactor, 0));
}

void ImplTabSizer::dispose()
{
    vcl::Window::dispose();
}

void ImplTabSizer::ImplTrack( const Point& rScreenPos )
{
    TabBar* pParent = GetParent();
diff --git a/vcl/README.lifecycle b/vcl/README.lifecycle
index 201e212..1ee7eab 100644
--- a/vcl/README.lifecycle
+++ b/vcl/README.lifecycle
@@ -67,6 +67,14 @@ to lingering pointers to freed objects.
	'dispose' methods, in order to provide a minimal initial
	behavioral change.

	As such a VclPtr can have three states:

	VclPtr<PushButton> pButton;
	...
	assert (pButton == nullptr || !pButton);    // null
	assert (pButton && !pButton->IsDisposed()); // alive
	assert (pButton &&  pButton->IsDisposed()); // disposed

** ScopedVclPtr - making disposes easier

	While replacing existing code with new, it can be a bit
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 2af9470..b04bad1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2264,8 +2264,7 @@ vcl::Font Window::GetPointFont() const

void Window::Show( bool bVisible, sal_uInt16 nFlags )
{

    if ( mpWindowImpl->mbVisible == bVisible )
    if ( IsDisposed() || mpWindowImpl->mbVisible == bVisible )
        return;

    ImplDelData aDogTag( this );