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

Arkadiy Illarionov (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 20 05:52:49 UTC 2019


 chart2/source/controller/accessibility/AccessibleBase.cxx      |    3 +
 chart2/source/controller/accessibility/AccessibleChartView.cxx |    4 +-
 chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx       |    4 +-
 chart2/source/controller/main/ChartController.cxx              |    2 -
 chart2/source/controller/main/ChartController_Position.cxx     |    3 +
 chart2/source/controller/main/ChartController_Properties.cxx   |    3 +
 chart2/source/controller/main/ChartController_Window.cxx       |    6 +--
 chart2/source/controller/uitest/uiobject.cxx                   |    4 +-
 chart2/source/inc/chartview/ExplicitValueProvider.hxx          |    1 
 chart2/source/view/main/ChartView.cxx                          |   16 ----------
 10 files changed, 20 insertions(+), 26 deletions(-)

New commits:
commit 336b9a14f65222936d000551ed9728ab13514479
Author:     Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Wed Jun 19 22:35:40 2019 +0300
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jun 20 07:51:48 2019 +0200

    tdf#39593 Remove chart::ExplicitValueProvider::getExplicitValueProvider
    
    Replace with comphelper::getUnoTunnelImplementation.
    
    Change-Id: I8a457dc2aa701957f463b31bd6cc112337999aad
    Reviewed-on: https://gerrit.libreoffice.org/74377
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx
index 7f545b35c018..ff1008abedd9 100644
--- a/chart2/source/controller/accessibility/AccessibleBase.cxx
+++ b/chart2/source/controller/accessibility/AccessibleBase.cxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <sal/log.hxx>
 #include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <vcl/unohelp.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
@@ -631,7 +632,7 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleAtPoint( const aw
 awt::Rectangle SAL_CALL AccessibleBase::getBounds()
 {
     ExplicitValueProvider *pExplicitValueProvider(
-        ExplicitValueProvider::getExplicitValueProvider( m_aAccInfo.m_xView ));
+        comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_aAccInfo.m_xView ));
     if( pExplicitValueProvider )
     {
         VclPtr<vcl::Window> pWindow( VCLUnoHelper::GetWindow( m_aAccInfo.m_xWindow ));
diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx
index 15ec18a6517b..4d5e1d89ae7f 100644
--- a/chart2/source/controller/accessibility/AccessibleChartView.cxx
+++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx
@@ -30,6 +30,8 @@
 #include <com/sun/star/view/XSelectionSupplier.hpp>
 #include <com/sun/star/chart2/XChartDocument.hpp>
 
+#include <comphelper/servicehelper.hxx>
+
 #include <rtl/ustring.hxx>
 #include <vcl/window.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
@@ -296,7 +298,7 @@ void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments
             Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
             if( xChartDoc.is())
                 m_spObjectHierarchy.reset(
-                    new ObjectHierarchy( xChartDoc, ExplicitValueProvider::getExplicitValueProvider(m_xChartView) ));
+                    new ObjectHierarchy( xChartDoc, comphelper::getUnoTunnelImplementation<ExplicitValueProvider>(m_xChartView) ));
             else
                 m_spObjectHierarchy.reset();
         }
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
index 65c201232352..634840e367b6 100644
--- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
@@ -27,6 +27,8 @@
 #include <AxisHelper.hxx>
 #include <ObjectNameProvider.hxx>
 
+#include <comphelper/servicehelper.hxx>
+
 using ::com::sun::star::uno::Reference;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::chart2;
