[Libreoffice-commits] core.git: 2 commits - chart2/source sc/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Tue Mar 28 20:00:12 UTC 2017


 chart2/source/controller/main/ChartController.cxx |    9 ++++++---
 sc/source/ui/view/gridwin_dbgutil.cxx             |    4 ++--
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 799824565b783ec0b2323bd609a0e69a70182ac1
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Tue Mar 28 13:00:03 2017 +0000

    fix too small loop var
    
    Change-Id: Icaa64ac579a55f53fb1397e5eeee6dcc4c9d37cc
    Reviewed-on: https://gerrit.libreoffice.org/35802
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx
index 517bbe08dd8f..54050a4287ee 100644
--- a/sc/source/ui/view/gridwin_dbgutil.cxx
+++ b/sc/source/ui/view/gridwin_dbgutil.cxx
@@ -96,8 +96,8 @@ void ScGridWindow::dumpGraphicInformation()
         for (sal_uInt16 nPage = 0; nPage < nPageCount; ++nPage)
         {
             SdrPage* pPage = pDrawLayer->GetPage(nPage);
-            sal_uInt16 nObjCount = pPage->GetObjCount();
-            for (sal_uInt16 nObj = 0; nObj < nObjCount; ++nObj)
+            size_t nObjCount = pPage->GetObjCount();
+            for (size_t nObj = 0; nObj < nObjCount; ++nObj)
             {
                 SdrObject* pObj = pPage->GetObj(nObj);
                 std::cout << "Graphic Object" << std::endl;
commit 539470ebd5c47a7876ccc19df6110acacd477bb8
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sun Mar 26 00:42:31 2017 +0100

    it makes no sense for CC to leak resources when its unaware of model
    
    - if the UNO_QUERY_THROW cast throws, this skips all of the disposing
      (and thus leaks)
    - the whole try-catch-ignore case has been there since early c6b95527
    - even in that commit message, no sane justification has been given
    - apparently the try-block was Java-style "catch exceptions until it
      runs" cargo-cult
    - this change is still the more conservative change: probably the whole
      try-catch framing should be removed
    
    Change-Id: Ie3a71e48eb056afd8a844e19898dc1555de4297e
    Reviewed-on: https://gerrit.libreoffice.org/35690
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 3d163b791e1a..394a4e5b760b 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -803,8 +803,9 @@ void SAL_CALL ChartController::dispose()
 
         //--release all resources and references
         {
-            uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(getModel(), uno::UNO_QUERY_THROW);
-            x3DWindowProvider->setWindow(0);
+            uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(getModel(), uno::UNO_QUERY);
+            if(x3DWindowProvider.is())
+                x3DWindowProvider->setWindow(0);
 
             uno::Reference< util::XModeChangeBroadcaster > xViewBroadcaster( m_xChartView, uno::UNO_QUERY );
             if( xViewBroadcaster.is() )
@@ -818,7 +819,8 @@ void SAL_CALL ChartController::dispose()
             m_apDropTargetHelper.reset();
 
             //the accessible view is disposed within window destructor of m_pChartWindow
-            m_xViewWindow->dispose(); //ChartWindow is deleted via UNO due to dispose of m_xViewWindow (triggered by Framework (Controller pretends to be XWindow also))
+            if(m_xViewWindow.is())
+                m_xViewWindow->dispose(); //ChartWindow is deleted via UNO due to dispose of m_xViewWindow (triggered by Framework (Controller pretends to be XWindow also))
             m_xChartView.clear();
         }
 
@@ -865,6 +867,7 @@ void SAL_CALL ChartController::dispose()
     }
     catch( const uno::Exception & ex )
     {
+        assert(!m_xChartView.is());
         ASSERT_EXCEPTION( ex );
     }
  }


More information about the Libreoffice-commits mailing list