summaryrefslogtreecommitdiff
path: root/reportdesign/inc
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-25 14:29:43 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-25 14:29:43 +0100
commit4ae5573a0f94cc859ba2c30ac71bcd2ff8677f1f (patch)
tree42b732a30c938aae158d5f7c1a44dcd3f4ac4ac9 /reportdesign/inc
parent5cf47c0008eb4126cfc41c59fbeeb4d73c8e22b1 (diff)
undoapi: migrated report designer to use an own, model-bound UndoManager, instead of the UndoManager formerly bound to the controller
Diffstat (limited to 'reportdesign/inc')
-rwxr-xr-x[-rw-r--r--]reportdesign/inc/ReportDefinition.hxx77
-rw-r--r--reportdesign/inc/RptModel.hxx8
-rw-r--r--reportdesign/inc/UndoActions.hxx52
3 files changed, 94 insertions, 43 deletions
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index d932110bc5f3..68a16e609b77 100644..100755
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -29,25 +29,36 @@
#define REPORTDESIGN_API_REPORTDEFINITION_HXX
#include "dllapi.h"
-#include <com/sun/star/report/XReportDefinition.hpp>
-#include <cppuhelper/compbase12.hxx>
-#include <cppuhelper/basemutex.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
+
+#include "ReportHelperDefines.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+#include <com/sun/star/frame/XModule.hpp>
#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
#include <com/sun/star/frame/XUntitledNumbers.hpp>
-#include <com/sun/star/frame/XModule.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
-#include <com/sun/star/datatransfer/XTransferable.hpp>
-#include <cppuhelper/propertysetmixin.hxx>
-#include <comphelper/uno3.hxx>
+/** === end UNO includes === **/
+
#include <comphelper/embeddedobjectcontainer.hxx>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/propertysetmixin.hxx>
#include <svx/unomod.hxx>
-#include "ReportHelperDefines.hxx"
+#if !defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13
+#include <comphelper/implbase_var.hxx>
+#endif
+
#include <boost/shared_ptr.hpp>
@@ -62,32 +73,37 @@ namespace comphelper
namespace reportdesign
{
class OReportComponentProperties;
- typedef ::cppu::WeakComponentImplHelper12< com::sun::star::report::XReportDefinition
- ,com::sun::star::document::XEventBroadcaster
- ,com::sun::star::lang::XServiceInfo
- ,com::sun::star::frame::XModule
- ,com::sun::star::lang::XUnoTunnel
- ,com::sun::star::util::XNumberFormatsSupplier
- ,::com::sun::star::frame::XTitle
- ,::com::sun::star::frame::XTitleChangeBroadcaster
- ,::com::sun::star::frame::XUntitledNumbers
- ,::com::sun::star::document::XDocumentPropertiesSupplier
- ,::com::sun::star::datatransfer::XTransferable
- ,SvxUnoDrawMSFactory> ReportDefinitionBase;
- typedef ::cppu::PropertySetMixin<com::sun::star::report::XReportDefinition> ReportDefinitionPropertySet;
+ typedef ::comphelper::WeakComponentImplHelper13 < ::com::sun::star::report::XReportDefinition
+ , ::com::sun::star::document::XEventBroadcaster
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::frame::XModule
+ , ::com::sun::star::lang::XUnoTunnel
+ , ::com::sun::star::util::XNumberFormatsSupplier
+ , ::com::sun::star::frame::XTitle
+ , ::com::sun::star::frame::XTitleChangeBroadcaster
+ , ::com::sun::star::frame::XUntitledNumbers
+ , ::com::sun::star::document::XDocumentPropertiesSupplier
+ , ::com::sun::star::datatransfer::XTransferable
+ , ::com::sun::star::document::XUndoManagerSupplier
+ , SvxUnoDrawMSFactory
+ > ReportDefinitionBase;
+
+ typedef ::cppu::PropertySetMixin< ::com::sun::star::report::XReportDefinition > ReportDefinitionPropertySet;
struct OReportDefinitionImpl;
/** \class OReportDefinition Defines the implementation of a \interface com:::sun::star::report::XReportDefinition
* \ingroup reportdesign_api
*
*/
- class REPORTDESIGN_DLLPUBLIC OReportDefinition : public ::cppu::BaseMutex,
- public ReportDefinitionBase,
- public ReportDefinitionPropertySet,
- public ::comphelper::IEmbeddedHelper
+ class REPORTDESIGN_DLLPUBLIC OReportDefinition :public ::cppu::BaseMutex
+ ,public ReportDefinitionBase
+ ,public ReportDefinitionPropertySet
+ ,public ::comphelper::IEmbeddedHelper
{
+ private:
::boost::shared_ptr<OReportComponentProperties> m_aProps;
::boost::shared_ptr<OReportDefinitionImpl> m_pImpl;
+
private:
OReportDefinition(const OReportDefinition&);
OReportDefinition& operator=(const OReportDefinition&);
@@ -380,6 +396,9 @@ namespace reportdesign
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw (::com::sun::star::uno::RuntimeException);
+ // XUndoManagerSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL getUndoManager( ) throw (::com::sun::star::uno::RuntimeException);
+
// comphelper::IEmbeddedHelper
virtual com::sun::star::uno::Reference < com::sun::star::embed::XStorage > getStorage() const;
virtual ::comphelper::EmbeddedObjectContainer& getEmbeddedObjectContainer() const;
diff --git a/reportdesign/inc/RptModel.hxx b/reportdesign/inc/RptModel.hxx
index 872938426259..da0b92186ace 100644
--- a/reportdesign/inc/RptModel.hxx
+++ b/reportdesign/inc/RptModel.hxx
@@ -35,7 +35,7 @@
class Window;
namespace dbaui
{
- class OSingleDocumentController;
+ class DBSubComponentController;
}
namespace reportdesign
{
@@ -56,7 +56,7 @@ class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
private:
OXUndoEnvironment* m_pUndoEnv;
- ::dbaui::OSingleDocumentController* m_pController;
+ ::dbaui::DBSubComponentController* m_pController;
::reportdesign::OReportDefinition* m_pReportDefinition;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
@@ -79,8 +79,8 @@ public:
OXUndoEnvironment& GetUndoEnv();
void SetModified(sal_Bool _bModified);
- inline dbaui::OSingleDocumentController* getController() const { return m_pController; }
- inline void attachController( dbaui::OSingleDocumentController& _rController ) { m_pController = &_rController; }
+ inline dbaui::DBSubComponentController* getController() const { return m_pController; }
+ inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; }
void detachController();
OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx
index 180fa616cf39..cda3a2d6b4a2 100644
--- a/reportdesign/inc/UndoActions.hxx
+++ b/reportdesign/inc/UndoActions.hxx
@@ -28,8 +28,9 @@
#define RPTUI_UNDOACTIONS_HXX
#include "dllapi.h"
-#include <svx/svdundo.hxx>
-#include <tools/string.hxx>
+
+#include "RptModel.hxx"
+
/** === begin UNO includes === **/
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -43,13 +44,16 @@
#include <com/sun/star/report/XReportComponent.hpp>
#include <com/sun/star/report/XReportDefinition.hpp>
#include <com/sun/star/report/XGroup.hpp>
+#include <com/sun/star/document/XUndoManager.hpp>
/** === end UNO includes === **/
+
#include <cppuhelper/implbase3.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/sequence.hxx>
#include <svl/lstner.hxx>
#include <svx/svdouno.hxx>
-#include "RptModel.hxx"
+#include <svx/svdundo.hxx>
+#include <tools/string.hxx>
#include <functional>
#include <memory>
@@ -119,23 +123,51 @@ namespace rptui
static ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> getMemberFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
};
- class REPORTDESIGN_DLLPUBLIC UndoManagerListAction
+ //==================================================================================================================
+ //= UndoContext
+ //==================================================================================================================
+ class UndoContext
{
+ public:
+ UndoContext( SfxUndoManager& i_undoManager, const ::rtl::OUString& i_undoTitle )
+ :m_rUndoManager( i_undoManager )
+ {
+ m_rUndoManager.EnterListAction( i_undoTitle, String() );
+ }
+
+ ~UndoContext()
+ {
+ m_rUndoManager.LeaveListAction();
+ }
+
private:
- SfxUndoManager& m_rManager;
+ SfxUndoManager& m_rUndoManager;
+ };
+ //==================================================================================================================
+ //= UndoSuppressor
+ //==================================================================================================================
+ class UndoSuppressor
+ {
public:
- UndoManagerListAction( SfxUndoManager& _rManager, const String& _rListActionComment )
- :m_rManager( _rManager )
+ UndoSuppressor( SfxUndoManager& i_undoManager )
+ :m_rUndoManager( i_undoManager )
{
- m_rManager.EnterListAction( _rListActionComment, String() );
+ m_rUndoManager.EnableUndo( false );
}
- ~UndoManagerListAction()
+
+ ~UndoSuppressor()
{
- m_rManager.LeaveListAction();
+ m_rUndoManager.EnableUndo( true );
}
+
+ private:
+ SfxUndoManager& m_rUndoManager;
};
+ //==================================================================================================================
+ //= OCommentUndoAction
+ //==================================================================================================================
class REPORTDESIGN_DLLPUBLIC OCommentUndoAction : public SdrUndoAction
{
protected: