[Libreoffice-commits] core.git: Branch 'feature/vclref' - include/vcl vcl/qa vcl/source vcl/unx

Noel Grandin noel at peralex.com
Mon Jan 5 05:09:07 PST 2015


 include/vcl/dialog.hxx              |    4 -
 include/vcl/edit.hxx                |    4 -
 include/vcl/layout.hxx              |    4 -
 include/vcl/vclref.hxx              |   20 +++++++--
 vcl/qa/cppunit/lifecycle.cxx        |    2 
 vcl/source/app/dbggui.cxx           |    2 
 vcl/source/control/combobox.cxx     |    8 +--
 vcl/source/control/edit.cxx         |   74 ++++++++++++++++++------------------
 vcl/source/window/layout.cxx        |   50 ++++++++++++------------
 vcl/unx/generic/app/i18n_status.cxx |    2 
 10 files changed, 90 insertions(+), 80 deletions(-)

New commits:
commit 4e490ebab4001ef8d95a4eb3e94e98ddb56f9335
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jan 5 14:29:59 2015 +0200

    vcl: add cast operator to VclReference to convert to pointer
    
    so we don't have to call .get() everywhere
    
    Change-Id: If6ccd7dcf1a492b1e7703956ecbe8e5ac2dd0fb7

diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index d9cb949..c87adad 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -90,8 +90,8 @@ public:
 
     virtual void queue_resize(StateChangedType eReason = StateChangedType::LAYOUT) SAL_OVERRIDE;
     virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
-    VclButtonBox* get_action_area() { return mpActionArea.get(); }
-    VclBox* get_content_area() { return mpContentArea.get(); }
+    VclButtonBox* get_action_area() { return mpActionArea; }
+    VclBox* get_content_area() { return mpContentArea; }
 
     virtual bool    Close() SAL_OVERRIDE;
 
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index 93868c7..62d0730 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -187,7 +187,7 @@ public:
 
     virtual void        SetModifyFlag();
     virtual void        ClearModifyFlag();
-    virtual bool        IsModified() const { return mpSubEdit.get() ? mpSubEdit->mbModified : mbModified; }
+    virtual bool        IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; }
 
     virtual void        EnableUpdateData( sal_uLong nTimeout = EDIT_UPDATEDATA_TIMEOUT );
     virtual void        DisableUpdateData() { delete mpUpdateDataTimer; mpUpdateDataTimer = NULL; }
@@ -237,7 +237,7 @@ public:
     virtual void        SetUpdateDataHdl( const Link& rLink ) { maUpdateDataHdl = rLink; }
 
     void                SetSubEdit( VclReference<Edit> pEdit );
-    Edit*               GetSubEdit() const { return mpSubEdit.get(); }
+    Edit*               GetSubEdit() const { return mpSubEdit; }
 
     boost::signals2::signal< void ( Edit* ) > autocompleteSignal;
     AutocompleteAction  GetAutocompleteAction() const { return meAutocompleteAction; }
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 843366b..d8d5e5f0 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -572,8 +572,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_pVScroll.get(); }
-    ScrollBar& getHorzScrollBar() { return *m_pHScroll.get(); }
+    ScrollBar& getVertScrollBar() { return *m_pVScroll; }
+    ScrollBar& getHorzScrollBar() { return *m_pHScroll; }
     Size getVisibleChildSize() const;
     //set to true to disable the built-in scrolling callbacks to allow the user
     //to override it
diff --git a/include/vcl/vclref.hxx b/include/vcl/vclref.hxx
index b8c15ea..0827af6 100644
--- a/include/vcl/vclref.hxx
+++ b/include/vcl/vclref.hxx
@@ -111,26 +111,36 @@ public:
     inline VclReference(
         const VclReference< derived_type > & rRef,
         typename ::vcl::detail::UpCast< reference_type, derived_type >::t = 0 )
-        : m_rInnerRef( static_cast<reference_type*>(rRef.get()) )
+        : m_rInnerRef( static_cast<reference_type*>(rRef) )
     {
     }
 
