summaryrefslogtreecommitdiff
path: root/sot/source/sdstor/storage.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-12 14:53:28 +0200
committerNoel Grandin <noel@peralex.com>2015-03-18 14:23:50 +0200
commitfb14be5f8f74f83ba89e15f891ddf1f753dcc62f (patch)
treebeaa4af08b0c3d75bf6e40b21b96c55e0ac1c60a /sot/source/sdstor/storage.cxx
parentb8ce52aab9459773544f1696cfe6b7b6f171a389 (diff)
create new 'enum class' SotClipboardFormatId to unify types
of which there are several. There are some issues here I am unsure of - the SW and SC and CHART2 modules essentially ignore the enum values and assign their own ids Perhaps I should change them to use the common values and create new enum values where necessary? - the sc/qa/ and sq/qa/ and starmath/qa/ code was doing some dodgy stuff. I translated the code to pass down the stuff numeric values to the underlying code, but perhaps further fixing is necessary? Change-Id: Ic06d723e404481e3f1bca67c43b70321b764d923
Diffstat (limited to 'sot/source/sdstor/storage.cxx')
-rw-r--r--sot/source/sdstor/storage.cxx61
1 files changed, 31 insertions, 30 deletions
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 6de540de9d3b..d6e9bc1085f7 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -606,7 +606,7 @@ const OUString & SotStorage::GetName() const
}
void SotStorage::SetClass( const SvGlobalName & rName,
- sal_uLong nOriginalClipFormat,
+ SotClipboardFormatId nOriginalClipFormat,
const OUString & rUserTypeName )
{
DBG_ASSERT( Owner(), "must be owner" );
@@ -627,9 +627,9 @@ SvGlobalName SotStorage::GetClassName()
return aGN;
}
-sal_uLong SotStorage::GetFormat()
+SotClipboardFormatId SotStorage::GetFormat()
{
- sal_uLong nFormat = 0;
+ SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
DBG_ASSERT( Owner(), "must be owner" );
if( m_pOwnStg )
nFormat = m_pOwnStg->GetFormat();
@@ -863,11 +863,11 @@ SotStorage* SotStorage::OpenOLEStorage( const com::sun::star::uno::Reference < c
return new SotStorage( pStream, true );
}
-sal_Int32 SotStorage::GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage )
+SotClipboardFormatId SotStorage::GetFormatID( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage )
{
uno::Reference< beans::XPropertySet > xProps( xStorage, uno::UNO_QUERY );
if ( !xProps.is() )
- return 0;
+ return SotClipboardFormatId::NONE;
OUString aMediaType;
xProps->getPropertyValue("MediaType") >>= aMediaType;
@@ -878,39 +878,40 @@ sal_Int32 SotStorage::GetFormatID( const com::sun::star::uno::Reference < com::s
return SotExchange::GetFormat( aDataFlavor );
}
- return 0;
+ return SotClipboardFormatId::NONE;
}
sal_Int32 SotStorage::GetVersion( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage )
{
- sal_Int32 nSotFormatID = SotStorage::GetFormatID( xStorage );
+ SotClipboardFormatId nSotFormatID = SotStorage::GetFormatID( xStorage );
switch( nSotFormatID )
{
- case SOT_FORMATSTR_ID_STARWRITER_8:
- case SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE:
- case SOT_FORMATSTR_ID_STARWRITERWEB_8:
- case SOT_FORMATSTR_ID_STARWRITERGLOB_8:
- case SOT_FORMATSTR_ID_STARWRITERGLOB_8_TEMPLATE:
- case SOT_FORMATSTR_ID_STARDRAW_8:
- case SOT_FORMATSTR_ID_STARDRAW_8_TEMPLATE:
- case SOT_FORMATSTR_ID_STARIMPRESS_8:
- case SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE:
- case SOT_FORMATSTR_ID_STARCALC_8:
- case SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE:
- case SOT_FORMATSTR_ID_STARCHART_8:
- case SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE:
- case SOT_FORMATSTR_ID_STARMATH_8:
- case SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE:
+ case SotClipboardFormatId::STARWRITER_8:
+ case SotClipboardFormatId::STARWRITER_8_TEMPLATE:
+ case SotClipboardFormatId::STARWRITERWEB_8:
+ case SotClipboardFormatId::STARWRITERGLOB_8:
+ case SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE:
+ case SotClipboardFormatId::STARDRAW_8:
+ case SotClipboardFormatId::STARDRAW_8_TEMPLATE:
+ case SotClipboardFormatId::STARIMPRESS_8:
+ case SotClipboardFormatId::STARIMPRESS_8_TEMPLATE:
+ case SotClipboardFormatId::STARCALC_8:
+ case SotClipboardFormatId::STARCALC_8_TEMPLATE:
+ case SotClipboardFormatId::STARCHART_8:
+ case SotClipboardFormatId::STARCHART_8_TEMPLATE:
+ case SotClipboardFormatId::STARMATH_8:
+ case SotClipboardFormatId::STARMATH_8_TEMPLATE:
return SOFFICE_FILEFORMAT_8;
- case SOT_FORMATSTR_ID_STARWRITER_60:
- case SOT_FORMATSTR_ID_STARWRITERWEB_60:
- case SOT_FORMATSTR_ID_STARWRITERGLOB_60:
- case SOT_FORMATSTR_ID_STARDRAW_60:
- case SOT_FORMATSTR_ID_STARIMPRESS_60:
- case SOT_FORMATSTR_ID_STARCALC_60:
- case SOT_FORMATSTR_ID_STARCHART_60:
- case SOT_FORMATSTR_ID_STARMATH_60:
+ case SotClipboardFormatId::STARWRITER_60:
+ case SotClipboardFormatId::STARWRITERWEB_60:
+ case SotClipboardFormatId::STARWRITERGLOB_60:
+ case SotClipboardFormatId::STARDRAW_60:
+ case SotClipboardFormatId::STARIMPRESS_60:
+ case SotClipboardFormatId::STARCALC_60:
+ case SotClipboardFormatId::STARCHART_60:
+ case SotClipboardFormatId::STARMATH_60:
return SOFFICE_FILEFORMAT_60;
+ default: break;
}
return 0;