dbaccess/source/ui/app/AppController.cxx | 4 dbaccess/source/ui/app/AppControllerDnD.cxx | 2 dbaccess/source/ui/dlg/detailpages.cxx | 40 +++--- dbaccess/source/ui/dlg/detailpages.hxx | 20 +-- dbaccess/source/ui/dlg/dlgsave.cxx | 20 +-- dbaccess/source/ui/dlg/paramdialog.cxx | 23 +-- dbaccess/source/ui/inc/commontypes.hxx | 1 dbaccess/source/ui/inc/dlgsave.hxx | 20 +-- dbaccess/source/ui/inc/paramdialog.hxx | 13 +- dbaccess/source/ui/misc/UITools.cxx | 2 dbaccess/source/ui/querydesign/querycontroller.cxx | 2 editeng/source/editeng/editdoc.cxx | 2 editeng/source/editeng/editdoc.hxx | 23 ++- editeng/source/editeng/editeng.cxx | 17 +- editeng/source/editeng/impedit.hxx | 4 editeng/source/editeng/impedit2.cxx | 26 ++-- editeng/source/editeng/impedit3.cxx | 18 +- fpicker/source/office/OfficeControlAccess.cxx | 132 +++++++++------------ fpicker/source/office/OfficeControlAccess.hxx | 28 +++- fpicker/source/office/iodlg.cxx | 41 ++---- fpicker/source/office/iodlg.hxx | 17 ++ 21 files changed, 242 insertions(+), 213 deletions(-)
New commits: commit e77c931f44c91c40fd67863fd6c3c6c4167ad3ff Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 23 11:32:36 2016 +0200 convert FLT constants to o3tl::typed_flags and remove the unused ALLFILESFILTER value Change-Id: I4d7484ed2d9a5efacac652c6557f14caadd89d34 diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 4630e33..fc6418b 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -761,7 +761,7 @@ IMPL_LINK_NOARG( SvtFileDialog, NewFolderHdl_Impl, Button*, void) } } -bool SvtFileDialog::createNewUserFilter( const OUString& _rNewFilter ) +void SvtFileDialog::createNewUserFilter( const OUString& _rNewFilter ) { // delete the old user filter and create a new one DELETEZ( pImpl->_pUserFilter ); @@ -781,26 +781,17 @@ bool SvtFileDialog::createNewUserFilter( const OUString& _rNewFilter ) SetDefaultExt( pImpl->GetCurFilter( )->GetExtension() ); else EraseDefaultExt(); - - // outta here - return bIsAllFiles; } -#define FLT_NONEMPTY 0x0001 -#define FLT_CHANGED 0x0002 -#define FLT_USERFILTER 0x0004 -#define FLT_ALLFILESFILTER 0x0008 - - -sal_uInt16 SvtFileDialog::adjustFilter( const OUString& _rFilter ) +AdjustFilterFlags SvtFileDialog::adjustFilter( const OUString& _rFilter ) { - sal_uInt16 nReturn = 0; + AdjustFilterFlags nReturn = AdjustFilterFlags::NONE; const bool bNonEmpty = !_rFilter.isEmpty(); if ( bNonEmpty ) { - nReturn |= FLT_NONEMPTY; + nReturn |= AdjustFilterFlags::NonEmpty; bool bFilterChanged = true; @@ -812,17 +803,13 @@ sal_uInt16 SvtFileDialog::adjustFilter( const OUString& _rFilter ) pFilter = FindFilter_Impl( _rFilter, true, bFilterChanged ); if ( bFilterChanged ) - nReturn |= FLT_CHANGED; + nReturn |= AdjustFilterFlags::Changed; if ( !pFilter ) { - nReturn |= FLT_USERFILTER; + nReturn |= AdjustFilterFlags::UserFilter; // no filter found : use it as user defined filter - if ( createNewUserFilter( _rFilter ) ) - { // it's the "all files" filter - nReturn |= FLT_ALLFILESFILTER; - - } + createNewUserFilter( _rFilter ); } } @@ -946,8 +933,8 @@ void SvtFileDialog::OpenHdl_Impl(void* pVoid) return; // if a filter was retrieved, there were wildcards ! - sal_uInt16 nNewFilterFlags = adjustFilter( aFilter ); - if ( nNewFilterFlags & FLT_CHANGED ) + AdjustFilterFlags nNewFilterFlags = adjustFilter( aFilter ); + if ( nNewFilterFlags & AdjustFilterFlags::Changed ) { // cut off all text before wildcard in edit and select wildcard pImpl->_pEdFileName->SetText( aFilter ); @@ -1048,14 +1035,14 @@ void SvtFileDialog::OpenHdl_Impl(void* pVoid) } else { - if ( nNewFilterFlags & FLT_CHANGED ) + if ( nNewFilterFlags & AdjustFilterFlags::Changed ) ExecuteFilter(); } return; } } - else if ( !( nNewFilterFlags & FLT_NONEMPTY ) ) + else if ( !( nNewFilterFlags & AdjustFilterFlags::NonEmpty ) ) { // if applicable save URL _aPath = aFileName; @@ -1063,7 +1050,7 @@ void SvtFileDialog::OpenHdl_Impl(void* pVoid) else { // if applicable filter again - if ( nNewFilterFlags & FLT_CHANGED ) + if ( nNewFilterFlags & AdjustFilterFlags::Changed ) ExecuteFilter(); return; } @@ -1946,8 +1933,8 @@ short SvtFileDialog::PrepareExecute() if ( !IsolateFilterFromPath_Impl( _aPath, aFilter ) ) return 0; - sal_uInt16 nNewFilterFlags = adjustFilter( aFilter ); - if ( nNewFilterFlags & ( FLT_NONEMPTY | FLT_USERFILTER ) ) + AdjustFilterFlags nNewFilterFlags = adjustFilter( aFilter ); + if ( nNewFilterFlags & ( AdjustFilterFlags::NonEmpty | AdjustFilterFlags::UserFilter ) ) { pImpl->_pEdFileName->SetText( aFilter ); } diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index c76956b..cd9f3f2 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -40,6 +40,7 @@ #include <comphelper/configuration.hxx> #include <comphelper/processfactory.hxx> #include "fpdialogbase.hxx" +#include <o3tl/typed_flags_set.hxx> #include <set> @@ -51,6 +52,17 @@ class SvtURLBox; class SvtExpFileDlg_Impl; class CustomContainer; +enum class AdjustFilterFlags { + NONE = 0x0000, + NonEmpty = 0x0001, + Changed = 0x0002, + UserFilter = 0x0004, +}; +namespace o3tl { + template<> struct typed_flags<AdjustFilterFlags> : is_typed_flags<AdjustFilterFlags, 0x0007> {}; +} + + class SvtFileDialog : public SvtFileDialog_Base { private: @@ -238,11 +250,10 @@ private: /** updates _pUserFilter with a new filter <p>No checks for necessity are made.</p> - @return <TRUE/> if the new filter is "*.*" */ - bool createNewUserFilter( const OUString& _rNewFilter ); + void createNewUserFilter( const OUString& _rNewFilter ); - sal_uInt16 adjustFilter( const OUString& _rFilter ); + AdjustFilterFlags adjustFilter( const OUString& _rFilter ); // IFilePickerController, needed by OControlAccess virtual Control* getControl( sal_Int16 _nControlId, bool _bLabelControl = false ) const override; commit a31e1f1a3204b2265bfda9ab77d704a93bb40d51 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 23 11:22:08 2016 +0200 convert PROPERTY_FLAG to o3tl::typed_flags Change-Id: Ib652b83b1beed048cabce91aee22fc98605fd654 diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index c373cc9..a8ba821 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -49,21 +49,11 @@ namespace svt namespace { - #define PROPERTY_FLAG_TEXT 0x00000001 - #define PROPERTY_FLAG_ENDBALED 0x00000002 - #define PROPERTY_FLAG_VISIBLE 0x00000004 - #define PROPERTY_FLAG_HELPURL 0x00000008 - #define PROPERTY_FLAG_LISTITEMS 0x00000010 - #define PROPERTY_FLAG_SELECTEDITEM 0x00000020 - #define PROPERTY_FLAG_SELECTEDITEMINDEX 0x00000040 - #define PROPERTY_FLAG_CHECKED 0x00000080 - - struct ControlDescription { const sal_Char* pControlName; sal_Int16 nControlId; - sal_Int32 nPropertyFlags; + PropFlags nPropertyFlags; }; @@ -71,38 +61,38 @@ namespace svt typedef ::std::pair< ControlDescIterator, ControlDescIterator > ControlDescRange; - #define PROPERTY_FLAGS_COMMON ( PROPERTY_FLAG_ENDBALED | PROPERTY_FLAG_VISIBLE | PROPERTY_FLAG_HELPURL ) - #define PROPERTY_FLAGS_LISTBOX ( PROPERTY_FLAG_LISTITEMS | PROPERTY_FLAG_SELECTEDITEM | PROPERTY_FLAG_SELECTEDITEMINDEX ) - #define PROPERTY_FLAGS_CHECKBOX ( PROPERTY_FLAG_CHECKED | PROPERTY_FLAG_TEXT ) + #define PROPERTY_FLAGS_COMMON ( PropFlags::Enabled | PropFlags::Visible | PropFlags::HelpUrl ) + #define PROPERTY_FLAGS_LISTBOX ( PropFlags::ListItems | PropFlags::SelectedItem | PropFlags::SelectedItemIndex ) + #define PROPERTY_FLAGS_CHECKBOX ( PropFlags::Checked | PropFlags::Text ) // Note: this array MUST be sorted by name! static const ControlDescription aDescriptions[] = { { "AutoExtensionBox", CHECKBOX_AUTOEXTENSION, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX }, - { "CancelButton", PUSHBUTTON_CANCEL, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, - { "CurrentFolderText", FIXEDTEXT_CURRENTFOLDER, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, + { "CancelButton", PUSHBUTTON_CANCEL, PROPERTY_FLAGS_COMMON | PropFlags::Text }, + { "CurrentFolderText", FIXEDTEXT_CURRENTFOLDER, PROPERTY_FLAGS_COMMON | PropFlags::Text }, { "DefaultLocationButton", TOOLBOXBUTOON_DEFAULT_LOCATION, PROPERTY_FLAGS_COMMON }, - { "FileURLEdit", EDIT_FILEURL, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, - { "FileURLEditLabel", EDIT_FILEURL_LABEL, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, + { "FileURLEdit", EDIT_FILEURL, PROPERTY_FLAGS_COMMON | PropFlags::Text }, + { "FileURLEditLabel", EDIT_FILEURL_LABEL, PROPERTY_FLAGS_COMMON | PropFlags::Text }, { "FileView", CONTROL_FILEVIEW, PROPERTY_FLAGS_COMMON }, { "FilterList", LISTBOX_FILTER, PROPERTY_FLAGS_COMMON }, - { "FilterListLabel", LISTBOX_FILTER_LABEL, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, + { "FilterListLabel", LISTBOX_FILTER_LABEL, PROPERTY_FLAGS_COMMON | PropFlags::Text }, { "FilterOptionsBox", CHECKBOX_FILTEROPTIONS, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX }, - { "HelpButton", PUSHBUTTON_HELP, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, + { "HelpButton", PUSHBUTTON_HELP, PROPERTY_FLAGS_COMMON | PropFlags::Text }, { "ImageTemplateList", LISTBOX_IMAGE_TEMPLATE, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_LISTBOX }, - { "ImageTemplateListLabel", LISTBOX_IMAGE_TEMPLATE_LABEL, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, + { "ImageTemplateListLabel", LISTBOX_IMAGE_TEMPLATE_LABEL, PROPERTY_FLAGS_COMMON | PropFlags::Text }, { "LevelUpButton", TOOLBOXBUTOON_LEVEL_UP, PROPERTY_FLAGS_COMMON }, { "LinkBox", CHECKBOX_LINK, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX }, { "NewFolderButton", TOOLBOXBUTOON_NEW_FOLDER, PROPERTY_FLAGS_COMMON }, - { "OkButton", PUSHBUTTON_OK , PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, + { "OkButton", PUSHBUTTON_OK , PROPERTY_FLAGS_COMMON | PropFlags::Text }, { "PasswordBox", CHECKBOX_PASSWORD, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX }, - { "PlayButton", PUSHBUTTON_PLAY, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, + { "PlayButton", PUSHBUTTON_PLAY, PROPERTY_FLAGS_COMMON | PropFlags::Text }, { "PreviewBox", CHECKBOX_PREVIEW, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX }, { "ReadOnlyBox", CHECKBOX_READONLY, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX }, { "SelectionBox", CHECKBOX_SELECTION, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_CHECKBOX }, { "TemplateList", LISTBOX_TEMPLATE, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_LISTBOX }, - { "TemplateListLabel", LISTBOX_TEMPLATE_LABEL, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT }, + { "TemplateListLabel", LISTBOX_TEMPLATE_LABEL, PROPERTY_FLAGS_COMMON | PropFlags::Text }, { "VersionList", LISTBOX_VERSION, PROPERTY_FLAGS_COMMON | PROPERTY_FLAGS_LISTBOX }, - { "VersionListLabel", LISTBOX_VERSION_LABEL, PROPERTY_FLAGS_COMMON | PROPERTY_FLAG_TEXT } + { "VersionListLabel", LISTBOX_VERSION_LABEL, PROPERTY_FLAGS_COMMON | PropFlags::Text } }; @@ -124,21 +114,21 @@ namespace svt struct ControlProperty { const sal_Char* pPropertyName; - sal_Int16 nPropertyId; + PropFlags nPropertyId; }; typedef const ControlProperty* ControlPropertyIterator; static const ControlProperty aProperties[] = { - { "Text", PROPERTY_FLAG_TEXT }, - { "Enabled", PROPERTY_FLAG_ENDBALED }, - { "Visible", PROPERTY_FLAG_VISIBLE }, - { "HelpURL", PROPERTY_FLAG_HELPURL }, - { "ListItems", PROPERTY_FLAG_LISTITEMS }, - { "SelectedItem", PROPERTY_FLAG_SELECTEDITEM }, - { "SelectedItemIndex", PROPERTY_FLAG_SELECTEDITEMINDEX }, - { "Checked", PROPERTY_FLAG_CHECKED } + { "Text", PropFlags::Text }, + { "Enabled", PropFlags::Enabled }, + { "Visible", PropFlags::Visible }, + { "HelpURL", PropFlags::HelpUrl }, + { "ListItems", PropFlags::ListItems }, + { "SelectedItem", PropFlags::SelectedItem }, + { "SelectedItemIndex", PropFlags::SelectedItemIndex }, + { "Checked", PropFlags::Checked } }; @@ -217,7 +207,7 @@ namespace svt { // look up the control sal_Int16 nControlId = -1; - sal_Int32 nPropertyMask = 0; + PropFlags nPropertyMask = PropFlags::NONE; Control* pControl = implGetControl( _rControlName, &nControlId, &nPropertyMask ); // will throw an IllegalArgumentException if the name is not valid @@ -227,7 +217,7 @@ namespace svt // it's a completely unknown property lcl_throwIllegalArgumentException(); - if ( 0 == ( nPropertyMask & aPropDesc->nPropertyId ) ) + if ( !( nPropertyMask & aPropDesc->nPropertyId ) ) // it's a property which is known, but not allowed for this control lcl_throwIllegalArgumentException(); @@ -235,7 +225,7 @@ namespace svt } - Control* OControlAccess::implGetControl( const OUString& _rControlName, sal_Int16* _pId, sal_Int32* _pPropertyMask ) const + Control* OControlAccess::implGetControl( const OUString& _rControlName, sal_Int16* _pId, PropFlags* _pPropertyMask ) const { Control* pControl = nullptr; ControlDescription tmpDesc; @@ -301,7 +291,7 @@ namespace svt Sequence< OUString > OControlAccess::getSupportedControlProperties( const OUString& _rControlName ) { sal_Int16 nControlId = -1; - sal_Int32 nPropertyMask = 0; + PropFlags nPropertyMask = PropFlags::NONE; implGetControl( _rControlName, &nControlId, &nPropertyMask ); // will throw an IllegalArgumentException if the name is not valid @@ -310,7 +300,7 @@ namespace svt OUString* pProperty = aProps.getArray(); for ( ControlPropertyIterator aProp = s_pProperties; aProp != s_pPropertiesEnd; ++aProp ) - if ( 0 != ( nPropertyMask & aProp->nPropertyId ) ) + if ( nPropertyMask & aProp->nPropertyId ) *pProperty++ = OUString::createFromAscii( aProp->pPropertyName ); aProps.realloc( pProperty - aProps.getArray() ); @@ -331,7 +321,7 @@ namespace svt { // look up the control sal_Int16 nControlId = -1; - sal_Int32 nPropertyMask = 0; + PropFlags nPropertyMask = PropFlags::NONE; implGetControl( _rControlName, &nControlId, &nPropertyMask ); // will throw an IllegalArgumentException if the name is not valid @@ -341,7 +331,7 @@ namespace svt // it's a property which is completely unknown return false; - return 0 != ( aPropDesc->nPropertyId & nPropertyMask ); + return bool( aPropDesc->nPropertyId & nPropertyMask ); } @@ -351,10 +341,10 @@ namespace svt DBG_ASSERT( pControl, "OControlAccess::SetValue: don't have this control in the current mode!" ); if ( pControl ) { - sal_Int16 nPropertyId = -1; + PropFlags nPropertyId = PropFlags::Unknown; if ( ControlActions::SET_HELP_URL == _nControlAction ) { - nPropertyId = PROPERTY_FLAG_HELPURL; + nPropertyId = PropFlags::HelpUrl; } else { @@ -367,7 +357,7 @@ namespace svt case CHECKBOX_LINK: case CHECKBOX_PREVIEW: case CHECKBOX_SELECTION: - nPropertyId = PROPERTY_FLAG_CHECKED; + nPropertyId = PropFlags::Checked; break; case LISTBOX_FILTER: @@ -379,7 +369,7 @@ namespace svt case LISTBOX_IMAGE_TEMPLATE: if ( ControlActions::SET_SELECT_ITEM == _nControlAction ) { - nPropertyId = PROPERTY_FLAG_SELECTEDITEMINDEX; + nPropertyId = PropFlags::SelectedItemIndex; } else { @@ -390,7 +380,7 @@ namespace svt } } - if ( -1 != nPropertyId ) + if ( PropFlags::Unknown != nPropertyId ) implSetControlProperty( _nControlId, pControl, nPropertyId, _rValue ); } } @@ -404,10 +394,10 @@ namespace svt DBG_ASSERT( pControl, "OControlAccess::GetValue: don't have this control in the current mode!" ); if ( pControl ) { - sal_Int16 nPropertyId = -1; + PropFlags nPropertyId = PropFlags::Unknown; if ( ControlActions::SET_HELP_URL == _nControlAction ) { - nPropertyId = PROPERTY_FLAG_HELPURL; + nPropertyId = PropFlags::HelpUrl; } else { @@ -420,7 +410,7 @@ namespace svt case CHECKBOX_LINK: case CHECKBOX_PREVIEW: case CHECKBOX_SELECTION: - nPropertyId = PROPERTY_FLAG_CHECKED; + nPropertyId = PropFlags::Checked; break; case LISTBOX_FILTER: @@ -440,13 +430,13 @@ namespace svt switch ( _nControlAction ) { case ControlActions::GET_SELECTED_ITEM: - nPropertyId = PROPERTY_FLAG_SELECTEDITEM; + nPropertyId = PropFlags::SelectedItem; break; case ControlActions::GET_SELECTED_ITEM_INDEX: - nPropertyId = PROPERTY_FLAG_SELECTEDITEMINDEX; + nPropertyId = PropFlags::SelectedItemIndex; break; case ControlActions::GET_ITEMS: - nPropertyId = PROPERTY_FLAG_LISTITEMS; + nPropertyId = PropFlags::ListItems; break; default: SAL_WARN( "fpicker.office", "OControlAccess::GetValue: invalid control action for the listbox!" ); @@ -456,7 +446,7 @@ namespace svt } } - if ( -1 != nPropertyId ) + if ( PropFlags::Unknown != nPropertyId ) aRet = implGetControlProperty( pControl, nPropertyId ); } @@ -536,7 +526,7 @@ namespace svt } - void OControlAccess::implSetControlProperty( sal_Int16 _nControlId, Control* _pControl, sal_Int16 _nProperty, const Any& _rValue, bool _bIgnoreIllegalArgument ) + void OControlAccess::implSetControlProperty( sal_Int16 _nControlId, Control* _pControl, PropFlags _nProperty, const Any& _rValue, bool _bIgnoreIllegalArgument ) { if ( !_pControl ) _pControl = m_pFilePickerController->getControl( _nControlId ); @@ -549,7 +539,7 @@ namespace svt switch ( _nProperty ) { - case PROPERTY_FLAG_TEXT: + case PropFlags::Text: { OUString sText; if ( _rValue >>= sText ) @@ -563,7 +553,7 @@ namespace svt } break; - case PROPERTY_FLAG_ENDBALED: + case PropFlags::Enabled: { bool bEnabled = false; if ( _rValue >>= bEnabled ) @@ -577,7 +567,7 @@ namespace svt } break; - case PROPERTY_FLAG_VISIBLE: + case PropFlags::Visible: { bool bVisible = false; if ( _rValue >>= bVisible ) @@ -591,7 +581,7 @@ namespace svt } break; - case PROPERTY_FLAG_HELPURL: + case PropFlags::HelpUrl: { OUString sHelpURL; if ( _rValue >>= sHelpURL ) @@ -605,7 +595,7 @@ namespace svt } break; - case PROPERTY_FLAG_LISTITEMS: + case PropFlags::ListItems: { DBG_ASSERT( WINDOW_LISTBOX == _pControl->GetType(), "OControlAccess::implSetControlProperty: invalid control/property combination!" ); @@ -635,7 +625,7 @@ namespace svt } break; - case PROPERTY_FLAG_SELECTEDITEM: + case PropFlags::SelectedItem: { DBG_ASSERT( WINDOW_LISTBOX == _pControl->GetType(), "OControlAccess::implSetControlProperty: invalid control/property combination!" ); @@ -652,7 +642,7 @@ namespace svt } break; - case PROPERTY_FLAG_SELECTEDITEMINDEX: + case PropFlags::SelectedItemIndex: { DBG_ASSERT( WINDOW_LISTBOX == _pControl->GetType(), "OControlAccess::implSetControlProperty: invalid control/property combination!" ); @@ -669,7 +659,7 @@ namespace svt } break; - case PROPERTY_FLAG_CHECKED: + case PropFlags::Checked: { DBG_ASSERT( WINDOW_CHECKBOX == _pControl->GetType(), "OControlAccess::implSetControlProperty: invalid control/property combination!" ); @@ -692,30 +682,30 @@ namespace svt } - Any OControlAccess::implGetControlProperty( Control* _pControl, sal_Int16 _nProperty ) const + Any OControlAccess::implGetControlProperty( Control* _pControl, PropFlags _nProperty ) const { DBG_ASSERT( _pControl, "OControlAccess::implGetControlProperty: invalid argument, this will crash!" ); Any aReturn; switch ( _nProperty ) { - case PROPERTY_FLAG_TEXT: + case PropFlags::Text: aReturn <<= OUString( _pControl->GetText() ); break; - case PROPERTY_FLAG_ENDBALED: + case PropFlags::Enabled: aReturn <<= _pControl->IsEnabled(); break; - case PROPERTY_FLAG_VISIBLE: + case PropFlags::Visible: aReturn <<= _pControl->IsVisible(); break; - case PROPERTY_FLAG_HELPURL: + case PropFlags::HelpUrl: aReturn <<= getHelpURL( _pControl, m_pFileView == _pControl ); break; - case PROPERTY_FLAG_LISTITEMS: + case PropFlags::ListItems: { DBG_ASSERT( WINDOW_LISTBOX == _pControl->GetType(), "OControlAccess::implGetControlProperty: invalid control/property combination!" ); @@ -729,7 +719,7 @@ namespace svt } break; - case PROPERTY_FLAG_SELECTEDITEM: + case PropFlags::SelectedItem: { DBG_ASSERT( WINDOW_LISTBOX == _pControl->GetType(), "OControlAccess::implGetControlProperty: invalid control/property combination!" ); @@ -742,7 +732,7 @@ namespace svt } break; - case PROPERTY_FLAG_SELECTEDITEMINDEX: + case PropFlags::SelectedItemIndex: { DBG_ASSERT( WINDOW_LISTBOX == _pControl->GetType(), "OControlAccess::implGetControlProperty: invalid control/property combination!" ); @@ -755,7 +745,7 @@ namespace svt } break; - case PROPERTY_FLAG_CHECKED: + case PropFlags::Checked: DBG_ASSERT( WINDOW_CHECKBOX == _pControl->GetType(), "OControlAccess::implGetControlProperty: invalid control/property combination!" ); diff --git a/fpicker/source/office/OfficeControlAccess.hxx b/fpicker/source/office/OfficeControlAccess.hxx index 91fd79b..7c3724e 100644 --- a/fpicker/source/office/OfficeControlAccess.hxx +++ b/fpicker/source/office/OfficeControlAccess.hxx @@ -24,6 +24,24 @@ #include <vcl/lstbox.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include "pickercallbacks.hxx" +#include <o3tl/typed_flags_set.hxx> + + +enum class PropFlags { + Unknown = -1, // used as an error sentinel + NONE = 0x0000, + Text = 0x0001, + Enabled = 0x0002, + Visible = 0x0004, + HelpUrl = 0x0008, + ListItems = 0x0010, + SelectedItem = 0x0020, + SelectedItemIndex = 0x0040, + Checked = 0x0080, +}; +namespace o3tl { + template<> struct typed_flags<PropFlags> : is_typed_flags<PropFlags, 0x00ff> {}; +} namespace svt @@ -79,7 +97,7 @@ namespace svt the affected control. Must be the same as referred by <arg>_nControlId</arg>, or NULL. @param _nProperty the property to set - See PROPERTY_FLAG_* + See PropFlags::* @param _rValue the value to set @param _bIgnoreIllegalArgument @@ -87,10 +105,10 @@ namespace svt */ void implSetControlProperty( sal_Int16 _nControlId, - Control* _pControl, sal_Int16 _nProperty, const css::uno::Any& _rValue, + Control* _pControl, PropFlags _nProperty, const css::uno::Any& _rValue, bool _bIgnoreIllegalArgument = true ); - Control* implGetControl( const OUString& _rControlName, sal_Int16* _pId, sal_Int32* _pPropertyMask = nullptr ) const; + Control* implGetControl( const OUString& _rControlName, sal_Int16* _pId, PropFlags* _pPropertyMask = nullptr ) const; /** implements the various methods for retrieving properties from controls @@ -99,10 +117,10 @@ namespace svt @PRECOND not <NULL/> @param _nProperty the property to retrieve - See PROPERTY_FLAG_* + See PropFlags::* @return */ - css::uno::Any implGetControlProperty( Control* _pControl, sal_Int16 _nProperty ) const; + css::uno::Any implGetControlProperty( Control* _pControl, PropFlags _nProperty ) const; static void implDoListboxAction( ListBox* _pListbox, sal_Int16 _nCtrlAction, const css::uno::Any& _rValue ); commit 76ab8c76daa57d21288c3a90f017ea5ae51db564 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 23 10:41:39 2016 +0200 replace CHAR flags with o3tl::typed_flags the usage of which looks a little dodgy, because this is a bitmask, but it's using == everywhere to check them Change-Id: I8e57d4f943a9048cc457a376ffbdfde0cffe22dd diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index a7a73ce..fe4ae42 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -527,7 +527,7 @@ ExtraPortionInfo::ExtraPortionInfo() , nWidthFullCompression(0) , nPortionOffsetX(0) , nMaxCompression100thPercent(0) -, nAsianCompressionTypes(0) +, nAsianCompressionTypes(AsianCompressionFlags::Normal) , bFirstCharIsRightPunktuation(false) , bCompressed(false) , pOrgDXArray(nullptr) diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index fb1eb18..5d0e6f5 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -30,6 +30,7 @@ #include <svl/itempool.hxx> #include <svl/languageoptions.hxx> #include <tools/lineend.hxx> +#include <o3tl/typed_flags_set.hxx> #include <deque> #include <memory> @@ -342,10 +343,16 @@ enum class DeleteMode { Simple, RestOfWord, RestOfContent }; -#define CHAR_NORMAL 0x00 -#define CHAR_KANA 0x01 -#define CHAR_PUNCTUATIONLEFT 0x02 -#define CHAR_PUNCTUATIONRIGHT 0x04 +enum class AsianCompressionFlags { + Normal = 0x00, + Kana = 0x01, + PunctuationLeft = 0x02, + PunctuationRight = 0x04, +}; +namespace o3tl { + template<> struct typed_flags<AsianCompressionFlags> : is_typed_flags<AsianCompressionFlags, 0x07> {}; +} + // struct ExtraPortionInfos @@ -359,7 +366,7 @@ struct ExtraPortionInfo sal_uInt16 nMaxCompression100thPercent; - sal_uInt8 nAsianCompressionTypes; + AsianCompressionFlags nAsianCompressionTypes; bool bFirstCharIsRightPunktuation; bool bCompressed; diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 45216e5..6f97901 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -1216,7 +1216,7 @@ inline vcl::Cursor* ImpEditView::GetCursor() void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit ); void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const MapUnit* pSourceUnit = nullptr, const MapUnit* pDestUnit = nullptr ); -sal_uInt8 GetCharTypeForCompression( sal_Unicode cChar ); +AsianCompressionFlags GetCharTypeForCompression( sal_Unicode cChar ); Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin ); #endif // INCLUDED_EDITENG_SOURCE_EDITENG_IMPEDIT_HXX diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 4bfb92c..f3ed14f 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -3970,10 +3970,10 @@ long ImpEditEngine::GetXPos( if ( rPortion.GetExtraInfos() && rPortion.GetExtraInfos()->bCompressed ) { nX += rPortion.GetExtraInfos()->nPortionOffsetX; - if ( rPortion.GetExtraInfos()->nAsianCompressionTypes & CHAR_PUNCTUATIONRIGHT ) + if ( rPortion.GetExtraInfos()->nAsianCompressionTypes & AsianCompressionFlags::PunctuationRight ) { - sal_uInt8 nType = GetCharTypeForCompression( pParaPortion->GetNode()->GetChar( nIndex ) ); - if ( nType == CHAR_PUNCTUATIONRIGHT && !pLine->GetCharPosArray().empty() ) + AsianCompressionFlags nType = GetCharTypeForCompression( pParaPortion->GetNode()->GetChar( nIndex ) ); + if ( nType == AsianCompressionFlags::PunctuationRight && !pLine->GetCharPosArray().empty() ) { sal_Int32 n = nIndex - nTextPortionStart; const long* pDXArray = &pLine->GetCharPosArray()[0]+( nTextPortionStart-pLine->GetStart() ); @@ -3981,9 +3981,9 @@ long ImpEditEngine::GetXPos( - ( n ? pDXArray[n-1] : 0 ); if ( (n+1) < rPortion.GetLen() ) { - // smaller, when char behind is CHAR_PUNCTUATIONRIGHT also + // smaller, when char behind is AsianCompressionFlags::PunctuationRight also nType = GetCharTypeForCompression( pParaPortion->GetNode()->GetChar( nIndex+1 ) ); - if ( nType == CHAR_PUNCTUATIONRIGHT ) + if ( nType == AsianCompressionFlags::PunctuationRight ) { sal_Int32 nNextCharWidth = ( ( (n+2) < rPortion.GetLen() ) ? pDXArray[n+1] : rPortion.GetSize().Width() ) - pDXArray[n]; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 81ef5db..ca66d6b 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -128,7 +128,7 @@ Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin ) return aTranslatedPos; } -sal_uInt8 GetCharTypeForCompression( sal_Unicode cChar ) +AsianCompressionFlags GetCharTypeForCompression( sal_Unicode cChar ) { switch ( cChar ) { @@ -136,18 +136,18 @@ sal_uInt8 GetCharTypeForCompression( sal_Unicode cChar ) case 0x3010: case 0x3014: case 0x3016: case 0x3018: case 0x301A: case 0x301D: { - return CHAR_PUNCTUATIONRIGHT; + return AsianCompressionFlags::PunctuationRight; } case 0x3001: case 0x3002: case 0x3009: case 0x300B: case 0x300D: case 0x300F: case 0x3011: case 0x3015: case 0x3017: case 0x3019: case 0x301B: case 0x301E: case 0x301F: { - return CHAR_PUNCTUATIONLEFT; + return AsianCompressionFlags::PunctuationLeft; } default: { - return ( ( 0x3040 <= cChar ) && ( 0x3100 > cChar ) ) ? CHAR_KANA : CHAR_NORMAL; + return ( ( 0x3040 <= cChar ) && ( 0x3100 > cChar ) ) ? AsianCompressionFlags::Kana : AsianCompressionFlags::Normal; } } } @@ -4287,10 +4287,10 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, sal_Int32 nPortionLen = pTextPortion->GetLen(); for ( sal_Int32 n = 0; n < nPortionLen; n++ ) { - sal_uInt8 nType = GetCharTypeForCompression( pNode->GetChar( n+nStartPos ) ); + AsianCompressionFlags nType = GetCharTypeForCompression( pNode->GetChar( n+nStartPos ) ); - bool bCompressPunctuation = ( nType == CHAR_PUNCTUATIONLEFT ) || ( nType == CHAR_PUNCTUATIONRIGHT ); - bool bCompressKana = ( nType == CHAR_KANA ) && ( GetAsianCompressionMode() == text::CharacterCompressionType::PUNCTUATION_AND_KANA ); + bool bCompressPunctuation = ( nType == AsianCompressionFlags::PunctuationLeft ) || ( nType == AsianCompressionFlags::PunctuationRight ); + bool bCompressKana = ( nType == AsianCompressionFlags::Kana ) && ( GetAsianCompressionMode() == text::CharacterCompressionType::PUNCTUATION_AND_KANA ); // create Extra infos only if needed... if ( bCompressPunctuation || bCompressKana ) @@ -4300,7 +4300,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, ExtraPortionInfo* pExtraInfos = new ExtraPortionInfo; pTextPortion->SetExtraInfos( pExtraInfos ); pExtraInfos->nOrgWidth = pTextPortion->GetSize().Width(); - pExtraInfos->nAsianCompressionTypes = CHAR_NORMAL; + pExtraInfos->nAsianCompressionTypes = AsianCompressionFlags::Normal; } pTextPortion->GetExtraInfos()->nMaxCompression100thPercent = n100thPercentFromMax; pTextPortion->GetExtraInfos()->nAsianCompressionTypes |= nType; @@ -4350,7 +4350,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, if ( !pTextPortion->GetExtraInfos()->pOrgDXArray ) pTextPortion->GetExtraInfos()->SaveOrgDXArray( pDXArray, pTextPortion->GetLen()-1 ); - if ( nType == CHAR_PUNCTUATIONRIGHT ) + if ( nType == AsianCompressionFlags::PunctuationRight ) { // If it's the first char, I must handle it in Paint()... if ( n ) commit 84e3e6ee04c2be0f8fa3a43c8c55bad6b6504f65 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 23 10:28:46 2016 +0200 convert DELMODE to scoped enum Change-Id: Idd3f45adb43930358420dba464dbdb88fe27b91d diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index 51b9ac2..fb1eb18 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -338,9 +338,9 @@ enum class PortionKind HYPHENATOR = 4 }; -#define DELMODE_SIMPLE 0 -#define DELMODE_RESTOFWORD 1 -#define DELMODE_RESTOFCONTENT 2 +enum class DeleteMode { + Simple, RestOfWord, RestOfContent +}; #define CHAR_NORMAL 0x00 #define CHAR_KANA 0x01 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 11912f6..e4b0fb0 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1140,30 +1140,31 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v break; } - sal_uInt8 nDel = 0, nMode = 0; + sal_uInt8 nDel = 0; + DeleteMode nMode = DeleteMode::Simple; switch( nCode ) { case css::awt::Key::DELETE_WORD_BACKWARD: - nMode = DELMODE_RESTOFWORD; + nMode = DeleteMode::RestOfWord; nDel = DEL_LEFT; break; case css::awt::Key::DELETE_WORD_FORWARD: - nMode = DELMODE_RESTOFWORD; + nMode = DeleteMode::RestOfWord; nDel = DEL_RIGHT; break; case css::awt::Key::DELETE_TO_BEGIN_OF_PARAGRAPH: - nMode = DELMODE_RESTOFCONTENT; + nMode = DeleteMode::RestOfContent; nDel = DEL_LEFT; break; case css::awt::Key::DELETE_TO_END_OF_PARAGRAPH: - nMode = DELMODE_RESTOFCONTENT; + nMode = DeleteMode::RestOfContent; nDel = DEL_RIGHT; break; default: nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT; - nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE; - if ( ( nMode == DELMODE_RESTOFWORD ) && rKeyEvent.GetKeyCode().IsShift() ) - nMode = DELMODE_RESTOFCONTENT; + nMode = rKeyEvent.GetKeyCode().IsMod1() ? DeleteMode::RestOfWord : DeleteMode::Simple; + if ( ( nMode == DeleteMode::RestOfWord ) && rKeyEvent.GetKeyCode().IsShift() ) + nMode = DeleteMode::RestOfContent; break; } diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 2909167..45216e5 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -795,7 +795,7 @@ public: EditPaM InsertTextUserInput( const EditSelection& rCurEditSelection, sal_Unicode c, bool bOverwrite ); EditPaM InsertText(const EditSelection& aCurEditSelection, const OUString& rStr); EditPaM AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, bool bOverwrite, vcl::Window* pFrameWin = nullptr ); - EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, sal_uInt8 nMode, sal_uInt8 nDelMode ); + EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, sal_uInt8 nMode, DeleteMode nDelMode ); EditPaM InsertParaBreak(const EditSelection& rEditSelection); EditPaM InsertLineBreak(const EditSelection& aEditSelection); EditPaM InsertTab(const EditSelection& rEditSelection); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 43934f2..4bfb92c 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2267,7 +2267,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR return aPaM; } -EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 nMode, sal_uInt8 nDelMode ) +EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 nMode, DeleteMode nDelMode ) { OSL_ENSURE( !EditSelection( rSel ).DbgIsBuggy( aEditDoc ), "Index out of range in DeleteLeftOrRight" ); @@ -2279,11 +2279,11 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n EditPaM aDelEnd( aCurPos ); if ( nMode == DEL_LEFT ) { - if ( nDelMode == DELMODE_SIMPLE ) + if ( nDelMode == DeleteMode::Simple ) { aDelStart = CursorLeft( aCurPos, i18n::CharacterIteratorMode::SKIPCHARACTER ); } - else if ( nDelMode == DELMODE_RESTOFWORD ) + else if ( nDelMode == DeleteMode::RestOfWord ) { aDelStart = StartOfWord( aCurPos ); if ( aDelStart.GetIndex() == aCurPos.GetIndex() ) @@ -2303,11 +2303,11 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n } else { - if ( nDelMode == DELMODE_SIMPLE ) + if ( nDelMode == DeleteMode::Simple ) { aDelEnd = CursorRight( aCurPos ); } - else if ( nDelMode == DELMODE_RESTOFWORD ) + else if ( nDelMode == DeleteMode::RestOfWord ) { aDelEnd = EndOfWord( aCurPos ); @@ -2355,12 +2355,12 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n } // ConnectParagraphs not enough for different Nodes when - // DELMODE_RESTOFCONTENT. - if ( ( nDelMode == DELMODE_RESTOFCONTENT ) || ( aDelStart.GetNode() == aDelEnd.GetNode() ) ) + // DeleteMode::RestOfContent. + if ( ( nDelMode == DeleteMode::RestOfContent ) || ( aDelStart.GetNode() == aDelEnd.GetNode() ) ) return ImpDeleteSelection( EditSelection( aDelStart, aDelEnd ) ); // Decide now if to delete selection (RESTOFCONTENTS) - bool bSpecialBackward = ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE ); + bool bSpecialBackward = ( nMode == DEL_LEFT ) && ( nDelMode == DeleteMode::Simple ); if ( aStatus.IsAnyOutliner() ) bSpecialBackward = false; commit ba9b0fb78ab7492839c6127607f9d5a9b3927ed2 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 23 10:23:47 2016 +0200 convert SAD constants to o3tl::typed_flags and drop unused SAD_TITLE_STORE_AS Change-Id: I5114958b3954e3dc3ffd941334c6c4dbfbed7aea diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index fb61802..2c7f63f 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -2066,7 +2066,7 @@ void OApplicationController::renameEntry() pNameChecker.reset( new HierarchicalNameCheck( xHNames.get(), OUString() ) ); aDialog.reset( VclPtr<OSaveAsDlg>::Create( - getView(), getORB(), sName, sLabel, *pNameChecker, SAD_TITLE_RENAME ) ); + getView(), getORB(), sName, sLabel, *pNameChecker, SADFlags::TitleRename ) ); } } } @@ -2087,7 +2087,7 @@ void OApplicationController::renameEntry() aDialog.reset( VclPtr<OSaveAsDlg>::Create( getView(), nCommandType, getORB(), getConnection(), - *aList.begin(), *pNameChecker, SAD_TITLE_RENAME ) ); + *aList.begin(), *pNameChecker, SADFlags::TitleRename ) ); } break; default: diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 819cbf6..3572a4f 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -694,7 +694,7 @@ bool OApplicationController::paste( ElementType _eType, const svx::ODataAccessDe getConnection(), sTargetName, aNameChecker, - SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS ); + SADFlags::AdditionalDescription | SADFlags::TitlePasteAs ); if ( RET_OK != aAskForName->Execute() ) // cancelled by the user return false; diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index 37d1cb5..1ab5b91 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -62,17 +62,17 @@ public: const IObjectNameCheck& m_rObjectNameCheck; css::uno::Reference< css::sdbc::XDatabaseMetaData> m_xMetaData; sal_Int32 m_nType; - sal_Int32 m_nFlags; + SADFlags m_nFlags; OSaveAsDlgImpl( OSaveAsDlg* pParent, sal_Int32 _rType, const css::uno::Reference< css::sdbc::XConnection>& _xConnection, const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, - sal_Int32 _nFlags); + SADFlags _nFlags); OSaveAsDlgImpl( OSaveAsDlg* pParent, const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, - sal_Int32 _nFlags); + SADFlags _nFlags); }; } // dbaui @@ -82,7 +82,7 @@ OSaveAsDlgImpl::OSaveAsDlgImpl(OSaveAsDlg* pParent, const Reference< XConnection>& _xConnection, const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, - sal_Int32 _nFlags) + SADFlags _nFlags) : m_aQryLabel(ModuleRes(STR_QRY_LABEL)) , m_sTblLabel(ModuleRes(STR_TBL_LABEL)) , m_aName(rDefault) @@ -116,7 +116,7 @@ OSaveAsDlgImpl::OSaveAsDlgImpl(OSaveAsDlg* pParent, OSaveAsDlgImpl::OSaveAsDlgImpl(OSaveAsDlg* pParent, const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, - sal_Int32 _nFlags) + SADFlags _nFlags) : m_aQryLabel(ModuleRes(STR_QRY_LABEL)) , m_sTblLabel(ModuleRes(STR_TBL_LABEL)) , m_aName(rDefault) @@ -175,7 +175,7 @@ OSaveAsDlg::OSaveAsDlg( vcl::Window * pParent, const Reference< XConnection>& _xConnection, const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, - sal_Int32 _nFlags) + SADFlags _nFlags) : ModalDialog(pParent, "SaveDialog", "dbaccess/ui/savedialog.ui") , m_xContext( _rxContext ) { @@ -257,7 +257,7 @@ OSaveAsDlg::OSaveAsDlg( vcl::Window * pParent, const OUString& rDefault, const OUString& _sLabel, const IObjectNameCheck& _rObjectNameCheck, - sal_Int32 _nFlags) + SADFlags _nFlags) : ModalDialog(pParent, "SaveDialog", "dbaccess/ui/savedialog.ui") , m_xContext( _rxContext ) { @@ -324,14 +324,14 @@ void OSaveAsDlg::implInitOnlyTitle(const OUString& _rLabel) void OSaveAsDlg::implInit() { - if ( 0 == ( m_pImpl->m_nFlags & SAD_ADDITIONAL_DESCRIPTION ) ) { + if ( !( m_pImpl->m_nFlags & SADFlags::AdditionalDescription ) ) { // hide the description window m_pImpl->m_pDescription->Hide(); } - if ( SAD_TITLE_PASTE_AS == ( m_pImpl->m_nFlags & SAD_TITLE_PASTE_AS ) ) + if ( SADFlags::TitlePasteAs == ( m_pImpl->m_nFlags & SADFlags::TitlePasteAs ) ) SetText( ModuleRes( STR_TITLE_PASTE_AS ) ); - else if ( SAD_TITLE_RENAME == ( m_pImpl->m_nFlags & SAD_TITLE_RENAME ) ) + else if ( SADFlags::TitleRename == ( m_pImpl->m_nFlags & SADFlags::TitleRename ) ) SetText( ModuleRes( STR_TITLE_RENAME ) ); m_pImpl->m_pPB_OK->SetClickHdl(LINK(this,OSaveAsDlg,ButtonClickHdl)); diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx index 257117f..78149bd 100644 --- a/dbaccess/source/ui/inc/dlgsave.hxx +++ b/dbaccess/source/ui/inc/dlgsave.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <vcl/msgbox.hxx> #include <memory> +#include <o3tl/typed_flags_set.hxx> namespace com { namespace sun { namespace star { namespace sdbc { @@ -33,13 +34,16 @@ namespace com { namespace sun { namespace star { } }}} +enum class SADFlags { + NONE = 0x0000, + AdditionalDescription = 0x0001, + TitlePasteAs = 0x0100, + TitleRename = 0x0200, +}; +namespace o3tl { + template<> struct typed_flags<SADFlags> : is_typed_flags<SADFlags, 0x0301> {}; +} -#define SAD_DEFAULT 0x0000 -#define SAD_ADDITIONAL_DESCRIPTION 0x0001 - -#define SAD_TITLE_STORE_AS 0x0000 -#define SAD_TITLE_PASTE_AS 0x0100 -#define SAD_TITLE_RENAME 0x0200 class Button; class Edit; @@ -58,14 +62,14 @@ namespace dbaui const css::uno::Reference< css::sdbc::XConnection>& _xConnection, const OUString& rDefault, const IObjectNameCheck& _rObjectNameCheck, - sal_Int32 _nFlags = SAD_DEFAULT | SAD_TITLE_STORE_AS); + SADFlags _nFlags = SADFlags::NONE); OSaveAsDlg( vcl::Window* _pParent, const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const OUString& _rDefault, const OUString& _sLabel, const IObjectNameCheck& _rObjectNameCheck, - sal_Int32 _nFlags = SAD_DEFAULT | SAD_TITLE_STORE_AS); + SADFlags _nFlags = SADFlags::NONE); virtual ~OSaveAsDlg() override; virtual void dispose() override; diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index f416675..44859bf 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1433,7 +1433,7 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo sTargetName, sLabel, aNameChecker, - SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS ); + SADFlags::AdditionalDescription | SADFlags::TitlePasteAs ); if ( RET_OK != aAskForName->Execute() ) // cancelled by the user return false; diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index b148f9c..8ec7a12 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1367,7 +1367,7 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b getConnection(), aDefaultName, aNameChecker, - SAD_DEFAULT ); + SADFlags::NONE ); bRet = ( aDlg->Execute() == RET_OK ); if ( bRet ) commit a8b555a26067b48f4c1568d476613c5769eb7591 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 23 10:06:12 2016 +0200 convert EF constants to o3tl::typed_flags and remove now unused ByteVector typedef Change-Id: I9c4b30aea2608cf97e597b00b4a4ea800efac4ec diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 534d517..c240f47 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 5779a7a..18ba066 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 43997f9..d8fa73c 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 commit 8af0d5367e2d4cbc04989321f1e68c024d4c343e Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 23 10:00:14 2016 +0200 convert CBTP constants to o3tl::typed_flags Change-Id: I453a9bacef737a56e381c4172710ec6acf225f0b diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 93702c9..66209cf 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -58,7 +58,7 @@ namespace dbaui OCommonBehaviourTabPage::OCommonBehaviourTabPage(vcl::Window* pParent, const OString& rId, const OUString& rUIXMLDescription, const SfxItemSet& _rCoreAttrs, - sal_uInt32 nControlFlags) + OCommonBehaviourTabPageFlags nControlFlags) :OGenericAdministrationPage(pParent, rId, rUIXMLDescription, _rCoreAttrs) ,m_pOptionsLabel(nullptr) @@ -73,7 +73,7 @@ namespace dbaui ,m_nControlFlags(nControlFlags) { - if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) { m_pOptionsLabel = get<FixedText>("optionslabel"); m_pOptionsLabel->Show(); @@ -82,7 +82,7 @@ namespace dbaui m_pOptions->SetModifyHdl(LINK(this,OGenericAdministrationPage,OnControlEditModifyHdl)); } - if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) { FixedText* pDataConvertLabel = get<FixedText>("charsetheader"); pDataConvertLabel->Show(); @@ -120,22 +120,22 @@ namespace dbaui void OCommonBehaviourTabPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) { - if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) { _rControlList.push_back(new ODisableWrapper<FixedText>(m_pOptionsLabel)); } - if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) { _rControlList.push_back(new ODisableWrapper<FixedText>(m_pCharsetLabel)); } } void OCommonBehaviourTabPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) { - if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) _rControlList.push_back(new OSaveValueWrapper<Edit>(m_pOptions)); - if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) _rControlList.push_back(new OSaveValueWrapper<ListBox>(m_pCharset)); } @@ -152,13 +152,13 @@ namespace dbaui // forward the values to the controls if (bValid) { - if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) { m_pOptions->SetText(pOptionsItem->GetValue()); m_pOptions->ClearModifyFlag(); } - if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) { m_pCharset->SelectEntryByIanaName( pCharsetItem->GetValue() ); } @@ -170,12 +170,12 @@ namespace dbaui { bool bChangedSomething = false; - if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseOptions) { fillString(*_rSet,m_pOptions,DSID_ADDITIONALOPTIONS,bChangedSomething); } - if ((m_nControlFlags & CBTP_USE_CHARSET) == CBTP_USE_CHARSET) + if (m_nControlFlags & OCommonBehaviourTabPageFlags::UseCharset) { if ( m_pCharset->StoreSelectedCharSet( *_rSet, DSID_CHARSET ) ) bChangedSomething = true; @@ -186,7 +186,7 @@ namespace dbaui // ODbaseDetailsPage ODbaseDetailsPage::ODbaseDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OCommonBehaviourTabPage(pParent, "DbasePage", "dbaccess/ui/dbasepage.ui", _rCoreAttrs, CBTP_USE_CHARSET) + :OCommonBehaviourTabPage(pParent, "DbasePage", "dbaccess/ui/dbasepage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset) { get(m_pShowDeleted, "showDelRowsCheckbutton"); get(m_pFT_Message, "specMessageLabel"); @@ -265,7 +265,7 @@ namespace dbaui // OAdoDetailsPage OAdoDetailsPage::OAdoDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OCommonBehaviourTabPage(pParent, "AutoCharset", "dbaccess/ui/autocharsetpage.ui", _rCoreAttrs, CBTP_USE_CHARSET ) + :OCommonBehaviourTabPage(pParent, "AutoCharset", "dbaccess/ui/autocharsetpage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset ) { } @@ -277,7 +277,7 @@ namespace dbaui // OOdbcDetailsPage OOdbcDetailsPage::OOdbcDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OCommonBehaviourTabPage(pParent, "ODBC", "dbaccess/ui/odbcpage.ui", _rCoreAttrs, CBTP_USE_CHARSET | CBTP_USE_OPTIONS) + :OCommonBehaviourTabPage(pParent, "ODBC", "dbaccess/ui/odbcpage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset | OCommonBehaviourTabPageFlags::UseOptions) { get(m_pUseCatalog, "useCatalogCheckbutton"); m_pUseCatalog->SetToggleHdl( LINK(this, OGenericAdministrationPage, ControlModifiedCheckBoxHdl) ); @@ -321,7 +321,7 @@ namespace dbaui // OOdbcDetailsPage OUserDriverDetailsPage::OUserDriverDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) : OCommonBehaviourTabPage(pParent, "UserDetailsPage", "dbaccess/ui/userdetailspage.ui", _rCoreAttrs, - CBTP_USE_CHARSET | CBTP_USE_OPTIONS) + OCommonBehaviourTabPageFlags::UseCharset | OCommonBehaviourTabPageFlags::UseOptions) { get(m_pFTHostname, "hostnameft"); get(m_pEDHostname, "hostname"); @@ -400,7 +400,7 @@ namespace dbaui } // OMySQLODBCDetailsPage OMySQLODBCDetailsPage::OMySQLODBCDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OCommonBehaviourTabPage(pParent, "AutoCharset", "dbaccess/ui/autocharsetpage.ui", _rCoreAttrs, CBTP_USE_CHARSET ) + :OCommonBehaviourTabPage(pParent, "AutoCharset", "dbaccess/ui/autocharsetpage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset ) { } @@ -411,7 +411,7 @@ namespace dbaui // OMySQLJDBCDetailsPage OGeneralSpecialJDBCDetailsPage::OGeneralSpecialJDBCDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId, bool bShowSocket ) - :OCommonBehaviourTabPage(pParent, "GeneralSpecialJDBCDetails", "dbaccess/ui/generalspecialjdbcdetailspage.ui", _rCoreAttrs, CBTP_USE_CHARSET) + :OCommonBehaviourTabPage(pParent, "GeneralSpecialJDBCDetails", "dbaccess/ui/generalspecialjdbcdetailspage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset) ,m_nPortId(_nPortId) ,m_bUseClass(true) { @@ -556,7 +556,7 @@ namespace dbaui // MySQLNativePage MySQLNativePage::MySQLNativePage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OCommonBehaviourTabPage(pParent, "MysqlNativePage", "dbaccess/ui/mysqlnativepage.ui", _rCoreAttrs, CBTP_USE_CHARSET ) + :OCommonBehaviourTabPage(pParent, "MysqlNativePage", "dbaccess/ui/mysqlnativepage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset ) ,m_aMySQLSettings ( VclPtr<MySQLNativeSettings>::Create(*get<VclVBox>("MySQLSettingsContainer"), LINK(this,OGenericAdministrationPage,OnControlModified)) ) { get(m_pSeparator1, "connectionheader"); @@ -657,7 +657,7 @@ namespace dbaui // OLDAPDetailsPage OLDAPDetailsPage::OLDAPDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OCommonBehaviourTabPage(pParent, "LDAP", "dbaccess/ui/ldappage.ui", _rCoreAttrs, 0) + :OCommonBehaviourTabPage(pParent, "LDAP", "dbaccess/ui/ldappage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::NONE) { get(m_pETBaseDN, "baseDNEntry"); get(m_pCBUseSSL, "useSSLCheckbutton"); @@ -747,7 +747,7 @@ namespace dbaui // OTextDetailsPage OTextDetailsPage::OTextDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OCommonBehaviourTabPage(pParent, "EmptyPage", "dbaccess/ui/emptypage.ui", _rCoreAttrs, 0) + :OCommonBehaviourTabPage(pParent, "EmptyPage", "dbaccess/ui/emptypage.ui", _rCoreAttrs, OCommonBehaviourTabPageFlags::NONE) { m_pTextConnectionHelper = VclPtr<OTextConnectionHelper>::Create( get<VclVBox>("EmptyPage"), TC_EXTENSION | TC_HEADER | TC_SEPARATORS | TC_CHARSET ); diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index 8c5f0ff..bbc5308 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -32,14 +32,19 @@ #include "admincontrols.hxx" #include <svtools/dialogcontrolling.hxx> +#include <o3tl/typed_flags_set.hxx> + +enum class OCommonBehaviourTabPageFlags { + NONE = 0x0000, + UseCharset = 0x0002, + UseOptions = 0x0004, +}; +namespace o3tl { + template<> struct typed_flags<OCommonBehaviourTabPageFlags> : is_typed_flags<OCommonBehaviourTabPageFlags, 0x0006> {}; +} namespace dbaui { - // OCommonBehaviourTabPage - #define CBTP_NONE 0x00000000 - #define CBTP_USE_CHARSET 0x00000002 - #define CBTP_USE_OPTIONS 0x00000004 - /** eases the implementation of tab pages handling user/password and/or character set and/or generic options input <BR> @@ -62,13 +67,12 @@ namespace dbaui VclPtr<FixedText> m_pAutoRetrievingLabel; VclPtr<Edit> m_pAutoRetrieving; - sal_uInt32 m_nControlFlags; + OCommonBehaviourTabPageFlags m_nControlFlags; public: virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) override; - // nControlFlags is a combination of the CBTP_xxx-constants - OCommonBehaviourTabPage(vcl::Window* pParent, const OString& rId, const OUString& rUIXMLDescription, const SfxItemSet& _rCoreAttrs, sal_uInt32 nControlFlags); + OCommonBehaviourTabPage(vcl::Window* pParent, const OString& rId, const OUString& rUIXMLDescription, const SfxItemSet& _rCoreAttrs, OCommonBehaviourTabPageFlags nControlFlags); protected: virtual ~OCommonBehaviourTabPage() override; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits