summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-29 13:39:26 +0200
committerNoel Grandin <noel@peralex.com>2016-08-30 08:40:03 +0200
commit15b084f2034dc892ef456f8c65f162c760c69fe8 (patch)
tree1e30ed2728712b3a40b052b56c15ccd2dcceb8d0 /dbaccess
parente27fbbcdf5fc1723297b22464d8291843f1b83a5 (diff)
convert DbGridControl::Option to scoped enum
Change-Id: I160fb53b585bb7eb04348dd208ec5c705d595279
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx12
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx6
2 files changed, 9 insertions, 9 deletions
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index af2612671873..8c745bb03610 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1577,8 +1577,8 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const
aReturn.bEnabled = true;
- sal_Int16 nGridMode = getBrowserView()->getVclControl()->GetOptions();
- aReturn.bChecked = nGridMode > DbGridControl::OPT_READONLY;
+ DbGridControlOptions nGridMode = getBrowserView()->getVclControl()->GetOptions();
+ aReturn.bChecked = nGridMode > DbGridControlOptions::Readonly;
}
break;
case ID_BROWSER_FILTERED:
@@ -1916,9 +1916,9 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
break;
case ID_BROWSER_EDITDOC:
{
- sal_Int16 nGridMode = getBrowserView()->getVclControl()->GetOptions();
- if (nGridMode == DbGridControl::OPT_READONLY)
- getBrowserView()->getVclControl()->SetOptions(DbGridControl::OPT_UPDATE | DbGridControl::OPT_INSERT | DbGridControl::OPT_DELETE);
+ DbGridControlOptions nGridMode = getBrowserView()->getVclControl()->GetOptions();
+ if (nGridMode == DbGridControlOptions::Readonly)
+ getBrowserView()->getVclControl()->SetOptions(DbGridControlOptions::Update | DbGridControlOptions::Insert | DbGridControlOptions::Delete);
// the options not supported by the data source will be removed automatically
else
{
@@ -1930,7 +1930,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property
if (GetState(ID_BROWSER_UNDORECORD).bEnabled)
Execute(ID_BROWSER_UNDORECORD,Sequence<PropertyValue>());
- getBrowserView()->getVclControl()->SetOptions(DbGridControl::OPT_READONLY);
+ getBrowserView()->getVclControl()->SetOptions(DbGridControlOptions::Readonly);
}
InvalidateFeature(ID_BROWSER_EDITDOC);
}
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 64c68b11b8b6..574eabe402c0 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -1065,7 +1065,7 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel )
// so the row contains data which has no counter part within the data source
long nCorrectRowCount = GetRowCount();
- if (GetOptions() & OPT_INSERT)
+ if (GetOptions() & DbGridControlOptions::Insert)
--nCorrectRowCount; // there is a empty row for inserting records
if (bCurrentRowVirtual)
--nCorrectRowCount;
@@ -1281,7 +1281,7 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt )
sal_uInt16 nCol = GetColumnAtXPosPixel(rEvt.maPosPixel.X(), false);
long nCorrectRowCount = GetRowCount();
- if (GetOptions() & OPT_INSERT)
+ if (GetOptions() & DbGridControlOptions::Insert)
--nCorrectRowCount; // there is a empty row for inserting records
if (IsCurrentAppending())
--nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one
@@ -1375,7 +1375,7 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt )
sal_uInt16 nCol = GetColumnAtXPosPixel(rEvt.maPosPixel.X(), false);
long nCorrectRowCount = GetRowCount();
- if (GetOptions() & OPT_INSERT)
+ if (GetOptions() & DbGridControlOptions::Insert)
--nCorrectRowCount; // there is a empty row for inserting records
if (IsCurrentAppending())
--nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one