summaryrefslogtreecommitdiff
path: root/sot/source/base/exchange.cxx
diff options
context:
space:
mode:
authorBjörn Milcke <bm@openoffice.org>2001-03-15 12:08:29 +0000
committerBjörn Milcke <bm@openoffice.org>2001-03-15 12:08:29 +0000
commit0dd53c8d117b1716654c1aaf1a839ac9d0baf5b9 (patch)
treea4edf3755f884635754e3343b07d5d52544d2cf0 /sot/source/base/exchange.cxx
parent3608c62337fb8265f64eebc0cb32540621dba6ea (diff)
#84772# Hack for a temporary chart format string "StarChartDocument 5.0" (105) which was only used for 5.1 documents (but not 5.0/5.2). It is converted to 42 ("StarChart 5.0")
Diffstat (limited to 'sot/source/base/exchange.cxx')
-rw-r--r--sot/source/base/exchange.cxx27
1 files changed, 21 insertions, 6 deletions
diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index e2b448f8f49d..9c6a9ef4f297 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: exchange.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: ka $ $Date: 2001-03-12 12:55:34 $
+ * last change: $Author: bm $ $Date: 2001-03-15 13:08:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -254,10 +254,15 @@ ULONG SotExchange::RegisterFormatName( const String& rName )
if( COMPARE_EQUAL == rName.CompareToAscii( aFormatArray_Impl[ i ].pName ) )
return i;
+ // BM: the chart format 105 ("StarChartDocument 5.0") was written
+ // only into 5.1 chart documents - in 5.0 and 5.2 it was 42 ("StarChart 5.0")
+ // The registry only contains the entry for the 42 format id.
nMax = SOT_FORMATSTR_ID_USER_END;
for( i = SOT_FORMAT_RTF; i <= nMax; ++i )
- if( COMPARE_EQUAL == rName.CompareToAscii( aFormatArray_Impl[ i ].pName ) )
- return i;
+ if( rName.EqualsAscii( aFormatArray_Impl[ i ].pName ) )
+ return ( (i == SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50)
+ ? SOT_FORMATSTR_ID_STARCHART_50
+ : i );
// dann in der dynamischen Liste
List& rL = InitFormats_Impl();
@@ -382,10 +387,15 @@ ULONG SotExchange::GetFormatIdFromMimeType( const String& rMimeType )
if( rMimeType.EqualsAscii( aFormatArray_Impl[ i ].pMimeType ) )
return i;
+ // BM: the chart format 105 ("StarChartDocument 5.0") was written
+ // only into 5.1 chart documents - in 5.0 and 5.2 it was 42 ("StarChart 5.0")
+ // The registry only contains the entry for the 42 format id.
nMax = SOT_FORMATSTR_ID_USER_END;
for( i = SOT_FORMAT_RTF; i <= nMax; ++i )
if( rMimeType.EqualsAscii( aFormatArray_Impl[ i ].pMimeType ) )
- return i;
+ return ( (i == SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50)
+ ? SOT_FORMATSTR_ID_STARCHART_50
+ : i );
// dann in der dynamischen Liste
List& rL = InitFormats_Impl();
@@ -416,10 +426,15 @@ ULONG SotExchange::GetFormat( const DataFlavor& rFlavor )
if( aMimeType.EqualsAscii( aFormatArray_Impl[ i ].pMimeType ) )
return i;
+ // BM: the chart format 105 ("StarChartDocument 5.0") was written
+ // only into 5.1 chart documents - in 5.0 and 5.2 it was 42 ("StarChart 5.0")
+ // The registry only contains the entry for the 42 format id.
nMax = SOT_FORMATSTR_ID_USER_END;
for( i = SOT_FORMAT_RTF; i <= nMax; ++i )
if( aMimeType.EqualsAscii( aFormatArray_Impl[ i ].pMimeType ) )
- return i;
+ return ( (i == SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50)
+ ? SOT_FORMATSTR_ID_STARCHART_50
+ : i );
// dann in der dynamischen Liste
List& rL = InitFormats_Impl();