From 784ea715b333655894b2702d721fd119f81bd394 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 17 Nov 2010 09:11:03 +0100 Subject: undoapi: carry the SfxUndoManager around as &, not as * --- reportdesign/source/ui/dlg/CondFormat.cxx | 2 +- reportdesign/source/ui/dlg/GroupsSorting.cxx | 12 ++++++------ reportdesign/source/ui/inc/ReportController.hxx | 4 ---- reportdesign/source/ui/report/ReportController.cxx | 19 +++++++------------ reportdesign/source/ui/report/SectionWindow.cxx | 4 ++-- reportdesign/source/ui/report/ViewsWindow.cxx | 2 +- 6 files changed, 17 insertions(+), 26 deletions(-) (limited to 'reportdesign/source') 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& _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 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 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 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); -- cgit From 846cc7894b5a48d2aa3efa2472fb095e771fa05b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 17 Nov 2010 09:30:55 +0100 Subject: undoapi: make the SfxUndoManager an impl detail of OSingleDocumentControllerImpl, instead of exposing it as member --- reportdesign/source/ui/report/ReportController.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index b1bd1a12e89a..227eccdaf1dd 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -1195,7 +1195,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > uno::Reference< report::XFunctions> xFunctions(xFunction->getParent(),uno::UNO_QUERY_THROW); sal_Int32 nIndex = getPositionInIndexAccess(xFunctions.get(),xFunction); const String sUndoAction = String((ModuleRes(RID_STR_UNDO_REMOVE_FUNCTION))); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); xFunctions->removeByIndex(nIndex); select(uno::makeAny(xFunctions->getParent())); InvalidateFeature( SID_SAVEDOC ); @@ -1493,7 +1493,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > if ( !pListAction.get() && bMulti) { const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT)); - pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction)); + pListAction.reset(new UndoManagerListAction(GetUndoManager(),sUndoAction)); } // if ( !pListAction.get() ) uno::Reference< report::XReportControlFormat> xReportControlFormat(*aIter,uno::UNO_QUERY); lcl_setFontWPU_nothrow(xReportControlFormat,_nId); @@ -1572,7 +1572,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > if ( !pListAction.get() ) { const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT)); - pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction)); + pListAction.reset(new UndoManagerListAction(GetUndoManager(),sUndoAction)); rptui::openCharDialog(xFormat,xWindow,aSettings); } // if ( !pListAction.get() ) applyCharacterSettings( xFormat, aSettings ); @@ -2507,7 +2507,7 @@ void OReportController::openPageDialog(const uno::Reference& _ { uno::Reference< beans::XPropertySet> xProp(getUsedStyle(m_xReportDefinition),uno::UNO_QUERY_THROW); const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEPAGE)); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); const SfxPoolItem* pItem = NULL; if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_SIZE,sal_True,&pItem)) { @@ -2621,7 +2621,7 @@ void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHi void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t& _pMemfun) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); _pMemfun( getDesignView() ); InvalidateFeature( SID_SAVEDOC ); InvalidateFeature( SID_UNDO ); @@ -2630,7 +2630,7 @@ void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::me void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection); InvalidateFeature( SID_SAVEDOC ); InvalidateFeature( SID_UNDO ); @@ -2715,7 +2715,7 @@ void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference& _aArgs) getDesignView()->unmarkAllObjects(NULL); const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL)); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); SequenceAsHashMap aMap(_aArgs); aMap.createItemIfMissing(PROPERTY_FORMATKEY,aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYDATE,sal_Int32(0))); @@ -3299,7 +3299,7 @@ void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs getDesignView()->unmarkAllObjects(NULL); const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL)); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); if ( !m_xReportDefinition->getPageHeaderOn() ) { @@ -4220,7 +4220,7 @@ bool OReportController::impl_setPropertyAtControls_throw(const sal_uInt16 _nUndo if ( !pListAction.get() && _nUndoResId && bMultiSet ) { const String sUndoAction = String(ModuleRes(_nUndoResId)); - pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction)); + pListAction.reset(new UndoManagerListAction(GetUndoManager(),sUndoAction)); } // if ( !pListAction.get() ) const uno::Reference< beans::XPropertySet > xControlModel(*aIter,uno::UNO_QUERY); if ( xControlModel.is() ) -- cgit From 280d6e78fc41c5de56734d4e3621ff18ea09f546 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- reportdesign/source/ui/inspection/DataProviderHandler.cxx | 2 +- reportdesign/source/ui/inspection/GeometryHandler.cxx | 2 +- reportdesign/source/ui/inspection/ReportComponentHandler.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index 8ac5053ff39f..dcc327060806 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include "metadata.hxx" #include #include diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 084bd77f8d5b..c02683a97452 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -66,7 +66,7 @@ #include #include -#include +#include #include #include "ModuleHelper.hxx" diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx index 859c0da38709..d992206b6f54 100644 --- a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx +++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "metadata.hxx" //........................................................................ -- cgit From 5cf47c0008eb4126cfc41c59fbeeb4d73c8e22b1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 25 Nov 2010 14:28:03 +0100 Subject: undoapi: split OSingleDocumentController into DBSubComponentController (which the report design's controller will be derived from) and the still-so-named OSingleDocumentController. Module reportdesign does not compile with this change, this is yet to come. --- reportdesign/source/ui/inc/ReportController.hxx | 2 -- reportdesign/source/ui/report/ReportController.cxx | 10 +--------- 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index 9492afd04176..e3ced50861b3 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -333,8 +333,6 @@ namespace rptui // execute a feature virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); - virtual void losingConnection( ); - virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const; virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index d714e6d215ea..b66b527aeb35 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -391,7 +391,6 @@ void OReportController::disposing() OReportController_BASE::disposing(); - // disconnect(); try { m_xReportDefinition.clear(); @@ -2106,14 +2105,6 @@ void OReportController::impl_onModifyChanged() } } // ----------------------------------------------------------------------------- -void OReportController::losingConnection( ) -{ - // let the base class do it's reconnect - OReportController_BASE::losingConnection( ); - - InvalidateAll(); -} -// ----------------------------------------------------------------------------- void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _xLayoutManager) { if ( _xLayoutManager.is() ) @@ -2300,6 +2291,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven // ----------------------------------------------------------------------------- void SAL_CALL OReportController::disposing( const lang::EventObject& Source ) throw(uno::RuntimeException) { + // simply disambiguate OReportController_BASE::disposing(Source); } -- cgit From 4ae5573a0f94cc859ba2c30ac71bcd2ff8677f1f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 25 Nov 2010 14:29:43 +0100 Subject: undoapi: migrated report designer to use an own, model-bound UndoManager, instead of the UndoManager formerly bound to the controller --- reportdesign/source/core/api/ReportDefinition.cxx | 179 +++++++++------- reportdesign/source/core/sdr/RptModel.cxx | 2 +- reportdesign/source/core/sdr/RptObject.cxx | 2 +- reportdesign/source/core/sdr/UndoActions.cxx | 2 +- reportdesign/source/core/sdr/UndoEnv.cxx | 23 +-- reportdesign/source/core/sdr/formatnormalizer.cxx | 4 +- reportdesign/source/ui/dlg/CondFormat.cxx | 4 +- reportdesign/source/ui/dlg/GroupsSorting.cxx | 16 +- reportdesign/source/ui/inc/ReportController.hxx | 95 +++++---- reportdesign/source/ui/report/ReportController.cxx | 227 ++++++++++++--------- reportdesign/source/ui/report/SectionWindow.cxx | 7 +- reportdesign/source/ui/report/ViewsWindow.cxx | 2 +- 12 files changed, 314 insertions(+), 249 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 2cf848dc0c84..6b8414ad60a3 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -24,18 +24,66 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ + #include "ReportDefinition.hxx" + +#include "FixedLine.hxx" +#include "FixedText.hxx" +#include "FormattedField.hxx" +#include "Functions.hxx" +#include "Groups.hxx" +#include "ImageControl.hxx" +#include "ReportComponent.hxx" +#include "ReportHelperImpl.hxx" +#include "RptDef.hxx" +#include "RptModel.hxx" +#include "Section.hxx" +#include "Shape.hxx" +#include "Tools.hxx" +#include "UndoEnv.hxx" +#include "core_resource.hrc" +#include "core_resource.hxx" +#include "corestrings.hrc" + +/** === begin UNO includes === **/ #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include +#include +#include #include -#include +#include +/** === end UNO includes === **/ + #include #include #include @@ -44,83 +92,41 @@ #include #include #include -#include #include #include #include -#include +#include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "corestrings.hrc" -#include "Groups.hxx" -#include "RptDef.hxx" -#include "Section.hxx" -#include "FixedLine.hxx" -#include "core_resource.hrc" -#include "core_resource.hxx" -#include "Tools.hxx" -#include -#include -#include #include #include -#include #include -#include -#include "Functions.hxx" -#include -#include -#include -#include -#include "RptModel.hxx" -#include "UndoEnv.hxx" -#include "FormattedField.hxx" -#include "FixedText.hxx" -#include "ImageControl.hxx" -#include "Shape.hxx" -#include "ReportHelperImpl.hxx" -#include -#include -#include - +#include +#include +#include #include +#include +#include +#include +#include #include +#include #include #include -#include -#include -#include -#include "ReportComponent.hxx" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #define MAP_LEN(x) x, sizeof(x) - 1 #define MAP_CHAR_LEN(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(x)) @@ -607,6 +613,7 @@ struct OReportDefinitionImpl ::boost::shared_ptr< ::comphelper::EmbeddedObjectContainer> m_pObjectContainer; ::boost::shared_ptr m_pReportModel; + ::rtl::Reference< ::dbaui::UndoManager > m_pUndoManager; ::rtl::OUString m_sCaption; ::rtl::OUString m_sCommand; ::rtl::OUString m_sFilter; @@ -623,6 +630,7 @@ struct OReportDefinitionImpl sal_Bool m_bModified; sal_Bool m_bEscapeProcessing; sal_Bool m_bSetModifiedEnabled; + OReportDefinitionImpl(::osl::Mutex& _aMutex) :m_aStorageChangeListeners(_aMutex) ,m_aCloseListener(_aMutex) @@ -746,7 +754,6 @@ OReportDefinition::~OReportDefinition() } // ----------------------------------------------------------------------------- IMPLEMENT_FORWARD_REFCOUNT( OReportDefinition, ReportDefinitionBase ) -//IMPLEMENT_FORWARD_XINTERFACE2(OReportDefinition,ReportDefinitionBase,ReportDefinitionPropertySet) void OReportDefinition::init() { try @@ -764,7 +771,7 @@ void OReportDefinition::init() pCreatorThread->createSuspended(); pCreatorThread->setPriority(osl_Thread_PriorityBelowNormal); pCreatorThread->resume(); - } // for ( ; pIter != pEnd; ++pIter ) + } } m_pImpl->m_pReportModel.reset(new OReportModel(this)); @@ -775,6 +782,9 @@ void OReportDefinition::init() rAdmin.NewLayer(UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "back" ) ), RPT_LAYER_BACK ); rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), RPT_LAYER_HIDDEN ); + m_pImpl->m_pUndoManager = new ::dbaui::UndoManager( *this, m_aMutex ); + m_pImpl->m_pReportModel->SetSdrUndoManager( &m_pImpl->m_pUndoManager->GetSfxUndoManager() ); + m_pImpl->m_xFunctions = new OFunctions(this,m_aProps->m_xContext); if ( !m_pImpl->m_xStorage.is() ) m_pImpl->m_xStorage = ::comphelper::OStorageHelper::GetTemporaryStorage(); @@ -789,9 +799,9 @@ void OReportDefinition::init() } m_pImpl->m_pObjectContainer.reset( new comphelper::EmbeddedObjectContainer(m_pImpl->m_xStorage , static_cast(this) ) ); } - catch(uno::Exception) + catch ( const uno::Exception& ) { - OSL_ENSURE(0,"Error!"); + DBG_UNHANDLED_EXCEPTION(); } } // ----------------------------------------------------------------------------- @@ -1296,10 +1306,21 @@ void SAL_CALL OReportDefinition::close( ::sal_Bool _bDeliverOwnership ) throw (u ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); ::osl::MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); + ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed ); ::comphelper::MediaDescriptor aDescriptor( _aArguments ); - fillArgs(aDescriptor); - m_pImpl->m_pReportModel->SetModified(sal_False); + + m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( false ); + try + { + fillArgs(aDescriptor); + m_pImpl->m_pReportModel->SetModified(sal_False); + } + catch ( ... ) + { + m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( true ); + throw; + } + m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( true ); return sal_True; } // ----------------------------------------------------------------------------- @@ -1842,7 +1863,6 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue else if ( sURL.getLength() ) aStorageSource <<= sURL; else - // TODO: error message throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No input source (URL or InputStream) found." ) ), // TODO: resource @@ -2931,8 +2951,15 @@ uno::Sequence< datatransfer::DataFlavor > SAL_CALL OReportDefinition::getTransfe { return aFlavor.MimeType.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png"))); } + // ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- +uno::Reference< document::XUndoManager > SAL_CALL OReportDefinition::getUndoManager( ) throw (uno::RuntimeException) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + return m_pImpl->m_pUndoManager.get(); +} + + // ============================================================================= }// namespace reportdesign // ============================================================================= diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx index 7327456c7940..05b9d8d39499 100644 --- a/reportdesign/source/core/sdr/RptModel.cxx +++ b/reportdesign/source/core/sdr/RptModel.cxx @@ -28,7 +28,7 @@ #include "RptModel.hxx" #include "RptPage.hxx" -#include +#include #include #include diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 7d1cdbc6db30..4b3db47c4078 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -37,7 +37,7 @@ #include #include "RptPage.hxx" #include "corestrings.hrc" -#include +#include #include "ModuleHelper.hxx" #include diff --git a/reportdesign/source/core/sdr/UndoActions.cxx b/reportdesign/source/core/sdr/UndoActions.cxx index d58fe62e974d..6ebebd30a61a 100644 --- a/reportdesign/source/core/sdr/UndoActions.cxx +++ b/reportdesign/source/core/sdr/UndoActions.cxx @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx index f4dd0a7f8645..091dad4b8ad4 100644 --- a/reportdesign/source/core/sdr/UndoEnv.cxx +++ b/reportdesign/source/core/sdr/UndoEnv.cxx @@ -54,7 +54,7 @@ #include #include #include -#include +#include #include #include @@ -262,7 +262,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv if (!xSet.is()) return; - dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController(); + dbaui::DBSubComponentController* pController = m_pImpl->m_rModel.getController(); if ( !pController ) return; @@ -380,7 +380,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv if ( pUndo == NULL ) pUndo = new ORptUndoPropertyAction( m_pImpl->m_rModel, _rEvent ); - pController->addUndoActionAndInvalidate(pUndo); + m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction( pUndo ); pController->InvalidateAll(); } // ----------------------------------------------------------------------------- @@ -439,12 +439,9 @@ void SAL_CALL OXUndoEnvironment::elementInserted(const ContainerEvent& evt) thro uno::Reference< report::XFunctions> xContainer(evt.Source,uno::UNO_QUERY); if ( xContainer.is() ) { - dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController(); - pController->addUndoActionAndInvalidate(new OUndoContainerAction(m_pImpl->m_rModel - ,rptui::Inserted - ,xContainer.get() - ,xIface - ,RID_STR_UNDO_ADDFUNCTION)); + m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction( + new OUndoContainerAction( m_pImpl->m_rModel, rptui::Inserted, xContainer.get(), + xIface, RID_STR_UNDO_ADDFUNCTION ) ); } } } @@ -510,12 +507,8 @@ void SAL_CALL OXUndoEnvironment::elementRemoved(const ContainerEvent& evt) throw uno::Reference< report::XFunctions> xFunctions(evt.Source,uno::UNO_QUERY); if ( xFunctions.is() ) { - dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController(); - pController->addUndoActionAndInvalidate(new OUndoContainerAction(m_pImpl->m_rModel - ,rptui::Removed - ,xFunctions.get() - ,xIface - ,RID_STR_UNDO_ADDFUNCTION)); + m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction( new OUndoContainerAction( + m_pImpl->m_rModel, rptui::Removed, xFunctions.get(), xIface, RID_STR_UNDO_ADDFUNCTION ) ); } } } diff --git a/reportdesign/source/core/sdr/formatnormalizer.cxx b/reportdesign/source/core/sdr/formatnormalizer.cxx index e4817bbe9f44..f5fba8129d54 100644 --- a/reportdesign/source/core/sdr/formatnormalizer.cxx +++ b/reportdesign/source/core/sdr/formatnormalizer.cxx @@ -35,7 +35,7 @@ #include /** === end UNO includes === **/ -#include +#include #include #include #include @@ -186,7 +186,7 @@ namespace rptui if ( !m_xReportDefinition.is() ) return false; - ::dbaui::OSingleDocumentController* pController( m_rModel.getController() ); + ::dbaui::DBSubComponentController* pController( m_rModel.getController() ); OSL_ENSURE( pController, "FormatNormalizer::impl_ensureUpToDateFieldList_nothrow: no controller? how can *this* happen?!" ); if ( !pController ) return false; diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx index b271a3324022..3bf5cc9c37da 100644 --- a/reportdesign/source/ui/dlg/CondFormat.cxx +++ b/reportdesign/source/ui/dlg/CondFormat.cxx @@ -465,8 +465,8 @@ namespace rptui short nRet = ModalDialog::Execute(); if ( nRet == RET_OK ) { - String sUndoAction( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) ); - UndoManagerListAction aListAction(m_rController.GetUndoManager(),sUndoAction); + const String sUndoAction( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) ); + const UndoContext aUndoContext( 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 5a6b7bd1e22b..b471d271b867 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -316,8 +316,8 @@ void OFieldExpressionControl::moveGroups(const uno::Sequence& _aGroups m_bIgnoreEvent = true; { sal_Int32 nRow = _nRow; - String sUndoAction(ModuleRes(RID_STR_UNDO_MOVE_GROUP)); - UndoManagerListAction aListAction(m_pParent->m_pController->GetUndoManager(),sUndoAction); + const String sUndoAction(ModuleRes(RID_STR_UNDO_MOVE_GROUP)); + const UndoContext aUndoContext( 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->GetUndoManager().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->GetUndoManager().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->GetUndoManager().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->GetUndoManager().LeaveListAction(); + m_pParent->m_pController->getUndoManager().LeaveListAction(); m_nDataPos = GetCurRow(); InvalidateStatusCell( nOldDataPos ); @@ -930,8 +930,8 @@ void OFieldExpressionControl::InsertRows( long nRow ) { m_bIgnoreEvent = false; { - String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP)); - UndoManagerListAction aListAction(m_pParent->m_pController->GetUndoManager(),sUndoAction); + const String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP)); + const UndoContext aUndoContext( m_pParent->m_pController->getUndoManager(), sUndoAction ); uno::Reference 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 e3ced50861b3..5777635cc476 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -27,48 +27,52 @@ #ifndef RPTUI_REPORTCONTROLLER_HXX #define RPTUI_REPORTCONTROLLER_HXX -#include -#include -#include -#include -#include -#include +#include "DesignView.hxx" +#include "ModuleHelper.hxx" +#include "ReportControllerObserver.hxx" +#include "RptDef.hxx" + +/** === begin UNO includes === **/ #include -#include #include -#include -#include -#include +#include +#include #include #include -#include +#include +#include #include +#include #include #include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include "ModuleHelper.hxx" +/** === end UNO includes === **/ -#include #include #include #include +#include +#include +#include +#include +#include +#include +#include -#include "RptDef.hxx" -#include "DesignView.hxx" -#include +#include #include -#include -#include "ReportControllerObserver.hxx" +#include class TransferableHelper; class TransferableClipboardListener; class VclWindowEvent; +class SfxUndoManager; namespace rptui { class OGroupsSortingDialog; @@ -78,7 +82,7 @@ namespace rptui class OAddFieldWindow; class OSectionWindow; - typedef ::dbaui::OSingleDocumentController OReportController_BASE; + typedef ::dbaui::DBSubComponentController OReportController_BASE; typedef ::cppu::ImplHelper5 < ::com::sun::star::container::XContainerListener , ::com::sun::star::beans::XPropertyChangeListener , ::com::sun::star::view::XSelectionSupplier @@ -91,6 +95,7 @@ namespace rptui ,public SfxListener ,public ::comphelper::OPropertyStateContainer ,public ::comphelper::OPropertyArrayUsageHelper < OReportController_BASE > + ,public ::boost::noncopyable { private: OModuleClient m_aModuleClient; @@ -107,9 +112,9 @@ namespace rptui ODesignView* getDesignView() const { return static_cast< ODesignView* >( getView() ); } - ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition> m_xReportDefinition; - ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportEngine> m_xReportEngine; - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XComponentLoader> m_xFrameLoader; + ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition; + ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportEngine > m_xReportEngine; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader > m_xFrameLoader; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > m_xRowSetMediator; @@ -215,15 +220,20 @@ namespace rptui void executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t& _pMemfun); void alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false); + + // open the help agent of report designer at start time + void doOpenHelpAgent(); + + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame(); + /** shrink a section @param _nUndoStrId the string id of the string which is shown in undo menu @param _nShrinkId ID of what you would like to shrink. */ - protected: void shrinkSectionBottom(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection); void shrinkSectionTop(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection); - public: + public: void shrinkSection(USHORT _nUndoStrId, ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection, sal_Int32 _nShrinkId); /** opens the file open dialog to allow the user to select a image which will be @@ -292,14 +302,11 @@ namespace rptui */ void impl_zoom_nothrow(); - private: - OReportController(OReportController const&); - OReportController& operator =(OReportController const&); - public: - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame(); + virtual void impl_onModifyChanged(); - // open the help agent of report designer at start time - void doOpenHelpAgent(); + virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager ); + virtual void impl_initialize( ); + bool isUiVisible() const; /** creates a new default control for the currently set type when the modifier KEY_MOD1 was pressed * \param _aArgs must contain a properyvalue with name "KeyModifier" and value KEY_MOD1 when control should be created. @@ -336,11 +343,12 @@ namespace rptui virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const; virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); + private: virtual ~OReportController(); + public: OReportController(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context); - DECL_LINK( NotifyUndoActionHdl, SfxUndoAction* ); DECL_LINK( EventLstHdl, VclWindowEvent* ); DECL_LINK( OnCreateHdl, OAddFieldWindow*); @@ -350,8 +358,6 @@ namespace rptui // SfxListener virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint); - virtual void impl_onModifyChanged(); - /** returns when the command is enbaled @param _nCommand the command id @param _xControlFormat the report control format @@ -449,7 +455,7 @@ namespace rptui * * \return */ - ::boost::shared_ptr getSdrModel(); + ::boost::shared_ptr getSdrModel() const; inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const { return m_xContext; } inline sal_Int16 getZoomValue() const { return m_nZoomValue; } @@ -471,10 +477,9 @@ namespace rptui ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getColumns() const; ::rtl::OUString getColumnLabel_throw(const ::rtl::OUString& i_sColumnName) const; - private: - virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager ); - virtual void impl_initialize( ); - bool isUiVisible() const; + SfxUndoManager& getUndoManager() const; + void clearUndoManager() const; + void addUndoAction( SfxUndoAction* i_pAction ); }; } #endif // RPTUI_REPORTCONTROLLER_HXX diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index b66b527aeb35..9b7dd3374b44 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -99,6 +99,7 @@ #include #include #include +#include #include #include @@ -117,7 +118,7 @@ #include #include #include -#include //CHINA001 +#include #include #include #include @@ -137,7 +138,7 @@ #include #include -#include //CHINA001 +#include #include #include #include @@ -152,17 +153,17 @@ #include #include "UndoEnv.hxx" #include "InsertFunctions.hxx" +#include "ReportControllerObserver.hxx" #include #include #include +#include #include #include #include -#include - #define MAX_ROWS_FOR_PREVIEW 50 using namespace ::com::sun::star; @@ -245,14 +246,16 @@ void lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs, SequenceAsHashMap aMap(aArgs); xReportControlFormat = aMap.getUnpackedValueOrDefault(REPORTCONTROLFORMAT,uno::Reference< report::XReportControlFormat>()); _xWindow = aMap.getUnpackedValueOrDefault(CURRENT_WINDOW,uno::Reference< awt::XWindow>()); - } // if ( aArgs.getLength() ) + } + if ( !xReportControlFormat.is() ) { _pView->fillControlModelSelection(_rControlsFormats); - //xReportControlFormat.set( _pView->getCurrentControlModel(),uno::UNO_QUERY); - } // if ( !xReportControlFormat.is() ) + } else + { _rControlsFormats.push_back(xReportControlFormat); + } if ( !_xWindow.is() ) _xWindow = VCLUnoHelper::GetInterface(_pView); @@ -372,14 +375,15 @@ void OReportController::disposing() pSectionWindow = getDesignView()->getMarkedSection(); if ( pSectionWindow ) pSectionWindow->getReportSection().deactivateOle(); - GetUndoManager().Clear(); // clear all undo redo things + clearUndoManager(); if ( m_aReportModel ) listen(false); m_pReportControllerObserver->Clear(); m_pReportControllerObserver->release(); } - catch(uno::Exception&) + catch ( const uno::Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } @@ -456,8 +460,20 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const break; case SID_REDO: case SID_UNDO: - aReturn = OReportController_BASE::GetState(_nId); - aReturn.bEnabled = aReturn.bEnabled; + { + USHORT ( SfxUndoManager::*retrieveCount )( bool const ) const = + ( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionCount : &SfxUndoManager::GetRedoActionCount; + + SfxUndoManager& rUndoManager( getUndoManager() ); + aReturn.bEnabled = ( rUndoManager.*retrieveCount )( ::svl::IUndoManager::TopLevel ) > 0; + if ( aReturn.bEnabled ) + { + // TODO: add "Undo/Redo: prefix" + String ( SfxUndoManager::*retrieveComment )( USHORT, bool const ) const = + ( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionComment : &SfxUndoManager::GetRedoActionComment; + aReturn.sTitle = (rUndoManager.*retrieveComment)( 0, ::svl::IUndoManager::TopLevel ); + } + } break; case SID_OBJECT_RESIZING: case SID_OBJECT_SMALLESTWIDTH: @@ -1023,10 +1039,12 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_REDO: case SID_UNDO: { - // const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() ); - // We would like to know if we are in undo mode const OXUndoEnvironment::OUndoMode aLock( m_aReportModel->GetUndoEnv() ); - OReportController_BASE::Execute( _nId, aArgs ); + BOOL ( SfxUndoManager::*doXDo )() = + ( _nId == SID_UNDO ) ? &SfxUndoManager::Undo : &SfxUndoManager::Redo; + + SfxUndoManager& rUndoManager( getUndoManager() ); + (rUndoManager.*doXDo)(); InvalidateAll(); updateFloater(); } @@ -1164,7 +1182,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > uno::Reference< report::XFunctions> xFunctions(xFunction->getParent(),uno::UNO_QUERY_THROW); sal_Int32 nIndex = getPositionInIndexAccess(xFunctions.get(),xFunction); const String sUndoAction = String((ModuleRes(RID_STR_UNDO_REMOVE_FUNCTION))); - UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); xFunctions->removeByIndex(nIndex); select(uno::makeAny(xFunctions->getParent())); InvalidateFeature( SID_SAVEDOC ); @@ -1191,14 +1209,6 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > InvalidateAll(); break; case SID_INSERT_DIAGRAM: - /*{ - OSectionView* pView = getCurrentSectionView(); - if ( pView ) - { - Reference< awt::XWindow> xWindow = VCLUnoHelper::GetInterface(getView()->Window::GetParent()); - InsertChart(m_xContext,m_xReportDefinition.get(),xWindow,pView,getSdrModel().get()); - } - }*/ getDesignView()->SetMode( RPTUI_INSERT ); getDesignView()->SetInsertObj( OBJ_OLE2); createDefaultControl(aArgs); @@ -1451,19 +1461,16 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_ATTR_CHAR_POSTURE: case SID_ATTR_CHAR_UNDERLINE: { - ::std::auto_ptr pListAction; uno::Reference< awt::XWindow> xWindow; ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats; lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats ); - bool bMulti = aControlsFormats.size() > 1; + + const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT)); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); + ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin(); for(; aIter != aControlsFormats.end();++aIter) { - if ( !pListAction.get() && bMulti) - { - const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT)); - pListAction.reset(new UndoManagerListAction(GetUndoManager(),sUndoAction)); - } // if ( !pListAction.get() ) uno::Reference< report::XReportControlFormat> xReportControlFormat(*aIter,uno::UNO_QUERY); lcl_setFontWPU_nothrow(xReportControlFormat,_nId); } @@ -1527,32 +1534,37 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > break; case SID_CHAR_DLG: { - ::std::auto_ptr pListAction; uno::Sequence< beans::NamedValue > aSettings; uno::Reference< awt::XWindow> xWindow; ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats; lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats ); - ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin(); - for(; aIter != aControlsFormats.end();++aIter) + + if ( !aControlsFormats.empty() ) { - uno::Reference< report::XReportControlFormat > xFormat(*aIter,uno::UNO_QUERY); - if ( xFormat.is() ) + const String sUndoAction( ModuleRes( RID_STR_UNDO_CHANGEFONT ) ); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); + + ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin(); + for(; aIter != aControlsFormats.end();++aIter) { - if ( !pListAction.get() ) + uno::Reference< report::XReportControlFormat > xFormat( *aIter, uno::UNO_QUERY ); + if ( !xFormat.is() ) + continue; + + if ( aSettings.getLength() == 0 ) { - const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT)); - pListAction.reset(new UndoManagerListAction(GetUndoManager(),sUndoAction)); - rptui::openCharDialog(xFormat,xWindow,aSettings); - } // if ( !pListAction.get() ) + ::rptui::openCharDialog( xFormat, xWindow, aSettings ); + if ( aSettings.getLength() == 0 ) + break; + } + applyCharacterSettings( xFormat, aSettings ); } - } // for(; aIter != aControlsFormats.end();++aIter) - if ( !aControlsFormats.empty() ) + InvalidateAll(); + } } break; - //case SID_FM_DESIGN_MODE: - // break; case SID_INSERT_GRAPHIC: insertGraphic(); break; @@ -1673,10 +1685,14 @@ void OReportController::impl_initialize( ) { //m_sName = m_xReportDefinition->getName(); getView()->initialize(); // show the windows and fill with our informations - GetUndoManager().Clear(); // clear all undo redo things - getSdrModel(); + + m_aReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition); if ( !m_aReportModel ) - throw Exception(); + throw RuntimeException(); + m_aReportModel->attachController( *this ); + + clearUndoManager(); + UndoSuppressor aSuppressUndo( getUndoManager() ); ::comphelper::NamedValueCollection aArgs(getModel()->getArgs()); setMode(aArgs.getOrDefault("Mode", rtl::OUString::createFromAscii("normal"))); @@ -1828,7 +1844,7 @@ sal_Bool SAL_CALL OReportController::suspend(sal_Bool /*_bSuspend*/) throw( Runt // ----------------------------------------------------------------------------- void OReportController::describeSupportedFeatures() { - OSingleDocumentController::describeSupportedFeatures(); + DBSubComponentController::describeSupportedFeatures(); implDescribeSupportedFeature( ".uno:TextDocument", SID_RPT_TEXTDOCUMENT, CommandGroup::APPLICATION ); implDescribeSupportedFeature( ".uno:Spreadsheet", SID_RPT_SPREADSHEET, CommandGroup::APPLICATION ); @@ -2097,7 +2113,7 @@ void OReportController::impl_onModifyChanged() { if ( m_xReportDefinition.is() ) m_xReportDefinition->setModified( impl_isModified() ); - OSingleDocumentController::impl_onModifyChanged(); + DBSubComponentController::impl_onModifyChanged(); } catch(uno::Exception) { @@ -2363,13 +2379,6 @@ IMPL_LINK( OReportController, OnClipboardChanged, void*, EMPTYARG ) return OnInvalidateClipboard( NULL ); } //------------------------------------------------------------------------------ -IMPL_LINK( OReportController, NotifyUndoActionHdl, SfxUndoAction*, _pUndoAction ) -{ - OSL_ENSURE(_pUndoAction,"UndoAction is NULL!"); - addUndoActionAndInvalidate(_pUndoAction); - return 0L; -} -//------------------------------------------------------------------------------ IMPL_LINK(OReportController, OnInvalidateClipboard, void*, EMPTYARG) { InvalidateFeature(SID_CUT); @@ -2470,7 +2479,7 @@ void OReportController::openPageDialog(const uno::Reference& _ { uno::Reference< beans::XPropertySet> xProp(getUsedStyle(m_xReportDefinition),uno::UNO_QUERY_THROW); const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEPAGE)); - UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); const SfxPoolItem* pItem = NULL; if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_SIZE,sal_True,&pItem)) { @@ -2521,13 +2530,24 @@ void OReportController::openPageDialog(const uno::Reference& _ delete pDefaults[i]; } + // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OReportController::attachModel(const uno::Reference< frame::XModel > & xModel) throw( uno::RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); - m_xReportDefinition.set(xModel,uno::UNO_QUERY); - return m_xReportDefinition.is(); + + uno::Reference< report::XReportDefinition > xReportDefinition( xModel, UNO_QUERY ); + if ( !xReportDefinition.is() ) + return sal_False; + + uno::Reference< document::XUndoManagerSupplier > xTestSuppUndo( xModel, UNO_QUERY ); + if ( !xTestSuppUndo.is() ) + return sal_False; + + m_xReportDefinition = xReportDefinition; + return sal_True; } + // ----------------------------------------------------------------------------- void OReportController::openSortingAndGroupingDialog() { @@ -2584,7 +2604,7 @@ void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHi void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t& _pMemfun) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); - UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); _pMemfun( getDesignView() ); InvalidateFeature( SID_SAVEDOC ); InvalidateFeature( SID_UNDO ); @@ -2593,7 +2613,7 @@ void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::me void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); - UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection); InvalidateFeature( SID_SAVEDOC ); InvalidateFeature( SID_UNDO ); @@ -2678,7 +2698,7 @@ void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference OReportController::getSdrModel() +::boost::shared_ptr OReportController::getSdrModel() const { - if ( !m_aReportModel ) - { - m_aReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition); - if ( m_aReportModel ) - { - m_aReportModel->attachController( *this ); - m_aReportModel->SetNotifyUndoActionHdl(LINK( this, OReportController, NotifyUndoActionHdl )); - } - } return m_aReportModel; } // ----------------------------------------------------------------------------- @@ -3252,7 +3263,7 @@ void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs) getDesignView()->unmarkAllObjects(NULL); const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL)); - UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); SequenceAsHashMap aMap(_aArgs); aMap.createItemIfMissing(PROPERTY_FORMATKEY,aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYDATE,sal_Int32(0))); @@ -3280,7 +3291,7 @@ void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs getDesignView()->unmarkAllObjects(NULL); const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL)); - UndoManagerListAction aListAction(GetUndoManager(),sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); if ( !m_xReportDefinition->getPageHeaderOn() ) { @@ -3324,7 +3335,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) } uno::Reference xCurrentSection = getDesignView()->getCurrentSection(); - UndoManagerListAction aUndo( GetUndoManager(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) ); + UndoContext aUndoContext( getUndoManager(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) ); try { @@ -3792,19 +3803,21 @@ void OReportController::switchReportSection(const sal_Int16 _nId) { const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() ); const bool bSwitchOn = !m_xReportDefinition->getReportHeaderOn(); + + ::boost::scoped_ptr< UndoContext > pUndoContext; if ( SID_REPORTHEADERFOOTER == _nId ) { const String sUndoAction(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER)); - GetUndoManager().EnterListAction( sUndoAction, String() ); + pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) ); - addUndoActionAndInvalidate(new OReportSectionUndo(*(m_aReportModel),SID_REPORTHEADER_WITHOUT_UNDO + addUndoAction(new OReportSectionUndo(*(m_aReportModel),SID_REPORTHEADER_WITHOUT_UNDO ,::std::mem_fun(&OReportHelper::getReportHeader) ,m_xReportDefinition ,bSwitchOn ? Inserted : Removed ,0 )); - addUndoActionAndInvalidate(new OReportSectionUndo(*(m_aReportModel),SID_REPORTFOOTER_WITHOUT_UNDO + addUndoAction(new OReportSectionUndo(*(m_aReportModel),SID_REPORTFOOTER_WITHOUT_UNDO ,::std::mem_fun(&OReportHelper::getReportFooter) ,m_xReportDefinition ,bSwitchOn ? Inserted : Removed @@ -3827,7 +3840,7 @@ void OReportController::switchReportSection(const sal_Int16 _nId) } if ( SID_REPORTHEADERFOOTER == _nId ) - GetUndoManager().LeaveListAction(); + pUndoContext.reset(); getView()->Resize(); } } @@ -3840,12 +3853,13 @@ void OReportController::switchPageSection(const sal_Int16 _nId) const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() ); const bool bSwitchOn = !m_xReportDefinition->getPageHeaderOn(); + ::boost::scoped_ptr< UndoContext > pUndoContext; if ( SID_PAGEHEADERFOOTER == _nId ) { const String sUndoAction(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER)); - GetUndoManager().EnterListAction( sUndoAction, String() ); + pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) ); - addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel + addUndoAction(new OReportSectionUndo(*m_aReportModel ,SID_PAGEHEADER_WITHOUT_UNDO ,::std::mem_fun(&OReportHelper::getPageHeader) ,m_xReportDefinition @@ -3853,7 +3867,7 @@ void OReportController::switchPageSection(const sal_Int16 _nId) ,0 )); - addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel + addUndoAction(new OReportSectionUndo(*m_aReportModel ,SID_PAGEFOOTER_WITHOUT_UNDO ,::std::mem_fun(&OReportHelper::getPageFooter) ,m_xReportDefinition @@ -3875,7 +3889,7 @@ void OReportController::switchPageSection(const sal_Int16 _nId) break; } if ( SID_PAGEHEADERFOOTER == _nId ) - GetUndoManager().LeaveListAction(); + pUndoContext.reset(); getView()->Resize(); } } @@ -3901,7 +3915,7 @@ void OReportController::modifyGroup(const bool _bAppend, const Sequence< Propert rUndoEnv.AddElement( xGroup->getFunctions() ); } - addUndoActionAndInvalidate( new OGroupUndo( + addUndoAction( new OGroupUndo( *m_aReportModel, _bAppend ? RID_STR_UNDO_APPEND_GROUP : RID_STR_UNDO_REMOVE_GROUP, _bAppend ? Inserted : Removed, @@ -3935,7 +3949,7 @@ void OReportController::createGroupSection(const bool _bUndo,const bool _bHeader { const OXUndoEnvironment::OUndoEnvLock aLock(m_aReportModel->GetUndoEnv()); if ( _bUndo ) - addUndoActionAndInvalidate(new OGroupSectionUndo(*m_aReportModel + addUndoAction(new OGroupSectionUndo(*m_aReportModel ,_bHeader ? SID_GROUPHEADER_WITHOUT_UNDO : SID_GROUPFOOTER_WITHOUT_UNDO ,_bHeader ? ::std::mem_fun(&OGroupHelper::getHeader) : ::std::mem_fun(&OGroupHelper::getFooter) ,xGroup @@ -4190,23 +4204,21 @@ sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const un // ----------------------------------------------------------------------------- bool OReportController::impl_setPropertyAtControls_throw(const sal_uInt16 _nUndoResId,const ::rtl::OUString& _sProperty,const uno::Any& _aValue,const Sequence< PropertyValue >& _aArgs) { - ::std::auto_ptr pListAction; ::std::vector< uno::Reference< uno::XInterface > > aSelection; uno::Reference< awt::XWindow> xWindow; lcl_getReportControlFormat( _aArgs, getDesignView(), xWindow, aSelection ); - const bool bMultiSet = aSelection.size() > 1; ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin(); + + const String sUndoAction = String( ModuleRes( _nUndoResId ) ); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); + for(; aIter != aSelection.end();++aIter) { - if ( !pListAction.get() && _nUndoResId && bMultiSet ) - { - const String sUndoAction = String(ModuleRes(_nUndoResId)); - pListAction.reset(new UndoManagerListAction(GetUndoManager(),sUndoAction)); - } // if ( !pListAction.get() ) const uno::Reference< beans::XPropertySet > xControlModel(*aIter,uno::UNO_QUERY); if ( xControlModel.is() ) xControlModel->setPropertyValue(_sProperty,_aValue); - } // for(; aIter != aSelection.end();++aIter) + } + return !aSelection.empty(); } // ----------------------------------------------------------------------------- @@ -4375,4 +4387,33 @@ uno::Reference< container::XNameAccess > OReportController::getColumns() const } return sLabel; } + +// ----------------------------------------------------------------------------- +SfxUndoManager& OReportController::getUndoManager() const +{ + DBG_TESTSOLARMUTEX(); + // this is expected to be called during UI actions, so the SM is assumed to be locked + + ::boost::shared_ptr< OReportModel > pReportModel( getSdrModel() ); + ENSURE_OR_THROW( !!pReportModel, "no access to our model" ); + + SfxUndoManager* pUndoManager( pReportModel->GetSdrUndoManager() ); + ENSURE_OR_THROW( pUndoManager != NULL, "no access to our model's UndoManager" ); + + return *pUndoManager; +} + +// ----------------------------------------------------------------------------- +void OReportController::clearUndoManager() const +{ + getUndoManager().Clear(); +} + // ----------------------------------------------------------------------------- +void OReportController::addUndoAction( SfxUndoAction* i_pAction ) +{ + getUndoManager().AddUndoAction( i_pAction ); + + InvalidateFeature( SID_UNDO ); + InvalidateFeature( SID_REDO ); +} diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index ae9c8e0e0bb3..063986f140b4 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -329,15 +329,14 @@ void OSectionWindow::zoom(const Fraction& _aZoom) //----------------------------------------------------------------------------- IMPL_LINK( OSectionWindow, StartSplitHdl, Splitter*, ) { - const String sEmpty(ModuleRes(RID_STR_UNDO_CHANGE_SIZE)); - getViewsWindow()->getView()->getReportView()->getController().GetUndoManager().EnterListAction(sEmpty,String()); + const String sUndoAction( ModuleRes( RID_STR_UNDO_CHANGE_SIZE ) ); + getViewsWindow()->getView()->getReportView()->getController().getUndoManager().EnterListAction( sUndoAction, String() ); return 0L; } //------------------------------------------------------------------------------ IMPL_LINK( OSectionWindow, EndSplitHdl, Splitter*, ) { - getViewsWindow()->getView()->getReportView()->getController().GetUndoManager().LeaveListAction(); - /*getViewsWindow()->Resize();*/ + getViewsWindow()->getView()->getReportView()->getController().getUndoManager().LeaveListAction(); return 0L; } //----------------------------------------------------------------------------- diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 21735676d078..2de8db6c25f0 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().GetUndoManager(),sUndoAction); + const UndoContext aUndoContext( getView()->getReportView()->getController().getUndoManager(), sUndoAction ); Point aNewPos = _aPnt; OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aNewPos); -- cgit From 068d7541e2cba4a40f71ec830e39c3901966ce1c Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 25 Nov 2010 14:46:04 +0100 Subject: undoapi: renamed Undo.* to RptUndo.*, to not confuse a certain IDE with different same-named files in the source tree ... --- reportdesign/source/ui/dlg/Navigator.cxx | 2 +- reportdesign/source/ui/inc/RptUndo.hxx | 153 ++++++++ reportdesign/source/ui/inc/Undo.hxx | 153 -------- reportdesign/source/ui/misc/RptUndo.cxx | 411 ++++++++++++++++++++ reportdesign/source/ui/misc/Undo.cxx | 416 --------------------- reportdesign/source/ui/misc/makefile.mk | 2 +- reportdesign/source/ui/report/ReportController.cxx | 2 +- 7 files changed, 567 insertions(+), 572 deletions(-) create mode 100644 reportdesign/source/ui/inc/RptUndo.hxx delete mode 100644 reportdesign/source/ui/inc/Undo.hxx create mode 100644 reportdesign/source/ui/misc/RptUndo.cxx delete mode 100644 reportdesign/source/ui/misc/Undo.cxx (limited to 'reportdesign/source') diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index af61f3b6d514..506fa4abd90b 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -31,7 +31,7 @@ #include "uistrings.hrc" #include "ReportController.hxx" #include "UITools.hxx" -#include "Undo.hxx" +#include "RptUndo.hxx" #include "reportformula.hxx" #include #include diff --git a/reportdesign/source/ui/inc/RptUndo.hxx b/reportdesign/source/ui/inc/RptUndo.hxx new file mode 100644 index 000000000000..479872b06573 --- /dev/null +++ b/reportdesign/source/ui/inc/RptUndo.hxx @@ -0,0 +1,153 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef RPTUI_UNDO_HXX +#define RPTUI_UNDO_HXX + +#include "UndoActions.hxx" +#include + +FORWARD_DECLARE_INTERFACE(awt,XControl) +FORWARD_DECLARE_INTERFACE(awt,XControlContainer) +FORWARD_DECLARE_INTERFACE(drawing,XShape) +namespace dbaui +{ + class IController; +} +namespace rptui +{ + class OObjectBase; + + + /** \class OSectionUndo + * Undo class for section add and remove. + */ + class OSectionUndo : public OCommentUndoAction + { + OSectionUndo(const OSectionUndo&); + void operator =(const OSectionUndo&); + protected: + ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> > + m_aControls; + ::std::vector< ::std::pair< ::rtl::OUString ,::com::sun::star::uno::Any> > + m_aValues; + Action m_eAction; + sal_uInt16 m_nSlot; + bool m_bInserted; + + virtual void implReInsert( ) = 0; + virtual void implReRemove( ) = 0; + + void collectControls(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); + public: + TYPEINFO(); + OSectionUndo( OReportModel& rMod + ,sal_uInt16 _nSlot + ,Action _eAction + ,USHORT nCommentID); + virtual ~OSectionUndo(); + + virtual void Undo(); + virtual void Redo(); + }; + + /** Undo action for the group header, footer, page header, footer + */ + class OReportSectionUndo : public OSectionUndo + { + OReportHelper m_aReportHelper; + ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > + ,OReportHelper> m_pMemberFunction; + + void implReInsert( ); + void implReRemove( ); + OReportSectionUndo(const OReportSectionUndo&); + void operator =(const OReportSectionUndo&); + public: + TYPEINFO(); + //OReportSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection + OReportSectionUndo( OReportModel& rMod + ,sal_uInt16 _nSlot + ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > + ,OReportHelper> _pMemberFunction + ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport + ,Action _eAction + ,USHORT nCommentID); + virtual ~OReportSectionUndo(); + }; + + /** Undo action for the group header, footer + */ + class OGroupSectionUndo : public OSectionUndo + { + OGroupHelper m_aGroupHelper; + ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > + ,OGroupHelper> m_pMemberFunction; + + mutable ::rtl::OUString m_sName; + + void implReInsert( ); + void implReRemove( ); + OGroupSectionUndo(const OGroupSectionUndo&); + void operator =(const OGroupSectionUndo&); + public: + TYPEINFO(); + //OGroupSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection + OGroupSectionUndo( OReportModel& rMod + ,sal_uInt16 _nSlot + ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > + ,OGroupHelper> _pMemberFunction + ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup + ,Action _eAction + ,USHORT nCommentID); + + virtual String GetComment() const; + }; + + /** /class OGroupUndo + * \brief Undo action for removing a group object. + */ + class OGroupUndo : public OCommentUndoAction + { + ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup> m_xGroup; /// m_xReportDefinition; ///& _xGroup + ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition); + virtual void Undo(); + virtual void Redo(); + }; +} +#endif // RPTUI_UNDO_HXX diff --git a/reportdesign/source/ui/inc/Undo.hxx b/reportdesign/source/ui/inc/Undo.hxx deleted file mode 100644 index 479872b06573..000000000000 --- a/reportdesign/source/ui/inc/Undo.hxx +++ /dev/null @@ -1,153 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef RPTUI_UNDO_HXX -#define RPTUI_UNDO_HXX - -#include "UndoActions.hxx" -#include - -FORWARD_DECLARE_INTERFACE(awt,XControl) -FORWARD_DECLARE_INTERFACE(awt,XControlContainer) -FORWARD_DECLARE_INTERFACE(drawing,XShape) -namespace dbaui -{ - class IController; -} -namespace rptui -{ - class OObjectBase; - - - /** \class OSectionUndo - * Undo class for section add and remove. - */ - class OSectionUndo : public OCommentUndoAction - { - OSectionUndo(const OSectionUndo&); - void operator =(const OSectionUndo&); - protected: - ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> > - m_aControls; - ::std::vector< ::std::pair< ::rtl::OUString ,::com::sun::star::uno::Any> > - m_aValues; - Action m_eAction; - sal_uInt16 m_nSlot; - bool m_bInserted; - - virtual void implReInsert( ) = 0; - virtual void implReRemove( ) = 0; - - void collectControls(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); - public: - TYPEINFO(); - OSectionUndo( OReportModel& rMod - ,sal_uInt16 _nSlot - ,Action _eAction - ,USHORT nCommentID); - virtual ~OSectionUndo(); - - virtual void Undo(); - virtual void Redo(); - }; - - /** Undo action for the group header, footer, page header, footer - */ - class OReportSectionUndo : public OSectionUndo - { - OReportHelper m_aReportHelper; - ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > - ,OReportHelper> m_pMemberFunction; - - void implReInsert( ); - void implReRemove( ); - OReportSectionUndo(const OReportSectionUndo&); - void operator =(const OReportSectionUndo&); - public: - TYPEINFO(); - //OReportSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection - OReportSectionUndo( OReportModel& rMod - ,sal_uInt16 _nSlot - ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > - ,OReportHelper> _pMemberFunction - ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport - ,Action _eAction - ,USHORT nCommentID); - virtual ~OReportSectionUndo(); - }; - - /** Undo action for the group header, footer - */ - class OGroupSectionUndo : public OSectionUndo - { - OGroupHelper m_aGroupHelper; - ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > - ,OGroupHelper> m_pMemberFunction; - - mutable ::rtl::OUString m_sName; - - void implReInsert( ); - void implReRemove( ); - OGroupSectionUndo(const OGroupSectionUndo&); - void operator =(const OGroupSectionUndo&); - public: - TYPEINFO(); - //OGroupSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection - OGroupSectionUndo( OReportModel& rMod - ,sal_uInt16 _nSlot - ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > - ,OGroupHelper> _pMemberFunction - ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup - ,Action _eAction - ,USHORT nCommentID); - - virtual String GetComment() const; - }; - - /** /class OGroupUndo - * \brief Undo action for removing a group object. - */ - class OGroupUndo : public OCommentUndoAction - { - ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup> m_xGroup; /// m_xReportDefinition; ///& _xGroup - ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition); - virtual void Undo(); - virtual void Redo(); - }; -} -#endif // RPTUI_UNDO_HXX diff --git a/reportdesign/source/ui/misc/RptUndo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx new file mode 100644 index 000000000000..312946139a0a --- /dev/null +++ b/reportdesign/source/ui/misc/RptUndo.cxx @@ -0,0 +1,411 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "precompiled_reportdesign.hxx" + +#include "RptUndo.hxx" +#include "uistrings.hrc" +#include "rptui_slotid.hrc" +#include "UITools.hxx" +#include "UndoEnv.hxx" + +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace rptui +{ + using namespace ::com::sun::star; + using namespace uno; + using namespace lang; + using namespace script; + using namespace beans; + using namespace awt; + using namespace util; + using namespace container; + using namespace report; + +//---------------------------------------------------------------------------- +namespace +{ + void lcl_collectElements(const uno::Reference< report::XSection >& _xSection,::std::vector< uno::Reference< drawing::XShape> >& _rControls) + { + if ( _xSection.is() ) + { + sal_Int32 nCount = _xSection->getCount(); + _rControls.reserve(nCount); + while ( nCount ) + { + uno::Reference< drawing::XShape> xShape(_xSection->getByIndex(nCount-1),uno::UNO_QUERY); + _rControls.push_back(xShape); + _xSection->remove(xShape); + --nCount; + } + } // if ( _xSection.is() ) + } + //---------------------------------------------------------------------------- + void lcl_insertElements(const uno::Reference< report::XSection >& _xSection,const ::std::vector< uno::Reference< drawing::XShape> >& _aControls) + { + if ( _xSection.is() ) + { + ::std::vector< uno::Reference< drawing::XShape> >::const_reverse_iterator aIter = _aControls.rbegin(); + ::std::vector< uno::Reference< drawing::XShape> >::const_reverse_iterator aEnd = _aControls.rend(); + for (; aIter != aEnd; ++aIter) + { + try + { + const awt::Point aPos = (*aIter)->getPosition(); + const awt::Size aSize = (*aIter)->getSize(); + _xSection->add(*aIter); + (*aIter)->setPosition( aPos ); + (*aIter)->setSize( aSize ); + } + catch(const uno::Exception&) + { + OSL_ENSURE(0,"lcl_insertElements:Exception caught!"); + } + } + } + } + //---------------------------------------------------------------------------- + void lcl_setValues(const uno::Reference< report::XSection >& _xSection,const ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >& _aValues) + { + if ( _xSection.is() ) + { + ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >::const_iterator aIter = _aValues.begin(); + ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >::const_iterator aEnd = _aValues.end(); + for (; aIter != aEnd; ++aIter) + { + try + { + _xSection->setPropertyValue(aIter->first,aIter->second); + } + catch(const uno::Exception&) + { + OSL_ENSURE(0,"lcl_setValues:Exception caught!"); + } + } + } + } +} +//---------------------------------------------------------------------------- +TYPEINIT1( OSectionUndo, OCommentUndoAction ); +DBG_NAME(rpt_OSectionUndo) +//---------------------------------------------------------------------------- +OSectionUndo::OSectionUndo(OReportModel& _rMod + ,sal_uInt16 _nSlot + ,Action _eAction + ,USHORT nCommentID) +: OCommentUndoAction(_rMod,nCommentID) +,m_eAction(_eAction) +,m_nSlot(_nSlot) +,m_bInserted(false) +{ + DBG_CTOR(rpt_OSectionUndo,NULL); +} +// ----------------------------------------------------------------------------- +OSectionUndo::~OSectionUndo() +{ + if ( !m_bInserted ) + { + OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv(); + ::std::vector< uno::Reference< drawing::XShape> >::iterator aEnd = m_aControls.end(); + for (::std::vector< uno::Reference< drawing::XShape> >::iterator aIter = m_aControls.begin(); aIter != aEnd; ++aIter) + { + uno::Reference< drawing::XShape> xShape = *aIter; + rEnv.RemoveElement(xShape); + +#if OSL_DEBUG_LEVEL > 0 + SvxShape* pShape = SvxShape::getImplementation( xShape ); + SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL; + OSL_ENSURE( pShape && pShape->HasSdrObjectOwnership() && pObject && !pObject->IsInserted(), + "OSectionUndo::~OSectionUndo: inconsistency in the shape/object ownership!" ); +#endif + try + { + comphelper::disposeComponent(xShape); + } + catch(uno::Exception) + { + OSL_ENSURE(0,"Exception caught!"); + } + } + } + DBG_DTOR(rpt_OSectionUndo,NULL); +} +// ----------------------------------------------------------------------------- +void OSectionUndo::collectControls(const uno::Reference< report::XSection >& _xSection) +{ + m_aControls.clear(); + try + { + // copy all properties for restoring + uno::Reference< beans::XPropertySetInfo> xInfo = _xSection->getPropertySetInfo(); + uno::Sequence< beans::Property> aSeq = xInfo->getProperties(); + const beans::Property* pIter = aSeq.getConstArray(); + const beans::Property* pEnd = pIter + aSeq.getLength(); + for(;pIter != pEnd;++pIter) + { + if ( 0 == (pIter->Attributes & beans::PropertyAttribute::READONLY) ) + m_aValues.push_back(::std::pair< ::rtl::OUString ,uno::Any>(pIter->Name,_xSection->getPropertyValue(pIter->Name))); + } + lcl_collectElements(_xSection,m_aControls); + } + catch(uno::Exception&) + { + } +} +//---------------------------------------------------------------------------- +void OSectionUndo::Undo() +{ + try + { + switch ( m_eAction ) + { + case Inserted: + implReRemove(); + break; + + case Removed: + implReInsert(); + break; + } + } + catch( const Exception& ) + { + OSL_ENSURE( sal_False, "OSectionUndo::Undo: caught an exception!" ); + } +} +//---------------------------------------------------------------------------- +void OSectionUndo::Redo() +{ + try + { + switch ( m_eAction ) + { + case Inserted: + implReInsert(); + break; + + case Removed: + implReRemove(); + break; + } + } + catch( const Exception& ) + { + OSL_ENSURE( sal_False, "OSectionUndo::Redo: caught an exception!" ); + } +} +//---------------------------------------------------------------------------- +TYPEINIT1( OReportSectionUndo, OSectionUndo ); +//---------------------------------------------------------------------------- +OReportSectionUndo::OReportSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot + ,::std::mem_fun_t< uno::Reference< report::XSection > + ,OReportHelper> _pMemberFunction + ,const uno::Reference< report::XReportDefinition >& _xReport + ,Action _eAction + ,USHORT nCommentID) +: OSectionUndo(_rMod,_nSlot,_eAction,nCommentID) +,m_aReportHelper(_xReport) +,m_pMemberFunction(_pMemberFunction) +{ + if( m_eAction == Removed ) + collectControls(m_pMemberFunction(&m_aReportHelper)); +} +// ----------------------------------------------------------------------------- +OReportSectionUndo::~OReportSectionUndo() +{ +} +//---------------------------------------------------------------------------- +void OReportSectionUndo::implReInsert( ) +{ + const uno::Sequence< beans::PropertyValue > aArgs; + m_pController->executeChecked(m_nSlot,aArgs); + uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aReportHelper); + lcl_insertElements(xSection,m_aControls); + lcl_setValues(xSection,m_aValues); + m_bInserted = true; +} +//---------------------------------------------------------------------------- +void OReportSectionUndo::implReRemove( ) +{ + if( m_eAction == Removed ) + collectControls(m_pMemberFunction(&m_aReportHelper)); + const uno::Sequence< beans::PropertyValue > aArgs; + m_pController->executeChecked(m_nSlot,aArgs); + m_bInserted = false; +} +//---------------------------------------------------------------------------- +TYPEINIT1( OGroupSectionUndo, OSectionUndo ); +//---------------------------------------------------------------------------- +OGroupSectionUndo::OGroupSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot + ,::std::mem_fun_t< uno::Reference< report::XSection > + ,OGroupHelper> _pMemberFunction + ,const uno::Reference< report::XGroup >& _xGroup + ,Action _eAction + ,USHORT nCommentID) +: OSectionUndo(_rMod,_nSlot,_eAction,nCommentID) +,m_aGroupHelper(_xGroup) +,m_pMemberFunction(_pMemberFunction) +{ + if( m_eAction == Removed ) + { + uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aGroupHelper); + if ( xSection.is() ) + m_sName = xSection->getName(); + collectControls(xSection); + } +} +//---------------------------------------------------------------------------- +String OGroupSectionUndo::GetComment() const +{ + if ( !m_sName.getLength() ) + { + try + { + uno::Reference< report::XSection > xSection = const_cast(this)->m_pMemberFunction(&const_cast(this)->m_aGroupHelper); + + if ( xSection.is() ) + m_sName = xSection->getName(); + } + catch(uno::Exception&) + {} + } + return m_strComment + m_sName; +} +//---------------------------------------------------------------------------- +void OGroupSectionUndo::implReInsert( ) +{ + uno::Sequence< beans::PropertyValue > aArgs(2); + + aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? PROPERTY_HEADERON : PROPERTY_FOOTERON; + aArgs[0].Value <<= sal_True; + aArgs[1].Name = PROPERTY_GROUP; + aArgs[1].Value <<= m_aGroupHelper.getGroup(); + m_pController->executeChecked(m_nSlot,aArgs); + + uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aGroupHelper); + lcl_insertElements(xSection,m_aControls); + lcl_setValues(xSection,m_aValues); + m_bInserted = true; +} +//---------------------------------------------------------------------------- +void OGroupSectionUndo::implReRemove( ) +{ + if( m_eAction == Removed ) + collectControls(m_pMemberFunction(&m_aGroupHelper)); + + uno::Sequence< beans::PropertyValue > aArgs(2); + + aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? PROPERTY_HEADERON : PROPERTY_FOOTERON; + aArgs[0].Value <<= sal_False; + aArgs[1].Name = PROPERTY_GROUP; + aArgs[1].Value <<= m_aGroupHelper.getGroup(); + + m_pController->executeChecked(m_nSlot,aArgs); + m_bInserted = false; +} +//---------------------------------------------------------------------------- +TYPEINIT1( OGroupUndo, OCommentUndoAction ); +//---------------------------------------------------------------------------- +OGroupUndo::OGroupUndo(OReportModel& _rMod + ,USHORT nCommentID + ,Action _eAction + ,const uno::Reference< report::XGroup>& _xGroup + ,const uno::Reference< report::XReportDefinition >& _xReportDefinition) +: OCommentUndoAction(_rMod,nCommentID) +,m_xGroup(_xGroup) +,m_xReportDefinition(_xReportDefinition) +,m_eAction(_eAction) +{ + m_nLastPosition = getPositionInIndexAccess(m_xReportDefinition->getGroups().get(),m_xGroup); +} +//---------------------------------------------------------------------------- +void OGroupUndo::implReInsert( ) +{ + try + { + m_xReportDefinition->getGroups()->insertByIndex(m_nLastPosition,uno::makeAny(m_xGroup)); + } + catch(uno::Exception&) + { + OSL_ENSURE(0,"Exception catched while undoing remove group"); + } +} +//---------------------------------------------------------------------------- +void OGroupUndo::implReRemove( ) +{ + try + { + m_xReportDefinition->getGroups()->removeByIndex(m_nLastPosition); + } + catch(uno::Exception&) + { + OSL_ENSURE(0,"Exception catched while redoing remove group"); + } +} +//---------------------------------------------------------------------------- +void OGroupUndo::Undo() +{ + switch ( m_eAction ) + { + case Inserted: + implReRemove(); + break; + + case Removed: + implReInsert(); + break; + } + +} +//---------------------------------------------------------------------------- +void OGroupUndo::Redo() +{ + switch ( m_eAction ) + { + case Inserted: + implReInsert(); + break; + + case Removed: + implReRemove(); + break; + } +} +//---------------------------------------------------------------------------- +//============================================================================ +} // rptui +//============================================================================ + + diff --git a/reportdesign/source/ui/misc/Undo.cxx b/reportdesign/source/ui/misc/Undo.cxx deleted file mode 100644 index d944dc2aee20..000000000000 --- a/reportdesign/source/ui/misc/Undo.cxx +++ /dev/null @@ -1,416 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "precompiled_reportdesign.hxx" - -#include "Undo.hxx" -#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC -#include "uistrings.hrc" -#endif -#ifndef _RPTUI_SLOTID_HRC_ -#include "rptui_slotid.hrc" -#endif -#ifndef RPTUI_TOOLS_HXX -#include "UITools.hxx" -#endif -#include -#include -#include - -#include "UndoEnv.hxx" -#include -#include -#include -#include -#include - -namespace rptui -{ - using namespace ::com::sun::star; - using namespace uno; - using namespace lang; - using namespace script; - using namespace beans; - using namespace awt; - using namespace util; - using namespace container; - using namespace report; - -//---------------------------------------------------------------------------- -namespace -{ - void lcl_collectElements(const uno::Reference< report::XSection >& _xSection,::std::vector< uno::Reference< drawing::XShape> >& _rControls) - { - if ( _xSection.is() ) - { - sal_Int32 nCount = _xSection->getCount(); - _rControls.reserve(nCount); - while ( nCount ) - { - uno::Reference< drawing::XShape> xShape(_xSection->getByIndex(nCount-1),uno::UNO_QUERY); - _rControls.push_back(xShape); - _xSection->remove(xShape); - --nCount; - } - } // if ( _xSection.is() ) - } - //---------------------------------------------------------------------------- - void lcl_insertElements(const uno::Reference< report::XSection >& _xSection,const ::std::vector< uno::Reference< drawing::XShape> >& _aControls) - { - if ( _xSection.is() ) - { - ::std::vector< uno::Reference< drawing::XShape> >::const_reverse_iterator aIter = _aControls.rbegin(); - ::std::vector< uno::Reference< drawing::XShape> >::const_reverse_iterator aEnd = _aControls.rend(); - for (; aIter != aEnd; ++aIter) - { - try - { - const awt::Point aPos = (*aIter)->getPosition(); - const awt::Size aSize = (*aIter)->getSize(); - _xSection->add(*aIter); - (*aIter)->setPosition( aPos ); - (*aIter)->setSize( aSize ); - } - catch(const uno::Exception&) - { - OSL_ENSURE(0,"lcl_insertElements:Exception caught!"); - } - } - } - } - //---------------------------------------------------------------------------- - void lcl_setValues(const uno::Reference< report::XSection >& _xSection,const ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >& _aValues) - { - if ( _xSection.is() ) - { - ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >::const_iterator aIter = _aValues.begin(); - ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >::const_iterator aEnd = _aValues.end(); - for (; aIter != aEnd; ++aIter) - { - try - { - _xSection->setPropertyValue(aIter->first,aIter->second); - } - catch(const uno::Exception&) - { - OSL_ENSURE(0,"lcl_setValues:Exception caught!"); - } - } - } - } -} -//---------------------------------------------------------------------------- -TYPEINIT1( OSectionUndo, OCommentUndoAction ); -DBG_NAME(rpt_OSectionUndo) -//---------------------------------------------------------------------------- -OSectionUndo::OSectionUndo(OReportModel& _rMod - ,sal_uInt16 _nSlot - ,Action _eAction - ,USHORT nCommentID) -: OCommentUndoAction(_rMod,nCommentID) -,m_eAction(_eAction) -,m_nSlot(_nSlot) -,m_bInserted(false) -{ - DBG_CTOR(rpt_OSectionUndo,NULL); -} -// ----------------------------------------------------------------------------- -OSectionUndo::~OSectionUndo() -{ - if ( !m_bInserted ) - { - OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv(); - ::std::vector< uno::Reference< drawing::XShape> >::iterator aEnd = m_aControls.end(); - for (::std::vector< uno::Reference< drawing::XShape> >::iterator aIter = m_aControls.begin(); aIter != aEnd; ++aIter) - { - uno::Reference< drawing::XShape> xShape = *aIter; - rEnv.RemoveElement(xShape); - -#if OSL_DEBUG_LEVEL > 0 - SvxShape* pShape = SvxShape::getImplementation( xShape ); - SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL; - OSL_ENSURE( pShape && pShape->HasSdrObjectOwnership() && pObject && !pObject->IsInserted(), - "OSectionUndo::~OSectionUndo: inconsistency in the shape/object ownership!" ); -#endif - try - { - comphelper::disposeComponent(xShape); - } - catch(uno::Exception) - { - OSL_ENSURE(0,"Exception caught!"); - } - } - } - DBG_DTOR(rpt_OSectionUndo,NULL); -} -// ----------------------------------------------------------------------------- -void OSectionUndo::collectControls(const uno::Reference< report::XSection >& _xSection) -{ - m_aControls.clear(); - try - { - // copy all properties for restoring - uno::Reference< beans::XPropertySetInfo> xInfo = _xSection->getPropertySetInfo(); - uno::Sequence< beans::Property> aSeq = xInfo->getProperties(); - const beans::Property* pIter = aSeq.getConstArray(); - const beans::Property* pEnd = pIter + aSeq.getLength(); - for(;pIter != pEnd;++pIter) - { - if ( 0 == (pIter->Attributes & beans::PropertyAttribute::READONLY) ) - m_aValues.push_back(::std::pair< ::rtl::OUString ,uno::Any>(pIter->Name,_xSection->getPropertyValue(pIter->Name))); - } - lcl_collectElements(_xSection,m_aControls); - } - catch(uno::Exception&) - { - } -} -//---------------------------------------------------------------------------- -void OSectionUndo::Undo() -{ - try - { - switch ( m_eAction ) - { - case Inserted: - implReRemove(); - break; - - case Removed: - implReInsert(); - break; - } - } - catch( const Exception& ) - { - OSL_ENSURE( sal_False, "OSectionUndo::Undo: caught an exception!" ); - } -} -//---------------------------------------------------------------------------- -void OSectionUndo::Redo() -{ - try - { - switch ( m_eAction ) - { - case Inserted: - implReInsert(); - break; - - case Removed: - implReRemove(); - break; - } - } - catch( const Exception& ) - { - OSL_ENSURE( sal_False, "OSectionUndo::Redo: caught an exception!" ); - } -} -//---------------------------------------------------------------------------- -TYPEINIT1( OReportSectionUndo, OSectionUndo ); -//---------------------------------------------------------------------------- -OReportSectionUndo::OReportSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot - ,::std::mem_fun_t< uno::Reference< report::XSection > - ,OReportHelper> _pMemberFunction - ,const uno::Reference< report::XReportDefinition >& _xReport - ,Action _eAction - ,USHORT nCommentID) -: OSectionUndo(_rMod,_nSlot,_eAction,nCommentID) -,m_aReportHelper(_xReport) -,m_pMemberFunction(_pMemberFunction) -{ - if( m_eAction == Removed ) - collectControls(m_pMemberFunction(&m_aReportHelper)); -} -// ----------------------------------------------------------------------------- -OReportSectionUndo::~OReportSectionUndo() -{ -} -//---------------------------------------------------------------------------- -void OReportSectionUndo::implReInsert( ) -{ - const uno::Sequence< beans::PropertyValue > aArgs; - m_pController->executeChecked(m_nSlot,aArgs); - uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aReportHelper); - lcl_insertElements(xSection,m_aControls); - lcl_setValues(xSection,m_aValues); - m_bInserted = true; -} -//---------------------------------------------------------------------------- -void OReportSectionUndo::implReRemove( ) -{ - if( m_eAction == Removed ) - collectControls(m_pMemberFunction(&m_aReportHelper)); - const uno::Sequence< beans::PropertyValue > aArgs; - m_pController->executeChecked(m_nSlot,aArgs); - m_bInserted = false; -} -//---------------------------------------------------------------------------- -TYPEINIT1( OGroupSectionUndo, OSectionUndo ); -//---------------------------------------------------------------------------- -OGroupSectionUndo::OGroupSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot - ,::std::mem_fun_t< uno::Reference< report::XSection > - ,OGroupHelper> _pMemberFunction - ,const uno::Reference< report::XGroup >& _xGroup - ,Action _eAction - ,USHORT nCommentID) -: OSectionUndo(_rMod,_nSlot,_eAction,nCommentID) -,m_aGroupHelper(_xGroup) -,m_pMemberFunction(_pMemberFunction) -{ - if( m_eAction == Removed ) - { - uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aGroupHelper); - if ( xSection.is() ) - m_sName = xSection->getName(); - collectControls(xSection); - } -} -//---------------------------------------------------------------------------- -String OGroupSectionUndo::GetComment() const -{ - if ( !m_sName.getLength() ) - { - try - { - uno::Reference< report::XSection > xSection = const_cast(this)->m_pMemberFunction(&const_cast(this)->m_aGroupHelper); - - if ( xSection.is() ) - m_sName = xSection->getName(); - } - catch(uno::Exception&) - {} - } - return m_strComment + m_sName; -} -//---------------------------------------------------------------------------- -void OGroupSectionUndo::implReInsert( ) -{ - uno::Sequence< beans::PropertyValue > aArgs(2); - - aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? PROPERTY_HEADERON : PROPERTY_FOOTERON; - aArgs[0].Value <<= sal_True; - aArgs[1].Name = PROPERTY_GROUP; - aArgs[1].Value <<= m_aGroupHelper.getGroup(); - m_pController->executeChecked(m_nSlot,aArgs); - - uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aGroupHelper); - lcl_insertElements(xSection,m_aControls); - lcl_setValues(xSection,m_aValues); - m_bInserted = true; -} -//---------------------------------------------------------------------------- -void OGroupSectionUndo::implReRemove( ) -{ - if( m_eAction == Removed ) - collectControls(m_pMemberFunction(&m_aGroupHelper)); - - uno::Sequence< beans::PropertyValue > aArgs(2); - - aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? PROPERTY_HEADERON : PROPERTY_FOOTERON; - aArgs[0].Value <<= sal_False; - aArgs[1].Name = PROPERTY_GROUP; - aArgs[1].Value <<= m_aGroupHelper.getGroup(); - - m_pController->executeChecked(m_nSlot,aArgs); - m_bInserted = false; -} -//---------------------------------------------------------------------------- -TYPEINIT1( OGroupUndo, OCommentUndoAction ); -//---------------------------------------------------------------------------- -OGroupUndo::OGroupUndo(OReportModel& _rMod - ,USHORT nCommentID - ,Action _eAction - ,const uno::Reference< report::XGroup>& _xGroup - ,const uno::Reference< report::XReportDefinition >& _xReportDefinition) -: OCommentUndoAction(_rMod,nCommentID) -,m_xGroup(_xGroup) -,m_xReportDefinition(_xReportDefinition) -,m_eAction(_eAction) -{ - m_nLastPosition = getPositionInIndexAccess(m_xReportDefinition->getGroups().get(),m_xGroup); -} -//---------------------------------------------------------------------------- -void OGroupUndo::implReInsert( ) -{ - try - { - m_xReportDefinition->getGroups()->insertByIndex(m_nLastPosition,uno::makeAny(m_xGroup)); - } - catch(uno::Exception&) - { - OSL_ENSURE(0,"Exception catched while undoing remove group"); - } -} -//---------------------------------------------------------------------------- -void OGroupUndo::implReRemove( ) -{ - try - { - m_xReportDefinition->getGroups()->removeByIndex(m_nLastPosition); - } - catch(uno::Exception&) - { - OSL_ENSURE(0,"Exception catched while redoing remove group"); - } -} -//---------------------------------------------------------------------------- -void OGroupUndo::Undo() -{ - switch ( m_eAction ) - { - case Inserted: - implReRemove(); - break; - - case Removed: - implReInsert(); - break; - } - -} -//---------------------------------------------------------------------------- -void OGroupUndo::Redo() -{ - switch ( m_eAction ) - { - case Inserted: - implReInsert(); - break; - - case Removed: - implReRemove(); - break; - } -} -//---------------------------------------------------------------------------- -//============================================================================ -} // rptui -//============================================================================ - - diff --git a/reportdesign/source/ui/misc/makefile.mk b/reportdesign/source/ui/misc/makefile.mk index b12bafdc7760..494b68023d62 100644 --- a/reportdesign/source/ui/misc/makefile.mk +++ b/reportdesign/source/ui/misc/makefile.mk @@ -44,7 +44,7 @@ VISIBILITY_HIDDEN=TRUE # ... object files ............................ EXCEPTIONSFILES= \ - $(SLO)$/Undo.obj \ + $(SLO)$/RptUndo.obj \ $(SLO)$/ColorListener.obj \ $(SLO)$/UITools.obj \ $(SLO)$/rptuiservices.obj \ diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 9b7dd3374b44..7542517f11c1 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -127,7 +127,7 @@ #include "DesignView.hxx" #include "ModuleHelper.hxx" #include "RptObject.hxx" -#include "Undo.hxx" +#include "RptUndo.hxx" #include "uistrings.hrc" #include "RptDef.hxx" #include "ReportSection.hxx" -- cgit From 25aa1b3dcf8a887468a9da27cfa268b9df8dca22 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 17 Dec 2010 12:33:22 +0100 Subject: undoapi: (I|Sfx)UndoManager now working with size_t instead of USHORT --- reportdesign/source/ui/report/ReportController.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 7542517f11c1..885d605277f8 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -461,7 +461,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_REDO: case SID_UNDO: { - USHORT ( SfxUndoManager::*retrieveCount )( bool const ) const = + size_t ( SfxUndoManager::*retrieveCount )( bool const ) const = ( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionCount : &SfxUndoManager::GetRedoActionCount; SfxUndoManager& rUndoManager( getUndoManager() ); @@ -469,7 +469,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const if ( aReturn.bEnabled ) { // TODO: add "Undo/Redo: prefix" - String ( SfxUndoManager::*retrieveComment )( USHORT, bool const ) const = + String ( SfxUndoManager::*retrieveComment )( size_t, bool const ) const = ( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionComment : &SfxUndoManager::GetRedoActionComment; aReturn.sTitle = (rUndoManager.*retrieveComment)( 0, ::svl::IUndoManager::TopLevel ); } -- cgit From 9d03441ed0e9ac247656b3baaca9030c89e20551 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 14 Jan 2011 17:40:56 +0100 Subject: removetooltypes01: #i112600# remove tooltypes from reportdesign --- reportdesign/source/core/sdr/ReportDrawPage.cxx | 2 +- reportdesign/source/core/sdr/ReportUndoFactory.cxx | 12 +-- reportdesign/source/core/sdr/RptModel.cxx | 6 +- reportdesign/source/core/sdr/RptObject.cxx | 20 ++-- reportdesign/source/core/sdr/RptPage.cxx | 16 +-- reportdesign/source/core/sdr/UndoActions.cxx | 8 +- reportdesign/source/core/sdr/UndoEnv.cxx | 2 +- reportdesign/source/filter/xml/xmlExport.cxx | 2 +- reportdesign/source/filter/xml/xmlExport.hxx | 2 +- reportdesign/source/filter/xml/xmlfilter.cxx | 2 +- reportdesign/source/ui/dlg/AddField.cxx | 34 +++--- reportdesign/source/ui/dlg/CondFormat.cxx | 6 +- reportdesign/source/ui/dlg/Condition.cxx | 26 ++--- reportdesign/source/ui/dlg/Condition.hxx | 2 +- reportdesign/source/ui/dlg/Formula.cxx | 10 +- reportdesign/source/ui/dlg/GroupExchange.cxx | 2 +- reportdesign/source/ui/dlg/GroupsSorting.cxx | 72 ++++++------- reportdesign/source/ui/dlg/Navigator.cxx | 34 +++--- reportdesign/source/ui/dlg/dlgpage.cxx | 2 +- reportdesign/source/ui/inc/CondFormat.hxx | 4 +- reportdesign/source/ui/inc/DesignView.hxx | 36 +++---- reportdesign/source/ui/inc/Formula.hxx | 8 +- reportdesign/source/ui/inc/FunctionHelper.hxx | 2 +- reportdesign/source/ui/inc/GeometryHandler.hxx | 2 +- reportdesign/source/ui/inc/GroupsSorting.hxx | 2 +- reportdesign/source/ui/inc/ReportController.hxx | 8 +- reportdesign/source/ui/inc/ReportRuler.hxx | 2 +- reportdesign/source/ui/inc/ReportSection.hxx | 8 +- reportdesign/source/ui/inc/ReportWindow.hxx | 16 +-- reportdesign/source/ui/inc/ScrollHelper.hxx | 16 +-- reportdesign/source/ui/inc/SectionWindow.hxx | 8 +- reportdesign/source/ui/inc/UITools.hxx | 2 +- reportdesign/source/ui/inc/Undo.hxx | 8 +- reportdesign/source/ui/inc/ViewsWindow.hxx | 30 +++--- reportdesign/source/ui/inc/dlgedfunc.hxx | 20 ++-- reportdesign/source/ui/inc/dlgpage.hxx | 2 +- .../source/ui/inspection/DefaultInspection.cxx | 2 +- reportdesign/source/ui/misc/FunctionHelper.cxx | 4 +- reportdesign/source/ui/misc/UITools.cxx | 28 ++--- reportdesign/source/ui/misc/Undo.cxx | 8 +- .../source/ui/misc/statusbarcontroller.cxx | 6 +- reportdesign/source/ui/misc/toolboxcontroller.cxx | 10 +- reportdesign/source/ui/report/DesignView.cxx | 38 +++---- reportdesign/source/ui/report/EndMarker.cxx | 10 +- reportdesign/source/ui/report/FixedTextColor.cxx | 4 +- .../source/ui/report/FormattedFieldBeautifier.cxx | 2 +- reportdesign/source/ui/report/ReportController.cxx | 34 +++--- reportdesign/source/ui/report/ReportRuler.cxx | 2 +- reportdesign/source/ui/report/ReportSection.cxx | 36 +++---- reportdesign/source/ui/report/ReportWindow.cxx | 22 ++-- reportdesign/source/ui/report/ScrollHelper.cxx | 16 +-- reportdesign/source/ui/report/SectionView.cxx | 20 ++-- reportdesign/source/ui/report/SectionWindow.cxx | 10 +- reportdesign/source/ui/report/StartMarker.cxx | 16 +-- reportdesign/source/ui/report/ViewsWindow.cxx | 60 +++++------ reportdesign/source/ui/report/dlgedfunc.cxx | 116 ++++++++++----------- reportdesign/source/ui/report/propbrw.cxx | 6 +- 57 files changed, 442 insertions(+), 442 deletions(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx index 6ef0f970078f..1cfdfaf0e0f9 100644 --- a/reportdesign/source/core/sdr/ReportDrawPage.cxx +++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx @@ -118,7 +118,7 @@ uno::Reference< drawing::XShape > OReportDrawPage::_CreateShape( SdrObject *pOb /************************************************** * Das leere OLE-Objekt bekommt ein neues IPObj **************************************************/ - pObj->SetEmptyPresObj(FALSE); + pObj->SetEmptyPresObj(sal_False); pOle2Obj->SetOutlinerParaObject(NULL); pOle2Obj->SetObjRef(xObj); pOle2Obj->SetPersistName(sName); diff --git a/reportdesign/source/core/sdr/ReportUndoFactory.cxx b/reportdesign/source/core/sdr/ReportUndoFactory.cxx index e0e089e651b2..eb2fdcb893d8 100644 --- a/reportdesign/source/core/sdr/ReportUndoFactory.cxx +++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx @@ -33,7 +33,7 @@ namespace rptui { using namespace ::com::sun::star; // ----------------------------------------------------------------------------- -SdrUndoAction* lcl_createUndo(SdrObject& rObject,Action _eAction,USHORT _nCommentId) +SdrUndoAction* lcl_createUndo(SdrObject& rObject,Action _eAction,sal_uInt16 _nCommentId) { OObjectBase* pObj = dynamic_cast(&rObject); if ( !pObj ) @@ -79,12 +79,12 @@ SdrUndoAction* OReportUndoFactory::CreateUndoGeoObject( SdrObject& rObject ) SdrUndoAction* OReportUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText ) { - return m_pUndoFactory->CreateUndoAttrObject( rObject, bStyleSheet1 ? TRUE : FALSE, bSaveText ? TRUE : FALSE ); + return m_pUndoFactory->CreateUndoAttrObject( rObject, bStyleSheet1 ? sal_True : sal_False, bSaveText ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect ) { - return m_pUndoFactory->CreateUndoRemoveObject( rObject, bOrdNumDirect ? TRUE : FALSE ); + return m_pUndoFactory->CreateUndoRemoveObject( rObject, bOrdNumDirect ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool /*bOrdNumDirect*/ ) @@ -95,7 +95,7 @@ SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject, b SdrUndoAction* OReportUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool /*bOrdNumDirect*/ ) { return lcl_createUndo(rObject,rptui::Removed,RID_STR_UNDO_DELETE_CONTROL); - //return m_pUndoFactory->CreateUndoDeleteObject( rObject, bOrdNumDirect ? TRUE : FALSE ); + //return m_pUndoFactory->CreateUndoDeleteObject( rObject, bOrdNumDirect ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool /*bOrdNumDirect*/ ) @@ -105,7 +105,7 @@ SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool SdrUndoAction* OReportUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect ) { - return m_pUndoFactory->CreateUndoCopyObject( rObject, bOrdNumDirect ? TRUE : FALSE ); + return m_pUndoFactory->CreateUndoCopyObject( rObject, bOrdNumDirect ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1) @@ -115,7 +115,7 @@ SdrUndoAction* OReportUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, s SdrUndoAction* OReportUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect ) { - return m_pUndoFactory->CreateUndoReplaceObject( rOldObject, rNewObject, bOrdNumDirect ? TRUE : FALSE ); + return m_pUndoFactory->CreateUndoReplaceObject( rOldObject, rNewObject, bOrdNumDirect ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer ) diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx index 7327456c7940..816873cbc6c5 100644 --- a/reportdesign/source/core/sdr/RptModel.cxx +++ b/reportdesign/source/core/sdr/RptModel.cxx @@ -130,7 +130,7 @@ void OReportModel::SetModified(sal_Bool _bModified) m_pController->setModified(_bModified); } // ----------------------------------------------------------------------------- -SdrPage* OReportModel::RemovePage(USHORT nPgNum) +SdrPage* OReportModel::RemovePage(sal_uInt16 nPgNum) { OReportPage* pPage = dynamic_cast(SdrModel::RemovePage(nPgNum)); //if ( pPage ) @@ -151,8 +151,8 @@ OReportPage* OReportModel::createNewPage(const uno::Reference< report::XSection OReportPage* OReportModel::getPage(const uno::Reference< report::XSection >& _xSection) { OReportPage* pPage = NULL; - USHORT nCount = GetPageCount(); - for (USHORT i = 0; i < nCount && !pPage ; ++i) + sal_uInt16 nCount = GetPageCount(); + for (sal_uInt16 i = 0; i < nCount && !pPage ; ++i) { OReportPage* pRptPage = PTR_CAST( OReportPage, GetPage(i) ); if ( pRptPage && pRptPage->getSection() == _xSection ) diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 7d1cdbc6db30..7d73977b03bb 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -509,12 +509,12 @@ OCustomShape::~OCustomShape() DBG_DTOR( rpt_OCustomShape, NULL); } // ----------------------------------------------------------------------------- -UINT16 OCustomShape::GetObjIdentifier() const +sal_uInt16 OCustomShape::GetObjIdentifier() const { - return UINT16(OBJ_CUSTOMSHAPE); + return sal_uInt16(OBJ_CUSTOMSHAPE); } //---------------------------------------------------------------------------- -UINT32 OCustomShape::GetObjInventor() const +sal_uInt32 OCustomShape::GetObjInventor() const { return ReportInventor; } @@ -692,12 +692,12 @@ void OUnoObject::impl_setReportComponent_nothrow() impl_initializeModel_nothrow(); } // ----------------------------------------------------------------------------- -UINT16 OUnoObject::GetObjIdentifier() const +sal_uInt16 OUnoObject::GetObjIdentifier() const { - return UINT16(m_nObjectType); + return sal_uInt16(m_nObjectType); } //---------------------------------------------------------------------------- -UINT32 OUnoObject::GetObjInventor() const +sal_uInt32 OUnoObject::GetObjInventor() const { return ReportInventor; } @@ -972,7 +972,7 @@ SdrObject* OUnoObject::Clone() const //---------------------------------------------------------------------------- TYPEINIT1(OOle2Obj, SdrOle2Obj); DBG_NAME( rpt_OOle2Obj ); -OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent,UINT16 _nType) +OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent,sal_uInt16 _nType) :SdrOle2Obj() ,OObjectBase(_xComponent) ,m_nType(_nType) @@ -984,7 +984,7 @@ OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent, m_bIsListening = sal_True; } //---------------------------------------------------------------------------- -OOle2Obj::OOle2Obj(const ::rtl::OUString& _sComponentName,UINT16 _nType) +OOle2Obj::OOle2Obj(const ::rtl::OUString& _sComponentName,sal_uInt16 _nType) :SdrOle2Obj() ,OObjectBase(_sComponentName) ,m_nType(_nType) @@ -999,12 +999,12 @@ OOle2Obj::~OOle2Obj() DBG_DTOR( rpt_OOle2Obj, NULL); } // ----------------------------------------------------------------------------- -UINT16 OOle2Obj::GetObjIdentifier() const +sal_uInt16 OOle2Obj::GetObjIdentifier() const { return m_nType; } //---------------------------------------------------------------------------- -UINT32 OOle2Obj::GetObjInventor() const +sal_uInt32 OOle2Obj::GetObjInventor() const { return ReportInventor; } diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx index 29f1109aeb6b..3fe30aacaaaa 100644 --- a/reportdesign/source/core/sdr/RptPage.cxx +++ b/reportdesign/source/core/sdr/RptPage.cxx @@ -78,11 +78,11 @@ SdrPage* OReportPage::Clone() const } //---------------------------------------------------------------------------- -ULONG OReportPage::getIndexOf(const uno::Reference< report::XReportComponent >& _xObject) +sal_uLong OReportPage::getIndexOf(const uno::Reference< report::XReportComponent >& _xObject) { DBG_CHKTHIS( rpt_OReportPage,NULL); - ULONG nCount = GetObjCount(); - ULONG i = 0; + sal_uLong nCount = GetObjCount(); + sal_uLong i = 0; for (; i < nCount; ++i) { OObjectBase* pObj = dynamic_cast(GetObj(i)); @@ -98,7 +98,7 @@ ULONG OReportPage::getIndexOf(const uno::Reference< report::XReportComponent >& void OReportPage::removeSdrObject(const uno::Reference< report::XReportComponent >& _xObject) { DBG_CHKTHIS( rpt_OReportPage,NULL); - ULONG nPos = getIndexOf(_xObject); + sal_uLong nPos = getIndexOf(_xObject); if ( nPos < GetObjCount() ) { OObjectBase* pBase = dynamic_cast(GetObj(nPos)); @@ -109,7 +109,7 @@ void OReportPage::removeSdrObject(const uno::Reference< report::XReportComponent } } // ----------------------------------------------------------------------------- -SdrObject* OReportPage::RemoveObject(ULONG nObjNum) +SdrObject* OReportPage::RemoveObject(sal_uLong nObjNum) { SdrObject* pObj = SdrPage::RemoveObject(nObjNum); if (getSpecialMode()) @@ -152,7 +152,7 @@ void OReportPage::insertObject(const uno::Reference< report::XReportComponent >& OSL_ENSURE(_xObject.is(),"Object is not valid to create a SdrObject!"); if ( !_xObject.is() ) // || !m_pView ) return; - ULONG nPos = getIndexOf(_xObject); + sal_uLong nPos = getIndexOf(_xObject); if ( nPos < GetObjCount() ) return; // Object already in list @@ -177,7 +177,7 @@ void OReportPage::removeTempObject(SdrObject *_pToRemoveObj) { if (_pToRemoveObj) { - for (ULONG i=0;i _xContainer ,const Reference< XInterface > & xElem - ,USHORT _nCommentId) + ,sal_uInt16 _nCommentId) :OCommentUndoAction(_rMod,_nCommentId) ,m_xElement(xElem) ,m_xContainer(_xContainer) @@ -268,7 +268,7 @@ OUndoGroupSectionAction::OUndoGroupSectionAction(SdrModel& _rMod ,OGroupHelper> _pMemberFunction ,const uno::Reference< report::XGroup >& _xGroup ,const Reference< XInterface > & xElem - ,USHORT _nCommentId) + ,sal_uInt16 _nCommentId) :OUndoContainerAction(_rMod,_eAction,NULL,xElem,_nCommentId) ,m_aGroupHelper(_xGroup) ,m_pMemberFunction(_pMemberFunction) @@ -314,7 +314,7 @@ OUndoReportSectionAction::OUndoReportSectionAction(SdrModel& _rMod ,OReportHelper> _pMemberFunction ,const uno::Reference< report::XReportDefinition >& _xReport ,const Reference< XInterface > & xElem - ,USHORT _nCommentId) + ,sal_uInt16 _nCommentId) :OUndoContainerAction(_rMod,_eAction,NULL,xElem,_nCommentId) ,m_aReportHelper(_xReport) ,m_pMemberFunction(_pMemberFunction) diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx index f4dd0a7f8645..aa9f6523e357 100644 --- a/reportdesign/source/core/sdr/UndoEnv.cxx +++ b/reportdesign/source/core/sdr/UndoEnv.cxx @@ -291,7 +291,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv { // nothing 'til now ... have to change this .... // the attributes Reference< XPropertySetInfo > xPSI( xSet->getPropertySetInfo(), UNO_SET_THROW ); - INT32 nPropertyAttributes = 0; + sal_Int32 nPropertyAttributes = 0; try { if ( xPSI->hasPropertyByName( _rEvent.PropertyName ) ) diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 2c946d5280da..eec798af7f1f 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -1436,7 +1436,7 @@ void ORptExport::_ExportAutoStyles() GetPageExport()->exportAutoStyles(); } // ----------------------------------------------------------------------------- -void ORptExport::_ExportStyles(BOOL bUsed) +void ORptExport::_ExportStyles(sal_Bool bUsed) { SvXMLExport::_ExportStyles(bUsed); diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx index d6c8aea1dcc2..0b4e48c4990a 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -181,7 +181,7 @@ private: virtual void SetBodyAttributes(); protected: - virtual void _ExportStyles( BOOL bUsed ); + virtual void _ExportStyles( sal_Bool bUsed ); virtual void _ExportAutoStyles(); virtual void _ExportContent(); virtual void _ExportMasterStyles(); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 74e6e1dd9341..463c2bfa6066 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -508,7 +508,7 @@ sal_Bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) uno::Reference xCom(GetModel(),UNO_QUERY); SfxMediumRef pMedium = new SfxMedium( - sFileName, ( STREAM_READ | STREAM_NOCREATE ), FALSE, 0 ); + sFileName, ( STREAM_READ | STREAM_NOCREATE ), sal_False, 0 ); if( pMedium ) { diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx index 11de48113cee..9a7c1d8086e2 100644 --- a/reportdesign/source/ui/dlg/AddField.cxx +++ b/reportdesign/source/ui/dlg/AddField.cxx @@ -190,7 +190,7 @@ OAddFieldWindow::OAddFieldWindow(Window* pParent m_aActions.SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction)); setToolBox(&m_aActions); m_aActions.CheckItem(SID_FM_SORTUP); - m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, FALSE); + m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, sal_False); m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) ); m_pListBox->SetSelectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) ); @@ -232,8 +232,8 @@ OAddFieldWindow::~OAddFieldWindow() if ( m_pListBox.get() ) { SvLBoxTreeList* pModel = m_pListBox->GetModel(); - ULONG nCount = pModel->GetEntryCount(); - for(ULONG i = 0; i< nCount;++i) + sal_uLong nCount = pModel->GetEntryCount(); + for(sal_uLong i = 0; i< nCount;++i) { delete static_cast(pModel->GetEntry(i)->GetUserData()); } @@ -293,7 +293,7 @@ namespace const ::rtl::OUString* pEntries = _rEntries.getConstArray(); sal_Int32 nEntries = _rEntries.getLength(); for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries ) - _rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries) ); + _rListBox.InsertEntry( *pEntries,NULL,sal_False,LIST_APPEND,new ColumnInfo(*pEntries) ); } void lcl_addToList( OAddFieldWindowListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns ) { @@ -307,9 +307,9 @@ namespace if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) ) xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel; if ( sLabel.getLength() ) - _rListBox.InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); + _rListBox.InsertEntry( sLabel,NULL,sal_False,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); else - _rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); + _rListBox.InsertEntry( *pEntries,NULL,sal_False,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); } } } @@ -326,10 +326,10 @@ void OAddFieldWindow::Update() { // ListBox loeschen m_pListBox->Clear(); - const USHORT nItemCount = m_aActions.GetItemCount(); - for (USHORT j = 0; j< nItemCount; ++j) + const sal_uInt16 nItemCount = m_aActions.GetItemCount(); + for (sal_uInt16 j = 0; j< nItemCount; ++j) { - m_aActions.EnableItem(m_aActions.GetItemId(j),FALSE); + m_aActions.EnableItem(m_aActions.GetItemId(j),sal_False); } String aTitle(ModuleRes(RID_STR_FIELDSELECTION)); @@ -374,7 +374,7 @@ void OAddFieldWindow::Update() SetText( aTitle ); if ( m_aCommandName.getLength() ) { - for (USHORT i = 0; i < nItemCount; ++i) + for (sal_uInt16 i = 0; i < nItemCount; ++i) { m_aActions.EnableItem(m_aActions.GetItemId(i)); } @@ -475,9 +475,9 @@ void OAddFieldWindow::_elementInserted( const container::ContainerEvent& _rEvent if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) ) xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel; if ( sLabel.getLength() ) - m_pListBox->InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(sName,sLabel) ); + m_pListBox->InsertEntry( sLabel,NULL,sal_False,LIST_APPEND,new ColumnInfo(sName,sLabel) ); else - m_pListBox->InsertEntry( sName,NULL,FALSE,LIST_APPEND,new ColumnInfo(sName,sLabel) ); + m_pListBox->InsertEntry( sName,NULL,sal_False,LIST_APPEND,new ColumnInfo(sName,sLabel) ); } } } @@ -534,19 +534,19 @@ void OAddFieldWindow::resizeControls(const Size& _rDiff) //------------------------------------------------------------------ IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ ) { - const USHORT nCurItem = m_aActions.GetCurItemId(); + const sal_uInt16 nCurItem = m_aActions.GetCurItemId(); if ( SID_ADD_CONTROL_PAIR == nCurItem ) OnDoubleClickHdl(NULL); else { if ( SID_FM_REMOVE_FILTER_SORT == nCurItem || !m_aActions.IsItemChecked(nCurItem) ) { - const USHORT nItemCount = m_aActions.GetItemCount(); - for (USHORT j = 0; j< nItemCount; ++j) + const sal_uInt16 nItemCount = m_aActions.GetItemCount(); + for (sal_uInt16 j = 0; j< nItemCount; ++j) { - const USHORT nItemId = m_aActions.GetItemId(j); + const sal_uInt16 nItemId = m_aActions.GetItemId(j); if ( nCurItem != nItemId ) - m_aActions.CheckItem(nItemId,FALSE); + m_aActions.CheckItem(nItemId,sal_False); } SvSortMode eSortMode = SortNone; if ( SID_FM_REMOVE_FILTER_SORT != nCurItem ) diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx index d3617749d10b..b4f9fc54b410 100644 --- a/reportdesign/source/ui/dlg/CondFormat.cxx +++ b/reportdesign/source/ui/dlg/CondFormat.cxx @@ -87,11 +87,11 @@ namespace rptui UpdateLocker( Window& _rWindow ) :m_rWindow( _rWindow ) { - _rWindow.SetUpdateMode( FALSE ); + _rWindow.SetUpdateMode( sal_False ); } ~UpdateLocker() { - m_rWindow.SetUpdateMode( TRUE ); + m_rWindow.SetUpdateMode( sal_True ); } }; @@ -400,7 +400,7 @@ namespace rptui } // ----------------------------------------------------------------------------- - void ConditionalFormattingDialog::applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor ) + void ConditionalFormattingDialog::applyCommand( size_t _nCondIndex, sal_uInt16 _nCommandId, const ::Color _aColor ) { OSL_PRECOND( _nCommandId, "ConditionalFormattingDialog::applyCommand: illegal command id!" ); try diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index e3591ae03534..0e4d7dbcad82 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -71,7 +71,7 @@ ConditionField::ConditionField( Condition* _pParent, const ResId& _rResId ) : Ed { m_pSubEdit = new Edit(this,0); SetSubEdit(m_pSubEdit); - m_pSubEdit->EnableRTL( FALSE ); + m_pSubEdit->EnableRTL( sal_False ); m_pSubEdit->SetPosPixel( Point() ); m_aFormula.SetText(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("..."))); @@ -129,7 +129,7 @@ class OColorPopup : public FloatingWindow { DECL_LINK( SelectHdl, void * ); Condition* m_pCondition; - USHORT m_nSlotId; + sal_uInt16 m_nSlotId; public: OColorPopup(Window* _pParent,Condition* _pCondition); ValueSet m_aColorSet; @@ -138,7 +138,7 @@ public: virtual void Resize(); void StartSelection(); - void SetSlotId(USHORT _nSlotId); + void SetSlotId(sal_uInt16 _nSlotId); }; // ----------------------------------------------------------------------------- OColorPopup::OColorPopup(Window* _pParent,Condition* _pCondition) @@ -204,7 +204,7 @@ void OColorPopup::StartSelection() m_aColorSet.StartSelection(); } // ----------------------------------------------------------------------------- -void OColorPopup::SetSlotId(USHORT _nSlotId) +void OColorPopup::SetSlotId(sal_uInt16 _nSlotId) { m_nSlotId = _nSlotId; if ( SID_ATTR_CHAR_COLOR_BACKGROUND == _nSlotId || SID_BACKGROUND_COLOR == _nSlotId ) @@ -216,7 +216,7 @@ void OColorPopup::SetSlotId(USHORT _nSlotId) // ----------------------------------------------------------------------------- IMPL_LINK( OColorPopup, SelectHdl, void *, EMPTYARG ) { - USHORT nItemId = m_aColorSet.GetSelectItemId(); + sal_uInt16 nItemId = m_aColorSet.GetSelectItemId(); Color aColor( nItemId == 0 ? Color( COL_TRANSPARENT ) : m_aColorSet.GetItemColor( nItemId ) ); /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() calls. @@ -330,11 +330,11 @@ Condition::~Condition() // ----------------------------------------------------------------------------- IMPL_LINK( Condition, DropdownClick, ToolBox*, /*pToolBar*/ ) { - USHORT nId( m_aActions.GetCurItemId() ); + sal_uInt16 nId( m_aActions.GetCurItemId() ); if ( !m_pColorFloat ) m_pColorFloat = new OColorPopup(&m_aActions,this); - USHORT nTextId = 0; + sal_uInt16 nTextId = 0; switch(nId) { case SID_ATTR_CHAR_COLOR2: @@ -378,7 +378,7 @@ IMPL_LINK( Condition, OnConditionAction, Button*, _pClickedButton ) } //------------------------------------------------------------------------------ -void Condition::ApplyCommand( USHORT _nCommandId, const ::Color& _rColor) +void Condition::ApplyCommand( sal_uInt16 _nCommandId, const ::Color& _rColor) { if ( _nCommandId == SID_ATTR_CHAR_COLOR2 ) m_pBtnUpdaterFontColor->Update( _rColor ); @@ -631,8 +631,8 @@ void Condition::impl_setCondition( const ::rtl::OUString& _rConditionFormula ) } // update UI - m_aConditionType.SelectEntryPos( (USHORT)eType ); - m_aOperationList.SelectEntryPos( (USHORT)eOperation ); + m_aConditionType.SelectEntryPos( (sal_uInt16)eType ); + m_aOperationList.SelectEntryPos( (sal_uInt16)eOperation ); m_aCondLHS.SetText( sLHS ); m_aCondRHS.SetText( sRHS ); @@ -667,10 +667,10 @@ void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat OSL_ENSURE(_xReportControlFormat.is(),"XReportControlFormat is NULL!"); if ( _xReportControlFormat.is() ) { - USHORT nItemCount = m_aActions.GetItemCount(); - for (USHORT j = 0; j< nItemCount; ++j) + sal_uInt16 nItemCount = m_aActions.GetItemCount(); + for (sal_uInt16 j = 0; j< nItemCount; ++j) { - USHORT nItemId = m_aActions.GetItemId(j); + sal_uInt16 nItemId = m_aActions.GetItemId(j); m_aActions.CheckItem( nItemId, m_rController.isFormatCommandEnabled( nItemId, _xReportControlFormat ) ); } diff --git a/reportdesign/source/ui/dlg/Condition.hxx b/reportdesign/source/ui/dlg/Condition.hxx index 12517480b3b5..36f0a8ecb697 100644 --- a/reportdesign/source/ui/dlg/Condition.hxx +++ b/reportdesign/source/ui/dlg/Condition.hxx @@ -148,7 +148,7 @@ namespace rptui /** forward to the parent class */ - void ApplyCommand(USHORT _nCommandId, const ::Color& _aColor ); + void ApplyCommand(sal_uInt16 _nCommandId, const ::Color& _aColor ); inline ::rptui::OReportController& getController() const { return m_rController; } diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx index 682ec6b17438..6f741698268c 100644 --- a/reportdesign/source/ui/dlg/Formula.cxx +++ b/reportdesign/source/ui/dlg/Formula.cxx @@ -115,7 +115,7 @@ bool FormulaDialog::calculateValue( const String& rStrExp, String& rStrResult ) rStrResult = rStrExp; return false; } -void FormulaDialog::doClose(BOOL _bOk) +void FormulaDialog::doClose(sal_Bool _bOk) { EndDialog(_bOk ? RET_OK : RET_CANCEL); } @@ -125,10 +125,10 @@ void FormulaDialog::insertEntryToLRUList(const IFunctionDescription* /*_pDesc void FormulaDialog::showReference(const String& /*_sFormula*/) { } -void FormulaDialog::dispatch(BOOL /*_bOK*/,BOOL /*_bMartixChecked*/) +void FormulaDialog::dispatch(sal_Bool /*_bOK*/,sal_Bool /*_bMartixChecked*/) { } -void FormulaDialog::setDispatcherLock( BOOL /*bLock*/ ) +void FormulaDialog::setDispatcherLock( sal_Bool /*bLock*/ ) { } void FormulaDialog::setReferenceInput(const FormEditData* /*_pData*/) @@ -188,7 +188,7 @@ void FormulaDialog::ShowReference(const String& /*_sRef*/) { } // ----------------------------------------------------------------------------- -void FormulaDialog::HideReference( BOOL /*bDoneRefMode*/) +void FormulaDialog::HideReference( sal_Bool /*bDoneRefMode*/) { } // ----------------------------------------------------------------------------- @@ -242,7 +242,7 @@ IMPL_LINK( FormulaDialog, OnClickHdl, OAddFieldWindow* ,_pAddFieldDlg) } // if ( m_pEdit && aArgs.getLength() ) m_pEdit = NULL; _pAddFieldDlg->Hide(); - RefInputDoneAfter( TRUE ); + RefInputDoneAfter( sal_True ); return 0L; } diff --git a/reportdesign/source/ui/dlg/GroupExchange.cxx b/reportdesign/source/ui/dlg/GroupExchange.cxx index cbce03c629fd..b5ba9534a9ad 100644 --- a/reportdesign/source/ui/dlg/GroupExchange.cxx +++ b/reportdesign/source/ui/dlg/GroupExchange.cxx @@ -60,7 +60,7 @@ namespace rptui // ----------------------------------------------------------------------------- sal_Bool OGroupExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { - ULONG nFormat = SotExchange::GetFormat(rFlavor); + sal_uLong nFormat = SotExchange::GetFormat(rFlavor); if(nFormat == OGroupExchange::getReportGroupId() ) { return SetAny(uno::makeAny(m_aGroupRow),rFlavor); diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index d4ea5fa17a48..3d9de51c227b 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -101,14 +101,14 @@ class OFieldExpressionControl : public TContainerListenerBase ::svt::ComboBoxControl* m_pComboCell; sal_Int32 m_nDataPos; sal_Int32 m_nCurrentPos; - ULONG m_nPasteEvent; - ULONG m_nDeleteEvent; + sal_uLong m_nPasteEvent; + sal_uLong m_nDeleteEvent; OGroupsSortingDialog* m_pParent; bool m_bIgnoreEvent; - void fillListBox(const uno::Reference< beans::XPropertySet>& _xDest,long nRow,USHORT nColumnId); - BOOL SaveModified(bool _bAppend); + void fillListBox(const uno::Reference< beans::XPropertySet>& _xDest,long nRow,sal_uInt16 nColumnId); + sal_Bool SaveModified(bool _bAppend); OFieldExpressionControl(const OFieldExpressionControl&); // NO COPY void operator =(const OFieldExpressionControl&); // NO ASSIGN @@ -144,18 +144,18 @@ public: */ void moveGroups(const uno::Sequence& _aGroups,sal_Int32 _nRow,sal_Bool _bSelect = sal_True); - virtual BOOL CursorMoving(long nNewRow, USHORT nNewCol); + virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol); using OFieldExpressionControl_Base::GetRowCount; protected: - virtual BOOL IsTabAllowed(BOOL bForward) const; + virtual sal_Bool IsTabAllowed(sal_Bool bForward) const; - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol ); - virtual ::svt::CellController* GetController( long nRow, USHORT nCol ); - virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const; - virtual BOOL SeekRow( long nRow ); - virtual BOOL SaveModified(); - virtual String GetCellText( long nRow, USHORT nColId ) const; + virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ); + virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ); + virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId ) const; + virtual sal_Bool SeekRow( long nRow ); + virtual sal_Bool SaveModified(); + virtual String GetCellText( long nRow, sal_uInt16 nColId ) const; virtual RowStatus GetRowStatus(long nRow) const; virtual void KeyInput(const KeyEvent& rEvt); @@ -275,7 +275,7 @@ sal_Int8 OFieldExpressionControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt sal_Int8 nAction = DND_ACTION_NONE; if ( IsEditing() ) { - USHORT nPos = m_pComboCell->GetSelectEntryPos(); + sal_uInt16 nPos = m_pComboCell->GetSelectEntryPos(); if ( COMBOBOX_ENTRY_NOTFOUND != nPos || m_pComboCell->GetText().Len() ) SaveModified(); DeactivateCell(); @@ -376,7 +376,7 @@ void OFieldExpressionControl::lateInit() aFont.SetWeight( WEIGHT_LIGHT ); SetFont(aFont); - InsertHandleColumn(static_cast(GetTextWidth('0') * 4)/*, TRUE */); + InsertHandleColumn(static_cast(GetTextWidth('0') * 4)/*, sal_True */); InsertDataColumn( FIELD_EXPRESSION, String(ModuleRes(STR_RPT_EXPRESSION)), 100); m_pComboCell = new ComboBoxControl( &GetDataWindow() ); @@ -403,7 +403,7 @@ void OFieldExpressionControl::lateInit() // not the first call RowRemoved(0, GetRowCount()); - RowInserted(0, m_aGroupPositions.size(), TRUE); + RowInserted(0, m_aGroupPositions.size(), sal_True); } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- @@ -429,19 +429,19 @@ IMPL_LINK(OFieldExpressionControl, AsynchDeactivate, void*, EMPTYARG) } //------------------------------------------------------------------------------ -BOOL OFieldExpressionControl::IsTabAllowed(BOOL /*bForward*/) const +sal_Bool OFieldExpressionControl::IsTabAllowed(sal_Bool /*bForward*/) const { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); - return FALSE; + return sal_False; } //------------------------------------------------------------------------------ -BOOL OFieldExpressionControl::SaveModified() +sal_Bool OFieldExpressionControl::SaveModified() { return SaveModified(true); } //------------------------------------------------------------------------------ -BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow) +sal_Bool OFieldExpressionControl::SaveModified(bool _bAppendRow) { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); sal_Int32 nRow = GetCurRow(); @@ -486,7 +486,7 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow) xGroup = m_pParent->getGroup(m_aGroupPositions[nRow]); if ( xGroup.is() ) { - USHORT nPos = m_pComboCell->GetSelectEntryPos(); + sal_uInt16 nPos = m_pComboCell->GetSelectEntryPos(); ::rtl::OUString sExpression; if ( COMBOBOX_ENTRY_NOTFOUND == nPos ) sExpression = m_pComboCell->GetText(); @@ -519,10 +519,10 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow) } } - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ -String OFieldExpressionControl::GetCellText( long nRow, USHORT /*nColId*/ ) const +String OFieldExpressionControl::GetCellText( long nRow, sal_uInt16 /*nColId*/ ) const { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); String sText; @@ -553,7 +553,7 @@ String OFieldExpressionControl::GetCellText( long nRow, USHORT /*nColId*/ ) cons } //------------------------------------------------------------------------------ -void OFieldExpressionControl::InitController( CellControllerRef& /*rController*/, long nRow, USHORT nColumnId ) +void OFieldExpressionControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); @@ -576,7 +576,7 @@ sal_Bool OFieldExpressionControl::CursorMoving(long nNewRow, sal_uInt16 nNewCol) return sal_True; } //------------------------------------------------------------------------------ -CellController* OFieldExpressionControl::GetController( long /*nRow*/, USHORT /*nColumnId*/ ) +CellController* OFieldExpressionControl::GetController( long /*nRow*/, sal_uInt16 /*nColumnId*/ ) { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); ComboBoxCellController* pCellController = new ComboBoxCellController( m_pComboCell ); @@ -585,17 +585,17 @@ CellController* OFieldExpressionControl::GetController( long /*nRow*/, USHORT /* } //------------------------------------------------------------------------------ -BOOL OFieldExpressionControl::SeekRow( long _nRow ) +sal_Bool OFieldExpressionControl::SeekRow( long _nRow ) { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); // die Basisklasse braucht den Aufruf, da sie sich dort merkt, welche Zeile gepainted wird EditBrowseBox::SeekRow(_nRow); m_nCurrentPos = _nRow; - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ -void OFieldExpressionControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId ) const +void OFieldExpressionControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); String aText =const_cast< OFieldExpressionControl*>(this)->GetCellText( m_nCurrentPos, nColumnId ); @@ -748,7 +748,7 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) return; } - USHORT nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); + sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); if ( nColId == HANDLE_ID ) { @@ -1019,7 +1019,7 @@ OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent { pControlsLst[i]->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot)); pControlsLst[i]->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost)); - pControlsLst[i]->Show(TRUE); + pControlsLst[i]->Show(sal_True); } // for (int i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i) for (size_t i = 0; i < (sizeof(pControlsLst)/sizeof(pControlsLst[0]))-1; ++i) @@ -1034,7 +1034,7 @@ OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i) { - pControls[i]->Show(TRUE); + pControls[i]->Show(sal_True); String sText = pControls[i]->GetText(); if ( aMnemonicGenerator.CreateMnemonic(sText) ) pControls[i]->SetText(sText); @@ -1214,7 +1214,7 @@ IMPL_LINK(OGroupsSortingDialog, OnControlFocusGot, Control*, pControl ) NumericField* pNumericField = dynamic_cast< NumericField* >( pControl ); if ( pNumericField ) pNumericField->SaveValue(); - showHelpText(static_cast(i+STR_RPT_HELP_FIELD)); + showHelpText(static_cast(i+STR_RPT_HELP_FIELD)); break; } } @@ -1237,7 +1237,7 @@ IMPL_LINK( OGroupsSortingDialog, OnFormatAction, ToolBox*, /*NOTINTERESTEDIN*/ ) { DBG_CHKTHIS( rpt_OGroupsSortingDialog,NULL); - USHORT nCommand = m_aToolBox.GetCurItemId(); + sal_uInt16 nCommand = m_aToolBox.GetCurItemId(); if ( m_pFieldExpression ) { @@ -1318,7 +1318,7 @@ IMPL_LINK( OGroupsSortingDialog, LBChangeHdl, ListBox*, pListBox ) return 1L; } // ----------------------------------------------------------------------------- -void OGroupsSortingDialog::showHelpText(USHORT _nResId) +void OGroupsSortingDialog::showHelpText(sal_uInt16 _nResId) { m_aHelpWindow.SetText(String(ModuleRes(_nResId))); } @@ -1362,8 +1362,8 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference& _x case sdbc::DataType::TIME: case sdbc::DataType::TIMESTAMP: { - USHORT nIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE }; - for (USHORT i = 0; i < sizeof(nIds)/sizeof(nIds[0]); ++i) + sal_uInt16 nIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE }; + for (sal_uInt16 i = 0; i < sizeof(nIds)/sizeof(nIds[0]); ++i) { m_aGroupOnLst.InsertEntry(String(ModuleRes(nIds[i]))); m_aGroupOnLst.SetEntryData(i+1,reinterpret_cast(i+2)); @@ -1375,7 +1375,7 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference& _x m_aGroupOnLst.SetEntryData(1,reinterpret_cast(report::GroupOn::INTERVAL)); break; } // switch(nDataType) - USHORT nPos = 0; + sal_uInt16 nPos = 0; switch(_xGroup->getGroupOn()) { case report::GroupOn::DEFAULT: diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index af61f3b6d514..aad664d4bb22 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -73,9 +73,9 @@ using namespace ::com::sun::star; using namespace utl; using namespace ::comphelper; -USHORT lcl_getImageId(const uno::Reference< report::XReportComponent>& _xElement) +sal_uInt16 lcl_getImageId(const uno::Reference< report::XReportComponent>& _xElement) { - USHORT nId = 0; + sal_uInt16 nId = 0; uno::Reference< report::XFixedLine> xFixedLine(_xElement,uno::UNO_QUERY); if ( uno::Reference< report::XFixedText>(_xElement,uno::UNO_QUERY).is() ) nId = SID_FM_FIXEDTEXT; @@ -163,8 +163,8 @@ class NavigatorTree : public ::cppu::BaseMutex ::rtl::Reference< comphelper::OSelectionChangeMultiplexer> m_pSelectionListener; unsigned short m_nTimerCounter; - SvLBoxEntry* insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition,UserData* _pData); - void traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition = LIST_APPEND); + SvLBoxEntry* insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,sal_uInt16 _nImageId,sal_uLong _nPosition,UserData* _pData); + void traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,sal_uInt16 _nImageId,sal_uLong _nPosition = LIST_APPEND); void traverseFunctions(const uno::Reference< report::XFunctions>& _xFunctions,SvLBoxEntry* _pParent); NavigatorTree(const NavigatorTree&); @@ -317,12 +317,12 @@ void NavigatorTree::Command( const CommandEvent& rEvt ) uno::Reference< report::XFunction>(pData->getContent(),uno::UNO_QUERY).is()); PopupMenu aContextMenu( ModuleRes( RID_MENU_NAVIGATOR ) ); - USHORT nCount = aContextMenu.GetItemCount(); - for (USHORT i = 0; i < nCount; ++i) + sal_uInt16 nCount = aContextMenu.GetItemCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { if ( MENUITEM_SEPARATOR != aContextMenu.GetItemType(i)) { - USHORT nId = aContextMenu.GetItemId(i); + sal_uInt16 nId = aContextMenu.GetItemId(i); aContextMenu.CheckItem(nId,m_rController.isCommandChecked(nId)); sal_Bool bEnabled = m_rController.isCommandEnabled(nId); @@ -334,8 +334,8 @@ void NavigatorTree::Command( const CommandEvent& rEvt ) else aContextMenu.EnableItem(nId,bEnabled); } - } // for (USHORT i = 0; i < nCount; ++i) - USHORT nId = aContextMenu.Execute(this, aWhere); + } // for (sal_uInt16 i = 0; i < nCount; ++i) + sal_uInt16 nId = aContextMenu.Execute(this, aWhere); if ( nId ) { uno::Sequence< beans::PropertyValue> aArgs; @@ -501,7 +501,7 @@ void NavigatorTree::_selectionChanged( const lang::EventObject& aEvent ) throw ( SetCurEntry(pEntry); } else if ( !pEntry ) - SelectAll(FALSE,FALSE); + SelectAll(sal_False,sal_False); } else { @@ -520,13 +520,13 @@ void NavigatorTree::_selectionChanged( const lang::EventObject& aEvent ) throw ( m_pSelectionListener->unlock(); } // ----------------------------------------------------------------------------- -SvLBoxEntry* NavigatorTree::insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition,UserData* _pData) +SvLBoxEntry* NavigatorTree::insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,sal_uInt16 _nImageId,sal_uLong _nPosition,UserData* _pData) { SvLBoxEntry* pEntry = NULL; if ( _nImageId ) { const Image aImage( m_aNavigatorImages.GetImage( _nImageId ) ); - pEntry = InsertEntry(_sName,aImage,aImage,_pParent,FALSE,_nPosition,_pData); + pEntry = InsertEntry(_sName,aImage,aImage,_pParent,sal_False,_nPosition,_pData); if ( pEntry ) { const Image aImageHC( m_aNavigatorImagesHC.GetImage( _nImageId ) ); @@ -535,11 +535,11 @@ SvLBoxEntry* NavigatorTree::insertEntry(const ::rtl::OUString& _sName,SvLBoxEntr } } else - pEntry = InsertEntry(_sName,_pParent,FALSE,_nPosition,_pData); + pEntry = InsertEntry(_sName,_pParent,sal_False,_nPosition,_pData); return pEntry; } // ----------------------------------------------------------------------------- -void NavigatorTree::traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition) +void NavigatorTree::traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,sal_uInt16 _nImageId,sal_uLong _nPosition) { SvLBoxEntry* pSection = insertEntry(_xSection->getName(),_pParent,_nImageId,_nPosition,new UserData(this,_xSection)); const sal_Int32 nCount = _xSection->getCount(); @@ -680,7 +680,7 @@ void NavigatorTree::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) SvLBoxEntry* pParent = find(xReport); if ( _rEvent.PropertyName == PROPERTY_REPORTHEADERON ) { - ULONG nPos = xReport->getReportHeaderOn() ? 2 : 1; + sal_uLong nPos = xReport->getReportHeaderOn() ? 2 : 1; traverseSection(xReport->getReportHeader(),pParent,SID_REPORTHEADERFOOTER,nPos); } else if ( _rEvent.PropertyName == PROPERTY_PAGEHEADERON ) @@ -691,7 +691,7 @@ void NavigatorTree::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) traverseSection(xReport->getPageFooter(),pParent, SID_PAGEHEADERFOOTER); else if ( _rEvent.PropertyName == PROPERTY_REPORTFOOTERON ) { - ULONG nPos = xReport->getPageFooterOn() ? (GetLevelChildCount(pParent) - 1) : LIST_APPEND; + sal_uLong nPos = xReport->getPageFooterOn() ? (GetLevelChildCount(pParent) - 1) : LIST_APPEND; traverseSection(xReport->getReportFooter(),pParent,SID_REPORTHEADERFOOTER,nPos); } } @@ -722,7 +722,7 @@ void NavigatorTree::_elementInserted( const container::ContainerEvent& _rEvent ) uno::Reference< report::XReportComponent> xElement(xProp,uno::UNO_QUERY); if ( xProp.is() ) sName = lcl_getName(xProp); - insertEntry(sName,pEntry,(!xElement.is() ? USHORT(SID_RPT_NEW_FUNCTION) : lcl_getImageId(xElement)),LIST_APPEND,new UserData(this,xProp)); + insertEntry(sName,pEntry,(!xElement.is() ? sal_uInt16(SID_RPT_NEW_FUNCTION) : lcl_getImageId(xElement)),LIST_APPEND,new UserData(this,xProp)); } if ( !IsExpanded(pEntry) ) Expand(pEntry); diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx index 0f6d328de729..ac373c4c24ae 100644 --- a/reportdesign/source/ui/dlg/dlgpage.cxx +++ b/reportdesign/source/ui/dlg/dlgpage.cxx @@ -47,7 +47,7 @@ namespace rptui |* \************************************************************************/ -ORptPageDialog::ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,USHORT _nPageId) : +ORptPageDialog::ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,sal_uInt16 _nPageId) : SfxTabDialog ( pParent, ModuleRes( _nPageId ), pAttr ), rOutAttrs ( *pAttr ) { diff --git a/reportdesign/source/ui/inc/CondFormat.hxx b/reportdesign/source/ui/inc/CondFormat.hxx index 79907f4e5e87..e4e56d59e91a 100644 --- a/reportdesign/source/ui/inc/CondFormat.hxx +++ b/reportdesign/source/ui/inc/CondFormat.hxx @@ -60,7 +60,7 @@ namespace rptui public: virtual void addCondition( size_t _nAddAfterIndex ) = 0; virtual void deleteCondition( size_t _nCondIndex ) = 0; - virtual void applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor ) = 0; + virtual void applyCommand( size_t _nCondIndex, sal_uInt16 _nCommandId, const ::Color _aColor ) = 0; virtual void moveConditionUp( size_t _nCondIndex ) = 0; virtual void moveConditionDown( size_t _nCondIndex ) = 0; virtual ::rtl::OUString getDataField() const = 0; @@ -109,7 +109,7 @@ namespace rptui // IConditionalFormatAction overridables virtual void addCondition( size_t _nAddAfterIndex ); virtual void deleteCondition( size_t _nCondIndex ); - virtual void applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor ); + virtual void applyCommand( size_t _nCondIndex, sal_uInt16 _nCommandId, const ::Color _aColor ); virtual void moveConditionUp( size_t _nCondIndex ); virtual void moveConditionDown( size_t _nCondIndex ); virtual ::rtl::OUString getDataField() const; diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index 4da25a831607..52780fdb65ed 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -83,14 +83,14 @@ namespace rptui Timer m_aMarkTimer; Point m_aScrollOffset; DlgEdMode m_eMode; - USHORT m_nCurrentPosition; - USHORT m_eActObj; - BOOL m_bFirstDraw; + sal_uInt16 m_nCurrentPosition; + sal_uInt16 m_eActObj; + sal_Bool m_bFirstDraw; Size m_aGridSizeCoarse; Size m_aGridSizeFine; - BOOL m_bGridVisible; - BOOL m_bGridSnap; - BOOL m_bDeleted; + sal_Bool m_bGridVisible; + sal_Bool m_bGridSnap; + sal_Bool m_bDeleted; DECL_LINK( MarkTimeout, Timer * ); @@ -125,8 +125,8 @@ namespace rptui inline OReportController& getController() const { return m_rReportController; } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); - USHORT GetInsertObj() const; + void SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); + sal_uInt16 GetInsertObj() const; rtl::OUString GetInsertObjString() const; DlgEdMode GetMode() const { return m_eMode; } @@ -142,7 +142,7 @@ namespace rptui * * \return if paste is allowed */ - BOOL IsPasteAllowed() const; + sal_Bool IsPasteAllowed() const; /** paste a new control in this section */ @@ -168,17 +168,17 @@ namespace rptui void SelectAll(const sal_uInt16 _nObjectType); /// checks if a selection exists - BOOL HasSelection() const; + sal_Bool HasSelection() const; void UpdatePropertyBrowserDelayed(OSectionView& _rView); - USHORT getSectionCount() const; + sal_uInt16 getSectionCount() const; /** removes the section at the given position. * * \param _nPosition Zero based. */ - void removeSection(USHORT _nPosition); + void removeSection(sal_uInt16 _nPosition); /** adds a new section at position _nPosition. If the section is nothing happens. @@ -186,13 +186,13 @@ namespace rptui */ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition = USHRT_MAX); + ,sal_uInt16 _nPosition = USHRT_MAX); inline Size getGridSizeCoarse() const { return m_aGridSizeCoarse; } inline Size getGridSizeFine() const { return m_aGridSizeFine; } - inline BOOL isGridSnap() const { return m_bGridSnap; } - void setGridSnap(BOOL bOn); - void setDragStripes(BOOL bOn); + inline sal_Bool isGridSnap() const { return m_bGridSnap; } + void setGridSnap(sal_Bool bOn); + void setDragStripes(sal_Bool bOn); /** turns the grid on or off * * \param _bGridVisible @@ -201,10 +201,10 @@ namespace rptui void togglePropertyBrowser(sal_Bool _bToogleOn); - BOOL isAddFieldVisible() const; + sal_Bool isAddFieldVisible() const; void toggleAddField(); - BOOL isReportExplorerVisible() const; + sal_Bool isReportExplorerVisible() const; void toggleReportExplorer(); /** shows or hides the ruler. diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx index da9825adf349..b08e14f52b4a 100644 --- a/reportdesign/source/ui/inc/Formula.hxx +++ b/reportdesign/source/ui/inc/Formula.hxx @@ -72,11 +72,11 @@ public: virtual void notifyChange(); virtual void fill(); virtual bool calculateValue(const String& _sExpression,String& _rResult); - virtual void doClose(BOOL _bOk); + virtual void doClose(sal_Bool _bOk); virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc); virtual void showReference(const String& _sFormula); - virtual void dispatch(BOOL _bOK,BOOL _bMartixChecked); - virtual void setDispatcherLock( BOOL bLock ); + virtual void dispatch(sal_Bool _bOK,sal_Bool _bMartixChecked); + virtual void setDispatcherLock( sal_Bool bLock ); virtual void setReferenceInput(const formula::FormEditData* _pData); virtual void deleteFormData(); virtual void clear(); @@ -96,7 +96,7 @@ public: // IControlReferenceHandler virtual void ShowReference(const String& _sRef); - virtual void HideReference( BOOL bDoneRefMode = TRUE ); + virtual void HideReference( sal_Bool bDoneRefMode = sal_True ); virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); diff --git a/reportdesign/source/ui/inc/FunctionHelper.hxx b/reportdesign/source/ui/inc/FunctionHelper.hxx index e2a43c163808..13525e8f2e0e 100644 --- a/reportdesign/source/ui/inc/FunctionHelper.hxx +++ b/reportdesign/source/ui/inc/FunctionHelper.hxx @@ -78,7 +78,7 @@ public: virtual ::rtl::OUString getDescription() const ; virtual xub_StrLen getSuppressedArgumentCount() const ; virtual ::rtl::OUString getFormula(const ::std::vector< ::rtl::OUString >& _aArguments) const ; - virtual void fillVisibleArgumentMapping(::std::vector& _rArguments) const ; + virtual void fillVisibleArgumentMapping(::std::vector& _rArguments) const ; virtual void initArgumentInfo() const; virtual ::rtl::OUString getSignature() const ; virtual rtl::OString getHelpId() const ; diff --git a/reportdesign/source/ui/inc/GeometryHandler.hxx b/reportdesign/source/ui/inc/GeometryHandler.hxx index a03c9d447316..200b7c29a60a 100644 --- a/reportdesign/source/ui/inc/GeometryHandler.hxx +++ b/reportdesign/source/ui/inc/GeometryHandler.hxx @@ -195,7 +195,7 @@ namespace rptui * \param _sQuotedFunction the quoted function name * \param _Out_rDataField the data field which is used in the function * \param _xFunctionsSupplier teh function supplier to search or empty if not used - * \param _bSet If set to TRUE than the m_sDefaultFunction and m_sScope vars will be set if successful. + * \param _bSet If set to sal_True than the m_sDefaultFunction and m_sScope vars will be set if successful. * \return sal_True with known otherwise sal_False */ sal_Bool isDefaultFunction(const ::rtl::OUString& _sQuotedFunction diff --git a/reportdesign/source/ui/inc/GroupsSorting.hxx b/reportdesign/source/ui/inc/GroupsSorting.hxx index 09fb4f188320..239858c605a4 100644 --- a/reportdesign/source/ui/inc/GroupsSorting.hxx +++ b/reportdesign/source/ui/inc/GroupsSorting.hxx @@ -143,7 +143,7 @@ private: /** shows the text given by the id in the multiline edit @param _nResId the string id */ - void showHelpText(USHORT _nResId); + void showHelpText(sal_uInt16 _nResId); /** display the group props @param _xGroup the group to display */ diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index 6694c81c999b..2eba90b13192 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -213,8 +213,8 @@ namespace rptui ,sal_Int32 _nGroupPos ,bool _bShow); - void executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t& _pMemfun); - void alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false); + void executeMethodWithUndo(sal_uInt16 _nUndoStrId,const ::std::mem_fun_t& _pMemfun); + void alignControlsWithUndo(sal_uInt16 _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false); /** shrink a section @param _nUndoStrId the string id of the string which is shown in undo menu @param _nShrinkId ID of what you would like to shrink. @@ -224,7 +224,7 @@ namespace rptui void shrinkSectionTop(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection); public: - void shrinkSection(USHORT _nUndoStrId, ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection, sal_Int32 _nShrinkId); + void shrinkSection(sal_uInt16 _nUndoStrId, ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection, sal_Int32 _nShrinkId); /** opens the file open dialog to allow the user to select a image which will be * bound to a newly created image button. @@ -279,7 +279,7 @@ namespace rptui /** collapse or expand the currently selected section. * - * \param _bCollapse collapse if TRUE otherwise expand + * \param _bCollapse collapse if sal_True otherwise expand */ void collapseSection(const bool _bCollapse); diff --git a/reportdesign/source/ui/inc/ReportRuler.hxx b/reportdesign/source/ui/inc/ReportRuler.hxx index ba65b1b80b9f..a14e3a2dffdb 100644 --- a/reportdesign/source/ui/inc/ReportRuler.hxx +++ b/reportdesign/source/ui/inc/ReportRuler.hxx @@ -55,7 +55,7 @@ namespace rptui * * \param _bVisible when the grid is made visible */ - void SetGridVisible(BOOL _bVisible); + void SetGridVisible(sal_Bool _bVisible); }; //============================================================================== } // rptui diff --git a/reportdesign/source/ui/inc/ReportSection.hxx b/reportdesign/source/ui/inc/ReportSection.hxx index a95fd72b7f40..1a6cc07b4169 100644 --- a/reportdesign/source/ui/inc/ReportSection.hxx +++ b/reportdesign/source/ui/inc/ReportSection.hxx @@ -61,7 +61,7 @@ namespace rptui ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection; DlgEdMode m_eMode; - BOOL m_bDialogModelChanged; + sal_Bool m_bDialogModelChanged; sal_Bool m_bInDrag; /** fills the section with all control from the report section @@ -117,15 +117,15 @@ namespace rptui * * \param _bVisible when the grid is made visible */ - void SetGridVisible(BOOL _bVisible); + void SetGridVisible(sal_Bool _bVisible); inline OSectionWindow* getSectionWindow() const { return m_pParent; } inline OSectionView& getSectionView() const { return *m_pView; } inline OReportPage* getPage() const { return m_pPage; } inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getSection() const { return m_xSection; } - void SetDialogModelChanged( BOOL bChanged = TRUE ) { m_bDialogModelChanged = bChanged; } - BOOL IsDialogModelChanged() const { return m_bDialogModelChanged; } + void SetDialogModelChanged( sal_Bool bChanged = sal_True ) { m_bDialogModelChanged = bChanged; } + sal_Bool IsDialogModelChanged() const { return m_bDialogModelChanged; } DlgEdMode GetMode() const { return m_eMode; } void SetMode( DlgEdMode m_eMode ); diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx index 4267bc0ef6e4..da1dd620a15f 100644 --- a/reportdesign/source/ui/inc/ReportWindow.hxx +++ b/reportdesign/source/ui/inc/ReportWindow.hxx @@ -86,10 +86,10 @@ namespace rptui inline OScrollWindowHelper* getScrollWindow() const { return m_pParent; } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); + void SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); rtl::OUString GetInsertObjString() const; - void setGridSnap(BOOL bOn); - void setDragStripes(BOOL bOn); + void setGridSnap(sal_Bool bOn); + void setDragStripes(sal_Bool bOn); /** copies the current selection in this section */ @@ -99,7 +99,7 @@ namespace rptui * * \return if paste is allowed */ - BOOL IsPasteAllowed() const; + sal_Bool IsPasteAllowed() const; /** paste a new control in this section */ @@ -116,7 +116,7 @@ namespace rptui /** returns when a object is marked */ - BOOL HasSelection() const; + sal_Bool HasSelection() const; Point getThumbPos() const; @@ -124,7 +124,7 @@ namespace rptui * * \param _nPosition Zero based. */ - void removeSection(USHORT _nPosition); + void removeSection(sal_uInt16 _nPosition); /** adds a new section at position _nPosition. If the section is nothing happens. @@ -132,9 +132,9 @@ namespace rptui */ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition = USHRT_MAX); + ,sal_uInt16 _nPosition = USHRT_MAX); - USHORT getSectionCount() const; + sal_uInt16 getSectionCount() const; /** turns the grid on or off * diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index d5080e56d28d..1f9f73533340 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -99,10 +99,10 @@ namespace rptui // forwards void SetMode( DlgEdMode _eMode ); - void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); + void SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); rtl::OUString GetInsertObjString() const; - void setGridSnap(BOOL bOn); - void setDragStripes(BOOL bOn); + void setGridSnap(sal_Bool bOn); + void setDragStripes(sal_Bool bOn); /** copies the current selection in this section */ void Copy(); @@ -111,7 +111,7 @@ namespace rptui * * \return if paste is allowed */ - BOOL IsPasteAllowed() const; + sal_Bool IsPasteAllowed() const; /** paste a new control in this section */ @@ -128,13 +128,13 @@ namespace rptui /** returns when a object is marked */ - BOOL HasSelection() const; + sal_Bool HasSelection() const; /** removes the section at the given position. * * \param _nPosition Zero based. */ - void removeSection(USHORT _nPosition); + void removeSection(sal_uInt16 _nPosition); /** adds a new section at position _nPosition. If the section is nothing happens. @@ -142,9 +142,9 @@ namespace rptui */ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition = USHRT_MAX); + ,sal_uInt16 _nPosition = USHRT_MAX); - USHORT getSectionCount() const; + sal_uInt16 getSectionCount() const; /** turns the grid on or off * diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx index d9c2fa01d676..8afd59ee2de8 100644 --- a/reportdesign/source/ui/inc/SectionWindow.hxx +++ b/reportdesign/source/ui/inc/SectionWindow.hxx @@ -75,9 +75,9 @@ namespace rptui * \param _nResId * \param _pGetSection * \param _pIsSectionOn - * @return TRUE when title was set otherwise FALSE + * @return sal_True when title was set otherwise FALSE */ - bool setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t _pIsSectionOn); + bool setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t _pIsSectionOn); /** set the title of the (report/page) header or footer * @@ -85,9 +85,9 @@ namespace rptui * \param _nResId * \param _pGetSection * \param _pIsSectionOn - * @return TRUE when title was set otherwise FALSE + * @return sal_True when title was set otherwise FALSE */ - bool setReportSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t _pIsSectionOn); + bool setReportSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t _pIsSectionOn); void ImplInitSettings(); DECL_LINK(Collapsed,OColorListener*); diff --git a/reportdesign/source/ui/inc/UITools.hxx b/reportdesign/source/ui/inc/UITools.hxx index d7aa74c240e8..2b5ab62bcb11 100644 --- a/reportdesign/source/ui/inc/UITools.hxx +++ b/reportdesign/source/ui/inc/UITools.hxx @@ -168,7 +168,7 @@ namespace rptui * * \param pControl the control which should place in the section without overlapping * \param _pReportSection the section - * \param _bInsert TRUE whe the control should be inserted, otherwise not. + * \param _bInsert sal_True whe the control should be inserted, otherwise not. */ void correctOverlapping(SdrObject* pControl,OReportSection& _aReportSection,bool _bInsert = true); diff --git a/reportdesign/source/ui/inc/Undo.hxx b/reportdesign/source/ui/inc/Undo.hxx index 479872b06573..bd3b9606a8e3 100644 --- a/reportdesign/source/ui/inc/Undo.hxx +++ b/reportdesign/source/ui/inc/Undo.hxx @@ -67,7 +67,7 @@ namespace rptui OSectionUndo( OReportModel& rMod ,sal_uInt16 _nSlot ,Action _eAction - ,USHORT nCommentID); + ,sal_uInt16 nCommentID); virtual ~OSectionUndo(); virtual void Undo(); @@ -95,7 +95,7 @@ namespace rptui ,OReportHelper> _pMemberFunction ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport ,Action _eAction - ,USHORT nCommentID); + ,sal_uInt16 nCommentID); virtual ~OReportSectionUndo(); }; @@ -122,7 +122,7 @@ namespace rptui ,OGroupHelper> _pMemberFunction ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup ,Action _eAction - ,USHORT nCommentID); + ,sal_uInt16 nCommentID); virtual String GetComment() const; }; @@ -142,7 +142,7 @@ namespace rptui public: TYPEINFO(); OGroupUndo(OReportModel& rMod - ,USHORT nCommentID + ,sal_uInt16 nCommentID ,Action _eAction ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition); diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx index 13b8566933c6..9bee09a0b335 100644 --- a/reportdesign/source/ui/inc/ViewsWindow.hxx +++ b/reportdesign/source/ui/inc/ViewsWindow.hxx @@ -92,7 +92,7 @@ namespace rptui public: OWindowPositionCorrector(Window* _pWindow,long _nDeltaX, long _nDeltaY) :m_nDeltaX(_nDeltaX), m_nDeltaY(_nDeltaY) { - USHORT nCount = _pWindow->GetChildCount(); + sal_uInt16 nCount = _pWindow->GetChildCount(); m_aChildren.reserve(nCount); while( nCount ) { @@ -146,7 +146,7 @@ namespace rptui void ImplInitSettings(); /** returns the iterator at pos _nPos or the end() */ - TSectionsMap::iterator getIteratorAtPos(USHORT _nPos); + TSectionsMap::iterator getIteratorAtPos(sal_uInt16 _nPos); void collectRectangles(TRectangleMap& _rMap,bool _bBoundRects); void collectBoundResizeRect(const TRectangleMap& _rSortRectangles,sal_Int32 _nControlModification,bool _bAlignAtSection,bool _bBoundRects,Rectangle& _rBound,Rectangle& _rResize); void impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet); @@ -181,7 +181,7 @@ namespace rptui * * \param _nPosition Zero based. */ - void removeSection(USHORT _nPosition); + void removeSection(sal_uInt16 _nPosition); /** adds a new section at position _nPosition. If the section is nothing happens. @@ -189,23 +189,23 @@ namespace rptui */ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition = USHRT_MAX); + ,sal_uInt16 _nPosition = USHRT_MAX); - USHORT getSectionCount() const; + sal_uInt16 getSectionCount() const; /** return the section at the given position * * \param _nPos * \return the section at this pos or an empty section */ - ::boost::shared_ptr getSectionWindow(const USHORT _nPos) const; + ::boost::shared_ptr getSectionWindow(const sal_uInt16 _nPos) const; /** turns the grid on or off * * \param _bVisible */ void toggleGrid(sal_Bool _bVisible); - void setGridSnap(BOOL bOn); - void setDragStripes(BOOL bOn); + void setGridSnap(sal_Bool bOn); + void setDragStripes(sal_Bool bOn); /** returns the total accumulated height of all sections until _pSection is reached */ @@ -213,7 +213,7 @@ namespace rptui inline bool empty() const { return m_aSections.empty(); } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); + void SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); rtl::OUString GetInsertObjString() const; /** copies the current selection in this section */ @@ -223,7 +223,7 @@ namespace rptui * * \return if paste is allowed */ - BOOL IsPasteAllowed() const; + sal_Bool IsPasteAllowed() const; /** paste a new control in this section */ @@ -240,7 +240,7 @@ namespace rptui /** returns when a object is marked */ - BOOL HasSelection() const; + sal_Bool HasSelection() const; /** unmark all objects on the views without the given one. * @@ -293,7 +293,7 @@ namespace rptui /** returns the current position in the list */ - USHORT getPosition(const OSectionWindow* _pSectionWindow = NULL) const; + sal_uInt16 getPosition(const OSectionWindow* _pSectionWindow = NULL) const; /** calls on every section BrkAction * @@ -309,12 +309,12 @@ namespace rptui bool isObjectInMyTempList(SdrObject *); public: void BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionView* _pSection); - void EndDragObj(BOOL _bDragIntoNewSection,const OSectionView* _pSection,const Point& _aPnt); + void EndDragObj(sal_Bool _bDragIntoNewSection,const OSectionView* _pSection,const Point& _aPnt); void EndAction(); void ForceMarkedToAnotherPage(); - BOOL IsAction() const; - BOOL IsDragObj() const; + sal_Bool IsAction() const; + sal_Bool IsDragObj() const; void handleKey(const KeyCode& _rCode); void stopScrollTimer(); diff --git a/reportdesign/source/ui/inc/dlgedfunc.hxx b/reportdesign/source/ui/inc/dlgedfunc.hxx index 0c397c106dbb..f7eb0cb6d00e 100644 --- a/reportdesign/source/ui/inc/dlgedfunc.hxx +++ b/reportdesign/source/ui/inc/dlgedfunc.hxx @@ -93,9 +93,9 @@ public: DlgEdFunc( OReportSection* pParent ); virtual ~DlgEdFunc(); - virtual BOOL MouseButtonDown( const MouseEvent& rMEvt ); - virtual BOOL MouseButtonUp( const MouseEvent& rMEvt ); - virtual BOOL MouseMove( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt ); + virtual sal_Bool MouseMove( const MouseEvent& rMEvt ); /** checks if the keycode is known by the child windows @param _rCode the keycode @@ -134,9 +134,9 @@ public: DlgEdFuncInsert( OReportSection* pParent ); ~DlgEdFuncInsert(); - virtual BOOL MouseButtonDown( const MouseEvent& rMEvt ); - virtual BOOL MouseButtonUp( const MouseEvent& rMEvt ); - virtual BOOL MouseMove( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt ); + virtual sal_Bool MouseMove( const MouseEvent& rMEvt ); }; //============================================================================ @@ -149,11 +149,11 @@ public: DlgEdFuncSelect( OReportSection* pParent ); ~DlgEdFuncSelect(); - virtual BOOL MouseButtonDown( const MouseEvent& rMEvt ); - virtual BOOL MouseButtonUp( const MouseEvent& rMEvt ); - virtual BOOL MouseMove( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt ); + virtual sal_Bool MouseMove( const MouseEvent& rMEvt ); - void SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag); + void SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, sal_Bool bQuickDrag); }; } diff --git a/reportdesign/source/ui/inc/dlgpage.hxx b/reportdesign/source/ui/inc/dlgpage.hxx index d335b8f28920..aec98e42cdd6 100644 --- a/reportdesign/source/ui/inc/dlgpage.hxx +++ b/reportdesign/source/ui/inc/dlgpage.hxx @@ -45,7 +45,7 @@ private: void operator =(const ORptPageDialog&); public: - ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,USHORT _nPageId); + ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,sal_uInt16 _nPageId); virtual ~ORptPageDialog() {} }; // ============================================================================= diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx index 48d8c74e0c01..c5b2df1d3589 100644 --- a/reportdesign/source/ui/inspection/DefaultInspection.cxx +++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx @@ -237,7 +237,7 @@ namespace rptui const struct { const sal_Char* programmaticName; - USHORT uiNameResId; + sal_uInt16 uiNameResId; rtl::OString helpId; } aCategories[] = { { "General", RID_STR_PROPPAGE_DEFAULT, HID_RPT_PROPDLG_TAB_GENERAL }, diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index 791251e0424a..e6c92f0cbb0d 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -203,10 +203,10 @@ xub_StrLen FunctionDescription::getSuppressedArgumentCount() const return sFormula; } // ----------------------------------------------------------------------------- -void FunctionDescription::fillVisibleArgumentMapping(::std::vector& _rArguments) const +void FunctionDescription::fillVisibleArgumentMapping(::std::vector& _rArguments) const { const sal_Int32 nCount = m_aParameter.getLength(); - for(USHORT i = 0;i < nCount; ++i) + for(sal_uInt16 i = 0;i < nCount; ++i) { _rArguments.push_back(i); } diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 209017ed062e..f17f4afabb36 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -204,7 +204,7 @@ void adjustSectionName(const uno::Reference< report::XGroup >& _xGroup,sal_Int32 namespace { // ------------------------------------------------------------------------- - Font lcl_getReportControlFont( const uno::Reference& _rxReportControlFormat, awt::FontDescriptor& _out_rControlFont ,USHORT _nWichFont) + Font lcl_getReportControlFont( const uno::Reference& _rxReportControlFormat, awt::FontDescriptor& _out_rControlFont ,sal_uInt16 _nWichFont) { if ( !_rxReportControlFormat.is() ) throw uno::RuntimeException(); @@ -228,14 +228,14 @@ namespace } // ------------------------------------------------------------------------- - Font lcl_getReportControlFont( const uno::Reference& _rxReportControlFormat,USHORT _nWhich ) + Font lcl_getReportControlFont( const uno::Reference& _rxReportControlFormat,sal_uInt16 _nWhich ) { awt::FontDescriptor aAwtFont; return lcl_getReportControlFont( _rxReportControlFormat, aAwtFont, _nWhich ); } // ------------------------------------------------------------------------- const Font lcl_setFont(const uno::Reference& _rxReportControlFormat, - SfxItemSet& _rItemSet,USHORT _nWhich,USHORT _nFont, USHORT _nFontHeight,USHORT _nLanguage,USHORT _nPosture, USHORT _nWeight) + SfxItemSet& _rItemSet,sal_uInt16 _nWhich,sal_uInt16 _nFont, sal_uInt16 _nFontHeight,sal_uInt16 _nLanguage,sal_uInt16 _nPosture, sal_uInt16 _nWeight) { // fill it awt::FontDescriptor aControlFont; @@ -383,7 +383,7 @@ namespace // ------------------------------------------------------------------------- void lcl_initAwtFont( const Font& _rOriginalFont, const SfxItemSet& _rItemSet, awt::FontDescriptor& _out_rAwtFont, - USHORT _nFont, USHORT _nFontHeight,USHORT _nPosture, USHORT _nWeight) + sal_uInt16 _nFont, sal_uInt16 _nFontHeight,sal_uInt16 _nPosture, sal_uInt16 _nWeight) { Font aNewFont( _rOriginalFont ); const SfxPoolItem* pItem( NULL ); @@ -543,7 +543,7 @@ namespace lcl_pushBack( _out_rProperties, PROPERTY_CHARCASEMAP, uno::makeAny( pFontItem->GetValue() ) ); } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CASEMAP,sal_True,&pItem) && pItem->ISA(SvxCaseMapItem)) struct Items { - USHORT nWhich; + sal_uInt16 nWhich; ::rtl::OUString sPropertyName; }; const Items pItems[] = { {ITEMID_LANGUAGE,PROPERTY_CHARLOCALE} @@ -667,9 +667,9 @@ bool openCharDialog( const uno::Reference& _rxRep new SvxPostureItem(ITALIC_NONE,ITEMID_POSTURE), new SvxWeightItem(WEIGHT_NORMAL,ITEMID_WEIGHT), - new SvxShadowedItem(FALSE,ITEMID_SHADOWED), - new SvxWordLineModeItem(FALSE,ITEMID_WORDLINEMODE), - new SvxContourItem(FALSE,ITEMID_CONTOUR), + new SvxShadowedItem(sal_False,ITEMID_SHADOWED), + new SvxWordLineModeItem(sal_False,ITEMID_WORDLINEMODE), + new SvxContourItem(sal_False,ITEMID_CONTOUR), new SvxCrossedOutItem(STRIKEOUT_NONE,ITEMID_CROSSEDOUT), new SvxUnderlineItem(UNDERLINE_NONE,ITEMID_UNDERLINE), @@ -678,15 +678,15 @@ bool openCharDialog( const uno::Reference& _rxRep new SvxCaseMapItem(SVX_CASEMAP_NOT_MAPPED,ITEMID_CASEMAP), new SvxEscapementItem(ITEMID_ESCAPEMENT), new SvxFontListItem(pFontList.get(),ITEMID_FONTLIST), - new SvxAutoKernItem(FALSE,ITEMID_AUTOKERN), + new SvxAutoKernItem(sal_False,ITEMID_AUTOKERN), new SvxColorTableItem(pColorTable.get(),ITEMID_COLOR_TABLE), - new SvxBlinkItem(FALSE,ITEMID_BLINK), + new SvxBlinkItem(sal_False,ITEMID_BLINK), new SvxEmphasisMarkItem(EMPHASISMARK_NONE,ITEMID_EMPHASISMARK), - new SvxTwoLinesItem(TRUE,0,0,ITEMID_TWOLINES), + new SvxTwoLinesItem(sal_True,0,0,ITEMID_TWOLINES), new SvxCharRotateItem(0,sal_False,ITEMID_CHARROTATE), new SvxCharScaleWidthItem(100,ITEMID_CHARSCALE_W), new SvxCharReliefItem(RELIEF_NONE,ITEMID_CHARRELIEF), - new SvxCharHiddenItem(FALSE,ITEMID_CHARHIDDEN), + new SvxCharHiddenItem(sal_False,ITEMID_CHARHIDDEN), new SvxBrushItem(ITEMID_BRUSH), new SvxHorJustifyItem(ITEMID_HORJUSTIFY), new SvxVerJustifyItem(ITEMID_VERJUSTIFY), @@ -707,7 +707,7 @@ bool openCharDialog( const uno::Reference& _rxRep OSL_ASSERT((sizeof(pDefaults)/sizeof(pDefaults[0])) == (sizeof(aItemInfos)/sizeof(aItemInfos[0]))); - static USHORT pRanges[] = + static sal_uInt16 pRanges[] = { ITEMID_FONT,ITEMID_WEIGHT_COMPLEX, 0 @@ -758,7 +758,7 @@ bool openAreaDialog( const uno::Reference& _xShape,const uno::R Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); - //static USHORT pRanges[] = + //static sal_uInt16 pRanges[] = //{ // XATTR_START,XATTR_END, // 0 diff --git a/reportdesign/source/ui/misc/Undo.cxx b/reportdesign/source/ui/misc/Undo.cxx index d944dc2aee20..a29613ae4426 100644 --- a/reportdesign/source/ui/misc/Undo.cxx +++ b/reportdesign/source/ui/misc/Undo.cxx @@ -129,7 +129,7 @@ DBG_NAME(rpt_OSectionUndo) OSectionUndo::OSectionUndo(OReportModel& _rMod ,sal_uInt16 _nSlot ,Action _eAction - ,USHORT nCommentID) + ,sal_uInt16 nCommentID) : OCommentUndoAction(_rMod,nCommentID) ,m_eAction(_eAction) ,m_nSlot(_nSlot) @@ -239,7 +239,7 @@ OReportSectionUndo::OReportSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot ,OReportHelper> _pMemberFunction ,const uno::Reference< report::XReportDefinition >& _xReport ,Action _eAction - ,USHORT nCommentID) + ,sal_uInt16 nCommentID) : OSectionUndo(_rMod,_nSlot,_eAction,nCommentID) ,m_aReportHelper(_xReport) ,m_pMemberFunction(_pMemberFunction) @@ -278,7 +278,7 @@ OGroupSectionUndo::OGroupSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot ,OGroupHelper> _pMemberFunction ,const uno::Reference< report::XGroup >& _xGroup ,Action _eAction - ,USHORT nCommentID) + ,sal_uInt16 nCommentID) : OSectionUndo(_rMod,_nSlot,_eAction,nCommentID) ,m_aGroupHelper(_xGroup) ,m_pMemberFunction(_pMemberFunction) @@ -344,7 +344,7 @@ void OGroupSectionUndo::implReRemove( ) TYPEINIT1( OGroupUndo, OCommentUndoAction ); //---------------------------------------------------------------------------- OGroupUndo::OGroupUndo(OReportModel& _rMod - ,USHORT nCommentID + ,sal_uInt16 nCommentID ,Action _eAction ,const uno::Reference< report::XGroup>& _xGroup ,const uno::Reference< report::XReportDefinition >& _xReportDefinition) diff --git a/reportdesign/source/ui/misc/statusbarcontroller.cxx b/reportdesign/source/ui/misc/statusbarcontroller.cxx index ce34ebadf775..2e815d90f81f 100644 --- a/reportdesign/source/ui/misc/statusbarcontroller.cxx +++ b/reportdesign/source/ui/misc/statusbarcontroller.cxx @@ -99,10 +99,10 @@ void SAL_CALL OStatusbarController::initialize( const Sequence< Any >& _rArgumen StatusBar* pStatusBar = static_cast(VCLUnoHelper::GetWindow(m_xParentWindow)); if ( pStatusBar ) { - const USHORT nCount = pStatusBar->GetItemCount(); - for (USHORT nPos = 0; nPos < nCount; ++nPos) + const sal_uInt16 nCount = pStatusBar->GetItemCount(); + for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { - const USHORT nItemId = pStatusBar->GetItemId(nPos); + const sal_uInt16 nItemId = pStatusBar->GetItemId(nPos); if ( pStatusBar->GetItemCommand(nItemId) == String(m_aCommandURL) ) { m_nId = nItemId; diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx index cf5561ba4758..e89cc5c6297e 100644 --- a/reportdesign/source/ui/misc/toolboxcontroller.cxx +++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx @@ -148,10 +148,10 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments ToolBox* pToolBox = static_cast(VCLUnoHelper::GetWindow(getParent())); if ( pToolBox ) { - const USHORT nCount = pToolBox->GetItemCount(); - for (USHORT nPos = 0; nPos < nCount; ++nPos) + const sal_uInt16 nCount = pToolBox->GetItemCount(); + for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { - const USHORT nItemId = pToolBox->GetItemId(nPos); + const sal_uInt16 nItemId = pToolBox->GetItemId(nPos); if ( pToolBox->GetItemCommand(nItemId) == String(m_aCommandURL) ) { m_nToolBoxId = nItemId; @@ -230,9 +230,9 @@ void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event sal_Bool bCheckmark = sal_False; //m_pToolbarController->GetToolBox().Enable(Event.IsEnabled); ToolBox& rTb = m_pToolbarController->GetToolBox(); - for ( USHORT i = 0; i < rTb.GetItemCount(); i++ ) + for ( sal_uInt16 i = 0; i < rTb.GetItemCount(); i++ ) { - USHORT nId = rTb.GetItemId( i ); + sal_uInt16 nId = rTb.GetItemId( i ); if ( nId == 0 ) continue; diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 339e136c2fec..d74a5d943d5a 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -113,20 +113,20 @@ public: long nReportSize = GetItemSize( REPORT_ID ); long nTaskPaneSize = GetItemSize( TASKPANE_ID ); - BOOL bMod = FALSE; + sal_Bool bMod = sal_False; if( nReportSize < nReportMinSplitSize ) { nReportSize = nReportMinSplitSize; nTaskPaneSize = 99 - nReportMinSplitSize; - bMod = TRUE; + bMod = sal_True; } else if( nTaskPaneSize < nTaskPaneMinSplitSize ) { nTaskPaneSize = nTaskPaneMinSplitSize; nReportSize = 99 - nTaskPaneMinSplitSize; - bMod = TRUE; + bMod = sal_True; } if( bMod ) @@ -155,12 +155,12 @@ ODesignView::ODesignView( Window* pParent, ,m_eMode( RPTUI_SELECT ) ,m_nCurrentPosition(USHRT_MAX) ,m_eActObj( OBJ_NONE ) - ,m_bFirstDraw(FALSE) + ,m_bFirstDraw(sal_False) ,m_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid ,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation - ,m_bGridVisible(TRUE) - ,m_bGridSnap(TRUE) - ,m_bDeleted( FALSE ) + ,m_bGridVisible(sal_True) + ,m_bGridSnap(sal_True) + ,m_bDeleted( sal_False ) { DBG_CTOR( rpt_ODesignView,NULL); SetHelpId(UID_RPT_RPT_APP_VIEW); @@ -191,7 +191,7 @@ ODesignView::ODesignView( Window* pParent, ODesignView::~ODesignView() { DBG_DTOR( rpt_ODesignView,NULL); - m_bDeleted = TRUE; + m_bDeleted = sal_True; Hide(); m_aScrollWindow.Hide(); m_aMarkTimer.Stop(); @@ -358,7 +358,7 @@ void ODesignView::SetMode( DlgEdMode _eNewMode ) m_aScrollWindow.SetMode(_eNewMode); } //---------------------------------------------------------------------------- -void ODesignView::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType ) +void ODesignView::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) { m_eActObj = eObj; m_aScrollWindow.SetInsertObj( eObj,_sShapeType ); @@ -370,7 +370,7 @@ rtl::OUString ODesignView::GetInsertObjString() const } //---------------------------------------------------------------------------- -USHORT ODesignView::GetInsertObj() const +sal_uInt16 ODesignView::GetInsertObj() const { return m_eActObj; } @@ -401,13 +401,13 @@ void ODesignView::Delete() m_aScrollWindow.Delete(); } //---------------------------------------------------------------------------- -BOOL ODesignView::HasSelection() const +sal_Bool ODesignView::HasSelection() const { return m_aScrollWindow.HasSelection(); } //---------------------------------------------------------------------------- -BOOL ODesignView::IsPasteAllowed() const +sal_Bool ODesignView::IsPasteAllowed() const { return m_aScrollWindow.IsPasteAllowed(); } @@ -435,7 +435,7 @@ void ODesignView::toggleGrid(sal_Bool _bGridVisible) m_aScrollWindow.toggleGrid(_bGridVisible); } //---------------------------------------------------------------------------- -USHORT ODesignView::getSectionCount() const +sal_uInt16 ODesignView::getSectionCount() const { return m_aScrollWindow.getSectionCount(); } @@ -445,12 +445,12 @@ void ODesignView::showRuler(sal_Bool _bShow) m_aScrollWindow.showRuler(_bShow); } //---------------------------------------------------------------------------- -void ODesignView::removeSection(USHORT _nPosition) +void ODesignView::removeSection(sal_uInt16 _nPosition) { m_aScrollWindow.removeSection(_nPosition); } //---------------------------------------------------------------------------- -void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition) +void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,sal_uInt16 _nPosition) { m_aScrollWindow.addSection(_xSection,_sColorEntry,_nPosition); } @@ -552,7 +552,7 @@ void ODesignView::showProperties(const uno::Reference< uno::XInterface>& _xRepor } } //----------------------------------------------------------------------------- -BOOL ODesignView::isReportExplorerVisible() const +sal_Bool ODesignView::isReportExplorerVisible() const { return m_pReportExplorer && m_pReportExplorer->IsVisible(); } @@ -573,7 +573,7 @@ void ODesignView::toggleReportExplorer() m_pReportExplorer->Show(!m_pReportExplorer->IsVisible()); } //----------------------------------------------------------------------------- -BOOL ODesignView::isAddFieldVisible() const +sal_Bool ODesignView::isAddFieldVisible() const { return m_pAddField && m_pAddField->IsVisible(); } @@ -752,13 +752,13 @@ void ODesignView::fillControlModelSelection(::std::vector< uno::Reference< uno:: m_aScrollWindow.fillControlModelSelection(_rSelection); } // ----------------------------------------------------------------------------- -void ODesignView::setGridSnap(BOOL bOn) +void ODesignView::setGridSnap(sal_Bool bOn) { m_aScrollWindow.setGridSnap(bOn); } // ----------------------------------------------------------------------------- -void ODesignView::setDragStripes(BOOL bOn) +void ODesignView::setDragStripes(sal_Bool bOn) { m_aScrollWindow.setDragStripes(bOn); } diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index c32a07d5fc76..5ace128c3a2f 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -46,7 +46,7 @@ OEndMarker::OEndMarker(Window* _pParent ,const ::rtl::OUString& _sColorEntry) DBG_CTOR( rpt_OEndMarker,NULL); SetUniqueId(HID_RPT_ENDMARKER); ImplInitSettings(); - SetPaintTransparent(TRUE); + SetPaintTransparent(sal_True); } // ----------------------------------------------------------------------------- OEndMarker::~OEndMarker() @@ -68,14 +68,14 @@ void OEndMarker::Paint( const Rectangle& /*rRect*/ ) Color aStartColor(m_nColor); aStartColor.IncreaseLuminance(10); - USHORT nHue = 0; - USHORT nSat = 0; - USHORT nBri = 0; + sal_uInt16 nHue = 0; + sal_uInt16 nSat = 0; + sal_uInt16 nBri = 0; aStartColor.RGBtoHSB(nHue, nSat, nBri); nSat += 40; Color aEndColor(Color::HSBtoRGB(nHue, nSat, nBri)); Gradient aGradient(GRADIENT_LINEAR,aStartColor,aEndColor); - aGradient.SetSteps(static_cast(aSize.Height())); + aGradient.SetSteps(static_cast(aSize.Height())); DrawGradient(PixelToLogic(aPoly) ,aGradient); if ( m_bMarked ) diff --git a/reportdesign/source/ui/report/FixedTextColor.cxx b/reportdesign/source/ui/report/FixedTextColor.cxx index 9952d706a4b4..d80a79dde0f7 100644 --- a/reportdesign/source/ui/report/FixedTextColor.cxx +++ b/reportdesign/source/ui/report/FixedTextColor.cxx @@ -71,7 +71,7 @@ namespace rptui // sal_Int32 FixedTextColor::getTextColor() // { // const StyleSettings& aStyleSettings = Application::GetSettings().GetStyleSettings(); - // BOOL bHighContrast = aStyleSettings.GetHighContrastMode(); + // sal_Bool bHighContrast = aStyleSettings.GetHighContrastMode(); // // Color aGetFaceColor = aStyleSettings.GetFaceColor(); // Color aGetCheckedColor = aStyleSettings.GetCheckedColor(); @@ -246,7 +246,7 @@ namespace rptui if ( xSection.is() ) { OReportPage *pPage = pModel->getPage(xSection); - ULONG nIndex = pPage->getIndexOf(_xFixedText.get()); + sal_uLong nIndex = pPage->getIndexOf(_xFixedText.get()); if (nIndex < pPage->GetObjCount() ) { SdrObject *pObject = pPage->GetObj(nIndex); diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx index fdfdad6cb55f..4a56a4392262 100644 --- a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx +++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx @@ -179,7 +179,7 @@ namespace rptui if ( xSection.is() ) { OReportPage *pPage = pModel->getPage(xSection); - ULONG nIndex = pPage->getIndexOf(_xComponent); + sal_uLong nIndex = pPage->getIndexOf(_xComponent); if (nIndex < pPage->GetObjCount() ) { SdrObject *pObject = pPage->GetObj(nIndex); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 4ed0e3cd2842..b67b12213e0d 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2219,7 +2219,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven { if ( evt.PropertyName.equals( PROPERTY_REPORTHEADERON ) ) { - const USHORT nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0; + const sal_uInt16 nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0; if ( bShow ) { getDesignView()->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER,nPosition); @@ -2232,7 +2232,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven } else if ( evt.PropertyName.equals( PROPERTY_REPORTFOOTERON ) ) { - USHORT nPosition = getDesignView()->getSectionCount(); + sal_uInt16 nPosition = getDesignView()->getSectionCount(); if ( m_xReportDefinition->getPageFooterOn() ) --nPosition; if ( bShow ) @@ -2254,7 +2254,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven } else { - getDesignView()->removeSection(USHORT(0)); + getDesignView()->removeSection(sal_uInt16(0)); } } else if ( evt.PropertyName.equals( PROPERTY_PAGEFOOTERON ) ) @@ -2309,12 +2309,12 @@ void SAL_CALL OReportController::disposing( const lang::EventObject& Source ) th } // ----------------------------------------------------------------------------- -USHORT lcl_getNonVisbleGroupsBefore( const uno::Reference< report::XGroups>& _xGroups +sal_uInt16 lcl_getNonVisbleGroupsBefore( const uno::Reference< report::XGroups>& _xGroups ,sal_Int32 _nGroupPos ,::std::mem_fun_t&_pGroupMemberFunction) { uno::Reference< report::XGroup> xGroup; - USHORT nNonVisibleGroups = 0; + sal_uInt16 nNonVisibleGroups = 0; sal_Int32 nCount = _xGroups->getCount(); for( sal_Int32 i = 0; i < _nGroupPos && i < nCount; ++i) { @@ -2333,12 +2333,12 @@ void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGr ::std::mem_fun_t pMemFun = ::std::mem_fun(&OGroupHelper::getHeaderOn); ::std::mem_fun_t , OGroupHelper> pMemFunSection = ::std::mem_fun(&OGroupHelper::getHeader); ::rtl::OUString sColor(DBGROUPHEADER); - USHORT nPosition = 0; + sal_uInt16 nPosition = 0; bool bHandle = false; if ( _sPropName.equals( PROPERTY_HEADERON ) ) { nPosition = m_xReportDefinition->getPageHeaderOn() ? (m_xReportDefinition->getReportHeaderOn() ? 2 : 1) : (m_xReportDefinition->getReportHeaderOn() ? 1 : 0); - nPosition += (static_cast(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); + nPosition += (static_cast(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); bHandle = true; } else if ( _sPropName.equals( PROPERTY_FOOTERON ) ) @@ -2352,7 +2352,7 @@ void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGr if ( m_xReportDefinition->getReportFooterOn() ) --nPosition; sColor = DBGROUPFOOTER; - nPosition -= (static_cast(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); + nPosition -= (static_cast(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); if ( !_bShow ) --nPosition; bHandle = true; @@ -2423,10 +2423,10 @@ void OReportController::openPageDialog(const uno::Reference& _ new SfxAllEnumItem(RPTUI_ID_START,PAPER_A4), new SfxAllEnumItem(RPTUI_ID_END,PAPER_E), new SvxBrushItem(ITEMID_BRUSH), - new SfxUInt16Item(RPTUI_ID_METRIC,static_cast(eUserMetric)) + new SfxUInt16Item(RPTUI_ID_METRIC,static_cast(eUserMetric)) }; - static USHORT pRanges[] = + static sal_uInt16 pRanges[] = { RPTUI_ID_LRSPACE,RPTUI_ID_BRUSH, SID_ATTR_METRIC,SID_ATTR_METRIC, @@ -2447,9 +2447,9 @@ void OReportController::openPageDialog(const uno::Reference& _ pDescriptor->Put(SvxSizeItem(RPTUI_ID_SIZE,VCLSize(getStyleProperty(m_xReportDefinition,PROPERTY_PAPERSIZE)))); pDescriptor->Put(SvxLRSpaceItem(getStyleProperty(m_xReportDefinition,PROPERTY_LEFTMARGIN) ,getStyleProperty(m_xReportDefinition,PROPERTY_RIGHTMARGIN),0,0,RPTUI_ID_LRSPACE)); - pDescriptor->Put(SvxULSpaceItem(static_cast(getStyleProperty(m_xReportDefinition,PROPERTY_TOPMARGIN)) - ,static_cast(getStyleProperty(m_xReportDefinition,PROPERTY_BOTTOMMARGIN)),RPTUI_ID_ULSPACE)); - pDescriptor->Put(SfxUInt16Item(SID_ATTR_METRIC,static_cast(eUserMetric))); + pDescriptor->Put(SvxULSpaceItem(static_cast(getStyleProperty(m_xReportDefinition,PROPERTY_TOPMARGIN)) + ,static_cast(getStyleProperty(m_xReportDefinition,PROPERTY_BOTTOMMARGIN)),RPTUI_ID_ULSPACE)); + pDescriptor->Put(SfxUInt16Item(SID_ATTR_METRIC,static_cast(eUserMetric))); uno::Reference< style::XStyle> xPageStyle(getUsedStyle(m_xReportDefinition)); if ( xPageStyle.is() ) @@ -2594,7 +2594,7 @@ void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHi } } // ----------------------------------------------------------------------------- -void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t& _pMemfun) +void OReportController::executeMethodWithUndo(sal_uInt16 _nUndoStrId,const ::std::mem_fun_t& _pMemfun) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); @@ -2603,7 +2603,7 @@ void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::me InvalidateFeature( SID_UNDO ); } // ----------------------------------------------------------------------------- -void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection) +void OReportController::alignControlsWithUndo(sal_uInt16 _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); @@ -2686,7 +2686,7 @@ void OReportController::shrinkSectionTop(uno::Reference _xSect _xSection->setHeight(nNewSectionHeight); } -void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference _xSection, sal_Int32 _nSid) +void OReportController::shrinkSection(sal_uInt16 _nUndoStrId, uno::Reference _xSection, sal_Int32 _nSid) { if ( _xSection.is() ) { @@ -4257,7 +4257,7 @@ void OReportController::openZoomDialog() { new SvxZoomItem() }; - static USHORT pRanges[] = + static sal_uInt16 pRanges[] = { SID_ATTR_ZOOM,SID_ATTR_ZOOM, 0 diff --git a/reportdesign/source/ui/report/ReportRuler.cxx b/reportdesign/source/ui/report/ReportRuler.cxx index c2480f23b3e5..e0bc9751ec49 100644 --- a/reportdesign/source/ui/report/ReportRuler.cxx +++ b/reportdesign/source/ui/report/ReportRuler.cxx @@ -53,7 +53,7 @@ void OReportRuler::Resize() m_pSection->SetPosSizePixel(Point(0,0),GetOutputSize()); } //------------------------------------------------------------------------------ -void OReportRuler::SetGridVisible(BOOL _bVisible) +void OReportRuler::SetGridVisible(sal_Bool _bVisible) { m_pSection->SetGridVisible( _bVisible ); } diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 04222d6e2f1e..632efedd579c 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -96,7 +96,7 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re ,m_pReportListener(NULL) ,m_xSection(_xSection) ,m_eMode(RPTUI_SELECT) -,m_bDialogModelChanged(FALSE) +,m_bDialogModelChanged(sal_False) ,m_bInDrag(sal_False) { DBG_CTOR( rpt_OReportSection,NULL); @@ -211,7 +211,7 @@ void OReportSection::fill() // without the following call, no grid is painted m_pView->ShowSdrPage( m_pPage ); - m_pView->SetMoveSnapOnlyTopLeft( TRUE ); + m_pView->SetMoveSnapOnlyTopLeft( sal_True ); ODesignView* pDesignView = m_pParent->getViewsWindow()->getView()->getReportView(); // #i93595# Adapted grid to a more coarse grid and subdivisions for better visualisation. This @@ -227,8 +227,8 @@ void OReportSection::fill() m_pView->SetSnapGridWidth(aX, aY); m_pView->SetGridSnap( pDesignView->isGridSnap() ); - m_pView->SetGridFront( FALSE ); - m_pView->SetDragStripes( TRUE ); + m_pView->SetGridFront( sal_False ); + m_pView->SetDragStripes( sal_True ); m_pView->SetPageVisible(); sal_Int32 nColor = m_xSection->getBackColor(); if ( nColor == (sal_Int32)COL_TRANSPARENT ) @@ -243,7 +243,7 @@ void OReportSection::fill() // LLA: TODO // m_pPage->SetUppBorder(-10000); - m_pView->SetDesignMode( TRUE ); + m_pView->SetDesignMode( sal_True ); m_pView->StartListening( *m_pModel ); /*Resize();*/ @@ -372,14 +372,14 @@ void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedOb // insert control models of marked objects into clipboard dialog model const SdrMarkList& rMarkedList = m_pView->GetMarkedObjectList(); - const ULONG nMark = rMarkedList.GetMarkCount(); + const sal_uLong nMark = rMarkedList.GetMarkCount(); ::std::vector< uno::Reference > aCopies; aCopies.reserve(nMark); SdrUndoFactory& rUndo = m_pView->GetModel()->GetSdrUndoFactory(); - for( ULONG i = nMark; i > 0; ) + for( sal_uLong i = nMark; i > 0; ) { --i; SdrObject* pSdrObject = rMarkedList.GetMark(i)->GetMarkedSdrObj(); @@ -402,7 +402,7 @@ void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedOb OSL_ENSURE(0,"Can't copy report elements!"); } } - } // for( ULONG i = 0; i < nMark; i++ ) + } // for( sal_uLong i = 0; i < nMark; i++ ) if ( !aCopies.empty() ) { @@ -436,7 +436,7 @@ void OReportSection::MouseMove( const MouseEvent& rMEvt ) } //---------------------------------------------------------------------------- -void OReportSection::SetGridVisible(BOOL _bVisible) +void OReportSection::SetGridVisible(sal_Bool _bVisible) { m_pView->SetGridVisible( _bVisible ); } @@ -460,14 +460,14 @@ void OReportSection::SelectAll(const sal_uInt16 _nObjectType) } } } -void lcl_insertMenuItemImages(PopupMenu& rContextMenu,OReportController& rController,const uno::Reference< report::XReportDefinition>& _xReportDefinition,uno::Reference& _rFrame,BOOL _bHiContrast) +void lcl_insertMenuItemImages(PopupMenu& rContextMenu,OReportController& rController,const uno::Reference< report::XReportDefinition>& _xReportDefinition,uno::Reference& _rFrame,sal_Bool _bHiContrast) { - const USHORT nCount = rContextMenu.GetItemCount(); - for (USHORT i = 0; i < nCount; ++i) + const sal_uInt16 nCount = rContextMenu.GetItemCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { if ( MENUITEM_SEPARATOR != rContextMenu.GetItemType(i)) { - const USHORT nId = rContextMenu.GetItemId(i); + const sal_uInt16 nId = rContextMenu.GetItemId(i); PopupMenu* pPopupMenu = rContextMenu.GetPopupMenu( nId ); if ( pPopupMenu ) { @@ -476,7 +476,7 @@ void lcl_insertMenuItemImages(PopupMenu& rContextMenu,OReportController& rContro else { const ::rtl::OUString sCommand = rContextMenu.GetItemCommand(nId); - rContextMenu.SetItemImage(nId,framework::GetImageFromURL(_rFrame,sCommand,FALSE,_bHiContrast)); + rContextMenu.SetItemImage(nId,framework::GetImageFromURL(_rFrame,sCommand,sal_False,_bHiContrast)); if ( nId == SID_PAGEHEADERFOOTER ) { String sText = String(ModuleRes((_xReportDefinition.is() && _xReportDefinition->getPageHeaderOn()) ? RID_STR_PAGEHEADERFOOTER_DELETE : RID_STR_PAGEHEADERFOOTER_INSERT)); @@ -491,7 +491,7 @@ void lcl_insertMenuItemImages(PopupMenu& rContextMenu,OReportController& rContro rContextMenu.CheckItem(nId,rController.isCommandChecked(nId)); rContextMenu.EnableItem(nId,rController.isCommandEnabled(nId)); } - } // for (USHORT i = 0; i < nCount; ++i) + } // for (sal_uInt16 i = 0; i < nCount; ++i) } //---------------------------------------------------------------------------- void OReportSection::Command( const CommandEvent& _rCEvt ) @@ -502,7 +502,7 @@ void OReportSection::Command( const CommandEvent& _rCEvt ) case COMMAND_CONTEXTMENU: { const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - BOOL bHiContrast = rSettings.GetHighContrastMode(); + sal_Bool bHiContrast = rSettings.GetHighContrastMode(); OReportController& rController = m_pParent->getViewsWindow()->getView()->getReportView()->getController(); uno::Reference xFrame = rController.getFrame(); PopupMenu aContextMenu( ModuleRes( RID_MENU_REPORT ) ); @@ -512,7 +512,7 @@ void OReportSection::Command( const CommandEvent& _rCEvt ) Point aPos = _rCEvt.GetMousePosPixel(); m_pView->EndAction(); - const USHORT nId = aContextMenu.Execute(this, aPos); + const sal_uInt16 nId = aContextMenu.Execute(this, aPos); if ( nId ) { uno::Sequence< beans::PropertyValue> aArgs; @@ -751,7 +751,7 @@ sal_Int8 OReportSection::AcceptDrop( const AcceptDropEvent& _rEvt ) ) { if (!m_pParent) return DND_ACTION_NONE; - USHORT nCurrentPosition = 0; + sal_uInt16 nCurrentPosition = 0; nCurrentPosition = m_pParent->getViewsWindow()->getPosition(m_pParent); if (_rEvt.mnAction == DND_ACTION_COPY ) { diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 3a2f4559b43a..d1afc5bcfd22 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -100,7 +100,7 @@ void OReportWindow::initialize() m_aViewsWindow.initialize(); } //---------------------------------------------------------------------------- -void OReportWindow::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType ) +void OReportWindow::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) { m_aViewsWindow.SetInsertObj( eObj,_sShapeType); } @@ -116,7 +116,7 @@ void OReportWindow::SetMode( DlgEdMode eNewMode ) m_aViewsWindow.SetMode(eNewMode); } //---------------------------------------------------------------------------- -void OReportWindow::removeSection(USHORT _nPosition) +void OReportWindow::removeSection(sal_uInt16 _nPosition) { m_aViewsWindow.removeSection(_nPosition); m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight()); @@ -124,7 +124,7 @@ void OReportWindow::removeSection(USHORT _nPosition) //Resize(); } //---------------------------------------------------------------------------- -void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition) +void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,sal_uInt16 _nPosition) { if ( !_xSection.is() ) return; @@ -251,7 +251,7 @@ void OReportWindow::ScrollChildren(const Point& _aThumbPos) m_aViewsWindow.scrollChildren(_aThumbPos); } //---------------------------------------------------------------------------- -USHORT OReportWindow::getSectionCount() const +sal_uInt16 OReportWindow::getSectionCount() const { return m_aViewsWindow.getSectionCount(); } @@ -261,7 +261,7 @@ void OReportWindow::notifySizeChanged() m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight()); } //---------------------------------------------------------------------------- -BOOL OReportWindow::HasSelection() const +sal_Bool OReportWindow::HasSelection() const { return m_aViewsWindow.HasSelection(); } @@ -284,7 +284,7 @@ void OReportWindow::Paste() m_aViewsWindow.Paste(); } //---------------------------------------------------------------------------- -BOOL OReportWindow::IsPasteAllowed() const +sal_Bool OReportWindow::IsPasteAllowed() const { return m_aViewsWindow.IsPasteAllowed(); } @@ -364,13 +364,13 @@ void OReportWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAl m_aViewsWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects); } // ----------------------------------------------------------------------------- -void OReportWindow::setGridSnap(BOOL bOn) +void OReportWindow::setGridSnap(sal_Bool bOn) { m_aViewsWindow.setGridSnap(bOn); } // ----------------------------------------------------------------------------- -void OReportWindow::setDragStripes(BOOL bOn) +void OReportWindow::setDragStripes(sal_Bool bOn) { m_aViewsWindow.setDragStripes(bOn); } @@ -423,14 +423,14 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const break; case SVX_ZOOM_WHOLEPAGE: { - nZoom = (USHORT)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); + nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); MapMode aMap( MAP_100TH_MM ); const Size aHeight = m_aViewsWindow.LogicToPixel(m_aViewsWindow.PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler.GetSizePixel().Height())),aMap); - nZoom = ::std::min(nZoom,(USHORT)(long)Fraction(aSize.Height()*100,aHeight.Height())); + nZoom = ::std::min(nZoom,(sal_uInt16)(long)Fraction(aSize.Height()*100,aHeight.Height())); } break; case SVX_ZOOM_PAGEWIDTH: - nZoom = (USHORT)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); + nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); break; default: break; diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index b6ab83e24a64..13c65882e6c0 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -203,12 +203,12 @@ IMPL_LINK( OScrollWindowHelper, ScrollHdl, ScrollBar*, /*pScroll*/ ) //------------------------------------------------------------------------------ void OScrollWindowHelper::addSection(const uno::Reference< report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition) + ,sal_uInt16 _nPosition) { m_aReportWindow.addSection(_xSection,_sColorEntry,_nPosition); } //------------------------------------------------------------------------------ -void OScrollWindowHelper::removeSection(USHORT _nPosition) +void OScrollWindowHelper::removeSection(sal_uInt16 _nPosition) { m_aReportWindow.removeSection(_nPosition); } @@ -218,12 +218,12 @@ void OScrollWindowHelper::toggleGrid(sal_Bool _bVisible) m_aReportWindow.toggleGrid(_bVisible); } //------------------------------------------------------------------------------ -USHORT OScrollWindowHelper::getSectionCount() const +sal_uInt16 OScrollWindowHelper::getSectionCount() const { return m_aReportWindow.getSectionCount(); } //------------------------------------------------------------------------------ -void OScrollWindowHelper::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType ) +void OScrollWindowHelper::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) { m_aReportWindow.SetInsertObj(eObj,_sShapeType); } @@ -238,7 +238,7 @@ void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode ) m_aReportWindow.SetMode(_eNewMode); } //------------------------------------------------------------------------------ -BOOL OScrollWindowHelper::HasSelection() const +sal_Bool OScrollWindowHelper::HasSelection() const { return m_aReportWindow.HasSelection(); } @@ -258,7 +258,7 @@ void OScrollWindowHelper::Paste() m_aReportWindow.Paste(); } //---------------------------------------------------------------------------- -BOOL OScrollWindowHelper::IsPasteAllowed() const +sal_Bool OScrollWindowHelper::IsPasteAllowed() const { return m_aReportWindow.IsPasteAllowed(); } @@ -380,12 +380,12 @@ void OScrollWindowHelper::_propertyChanged(const beans::PropertyChangeEvent& /*_ m_aReportWindow.notifySizeChanged(); } // ----------------------------------------------------------------------------- -void OScrollWindowHelper::setGridSnap(BOOL bOn) +void OScrollWindowHelper::setGridSnap(sal_Bool bOn) { m_aReportWindow.setGridSnap(bOn); } // ----------------------------------------------------------------------------- -void OScrollWindowHelper::setDragStripes(BOOL bOn) +void OScrollWindowHelper::setDragStripes(sal_Bool bOn) { m_aReportWindow.setDragStripes(bOn); } diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx index e0d836a3d8c5..d8bbb68b95f3 100644 --- a/reportdesign/source/ui/report/SectionView.cxx +++ b/reportdesign/source/ui/report/SectionView.cxx @@ -56,7 +56,7 @@ OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, O SetBufferedOverlayAllowed(true); SetPageBorderVisible(false); SetBordVisible(); - SetQuickTextEditMode(FALSE); + SetQuickTextEditMode(sal_False); } //---------------------------------------------------------------------------- @@ -162,16 +162,16 @@ void OSectionView::ObjectRemovedInAliveMode( const SdrObject* _pObject ) { DBG_CHKTHIS( rpt_OSectionView,NULL); const SdrMarkList& rMarkedList = GetMarkedObjectList(); - const ULONG nMark = rMarkedList.GetMarkCount(); + const sal_uLong nMark = rMarkedList.GetMarkCount(); - for( ULONG i = 0; i < nMark; i++ ) + for( sal_uLong i = 0; i < nMark; i++ ) { SdrObject* pSdrObj = rMarkedList.GetMark(i)->GetMarkedSdrObj(); if (_pObject == pSdrObj) { SdrPageView* pPgView = GetSdrPageView(); BrkAction(); - MarkObj( pSdrObj, pPgView, TRUE ); + MarkObj( pSdrObj, pPgView, sal_True ); break; } } @@ -187,8 +187,8 @@ void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo ) BegUndo( ); const SdrMarkList& rMark = GetMarkedObjectList(); - ULONG nCount = rMark.GetMarkCount(); - for (ULONG i=0; iGetMarkedSdrObj(); if ( pObj->ISA(OCustomShape) ) @@ -218,10 +218,10 @@ void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo ) bool OSectionView::OnlyShapesMarked() const { const SdrMarkList& rMark = GetMarkedObjectList(); - const ULONG nCount = rMark.GetMarkCount(); + const sal_uLong nCount = rMark.GetMarkCount(); if ( !nCount ) return false; - ULONG i=0; + sal_uLong i=0; for (; iGetMarkedSdrObj(); @@ -229,7 +229,7 @@ bool OSectionView::OnlyShapesMarked() const { break; } - } // for (ULONG i=0; iGetMarkedSdrObj(); if ( nRet == SHRT_MAX ) diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 26ce8c13c2a6..67dfb0f9753f 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -109,7 +109,7 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep } _propertyChanged(aEvent); - SetPaintTransparent(TRUE); + SetPaintTransparent(sal_True); } // ----------------------------------------------------------------------------- OSectionWindow::~OSectionWindow() @@ -135,11 +135,11 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) const uno::Reference< report::XSection> xCurrentSection = m_aReportSection.getSection(); if ( _rEvent.PropertyName.equals(PROPERTY_HEIGHT) ) { - m_pParent->getView()->SetUpdateMode(FALSE); + m_pParent->getView()->SetUpdateMode(sal_False); Resize(); m_pParent->getView()->notifySizeChanged(); m_pParent->resize(*this); - m_pParent->getView()->SetUpdateMode(TRUE); + m_pParent->getView()->SetUpdateMode(sal_True); m_aStartMarker.Invalidate(INVALIDATE_NOERASE); m_aEndMarker.Invalidate(INVALIDATE_NOERASE); m_aReportSection.Invalidate(/*INVALIDATE_NOERASE*/); @@ -175,7 +175,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) } } // ----------------------------------------------------------------------------- -bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,USHORT _nResId,::std::mem_fun_t , OReportHelper> _pGetSection,::std::mem_fun_t _pIsSectionOn) +bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t , OReportHelper> _pGetSection,::std::mem_fun_t _pIsSectionOn) { OReportHelper aReportHelper(_xReport); const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection.getSection(); @@ -188,7 +188,7 @@ bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReport return bRet; } // ----------------------------------------------------------------------------- -bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t , OGroupHelper> _pGetSection,::std::mem_fun_t _pIsSectionOn) +bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t , OGroupHelper> _pGetSection,::std::mem_fun_t _pIsSectionOn) { OGroupHelper aGroupHelper(_xGroup); const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection.getSection() ; diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index c3fed866e534..cf4be7f17161 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -83,7 +83,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol m_aVRuler.SetMargin2(); const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); - SetPaintTransparent(TRUE); + SetPaintTransparent(sal_True); } // ----------------------------------------------------------------------------- OStartMarker::~OStartMarker() @@ -108,7 +108,7 @@ sal_Int32 OStartMarker::getMinHeight() const void OStartMarker::Paint( const Rectangle& rRect ) { Window::Paint( rRect ); - //SetUpdateMode(FALSE); + //SetUpdateMode(sal_False); Size aSize = GetOutputSizePixel(); long nSize = aSize.Width(); const long nCornerWidth = long(CORNER_SPACE * (double)GetMapMode().GetScaleX()); @@ -132,14 +132,14 @@ void OStartMarker::Paint( const Rectangle& rRect ) Color aStartColor(m_nColor); aStartColor.IncreaseLuminance(10); - USHORT nHue = 0; - USHORT nSat = 0; - USHORT nBri = 0; + sal_uInt16 nHue = 0; + sal_uInt16 nSat = 0; + sal_uInt16 nBri = 0; aStartColor.RGBtoHSB(nHue, nSat, nBri); nSat += 40; Color aEndColor(Color::HSBtoRGB(nHue, nSat, nBri)); Gradient aGradient(GRADIENT_LINEAR,aStartColor,aEndColor); - aGradient.SetSteps(static_cast(aSize.Height())); + aGradient.SetSteps(static_cast(aSize.Height())); DrawGradient(PixelToLogic(aPoly) ,aGradient); } @@ -218,10 +218,10 @@ void OStartMarker::initDefaultNodeImages() pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; } m_aImage.SetImage(*pImage); - m_aImage.SetMouseTransparent(TRUE); + m_aImage.SetMouseTransparent(sal_True); m_aImage.SetBackground(); m_aText.SetBackground(); - m_aText.SetMouseTransparent(TRUE); + m_aText.SetMouseTransparent(sal_True); } // ----------------------------------------------------------------------- void OStartMarker::ImplInitSettings() diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index bcd50236aab3..49f67a6e5195 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -184,7 +184,7 @@ OViewsWindow::OViewsWindow( OReportWindow* _pReportWindow) ,m_bInUnmark(sal_False) { DBG_CTOR( rpt_OViewsWindow,NULL); - SetPaintTransparent(TRUE); + SetPaintTransparent(sal_True); SetUniqueId(UID_RPT_VIEWSWINDOW); SetMapMode( MapMode( MAP_100TH_MM ) ); m_aColorConfig.AddListener(this); @@ -268,7 +268,7 @@ void OViewsWindow::Resize() Point aStartPoint(0,-aOffset.Y()); TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); - for (USHORT nPos=0;aIter != aEnd ; ++aIter,++nPos) + for (sal_uInt16 nPos=0;aIter != aEnd ; ++aIter,++nPos) { const ::boost::shared_ptr pSectionWindow = (*aIter); impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,true); @@ -312,7 +312,7 @@ void OViewsWindow::DataChanged( const DataChangedEvent& rDCEvt ) } } //---------------------------------------------------------------------------- -void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition) +void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,sal_uInt16 _nPosition) { ::boost::shared_ptr pSectionWindow( new OSectionWindow(this,_xSection,_sColorEntry) ); m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(pSectionWindow)); @@ -321,7 +321,7 @@ void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSectio Resize(); } //---------------------------------------------------------------------------- -void OViewsWindow::removeSection(USHORT _nPosition) +void OViewsWindow::removeSection(sal_uInt16 _nPosition) { if ( _nPosition < m_aSections.size() ) { @@ -335,7 +335,7 @@ void OViewsWindow::removeSection(USHORT _nPosition) } // if ( _nPosition < m_aSections.size() ) } //------------------------------------------------------------------------------ -void OViewsWindow::toggleGrid(BOOL _bVisible) +void OViewsWindow::toggleGrid(sal_Bool _bVisible) { ::std::for_each(m_aSections.begin(),m_aSections.end(), ::std::compose1(::boost::bind(&OReportSection::SetGridVisible,_1,_bVisible),TReportPairHelper())); @@ -355,12 +355,12 @@ sal_Int32 OViewsWindow::getTotalHeight() const return nHeight; } //---------------------------------------------------------------------------- -USHORT OViewsWindow::getSectionCount() const +sal_uInt16 OViewsWindow::getSectionCount() const { - return static_cast(m_aSections.size()); + return static_cast(m_aSections.size()); } //---------------------------------------------------------------------------- -void OViewsWindow::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType ) +void OViewsWindow::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) { TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); @@ -382,7 +382,7 @@ void OViewsWindow::SetMode( DlgEdMode eNewMode ) ::std::compose1(::boost::bind(&OReportSection::SetMode,_1,eNewMode),TReportPairHelper())); } //---------------------------------------------------------------------------- -BOOL OViewsWindow::HasSelection() const +sal_Bool OViewsWindow::HasSelection() const { TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); @@ -512,7 +512,7 @@ void OViewsWindow::markSection(const sal_uInt16 _nPos) m_pParent->setMarked(m_aSections[_nPos]->getReportSection().getSection(),sal_True); } //---------------------------------------------------------------------------- -BOOL OViewsWindow::IsPasteAllowed() const +sal_Bool OViewsWindow::IsPasteAllowed() const { TransferableDataHelper aTransferData( TransferableDataHelper::CreateFromSystemClipboard( const_cast< OViewsWindow* >( this ) ) ); return aTransferData.HasFormat(OReportExchange::getDescriptorFormatId()); @@ -586,7 +586,7 @@ void OViewsWindow::showRuler(sal_Bool _bShow) ::std::for_each(m_aSections.begin(),m_aSections.end(), ::std::compose1(::boost::bind(&OStartMarker::showRuler,_1,_bShow),TStartMarkerHelper())); ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(&OStartMarker::Window::Invalidate,_1,USHORT(INVALIDATE_NOERASE)),TStartMarkerHelper())); + ::std::compose1(::boost::bind(&OStartMarker::Window::Invalidate,_1,sal_uInt16(INVALIDATE_NOERASE)),TStartMarkerHelper())); } //---------------------------------------------------------------------------- void OViewsWindow::MouseButtonUp( const MouseEvent& rMEvt ) @@ -628,7 +628,7 @@ sal_Bool OViewsWindow::handleKeyEvent(const KeyEvent& _rEvent) return bRet; } //---------------------------------------------------------------------------- -OViewsWindow::TSectionsMap::iterator OViewsWindow::getIteratorAtPos(USHORT _nPos) +OViewsWindow::TSectionsMap::iterator OViewsWindow::getIteratorAtPos(sal_uInt16 _nPos) { TSectionsMap::iterator aRet = m_aSections.end(); if ( _nPos < m_aSections.size() ) @@ -743,7 +743,7 @@ void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles, SdrObjTransformInfoRec aInfo; const SdrObject* pObj = aRectIter->second.first; pObj->TakeObjInfo(aInfo); - BOOL bHasFixed = !aInfo.bMoveAllowed || pObj->IsMoveProtect(); + sal_Bool bHasFixed = !aInfo.bMoveAllowed || pObj->IsMoveProtect(); if ( bHasFixed ) _rBound.Union(aObjRect); else @@ -939,7 +939,7 @@ void OViewsWindow::createDefault() pMarkedSection->getReportSection().createDefault(m_sShapeType); } // ----------------------------------------------------------------------------- -void OViewsWindow::setGridSnap(BOOL bOn) +void OViewsWindow::setGridSnap(sal_Bool bOn) { TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); @@ -950,7 +950,7 @@ void OViewsWindow::setGridSnap(BOOL bOn) } } // ----------------------------------------------------------------------------- -void OViewsWindow::setDragStripes(BOOL bOn) +void OViewsWindow::setDragStripes(sal_Bool bOn) { TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); @@ -958,11 +958,11 @@ void OViewsWindow::setDragStripes(BOOL bOn) (*aIter)->getReportSection().getSectionView().SetDragStripes(bOn); } // ----------------------------------------------------------------------------- -USHORT OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) const +sal_uInt16 OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) const { TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); - USHORT nPosition = 0; + sal_uInt16 nPosition = 0; for (; aIter != aEnd ; ++aIter) { if ( _pSectionWindow == (*aIter).get() ) @@ -974,7 +974,7 @@ USHORT OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) const return nPosition; } // ----------------------------------------------------------------------------- -::boost::shared_ptr OViewsWindow::getSectionWindow(const USHORT _nPos) const +::boost::shared_ptr OViewsWindow::getSectionWindow(const sal_uInt16 _nPos) const { ::boost::shared_ptr aReturn; @@ -1069,7 +1069,7 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _ // pNewObj->Move(Size(_aRect.Left(), _aRect.Top())); pNewObj->Move(Size(0, aNewPos.Y())); - BOOL bChanged = rView.GetModel()->IsChanged(); + sal_Bool bChanged = rView.GetModel()->IsChanged(); rReportSection.getPage()->InsertObject(pNewObj); rView.GetModel()->SetChanged(bChanged); m_aBegDragTempList.push_back(pNewObj); @@ -1326,7 +1326,7 @@ void OViewsWindow::EndDragObj_removeInvisibleObjects() } } // ----------------------------------------------------------------------------- -void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSection,const Point& _aPnt) +void OViewsWindow::EndDragObj(sal_Bool _bControlKeyPressed, const OSectionView* _pSection,const Point& _aPnt) { const String sUndoAction = String((ModuleRes(RID_STR_UNDO_CHANGEPOSITION))); UndoManagerListAction aListAction(*getView()->getReportView()->getController().getUndoMgr(),sUndoAction); @@ -1357,7 +1357,7 @@ void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSe rReportSection.Copy(aAllreadyCopiedObjects,true); } else - pInSection->EndDragObj(FALSE); + pInSection->EndDragObj(sal_False); } // for (; aIter != aEnd; ++aIter) if ( aAllreadyCopiedObjects.getLength() ) @@ -1428,7 +1428,7 @@ void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSe } else { - ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( FALSE ) ); + ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( sal_False ) ); EndDragObj_removeInvisibleObjects(); } m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32); @@ -1568,9 +1568,9 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bo #endif } // ----------------------------------------------------------------------------- -BOOL OViewsWindow::IsAction() const +sal_Bool OViewsWindow::IsAction() const { - BOOL bAction = FALSE; + sal_Bool bAction = sal_False; TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); for (; !bAction && aIter != aEnd; ++aIter) @@ -1578,9 +1578,9 @@ BOOL OViewsWindow::IsAction() const return bAction; } // ----------------------------------------------------------------------------- -BOOL OViewsWindow::IsDragObj() const +sal_Bool OViewsWindow::IsDragObj() const { - BOOL bAction = FALSE; + sal_Bool bAction = sal_False; TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); for (; !bAction && aIter != aEnd; ++aIter) @@ -1600,7 +1600,7 @@ sal_uInt32 OViewsWindow::getMarkedObjectCount() const // ----------------------------------------------------------------------------- void OViewsWindow::handleKey(const KeyCode& _rCode) { - const USHORT nCode = _rCode.GetCode(); + const sal_uInt16 nCode = _rCode.GetCode(); if ( _rCode.IsMod1() ) { // scroll page @@ -1710,13 +1710,13 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) if ( rView.IsDragObj() ) { const FASTBOOL bWasNoSnap = rDragStat.IsNoSnap(); - const BOOL bWasSnapEnabled = rView.IsSnapEnabled(); + const sal_Bool bWasSnapEnabled = rView.IsSnapEnabled(); // switch snapping off if ( !bWasNoSnap ) - ((SdrDragStat&)rDragStat).SetNoSnap( TRUE ); + ((SdrDragStat&)rDragStat).SetNoSnap( sal_True ); if ( bWasSnapEnabled ) - rView.SetSnapEnabled( FALSE ); + rView.SetSnapEnabled( sal_False ); Rectangle aNewRect; bool bCheck = false; diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 1535ce7d6ee1..b17b68bdba4b 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -185,11 +185,11 @@ DlgEdFunc::~DlgEdFunc() //---------------------------------------------------------------------------- -BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) +sal_Bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) { m_aMDPos = m_pParent->PixelToLogic( rMEvt.GetPosPixel() ); m_pParent->GrabFocus(); - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; if ( rMEvt.IsLeft() ) { if ( rMEvt.GetClicks() > 1 ) @@ -206,8 +206,8 @@ BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) // SdrViewEvent aVEvt; // m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); // if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) ) - // SetInEditMode(static_cast(aVEvt.pRootObj),rMEvt, FALSE); - bHandled = TRUE; + // SetInEditMode(static_cast(aVEvt.pRootObj),rMEvt, sal_False); + bHandled = sal_True; } } else @@ -218,7 +218,7 @@ BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) // if selected object was hit, drag object if ( pHdl!=NULL || m_rView.IsMarkedHit(m_aMDPos) ) { - bHandled = TRUE; + bHandled = sal_True; m_pParent->CaptureMouse(); m_pParent->getSectionWindow()->getViewsWindow()->BegDragObj(m_aMDPos, pHdl,&m_rView); } @@ -235,10 +235,10 @@ BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) else m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL); - bHandled = TRUE; + bHandled = sal_True; } else if( !rMEvt.IsLeft() ) - bHandled = TRUE; + bHandled = sal_True; if ( !bHandled ) m_pParent->CaptureMouse(); return bHandled; @@ -246,9 +246,9 @@ BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) //---------------------------------------------------------------------------- -BOOL DlgEdFunc::MouseButtonUp( const MouseEvent& /*rMEvt*/ ) +sal_Bool DlgEdFunc::MouseButtonUp( const MouseEvent& /*rMEvt*/ ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; m_pParent->getSectionWindow()->getViewsWindow()->stopScrollTimer(); return bHandled; } @@ -257,7 +257,7 @@ void DlgEdFunc::checkTwoCklicks(const MouseEvent& rMEvt) { deactivateOle(); - const USHORT nClicks = rMEvt.GetClicks(); + const sal_uInt16 nClicks = rMEvt.GetClicks(); if ( nClicks == 2 && rMEvt.IsLeft() ) { if ( m_rView.AreObjectsMarked() ) @@ -282,19 +282,19 @@ void DlgEdFunc::stopScrollTimer() } //---------------------------------------------------------------------------- -BOOL DlgEdFunc::MouseMove( const MouseEvent& /*rMEvt*/ ) +sal_Bool DlgEdFunc::MouseMove( const MouseEvent& /*rMEvt*/ ) { - return FALSE; + return sal_False; } //------------------------------------------------------------------------------ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) { - BOOL bReturn = FALSE; + sal_Bool bReturn = sal_False; if ( !m_bUiActive ) { const KeyCode& rCode = _rEvent.GetKeyCode(); - USHORT nCode = rCode.GetCode(); + sal_uInt16 nCode = rCode.GetCode(); switch ( nCode ) { @@ -303,12 +303,12 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) if ( m_pParent->getSectionWindow()->getViewsWindow()->IsAction() ) { m_pParent->getSectionWindow()->getViewsWindow()->BrkAction(); - bReturn = TRUE; + bReturn = sal_True; } else if ( m_rView.IsTextEdit() ) { m_rView.SdrEndTextEdit(); - bReturn = TRUE; + bReturn = sal_True; } else if ( m_rView.AreObjectsMarked() ) { @@ -321,7 +321,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) //m_rView.UnmarkAll(); deactivateOle(true); - bReturn = FALSE; + bReturn = sal_False; } else { @@ -344,7 +344,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) if ( m_rView.AreObjectsMarked() ) m_rView.MakeVisible( m_rView.GetAllMarkedRect(), *m_pParent); - bReturn = TRUE; + bReturn = sal_True; } else if ( rCode.IsMod1() && rCode.IsMod2()) { @@ -361,7 +361,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) m_rView.MakeVisible( aVisRect, *m_pParent); } - bReturn = TRUE; + bReturn = sal_True; } } break; @@ -371,7 +371,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) case KEY_RIGHT: { m_pParent->getSectionWindow()->getViewsWindow()->handleKey(rCode); - bReturn = TRUE; + bReturn = sal_True; } break; case KEY_RETURN: @@ -388,7 +388,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) case KEY_DELETE: if ( !rCode.IsMod1() && !rCode.IsMod2() ) { - bReturn = TRUE; + bReturn = sal_True; break; } // if ( !rCode.IsMod1() && !rCode.IsMod2() ) // run through @@ -410,7 +410,7 @@ void DlgEdFunc::activateOle(SdrObject* _pObj) { if ( _pObj ) { - const UINT16 nSdrObjKind = _pObj->GetObjIdentifier(); + const sal_uInt16 nSdrObjKind = _pObj->GetObjIdentifier(); // // OLE: activate // @@ -451,8 +451,8 @@ void DlgEdFunc::activateOle(SdrObject* _pObj) void DlgEdFunc::deactivateOle(bool _bSelect) { OLEObjCache& rObjCache = GetSdrGlobalData().GetOLEObjCache(); - const ULONG nCount = rObjCache.Count(); - for(ULONG i = 0 ; i< nCount;++i) + const sal_uLong nCount = rObjCache.Count(); + for(sal_uLong i = 0 ; i< nCount;++i) { SdrOle2Obj* pObj = reinterpret_cast(rObjCache.GetObject(i)); if ( m_pParent->getPage() == pObj->GetPage() ) @@ -475,7 +475,7 @@ void DlgEdFunc::deactivateOle(bool _bSelect) } } // if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE ) } - } // for(ULONG i = 0 ; i< nCount;++i) + } // for(sal_uLong i = 0 ; i< nCount;++i) } // ----------------------------------------------------------------------------- void DlgEdFunc::colorizeOverlappedObject(SdrObject* _pOverlappedObj) @@ -673,22 +673,22 @@ bool DlgEdFunc::setMovementPointer(const MouseEvent& rMEvt) DlgEdFuncInsert::DlgEdFuncInsert( OReportSection* _pParent ) : DlgEdFunc( _pParent ) { - m_rView.SetCreateMode( TRUE ); + m_rView.SetCreateMode( sal_True ); } //---------------------------------------------------------------------------- DlgEdFuncInsert::~DlgEdFuncInsert() { - m_rView.SetEditMode( TRUE ); + m_rView.SetEditMode( sal_True ); } //---------------------------------------------------------------------------- -BOOL DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseButtonDown(rMEvt) ) - return TRUE; + return sal_True; SdrViewEvent aVEvt; sal_Int16 nId = m_rView.GetCurrentObjIdentifier(); @@ -705,7 +705,7 @@ BOOL DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) // rtl::OUString suWasN2 = m_pParent->getSectionWindow()->getViewsWindow()->GetInsertObjString(); m_pParent->getSectionWindow()->getViewsWindow()->BrkAction(); - return FALSE; + return sal_False; } if( eHit != SDRHIT_UNMARKEDOBJECT || nId == OBJ_CUSTOMSHAPE) @@ -730,19 +730,19 @@ BOOL DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) m_pParent->getSectionWindow()->getViewsWindow()->BegMarkObj( m_aMDPos,&m_rView ); } - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- -BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseButtonUp( rMEvt ) ) - return TRUE; + return sal_True; const Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); - const USHORT nHitLog = USHORT ( m_pParent->PixelToLogic(Size(3,0)).Width() ); + const sal_uInt16 nHitLog = sal_uInt16 ( m_pParent->PixelToLogic(Size(3,0)).Width() ); - BOOL bReturn = TRUE; + sal_Bool bReturn = sal_True; // object creation active? if ( m_rView.IsCreateObj() ) { @@ -750,8 +750,8 @@ BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) { m_pParent->getSectionWindow()->getViewsWindow()->BrkAction(); // BrkAction disables the create mode - m_rView.SetCreateMode( TRUE ); - return TRUE; + m_rView.SetCreateMode( sal_True ); + return sal_True; } m_rView.EndCreateObj(SDRCREATE_FORCEEND); @@ -798,10 +798,10 @@ BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) //---------------------------------------------------------------------------- -BOOL DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseMove(rMEvt ) ) - return TRUE; + return sal_True; Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); if ( m_rView.IsCreateObj() ) @@ -832,7 +832,7 @@ BOOL DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt ) if ( !bIsSetPoint ) m_pParent->SetPointer( m_rView.GetPreferedPointer( aPos, m_pParent) ); - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- @@ -850,11 +850,11 @@ DlgEdFuncSelect::~DlgEdFuncSelect() //---------------------------------------------------------------------------- -BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) { m_bSelectionMode = false; if ( DlgEdFunc::MouseButtonDown(rMEvt) ) - return TRUE; + return sal_True; SdrViewEvent aVEvt; const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); @@ -892,15 +892,15 @@ BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) } } - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- -BOOL DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseButtonUp( rMEvt ) ) - return TRUE; + return sal_True; // get view from parent const Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); @@ -916,15 +916,15 @@ BOOL DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt ) if ( !m_bUiActive ) m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView); m_bSelectionMode = false; - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- -BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseMove(rMEvt ) ) - return TRUE; + return sal_True; Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); bool bIsSetPoint = false; @@ -971,10 +971,10 @@ BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) unColorizeOverlappedObj(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -//void DlgEdFuncSelect::SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag) +//void DlgEdFuncSelect::SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, sal_Bool bQuickDrag) //{ // // SdrPageView* pPV = m_rView.GetSdrPageView(); @@ -983,12 +983,12 @@ BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) // m_rView.SetCurrentObj(OBJ_TEXT); // m_rView.SetEditMode(SDREDITMODE_EDIT); // -// BOOL bEmptyOutliner = FALSE; +// sal_Bool bEmptyOutliner = sal_False; // // if (!_pTextObj->GetOutlinerParaObject() && m_rView.GetTextEditOutliner()) // { // ::SdrOutliner* pOutl = m_rView.GetTextEditOutliner(); -// ULONG nParaAnz = pOutl->GetParagraphCount(); +// sal_uLong nParaAnz = pOutl->GetParagraphCount(); // Paragraph* p1stPara = pOutl->GetParagraph( 0 ); // // if (nParaAnz==1 && p1stPara) @@ -996,15 +996,15 @@ BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) // // Bei nur einem Pararaph // if (pOutl->GetText(p1stPara).Len() == 0) // { -// bEmptyOutliner = TRUE; +// bEmptyOutliner = sal_True; // } // } // } // // if (_pTextObj != m_rView.GetTextEditObject() || bEmptyOutliner) // { -// UINT32 nInv = _pTextObj->GetObjInventor(); -// UINT16 nSdrObjKind = _pTextObj->GetObjIdentifier(); +// sal_uInt32 nInv = _pTextObj->GetObjInventor(); +// sal_uInt16 nSdrObjKind = _pTextObj->GetObjIdentifier(); // // if (nInv == SdrInventor && _pTextObj->HasTextEdit() && // (nSdrObjKind == OBJ_TEXT || @@ -1018,7 +1018,7 @@ BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) // pOutl->SetMinDepth(0); // pOutl->SetStyleSheetPool((SfxStyleSheetPool*) pModel->GetStyleSheetPool()); // //pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); -// ULONG nCntrl = pOutl->GetControlWord(); +// sal_uLong nCntrl = pOutl->GetControlWord(); // nCntrl |= EE_CNTRL_ALLOWBIGOBJS; // nCntrl |= EE_CNTRL_URLSFXEXECUTE; // nCntrl |= EE_CNTRL_MARKFIELDS; @@ -1061,12 +1061,12 @@ BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) // if( ( pOPO && pOPO->IsVertical() ) /*|| // nSlotId == SID_ATTR_CHAR_VERTICAL || // nSlotId == SID_TEXT_FITTOSIZE_VERTICAL */) -// pOutl->SetVertical( TRUE ); +// pOutl->SetVertical( sal_True ); // // // if (m_rView.SdrBeginTextEdit(_pTextObj, pPV, pParent, sal_True, pOutl) && _pTextObj->GetObjInventor() == SdrInventor) // { -// //bFirstObjCreated = TRUE; +// //bFirstObjCreated = sal_True; // //DeleteDefaultText(); // // OutlinerView* pOLV = m_rView.GetTextEditOutlinerView(); diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index 9e9ae8dffced..c737ce5c3f34 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -311,7 +311,7 @@ sal_Bool PropBrw::Close() m_pDesignView->getController().executeUnChecked(SID_PROPERTYBROWSER_LAST_PAGE,uno::Sequence< beans::PropertyValue>()); - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- @@ -545,8 +545,8 @@ void PropBrw::Update( OSectionView* pNewView ) uno::Sequence< Reference > aMarkedObjects; OViewsWindow* pViews = m_pView->getReportSection()->getSectionWindow()->getViewsWindow(); - const USHORT nSectionCount = pViews->getSectionCount(); - for (USHORT i = 0; i < nSectionCount; ++i) + const sal_uInt16 nSectionCount = pViews->getSectionCount(); + for (sal_uInt16 i = 0; i < nSectionCount; ++i) { ::boost::shared_ptr pSectionWindow = pViews->getSectionWindow(i); if ( pSectionWindow ) -- cgit From 96668046dda0d3a216966b5989ddeb6476f3478b Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Fri, 28 Jan 2011 12:49:53 +0100 Subject: gnumake3: remove comphelper version; fix including extract.hxx --- reportdesign/source/ui/inspection/metadata.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx index 2c98d134196e..419a161741d2 100644 --- a/reportdesign/source/ui/inspection/metadata.cxx +++ b/reportdesign/source/ui/inspection/metadata.cxx @@ -29,7 +29,7 @@ #include #include "com/sun/star/inspection/XPropertyHandler.hpp" #include -#include +#include #ifndef RTPUI_REPORTDESIGN_HELPID_HRC #include "helpids.hrc" #endif -- cgit From 40b467cbda2df572038376e88f9d9fced39e5c0b Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 8 Feb 2011 11:05:35 +0100 Subject: removetooltypes01: Fix build problems after rebase to DEV300m99 in basctl, cui, reportdesign, sw --- reportdesign/source/ui/report/ReportController.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'reportdesign/source') diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 5967bbb199f8..ae8967394c59 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -1042,7 +1042,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_UNDO: { const OXUndoEnvironment::OUndoMode aLock( m_aReportModel->GetUndoEnv() ); - BOOL ( SfxUndoManager::*doXDo )() = + sal_Bool ( SfxUndoManager::*doXDo )() = ( _nId == SID_UNDO ) ? &SfxUndoManager::Undo : &SfxUndoManager::Redo; SfxUndoManager& rUndoManager( getUndoManager() ); -- cgit