@@ -67,7 +69,7 @@ double InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals(
 {
     double fStepWidth = 0.001;
 
-    ExplicitValueProvider* pExplicitValueProvider( ExplicitValueProvider::getExplicitValueProvider(xChartView) );
+    ExplicitValueProvider* pExplicitValueProvider( comphelper::getUnoTunnelImplementation<ExplicitValueProvider>(xChartView) );
     if( pExplicitValueProvider )
     {
         Reference< XAxis > xAxis;
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 15a30767c63c..6473cd683d24 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1466,7 +1466,7 @@ DrawModelWrapper* ChartController::GetDrawModelWrapper()
 {
     if( !m_pDrawModelWrapper.get() )
     {
-        ExplicitValueProvider* pProvider = ExplicitValueProvider::getExplicitValueProvider( m_xChartView );
+        ExplicitValueProvider* pProvider = comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_xChartView );
         if( pProvider )
             m_pDrawModelWrapper = pProvider->getDrawModelWrapper();
         if ( m_pDrawModelWrapper.get() )
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 8df27d382153..4033a8272d7d 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -31,6 +31,7 @@
 #include <CommonConverters.hxx>
 #include <svx/ActionDescriptionProvider.hxx>
 
+#include <comphelper/servicehelper.hxx>
 #include <sal/log.hxx>
 #include <svx/svxids.hrc>
 #include <svx/rectenum.hxx>
@@ -116,7 +117,7 @@ void ChartController::executeDispatch_PositionAndSize(const ::css::uno::Sequence
         return;
 
     awt::Size aSelectedSize;
-    ExplicitValueProvider* pProvider( ExplicitValueProvider::getExplicitValueProvider( m_xChartView ) );
+    ExplicitValueProvider* pProvider( comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_xChartView ) );
     if( pProvider )
         aSelectedSize = ToSize( pProvider->getRectangleOfObject( aCID ) );
 
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 32688d35cb95..ef29211ce098 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -53,6 +53,7 @@
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/util/CloseVetoException.hpp>
 #include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
+#include <comphelper/servicehelper.hxx>
 
 #include <memory>
 
@@ -740,7 +741,7 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
         std::unique_ptr<wrapper::ItemConverter> pItemConverter(
             createItemConverter( rObjectCID, getModel(), m_xCC,
                                  m_pDrawModelWrapper->getSdrModel(),
-                                 ExplicitValueProvider::getExplicitValueProvider(m_xChartView),
+                                 comphelper::getUnoTunnelImplementation<ExplicitValueProvider>(m_xChartView),
                                  pRefSizeProv.get()));
 
         if (!pItemConverter)
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 97f515895741..a0dbd9877b60 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1355,7 +1355,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
     {
         // Navigation (Tab/F3/Home/End)
         uno::Reference< XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY );
-        ObjectKeyNavigation aObjNav( m_aSelection.getSelectedOID(), xChartDoc, ExplicitValueProvider::getExplicitValueProvider( m_xChartView ));
+        ObjectKeyNavigation aObjNav( m_aSelection.getSelectedOID(), xChartDoc, comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_xChartView ));
         awt::KeyEvent aKeyEvent( ::svt::AcceleratorExecute::st_VCLKey2AWTKey( aKeyCode ));
         bReturn = aObjNav.handleKeyEvent( aKeyEvent );
         if( bReturn )
@@ -1601,7 +1601,7 @@ bool ChartController::requestQuickHelp(
 
         // set rectangle
         ExplicitValueProvider * pValueProvider(
-            ExplicitValueProvider::getExplicitValueProvider( m_xChartView ));
+            comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_xChartView ));
         if( pValueProvider )
             rOutEqualRect = pValueProvider->getRectangleOfObject( aCID, true );
     }
@@ -1769,7 +1769,7 @@ bool ChartController::impl_moveOrResizeObject(
             ( aRefSize.Width > 0 && aRefSize.Height > 0 ) )
         {
             ExplicitValueProvider * pValueProvider(
-                ExplicitValueProvider::getExplicitValueProvider( m_xChartView ));
+                comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_xChartView ));
             if( pValueProvider )
             {
                 awt::Rectangle aRect( pValueProvider->getRectangleOfObject( rCID ));
diff --git a/chart2/source/controller/uitest/uiobject.cxx b/chart2/source/controller/uitest/uiobject.cxx
index 7dd9697ec217..0bc697a4daf7 100644
--- a/chart2/source/controller/uitest/uiobject.cxx
+++ b/chart2/source/controller/uitest/uiobject.cxx
@@ -16,6 +16,8 @@
 #include <chartview/ExplicitValueProvider.hxx>
 #include <com/sun/star/chart2/XChartDocument.hpp>
 
+#include <comphelper/servicehelper.hxx>
+
 #include <vcl/svapp.hxx>
 
 #include <algorithm>
@@ -173,7 +175,7 @@ std::set<OUString> ChartWindowUIObject::get_children() const
     css::uno::Reference< css::chart2::XChartDocument > xChartDoc( pController->getModel(), css::uno::UNO_QUERY );
 
     css::uno::Reference<css::uno::XInterface> xChartView = pController->getChartView();
-    chart::ExplicitValueProvider* pValueProvider = chart::ExplicitValueProvider::getExplicitValueProvider( xChartView );
+    chart::ExplicitValueProvider* pValueProvider = comphelper::getUnoTunnelImplementation<chart::ExplicitValueProvider>( xChartView );
     chart::ObjectHierarchy aHierarchy(xChartDoc, pValueProvider, true);
     chart::ObjectIdentifier aIdentifier = chart::ObjectHierarchy::getRootNodeOID();
     aChildren.insert(aIdentifier.getObjectCID());
diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
index 241fe10ead99..7fec9b254625 100644
--- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx
+++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
@@ -69,7 +69,6 @@ public:
     virtual std::shared_ptr< DrawModelWrapper > getDrawModelWrapper() = 0;
 
     static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
-    static ExplicitValueProvider* getExplicitValueProvider( const css::uno::Reference< css::uno::XInterface >& xChartView );
 
     static css::awt::Rectangle
         AddSubtractAxisTitleSizes(
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 18c9380e6db8..4fc6b67e64c7 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1047,20 +1047,6 @@ const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId()
     return theExplicitValueProviderUnoTunnelId::get().getSeq();
 }
 
-ExplicitValueProvider* ExplicitValueProvider::getExplicitValueProvider(
-        const Reference< uno::XInterface >& xChartView )
-{
-    ExplicitValueProvider* pExplicitValueProvider=nullptr;
-
-    Reference< lang::XUnoTunnel > xTunnel( xChartView, uno::UNO_QUERY );
-    if( xTunnel.is() )
-    {
-        pExplicitValueProvider = reinterpret_cast<ExplicitValueProvider*>(xTunnel->getSomething(
-            ExplicitValueProvider::getUnoTunnelId() ));
-    }
-    return pExplicitValueProvider;
-}
-
 ChartView::ChartView(
         uno::Reference<uno::XComponentContext> const & xContext,
         ChartModel& rModel)
@@ -1977,7 +1963,7 @@ awt::Rectangle ExplicitValueProvider::AddSubtractAxisTitleSizes(
     uno::Reference< chart2::XTitle > xSecondTitle_Width( TitleHelper::getTitle( TitleHelper::SECONDARY_Y_AXIS_TITLE, rModel ) );
     if( xTitle_Height.is() || xTitle_Width.is() || xSecondTitle_Height.is() || xSecondTitle_Width.is() )
     {
-        ExplicitValueProvider* pExplicitValueProvider = ExplicitValueProvider::getExplicitValueProvider(xChartView);
+        ExplicitValueProvider* pExplicitValueProvider = comphelper::getUnoTunnelImplementation<ExplicitValueProvider>(xChartView);
         if( pExplicitValueProvider )
         {
             //detect whether x axis points into x direction or not


More information about the Libreoffice-commits mailing list