[Libreoffice-commits] core.git: include/vcl vcl/source

Ras-al-Ghul dipankar1995 at gmail.com
Tue Jan 5 02:26:27 PST 2016


 include/vcl/window.hxx       |    4 ++--
 vcl/source/window/window.cxx |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit c29a6e1541f57d2a2ba8372af30e65a2a7b32a9f
Author: Ras-al-Ghul <dipankar1995 at gmail.com>
Date:   Mon Jan 4 23:41:33 2016 +0530

    tdf#89382 - vcl: unwind 'TODO' comment
    
    Have 'constified' ImplAddDel and ImplRemoveDel methods
    
    Change-Id: Id4aba9bda87b97b6a29971be802f83dea027ab22
    Reviewed-on: https://gerrit.libreoffice.org/21100
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 8257370..aafb1d7 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -593,8 +593,8 @@ public:
 
     SAL_DLLPRIVATE void                 ImplPosSizeWindow( long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags );
 
-    SAL_DLLPRIVATE void                 ImplAddDel( ImplDelData* pDel );
-    SAL_DLLPRIVATE void                 ImplRemoveDel( ImplDelData* pDel );
+    SAL_DLLPRIVATE void                 ImplAddDel( ImplDelData* pDel ) const;
+    SAL_DLLPRIVATE void                 ImplRemoveDel( ImplDelData* pDel ) const;
 
     SAL_DLLPRIVATE void                 ImplCallResize();
     SAL_DLLPRIVATE void                 ImplCallMove();
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index cc8973d..0974d2f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1395,7 +1395,7 @@ void Window::ImplSetReallyVisible()
     }
 }
 
-void Window::ImplAddDel( ImplDelData* pDel ) // TODO: make "const" when incompatibility ok
+void Window::ImplAddDel( ImplDelData* pDel ) const
 {
     if ( IsDisposed() )
     {
@@ -1406,13 +1406,13 @@ void Window::ImplAddDel( ImplDelData* pDel ) // TODO: make "const" when incompat
     DBG_ASSERT( !pDel->mpWindow, "Window::ImplAddDel(): cannot add ImplDelData twice !" );
     if( !pDel->mpWindow )
     {
-        pDel->mpWindow = this;  // #112873# store ref to this window, so pDel can remove itself
+        pDel->mpWindow = const_cast<vcl::Window*>(this);  // #112873# store ref to this window, so pDel can remove itself
         pDel->mpNext = mpWindowImpl->mpFirstDel;
         mpWindowImpl->mpFirstDel = pDel;
     }
 }
 
-void Window::ImplRemoveDel( ImplDelData* pDel ) // TODO: make "const" when incompatibility ok
+void Window::ImplRemoveDel( ImplDelData* pDel ) const
 {
     pDel->mpWindow = nullptr;      // #112873# pDel is not associated with a Window anymore
 


More information about the Libreoffice-commits mailing list