convert SFX_FILTER_ constants to enum class

Change-Id: I7e53cfc90cefd9da7d6ecd795b09214bd44b1613
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index ee9b6e5..806fc64 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -706,7 +706,7 @@ sal_Bool MimeConfigurationHelper::AddFilterNameCheckOwnFile(
    {
        sal_Int32 nFlags = GetFilterFlags( aFilterName );
        // check the OWN flag
        bResult = ( nFlags & SFX_FILTER_OWN );
        bResult = ( nFlags & SfxFilterFlags::OWN );
    }

    return bResult;
@@ -742,22 +742,22 @@ OUString MimeConfigurationHelper::GetDefaultFilterFromServiceName( const OUStrin
                    if ( xFilterEnum->nextElement() >>= aProps )
                    {
                        SequenceAsHashMap aPropsHM( aProps );
                        sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 );
                        SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aPropsHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 ));

                        // that should be import, export, own filter and not a template filter ( TemplatePath flag )
                        sal_Int32 const nRequired = (SFX_FILTER_OWN
                        SfxFilterFlags const nRequired = (SfxFilterFlags::OWN
                            // fdo#78159 for OOoXML, there is code to convert
                            // to ODF in OCommonEmbeddedObject::store*
                            // so accept it even though there's no export
                            | (SOFFICE_FILEFORMAT_60 == nVersion ? 0 : SFX_FILTER_EXPORT)
                            | SFX_FILTER_IMPORT );
                        if ( ( ( nFlags & nRequired ) == nRequired ) && !( nFlags & SFX_FILTER_TEMPLATEPATH ) )
                            | (SOFFICE_FILEFORMAT_60 == nVersion ? SfxFilterFlags::NONE : SfxFilterFlags::EXPORT)
                            | SfxFilterFlags::IMPORT );
                        if ( ( ( nFlags & nRequired ) == nRequired ) && !( nFlags & SfxFilterFlags::TEMPLATEPATH ) )
                        {
                            // if there are more than one filter the preffered one should be used
                            // if there is no preffered filter the first one will be used
                            if ( aResult.isEmpty() || ( nFlags & SFX_FILTER_PREFERED ) )
                            if ( aResult.isEmpty() || ( nFlags & SfxFilterFlags::PREFERED ) )
                                aResult = aPropsHM.getUnpackedValueOrDefault( "Name", OUString() );
                            if ( nFlags & SFX_FILTER_PREFERED )
                            if ( nFlags & SfxFilterFlags::PREFERED )
                                break; // the preferred filter was found
                        }
                    }
@@ -787,15 +787,15 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin
            if ( aImpFilterAny >>= aImpData )
            {
                SequenceAsHashMap aImpFilterHM( aImpData );
                sal_Int32 nFlags = aImpFilterHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 );
                SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aImpFilterHM.getUnpackedValueOrDefault( "Flags", (sal_Int32)0 ));

                if ( !( nFlags & SFX_FILTER_IMPORT ) )
                if ( !( nFlags & SfxFilterFlags::IMPORT ) )
                {
                    OSL_FAIL( "This is no import filter!" );
                    throw uno::Exception();
                }

                if ( nFlags & SFX_FILTER_EXPORT )
                if ( nFlags & SfxFilterFlags::EXPORT )
                {
                    aExportFilterName = aImportFilterName;
                }
