summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-17 09:11:03 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@oracle.com>2010-11-17 09:11:03 +0100
commit784ea715b333655894b2702d721fd119f81bd394 (patch)
tree72d1c5552720fd24a10dbd5e197847b57b95a976 /reportdesign
parentd5ff5c6f6810ed06b054d105416908f5a5028922 (diff)
undoapi: carry the SfxUndoManager around as &, not as *
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.cxx2
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx12
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx4
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx19
-rw-r--r--reportdesign/source/ui/report/SectionWindow.cxx4
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx2
6 files changed, 17 insertions, 26 deletions
diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx
index d3617749d10b..b271a3324022 100644
--- a/reportdesign/source/ui/dlg/CondFormat.cxx
+++ b/reportdesign/source/ui/dlg/CondFormat.cxx
@@ -466,7 +466,7 @@ namespace rptui
if ( nRet == RET_OK )
{
String sUndoAction( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) );
- UndoManagerListAction aListAction(*m_rController.getUndoMgr(),sUndoAction);
+ UndoManagerListAction aListAction(m_rController.GetUndoManager(),sUndoAction);
try
{
sal_Int32 j(0), i(0);;
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index d4ea5fa17a48..5a6b7bd1e22b 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -317,7 +317,7 @@ void OFieldExpressionControl::moveGroups(const uno::Sequence<uno::Any>& _aGroups
{
sal_Int32 nRow = _nRow;
String sUndoAction(ModuleRes(RID_STR_UNDO_MOVE_GROUP));
- UndoManagerListAction aListAction(*m_pParent->m_pController->getUndoMgr(),sUndoAction);
+ UndoManagerListAction aListAction(m_pParent->m_pController->GetUndoManager(),sUndoAction);
uno::Reference< report::XGroups> xGroups = m_pParent->getGroups();
const uno::Any* pIter = _aGroups.getConstArray();
@@ -455,7 +455,7 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow)
{
bAppend = sal_True;
String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP));
- m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() );
+ m_pParent->m_pController->GetUndoManager().EnterListAction( sUndoAction, String() );
xGroup = m_pParent->getGroups()->createGroup();
xGroup->setHeaderOn(sal_True);
@@ -499,7 +499,7 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow)
::rptui::adjustSectionName(xGroup,nPos);
if ( bAppend )
- m_pParent->m_pController->getUndoMgr()->LeaveListAction();
+ m_pParent->m_pController->GetUndoManager().LeaveListAction();
}
if ( Controller() )
@@ -824,7 +824,7 @@ void OFieldExpressionControl::DeleteRows()
{
bFirstTime = false;
String sUndoAction(ModuleRes(RID_STR_UNDO_REMOVE_SELECTION));
- m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() );
+ m_pParent->m_pController->GetUndoManager().EnterListAction( sUndoAction, String() );
}
sal_Int32 nGroupPos = m_aGroupPositions[nIndex];
@@ -844,7 +844,7 @@ void OFieldExpressionControl::DeleteRows()
} // while( nIndex >= 0 )
if ( !bFirstTime )
- m_pParent->m_pController->getUndoMgr()->LeaveListAction();
+ m_pParent->m_pController->GetUndoManager().LeaveListAction();
m_nDataPos = GetCurRow();
InvalidateStatusCell( nOldDataPos );
@@ -931,7 +931,7 @@ void OFieldExpressionControl::InsertRows( long nRow )
m_bIgnoreEvent = false;
{
String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP));
- UndoManagerListAction aListAction(*m_pParent->m_pController->getUndoMgr(),sUndoAction);
+ UndoManagerListAction aListAction(m_pParent->m_pController->GetUndoManager(),sUndoAction);
uno::Reference<report::XGroups> xGroups = m_pParent->getGroups();
sal_Int32 nGroupPos = 0;
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index 6694c81c999b..9492afd04176 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -354,10 +354,6 @@ namespace rptui
virtual void impl_onModifyChanged();
- // const ::connectivity::OSQLParseNode* getParseTree() const { return m_aSqlIterator.getParseTree();}
- // need for undo's and redo's
- SfxUndoManager* getUndoMgr();
-
/** returns <TRUE/> when the command is enbaled
@param _nCommand the command id
@param _xControlFormat the report control format
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 6d13804fe7fa..b1bd1a12e89a 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -372,7 +372,7 @@ void OReportController::disposing()
pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow )
pSectionWindow->getReportSection().deactivateOle();
- getUndoMgr()->Clear(); // clear all undo redo things
+ GetUndoManager().Clear(); // clear all undo redo things
if ( m_aReportModel )
listen(false);
m_pReportControllerObserver->Clear();
@@ -1703,7 +1703,7 @@ void OReportController::impl_initialize( )
{
//m_sName = m_xReportDefinition->getName();
getView()->initialize(); // show the windows and fill with our informations
- getUndoMgr()->Clear(); // clear all undo redo things
+ GetUndoManager().Clear(); // clear all undo redo things
getSdrModel();
if ( !m_aReportModel )
throw Exception();
@@ -2121,11 +2121,6 @@ void OReportController::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:ExpandSection", SID_EXPAND_SECTION);
}
// -----------------------------------------------------------------------------
-SfxUndoManager* OReportController::getUndoMgr()
-{
- return &m_aUndoManager;
-}
-// -----------------------------------------------------------------------------
void OReportController::impl_onModifyChanged()
{
try
@@ -3348,7 +3343,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
}
uno::Reference<report::XSection> xCurrentSection = getDesignView()->getCurrentSection();
- UndoManagerListAction aUndo( *getUndoMgr(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) );
+ UndoManagerListAction aUndo( GetUndoManager(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) );
try
{
@@ -3819,7 +3814,7 @@ void OReportController::switchReportSection(const sal_Int16 _nId)
if ( SID_REPORTHEADERFOOTER == _nId )
{
const String sUndoAction(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER));
- getUndoMgr()->EnterListAction( sUndoAction, String() );
+ GetUndoManager().EnterListAction( sUndoAction, String() );
addUndoActionAndInvalidate(new OReportSectionUndo(*(m_aReportModel),SID_REPORTHEADER_WITHOUT_UNDO
,::std::mem_fun(&OReportHelper::getReportHeader)
@@ -3851,7 +3846,7 @@ void OReportController::switchReportSection(const sal_Int16 _nId)
}
if ( SID_REPORTHEADERFOOTER == _nId )
- getUndoMgr()->LeaveListAction();
+ GetUndoManager().LeaveListAction();
getView()->Resize();
}
}
@@ -3867,7 +3862,7 @@ void OReportController::switchPageSection(const sal_Int16 _nId)
if ( SID_PAGEHEADERFOOTER == _nId )
{
const String sUndoAction(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER));
- getUndoMgr()->EnterListAction( sUndoAction, String() );
+ GetUndoManager().EnterListAction( sUndoAction, String() );
addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel
,SID_PAGEHEADER_WITHOUT_UNDO
@@ -3899,7 +3894,7 @@ void OReportController::switchPageSection(const sal_Int16 _nId)
break;
}
if ( SID_PAGEHEADERFOOTER == _nId )
- getUndoMgr()->LeaveListAction();
+ GetUndoManager().LeaveListAction();
getView()->Resize();
}
}
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index 26ce8c13c2a6..ae9c8e0e0bb3 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -330,13 +330,13 @@ void OSectionWindow::zoom(const Fraction& _aZoom)
IMPL_LINK( OSectionWindow, StartSplitHdl, Splitter*, )
{
const String sEmpty(ModuleRes(RID_STR_UNDO_CHANGE_SIZE));
- getViewsWindow()->getView()->getReportView()->getController().getUndoMgr()->EnterListAction(sEmpty,String());
+ getViewsWindow()->getView()->getReportView()->getController().GetUndoManager().EnterListAction(sEmpty,String());
return 0L;
}
//------------------------------------------------------------------------------
IMPL_LINK( OSectionWindow, EndSplitHdl, Splitter*, )
{
- getViewsWindow()->getView()->getReportView()->getController().getUndoMgr()->LeaveListAction();
+ getViewsWindow()->getView()->getReportView()->getController().GetUndoManager().LeaveListAction();
/*getViewsWindow()->Resize();*/
return 0L;
}
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index bcd50236aab3..21735676d078 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1329,7 +1329,7 @@ void OViewsWindow::EndDragObj_removeInvisibleObjects()
void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSection,const Point& _aPnt)
{
const String sUndoAction = String((ModuleRes(RID_STR_UNDO_CHANGEPOSITION)));
- UndoManagerListAction aListAction(*getView()->getReportView()->getController().getUndoMgr(),sUndoAction);
+ UndoManagerListAction aListAction(getView()->getReportView()->getController().GetUndoManager(),sUndoAction);
Point aNewPos = _aPnt;
OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aNewPos);