diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-22 14:06:13 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-29 10:41:37 +0200 |
commit | c97b81ea139a2299d9528f4ef04d0f88acc60c09 (patch) | |
tree | 6a737e0727064b356ba94c17cef25de83d9d3512 /svx | |
parent | a47be3914efb6940c1608763fbe9c7fd7dee9455 (diff) |
convert CTF_ constants to scoped enum
Change-Id: I1c8149e9fccde761bb2a5fd2cf3cddcd2d9748dd
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/dbaexchange.cxx | 32 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridcl.cxx | 6 | ||||
-rw-r--r-- | svx/source/form/tabwin.cxx | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx index 889173374c23..570177f3fe02 100644 --- a/svx/source/fmcomp/dbaexchange.cxx +++ b/svx/source/fmcomp/dbaexchange.cxx @@ -48,14 +48,14 @@ namespace svx ,const sal_Int32 _nCommandType ,const OUString& _rCommand ,const OUString& _rFieldName - ,sal_Int32 _nFormats) + ,ColumnTransferFormatFlags _nFormats) :m_nFormatFlags(_nFormats) { implConstruct(_rDatasource,_rConnectionResource,_nCommandType, _rCommand, _rFieldName); } - OColumnTransferable::OColumnTransferable(const ODataAccessDescriptor& _rDescriptor, sal_Int32 _nFormats ) + OColumnTransferable::OColumnTransferable(const ODataAccessDescriptor& _rDescriptor, ColumnTransferFormatFlags _nFormats ) :m_nFormatFlags(_nFormats) { OUString sDataSource, sDatabaseLocation, sConnectionResource, sCommand, sFieldName; @@ -73,7 +73,7 @@ namespace svx sDataSource.isEmpty() ? sDatabaseLocation : sDataSource, sConnectionResource, nCommandType, sCommand, sFieldName ); - if ( m_nFormatFlags & CTF_COLUMN_DESCRIPTOR ) + if ( m_nFormatFlags & ColumnTransferFormatFlags::COLUMN_DESCRIPTOR ) { if ( _rDescriptor.has( daConnection ) ) m_aDescriptor[ daConnection ] = _rDescriptor[ daConnection ]; @@ -85,7 +85,7 @@ namespace svx OColumnTransferable::OColumnTransferable(const Reference< XPropertySet >& _rxForm, const OUString& _rFieldName, const Reference< XPropertySet >& _rxColumn, - const Reference< XConnection >& _rxConnection, sal_Int32 _nFormats) + const Reference< XConnection >& _rxConnection, ColumnTransferFormatFlags _nFormats) :m_nFormatFlags(_nFormats) { OSL_ENSURE(_rxForm.is(), "OColumnTransferable::OColumnTransferable: invalid form!"); @@ -139,7 +139,7 @@ namespace svx implConstruct(sDatasource, sURL,nCommandType, sCommand, _rFieldName); - if ((m_nFormatFlags & CTF_COLUMN_DESCRIPTOR) == CTF_COLUMN_DESCRIPTOR) + if ((m_nFormatFlags & ColumnTransferFormatFlags::COLUMN_DESCRIPTOR) == ColumnTransferFormatFlags::COLUMN_DESCRIPTOR) { if (_rxColumn.is()) m_aDescriptor[daColumnObject] <<= _rxColumn; @@ -194,7 +194,7 @@ namespace svx m_sCompatibleFormat += _rFieldName; m_aDescriptor.clear(); - if ((m_nFormatFlags & CTF_COLUMN_DESCRIPTOR) == CTF_COLUMN_DESCRIPTOR) + if ((m_nFormatFlags & ColumnTransferFormatFlags::COLUMN_DESCRIPTOR) == ColumnTransferFormatFlags::COLUMN_DESCRIPTOR) { m_aDescriptor.setDataSource(_rDatasource); if ( !_rConnectionResource.isEmpty() ) @@ -209,13 +209,13 @@ namespace svx void OColumnTransferable::AddSupportedFormats() { - if (CTF_CONTROL_EXCHANGE & m_nFormatFlags) + if (ColumnTransferFormatFlags::CONTROL_EXCHANGE & m_nFormatFlags) AddFormat(SotClipboardFormatId::SBA_CTRLDATAEXCHANGE); - if (CTF_FIELD_DESCRIPTOR & m_nFormatFlags) + if (ColumnTransferFormatFlags::FIELD_DESCRIPTOR & m_nFormatFlags) AddFormat(SotClipboardFormatId::SBA_FIELDDATAEXCHANGE); - if (CTF_COLUMN_DESCRIPTOR & m_nFormatFlags) + if (ColumnTransferFormatFlags::COLUMN_DESCRIPTOR & m_nFormatFlags) AddFormat(getDescriptorFormatId()); } @@ -237,11 +237,11 @@ namespace svx } - bool OColumnTransferable::canExtractColumnDescriptor(const DataFlavorExVector& _rFlavors, sal_Int32 _nFormats) + bool OColumnTransferable::canExtractColumnDescriptor(const DataFlavorExVector& _rFlavors, ColumnTransferFormatFlags _nFormats) { - bool bFieldFormat = 0 != (_nFormats & CTF_FIELD_DESCRIPTOR); - bool bControlFormat = 0 != (_nFormats & CTF_CONTROL_EXCHANGE); - bool bDescriptorFormat = 0 != (_nFormats & CTF_COLUMN_DESCRIPTOR); + bool bFieldFormat = bool(_nFormats & ColumnTransferFormatFlags::FIELD_DESCRIPTOR); + bool bControlFormat = bool(_nFormats & ColumnTransferFormatFlags::CONTROL_EXCHANGE); + bool bDescriptorFormat = bool(_nFormats & ColumnTransferFormatFlags::COLUMN_DESCRIPTOR); for ( DataFlavorExVector::const_iterator aCheck = _rFlavors.begin(); aCheck != _rFlavors.end(); ++aCheck @@ -361,13 +361,13 @@ namespace svx OSL_ENSURE( _pContainer, "OColumnTransferable::addDataToContainer: invalid container!" ); if ( _pContainer ) { - if ( m_nFormatFlags & CTF_FIELD_DESCRIPTOR ) + if ( m_nFormatFlags & ColumnTransferFormatFlags::FIELD_DESCRIPTOR ) _pContainer->CopyAny( SotClipboardFormatId::SBA_FIELDDATAEXCHANGE, makeAny( m_sCompatibleFormat ) ); - if ( m_nFormatFlags & CTF_CONTROL_EXCHANGE ) + if ( m_nFormatFlags & ColumnTransferFormatFlags::CONTROL_EXCHANGE ) _pContainer->CopyAny( SotClipboardFormatId::SBA_CTRLDATAEXCHANGE, makeAny( m_sCompatibleFormat ) ); - if ( m_nFormatFlags & CTF_COLUMN_DESCRIPTOR ) + if ( m_nFormatFlags & ColumnTransferFormatFlags::COLUMN_DESCRIPTOR ) { Any aContent = makeAny( m_aDescriptor.createPropertyValueSequence() ); _pContainer->CopyAny( getDescriptorFormatId(), aContent ); diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 4e3e0ffc33e0..d7959e6fdd00 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -222,7 +222,7 @@ sal_Int8 FmGridHeader::AcceptDrop( const AcceptDropEvent& rEvt ) // search for recognized formats const DataFlavorExVector& rFlavors = GetDataFlavorExVector(); - if (OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_COLUMN_DESCRIPTOR | CTF_FIELD_DESCRIPTOR)) + if (OColumnTransferable::canExtractColumnDescriptor(rFlavors, ColumnTransferFormatFlags::COLUMN_DESCRIPTOR | ColumnTransferFormatFlags::FIELD_DESCRIPTOR)) return rEvt.mnAction; return DND_ACTION_NONE; @@ -236,8 +236,8 @@ sal_Int8 FmGridHeader::ExecuteDrop( const ExecuteDropEvent& _rEvt ) TransferableDataHelper aDroppedData(_rEvt.maDropEvent.Transferable); // check the formats - bool bColumnDescriptor = OColumnTransferable::canExtractColumnDescriptor(aDroppedData.GetDataFlavorExVector(), CTF_COLUMN_DESCRIPTOR); - bool bFieldDescriptor = OColumnTransferable::canExtractColumnDescriptor(aDroppedData.GetDataFlavorExVector(), CTF_FIELD_DESCRIPTOR); + bool bColumnDescriptor = OColumnTransferable::canExtractColumnDescriptor(aDroppedData.GetDataFlavorExVector(), ColumnTransferFormatFlags::COLUMN_DESCRIPTOR); + bool bFieldDescriptor = OColumnTransferable::canExtractColumnDescriptor(aDroppedData.GetDataFlavorExVector(), ColumnTransferFormatFlags::FIELD_DESCRIPTOR); if (!bColumnDescriptor && !bFieldDescriptor) { OSL_FAIL("FmGridHeader::ExecuteDrop: should never have reached this (no extractable format)!"); diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index acf428e32f9d..49e2e4ec3d73 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -162,7 +162,7 @@ void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPi aDescriptor[ daColumnName ] <<= pInfo->sColumnName; TransferableHelper* pTransferColumn = new OColumnTransferable( - aDescriptor, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR + aDescriptor, ColumnTransferFormatFlags::FIELD_DESCRIPTOR | ColumnTransferFormatFlags::CONTROL_EXCHANGE | ColumnTransferFormatFlags::COLUMN_DESCRIPTOR ); Reference< XTransferable> xEnsureDelete = pTransferColumn; EndSelection(); |