@@ -816,8 +816,8 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin
                        uno::Sequence< beans::PropertyValue > aExportFilterProps = SearchForFilter(
                            uno::Reference< container::XContainerQuery >( xFilterFactory, uno::UNO_QUERY_THROW ),
                            aSearchRequest,
                            SFX_FILTER_EXPORT,
                            SFX_FILTER_INTERNAL );
                            SfxFilterFlags::EXPORT,
                            SfxFilterFlags::INTERNAL );

                        if ( aExportFilterProps.getLength() )
                        {
@@ -840,8 +840,8 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin
uno::Sequence< beans::PropertyValue > MimeConfigurationHelper::SearchForFilter(
                                                        const uno::Reference< container::XContainerQuery >& xFilterQuery,
                                                        const uno::Sequence< beans::NamedValue >& aSearchRequest,
                                                        sal_Int32 nMustFlags,
                                                        sal_Int32 nDontFlags )
                                                        SfxFilterFlags nMustFlags,
                                                        SfxFilterFlags nDontFlags )
{
    uno::Sequence< beans::PropertyValue > aFilterProps;
    uno::Reference< container::XEnumeration > xFilterEnum =
@@ -857,11 +857,11 @@ uno::Sequence< beans::PropertyValue > MimeConfigurationHelper::SearchForFilter(
            if ( xFilterEnum->nextElement() >>= aProps )
            {
                SequenceAsHashMap aPropsHM( aProps );
                sal_Int32 nFlags = aPropsHM.getUnpackedValueOrDefault("Flags",
                                                                        (sal_Int32)0 );
                SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aPropsHM.getUnpackedValueOrDefault("Flags",
                                                                        (sal_Int32)0 ));
                if ( ( ( nFlags & nMustFlags ) == nMustFlags ) && !( nFlags & nDontFlags ) )
                {
                    if ( ( nFlags & SFX_FILTER_DEFAULT ) == SFX_FILTER_DEFAULT )
                    if ( ( nFlags & SfxFilterFlags::DEFAULT ) == SfxFilterFlags::DEFAULT )
                    {
                        aFilterProps = aProps;
                        break;
diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx
index b4657c1..ec60619 100644
--- a/cui/inc/pch/precompiled_cui.hxx
+++ b/cui/inc/pch/precompiled_cui.hxx
@@ -397,7 +397,6 @@
#include <sfx2/printopt.hxx>
#include <sfx2/request.hxx>
#include <sfx2/sfxcommands.h>
#include <sfx2/sfxdefs.hxx>
#include <sfx2/sfxdlg.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/sfxuno.hxx>
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 00126b1..ea52b32 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -29,7 +29,6 @@
#include <tools/diagnose_ex.h>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/sfxdefs.hxx>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <dialmgr.hxx>
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 0134af7..f5761d3 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -44,7 +44,6 @@
#include <sfx2/sfxcommands.h>
#include "about.hxx"
#include <config_buildid.h>
#include <sfx2/sfxdefs.hxx>
#include <sfx2/app.hxx>
#include <rtl/ustrbuf.hxx>
#include <vcl/bitmap.hxx>
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index bbecdaa..312aa12 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -403,9 +403,9 @@ void SfxSaveTabPage::Reset( const SfxItemSet* )
                    sal_IntPtr nData = reinterpret_cast<sal_IntPtr>(aDocTypeLB->GetEntryData(n));
                    OUString sCommand;
                    sCommand = "matchByDocumentService=%1:iflags=" +
                               OUString::number(SFX_FILTER_IMPORT|SFX_FILTER_EXPORT) +
                               OUString::number(static_cast<sal_Int32>(SfxFilterFlags::IMPORT|SfxFilterFlags::EXPORT)) +
                               ":eflags=" +
                               OUString::number(SFX_FILTER_NOTINFILEDLG) +
                               OUString::number(static_cast<sal_Int32>(SfxFilterFlags::NOTINFILEDLG)) +
                               ":default_first";
                    OUString sReplace;
                    switch(nData)
@@ -430,9 +430,9 @@ void SfxSaveTabPage::Reset( const SfxItemSet* )
                        OUString sFilter = aFilter.getUnpackedValueOrDefault("Name",OUString());
                        if (!sFilter.isEmpty())
                        {
                            sal_Int32 nFlags = aFilter.getUnpackedValueOrDefault("Flags",sal_Int32());
                            SfxFilterFlags nFlags = static_cast<SfxFilterFlags>(aFilter.getUnpackedValueOrDefault("Flags",sal_Int32()));
                            lList.push_back(sFilter);
                            lAlienList.push_back(0 != (nFlags & SFX_FILTER_ALIEN));
                            lAlienList.push_back(bool(nFlags & SfxFilterFlags::ALIEN));
                            lODFList.push_back( isODFFormat( sFilter ) );
                        }
                    }
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index ec19a52..06afe78 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -221,7 +221,7 @@ namespace dbaui
                    ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
                    0,
                    aModule.GetFactoryEmptyDocumentURL(SvtModuleOptions::E_CALC)
                    ,SFX_FILTER_IMPORT);
                    ,SfxFilterFlags::IMPORT);
                askForFileName(aFileDlg);
            }
            break;
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index b22be3d..c61aef3 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -95,9 +95,9 @@ const SfxFilter* impl_lookupExportFilterForUrl( const rtl::OUString& rUrl, const
    sQuery.append(":module=");
    sQuery.append(rFactory); // use long name here !
    sQuery.append(":iflags=");
    sQuery.append(OUString::number(SFX_FILTER_EXPORT));
    sQuery.append(OUString::number(static_cast<sal_Int32>(SfxFilterFlags::EXPORT)));
    sQuery.append(":eflags=");
    sQuery.append(OUString::number(SFX_FILTER_NOTINSTALLED));
    sQuery.append(OUString::number(static_cast<sal_Int32>(SFX_FILTER_NOTINSTALLED)));

    const Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
    const Reference< XContainerQuery > xFilterFactory(
@@ -117,7 +117,7 @@ const SfxFilter* impl_lookupExportFilterForUrl( const rtl::OUString& rUrl, const
            const SfxFilter* const pFilter( SfxFilter::GetFilterByName( aName ) );
            if ( pFilter && pFilter->CanExport() && pFilter->GetWildcard().Matches( rUrl ) )
            {
                if ( !pBestMatch || ( SFX_FILTER_PREFERED & pFilter->GetFilterFlags() ) )
                if ( !pBestMatch || ( SfxFilterFlags::PREFERED & pFilter->GetFilterFlags() ) )
                    pBestMatch = pFilter;
            }
        }
@@ -134,7 +134,7 @@ const SfxFilter* impl_getExportFilterFromUrl( const rtl::OUString& rUrl, const r
            UNO_QUERY_THROW );
    const rtl::OUString aTypeName( xTypeDetector->queryTypeByURL( rUrl ) );

    const SfxFilter* pFilter( SfxFilterMatcher( rFactory ).GetFilter4EA( aTypeName, SFX_FILTER_EXPORT ) );
    const SfxFilter* pFilter( SfxFilterMatcher( rFactory ).GetFilter4EA( aTypeName, SfxFilterFlags::EXPORT ) );
    if ( !pFilter )
        pFilter = impl_lookupExportFilterForUrl( rUrl, rFactory );
    if ( !pFilter )
diff --git a/filter/qa/cppunit/filters-dxf-test.cxx b/filter/qa/cppunit/filters-dxf-test.cxx
index 8d5be38..11e5103 100644
--- a/filter/qa/cppunit/filters-dxf-test.cxx
+++ b/filter/qa/cppunit/filters-dxf-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool DxfFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-eps-test.cxx b/filter/qa/cppunit/filters-eps-test.cxx
index 2cab8cd..79e81f5 100644
--- a/filter/qa/cppunit/filters-eps-test.cxx
+++ b/filter/qa/cppunit/filters-eps-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool EpsFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-met-test.cxx b/filter/qa/cppunit/filters-met-test.cxx
index 69ced46..7607463 100644
--- a/filter/qa/cppunit/filters-met-test.cxx
+++ b/filter/qa/cppunit/filters-met-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool MetFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-pcd-test.cxx b/filter/qa/cppunit/filters-pcd-test.cxx
index 16fbefb..4ce202e 100644
--- a/filter/qa/cppunit/filters-pcd-test.cxx
+++ b/filter/qa/cppunit/filters-pcd-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool PcdFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-pcx-test.cxx b/filter/qa/cppunit/filters-pcx-test.cxx
index b478af5..cd72478 100644
--- a/filter/qa/cppunit/filters-pcx-test.cxx
+++ b/filter/qa/cppunit/filters-pcx-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool PcxFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-pict-test.cxx b/filter/qa/cppunit/filters-pict-test.cxx
index 0ea1301..ec69824 100644
--- a/filter/qa/cppunit/filters-pict-test.cxx
+++ b/filter/qa/cppunit/filters-pict-test.cxx
@@ -42,7 +42,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    OUString pictURL()
    {
@@ -64,7 +64,7 @@ public:

bool PictFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-ppm-test.cxx b/filter/qa/cppunit/filters-ppm-test.cxx
index 31b4941..e98ce6f 100644
--- a/filter/qa/cppunit/filters-ppm-test.cxx
+++ b/filter/qa/cppunit/filters-ppm-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool PpmFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-psd-test.cxx b/filter/qa/cppunit/filters-psd-test.cxx
index a453443..ea2bc1e 100644
--- a/filter/qa/cppunit/filters-psd-test.cxx
+++ b/filter/qa/cppunit/filters-psd-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool PsdFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-ras-test.cxx b/filter/qa/cppunit/filters-ras-test.cxx
index 66f23c9..a7f2a69 100644
--- a/filter/qa/cppunit/filters-ras-test.cxx
+++ b/filter/qa/cppunit/filters-ras-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool RasFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-tga-test.cxx b/filter/qa/cppunit/filters-tga-test.cxx
index f723c35..28b2450 100644
--- a/filter/qa/cppunit/filters-tga-test.cxx
+++ b/filter/qa/cppunit/filters-tga-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool TgaFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/filter/qa/cppunit/filters-tiff-test.cxx b/filter/qa/cppunit/filters-tiff-test.cxx
index bb73d8f..d4218a5 100644
--- a/filter/qa/cppunit/filters-tiff-test.cxx
+++ b/filter/qa/cppunit/filters-tiff-test.cxx
@@ -36,7 +36,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    /**
     * Ensure CVEs remain unbroken
@@ -50,7 +50,7 @@ public:

bool TiffFilterTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/hwpfilter/qa/cppunit/test_hwpfilter.cxx b/hwpfilter/qa/cppunit/test_hwpfilter.cxx
index 6d6a697..d4fe836 100644
--- a/hwpfilter/qa/cppunit/test_hwpfilter.cxx
+++ b/hwpfilter/qa/cppunit/test_hwpfilter.cxx
@@ -28,7 +28,7 @@ namespace

        virtual bool load(const OUString &,
            const OUString &rURL, const OUString &,
            unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
            SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

        void test();

@@ -51,7 +51,7 @@ namespace

    bool HwpFilterTest::load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int)
        SfxFilterFlags, SotClipboardFormatId, unsigned int)
    {
        uno::Sequence< beans::PropertyValue > aDescriptor(1);
        aDescriptor[0].Name = "URL";
diff --git a/include/comphelper/documentconstants.hxx b/include/comphelper/documentconstants.hxx
index 268bf99..9cadc39 100644
--- a/include/comphelper/documentconstants.hxx
+++ b/include/comphelper/documentconstants.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_COMPHELPER_DOCUMENTCONSTANTS_HXX

#include <rtl/ustring.hxx>
#include <o3tl/typed_flags_set.hxx>

// formats of SO6/7
#define MIMETYPE_VND_SUN_XML_WRITER_ASCII               "application/vnd.sun.xml.writer"
@@ -72,8 +73,6 @@
#define ODFVER_011_TEXT "1.1"
#define ODFVER_012_TEXT "1.2"

#endif

// filter flags
// TODO/LATER: The flags should be part of the UNO specification

@@ -105,33 +104,43 @@
// in filter, and rename the obscure ones to describe their meaning
// using terms that are understandable.

#define SFX_FILTER_IMPORT            0x00000001L
#define SFX_FILTER_EXPORT            0x00000002L
#define SFX_FILTER_TEMPLATE          0x00000004L
#define SFX_FILTER_INTERNAL          0x00000008L
#define SFX_FILTER_TEMPLATEPATH      0x00000010L
#define SFX_FILTER_OWN               0x00000020L
#define SFX_FILTER_ALIEN             0x00000040L
#define SFX_FILTER_USESOPTIONS       0x00000080L
enum class SfxFilterFlags
{
    IMPORT            = 0x00000001L,
    EXPORT            = 0x00000002L,
    TEMPLATE          = 0x00000004L,
    INTERNAL          = 0x00000008L,
    TEMPLATEPATH      = 0x00000010L,
    OWN               = 0x00000020L,
    ALIEN             = 0x00000040L,
    USESOPTIONS       = 0x00000080L,

#define SFX_FILTER_DEFAULT           0x00000100L
#define SFX_FILTER_EXECUTABLE        0x00000200L
#define SFX_FILTER_SUPPORTSSELECTION 0x00000400L
#define SFX_FILTER_NOTINFILEDLG      0x00001000L
#define SFX_FILTER_OPENREADONLY      0x00010000L
#define SFX_FILTER_MUSTINSTALL       0x00020000L
#define SFX_FILTER_CONSULTSERVICE    0x00040000L
    DEFAULT           = 0x00000100L,
    EXECUTABLE        = 0x00000200L,
    SUPPORTSSELECTION = 0x00000400L,
    NOTINFILEDLG      = 0x00001000L,
    OPENREADONLY      = 0x00010000L,
    MUSTINSTALL       = 0x00020000L,
    CONSULTSERVICE    = 0x00040000L,

#define SFX_FILTER_STARONEFILTER     0x00080000L
#define SFX_FILTER_PACKED            0x00100000L
    STARONEFILTER     = 0x00080000L,
    PACKED            = 0x00100000L,

    ENCRYPTION        = 0x01000000L,
    PASSWORDTOMODIFY  = 0x02000000L,

#define SFX_FILTER_ENCRYPTION        0x01000000L
#define SFX_FILTER_PASSWORDTOMODIFY  0x02000000L
    PREFERED          = 0x10000000L,

#define SFX_FILTER_PREFERED          0x10000000L
    STARTPRESENTATION = 0x20000000L,

#define SFX_FILTER_VERSION_NONE      0
#define SFX_FILTER_NOTINSTALLED      SFX_FILTER_MUSTINSTALL | SFX_FILTER_CONSULTSERVICE
    NONE              = 0
};
namespace o3tl
{
    template<> struct typed_flags<SfxFilterFlags> : is_typed_flags<SfxFilterFlags, 0x331f17ffL> {};
}

#define SFX_FILTER_NOTINSTALLED (SfxFilterFlags::MUSTINSTALL | SfxFilterFlags::CONSULTSERVICE)

#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/mimeconfighelper.hxx b/include/comphelper/mimeconfighelper.hxx
index 1203c2b..9f9d9fd 100644
--- a/include/comphelper/mimeconfighelper.hxx
+++ b/include/comphelper/mimeconfighelper.hxx
@@ -32,6 +32,8 @@
#include <comphelper/comphelperdllapi.h>


enum class SfxFilterFlags;

namespace comphelper {

class COMPHELPER_DLLPUBLIC MimeConfigurationHelper
@@ -124,8 +126,8 @@ public:
    static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SearchForFilter(
                        const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery >& xFilterQuery,
                        const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aSearchRequest,
                        sal_Int32 nMustFlags,
                        sal_Int32 nDontFlags );
                        SfxFilterFlags nMustFlags,
                        SfxFilterFlags nDontFlags );

    static bool ClassIDsEqual( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID1,
                        const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID2 );
diff --git a/include/sfx2/docfac.hxx b/include/sfx2/docfac.hxx
index 509de0f..492cb4f 100644
--- a/include/sfx2/docfac.hxx
+++ b/include/sfx2/docfac.hxx
@@ -29,7 +29,6 @@
#include <rtl/ustring.hxx>

#include <sfx2/objsh.hxx>
#include <sfx2/sfxdefs.hxx>

class SfxMedium;
class SfxFilter;
diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx
index 5506f44..dad0da5 100644
--- a/include/sfx2/docfilt.hxx
+++ b/include/sfx2/docfilt.hxx
@@ -30,7 +30,6 @@
#include <sal/types.h>
#include <sot/formats.hxx>
#include <sfx2/dllapi.h>
#include <sfx2/sfxdefs.hxx>
#include <tools/wldcrd.hxx>

#define SFX_FILTER_STARTPRESENTATION 0x20000000L
@@ -78,13 +77,13 @@ public:
               const OUString& rServiceName );
    ~SfxFilter();

    bool IsAllowedAsTemplate() const { return (nFormatType & SFX_FILTER_TEMPLATE) != 0; }
    bool IsOwnFormat() const { return (nFormatType & SFX_FILTER_OWN) != 0; }
    bool IsOwnTemplateFormat() const { return (nFormatType & SFX_FILTER_TEMPLATEPATH) != 0; }
    bool IsAlienFormat() const { return (nFormatType & SFX_FILTER_ALIEN) != 0; }
    bool CanImport() const { return (nFormatType & SFX_FILTER_IMPORT) != 0; }
    bool CanExport() const { return (nFormatType & SFX_FILTER_EXPORT) != 0; }
    bool IsInternal() const { return (nFormatType & SFX_FILTER_INTERNAL) != 0; }
    bool IsAllowedAsTemplate() const { return bool(nFormatType & SfxFilterFlags::TEMPLATE); }
    bool IsOwnFormat() const { return bool(nFormatType & SfxFilterFlags::OWN); }
    bool IsOwnTemplateFormat() const { return bool(nFormatType & SfxFilterFlags::TEMPLATEPATH); }
    bool IsAlienFormat() const { return bool(nFormatType & SfxFilterFlags::ALIEN); }
    bool CanImport() const { return bool(nFormatType & SfxFilterFlags::IMPORT); }
    bool CanExport() const { return bool(nFormatType & SfxFilterFlags::EXPORT); }
    bool IsInternal() const { return bool(nFormatType & SfxFilterFlags::INTERNAL); }
    SfxFilterFlags  GetFilterFlags() const  { return nFormatType; }
    const OUString& GetFilterName() const { return maFilterName; }
    const OUString& GetMimeType() const { return aMimeType; }
diff --git a/include/sfx2/fcontnr.hxx b/include/sfx2/fcontnr.hxx
index 7a71a13..7e66740 100644
--- a/include/sfx2/fcontnr.hxx
+++ b/include/sfx2/fcontnr.hxx
@@ -29,7 +29,6 @@
#include <vcl/window.hxx>

#include <sfx2/docfilt.hxx>
#include <sfx2/sfxdefs.hxx>

#include <tools/ref.hxx>

@@ -85,10 +84,10 @@ public:

    const OUString      GetName() const;

    const SfxFilter*    GetAnyFilter( SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetAnyFilter( SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;

    SAL_DLLPRIVATE static void ReadFilters_Impl( bool bUpdate=false );
    SAL_DLLPRIVATE static void ReadSingleFilter_Impl( const OUString& rName,
@@ -112,19 +111,19 @@ public:
    SAL_DLLPRIVATE static bool IsFilterInstalled_Impl( const SfxFilter* pFilter );
    DECL_DLLPRIVATE_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, OUString* );

    sal_uInt32               GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    sal_uInt32               GuessFilter( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    sal_uInt32               GuessFilterControlDefaultUI( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED, bool bDefUI = true ) const;
    sal_uInt32               GuessFilterIgnoringContent( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    sal_uInt32               GuessFilter( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    sal_uInt32               GuessFilterControlDefaultUI( SfxMedium& rMedium, const SfxFilter **, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED, bool bDefUI = true ) const;
    sal_uInt32               DetectFilter( SfxMedium& rMedium, const SfxFilter **, bool bPlugIn, bool bAPI = false ) const;

    const SfxFilter*    GetFilter4Mime( const OUString& rMime, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const;
    const SfxFilter*    GetFilter4ClipBoardId( SotClipboardFormatId nId, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4UIName( const OUString& rName, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilterForProps( const com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue >& aSeq, SfxFilterFlags nMust = 0, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetAnyFilter( SfxFilterFlags nMust=0, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4Mime( const OUString& rMime, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) const;
    const SfxFilter*    GetFilter4ClipBoardId( SotClipboardFormatId nId, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4EA( const OUString& rEA, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4Extension( const OUString& rExt, SfxFilterFlags nMust = SfxFilterFlags::IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4FilterName( const OUString& rName, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilter4UIName( const OUString& rName, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetFilterForProps( const com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue >& aSeq, SfxFilterFlags nMust = SfxFilterFlags::NONE, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
    const SfxFilter*    GetAnyFilter( SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED ) const;
};

class SfxFilterContainer_Impl;
@@ -139,7 +138,7 @@ class SFX2_DLLPUBLIC SfxFilterMatcherIter : private boost::noncopyable
    SAL_DLLPRIVATE const SfxFilter* Find_Impl();

public:
    SfxFilterMatcherIter( const SfxFilterMatcher& rMatcher, SfxFilterFlags nMask = 0, SfxFilterFlags nNotMask = SFX_FILTER_NOTINSTALLED );
    SfxFilterMatcherIter( const SfxFilterMatcher& rMatcher, SfxFilterFlags nMask = SfxFilterFlags::NONE, SfxFilterFlags nNotMask = SFX_FILTER_NOTINSTALLED );
    const SfxFilter* First();
    const SfxFilter* Next();
};
diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx
index 2afd9ae..34688c1 100644
--- a/include/sfx2/filedlghelper.hxx
+++ b/include/sfx2/filedlghelper.hxx
@@ -30,7 +30,6 @@
#include <vcl/edit.hxx>
#include <vcl/button.hxx>
#include <vcl/graph.hxx>
#include <sfx2/sfxdefs.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/docfilt.hxx>

@@ -108,8 +107,8 @@ public:
                            FileDialogHelper( sal_Int16 nDialogType,
                                              sal_Int64 nFlags,
                                              const OUString& rFactory,
                                              SfxFilterFlags nMust = 0,
                                              SfxFilterFlags nDont = 0 );
                                              SfxFilterFlags nMust = SfxFilterFlags::NONE,
                                              SfxFilterFlags nDont = SfxFilterFlags::NONE );

                            FileDialogHelper( sal_Int16 nDialogType,
                                              sal_Int64 nFlags,
diff --git a/include/sfx2/sfxdefs.hxx b/include/sfx2/sfxdefs.hxx
deleted file mode 100644
index 2533f1f..0000000
--- a/include/sfx2/sfxdefs.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef INCLUDED_SFX2_SFXDEFS_HXX
#define INCLUDED_SFX2_SFXDEFS_HXX

#include <sal/types.h>

typedef sal_uInt32 SfxFilterFlags;

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/unotest/filters-test.hxx b/include/unotest/filters-test.hxx
index 5bbc646..5af991e 100644
--- a/include/unotest/filters-test.hxx
+++ b/include/unotest/filters-test.hxx
@@ -43,7 +43,7 @@ public:
        //additional filter data for SfxFilter
        const OUString &rUserData = OUString(),
        //SfxFilterFlags for SfxFilter
        unsigned int nFilterFlags = SFX_FILTER_IMPORT,
        SfxFilterFlags nFilterFlags = SfxFilterFlags::IMPORT,
        //Clipboard id for SfxFilter
        SotClipboardFormatId nClipboardID = SotClipboardFormatId::NONE,
        //additional filter version for SfxFilter
@@ -55,7 +55,7 @@ public:
        const OUString &rFilter,
        const OUString &rURL,
        const OUString &rUserData,
        unsigned int nFilterFlags,
        SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID,
        unsigned int nFilterVersion) = 0;

@@ -63,7 +63,7 @@ public:
        const OUString &/*rFilter*/,
        const OUString &/*rURL*/,
        const OUString &/*rUserData*/,
        unsigned int /*nFilterFlags*/,
        SfxFilterFlags /*nFilterFlags*/,
        SotClipboardFormatId /*nClipboardID*/,
        unsigned int /*nFilterVersion*/)
    {
@@ -78,7 +78,7 @@ protected:
        const OUString &rFilter,
        const OUString &rURL,
        const OUString &rUserData,
        unsigned int nFilterFlags,
        SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID,
        unsigned int nFilterVersion,
        bool bExport);
diff --git a/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx b/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
index 14a554e..7371136 100644
--- a/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
+++ b/lotuswordpro/qa/cppunit/test_lotuswordpro.cxx
@@ -29,7 +29,7 @@ namespace

        virtual bool load(const OUString &,
            const OUString &rURL, const OUString &,
            unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
            SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

        void test();

@@ -51,7 +51,7 @@ namespace

    bool LotusWordProTest::load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int)
        SfxFilterFlags, SotClipboardFormatId, unsigned int)
    {
        uno::Sequence< beans::PropertyValue > aDescriptor(1);
        aDescriptor[0].Name = "URL";
diff --git a/package/qa/cppunit/test_package.cxx b/package/qa/cppunit/test_package.cxx
index 35e4009..4dd3463 100644
--- a/package/qa/cppunit/test_package.cxx
+++ b/package/qa/cppunit/test_package.cxx
@@ -25,7 +25,7 @@ namespace

        virtual bool load(const OUString &,
            const OUString &rURL, const OUString &,
            unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
            SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

        void test();

@@ -36,7 +36,7 @@ namespace

    bool PackageTest::load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int)
        SfxFilterFlags, SotClipboardFormatId, unsigned int)
    {
        try
        {
diff --git a/sc/inc/scdll.hxx b/sc/inc/scdll.hxx
index 8dfd24e..952b819 100644
--- a/sc/inc/scdll.hxx
+++ b/sc/inc/scdll.hxx
@@ -23,7 +23,6 @@
class SfxMedium;
class SfxFilter;

#include <sfx2/sfxdefs.hxx>
#include <sfx2/module.hxx>
#include <sfx2/docfac.hxx>

diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 54eabf3..bfb2a8a 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -57,7 +57,7 @@ public:
    virtual void tearDown() SAL_OVERRIDE;

    virtual bool load( const OUString &rFilter, const OUString &rURL,
        const OUString &rUserData, unsigned int nFilterFlags,
        const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE;
    /**
     * Ensure CVEs remain unbroken
@@ -113,7 +113,7 @@ private:
};

bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL,
    const OUString &rUserData, unsigned int nFilterFlags,
    const OUString &rUserData, SfxFilterFlags nFilterFlags,
    SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)
{
    ScDocShellRef xDocShRef = ScBootstrapFixture::load(rURL, rFilter, rUserData,
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 11a22a8..d98e432 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -533,7 +533,7 @@ OUString toString(

ScDocShellRef ScBootstrapFixture::load( bool bReadWrite,
    const OUString& rURL, const OUString& rFilter, const OUString &rUserData,
    const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
    const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
    sal_uIntPtr nFilterVersion, const OUString* pPassword )
{
    SfxFilter* pFilter = new SfxFilter(
@@ -566,7 +566,7 @@ ScDocShellRef ScBootstrapFixture::load( bool bReadWrite,

ScDocShellRef ScBootstrapFixture::load(
    const OUString& rURL, const OUString& rFilter, const OUString &rUserData,
    const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
    const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
    sal_uIntPtr nFilterVersion, const OUString* pPassword )
{
    return load( false, rURL, rFilter, rUserData, rTypeName, nFilterFlags, nClipboardID,  nFilterVersion, pPassword );
@@ -580,12 +580,12 @@ ScDocShellRef ScBootstrapFixture::loadDoc(
    OUString aFileName;
    createFileURL( rFileName, aFileExtension, aFileName );
    OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8);
    unsigned int nFormatType = aFileFormats[nFormat].nFormatType;
    SfxFilterFlags nFormatType = aFileFormats[nFormat].nFormatType;
    SotClipboardFormatId nClipboardId = SotClipboardFormatId::NONE;
    if (nFormatType)
    if (nFormatType != SfxFilterFlags::NONE)
        nClipboardId = SotClipboardFormatId::STARCALC_8;

    return load(bReadWrite, aFileName, aFilterName, OUString(), aFilterType, nFormatType, nClipboardId, nFormatType);
    return load(bReadWrite, aFileName, aFilterName, OUString(), aFilterType, nFormatType, nClipboardId, static_cast<sal_uIntPtr>(nFormatType));
}

const FileFormat* ScBootstrapFixture::getFileFormats()
@@ -616,7 +616,7 @@ void ScBootstrapFixture::createCSVPath(const OUString& aFileBase, OUString& rCSV

ScDocShellRef ScBootstrapFixture::saveAndReload(
    ScDocShell* pShell, const OUString &rFilter,
    const OUString &rUserData, const OUString& rTypeName, sal_uLong nFormatType)
    const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType)
{

    utl::TempFile aTempFile;
@@ -667,7 +667,7 @@ boost::shared_ptr<utl::TempFile> ScBootstrapFixture::exportTo( ScDocShell* pShel
    pTempFile->EnableKillingFile();
    SfxMedium aStoreMedium( pTempFile->GetURL(), STREAM_STD_WRITE );
    SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE;
    sal_Int32 nFormatType = aFileFormats[nFormat].nFormatType;
    SfxFilterFlags nFormatType = aFileFormats[nFormat].nFormatType;
    if (nFormatType == ODS_FORMAT_TYPE)
        nExportFormat = SotClipboardFormatId::STARCHART_8;
    SfxFilter* pExportFilter = new SfxFilter(
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 20ab92c..3d3e0da 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -40,15 +40,15 @@
#define SCQAHELPER_DLLPUBLIC  SAL_DLLPUBLIC_IMPORT
#endif

#define ODS_FORMAT_TYPE 50331943
#define XLS_FORMAT_TYPE 318767171
#define XLSX_FORMAT_TYPE 268959811
#define LOTUS123_FORMAT_TYPE 268435649
#define CSV_FORMAT_TYPE  (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_USESOPTIONS)
#define HTML_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_USESOPTIONS)
#define DIF_FORMAT_TYPE 195
#define XLS_XML_FORMAT_TYPE (SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN)
#define XLSB_XML_FORMAT_TYPE 268959809
#define ODS_FORMAT_TYPE      static_cast<SfxFilterFlags>(50331943)
#define XLS_FORMAT_TYPE      static_cast<SfxFilterFlags>(318767171)
#define XLSX_FORMAT_TYPE     static_cast<SfxFilterFlags>(268959811)
#define LOTUS123_FORMAT_TYPE static_cast<SfxFilterFlags>(268435649)
#define CSV_FORMAT_TYPE      (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::USESOPTIONS)
#define HTML_FORMAT_TYPE     (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::USESOPTIONS)
#define DIF_FORMAT_TYPE      (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::USESOPTIONS)
#define XLS_XML_FORMAT_TYPE  (SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN)
#define XLSB_XML_FORMAT_TYPE static_cast<SfxFilterFlags>(268959809)

#define ODS      0
#define XLS      1
@@ -91,7 +91,7 @@ struct TestParam
};

struct FileFormat {
    const char* pName; const char* pFilterName; const char* pTypeName; unsigned int nFormatType;
    const char* pName; const char* pFilterName; const char* pTypeName; SfxFilterFlags nFormatType;
};

// Printers for the calc data structures. Needed for the EQUAL assertion
@@ -225,12 +225,12 @@ protected:

    ScDocShellRef load(
        bool bReadWrite, const OUString& rURL, const OUString& rFilter, const OUString &rUserData,
        const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
        const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
        sal_uIntPtr nFilterVersion = SOFFICE_FILEFORMAT_CURRENT, const OUString* pPassword = NULL );

    ScDocShellRef load(
        const OUString& rURL, const OUString& rFilter, const OUString &rUserData,
        const OUString& rTypeName, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
        const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
        sal_uIntPtr nFilterVersion = SOFFICE_FILEFORMAT_CURRENT, const OUString* pPassword = NULL );

    ScDocShellRef loadDoc(const OUString& rFileName, sal_Int32 nFormat, bool bReadWrite = false );
@@ -246,7 +246,7 @@ public:
    void createCSVPath(const OUString& aFileBase, OUString& rCSVPath);

    ScDocShellRef saveAndReload(ScDocShell* pShell, const OUString &rFilter,
    const OUString &rUserData, const OUString& rTypeName, sal_uLong nFormatType);
    const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType);

    ScDocShellRef saveAndReload( ScDocShell* pShell, sal_Int32 nFormat );

diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 44bb074..17b0e11 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -64,7 +64,7 @@ public:
    virtual void tearDown() SAL_OVERRIDE;

    virtual bool load( const OUString &rFilter, const OUString &rURL,
            const OUString &rUserData, unsigned int nFilterFlags,
            const OUString &rUserData, SfxFilterFlags nFilterFlags,
            SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE;
    void testSharedFormulaXLS();
#if 0
@@ -556,7 +556,7 @@ bool ScOpenCLTest::initTestEnv(const OUString& fileName, sal_Int32 nFormat,
}

bool ScOpenCLTest::load(const OUString &rFilter, const OUString &rURL,
    const OUString &rUserData, unsigned int nFilterFlags,
    const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)
{
    ScDocShellRef xDocShRef = ScBootstrapFixture::load(rURL, rFilter, rUserData,
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 0084145..b9be541 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -83,7 +83,7 @@ public:
    virtual void tearDown() SAL_OVERRIDE;

#if !defined MACOSX && !defined DRAGONFLY
    ScDocShellRef saveAndReloadPassword( ScDocShell*, const OUString&, const OUString&, const OUString&, sal_uLong );
    ScDocShellRef saveAndReloadPassword( ScDocShell*, const OUString&, const OUString&, const OUString&, SfxFilterFlags );
#endif

    void test();
@@ -219,7 +219,7 @@ void ScExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)

#if !defined MACOSX && !defined DRAGONFLY
ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUString &rFilter,
    const OUString &rUserData, const OUString& rTypeName, sal_uLong nFormatType)
    const OUString &rUserData, const OUString& rTypeName, SfxFilterFlags nFormatType)
{
    utl::TempFile aTempFile;
    aTempFile.EnableKillingFile();
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 01dae64..16a0e08 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -83,7 +83,7 @@ public:
    ScFiltersTest();

    virtual bool load( const OUString &rFilter, const OUString &rURL,
        const OUString &rUserData, unsigned int nFilterFlags,
        const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE;

    virtual void setUp() SAL_OVERRIDE;
@@ -286,7 +286,7 @@ private:
};

bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL,
    const OUString &rUserData, unsigned int nFilterFlags,
    const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)
{
    ScDocShellRef xDocShRef = ScBootstrapFixture::load( rURL, rFilter, rUserData,
@@ -1388,8 +1388,8 @@ void ScFiltersTest::testBrokenQuotesCSV()
    OUString aFilterType(getFileFormats()[CSV].pTypeName, strlen(getFileFormats()[CSV].pTypeName), RTL_TEXTENCODING_UTF8);
    std::cout << getFileFormats()[CSV].pName << " Test" << std::endl;

    unsigned int nFormatType = getFileFormats()[CSV].nFormatType;
    SotClipboardFormatId nClipboardId = nFormatType ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE;
    SfxFilterFlags nFormatType = getFileFormats()[CSV].nFormatType;
    SotClipboardFormatId nClipboardId = bool(nFormatType) ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE;
    ScDocShellRef xDocSh = ScBootstrapFixture::load(aFileName, aFilterName, OUString(), aFilterType,
        nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT);

@@ -1415,8 +1415,8 @@ void ScFiltersTest::testCellValueXLSX()
    OUString aFilterType(getFileFormats()[XLSX].pTypeName, strlen(getFileFormats()[XLSX].pTypeName), RTL_TEXTENCODING_UTF8);
    std::cout << getFileFormats()[XLSX].pName << " Test" << std::endl;

    unsigned int nFormatType = getFileFormats()[XLSX].nFormatType;
    SotClipboardFormatId nClipboardId = nFormatType ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE;
    SfxFilterFlags nFormatType = getFileFormats()[XLSX].nFormatType;
    SotClipboardFormatId nClipboardId = bool(nFormatType) ? SotClipboardFormatId::STARCALC_8 : SotClipboardFormatId::NONE;
    ScDocShellRef xDocSh = ScBootstrapFixture::load( aFileName, aFilterName, OUString(), aFilterType,
        nFormatType, nClipboardId, SOFFICE_FILEFORMAT_CURRENT);

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 536c8c5..fa3895f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2223,7 +2223,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
            /*  #i104990# If the imported document contains a medium
                password, determine if we can save it, otherwise ask the users
                whether they want to save without it. */
            if( (rMed.GetFilter()->GetFilterFlags() & SFX_FILTER_ENCRYPTION) == 0 )
            if( (rMed.GetFilter()->GetFilterFlags() & SfxFilterFlags::ENCRYPTION) == SfxFilterFlags::NONE )
            {
                SfxItemSet* pItemSet = rMed.GetItemSet();
                const SfxPoolItem* pItem = 0;
diff --git a/sd/inc/sddll.hxx b/sd/inc/sddll.hxx
index defc99d..36c9c0e 100644
--- a/sd/inc/sddll.hxx
+++ b/sd/inc/sddll.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SD_INC_SDDLL_HXX

#include <sfx2/module.hxx>
#include <sfx2/sfxdefs.hxx>

/*************************************************************************
|*
diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx
index 272f4a4..0115d59 100644
--- a/sd/qa/unit/filters-test.cxx
+++ b/sd/qa/unit/filters-test.cxx
@@ -42,7 +42,7 @@ public:

    virtual bool load( const OUString &rFilter,
        const OUString &rURL, const OUString &rUserData,
        unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
        SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
        unsigned int nFilterVersion) SAL_OVERRIDE;

    virtual void setUp() SAL_OVERRIDE;
@@ -60,7 +60,7 @@ private:
};

bool SdFiltersTest::load(const OUString &rFilter, const OUString &rURL,
    const OUString &rUserData, unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
    const OUString &rUserData, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
    unsigned int nFilterVersion)
{
    SfxFilter aFilter(
@@ -86,7 +86,7 @@ void SdFiltersTest::testCVEs()

    testDir(OUString("Impress Office Open XML"),
            getURLFromSrc("/sd/qa/unit/data/pptx/"),
            OUString(""),  (SFX_FILTER_IMPORT | SFX_FILTER_ALIEN | SFX_FILTER_STARONEFILTER));
            OUString(""),  (SfxFilterFlags::IMPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::STARONEFILTER));

    testDir(OUString("impress8"),
            getURLFromSrc("/sd/qa/unit/data/odp/"),
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 430d07d..c0ad5af 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -36,18 +36,18 @@ struct FileFormat
    const char* pFilterName;
    const char* pTypeName;
    const char* pUserData;
    sal_uLong nFormatType;
    SfxFilterFlags nFormatType;
};

// These values are taken from "Flags" in filter/source/config/fragments/filters/*
// You need to turn value of oor:name="Flags" to SFX_FILTER_*, see
// You need to turn value of oor:name="Flags" to SfxFilterFlags::*, see
// include/comphelper/documentconstants.hxx for the possible values.
// Note: 3RDPARTYFILTER == SFX_FILTER_STARONEFILTER
#define ODP_FORMAT_TYPE  ( SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_TEMPLATE | SFX_FILTER_OWN | SFX_FILTER_DEFAULT | SFX_FILTER_ENCRYPTION | SFX_FILTER_PREFERED )
#define PPT_FORMAT_TYPE  ( SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN )
#define PPTX_FORMAT_TYPE ( SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_ALIEN | SFX_FILTER_STARONEFILTER | SFX_FILTER_PREFERED )
#define HTML_FORMAT_TYPE ( SFX_FILTER_EXPORT | SFX_FILTER_ALIEN )
#define PDF_FORMAT_TYPE  ( SFX_FILTER_STARONEFILTER | SFX_FILTER_ALIEN | SFX_FILTER_IMPORT | SFX_FILTER_PREFERED )
// Note: 3RDPARTYFILTER == SfxFilterFlags::STARONEFILTER
#define ODP_FORMAT_TYPE  ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::TEMPLATE | SfxFilterFlags::OWN | SfxFilterFlags::DEFAULT | SfxFilterFlags::ENCRYPTION | SfxFilterFlags::PREFERED )
#define PPT_FORMAT_TYPE  ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN )
#define PPTX_FORMAT_TYPE ( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN | SfxFilterFlags::STARONEFILTER | SfxFilterFlags::PREFERED )
#define HTML_FORMAT_TYPE ( SfxFilterFlags::EXPORT | SfxFilterFlags::ALIEN )
#define PDF_FORMAT_TYPE  ( SfxFilterFlags::STARONEFILTER | SfxFilterFlags::ALIEN | SfxFilterFlags::IMPORT | SfxFilterFlags::PREFERED )

/** List of file formats we support in Impress unit tests.

@@ -64,7 +64,7 @@ FileFormat aFileFormats[] =
    { "pptx", "Impress Office Open XML", "Office Open XML Presentation", "", PPTX_FORMAT_TYPE },
    { "html", "graphic_HTML", "graphic_HTML", "", HTML_FORMAT_TYPE },
    { "pdf",  "draw_pdf_import", "pdf_Portable_Document_Format", "", PDF_FORMAT_TYPE },
    { 0, 0, 0, 0, 0 }
    { 0, 0, 0, 0, SfxFilterFlags::NONE }
};

#define ODP  0
@@ -107,7 +107,7 @@ protected:
        CPPUNIT_ASSERT_MESSAGE( "missing filter info", pFmt->pName != NULL );

        SotClipboardFormatId nOptions = SotClipboardFormatId::NONE;
        if (pFmt->nFormatType)
        if (pFmt->nFormatType != SfxFilterFlags::NONE)
            nOptions = SotClipboardFormatId::STARCALC_8;
        SfxFilter* aFilter = new SfxFilter(
            OUString::createFromAscii( pFmt->pFilterName ),
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index e563539..f80a756 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -162,51 +162,51 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                // Get other draw/impress filters
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARIMPRESS_60, SFX_FILTER_IMPORT, SFX_FILTER_TEMPLATEPATH );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARIMPRESS_60, SfxFilterFlags::IMPORT, SfxFilterFlags::TEMPLATEPATH );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARIMPRESS_60, SFX_FILTER_TEMPLATEPATH );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARIMPRESS_60, SfxFilterFlags::TEMPLATEPATH );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_60, SFX_FILTER_IMPORT, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_60, SfxFilterFlags::IMPORT, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_60, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_60, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARIMPRESS_50, SFX_FILTER_IMPORT, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARIMPRESS_50, SfxFilterFlags::IMPORT, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARIMPRESS_50, SFX_FILTER_TEMPLATEPATH );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARIMPRESS_50, SfxFilterFlags::TEMPLATEPATH );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_50, SFX_FILTER_IMPORT, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_50, SfxFilterFlags::IMPORT, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_50, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_50, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_40, SFX_FILTER_IMPORT, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_40, SfxFilterFlags::IMPORT, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_40, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW_40, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW, SFX_FILTER_IMPORT, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW, SfxFilterFlags::IMPORT, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW, SFX_FILTER_TEMPLATEPATH  );
                pFilter = aMatch.GetFilter4ClipBoardId( SotClipboardFormatId::STARDRAW, SfxFilterFlags::TEMPLATEPATH  );
                if( pFilter )
                    xFilterManager->appendFilter( pFilter->GetUIName(), pFilter->GetDefaultExtension() );

@@ -250,7 +250,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
    SfxMedium*          pMedium = new SfxMedium( aFile, StreamMode::READ | StreamMode::NOCREATE );
    const SfxFilter*    pFilter = NULL;

    SfxGetpApp()->GetFilterMatcher().GuessFilter( *pMedium, &pFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
    SfxGetpApp()->GetFilterMatcher().GuessFilter( *pMedium, &pFilter, SfxFilterFlags::IMPORT, SFX_FILTER_NOTINSTALLED | SfxFilterFlags::EXECUTABLE );

    bool                bDrawMode = mpViewShell && mpViewShell->ISA(DrawViewShell);
    bool                bInserted = false;
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 04d64b7..205f17a 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -449,7 +449,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl)
            {
                const SfxFilter*        pFoundFilter = NULL;
                SfxMedium               aSfxMedium( aCurrentDropFile, StreamMode::READ | StreamMode::SHARE_DENYNONE );
                ErrCode                 nErr = SfxGetpApp()->GetFilterMatcher().GuessFilter(  aSfxMedium, &pFoundFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
                ErrCode                 nErr = SfxGetpApp()->GetFilterMatcher().GuessFilter(  aSfxMedium, &pFoundFilter, SfxFilterFlags::IMPORT, SFX_FILTER_NOTINSTALLED | SfxFilterFlags::EXECUTABLE );

                if( pFoundFilter && !nErr )
                {
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index d684f8b..92d7c32 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 5405efb..1463572 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 c814317..78d1897 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 b3f3f94..b12521f 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 5d3edd3..41d8097c 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 2599f35..ad59751 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 4d51f8e..b4beffb 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 98bf20d..03b4e3a 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 2129913..55f73c05 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 644c37b..f62c77c 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 48aae16..24ad62e 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() )
    {
diff --git a/sot/qa/cppunit/test_sot.cxx b/sot/qa/cppunit/test_sot.cxx
index d984e2e..3c24588 100644
--- a/sot/qa/cppunit/test_sot.cxx
+++ b/sot/qa/cppunit/test_sot.cxx
@@ -33,7 +33,7 @@ namespace

        virtual bool load(const OUString &,
            const OUString &rURL, const OUString &,
            unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
            SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

        void test();
        void testSize();
@@ -104,7 +104,7 @@ namespace

    bool SotTest::load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int)
        SfxFilterFlags, SotClipboardFormatId, unsigned int)
    {
        SvFileStream aStream(rURL, StreamMode::READ);
        SotStorageRef xObjStor = new SotStorage(aStream);
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index 293d94d..3cfce68 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -44,7 +44,7 @@ private:
        // filter/source/config/fragments/filters/MathML_XML__Math_.xcu
        SfxFilter* pFilter = new SfxFilter(MATHML_XML,
                                           OUString(),
                                           SFX_FILTER_IMPORT | SFX_FILTER_EXPORT | SFX_FILTER_TEMPLATE,
                                           SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::TEMPLATE,
                                           SotClipboardFormatId::STARCALC_8,
                                           "MathML 1.01",
                                           0,
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index a6851f5..12f8e55 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -1489,7 +1489,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte
                const SfxFilter*    pSfxFilter = NULL;
                SfxMedium           aSfxMedium( aURL, referer_, StreamMode::READ | StreamMode::SHARE_DENYNONE );

                SfxGetpApp()->GetFilterMatcher().GuessFilter( aSfxMedium, &pSfxFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
                SfxGetpApp()->GetFilterMatcher().GuessFilter( aSfxMedium, &pSfxFilter, SfxFilterFlags::IMPORT, SFX_FILTER_NOTINSTALLED | SfxFilterFlags::EXECUTABLE );

                if( !pSfxFilter )
                {
diff --git a/sw/inc/swdll.hxx b/sw/inc/swdll.hxx
index 9f5dddf..79b77b6 100644
--- a/sw/inc/swdll.hxx
+++ b/sw/inc/swdll.hxx
@@ -19,7 +19,6 @@
#ifndef INCLUDED_SW_INC_SWDLL_HXX
#define INCLUDED_SW_INC_SWDLL_HXX

#include <sfx2/sfxdefs.hxx>
#include <sfx2/module.hxx>

#include <swdllapi.h>
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 3de7da2..e6713fc 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -43,10 +43,10 @@ class SwFiltersTest
{
public:
    virtual bool load( const OUString &rFilter, const OUString &rURL,
        const OUString &rUserData, unsigned int nFilterFlags,
        const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE;
    virtual bool save( const OUString &rFilter, const OUString &rURL,
        const OUString &rUserData, unsigned int nFilterFlags,
        const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) SAL_OVERRIDE;
    virtual void setUp() SAL_OVERRIDE;

@@ -59,27 +59,27 @@ public:

private:
    bool filter( const OUString &rFilter, const OUString &rURL,
        const OUString &rUserData, unsigned int nFilterFlags,
        const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion, bool bExport);
    uno::Reference<uno::XInterface> m_xWriterComponent;
};

bool SwFiltersTest::load(const OUString &rFilter, const OUString &rURL,
    const OUString &rUserData, unsigned int nFilterFlags,
    const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)
{
    return filter(rFilter, rURL, rUserData, nFilterFlags, nClipboardID, nFilterVersion, false);
}

bool SwFiltersTest::save(const OUString &rFilter, const OUString &rURL,
    const OUString &rUserData, unsigned int nFilterFlags,
    const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion)
{
    return filter(rFilter, rURL, rUserData, nFilterFlags, nClipboardID, nFilterVersion, true);
}

bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL,
    const OUString &rUserData, unsigned int nFilterFlags,
    const OUString &rUserData, SfxFilterFlags nFilterFlags,
        SotClipboardFormatId nClipboardID, unsigned int nFilterVersion, bool bExport)
{
    SfxFilter* pFilter = new SfxFilter(
@@ -95,7 +95,7 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL,
    SfxFilter* pExportFilter = 0;
    if (bExport)
    {
        SfxGetpApp()->GetFilterMatcher().GuessFilter(*pSrcMed, &pImportFilter, SFX_FILTER_IMPORT, 0);
        SfxGetpApp()->GetFilterMatcher().GuessFilter(*pSrcMed, &pImportFilter, SfxFilterFlags::IMPORT, SfxFilterFlags::NONE);
        pExportFilter = pFilter;
    }
    else
@@ -138,13 +138,13 @@ void SwFiltersTest::testCVEs()
    testDir(OUString("Staroffice XML (Writer)"),
            getURLFromSrc("/sw/qa/core/data/xml/"),
            OUString(FILTER_XML),
            SFX_FILTER_IMPORT | SFX_FILTER_OWN | SFX_FILTER_DEFAULT,
            SfxFilterFlags::IMPORT | SfxFilterFlags::OWN | SfxFilterFlags::DEFAULT,
            isstorage, SOFFICE_FILEFORMAT_CURRENT);

    testDir(OUString("writer8"),
            getURLFromSrc("/sw/qa/core/data/odt/"),
            OUString(FILTER_XML),
            SFX_FILTER_IMPORT | SFX_FILTER_OWN | SFX_FILTER_DEFAULT,
            SfxFilterFlags::IMPORT | SfxFilterFlags::OWN | SfxFilterFlags::DEFAULT,
            isstorage, SOFFICE_FILEFORMAT_CURRENT);

    testDir(OUString("MS Word 97"),
@@ -162,12 +162,12 @@ void SwFiltersTest::testCVEs()
    testDir(OUString("MS Word 2007 XML"),
            getURLFromSrc("/sw/qa/core/data/ooxml/"),
            OUString(),
            SFX_FILTER_STARONEFILTER);
            SfxFilterFlags::STARONEFILTER);

    testDir(OUString("Rich Text Format"),
            getURLFromSrc("/sw/qa/core/data/rtf/"),
            OUString(),
            SFX_FILTER_STARONEFILTER);
            SfxFilterFlags::STARONEFILTER);

    testDir(OUString("HTML"),
            getURLFromSrc("/sw/qa/core/data/html/"),
@@ -176,12 +176,12 @@ void SwFiltersTest::testCVEs()
    testDir("T602Document",
            getURLFromSrc("/sw/qa/core/data/602/"),
            OUString(),
            SFX_FILTER_STARONEFILTER);
            SfxFilterFlags::STARONEFILTER);

    testDir("Rich Text Format",
            getURLFromSrc("/sw/qa/core/exportdata/rtf/"),
            OUString(),
            SFX_FILTER_STARONEFILTER,
            SfxFilterFlags::STARONEFILTER,
            SotClipboardFormatId::NONE,
            0,
            /*bExport=*/true);
@@ -189,7 +189,7 @@ void SwFiltersTest::testCVEs()
    testDir("HTML",
            getURLFromSrc("/sw/qa/core/exportdata/html/"),
            OUString(sHTML),
            0,
            SfxFilterFlags::NONE,
            SotClipboardFormatId::NONE,
            0,
            /*bExport=*/true);
@@ -197,7 +197,7 @@ void SwFiltersTest::testCVEs()
    testDir("MS Word 2007 XML",
            getURLFromSrc("/sw/qa/core/exportdata/ooxml/"),
            OUString(),
            SFX_FILTER_STARONEFILTER,
            SfxFilterFlags::STARONEFILTER,
            SotClipboardFormatId::NONE,
            0,
            /*bExport=*/true);
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 9cf6407..e0860c8f 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -174,7 +174,7 @@ void SwDocTest::testFileNameFields()

    SfxFilter aFilter(
        OUString("Text"),
        OUString(), 0, SotClipboardFormatId::NONE, OUString(), 0, OUString(),
        OUString(), SfxFilterFlags::NONE, SotClipboardFormatId::NONE, OUString(), 0, OUString(),
        OUString("TEXT"), OUString() );
    aDstMed.SetFilter(&aFilter);

diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index b6151ac..71e5e4f 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -494,7 +494,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline,
                DelSectionFmt( GetSections().front() );

            SfxFilterContainer* pFCntnr = mpDocShell->GetFactory().GetFilterContainer();
            pFilter = pFCntnr->GetFilter4EA( pFilter->GetTypeName(), SFX_FILTER_EXPORT );
            pFilter = pFCntnr->GetFilter4EA( pFilter->GetTypeName(), SfxFilterFlags::EXPORT );
        }
        break;

diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index cfe8c01..5fcfcc8 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1015,7 +1015,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, const OUString& rURL,
            pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, sBaseURL ) );

        SfxFilterMatcher aMatcher( rFact.GetFilterContainer()->GetName() );
        ErrCode nErr = aMatcher.GuessFilter(*pMed, &pFilter, SFX_FILTER_VERSION_NONE);
        ErrCode nErr = aMatcher.GuessFilter(*pMed, &pFilter, SfxFilterFlags::NONE);
        if ( nErr || !pFilter)
            DELETEZ(pMed);
        else
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index a02dc2b..85440c6 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -141,7 +141,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
                xFltMgr->appendFilter( pFlt->GetUIName(), sWild );

                // #i40125
                if(pFlt->GetFilterFlags() & SFX_FILTER_DEFAULT)
                if(pFlt->GetFilterFlags() & SfxFilterFlags::DEFAULT)
                    xFltMgr->setCurrentFilter( pFlt->GetUIName() ) ;
            }

diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 691ada2..b31e6f1 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -987,7 +987,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
        {
            pSfxFlt = pFilterContainer->GetFilter4FilterName(
                OUString("writer_pdf_Export"),
                SFX_FILTER_EXPORT);
                SfxFilterFlags::EXPORT);
        }
        break;
        case MM_DOCTYPE_WORD:
@@ -1020,12 +1020,12 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
        {
            bAsBody = true;
            pSfxFlt = pFilterContainer->GetFilter4FilterName(
                OUString("Text (encoded)"), SFX_FILTER_EXPORT);
                OUString("Text (encoded)"), SfxFilterFlags::EXPORT);
        }
        break;
    }
    if(!pSfxFlt)
        pSfxFlt = pFilterContainer->GetFilter4Extension(sExtension, SFX_FILTER_EXPORT);
        pSfxFlt = pFilterContainer->GetFilter4Extension(sExtension, SfxFilterFlags::EXPORT);

    if(!pSfxFlt)
        return 0;
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index c7385c0..8808098 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -347,9 +347,9 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell,
                xMSF->createInstance("com.sun.star.document.FilterFactory"), UNO_QUERY_THROW);
        uno::Reference< container::XContainerQuery > xQuery(xFilterFactory, UNO_QUERY_THROW);
        const OUString sCommand("matchByDocumentService=com.sun.star.text.TextDocument:iflags="
            + OUString::number(SFX_FILTER_EXPORT)
            + OUString::number(static_cast<sal_Int32>(SfxFilterFlags::EXPORT))
            + ":eflags="
            + OUString::number(SFX_FILTER_NOTINFILEDLG)
            + OUString::number(static_cast<sal_Int32>(SfxFilterFlags::NOTINFILEDLG))
            + ":default_first");
        uno::Reference< container::XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand);
        const OUString sName("Name");
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 8f89438..1b3e2c5 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -916,7 +916,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
            if( bEMail && !rMergeDescriptor.bSendAsAttachment )
            {
                OUString sExtension = rMergeDescriptor.bSendAsHTML ? OUString("html") : OUString("txt");
                pStoreToFilter = pFilterContainer->GetFilter4Extension(sExtension, SFX_FILTER_EXPORT);
                pStoreToFilter = pFilterContainer->GetFilter4Extension(sExtension, SfxFilterFlags::EXPORT);
            }
            else if( !rMergeDescriptor.sSaveToFilter.isEmpty())
            {
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index a0b53fa..2b3fc6f 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -729,7 +729,7 @@ bool SwGlossaryHdl::ImportGlossaries( const OUString& rName )
        boost::scoped_ptr<SfxMedium> pMed(new SfxMedium( rName, StreamMode::READ, 0, 0 ));
        SfxFilterMatcher aMatcher( OUString("swriter") );
        pMed->UseInteractionHandler( true );
        if (!aMatcher.GuessFilter(*pMed, &pFilter, SFX_FILTER_VERSION_NONE))
        if (!aMatcher.GuessFilter(*pMed, &pFilter, SfxFilterFlags::NONE))
        {
            SwTextBlocks *pGlossary = NULL;
            pMed->SetFilter( pFilter );
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 13eebe7..fc0a8de 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -305,7 +305,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
            // search for an html filter for export
            SfxFilterContainer* pFilterCont = GetObjectShell()->GetFactory().GetFilterContainer();
            const SfxFilter* pFilter =
                pFilterCont->GetFilter4Extension( OUString("html"), SFX_FILTER_EXPORT );
                pFilterCont->GetFilter4Extension( OUString("html"), SfxFilterFlags::EXPORT );
            if ( pFilter )
            {
                // filter found -> use its uiname and wildcard
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 9e91ac0..54776c6 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -2081,7 +2081,7 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUS
            pMed = new SfxMedium(rFileName, StreamMode::READ, 0, 0 );
            SfxFilterMatcher aMatcher( rFact.GetFilterContainer()->GetName() );
            pMed->UseInteractionHandler( true );
            ErrCode nErr = aMatcher.GuessFilter(*pMed, &pFilter, SFX_FILTER_VERSION_NONE);
            ErrCode nErr = aMatcher.GuessFilter(*pMed, &pFilter, SfxFilterFlags::NONE);
            if ( nErr )
                DELETEZ(pMed);
            else
@@ -2151,7 +2151,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe
            SwReader* pRdr;
            Reader *pRead = pDocSh->StartConvertFrom( *pMedium, &pRdr, m_pWrtShell );
            if( pRead ||
                (pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER) != 0 )
                (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER) )
            {
                sal_uInt16 nUndoCheck = 0;
                SwDoc *pDoc = pDocSh->GetDoc();
diff --git a/unotest/source/cpp/filters-test.cxx b/unotest/source/cpp/filters-test.cxx
index ac80a5b..bc4292c 100644
--- a/unotest/source/cpp/filters-test.cxx
+++ b/unotest/source/cpp/filters-test.cxx
@@ -52,7 +52,7 @@ void decode(const OUString& rIn, const OUString &rOut)

void FiltersTest::recursiveScan(filterStatus nExpected,
    const OUString &rFilter, const OUString &rURL,
    const OUString &rUserData, unsigned int nFilterFlags,
    const OUString &rUserData, SfxFilterFlags nFilterFlags,
    SotClipboardFormatId nClipboardID, unsigned int nFilterVersion, bool bExport)
{
    osl::Directory aDir(rURL);
@@ -131,7 +131,7 @@ void FiltersTest::recursiveScan(filterStatus nExpected,

void FiltersTest::testDir(const OUString &rFilter,
    const OUString &rURL, const OUString &rUserData,
    unsigned int nFilterFlags, SotClipboardFormatId nClipboardID,
    SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
    unsigned int nFilterVersion, bool bExport)
{
    fprintf(stderr, "File tested,Test Result,Execution tools::Time (ms)\n");
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index ae7a205..81706f8 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -32,7 +32,7 @@ public:

    virtual bool load(const OUString &,
        const OUString &rURL, const OUString &,
        unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
        SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    void checkExportImport(const OUString& aFilterShortName);

@@ -53,7 +53,7 @@ public:

bool VclFiltersTest::load(const OUString &,
    const OUString &rURL, const OUString &,
    unsigned int, SotClipboardFormatId, unsigned int)
    SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    SvFileStream aFileStream(rURL, StreamMode::READ);
    Graphic aGraphic;
diff --git a/writerfilter/qa/cppunittests/rtftok/testrtftok.cxx b/writerfilter/qa/cppunittests/rtftok/testrtftok.cxx
index 6340f55..3733767 100644
--- a/writerfilter/qa/cppunittests/rtftok/testrtftok.cxx
+++ b/writerfilter/qa/cppunittests/rtftok/testrtftok.cxx
@@ -35,7 +35,7 @@ public:

    virtual bool load(const OUString&,
                      const OUString& rURL, const OUString&,
                      unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
                      SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    void test();

@@ -55,7 +55,7 @@ void RtfTest::setUp()

bool RtfTest::load(const OUString&,
                   const OUString& rURL, const OUString&,
                   unsigned int, SotClipboardFormatId, unsigned int)
                   SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    uno::Sequence< beans::PropertyValue > aDescriptor =
    {
diff --git a/writerperfect/qa/unit/WpftImportTestBase.cxx b/writerperfect/qa/unit/WpftImportTestBase.cxx
index 740f55b..874b4d6 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.cxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.cxx
@@ -73,7 +73,7 @@ void WpftImportTestBase::tearDown()
}

bool WpftImportTestBase::load(const OUString &, const OUString &rURL, const OUString &,
                              unsigned int, SotClipboardFormatId, unsigned int)
                              SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
    // create an empty frame
    const uno::Reference<lang::XComponent> xDoc(
diff --git a/writerperfect/qa/unit/WpftImportTestBase.hxx b/writerperfect/qa/unit/WpftImportTestBase.hxx
index 0f90102..7df8511 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.hxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.hxx
@@ -69,7 +69,7 @@ protected:

private:
    virtual bool load(const OUString &, const OUString &rURL, const OUString &,
                      unsigned int, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;
                      SfxFilterFlags, SotClipboardFormatId, unsigned int) SAL_OVERRIDE;

    void impl_detectFilterName(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &rDescriptor, const rtl::OUString &rTypeName);