summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-16 12:22:48 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-16 12:22:48 +0100
commitfa0b1d6e1d2850cae0cd11e33d662c8d8fad20a9 (patch)
tree636444c3c912ff88fa511e9f341baa675b09cc96 /chart2/source
parent4d0ae2eac2ac03475b7496f81e803b9b71b7481f (diff)
undoapi: derive XUndoManager from XChild, to allow convenient access to the document it belongs to
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/main/UndoGuard.cxx18
-rwxr-xr-xchart2/source/model/main/UndoManager.hxx7
2 files changed, 7 insertions, 18 deletions
diff --git a/chart2/source/controller/main/UndoGuard.cxx b/chart2/source/controller/main/UndoGuard.cxx
index b89b463cc0eb..1be8af4de180 100644
--- a/chart2/source/controller/main/UndoGuard.cxx
+++ b/chart2/source/controller/main/UndoGuard.cxx
@@ -45,22 +45,12 @@ namespace chart
{
//-----------------------------------------------------------------------------
-namespace
-{
- uno::Reference< uno::XInterface > lcl_getParent( const uno::Reference< uno::XInterface >& i_component )
- {
- const uno::Reference< container::XChild > xAsChild( i_component, uno::UNO_QUERY_THROW );
- return xAsChild->getParent();
- }
-}
-
-//-----------------------------------------------------------------------------
UndoGuard_Base::UndoGuard_Base( const OUString& i_undoString, const uno::Reference< document::XUndoManager > & i_undoManager )
- :m_xChartModel( lcl_getParent( i_undoManager ), uno::UNO_QUERY_THROW )
- ,m_xUndoManager( i_undoManager )
- ,m_aUndoString( i_undoString )
- ,m_bActionPosted( false )
+ :m_xChartModel( i_undoManager->getParent(), uno::UNO_QUERY_THROW )
+ ,m_xUndoManager( i_undoManager )
+ ,m_aUndoString( i_undoString )
+ ,m_bActionPosted( false )
{
}
diff --git a/chart2/source/model/main/UndoManager.hxx b/chart2/source/model/main/UndoManager.hxx
index 28f41afd6241..9071a9010b47 100755
--- a/chart2/source/model/main/UndoManager.hxx
+++ b/chart2/source/model/main/UndoManager.hxx
@@ -32,7 +32,7 @@
#include <com/sun/star/container/XChild.hpp>
/** === end UNO includes === **/
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <boost/scoped_ptr.hpp>
@@ -44,8 +44,7 @@ namespace chart
namespace impl
{
class UndoManager_Impl;
- typedef ::cppu::ImplHelper2 < ::com::sun::star::document::XUndoManager
- , ::com::sun::star::container::XChild
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::document::XUndoManager
> UndoManager_Base;
}
@@ -89,7 +88,7 @@ namespace chart
virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException);
- // XChild
+ // XChild (base of XUndoManager)
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);