summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-12 15:25:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-13 12:14:03 +0200
commit777ed3ffd8ee46997fa74442b46205fc8eca2cde (patch)
tree71d413a5581e6835a40ce6fd35db6ef9e3e91860 /reportdesign
parenta8b366af313a4ffd0ae5766cf4fc281c7efc83f3 (diff)
convert ControlModification to scoped enum
Change-Id: Ia81f1d9f27fb91b831c2ffc3572e119946b085d1 Reviewed-on: https://gerrit.libreoffice.org/36505 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/inc/RptDef.hxx26
-rw-r--r--reportdesign/source/ui/inc/DesignView.hxx4
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx2
-rw-r--r--reportdesign/source/ui/inc/ReportWindow.hxx2
-rw-r--r--reportdesign/source/ui/inc/ScrollHelper.hxx2
-rw-r--r--reportdesign/source/ui/inc/ViewsWindow.hxx7
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx2
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx2
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx3
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx2
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx7
11 files changed, 30 insertions, 29 deletions
diff --git a/reportdesign/inc/RptDef.hxx b/reportdesign/inc/RptDef.hxx
index 329012368c10..0007bedd9c1a 100644
--- a/reportdesign/inc/RptDef.hxx
+++ b/reportdesign/inc/RptDef.hxx
@@ -58,20 +58,20 @@ namespace rptui
#define OBJ_DLG_SUBREPORT ((sal_uInt16) OBJ_MAXI + 6)
// allows the alignment and resizing of controls
-namespace ControlModification
+enum class ControlModification
{
- static const ::sal_Int32 NONE = (sal_Int32)0;
- static const ::sal_Int32 LEFT = (sal_Int32)1;
- static const ::sal_Int32 RIGHT = (sal_Int32)2;
- static const ::sal_Int32 TOP = (sal_Int32)3;
- static const ::sal_Int32 BOTTOM = (sal_Int32)4;
- static const ::sal_Int32 CENTER_HORIZONTAL = (sal_Int32)5;
- static const ::sal_Int32 CENTER_VERTICAL = (sal_Int32)6;
- static const ::sal_Int32 WIDTH_SMALLEST = (sal_Int32)7;
- static const ::sal_Int32 HEIGHT_SMALLEST = (sal_Int32)8;
- static const ::sal_Int32 WIDTH_GREATEST = (sal_Int32)9;
- static const ::sal_Int32 HEIGHT_GREATEST = (sal_Int32)10;
-}
+ NONE = 0,
+ LEFT = 1,
+ RIGHT = 2,
+ TOP = 3,
+ BOTTOM = 4,
+ CENTER_HORIZONTAL = 5,
+ CENTER_VERTICAL = 6,
+ WIDTH_SMALLEST = 7,
+ HEIGHT_SMALLEST = 8,
+ WIDTH_GREATEST = 9,
+ HEIGHT_GREATEST = 10,
+};
class AnyConverter : public ::std::binary_function< OUString,css::uno::Any,css::uno::Any >
{
diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx
index 503e36534eeb..cd51c832a2a7 100644
--- a/reportdesign/source/ui/inc/DesignView.hxx
+++ b/reportdesign/source/ui/inc/DesignView.hxx
@@ -136,7 +136,7 @@ namespace rptui
/** align all marked objects in all sections
*/
- void alignMarkedObjects(sal_Int32 _nControlModification, bool _bAlignAtSection);
+ void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection);
/** All objects will be marked.
*/
@@ -147,7 +147,7 @@ namespace rptui
void UpdatePropertyBrowserDelayed(OSectionView& _rView);
- sal_uInt16 getSectionCount() const;
+ sal_uInt16 getSectionCount() const;
/** removes the section at the given position.
*
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index 46d9194fb099..ddab799c7c8f 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -204,7 +204,7 @@ namespace rptui
,bool _bShow);
void executeMethodWithUndo(sal_uInt16 _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun);
- void alignControlsWithUndo(sal_uInt16 _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false);
+ void alignControlsWithUndo(sal_uInt16 _nUndoStrId, ControlModification _nControlModification, bool _bAlignAtSection = false);
css::uno::Reference< css::frame::XFrame > getXFrame();
diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx
index fe1bc16fe1be..08b446e4c8d7 100644
--- a/reportdesign/source/ui/inc/ReportWindow.hxx
+++ b/reportdesign/source/ui/inc/ReportWindow.hxx
@@ -196,7 +196,7 @@ namespace rptui
/** align all marked objects in all sections
*/
- void alignMarkedObjects(sal_Int32 _nControlModification, bool _bAlignAtSection);
+ void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection);
sal_uInt32 getMarkedObjectCount() const;
diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx
index d8b2c56be03e..ddb3dd587e75 100644
--- a/reportdesign/source/ui/inc/ScrollHelper.hxx
+++ b/reportdesign/source/ui/inc/ScrollHelper.hxx
@@ -189,7 +189,7 @@ namespace rptui
/** align all marked objects in all sections
*/
- void alignMarkedObjects(sal_Int32 _nControlModification, bool _bAlignAtSection);
+ void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection);
sal_uInt32 getMarkedObjectCount() const;
diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx
index e05f1cd123cd..b74a9b1a0a0d 100644
--- a/reportdesign/source/ui/inc/ViewsWindow.hxx
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -37,12 +37,13 @@
#include "SectionWindow.hxx"
class SdrHdl;
+
namespace rptui
{
class OReportWindow;
class OReportSection;
class OSectionView;
-
+ enum class ControlModification;
struct RectangleLess : public ::std::binary_function< tools::Rectangle, tools::Rectangle, bool>
{
@@ -91,7 +92,7 @@ namespace rptui
*/
TSectionsMap::iterator getIteratorAtPos(sal_uInt16 _nPos);
void collectRectangles(TRectangleMap& _rMap);
- static void collectBoundResizeRect(const TRectangleMap& _rSortRectangles,sal_Int32 _nControlModification,bool _bAlignAtSection,tools::Rectangle& _rBound,tools::Rectangle& _rResize);
+ static void collectBoundResizeRect(const TRectangleMap& _rSortRectangles, ControlModification _nControlModification,bool _bAlignAtSection,tools::Rectangle& _rBound,tools::Rectangle& _rResize);
void impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet);
OViewsWindow(OViewsWindow&) = delete;
@@ -213,7 +214,7 @@ namespace rptui
/** align all marked objects in all sections
*/
- void alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection);
+ void alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection);
/** creates a default object
*
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index ff6b97866952..c993d46d57da 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -580,7 +580,7 @@ void ODesignView::setCurrentPage(const OUString& _sLastActivePage)
m_pPropWin->setCurrentPage(_sLastActivePage);
}
-void ODesignView::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection)
+void ODesignView::alignMarkedObjects(ControlModification _nControlModification,bool _bAlignAtSection)
{
m_aScrollWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection);
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 4ce1c6cec14c..01f3bde4ce2a 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2585,7 +2585,7 @@ void OReportController::executeMethodWithUndo(sal_uInt16 _nUndoStrId,const ::std
InvalidateFeature( SID_UNDO );
}
-void OReportController::alignControlsWithUndo(sal_uInt16 _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection)
+void OReportController::alignControlsWithUndo(sal_uInt16 _nUndoStrId, ControlModification _nControlModification, bool _bAlignAtSection)
{
const OUString sUndoAction = ModuleRes(_nUndoStrId);
UndoContext aUndoContext( getUndoManager(), sUndoAction );
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index c47b84ecadb2..510f455d2cd7 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -351,9 +351,8 @@ void OReportWindow::collapseSections(const uno::Sequence< css::beans::PropertyVa
m_aViewsWindow->collapseSections(_aCollpasedSections);
}
-void OReportWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection)
+void OReportWindow::alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection)
{
-
m_aViewsWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection);
}
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
index a2b73dc44662..f546a39afcf4 100644
--- a/reportdesign/source/ui/report/ScrollHelper.cxx
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -347,7 +347,7 @@ bool OScrollWindowHelper::EventNotify( NotifyEvent& rNEvt )
return OScrollWindowHelper_BASE::EventNotify(rNEvt);
}
-void OScrollWindowHelper::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection)
+void OScrollWindowHelper::alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection)
{
m_aReportWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection);
}
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 11c35bf2897c..1ea4502a5e44 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -55,7 +55,7 @@ namespace rptui
using namespace ::com::sun::star;
using namespace ::comphelper;
-bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _nYMov,SdrObject* _pObj,SdrView* _pView,sal_Int32 _nControlModification, bool _bBoundRects)
+bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _nYMov,SdrObject* _pObj,SdrView* _pView, ControlModification _nControlModification, bool _bBoundRects)
{
bool bMoveAllowed = _nXMov != 0 || _nYMov != 0;
if ( bMoveAllowed )
@@ -674,7 +674,7 @@ void OViewsWindow::collectRectangles(TRectangleMap& _rSortRectangles)
}
}
-void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles,sal_Int32 _nControlModification,bool _bAlignAtSection, tools::Rectangle& _rBound, tools::Rectangle& _rResize)
+void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles, ControlModification _nControlModification,bool _bAlignAtSection, tools::Rectangle& _rBound, tools::Rectangle& _rResize)
{
bool bOnlyOnce = false;
TRectangleMap::const_iterator aRectIter = _rSortRectangles.begin();
@@ -702,6 +702,7 @@ void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles,
if ( _rResize.getHeight() < aObjRect.getHeight() )
_rResize = aObjRect;
break;
+ default: break;
}
SdrObjTransformInfoRec aInfo;
@@ -737,7 +738,7 @@ void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles,
}
}
-void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection)
+void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification, bool _bAlignAtSection)
{
if ( _nControlModification == ControlModification::NONE )
return;