update dev300-m58
[ooovba.git] / sc / source / filter / inc / ftools.hxx
blob5c05b27094d6f231f9c64cb3f6c1dad9d879d4a8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ftools.hxx,v $
10 * $Revision: 1.24.4.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_FTOOLS_HXX
32 #define SC_FTOOLS_HXX
34 #include <vector>
35 #include <map>
36 #include <limits>
37 #include <memory>
38 #include <tools/string.hxx>
39 #include <tools/list.hxx>
40 #include <tools/debug.hxx>
41 #include "filter.hxx"
42 #include "scdllapi.h"
44 // Common macros ==============================================================
46 /** Expands to the size of a STATIC data array. */
47 #define STATIC_TABLE_SIZE( array ) (sizeof(array)/sizeof(*(array)))
48 /** Expands to a pointer behind the last element of a STATIC data array (like STL end()). */
49 #define STATIC_TABLE_END( array ) ((array)+STATIC_TABLE_SIZE(array))
51 /** Expands to a temporary String, created from an ASCII character array. */
52 #define CREATE_STRING( ascii ) String( RTL_CONSTASCII_USTRINGPARAM( ascii ) )
53 /** Expands to a temporary ::rtl::OUString, created from an ASCII character array. */
54 #undef CREATE_OUSTRING
55 #define CREATE_OUSTRING( ascii ) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ascii ) )
57 // items and item sets --------------------------------------------------------
59 /** Expands to the item (with type 'itemtype') with Which-ID 'which'. */
60 #define GETITEM( itemset, itemtype, which ) \
61 static_cast< const itemtype & >( (itemset).Get( which ) )
63 /** Expands to the value (with type 'valuetype') of the item with Which-ID 'which'. */
64 #define GETITEMVALUE( itemset, itemtype, which, valuetype ) \
65 static_cast< valuetype >( GETITEM( itemset, itemtype, which ).GetValue() )
67 /** Expands to the value of the SfxBoolItem with Which-ID 'which'. */
68 #define GETITEMBOOL( itemset, which ) \
69 GETITEMVALUE( itemset, SfxBoolItem, which, bool )
71 // Global static helpers ======================================================
73 // Value range limit helpers --------------------------------------------------
75 /** Returns the value, if it is not less than nMin, otherwise nMin. */
76 template< typename ReturnType, typename Type >
77 inline ReturnType llimit_cast( Type nValue, ReturnType nMin )
78 { return static_cast< ReturnType >( ::std::max< Type >( nValue, nMin ) ); }
80 /** Returns the value, if it fits into ReturnType, otherwise the minimum value of ReturnType. */
81 template< typename ReturnType, typename Type >
82 inline ReturnType llimit_cast( Type nValue )
83 { return llimit_cast( nValue, ::std::numeric_limits< ReturnType >::min() ); }
85 /** Returns the value, if it is not greater than nMax, otherwise nMax. */
86 template< typename ReturnType, typename Type >
87 inline ReturnType ulimit_cast( Type nValue, ReturnType nMax )
88 { return static_cast< ReturnType >( ::std::min< Type >( nValue, nMax ) ); }
90 /** Returns the value, if it fits into ReturnType, otherwise the maximum value of ReturnType. */
91 template< typename ReturnType, typename Type >
92 inline ReturnType ulimit_cast( Type nValue )
93 { return ulimit_cast( nValue, ::std::numeric_limits< ReturnType >::max() ); }
95 /** Returns the value, if it is not less than nMin and not greater than nMax, otherwise one of the limits. */
96 template< typename ReturnType, typename Type >
97 inline ReturnType limit_cast( Type nValue, ReturnType nMin, ReturnType nMax )
98 { return static_cast< ReturnType >( ::std::max< Type >( ::std::min< Type >( nValue, nMax ), nMin ) ); }
100 /** Returns the value, if it fits into ReturnType, otherwise one of the limits of ReturnType. */
101 template< typename ReturnType, typename Type >
102 inline ReturnType limit_cast( Type nValue )
103 { return limit_cast( nValue, ::std::numeric_limits< ReturnType >::min(), ::std::numeric_limits< ReturnType >::max() ); }
105 // Read from bitfields --------------------------------------------------------
107 /** Returns true, if at least one of the bits set in nMask is set in nBitField. */
108 template< typename Type >
109 inline bool get_flag( Type nBitField, Type nMask )
110 { return (nBitField & nMask) != 0; }
112 /** Returns nSet, if at least one bit of nMask is set in nBitField, otherwise nUnset. */
113 template< typename ReturnType, typename Type >
114 inline ReturnType get_flagvalue( Type nBitField, Type nMask, ReturnType nSet, ReturnType nUnset )
115 { return ::get_flag( nBitField, nMask ) ? nSet : nUnset; }
117 /** Extracts a value from a bit field.
118 @descr Returns in rnRet the data fragment from nBitField, that starts at bit nStartBit
119 (0-based, bit 0 is rightmost) with the width of nBitCount. rnRet will be right-aligned (normalized).
120 For instance: extract_value( n, 0x4321, 8, 4 ) stores 3 in n (value in bits 8-11). */
121 template< typename ReturnType, typename Type >
122 inline ReturnType extract_value( Type nBitField, sal_uInt8 nStartBit, sal_uInt8 nBitCount )
123 { return static_cast< ReturnType >( ((1UL << nBitCount) - 1) & (nBitField >> nStartBit) ); }
125 // Write to bitfields ---------------------------------------------------------
127 /** Sets or clears (according to bSet) all set bits of nMask in rnBitField. */
128 template< typename Type >
129 inline void set_flag( Type& rnBitField, Type nMask, bool bSet = true )
130 { if( bSet ) rnBitField |= nMask; else rnBitField &= ~nMask; }
132 /** Inserts a value into a bitfield.
133 @descr Inserts the lower nBitCount bits of nValue into rnBitField, starting
134 there at bit nStartBit. Other contents of rnBitField keep unchanged. */
135 template< typename Type, typename InsertType >
136 void insert_value( Type& rnBitField, InsertType nValue, sal_uInt8 nStartBit, sal_uInt8 nBitCount )
138 unsigned long nMask = ((1UL << nBitCount) - 1);
139 Type nNewValue = static_cast< Type >( nValue & nMask );
140 (rnBitField &= ~(nMask << nStartBit)) |= (nNewValue << nStartBit);
143 // ============================================================================
145 /** Deriving from this class prevents copy construction. */
146 class ScfNoCopy
148 private:
149 ScfNoCopy( const ScfNoCopy& );
150 ScfNoCopy& operator=( const ScfNoCopy& );
151 protected:
152 inline ScfNoCopy() {}
155 // ----------------------------------------------------------------------------
157 /** Deriving from this class prevents construction in general. */
158 class ScfNoInstance : private ScfNoCopy {};
160 // ============================================================================
162 /** Simple shared pointer (NOT thread-save, but faster than boost::shared_ptr). */
163 template< typename Type >
164 class ScfRef
166 template< typename > friend class ScfRef;
168 public:
169 typedef Type element_type;
170 typedef ScfRef this_type;
172 inline explicit ScfRef( element_type* pObj = 0 ) { eat( pObj ); }
173 inline /*implicit*/ ScfRef( const this_type& rRef ) { eat( rRef.mpObj, rRef.mpnCount ); }
174 template< typename Type2 >
175 inline /*implicit*/ ScfRef( const ScfRef< Type2 >& rRef ) { eat( rRef.mpObj, rRef.mpnCount ); }
176 inline ~ScfRef() { rel(); }
178 inline void reset( element_type* pObj = 0 ) { rel(); eat( pObj ); }
179 inline this_type& operator=( const this_type& rRef ) { if( this != &rRef ) { rel(); eat( rRef.mpObj, rRef.mpnCount ); } return *this; }
180 template< typename Type2 >
181 inline this_type& operator=( const ScfRef< Type2 >& rRef ) { rel(); eat( rRef.mpObj, rRef.mpnCount ); return *this; }
183 inline element_type* get() const { return mpObj; }
184 inline bool is() const { return mpObj != 0; }
186 inline element_type* operator->() const { return mpObj; }
187 inline element_type& operator*() const { return *mpObj; }
189 inline bool operator!() const { return mpObj == 0; }
191 private:
192 inline void eat( element_type* pObj, size_t* pnCount = 0 ) { mpObj = pObj; mpnCount = mpObj ? (pnCount ? pnCount : new size_t( 0 )) : 0; if( mpnCount ) ++*mpnCount; }
193 inline void rel() { if( mpnCount && !--*mpnCount ) { DELETEZ( mpObj ); DELETEZ( mpnCount ); } }
195 private:
196 Type* mpObj;
197 size_t* mpnCount;
200 template< typename Type >
201 inline bool operator==( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
203 return rxRef1.get() == rxRef2.get();
206 template< typename Type >
207 inline bool operator!=( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
209 return rxRef1.get() != rxRef2.get();
212 template< typename Type >
213 inline bool operator<( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
215 return rxRef1.get() < rxRef2.get();
218 template< typename Type >
219 inline bool operator>( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
221 return rxRef1.get() > rxRef2.get();
224 template< typename Type >
225 inline bool operator<=( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
227 return rxRef1.get() <= rxRef2.get();
230 template< typename Type >
231 inline bool operator>=( const ScfRef< Type >& rxRef1, const ScfRef< Type >& rxRef2 )
233 return rxRef1.get() >= rxRef2.get();
236 // ----------------------------------------------------------------------------
238 /** Template for a map of ref-counted objects with additional accessor functions. */
239 template< typename KeyType, typename ObjType >
240 class ScfRefMap : public ::std::map< KeyType, ScfRef< ObjType > >
242 public:
243 typedef KeyType key_type;
244 typedef ScfRef< ObjType > ref_type;
245 typedef ::std::map< key_type, ref_type > map_type;
247 /** Returns true, if the object accossiated to the passed key exists. */
248 inline bool has( key_type nKey ) const
250 typename map_type::const_iterator aIt = find( nKey );
251 return (aIt != this->end()) && aIt->second.is();
254 /** Returns a reference to the object accossiated to the passed key, or 0 on error. */
255 inline ref_type get( key_type nKey ) const
257 typename map_type::const_iterator aIt = find( nKey );
258 if( aIt != this->end() ) return aIt->second;
259 return ref_type();
263 // ============================================================================
265 class Color;
266 class SfxPoolItem;
267 class SfxItemSet;
268 class ScStyleSheet;
269 class ScStyleSheetPool;
270 class SotStorage;
271 class SotStorageRef;
272 class SotStorageStreamRef;
273 class SvStream;
275 /** Contains static methods used anywhere in the filters. */
276 class ScfTools : ScfNoInstance
278 public:
280 // *** common methods *** -----------------------------------------------------
282 /** Reads a 10-byte-long-double and converts it to double. */
283 static double ReadLongDouble( SvStream& rStrm );
284 /** Returns system text encoding for byte string conversion. */
285 static rtl_TextEncoding GetSystemTextEncoding();
286 /** Returns a string representing the hexadecimal value of nValue. */
287 static String GetHexStr( sal_uInt16 nValue );
289 /** Mixes RGB components with given transparence.
290 @param nTrans Foreground transparence (0x00 == full nFore ... 0x80 = full nBack). */
291 static sal_uInt8 GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans );
292 /** Mixes colors with given transparence.
293 @param nTrans Foreground transparence (0x00 == full rFore ... 0x80 = full rBack). */
294 static Color GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans );
296 // *** conversion of names *** ------------------------------------------------
298 /** Converts a string to a valid Calc defined name or database range name.
299 @descr Defined names in Calc may contain letters, digits (*), underscores, periods (*),
300 colons (*), question marks, and dollar signs.
301 (*) = not allowed at first position. */
302 static void ConvertToScDefinedName( String& rName );
304 // *** streams and storages *** -----------------------------------------------
306 /** Tries to open an existing storage with the specified name in the passed storage (read-only). */
307 static SotStorageRef OpenStorageRead( SotStorageRef xStrg, const String& rStrgName );
308 /** Creates and opens a storage with the specified name in the passed storage (read/write). */
309 static SotStorageRef OpenStorageWrite( SotStorageRef xStrg, const String& rStrgName );
311 /** Tries to open an existing stream with the specified name in the passed storage (read-only). */
312 static SotStorageStreamRef OpenStorageStreamRead( SotStorageRef xStrg, const String& rStrmName );
313 /** Creates and opens a stream with the specified name in the passed storage (read/write). */
314 static SotStorageStreamRef OpenStorageStreamWrite( SotStorageRef xStrg, const String& rStrmName );
316 // *** item handling *** ------------------------------------------------------
318 /** Returns true, if the passed item set contains the item.
319 @param bDeep true = Searches in parent item sets too. */
320 static bool CheckItem( const SfxItemSet& rItemSet, USHORT nWhichId, bool bDeep );
321 /** Returns true, if the passed item set contains at least one of the items.
322 @param pnWhichIds Zero-terminated array of Which-IDs.
323 @param bDeep true = Searches in parent item sets too. */
324 static bool CheckItems( const SfxItemSet& rItemSet, const USHORT* pnWhichIds, bool bDeep );
326 /** Puts the item into the passed item set.
327 @descr The item will be put into the item set, if bSkipPoolDef is false,
328 or if the item differs from the default pool item.
329 @param rItemSet The destination item set.
330 @param rItem The item to put into the item set.
331 @param nWhichId The Which-ID to set with the item.
332 @param bSkipPoolDef true = Do not put item if it is equal to pool default; false = Always put the item. */
333 static void PutItem(
334 SfxItemSet& rItemSet, const SfxPoolItem& rItem,
335 USHORT nWhichId, bool bSkipPoolDef );
337 /** Puts the item into the passed item set.
338 @descr The item will be put into the item set, if bSkipPoolDef is false,
339 or if the item differs from the default pool item.
340 @param rItemSet The destination item set.
341 @param rItem The item to put into the item set.
342 @param bSkipPoolDef true = Do not put item if it is equal to pool default; false = Always put the item. */
343 static void PutItem( SfxItemSet& rItemSet, const SfxPoolItem& rItem, bool bSkipPoolDef );
345 // *** style sheet handling *** -----------------------------------------------
347 /** Creates and returns a cell style sheet and inserts it into the pool.
348 @descr If the style sheet is already in the pool, another unused style name is used.
349 @param bForceName Controls behaviour, if the style already exists:
350 true = Old existing style will be renamed; false = New style gets another name. */
351 static ScStyleSheet& MakeCellStyleSheet(
352 ScStyleSheetPool& rPool,
353 const String& rStyleName, bool bForceName );
354 /** Creates and returns a page style sheet and inserts it into the pool.
355 @descr If the style sheet is already in the pool, another unused style name is used.
356 @param bForceName Controls behaviour, if the style already exists:
357 true = Old existing style will be renamed; false = New style gets another name. */
358 static ScStyleSheet& MakePageStyleSheet(
359 ScStyleSheetPool& rPool,
360 const String& rStyleName, bool bForceName );
362 // *** byte string import operations *** --------------------------------------
364 /** Reads and returns a zero terminted byte string. */
365 static ByteString ReadCString( SvStream& rStrm );
366 /** Reads and returns a zero terminted byte string. */
367 inline static String ReadCString( SvStream& rStrm, rtl_TextEncoding eTextEnc )
368 { return String( ReadCString( rStrm ), eTextEnc ); }
370 /** Reads and returns a zero terminted byte string and decreases a stream counter. */
371 static ByteString ReadCString( SvStream& rStrm, sal_Int32& rnBytesLeft );
372 /** Reads and returns a zero terminted byte string and decreases a stream counter. */
373 inline static String ReadCString( SvStream& rStrm, sal_Int32& rnBytesLeft, rtl_TextEncoding eTextEnc )
374 { return String( ReadCString( rStrm, rnBytesLeft ), eTextEnc ); }
376 /** Appends a zero terminted byte string. */
377 static void AppendCString( SvStream& rStrm, ByteString& rString );
378 /** Appends a zero terminted byte string. */
379 static void AppendCString( SvStream& rStrm, String& rString, rtl_TextEncoding eTextEnc );
381 // *** HTML table names <-> named range names *** -----------------------------
383 /** Returns the built-in range name for an HTML document. */
384 static const String& GetHTMLDocName();
385 /** Returns the built-in range name for all HTML tables. */
386 static const String& GetHTMLTablesName();
387 /** Returns the built-in range name for an HTML table, specified by table index. */
388 static String GetNameFromHTMLIndex( sal_uInt32 nIndex );
389 /** Returns the built-in range name for an HTML table, specified by table name. */
390 static String GetNameFromHTMLName( const String& rTabName );
392 /** Returns true, if rSource is the built-in range name for an HTML document. */
393 static bool IsHTMLDocName( const String& rSource );
394 /** Returns true, if rSource is the built-in range name for all HTML tables. */
395 static bool IsHTMLTablesName( const String& rSource );
396 /** Converts a built-in range name to an HTML table name.
397 @param rSource The string to be determined.
398 @param rName The HTML table name.
399 @return true, if conversion was successful. */
400 static bool GetHTMLNameFromName( const String& rSource, String& rName );
402 private:
403 /** Returns the prefix for table index names. */
404 static const String& GetHTMLIndexPrefix();
405 /** Returns the prefix for table names. */
406 static const String& GetHTMLNamePrefix();
409 // Containers =================================================================
411 typedef ::std::vector< sal_uInt8 > ScfUInt8Vec;
412 typedef ::std::vector< sal_Int16 > ScfInt16Vec;
413 typedef ::std::vector< sal_uInt16 > ScfUInt16Vec;
414 typedef ::std::vector< sal_Int32 > ScfInt32Vec;
415 typedef ::std::vector< sal_uInt32 > ScfUInt32Vec;
416 typedef ::std::vector< sal_Int64 > ScfInt64Vec;
417 typedef ::std::vector< sal_uInt64 > ScfUInt64Vec;
418 typedef ::std::vector< String > ScfStringVec;
420 // ----------------------------------------------------------------------------
422 /** Template for a list that owns the contained objects.
423 @descr This list stores pointers to objects and deletes the objects itself
424 on destruction. The Clear() method deletes all objects too. */
425 template< typename Type > class ScfDelList
427 public:
428 inline explicit ScfDelList( USHORT nInitSize = 16, USHORT nResize = 16 ) :
429 maList( nInitSize, nResize ) {}
430 /** Creates a deep copy of the passed list (copy-constructs all contained objects). */
431 inline explicit ScfDelList( const ScfDelList& rSrc ) { *this = rSrc; }
432 virtual ~ScfDelList();
434 /** Creates a deep copy of the passed list (copy-constructs all contained objects). */
435 ScfDelList& operator=( const ScfDelList& rSrc );
437 inline void Insert( Type* pObj, ULONG nIndex ) { if( pObj ) maList.Insert( pObj, nIndex ); }
438 inline void Append( Type* pObj ) { if( pObj ) maList.Insert( pObj, LIST_APPEND ); }
439 /** Removes the object without deletion. */
440 inline Type* Remove( ULONG nIndex ) { return static_cast< Type* >( maList.Remove( nIndex ) ); }
441 /** Removes and deletes the object. */
442 inline void Delete( ULONG nIndex ) { delete Remove( nIndex ); }
443 /** Exchanges the contained object with the passed, returns the old. */
444 inline Type* Exchange( Type* pObj, ULONG nIndex ) { return static_cast< Type* >( maList.Replace( pObj, nIndex ) ); }
445 /** Replaces (deletes) the contained object. */
446 inline void Replace( Type* pObj, ULONG nIndex ) { delete Exchange( pObj, nIndex ); }
448 void Clear();
449 inline ULONG Count() const { return maList.Count(); }
450 inline bool Empty() const { return maList.Count() == 0; }
452 inline Type* GetCurObject() const { return static_cast< Type* >( maList.GetCurObject() ); }
453 inline ULONG GetCurPos() const { return maList.GetCurPos(); }
454 inline Type* GetObject( sal_uInt32 nIndex ) const { return static_cast< Type* >( maList.GetObject( nIndex ) ); }
456 inline Type* First() const { return static_cast< Type* >( maList.First() ); }
457 inline Type* Last() const { return static_cast< Type* >( maList.Last() ); }
458 inline Type* Next() const { return static_cast< Type* >( maList.Next() ); }
459 inline Type* Prev() const { return static_cast< Type* >( maList.Prev() ); }
461 private:
462 mutable List maList; /// The base container object.
465 template< typename Type > ScfDelList< Type >& ScfDelList< Type >::operator=( const ScfDelList& rSrc )
467 Clear();
468 for( const Type* pObj = rSrc.First(); pObj; pObj = rSrc.Next() )
469 Append( new Type( *pObj ) );
470 return *this;
473 template< typename Type > ScfDelList< Type >::~ScfDelList()
475 Clear();
478 template< typename Type > void ScfDelList< Type >::Clear()
480 for( Type* pObj = First(); pObj; pObj = Next() )
481 delete pObj;
482 maList.Clear();
485 // ----------------------------------------------------------------------------
487 /** Template for a stack that owns the contained objects.
488 @descr This stack stores pointers to objects and deletes the objects
489 itself on destruction. The Clear() method deletes all objects too.
490 The Pop() method removes the top object from stack without deletion. */
491 template< typename Type >
492 class ScfDelStack : private ScfDelList< Type >
494 public:
495 inline ScfDelStack( USHORT nInitSize = 16, USHORT nResize = 16 ) :
496 ScfDelList< Type >( nInitSize, nResize ) {}
498 inline void Push( Type* pObj ) { Append( pObj ); }
499 /** Removes the top object without deletion. */
500 inline Type* Pop() { return Remove( Count() - 1 ); }
502 inline Type* Top() const { return GetObject( Count() - 1 ); }
504 using ScfDelList< Type >::Clear;
505 using ScfDelList< Type >::Count;
506 using ScfDelList< Type >::Empty;
509 // ----------------------------------------------------------------------------
510 class ScFormatFilterPluginImpl : public ScFormatFilterPlugin {
511 public:
512 ScFormatFilterPluginImpl();
513 // various import filters
514 virtual FltError ScImportLotus123( SfxMedium&, ScDocument*, CharSet eSrc = RTL_TEXTENCODING_DONTKNOW );
515 virtual FltError ScImportQuattroPro( SfxMedium &rMedium, ScDocument *pDoc );
516 virtual FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT );
517 // eFormat == EIF_AUTO -> passender Filter wird automatisch verwendet
518 // eFormat == EIF_BIFF5 -> nur Biff5-Stream fuehrt zum Erfolg (auch wenn in einem Excel97-Doc)
519 // eFormat == EIF_BIFF8 -> nur Biff8-Stream fuehrt zum Erfolg (nur in Excel97-Docs)
520 // eFormat == EIF_BIFF_LE4 -> nur Nicht-Storage-Dateien _koennen_ zum Erfolg fuehren
521 virtual FltError ScImportStarCalc10( SvStream&, ScDocument* );
522 virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
523 const CharSet eSrc = RTL_TEXTENCODING_DONTKNOW, UINT32 nDifOption = SC_DIFOPT_EXCEL );
524 virtual FltError ScImportRTF( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange );
525 virtual FltError ScImportHTML( SvStream&, const String& rBaseURL, ScDocument*, ScRange& rRange,
526 double nOutputFactor = 1.0, BOOL bCalcWidthHeight = TRUE,
527 SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true );
529 virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange );
530 virtual ScEEAbsImport *CreateHTMLImport( ScDocument* pDocP, const String& rBaseURL, const ScRange& rRange, BOOL bCalcWidthHeight );
531 virtual String GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrigName );
533 // various export filters
534 #if ENABLE_LOTUS123_EXPORT
535 virtual FltError ScExportLotus123( SvStream&, ScDocument*, ExportFormatLotus, CharSet eDest );
536 #endif
537 virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, CharSet eDest );
538 virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress& rOutPos, const CharSet eDest,
539 UINT32 nDifOption = SC_DIFOPT_EXCEL );
540 virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const CharSet eDest,
541 UINT32 nDifOption = SC_DIFOPT_EXCEL );
542 virtual FltError ScExportHTML( SvStream&, const String& rBaseURL, ScDocument*, const ScRange& rRange, const CharSet eDest, BOOL bAll,
543 const String& rStreamPath, String& rNonConvertibleChars );
544 virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const CharSet eDest );
547 // ============================================================================
549 #endif