diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-02 14:35:31 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-04 12:30:41 -0500 |
commit | 28bf1a3a1408df042d7e767c3760e47faf2d077e (patch) | |
tree | c4e3534682b14ae33f6e24a3cadd8f9c58fc4644 /chart2 | |
parent | f281d2d24c2a368c58d32b1b50acf83e0f056d90 (diff) |
Avoid re-constructing chart shapes when it's not in visible range.
The re-construction will be deferred until it becomes visible again.
Change-Id: I364ea8d38d48078dfd803b0e5bb20bfc8a2913ba
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/inc/ChartView.hxx | 10 | ||||
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 16 |
2 files changed, 20 insertions, 6 deletions
diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index d155c45983f9..047192aec7b6 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -37,7 +37,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XModifyListener.hpp> #include <com/sun/star/util/XModeChangeBroadcaster.hpp> -#include <com/sun/star/util/XUpdatable.hpp> +#include <com/sun/star/util/XUpdatable2.hpp> #include <com/sun/star/qa/XDumper.hpp> #include <vector> @@ -96,7 +96,7 @@ class ChartView : public ::cppu::WeakImplHelper10< ,::com::sun::star::lang::XUnoTunnel ,::com::sun::star::util::XModifyListener ,::com::sun::star::util::XModeChangeBroadcaster - ,::com::sun::star::util::XUpdatable + ,::com::sun::star::util::XUpdatable2 ,::com::sun::star::beans::XPropertySet ,::com::sun::star::lang::XMultiServiceFactory ,::com::sun::star::qa::XDumper @@ -169,6 +169,10 @@ public: // ::com::sun::star::util::XUpdatable virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + // util::XUpdatable2 + virtual void SAL_CALL updateSoft() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + virtual void SAL_CALL updateHard() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + // ::com::sun::star::beans::XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; @@ -217,7 +221,7 @@ private: //methods void impl_refreshAddIn(); bool impl_AddInDrawsAllByItself(); - void impl_updateView(); + void impl_updateView( bool bCheckLockedCtrler = true ); void render(); diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 63ba12abda30..edf6dc983693 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2627,7 +2627,7 @@ void SAL_CALL ChartView::disposing( const lang::EventObject& /* rSource */ ) { } -void ChartView::impl_updateView() +void ChartView::impl_updateView( bool bCheckLockedCtrler ) { if( !m_pDrawModelWrapper ) return; @@ -2638,7 +2638,7 @@ void ChartView::impl_updateView() return; } - if (mrChartModel.hasControllersLocked()) + if (bCheckLockedCtrler && mrChartModel.hasControllersLocked()) return; if( m_bViewDirty && !m_bInViewUpdate ) @@ -2822,7 +2822,7 @@ void SAL_CALL ChartView::removeModeChangeApproveListener( const uno::Reference< // ____ XUpdatable ____ void SAL_CALL ChartView::update() throw (uno::RuntimeException, std::exception) { - impl_updateView(); + impl_updateView(true); //#i100778# migrate all imported or old documents to a plot area sizing exclusive axes (in case the save settings allow for this): //Although in general it is a bad idea to change the model from within the view this is exceptionally the best place to do this special conversion. @@ -2833,6 +2833,16 @@ void SAL_CALL ChartView::update() throw (uno::RuntimeException, std::exception) impl_updateView(); } +void SAL_CALL ChartView::updateSoft() throw (uno::RuntimeException, std::exception) +{ + update(); +} + +void SAL_CALL ChartView::updateHard() throw (uno::RuntimeException, std::exception) +{ + impl_updateView(false); +} + // ____ XPropertySet ____ Reference< beans::XPropertySetInfo > SAL_CALL ChartView::getPropertySetInfo() throw (uno::RuntimeException, std::exception) |