summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-18 13:03:28 +0200
committerNoel Grandin <noel@peralex.com>2015-03-19 08:25:03 +0200
commit48bb2913a7459edb17a5f62c2f6e6fbc4f1051e2 (patch)
tree7e2f09fc8998bc1016f4d2ba7fa09e3125663361 /sfx2
parentbdad6d0fe492a2334cb27ef54fc5d1cba17d1970 (diff)
convert SFX_FILTER_ constants to enum class
Change-Id: I7e53cfc90cefd9da7d6ecd795b09214bd44b1613
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx4
-rw-r--r--sfx2/source/appl/shutdownicon.cxx2
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx30
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx18
-rw-r--r--sfx2/source/doc/docfile.cxx5
-rw-r--r--sfx2/source/doc/docfilt.cxx10
-rw-r--r--sfx2/source/doc/guisaveas.cxx58
-rw-r--r--sfx2/source/doc/objserv.cxx2
-rw-r--r--sfx2/source/doc/objstor.cxx26
-rw-r--r--sfx2/source/view/frmload.cxx4
-rw-r--r--sfx2/source/view/viewfrm.cxx2
11 files changed, 80 insertions, 81 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index d684f8bdeeed..92d7c3231fc4 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -302,7 +302,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUStri
}
aMedium.UseInteractionHandler( true );
- sal_uIntPtr nErr = GetFilterMatcher().GuessFilter( aMedium,&pFilter,SFX_FILTER_TEMPLATE, 0 );
+ sal_uIntPtr nErr = GetFilterMatcher().GuessFilter( aMedium,&pFilter,SfxFilterFlags::TEMPLATE, SfxFilterFlags::NONE );
if ( 0 != nErr)
{
delete pSet;
@@ -315,7 +315,7 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUStri
return ERRCODE_SFX_NOTATEMPLATE;
}
- if ( pFilter->GetFilterFlags() & SFX_FILTER_STARONEFILTER )
+ if ( pFilter->GetFilterFlags() & SfxFilterFlags::STARONEFILTER )
{
DBG_ASSERT( !xDoc.Is(), "Sorry, not implemented!" );
delete pSet;
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 5405efb1811f..146357287bff 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -452,7 +452,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
if ( !aFilterName.isEmpty() )
{
- const SfxFilter* pFilter = SfxGetpApp()->GetFilterMatcher().GetFilter4UIName( aFilterName, 0, SFX_FILTER_NOTINFILEDLG );
+ const SfxFilter* pFilter = SfxGetpApp()->GetFilterMatcher().GetFilter4UIName( aFilterName, SfxFilterFlags::NONE, SfxFilterFlags::NOTINFILEDLG );
if ( pFilter )
{
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index c8143170cced..78d1897c8a55 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -529,7 +529,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c
bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
{
- if ( pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL )
+ if ( pFilter->GetFilterFlags() & SfxFilterFlags::MUSTINSTALL )
{
// Here could a re-installation be offered
OUString aText( SfxResId(STR_FILTER_NOT_INSTALLED).toString() );
@@ -546,9 +546,9 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
// then the Filterflag be deleted
}
- return ( !(pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL) );
+ return ( !(pFilter->GetFilterFlags() & SfxFilterFlags::MUSTINSTALL) );
}
- else if ( pFilter->GetFilterFlags() & SFX_FILTER_CONSULTSERVICE )
+ else if ( pFilter->GetFilterFlags() & SfxFilterFlags::CONSULTSERVICE )
{
OUString aText( SfxResId(STR_FILTER_CONSULT_SERVICE).toString() );
aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() );
@@ -575,7 +575,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
else
{
SFX_ITEMSET_ARG( rMedium.GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, false);
- if ( ( pOldFilter->GetFilterFlags() & SFX_FILTER_PACKED ) && pSalvageItem )
+ if ( ( pOldFilter->GetFilterFlags() & SfxFilterFlags::PACKED ) && pSalvageItem )
// Salvage is always done without packing
pOldFilter = 0;
}
@@ -603,7 +603,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
const SfxFilter* pInstallFilter = NULL;
// Now test the filter which are not installed (ErrCode is irrelevant)
- GuessFilter( rMedium, &pInstallFilter, SFX_FILTER_IMPORT, SFX_FILTER_CONSULTSERVICE );
+ GuessFilter( rMedium, &pInstallFilter, SfxFilterFlags::IMPORT, SfxFilterFlags::CONSULTSERVICE );
if ( pInstallFilter )
{
if ( IsFilterInstalled_Impl( pInstallFilter ) )
@@ -614,7 +614,7 @@ sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**
{
// Now test the filter, which first must be obtained by Star
// (ErrCode is irrelevant)
- GuessFilter( rMedium, &pInstallFilter, SFX_FILTER_IMPORT, 0 );
+ GuessFilter( rMedium, &pInstallFilter, SfxFilterFlags::IMPORT, SfxFilterFlags::NONE );
if ( pInstallFilter )
IsFilterInstalled_Impl( pInstallFilter );
}
@@ -716,7 +716,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4EA( const OUString& rType, SfxFilte
SfxFilterFlags nFlags = pFilter->GetFilterFlags();
if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && pFilter->GetTypeName() == rType )
{
- if (nFlags & SFX_FILTER_PREFERED)
+ if (nFlags & SfxFilterFlags::PREFERED)
return pFilter;
if (!pFirst)
pFirst = pFilter;
@@ -798,7 +798,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4UIName( const OUString& rName, SfxF
if ( (nFlags & nMust) == nMust &&
!(nFlags & nDont ) && pFilter->GetUIName() == rName )
{
- if ( pFilter->GetFilterFlags() & SFX_FILTER_PREFERED )
+ if ( pFilter->GetFilterFlags() & SfxFilterFlags::PREFERED )
return pFilter;
else if ( !pFirstFilter )
pFirstFilter = pFilter;
@@ -864,7 +864,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const OUString& rName,
IMPL_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, OUString*, pString )
{
- const SfxFilter* pFilter = pThis->GetFilter4Extension( *pString, SFX_FILTER_IMPORT );
+ const SfxFilter* pFilter = pThis->GetFilter4Extension( *pString, SfxFilterFlags::IMPORT );
if (pFilter && !pFilter->GetWildcard().Matches( OUString() ) &&
!pFilter->GetWildcard().Matches(OUString("*.*")) &&
!pFilter->GetWildcard().Matches(OUString('*'))
@@ -883,8 +883,8 @@ SfxFilterMatcherIter::SfxFilterMatcherIter(
: nOrMask( nOrMaskP ), nAndMask( nAndMaskP ),
nCurrent(0), m_rMatch(rMatcher.m_rImpl)
{
- if( nOrMask == 0xffff ) //Due to falty build on s
- nOrMask = 0;
+ if( nOrMask == static_cast<SfxFilterFlags>(0xffff) ) //Due to faulty build on s
+ nOrMask = SfxFilterFlags::NONE;
m_rMatch.InitForIterating();
}
@@ -969,7 +969,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
{
// collect information to add filter to container
// (attention: some information aren't available on filter directly ... you must search for corresponding type too!)
- sal_Int32 nFlags = 0 ;
+ SfxFilterFlags nFlags = SfxFilterFlags::NONE;
SotClipboardFormatId nClipboardId = SotClipboardFormatId::NONE;
sal_Int32 nDocumentIconId = 0 ;
sal_Int32 nFormatVersion = 0 ;
@@ -998,7 +998,9 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
}
else if ( lFilterProperties[nFilterProperty].Name == "Flags" )
{
- lFilterProperties[nFilterProperty].Value >>= nFlags;
+ sal_Int32 nTmp;
+ lFilterProperties[nFilterProperty].Value >>= nTmp;
+ nFlags = static_cast<SfxFilterFlags>(nTmp);
}
else if ( lFilterProperties[nFilterProperty].Name == "UIName" )
{
@@ -1084,7 +1086,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
nClipboardId = SotExchange::RegisterFormatName( sHumanName );
// For external filters ignore clipboard IDs
- if((nFlags & SFX_FILTER_STARONEFILTER) == SFX_FILTER_STARONEFILTER)
+ if(nFlags & SfxFilterFlags::STARONEFILTER)
{
nClipboardId = SotClipboardFormatId::NONE;
}
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index b3f3f94a45e2..b12521f2f6a4 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -516,7 +516,7 @@ void FileDialogHelper_Impl::updateSelectionBox()
const SfxFilter* pFilter = getCurentSfxFilter();
mbSelectionFltrEnabled = updateExtendedControl(
ExtendedFilePickerElementIds::CHECKBOX_SELECTION,
- ( mbSelectionEnabled && pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_SUPPORTSSELECTION ) != 0 ) );
+ ( mbSelectionEnabled && pFilter && ( pFilter->GetFilterFlags() & SfxFilterFlags::SUPPORTSSELECTION ) ) );
uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, UNO_QUERY );
xCtrlAccess->setValue( ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0, makeAny( mbSelection ) );
}
@@ -532,7 +532,7 @@ void FileDialogHelper_Impl::enablePasswordBox( bool bInit )
const SfxFilter* pCurrentFilter = getCurentSfxFilter();
mbIsPwdEnabled = updateExtendedControl(
ExtendedFilePickerElementIds::CHECKBOX_PASSWORD,
- pCurrentFilter && ( pCurrentFilter->GetFilterFlags() & SFX_FILTER_ENCRYPTION )
+ pCurrentFilter && ( pCurrentFilter->GetFilterFlags() & SfxFilterFlags::ENCRYPTION )
);
if( bInit )
@@ -897,11 +897,11 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
mbSelectionFltrEnabled = false;
// default settings
- m_nDontFlags = SFX_FILTER_INTERNAL | SFX_FILTER_NOTINFILEDLG | SFX_FILTER_NOTINSTALLED;
+ m_nDontFlags = SFX_FILTER_NOTINSTALLED | SfxFilterFlags::INTERNAL | SfxFilterFlags::NOTINFILEDLG;
if (OPEN == lcl_OpenOrSave(m_nDialogType))
- m_nMustFlags = SFX_FILTER_IMPORT;
+ m_nMustFlags = SfxFilterFlags::IMPORT;
else
- m_nMustFlags = SFX_FILTER_EXPORT;
+ m_nMustFlags = SfxFilterFlags::EXPORT;
mpMatcher = NULL;
@@ -1730,9 +1730,9 @@ void FileDialogHelper_Impl::addFilters( const OUString& rFactory,
sQuery.append(":module=");
sQuery.append(rFactory); // use long name here !
sQuery.append(":iflags=");
- sQuery.append(OUString::number(m_nMustFlags));
+ sQuery.append(OUString::number(static_cast<sal_Int32>(m_nMustFlags)));
sQuery.append(":eflags=");
- sQuery.append(OUString::number(m_nDontFlags));
+ sQuery.append(OUString::number(static_cast<sal_Int32>(m_nDontFlags)));
uno::Reference< XEnumeration > xResult;
try
@@ -2591,7 +2591,7 @@ ErrCode FileOpenDialog_Impl( sal_Int16 nDialogType,
{
ErrCode nRet;
FileDialogHelper aDialog( nDialogType, nFlags,
- rFact, nDialog, 0, 0, rStandardDir, rBlackList );
+ rFact, nDialog, SfxFilterFlags::NONE, SfxFilterFlags::NONE, rStandardDir, rBlackList );
OUString aPath;
if ( pPath )
@@ -2613,7 +2613,7 @@ ErrCode RequestPassword(const SfxFilter* pCurrentFilter, OUString& aURL, SfxItem
::comphelper::DocPasswordRequestType_MS :
::comphelper::DocPasswordRequestType_STANDARD;
- ::rtl::Reference< ::comphelper::DocPasswordRequest > pPasswordRequest( new ::comphelper::DocPasswordRequest( eType, ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, aURL, ( pCurrentFilter->GetFilterFlags() & SFX_FILTER_PASSWORDTOMODIFY ) != 0 ) );
+ ::rtl::Reference< ::comphelper::DocPasswordRequest > pPasswordRequest( new ::comphelper::DocPasswordRequest( eType, ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, aURL, bool( pCurrentFilter->GetFilterFlags() & SfxFilterFlags::PASSWORDTOMODIFY ) ) );
uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest.get() );
xInteractionHandler->handle( rRequest );
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 5d3edd3dc156..41d8097c0294 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3173,10 +3173,7 @@ bool SfxMedium::SaveVersionList_Impl( bool /*bUseXML*/ )
bool SfxMedium::IsReadOnly() const
{
// a) ReadOnly filter can't produce read/write contents!
- bool bReadOnly = (
- (pImp->m_pFilter ) &&
- ((pImp->m_pFilter->GetFilterFlags() & SFX_FILTER_OPENREADONLY) == SFX_FILTER_OPENREADONLY)
- );
+ bool bReadOnly = pImp->m_pFilter && (pImp->m_pFilter->GetFilterFlags() & SfxFilterFlags::OPENREADONLY);
// b) if filter allow read/write contents .. check open mode of the storage
if (!bReadOnly)
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index 2599f3528919..ad597513f8b0 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -39,7 +39,7 @@ using namespace ::com::sun::star;
SfxFilter::SfxFilter( const OUString& rProvider, const OUString &rFilterName ) :
maFilterName(rFilterName),
maProvider(rProvider),
- nFormatType(0),
+ nFormatType(SfxFilterFlags::NONE),
nVersion(0),
lFormat(SotClipboardFormatId::NONE),
nDocIcon(0)
@@ -134,7 +134,7 @@ const SfxFilter* SfxFilter::GetDefaultFilterFromFactory( const OUString& rFact )
const SfxFilter* SfxFilter::GetFilterByName( const OUString& rName )
{
SfxFilterMatcher aMatch;
- return aMatch.GetFilter4FilterName( rName, 0, 0 );
+ return aMatch.GetFilter4FilterName( rName, SfxFilterFlags::NONE, SfxFilterFlags::NONE );
}
OUString SfxFilter::GetTypeFromStorage( const SotStorage& rStg )
@@ -201,13 +201,13 @@ OUString SfxFilter::GetTypeFromStorage(
SotClipboardFormatId nClipId = SotExchange::GetFormat( aDataFlavor );
if ( nClipId != SotClipboardFormatId::NONE )
{
- SfxFilterFlags nMust = SFX_FILTER_IMPORT, nDont = SFX_FILTER_NOTINSTALLED;
+ SfxFilterFlags nMust = SfxFilterFlags::IMPORT, nDont = SFX_FILTER_NOTINSTALLED;
if ( bTemplate )
// template filter was preselected, try to verify
- nMust |= SFX_FILTER_TEMPLATEPATH;
+ nMust |= SfxFilterFlags::TEMPLATEPATH;
else
// template filters shouldn't be detected if not explicitly asked for
- nDont |= SFX_FILTER_TEMPLATEPATH;
+ nDont |= SfxFilterFlags::TEMPLATEPATH;
const SfxFilter* pFilter = 0;
if (!aName.isEmpty())
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 4d51f8e9f6d0..b4beffb9c7ef 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -167,18 +167,18 @@ static sal_uInt8 getStoreModeFromSlotName( const OUString& aSlotName )
}
-static sal_Int32 getMustFlags( sal_Int8 nStoreMode )
+static SfxFilterFlags getMustFlags( sal_Int8 nStoreMode )
{
- return ( SFX_FILTER_EXPORT
- | ( ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED ) ) ? 0 : SFX_FILTER_IMPORT ) );
+ return ( SfxFilterFlags::EXPORT
+ | ( ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED ) ) ? SfxFilterFlags::NONE : SfxFilterFlags::IMPORT ) );
}
-static sal_Int32 getDontFlags( sal_Int8 nStoreMode )
+static SfxFilterFlags getDontFlags( sal_Int8 nStoreMode )
{
- return ( SFX_FILTER_INTERNAL
- | SFX_FILTER_NOTINFILEDLG
- | ( ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED ) ) ? SFX_FILTER_IMPORT : 0 ) );
+ return ( SfxFilterFlags::INTERNAL
+ | SfxFilterFlags::NOTINFILEDLG
+ | ( ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED ) ) ? SfxFilterFlags::IMPORT : SfxFilterFlags::NONE ) );
}
@@ -290,8 +290,8 @@ public:
OUString GetDocServiceName();
- uno::Sequence< beans::PropertyValue > GetDocServiceDefaultFilterCheckFlags( sal_Int32 nMust, sal_Int32 nDont );
- uno::Sequence< beans::PropertyValue > GetDocServiceAnyFilter( sal_Int32 nMust, sal_Int32 nDont );
+ uno::Sequence< beans::PropertyValue > GetDocServiceDefaultFilterCheckFlags( SfxFilterFlags nMust, SfxFilterFlags nDont );
+ uno::Sequence< beans::PropertyValue > GetDocServiceAnyFilter( SfxFilterFlags nMust, SfxFilterFlags nDont );
uno::Sequence< beans::PropertyValue > GetPreselectedFilter_Impl( sal_Int8 nStoreMode );
uno::Sequence< beans::PropertyValue > GetDocServiceDefaultFilter();
@@ -510,16 +510,16 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilter
}
-uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilterCheckFlags( sal_Int32 nMust,
- sal_Int32 nDont )
+uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilterCheckFlags( SfxFilterFlags nMust,
+ SfxFilterFlags nDont )
{
uno::Sequence< beans::PropertyValue > aFilterProps;
uno::Sequence< beans::PropertyValue > aProps = GetDocServiceDefaultFilter();
if ( aProps.getLength() )
{
::comphelper::SequenceAsHashMap aFiltHM( aProps );
- sal_Int32 nFlags = aFiltHM.getUnpackedValueOrDefault("Flags",
- (sal_Int32)0 );
+ SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aFiltHM.getUnpackedValueOrDefault("Flags",
+ (sal_Int32)0 ));
if ( ( ( nFlags & nMust ) == nMust ) && !( nFlags & nDont ) )
aFilterProps = aProps;
}
@@ -529,7 +529,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceDefaultFilter
-uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceAnyFilter( sal_Int32 nMust, sal_Int32 nDont )
+uno::Sequence< beans::PropertyValue > ModelData_Impl::GetDocServiceAnyFilter( SfxFilterFlags nMust, SfxFilterFlags nDont )
{
uno::Sequence< beans::NamedValue > aSearchRequest( 1 );
aSearchRequest[0].Name = "DocumentService";
@@ -543,8 +543,8 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetPreselectedFilter_Impl(
{
uno::Sequence< beans::PropertyValue > aFilterProps;
- sal_Int32 nMust = getMustFlags( nStoreMode );
- sal_Int32 nDont = getDontFlags( nStoreMode );
+ SfxFilterFlags nMust = getMustFlags( nStoreMode );
+ SfxFilterFlags nDont = getDontFlags( nStoreMode );
if ( nStoreMode & PDFEXPORT_REQUESTED )
{
@@ -749,7 +749,7 @@ bool hasMacros( const uno::Reference< frame::XModel >& xModel )
sal_Int8 ModelData_Impl::CheckFilter( const OUString& aFilterName )
{
::comphelper::SequenceAsHashMap aFiltPropsHM;
- sal_Int32 nFiltFlags = 0;
+ SfxFilterFlags nFiltFlags = SfxFilterFlags::NONE;
if ( !aFilterName.isEmpty() )
{
// get properties of filter
@@ -758,29 +758,29 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString& aFilterName )
m_pOwner->GetFilterConfiguration()->getByName( aFilterName ) >>= aFilterProps;
aFiltPropsHM = ::comphelper::SequenceAsHashMap( aFilterProps );
- nFiltFlags = aFiltPropsHM.getUnpackedValueOrDefault("Flags", (sal_Int32)0 );
+ nFiltFlags = static_cast<SfxFilterFlags>(aFiltPropsHM.getUnpackedValueOrDefault("Flags", (sal_Int32)0 ));
}
// only a temporary solution until default filter retrieving feature is implemented
// then GetDocServiceDefaultFilter() must be used
- ::comphelper::SequenceAsHashMap aDefFiltPropsHM = GetDocServiceDefaultFilterCheckFlags( 3, 0 );
- sal_Int32 nDefFiltFlags = aDefFiltPropsHM.getUnpackedValueOrDefault("Flags", (sal_Int32)0 );
+ ::comphelper::SequenceAsHashMap aDefFiltPropsHM = GetDocServiceDefaultFilterCheckFlags( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT, SfxFilterFlags::NONE );
+ SfxFilterFlags nDefFiltFlags = static_cast<SfxFilterFlags>(aDefFiltPropsHM.getUnpackedValueOrDefault("Flags", (sal_Int32)0 ));
// if the old filter is not acceptable
// and there is no default filter or it is not acceptable for requested parameters then proceed with saveAs
- if ( ( !aFiltPropsHM.size() || !( nFiltFlags & SFX_FILTER_EXPORT ) )
- && ( !aDefFiltPropsHM.size() || !( nDefFiltFlags & SFX_FILTER_EXPORT ) || nDefFiltFlags & SFX_FILTER_INTERNAL ) )
+ if ( ( !aFiltPropsHM.size() || !( nFiltFlags & SfxFilterFlags::EXPORT ) )
+ && ( !aDefFiltPropsHM.size() || !( nDefFiltFlags & SfxFilterFlags::EXPORT ) || nDefFiltFlags & SfxFilterFlags::INTERNAL ) )
return STATUS_SAVEAS;
// so at this point there is either an acceptable old filter or default one
- if ( !aFiltPropsHM.size() || !( nFiltFlags & SFX_FILTER_EXPORT ) )
+ if ( !aFiltPropsHM.size() || !( nFiltFlags & SfxFilterFlags::EXPORT ) )
{
// so the default filter must be acceptable
return STATUS_SAVEAS_STANDARDNAME;
}
- else if ( ( !( nFiltFlags & SFX_FILTER_OWN ) || ( nFiltFlags & SFX_FILTER_ALIEN ) )
+ else if ( ( !( nFiltFlags & SfxFilterFlags::OWN ) || ( nFiltFlags & SfxFilterFlags::ALIEN ) )
&& aDefFiltPropsHM.size()
- && ( nDefFiltFlags & SFX_FILTER_EXPORT ) && !( nDefFiltFlags & SFX_FILTER_INTERNAL ))
+ && ( nDefFiltFlags & SfxFilterFlags::EXPORT ) && !( nDefFiltFlags & SfxFilterFlags::INTERNAL ))
{
// the default filter is acceptable and the old filter is alien one
// so ask to make a saveAs operation
@@ -926,8 +926,8 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
OUString aDocServiceName = GetDocServiceName();
DBG_ASSERT( !aDocServiceName.isEmpty(), "No document service for this module set!" );
- sal_Int32 nMust = getMustFlags( nStoreMode );
- sal_Int32 nDont = getDontFlags( nStoreMode );
+ SfxFilterFlags nMust = getMustFlags( nStoreMode );
+ SfxFilterFlags nDont = getDontFlags( nStoreMode );
sfx2::FileDialogHelper::Context eCtxt = sfx2::FileDialogHelper::UNKNOWN_CONTEXT;
if ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED ) )
@@ -1008,9 +1008,9 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
m_pOwner->GetFilterConfiguration()->getByName( aOldFilterName ) >>= aOldFilterProps;
::comphelper::SequenceAsHashMap aOldFiltPropsHM( aOldFilterProps );
- sal_Int32 nOldFiltFlags = aOldFiltPropsHM.getUnpackedValueOrDefault("Flags", (sal_Int32)0 );
+ SfxFilterFlags nOldFiltFlags = static_cast<SfxFilterFlags>(aOldFiltPropsHM.getUnpackedValueOrDefault("Flags", (sal_Int32)0 ));
- if ( bSetStandardName || ( nOldFiltFlags & nMust ) != nMust || nOldFiltFlags & nDont )
+ if ( bSetStandardName || ( nOldFiltFlags & nMust ) != nMust || bool(nOldFiltFlags & nDont) )
{
// the suggested type will be changed, the extension should be adjusted
aAdjustToType = aPreselectedFilterPropsHM.getUnpackedValueOrDefault(
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 98bf20deb44e..03b4e3a10bc7 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -286,7 +286,7 @@ bool SfxObjectShell::APISaveAs_Impl
SFX_ITEMSET_ARG( aParams, pContentTypeItem, SfxStringItem, SID_CONTENTTYPE, false );
if ( pContentTypeItem )
{
- const SfxFilter* pFilter = SfxFilterMatcher( OUString::createFromAscii(GetFactory().GetShortName()) ).GetFilter4Mime( pContentTypeItem->GetValue(), SFX_FILTER_EXPORT );
+ const SfxFilter* pFilter = SfxFilterMatcher( OUString::createFromAscii(GetFactory().GetShortName()) ).GetFilter4Mime( pContentTypeItem->GetValue(), SfxFilterFlags::EXPORT );
if ( pFilter )
aFilterName = pFilter->GetName();
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 2129913c5137..55f73c05d01e 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -669,14 +669,14 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
if ( nError != ERRCODE_NONE )
SetError( nError, OUString( OSL_LOG_PREFIX ) );
- if (pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARTPRESENTATION)
+ if (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARTPRESENTATION)
pSet->Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, true) );
}
EnableSetModified( false );
pMedium->LockOrigFileOnDemand( true, false );
- if ( GetError() == ERRCODE_NONE && bOwnStorageFormat && ( !pFilter || !( pFilter->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) ) )
+ if ( GetError() == ERRCODE_NONE && bOwnStorageFormat && ( !pFilter || !( pFilter->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) ) )
{
uno::Reference< embed::XStorage > xStorage;
if ( pMedium->GetError() == ERRCODE_NONE )
@@ -750,7 +750,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
{
pImp->nLoadedFlags = 0;
pImp->bModelInitialized = false;
- if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) )
+ if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) )
{
uno::Reference < beans::XPropertySet > xSet( GetModel(), uno::UNO_QUERY );
OUString sLockUpdates("LockUpdates");
@@ -1130,7 +1130,7 @@ bool SfxObjectShell::SaveTo_Impl
// if no filter was set, use the default filter
// this should be changed in the feature, it should be an error!
SAL_WARN( "sfx.doc","No filter set!");
- pFilter = GetFactory().GetFilterContainer()->GetAnyFilter( SFX_FILTER_IMPORT | SFX_FILTER_EXPORT );
+ pFilter = GetFactory().GetFilterContainer()->GetAnyFilter( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT );
rMedium.SetFilter(pFilter);
}
@@ -1385,7 +1385,7 @@ bool SfxObjectShell::SaveTo_Impl
bool bOk = false;
// TODO/LATER: get rid of bOk
- if (bOwnTarget && pFilter && !(pFilter->GetFilterFlags() & SFX_FILTER_STARONEFILTER))
+ if (bOwnTarget && pFilter && !(pFilter->GetFilterFlags() & SfxFilterFlags::STARONEFILTER))
{
AddLog( OUString( OSL_LOG_PREFIX "Storing in own format." ) );
uno::Reference< embed::XStorage > xMedStorage = rMedium.GetStorage();
@@ -1554,7 +1554,7 @@ bool SfxObjectShell::SaveTo_Impl
{
AddLog( OUString( OSL_LOG_PREFIX "Storing in alien format." ) );
// it's a "SaveAs" in an alien format
- if ( rMedium.GetFilter() && ( rMedium.GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) )
+ if ( rMedium.GetFilter() && ( rMedium.GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) )
bOk = ExportTo( rMedium );
else
bOk = ConvertTo( rMedium );
@@ -2129,13 +2129,13 @@ bool SfxObjectShell::ConvertFrom
/* [Description]
This method is called for loading of documents over all filters which are
- not SFX_FILTER_OWN or for which no clipboard format has been registered
+ not SfxFilterFlags::OWN or for which no clipboard format has been registered
(thus no storage format that is used). In other words, with this method
it is imported.
Files which are to be opened here should be opened through 'rMedium'
to guarantee the right open modes. Especially if the format is retained
- (only possible with SFX_FILTER_SIMULATE or SFX_FILTER_ONW) file which must
+ (only possible with SfxFilterFlags::SIMULATE or SfxFilterFlags::ONW) file which must
be opened STREAM_SHARE_DENYWRITE.
[Return value]
@@ -2167,7 +2167,7 @@ bool SfxObjectShell::ConvertFrom
[Cross-references]
<SfxObjectShell::ConvertTo(SfxMedium&)>
- <SFX_FILTER_REGISTRATION>
+ <SfxFilterFlags::REGISTRATION>
*/
{
return false;
@@ -2433,13 +2433,13 @@ bool SfxObjectShell::ConvertTo
/* [Description]
This method is called for saving of documents over all filters which are
- not SFX_FILTER_OWN or for which no clipboard format has been registered
+ not SfxFilterFlags::OWN or for which no clipboard format has been registered
(thus no storage format that is used). In other words, with this method
it is exported.
Files which are to be opened here should be opened through 'rMedium'
to guarantee the right open modes. Especially if the format is retained
- (only possible with SFX_FILTER_SIMULATE or SFX_FILTER_ONW) file which must
+ (only possible with SfxFilterFlags::SIMULATE or SfxFilterFlags::ONW) file which must
be opened STREAM_SHARE_DENYWRITE.
[Return value]
@@ -2471,7 +2471,7 @@ bool SfxObjectShell::ConvertTo
[Cross-references]
<SfxObjectShell::ConvertFrom(SfxMedium&)>
- <SFX_FILTER_REGISTRATION>
+ <SfxFilterFlags::REGISTRATION>
*/
{
@@ -2806,7 +2806,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl
if ( !aFilterName.isEmpty() )
pNewFile->SetFilter( GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName ) );
else
- pNewFile->SetFilter( GetFactory().GetFilterContainer()->GetAnyFilter( SFX_FILTER_IMPORT | SFX_FILTER_EXPORT ) );
+ pNewFile->SetFilter( GetFactory().GetFilterContainer()->GetAnyFilter( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT ) );
if ( pNewFile->GetErrorCode() != ERRCODE_NONE )
{
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 644c37b5eaa4..f62c77c14b56 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -263,7 +263,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( con
UNO_QUERY_THROW );
const SfxFilterMatcher& rMatcher = SfxGetpApp()->GetFilterMatcher();
- const SfxFilterFlags nMust = SFX_FILTER_IMPORT;
+ const SfxFilterFlags nMust = SfxFilterFlags::IMPORT;
const SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED;
Reference < XEnumeration > xEnum( xQuery->createSubSetEnumerationByProperties(
@@ -281,7 +281,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( con
SfxFilterFlags nFlags = pFilter->GetFilterFlags();
if ( ( ( nFlags & nMust ) == nMust )
- && ( ( nFlags & nDont ) == 0 )
+ && ( ( nFlags & nDont ) == SfxFilterFlags::NONE )
)
{
return pFilter;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 48aae16c67f5..24ad62e384a2 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -179,7 +179,7 @@ static bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHa
// TODO/LATER: In future the info should replace the direct hash completely
bool bResult = ( !nPasswordHash && !aInfo.getLength() );
- OSL_ENSURE( pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_PASSWORDTOMODIFY ), "PasswordToModify feature is active for a filter that does not support it!" );
+ OSL_ENSURE( pFilter && ( pFilter->GetFilterFlags() & SfxFilterFlags::PASSWORDTOMODIFY ), "PasswordToModify feature is active for a filter that does not support it!" );
if ( pFilter && xHandler.is() )
{