diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-12 14:53:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-18 14:23:50 +0200 |
commit | fb14be5f8f74f83ba89e15f891ddf1f753dcc62f (patch) | |
tree | beaa4af08b0c3d75bf6e40b21b96c55e0ac1c60a /sfx2/source/doc/objstor.cxx | |
parent | convert AccessibleStates to enum class (diff) | |
download | core-fb14be5f8f74f83ba89e15f891ddf1f753dcc62f.tar.gz core-fb14be5f8f74f83ba89e15f891ddf1f753dcc62f.zip |
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 'sfx2/source/doc/objstor.cxx')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 59cb2e81ad45..2129913c5137 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -310,25 +310,25 @@ namespace { * Chart2 does not have an Object shell, so handle this here for now * If we ever implement a full scale object shell in chart2 move it there */ -sal_uInt32 GetChartVersion( sal_Int32 nVersion, bool bTemplate ) +SotClipboardFormatId GetChartVersion( sal_Int32 nVersion, bool bTemplate ) { if( nVersion == SOFFICE_FILEFORMAT_60) { - return SOT_FORMATSTR_ID_STARCHART_60; + return SotClipboardFormatId::STARCHART_60; } else if( nVersion == SOFFICE_FILEFORMAT_8) { if (bTemplate) { SAL_WARN("sfx", "no chart template support yet"); - return SOT_FORMATSTR_ID_STARCHART_8; + return SotClipboardFormatId::STARCHART_8; } else - return SOT_FORMATSTR_ID_STARCHART_8; + return SotClipboardFormatId::STARCHART_8; } SAL_WARN("sfx", "unsupported version"); - return 0; + return SotClipboardFormatId::NONE; } } @@ -343,14 +343,14 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto { SvGlobalName aName; OUString aFullTypeName, aShortTypeName, aAppName; - sal_uInt32 nClipFormat=0; + SotClipboardFormatId nClipFormat = SotClipboardFormatId::NONE; if(!bChart) FillClass( &aName, &nClipFormat, &aAppName, &aFullTypeName, &aShortTypeName, nVersion, bTemplate ); else nClipFormat = GetChartVersion(nVersion, bTemplate); - if ( nClipFormat ) + if ( nClipFormat != SotClipboardFormatId::NONE ) { // basic doesn't have a ClipFormat // without MediaType the storage is not really usable, but currently the BasicIDE still @@ -1346,7 +1346,7 @@ bool SfxObjectShell::SaveTo_Impl // If the filter is a "cross export" filter ( f.e. a filter for exporting an impress document from // a draw document ), the ClassId of the destination storage is different from the ClassId of this // document. It can be retrieved from the default filter for the desired target format - long nFormat = rMedium.GetFilter()->GetFormat(); + SotClipboardFormatId nFormat = rMedium.GetFilter()->GetFormat(); SfxFilterMatcher& rMatcher = SfxGetpApp()->GetFilterMatcher(); const SfxFilter *pFilt = rMatcher.GetFilter4ClipBoardId( nFormat ); if ( pFilt ) @@ -3330,26 +3330,26 @@ bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::XSto { ::com::sun::star::datatransfer::DataFlavor aDataFlavor; aDataFlavor.MimeType = aMediaType; - sal_uInt32 nFormat = SotExchange::GetFormat( aDataFlavor ); + SotClipboardFormatId nFormat = SotExchange::GetFormat( aDataFlavor ); switch ( nFormat ) { - 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 SOT_FORMATSTR_ID_STARWRITER_8: - case SOT_FORMATSTR_ID_STARWRITERWEB_8: - case SOT_FORMATSTR_ID_STARWRITERGLOB_8: - case SOT_FORMATSTR_ID_STARDRAW_8: - case SOT_FORMATSTR_ID_STARIMPRESS_8: - case SOT_FORMATSTR_ID_STARCALC_8: - case SOT_FORMATSTR_ID_STARCHART_8: - case SOT_FORMATSTR_ID_STARMATH_8: + 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 : + case SotClipboardFormatId::STARWRITER_8: + case SotClipboardFormatId::STARWRITERWEB_8: + case SotClipboardFormatId::STARWRITERGLOB_8: + case SotClipboardFormatId::STARDRAW_8: + case SotClipboardFormatId::STARIMPRESS_8: + case SotClipboardFormatId::STARCALC_8: + case SotClipboardFormatId::STARCHART_8: + case SotClipboardFormatId::STARMATH_8: break; default: @@ -3468,26 +3468,26 @@ bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< embed { ::com::sun::star::datatransfer::DataFlavor aDataFlavor; aDataFlavor.MimeType = aMediaType; - sal_uInt32 nFormat = SotExchange::GetFormat( aDataFlavor ); + SotClipboardFormatId nFormat = SotExchange::GetFormat( aDataFlavor ); switch ( nFormat ) { - 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 SOT_FORMATSTR_ID_STARWRITER_8: - case SOT_FORMATSTR_ID_STARWRITERWEB_8: - case SOT_FORMATSTR_ID_STARWRITERGLOB_8: - case SOT_FORMATSTR_ID_STARDRAW_8: - case SOT_FORMATSTR_ID_STARIMPRESS_8: - case SOT_FORMATSTR_ID_STARCALC_8: - case SOT_FORMATSTR_ID_STARCHART_8: - case SOT_FORMATSTR_ID_STARMATH_8: + 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 : + case SotClipboardFormatId::STARWRITER_8: + case SotClipboardFormatId::STARWRITERWEB_8: + case SotClipboardFormatId::STARWRITERGLOB_8: + case SotClipboardFormatId::STARDRAW_8: + case SotClipboardFormatId::STARIMPRESS_8: + case SotClipboardFormatId::STARCALC_8: + case SotClipboardFormatId::STARCHART_8: + case SotClipboardFormatId::STARMATH_8: break; default: |