avoid name clash for CDataFormatTranslator in ftransl, tdf#100872

E.g.
http://crashreport.libreoffice.org/stats/signature/com::sun::datatransfer::DataFormatTranslator::create%28com::sun::uno::Reference%3Ccom::sun::uno::XComponentContext%3E%20const%20&%29

Change-Id: I55d7fc9a83526de0cc5f838f0ee2c7e4649dbe6b
Reviewed-on: https://gerrit.libreoffice.org/27157
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
Markus Mohrhard
2016-07-12 15:23:31 +02:00
parent aa595c5da6
commit 37204431c6
3 changed files with 16 additions and 18 deletions

View File

@@ -103,12 +103,12 @@ FormatEntry::FormatEntry(
// ctor // ctor
CDataFormatTranslator::CDataFormatTranslator( const Reference< XComponentContext >& rxContext ) : CDataFormatTranslatorUNO::CDataFormatTranslatorUNO( const Reference< XComponentContext >& rxContext ) :
m_xContext( rxContext ) m_xContext( rxContext )
{ {
} }
Any SAL_CALL CDataFormatTranslator::getSystemDataTypeFromDataFlavor( const DataFlavor& aDataFlavor ) Any SAL_CALL CDataFormatTranslatorUNO::getSystemDataTypeFromDataFlavor( const DataFlavor& aDataFlavor )
throw( RuntimeException ) throw( RuntimeException )
{ {
Any aAny; Any aAny;
@@ -163,7 +163,7 @@ Any SAL_CALL CDataFormatTranslator::getSystemDataTypeFromDataFlavor( const DataF
return aAny; return aAny;
} }
DataFlavor SAL_CALL CDataFormatTranslator::getDataFlavorFromSystemDataType( const Any& aSysDataType ) DataFlavor SAL_CALL CDataFormatTranslatorUNO::getDataFlavorFromSystemDataType( const Any& aSysDataType )
throw( RuntimeException ) throw( RuntimeException )
{ {
OSL_PRECOND( aSysDataType.hasValue( ), "Empty system data type delivered" ); OSL_PRECOND( aSysDataType.hasValue( ), "Empty system data type delivered" );
@@ -192,14 +192,14 @@ DataFlavor SAL_CALL CDataFormatTranslator::getDataFlavorFromSystemDataType( cons
// XServiceInfo // XServiceInfo
OUString SAL_CALL CDataFormatTranslator::getImplementationName( ) OUString SAL_CALL CDataFormatTranslatorUNO::getImplementationName( )
throw( RuntimeException ) throw( RuntimeException )
{ {
return OUString( IMPL_NAME ); return OUString( IMPL_NAME );
} }
// XServiceInfo // XServiceInfo
sal_Bool SAL_CALL CDataFormatTranslator::supportsService( const OUString& ServiceName ) sal_Bool SAL_CALL CDataFormatTranslatorUNO::supportsService( const OUString& ServiceName )
throw( RuntimeException ) throw( RuntimeException )
{ {
return cppu::supportsService(this, ServiceName); return cppu::supportsService(this, ServiceName);
@@ -207,7 +207,7 @@ sal_Bool SAL_CALL CDataFormatTranslator::supportsService( const OUString& Servic
// XServiceInfo // XServiceInfo
Sequence< OUString > SAL_CALL CDataFormatTranslator::getSupportedServiceNames( ) Sequence< OUString > SAL_CALL CDataFormatTranslatorUNO::getSupportedServiceNames( )
throw( RuntimeException ) throw( RuntimeException )
{ {
return DataFormatTranslator_getSupportedServiceNames( ); return DataFormatTranslator_getSupportedServiceNames( );
@@ -472,7 +472,7 @@ static const std::vector< FormatEntry > g_TranslTable {
FormatEntry("application/x-openoffice-dummy4;windows_formatname=\"SO_DUMMYFORMAT_4\"", "SO_DUMMYFORMAT_4", NULL, CF_INVALID, CPPUTYPE_DEFAULT), FormatEntry("application/x-openoffice-dummy4;windows_formatname=\"SO_DUMMYFORMAT_4\"", "SO_DUMMYFORMAT_4", NULL, CF_INVALID, CPPUTYPE_DEFAULT),
}; };
void SAL_CALL CDataFormatTranslator::findDataFlavorForStandardFormatId( sal_Int32 aStandardFormatId, DataFlavor& aDataFlavor ) const void SAL_CALL CDataFormatTranslatorUNO::findDataFlavorForStandardFormatId( sal_Int32 aStandardFormatId, DataFlavor& aDataFlavor ) const
{ {
/* /*
we break the for loop if we find the first CF_INVALID we break the for loop if we find the first CF_INVALID
@@ -494,7 +494,7 @@ void SAL_CALL CDataFormatTranslator::findDataFlavorForStandardFormatId( sal_Int3
} }
} }
void SAL_CALL CDataFormatTranslator::findDataFlavorForNativeFormatName( const OUString& aNativeFormatName, DataFlavor& aDataFlavor ) const void SAL_CALL CDataFormatTranslatorUNO::findDataFlavorForNativeFormatName( const OUString& aNativeFormatName, DataFlavor& aDataFlavor ) const
{ {
vector< FormatEntry >::const_iterator citer_end = g_TranslTable.end( ); vector< FormatEntry >::const_iterator citer_end = g_TranslTable.end( );
for ( vector< FormatEntry >::const_iterator citer = g_TranslTable.begin( ); for ( vector< FormatEntry >::const_iterator citer = g_TranslTable.begin( );
@@ -509,7 +509,7 @@ void SAL_CALL CDataFormatTranslator::findDataFlavorForNativeFormatName( const OU
} }
} }
void SAL_CALL CDataFormatTranslator::findStandardFormatIdForCharset( const OUString& aCharset, Any& aAny ) const void SAL_CALL CDataFormatTranslatorUNO::findStandardFormatIdForCharset( const OUString& aCharset, Any& aAny ) const
{ {
if ( aCharset.equalsIgnoreAsciiCase( "utf-16" ) ) if ( aCharset.equalsIgnoreAsciiCase( "utf-16" ) )
aAny <<= static_cast< sal_Int32 >( CF_UNICODETEXT ); aAny <<= static_cast< sal_Int32 >( CF_UNICODETEXT );
@@ -521,7 +521,7 @@ void SAL_CALL CDataFormatTranslator::findStandardFormatIdForCharset( const OUStr
} }
} }
void SAL_CALL CDataFormatTranslator::setStandardFormatIdForNativeFormatName( const OUString& aNativeFormatName, Any& aAny ) const void SAL_CALL CDataFormatTranslatorUNO::setStandardFormatIdForNativeFormatName( const OUString& aNativeFormatName, Any& aAny ) const
{ {
vector< FormatEntry >::const_iterator citer_end = g_TranslTable.end( ); vector< FormatEntry >::const_iterator citer_end = g_TranslTable.end( );
for ( vector< FormatEntry >::const_iterator citer = g_TranslTable.begin( ); citer != citer_end; ++citer ) for ( vector< FormatEntry >::const_iterator citer = g_TranslTable.begin( ); citer != citer_end; ++citer )
@@ -535,7 +535,7 @@ void SAL_CALL CDataFormatTranslator::setStandardFormatIdForNativeFormatName( con
} }
} }
void SAL_CALL CDataFormatTranslator::findStdFormatIdOrNativeFormatNameForFullMediaType( void SAL_CALL CDataFormatTranslatorUNO::findStdFormatIdOrNativeFormatNameForFullMediaType(
const Reference< XMimeContentTypeFactory >& aRefXMimeFactory, const Reference< XMimeContentTypeFactory >& aRefXMimeFactory,
const OUString& aFullMediaType, const OUString& aFullMediaType,
Any& aAny ) const Any& aAny ) const
@@ -561,12 +561,12 @@ void SAL_CALL CDataFormatTranslator::findStdFormatIdOrNativeFormatNameForFullMed
} }
} }
inline sal_Bool CDataFormatTranslator::isTextPlainMediaType( const OUString& fullMediaType ) const inline sal_Bool CDataFormatTranslatorUNO::isTextPlainMediaType( const OUString& fullMediaType ) const
{ {
return fullMediaType.equalsIgnoreAsciiCase("text/plain"); return fullMediaType.equalsIgnoreAsciiCase("text/plain");
} }
DataFlavor SAL_CALL CDataFormatTranslator::mkDataFlv(const OUString& cnttype, const OUString& hpname, Type dtype) DataFlavor SAL_CALL CDataFormatTranslatorUNO::mkDataFlv(const OUString& cnttype, const OUString& hpname, Type dtype)
{ {
DataFlavor dflv; DataFlavor dflv;
dflv.MimeType = cnttype; dflv.MimeType = cnttype;

View File

@@ -39,15 +39,13 @@
#pragma warning(pop) #pragma warning(pop)
#endif #endif
// CDataFormatTranslator class CDataFormatTranslatorUNO : public
class CDataFormatTranslator : public
cppu::WeakImplHelper< css::datatransfer::XDataFormatTranslator, cppu::WeakImplHelper< css::datatransfer::XDataFormatTranslator,
css::lang::XServiceInfo > css::lang::XServiceInfo >
{ {
public: public:
explicit CDataFormatTranslator( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); explicit CDataFormatTranslatorUNO( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
// XDataFormatTranslator // XDataFormatTranslator

View File

@@ -52,7 +52,7 @@ namespace
Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager ) Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
{ {
return Reference< XInterface >( static_cast< XDataFormatTranslator* >( new CDataFormatTranslator( comphelper::getComponentContext(rServiceManager) ) ) ); return Reference< XInterface >( static_cast< XDataFormatTranslator* >( new CDataFormatTranslatorUNO( comphelper::getComponentContext(rServiceManager) ) ) );
} }
} }