+    /** Probably most common used: handle->someBodyOp().
+     */
+    inline reference_type * SAL_CALL operator->() const
+    {
+        return m_rInnerRef.get();
+    }
+
     /** Get the body. Can be used instead of operator->().
          I.e. handle->someBodyOp() and handle.get()->someBodyOp()
          are the same.
-     */
+      */
     inline reference_type * SAL_CALL get() const
     {
         return m_rInnerRef.get();
     }
 
-    /** Probably most common used: handle->someBodyOp().
-     */
-    inline reference_type * SAL_CALL operator->() const
+    inline SAL_CALL operator reference_type * () const
     {
         return m_rInnerRef.get();
     }
 
+    inline SAL_CALL operator bool () const
+    {
+        return m_rInnerRef.get() != NULL;
+    }
+
     inline void disposeAndClear()
     {
         // hold it alive for the lifetime of this method
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index a2d75df..c4eef2e 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -90,7 +90,7 @@ void LifecycleTest::testParentedWidgets()
     VclReference<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL,
                                                  WB_APP|WB_STDWORK));
     CPPUNIT_ASSERT(xWin.get() != NULL);
-    testWidgets(xWin.get());
+    testWidgets(xWin);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(LifecycleTest);
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index 9913c76..bc6a2d1 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -315,7 +315,7 @@ DbgDialog::DbgDialog() :
 
 IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
 {
-    if ( pButton == maOKButton.get() )
+    if ( pButton == maOKButton )
     {
         DbgData aData;
 
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 7caa6a6..39c382f 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -578,7 +578,7 @@ void ComboBox::Resize()
 void ComboBox::FillLayoutData() const
 {
     mpControlData->mpLayoutData = new vcl::ControlLayoutData();
-    AppendLayoutData( *mpSubEdit.get() );
+    AppendLayoutData( *mpSubEdit );
     mpSubEdit->SetLayoutDataParent( this );
     ImplListBoxWindowPtr rMainWindow = mpImplLB->GetMainWindow();
     if( mpFloatWin )
@@ -692,7 +692,7 @@ bool ComboBox::PreNotify( NotifyEvent& rNEvt )
 bool ComboBox::Notify( NotifyEvent& rNEvt )
 {
     bool nDone = false;
-    if( ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) && ( rNEvt.GetWindow() == mpSubEdit.get() )
+    if( ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) && ( rNEvt.GetWindow() == mpSubEdit )
             && !IsReadOnly() )
     {
         KeyEvent aKeyEvt = *rNEvt.GetKeyEvent();
@@ -730,7 +730,7 @@ bool ComboBox::Notify( NotifyEvent& rNEvt )
 
             case KEY_RETURN:
             {
-                if( ( rNEvt.GetWindow() == mpSubEdit.get() ) && IsInDropDown() )
+                if( ( rNEvt.GetWindow() == mpSubEdit ) && IsInDropDown() )
                 {
                     mpImplLB->ProcessKeyInput( aKeyEvt );
                     nDone = true;
@@ -748,7 +748,7 @@ bool ComboBox::Notify( NotifyEvent& rNEvt )
     }
     else if( (rNEvt.GetType() == MouseNotifyEvent::COMMAND) &&
              (rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) &&
-             (rNEvt.GetWindow() == mpSubEdit.get()) )
+             (rNEvt.GetWindow() == mpSubEdit) )
     {
         sal_uInt16 nWheelBehavior( GetSettings().GetMouseSettings().GetWheelBehavior() );
         if  (   ( nWheelBehavior == MOUSE_WHEEL_ALWAYS )
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 63d4857..1d157d4 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1331,7 +1331,7 @@ void Edit::ImplPaste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC
 
 void Edit::MouseButtonDown( const MouseEvent& rMEvt )
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
     {
         Control::MouseButtonDown( rMEvt );
         return;
@@ -1753,7 +1753,7 @@ void Edit::KeyInput( const KeyEvent& rKEvt )
     if ( mpUpdateDataTimer && !mbIsSubEdit && mpUpdateDataTimer->IsActive() )
         mpUpdateDataTimer->Start();//do not update while the user is still travelling in the control
 
-    if ( mpSubEdit.get() || !ImplHandleKeyEvent( rKEvt ) )
+    if ( mpSubEdit || !ImplHandleKeyEvent( rKEvt ) )
         Control::KeyInput( rKEvt );
 }
 
@@ -1765,13 +1765,13 @@ void Edit::FillLayoutData() const
 
 void Edit::Paint( const Rectangle& )
 {
-    if ( !mpSubEdit.get() )
+    if ( !mpSubEdit )
         ImplRepaint();
 }
 
 void Edit::Resize()
 {
-    if ( !mpSubEdit.get() && IsReallyVisible() )
+    if ( !mpSubEdit && IsReallyVisible() )
     {
         Control::Resize();
         // Wegen vertikaler Zentrierung...
@@ -1884,7 +1884,7 @@ void Edit::ImplInvalidateOutermostBorder( vcl::Window* pWin )
 
 void Edit::GetFocus()
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->ImplGrabFocus( GetGetFocusFlags() );
     else if ( !mbActivePopup )
     {
@@ -1937,7 +1937,7 @@ void Edit::GetFocus()
 
 vcl::Window* Edit::GetPreferredKeyInputWindow()
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         return mpSubEdit->GetPreferredKeyInputWindow();
     else
         return this;
@@ -1952,7 +1952,7 @@ void Edit::LoseFocus()
         mpUpdateDataTimer->Timeout();
     }
 
-    if ( !mpSubEdit.get() )
+    if ( !mpSubEdit )
     {
         // FIXME: this is currently only on OS X
         // check for other platforms that need similar handling
@@ -2208,11 +2208,11 @@ void Edit::StateChanged( StateChangedType nType )
 {
     if ( nType == StateChangedType::INITSHOW )
     {
-        if ( !mpSubEdit.get() )
+        if ( !mpSubEdit )
         {
             mnXOffset = 0;  // if GrabFocus before while size was still wrong
             ImplAlign();
-            if ( !mpSubEdit.get() )
+            if ( !mpSubEdit )
                 ImplShowCursor( false );
         }
         // update background (eventual SetPaintTransparent)
@@ -2220,7 +2220,7 @@ void Edit::StateChanged( StateChangedType nType )
     }
     else if ( nType == StateChangedType::ENABLE )
     {
-        if ( !mpSubEdit.get() )
+        if ( !mpSubEdit )
         {
             // change text color only
             ImplInvalidateOrRepaint();
@@ -2267,7 +2267,7 @@ void Edit::StateChanged( StateChangedType nType )
     }
     else if ( nType == StateChangedType::ZOOM )
     {
-        if ( !mpSubEdit.get() )
+        if ( !mpSubEdit )
         {
             ImplInitSettings( true, false, false );
             ImplShowCursor( true );
@@ -2276,7 +2276,7 @@ void Edit::StateChanged( StateChangedType nType )
     }
     else if ( nType == StateChangedType::CONTROLFONT )
     {
-        if ( !mpSubEdit.get() )
+        if ( !mpSubEdit )
         {
             ImplInitSettings( true, false, false );
             ImplShowCursor();
@@ -2285,7 +2285,7 @@ void Edit::StateChanged( StateChangedType nType )
     }
     else if ( nType == StateChangedType::CONTROLFOREGROUND )
     {
-        if ( !mpSubEdit.get() )
+        if ( !mpSubEdit )
         {
             ImplInitSettings( false, true, false );
             Invalidate();
@@ -2293,7 +2293,7 @@ void Edit::StateChanged( StateChangedType nType )
     }
     else if ( nType == StateChangedType::CONTROLBACKGROUND )
     {
-        if ( !mpSubEdit.get() )
+        if ( !mpSubEdit )
         {
             ImplInitSettings( false, false, true );
             Invalidate();
@@ -2310,7 +2310,7 @@ void Edit::DataChanged( const DataChangedEvent& rDCEvt )
          ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
           (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
     {
-        if ( !mpSubEdit.get() )
+        if ( !mpSubEdit )
         {
             ImplInitSettings( true, true, true );
             ImplShowCursor( true );
@@ -2443,7 +2443,7 @@ void Edit::EnableUpdateData( sal_uLong nTimeout )
 void Edit::SetEchoChar( sal_Unicode c )
 {
     mcEchoChar = c;
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->SetEchoChar( c );
 }
 
@@ -2452,7 +2452,7 @@ void Edit::SetReadOnly( bool bReadOnly )
     if ( mbReadOnly != bool(bReadOnly) )
     {
         mbReadOnly = bReadOnly;
-        if ( mpSubEdit.get() )
+        if ( mpSubEdit )
             mpSubEdit->SetReadOnly( bReadOnly );
 
         StateChanged( StateChangedType::READONLY );
@@ -2464,7 +2464,7 @@ void Edit::SetInsertMode( bool bInsert )
     if ( bInsert != mbInsertMode )
     {
         mbInsertMode = bInsert;
-        if ( mpSubEdit.get() )
+        if ( mpSubEdit )
             mpSubEdit->SetInsertMode( bInsert );
         else
             ImplShowCursor();
@@ -2473,7 +2473,7 @@ void Edit::SetInsertMode( bool bInsert )
 
 bool Edit::IsInsertMode() const
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         return mpSubEdit->IsInsertMode();
     else
         return mbInsertMode;
@@ -2483,7 +2483,7 @@ void Edit::SetMaxTextLen(sal_Int32 nMaxLen)
 {
     mnMaxTextLen = nMaxLen > 0 ? nMaxLen : EDIT_NOLIMIT;
 
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->SetMaxTextLen( mnMaxTextLen );
     else
     {
@@ -2498,7 +2498,7 @@ void Edit::SetSelection( const Selection& rSelection )
     // directly afterwards which would change the selection again
     if ( IsTracking() )
         EndTracking();
-    else if ( mpSubEdit.get() && mpSubEdit->IsTracking() )
+    else if ( mpSubEdit && mpSubEdit->IsTracking() )
         mpSubEdit->EndTracking();
 
     ImplSetSelection( rSelection );
@@ -2506,7 +2506,7 @@ void Edit::SetSelection( const Selection& rSelection )
 
 void Edit::ImplSetSelection( const Selection& rSelection, bool bPaint )
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->ImplSetSelection( rSelection );
     else
     {
@@ -2568,7 +2568,7 @@ void Edit::ImplSetSelection( const Selection& rSelection, bool bPaint )
 
 const Selection& Edit::GetSelection() const
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         return mpSubEdit->GetSelection();
     else
         return maSelection;
@@ -2576,7 +2576,7 @@ const Selection& Edit::GetSelection() const
 
 void Edit::ReplaceSelected( const OUString& rStr )
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->ReplaceSelected( rStr );
     else
         ImplInsertText( rStr );
@@ -2584,7 +2584,7 @@ void Edit::ReplaceSelected( const OUString& rStr )
 
 void Edit::DeleteSelected()
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->DeleteSelected();
     else
     {
@@ -2595,7 +2595,7 @@ void Edit::DeleteSelected()
 
 OUString Edit::GetSelected() const
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         return mpSubEdit->GetSelected();
     else
     {
@@ -2631,7 +2631,7 @@ void Edit::Paste()
 
 void Edit::Undo()
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->Undo();
     else
     {
@@ -2645,7 +2645,7 @@ void Edit::Undo()
 
 void Edit::SetText( const OUString& rStr )
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->SetText( rStr );     // not directly ImplSetText if SetText overloaded
     else
     {
@@ -2656,7 +2656,7 @@ void Edit::SetText( const OUString& rStr )
 
 void Edit::SetText( const OUString& rStr, const Selection& rSelection )
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->SetText( rStr, rSelection );
     else
         ImplSetText( rStr, &rSelection );
@@ -2664,7 +2664,7 @@ void Edit::SetText( const OUString& rStr, const Selection& rSelection )
 
 OUString Edit::GetText() const
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         return mpSubEdit->GetText();
     else
         return maText.toString();
@@ -2672,7 +2672,7 @@ OUString Edit::GetText() const
 
 void Edit::SetPlaceholderText( const OUString& rStr )
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->SetPlaceholderText( rStr );
     else if ( maPlaceholderText != rStr )
     {
@@ -2684,7 +2684,7 @@ void Edit::SetPlaceholderText( const OUString& rStr )
 
 OUString Edit::GetPlaceholderText() const
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         return mpSubEdit->GetPlaceholderText();
 
     return maPlaceholderText;
@@ -2692,7 +2692,7 @@ OUString Edit::GetPlaceholderText() const
 
 void Edit::SetModifyFlag()
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->mbModified = true;
     else
         mbModified = true;
@@ -2700,7 +2700,7 @@ void Edit::SetModifyFlag()
 
 void Edit::ClearModifyFlag()
 {
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
         mpSubEdit->mbModified = false;
     else
         mbModified = false;
@@ -2710,7 +2710,7 @@ void Edit::SetSubEdit( VclReference<Edit> pEdit )
 {
     mpSubEdit.disposeAndClear();
     mpSubEdit = pEdit;
-    if ( mpSubEdit.get() )
+    if ( mpSubEdit )
     {
         SetPointer( POINTER_ARROW );    // Nur das SubEdit hat den BEAM...
         mpSubEdit->mbIsSubEdit = true;
@@ -2806,7 +2806,7 @@ Size Edit::CalcSize(sal_Int32 nChars) const
 
 sal_Int32 Edit::GetMaxVisChars() const
 {
-    const vcl::Window* pW = mpSubEdit.get() ? mpSubEdit.get() : this;
+    const vcl::Window* pW = mpSubEdit ? mpSubEdit : this;
     sal_Int32 nOutWidth = pW->GetOutputSizePixel().Width();
     sal_Int32 nCharWidth = GetTextWidth( OUString('x') );
     return nCharWidth ? nOutWidth/nCharWidth : 0;
@@ -3038,7 +3038,7 @@ void Edit::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEv
 
 OUString Edit::GetSurroundingText() const
 {
-    if (mpSubEdit.get())
+    if (mpSubEdit)
         return mpSubEdit->GetSurroundingText();
     return maText.toString();
 }
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 30c616c3..2500329 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1471,7 +1471,7 @@ const vcl::Window *VclExpander::get_child() const
 {
     const WindowImpl* pWindowImpl = ImplGetWindowImpl();
 
-    assert(pWindowImpl->mpFirstChild == m_pDisclosureButton.get());
+    assert(pWindowImpl->mpFirstChild == m_pDisclosureButton);
 
     return pWindowImpl->mpFirstChild->GetWindow(WINDOW_NEXT);
 }
@@ -1493,7 +1493,7 @@ Size VclExpander::calculateRequisition() const
     if (pChild && pChild->IsVisible() && m_pDisclosureButton->IsChecked())
         aRet = getLayoutRequisition(*pChild);
 
-    Size aExpanderSize = getLayoutRequisition(*m_pDisclosureButton.get());
+    Size aExpanderSize = getLayoutRequisition(*m_pDisclosureButton);
 
     if (pLabel && pLabel->IsVisible())
     {
@@ -1527,7 +1527,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_pDisclosureButton.get());
+    Size aButtonSize = getLayoutRequisition(*m_pDisclosureButton);
     Size aLabelSize;
     Size aExpanderSize = aButtonSize;
     if (pLabel && pLabel->IsVisible())
@@ -1545,7 +1545,7 @@ void VclExpander::setAllocation(const Size &rAllocation)
 
     long nExtraExpanderHeight = aExpanderSize.Height() - aButtonSize.Height();
     Point aButtonPos(aChildPos.X(), aChildPos.Y() + nExtraExpanderHeight/2);
-    setLayoutAllocation(*m_pDisclosureButton.get(), aButtonPos, aButtonSize);
+    setLayoutAllocation(*m_pDisclosureButton, aButtonPos, aButtonSize);
 
     if (pLabel && pLabel->IsVisible())
     {
@@ -1672,10 +1672,10 @@ Size VclScrolledWindow::calculateRequisition() const
         aRet = getLayoutRequisition(*pChild);
 
     if (GetStyle() & WB_VSCROLL)
-        aRet.Width() += getLayoutRequisition(*m_pVScroll.get()).Width();
+        aRet.Width() += getLayoutRequisition(*m_pVScroll).Width();
 
     if (GetStyle() & WB_HSCROLL)
-        aRet.Height() += getLayoutRequisition(*m_pHScroll.get()).Height();
+        aRet.Height() += getLayoutRequisition(*m_pHScroll).Height();
 
     return aRet;
 }
@@ -1721,7 +1721,7 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation)
     }
 
     if (m_pVScroll->IsVisible())
-        nAvailWidth -= getLayoutRequisition(*m_pVScroll.get()).Width();
+        nAvailWidth -= getLayoutRequisition(*m_pVScroll).Width();
 
     // horz. ScrollBar
     if (GetStyle() & WB_AUTOHSCROLL)
@@ -1730,7 +1730,7 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation)
         m_pHScroll->Show(bShowHScroll);
 
         if (bShowHScroll)
-            nAvailHeight -= getLayoutRequisition(*m_pHScroll.get()).Height();
+            nAvailHeight -= getLayoutRequisition(*m_pHScroll).Height();
 
         if (GetStyle() & WB_AUTOVSCROLL)
             m_pVScroll->Show(nAvailHeight < aChildReq.Height());
@@ -1741,10 +1741,10 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation)
 
     if (m_pVScroll->IsVisible())
     {
-        nScrollBarWidth = getLayoutRequisition(*m_pVScroll.get()).Width();
+        nScrollBarWidth = getLayoutRequisition(*m_pVScroll).Width();
         Point aScrollPos(rAllocation.Width() - nScrollBarWidth, 0);
         Size aScrollSize(nScrollBarWidth, rAllocation.Height());
-        setLayoutAllocation(*m_pVScroll.get(), aScrollPos, aScrollSize);
+        setLayoutAllocation(*m_pVScroll, aScrollPos, aScrollSize);
         aChildAllocation.Width() -= nScrollBarWidth;
         aInnerSize.Width() -= nScrollBarWidth;
         aChildAllocation.Height() = aChildReq.Height();
@@ -1752,10 +1752,10 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation)
 
     if (m_pHScroll->IsVisible())
     {
-        nScrollBarHeight = getLayoutRequisition(*m_pHScroll.get()).Height();
+        nScrollBarHeight = getLayoutRequisition(*m_pHScroll).Height();
         Point aScrollPos(0, rAllocation.Height() - nScrollBarHeight);
         Size aScrollSize(rAllocation.Width(), nScrollBarHeight);
-        setLayoutAllocation(*m_pHScroll.get(), aScrollPos, aScrollSize);
+        setLayoutAllocation(*m_pHScroll, aScrollPos, aScrollSize);
         aChildAllocation.Height() -= nScrollBarHeight;
         aInnerSize.Height() -= nScrollBarHeight;
         aChildAllocation.Width() = aChildReq.Width();
@@ -1811,7 +1811,7 @@ bool VclScrolledWindow::Notify(NotifyEvent& rNEvt)
             const CommandWheelData* pData = rCEvt.GetWheelData();
             if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
             {
-                nDone = HandleScrollCommand(rCEvt, m_pHScroll.get(), m_pVScroll.get());
+                nDone = HandleScrollCommand(rCEvt, m_pHScroll, m_pVScroll);
             }
         }
     }
@@ -1942,7 +1942,7 @@ void MessageDialog::create_owned_areas()
     m_pOwnedContentArea = new VclVBox(this, false, 24);
     set_content_area(m_pOwnedContentArea);
     m_pOwnedContentArea->Show();
-    m_pOwnedActionArea = new VclHButtonBox(m_pOwnedContentArea.get());
+    m_pOwnedActionArea = new VclHButtonBox(m_pOwnedContentArea);
     set_action_area(m_pOwnedActionArea);
     m_pOwnedActionArea->Show();
 }
@@ -2100,7 +2100,7 @@ short MessageDialog::Execute()
 {
     setDeferredProperties();
 
-    if (!m_pGrid.get())
+    if (!m_pGrid)
     {
         VclContainer *pContainer = get_content_area();
         assert(pContainer);
@@ -2110,7 +2110,7 @@ short MessageDialog::Execute()
         m_pGrid->set_column_spacing(12);
         m_pGrid->set_row_spacing(GetTextHeight());
 
-        m_pImage = new FixedImage(m_pGrid.get(), WB_CENTER | WB_VCENTER | WB_3DLOOK);
+        m_pImage = new FixedImage(m_pGrid, WB_CENTER | WB_VCENTER | WB_3DLOOK);
         switch (m_eMessageType)
         {
             case VCL_MESSAGE_INFO:
@@ -2135,7 +2135,7 @@ short MessageDialog::Execute()
 
         bool bHasSecondaryText = !m_sSecondaryString.isEmpty();
 
-        m_pPrimaryMessage = new VclMultiLineEdit(m_pGrid.get(), nWinStyle);
+        m_pPrimaryMessage = new VclMultiLineEdit(m_pGrid, nWinStyle);
         m_pPrimaryMessage->SetPaintTransparent(true);
         m_pPrimaryMessage->EnableCursor(false);
 
@@ -2145,7 +2145,7 @@ short MessageDialog::Execute()
         m_pPrimaryMessage->SetText(m_sPrimaryString);
         m_pPrimaryMessage->Show(!m_sPrimaryString.isEmpty());
 
-        m_pSecondaryMessage = new VclMultiLineEdit(m_pGrid.get(), nWinStyle);
+        m_pSecondaryMessage = new VclMultiLineEdit(m_pGrid, nWinStyle);
         m_pSecondaryMessage->SetPaintTransparent(true);
         m_pSecondaryMessage->EnableCursor(false);
         m_pSecondaryMessage->set_grid_left_attach(1);
@@ -2169,46 +2169,46 @@ short MessageDialog::Execute()
                 pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON);
                 pBtn->Show();
                 m_aOwnedButtons.push_back(pBtn);
-                m_aResponses[pBtn.get()] = RET_OK;
+                m_aResponses[pBtn] = RET_OK;
                 break;
             case VCL_BUTTONS_CLOSE:
                 pBtn = new CloseButton(pButtonBox);
                 pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON);
                 pBtn->Show();
                 m_aOwnedButtons.push_back(pBtn);
-                m_aResponses[pBtn.get()] = RET_CLOSE;
+                m_aResponses[pBtn] = RET_CLOSE;
                 break;
             case VCL_BUTTONS_CANCEL:
                 pBtn = new CancelButton(pButtonBox);
                 pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON);
                 m_aOwnedButtons.push_back(pBtn);
-                m_aResponses[pBtn.get()] = RET_CANCEL;
+                m_aResponses[pBtn] = RET_CANCEL;
                 break;
             case VCL_BUTTONS_YES_NO:
                 pBtn = new PushButton(pButtonBox);
                 pBtn->SetText(Button::GetStandardText(BUTTON_YES));
                 pBtn->Show();
                 m_aOwnedButtons.push_back(pBtn);
-                m_aResponses[pBtn.get()] = RET_YES;
+                m_aResponses[pBtn] = RET_YES;
 
                 pBtn = new PushButton(pButtonBox);
                 pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON);
                 pBtn->SetText(Button::GetStandardText(BUTTON_NO));
                 pBtn->Show();
                 m_aOwnedButtons.push_back(pBtn);
-                m_aResponses[pBtn.get()] = RET_NO;
+                m_aResponses[pBtn] = RET_NO;
                 break;
             case VCL_BUTTONS_OK_CANCEL:
                 pBtn = new OKButton(pButtonBox);
                 pBtn->Show();
                 m_aOwnedButtons.push_back(pBtn);
-                m_aResponses[pBtn.get()] = RET_OK;
+                m_aResponses[pBtn] = RET_OK;
 
                 pBtn = new CancelButton(pButtonBox);
                 pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON);
                 pBtn->Show();
                 m_aOwnedButtons.push_back(pBtn);
-                m_aResponses[pBtn.get()] = RET_CANCEL;
+                m_aResponses[pBtn] = RET_CANCEL;
                 break;
         }
         setButtonHandlers(pButtonBox);
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index 377f621..f9ecc21 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -468,7 +468,7 @@ void IIIMPStatusWindow::GetFocus()
 
 IMPL_LINK( IIIMPStatusWindow, SelectHdl, MenuButton*, pBtn )
 {
-    if( pBtn == m_aStatusBtn.get() )
+    if( pBtn == m_aStatusBtn )
     {
         const ::std::vector< I18NStatus::ChoiceData >& rChoices( I18NStatus::get().getChoices() );
         unsigned int nIndex = m_aStatusBtn->GetCurItemId()-1;


More information about the Libreoffice-commits mailing list