diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-23 10:06:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-23 11:55:09 +0200 |
commit | a8b555a26067b48f4c1568d476613c5769eb7591 (patch) | |
tree | a290c6176632672c24666cc7d2147b8be90e7d9f /dbaccess | |
parent | convert CBTP constants to o3tl::typed_flags (diff) | |
download | core-a8b555a26067b48f4c1568d476613c5769eb7591.tar.gz core-a8b555a26067b48f4c1568d476613c5769eb7591.zip |
convert EF constants to o3tl::typed_flags
and remove now unused ByteVector typedef
Change-Id: I9c4b30aea2608cf97e597b00b4a4ea800efac4ec
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/dlg/paramdialog.cxx | 23 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/commontypes.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/paramdialog.hxx | 13 |
3 files changed, 22 insertions, 15 deletions
diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 534d5176fc37..c240f477b022 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -32,9 +32,6 @@ #include <tools/diagnose_ex.h> #include <unotools/syslocale.hxx> -#define EF_VISITED 0x0001 -#define EF_DIRTY 0x0002 - namespace dbaui { @@ -94,7 +91,7 @@ namespace dbaui pValues->Name = ::comphelper::getString(xParamAsSet->getPropertyValue(PROPERTY_NAME)); m_pAllParams->InsertEntry(pValues->Name); - m_aVisitedParams.push_back(0); + m_aVisitedParams.push_back(VisitFlags::NONE); // not visited, not dirty } @@ -165,7 +162,7 @@ namespace dbaui { if (m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND) { - if ( ( m_aVisitedParams[ m_nCurrentlySelected ] & EF_DIRTY ) == 0 ) + if ( !( m_aVisitedParams[ m_nCurrentlySelected ] & VisitFlags::Dirty ) ) // nothing to do, the value isn't dirty return false; } @@ -183,7 +180,7 @@ namespace dbaui { // with this the value isn't dirty anymore if (m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND) - m_aVisitedParams[m_nCurrentlySelected] &= ~EF_DIRTY; + m_aVisitedParams[m_nCurrentlySelected] &= ~VisitFlags::Dirty; } else { @@ -269,10 +266,10 @@ namespace dbaui // search the next entry in list we haven't visited yet sal_Int32 nNext = (nCurrent + 1) % nCount; - while ((nNext != nCurrent) && ( m_aVisitedParams[nNext] & EF_VISITED )) + while ((nNext != nCurrent) && ( m_aVisitedParams[nNext] & VisitFlags::Visited )) nNext = (nNext + 1) % nCount; - if ( m_aVisitedParams[nNext] & EF_VISITED ) + if ( m_aVisitedParams[nNext] & VisitFlags::Visited ) // there is no such "not visited yet" entry -> simply take the next one nNext = (nCurrent + 1) % nCount; @@ -320,7 +317,7 @@ namespace dbaui // with this the value isn't dirty OSL_ENSURE(static_cast<size_t>(m_nCurrentlySelected) < m_aVisitedParams.size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); - m_aVisitedParams[m_nCurrentlySelected] &= ~EF_DIRTY; + m_aVisitedParams[m_nCurrentlySelected] &= ~VisitFlags::Dirty; m_aResetVisitFlag.SetTimeout(1000); m_aResetVisitFlag.Start(); @@ -334,16 +331,16 @@ namespace dbaui // mark the currently selected entry as visited OSL_ENSURE(static_cast<size_t>(m_nCurrentlySelected) < m_aVisitedParams.size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); - m_aVisitedParams[m_nCurrentlySelected] |= EF_VISITED; + m_aVisitedParams[m_nCurrentlySelected] |= VisitFlags::Visited; // was it the last "not visited yet" entry ? - ByteVector::const_iterator aIter; + std::vector<VisitFlags>::const_iterator aIter; for ( aIter = m_aVisitedParams.begin(); aIter < m_aVisitedParams.end(); ++aIter ) { - if (((*aIter) & EF_VISITED) == 0) + if (!((*aIter) & VisitFlags::Visited)) break; } if (aIter == m_aVisitedParams.end()) @@ -378,7 +375,7 @@ namespace dbaui { // mark the currently selected entry as dirty OSL_ENSURE(static_cast<size_t>(m_nCurrentlySelected) < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); - m_aVisitedParams[m_nCurrentlySelected] |= EF_DIRTY; + m_aVisitedParams[m_nCurrentlySelected] |= VisitFlags::Dirty; m_bNeedErrorOnCurrent = true; } diff --git a/dbaccess/source/ui/inc/commontypes.hxx b/dbaccess/source/ui/inc/commontypes.hxx index 5779a7aa702a..18ba066f816a 100644 --- a/dbaccess/source/ui/inc/commontypes.hxx +++ b/dbaccess/source/ui/inc/commontypes.hxx @@ -37,7 +37,6 @@ namespace dbaui { typedef std::set<OUString> StringBag; - typedef std::vector<sal_Int8> ByteVector; typedef std::vector<OUString> StringArray; typedef ::utl::SharedUNOComponent< css::sdbc::XConnection > SharedConnection; diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index 43997f962efe..d8fa73c2205d 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -36,12 +36,23 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <connectivity/predicateinput.hxx> #include "svx/ParseContext.hxx" +#include <o3tl/typed_flags_set.hxx> namespace connectivity { class OSQLParseNode; } +enum class VisitFlags { + NONE = 0x00, + Visited = 0x01, + Dirty = 0x02, +}; +namespace o3tl { + template<> struct typed_flags<VisitFlags> : is_typed_flags<VisitFlags, 0x03> {}; +} + + namespace dbaui { @@ -69,7 +80,7 @@ namespace dbaui ::dbtools::OPredicateInputController m_aPredicateInput; - ByteVector m_aVisitedParams; + std::vector<VisitFlags> m_aVisitedParams; Timer m_aResetVisitFlag; // we reset the "visited flag" 1 second after and entry has been selected |