1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
35 #include <tools/string.hxx>
36 #include <tools/list.hxx>
37 #include <tools/debug.hxx>
38 #include <oox/helper/helper.hxx>
42 // Common macros ==============================================================
44 /** Expands to the size of a STATIC data array. */
45 #define STATIC_TABLE_SIZE( array ) (sizeof(array)/sizeof(*(array)))
46 /** Expands to a pointer behind the last element of a STATIC data array (like STL end()). */
47 #define STATIC_TABLE_END( array ) ((array)+STATIC_TABLE_SIZE(array))
49 /** Expands to a temporary String, created from an ASCII character array. */
50 #define CREATE_STRING( ascii ) String( RTL_CONSTASCII_USTRINGPARAM( ascii ) )
52 // items and item sets --------------------------------------------------------
54 /** Expands to the item (with type 'itemtype') with Which-ID 'which'. */
55 #define GETITEM( itemset, itemtype, which ) \
56 static_cast< const itemtype & >( (itemset).Get( which ) )
58 /** Expands to the value (with type 'valuetype') of the item with Which-ID 'which'. */
59 #define GETITEMVALUE( itemset, itemtype, which, valuetype ) \
60 static_cast< valuetype >( GETITEM( itemset, itemtype, which ).GetValue() )
62 /** Expands to the value of the SfxBoolItem with Which-ID 'which'. */
63 #define GETITEMBOOL( itemset, which ) \
64 GETITEMVALUE( itemset, SfxBoolItem, which, bool )
66 // Global static helpers ======================================================
68 // Value range limit helpers --------------------------------------------------
70 /** Returns the value, if it is not less than nMin, otherwise nMin. */
71 template< typename ReturnType
, typename Type
>
72 inline ReturnType
llimit_cast( Type nValue
, ReturnType nMin
)
73 { return static_cast< ReturnType
>( ::std::max
< Type
>( nValue
, nMin
) ); }
75 /** Returns the value, if it fits into ReturnType, otherwise the minimum value of ReturnType. */
76 template< typename ReturnType
, typename Type
>
77 inline ReturnType
llimit_cast( Type nValue
)
78 { return llimit_cast( nValue
, ::std::numeric_limits
< ReturnType
>::min() ); }
80 /** Returns the value, if it is not greater than nMax, otherwise nMax. */
81 template< typename ReturnType
, typename Type
>
82 inline ReturnType
ulimit_cast( Type nValue
, ReturnType nMax
)
83 { return static_cast< ReturnType
>( ::std::min
< Type
>( nValue
, nMax
) ); }
85 /** Returns the value, if it fits into ReturnType, otherwise the maximum value of ReturnType. */
86 template< typename ReturnType
, typename Type
>
87 inline ReturnType
ulimit_cast( Type nValue
)
88 { return ulimit_cast( nValue
, ::std::numeric_limits
< ReturnType
>::max() ); }
90 /** Returns the value, if it is not less than nMin and not greater than nMax, otherwise one of the limits. */
91 template< typename ReturnType
, typename Type
>
92 inline ReturnType
limit_cast( Type nValue
, ReturnType nMin
, ReturnType nMax
)
93 { return static_cast< ReturnType
>( ::std::max
< Type
>( ::std::min
< Type
>( nValue
, nMax
), nMin
) ); }
95 /** Returns the value, if it fits into ReturnType, otherwise one of the limits of ReturnType. */
96 template< typename ReturnType
, typename Type
>
97 inline ReturnType
limit_cast( Type nValue
)
98 { return limit_cast( nValue
, ::std::numeric_limits
< ReturnType
>::min(), ::std::numeric_limits
< ReturnType
>::max() ); }
100 // Read from bitfields --------------------------------------------------------
102 /** Returns true, if at least one of the bits set in nMask is set in nBitField. */
103 template< typename Type
>
104 inline bool get_flag( Type nBitField
, Type nMask
)
105 { return (nBitField
& nMask
) != 0; }
107 /** Returns nSet, if at least one bit of nMask is set in nBitField, otherwise nUnset. */
108 template< typename ReturnType
, typename Type
>
109 inline ReturnType
get_flagvalue( Type nBitField
, Type nMask
, ReturnType nSet
, ReturnType nUnset
)
110 { return ::get_flag( nBitField
, nMask
) ? nSet
: nUnset
; }
112 /** Extracts a value from a bit field.
113 @descr Returns in rnRet the data fragment from nBitField, that starts at bit nStartBit
114 (0-based, bit 0 is rightmost) with the width of nBitCount. rnRet will be right-aligned (normalized).
115 For instance: extract_value( n, 0x4321, 8, 4 ) stores 3 in n (value in bits 8-11). */
116 template< typename ReturnType
, typename Type
>
117 inline ReturnType
extract_value( Type nBitField
, sal_uInt8 nStartBit
, sal_uInt8 nBitCount
)
118 { return static_cast< ReturnType
>( ((1UL << nBitCount
) - 1) & (nBitField
>> nStartBit
) ); }
120 // Write to bitfields ---------------------------------------------------------
122 /** Sets or clears (according to bSet) all set bits of nMask in rnBitField. */
123 template< typename Type
>
124 inline void set_flag( Type
& rnBitField
, Type nMask
, bool bSet
= true )
125 { if( bSet
) rnBitField
|= nMask
; else rnBitField
&= ~nMask
; }
127 /** Inserts a value into a bitfield.
128 @descr Inserts the lower nBitCount bits of nValue into rnBitField, starting
129 there at bit nStartBit. Other contents of rnBitField keep unchanged. */
130 template< typename Type
, typename InsertType
>
131 void insert_value( Type
& rnBitField
, InsertType nValue
, sal_uInt8 nStartBit
, sal_uInt8 nBitCount
)
133 unsigned long nMask
= ((1UL << nBitCount
) - 1);
134 Type nNewValue
= static_cast< Type
>( nValue
& nMask
);
135 (rnBitField
&= ~(nMask
<< nStartBit
)) |= (nNewValue
<< nStartBit
);
138 // ============================================================================
140 /** Deriving from this class prevents copy construction. */
144 ScfNoCopy( const ScfNoCopy
& );
145 ScfNoCopy
& operator=( const ScfNoCopy
& );
147 inline ScfNoCopy() {}
150 // ----------------------------------------------------------------------------
152 /** Deriving from this class prevents construction in general. */
153 class ScfNoInstance
: private ScfNoCopy
{};
155 // ============================================================================
157 /** Simple shared pointer (NOT thread-save, but faster than boost::shared_ptr). */
158 template< typename Type
>
161 template< typename
> friend class ScfRef
;
164 typedef Type element_type
;
165 typedef ScfRef this_type
;
167 inline explicit ScfRef( element_type
* pObj
= 0 ) { eat( pObj
); }
168 inline /*implicit*/ ScfRef( const this_type
& rRef
) { eat( rRef
.mpObj
, rRef
.mpnCount
); }
169 template< typename Type2
>
170 inline /*implicit*/ ScfRef( const ScfRef
< Type2
>& rRef
) { eat( rRef
.mpObj
, rRef
.mpnCount
); }
171 inline ~ScfRef() { rel(); }
173 inline void reset( element_type
* pObj
= 0 ) { rel(); eat( pObj
); }
174 inline this_type
& operator=( const this_type
& rRef
) { if( this != &rRef
) { rel(); eat( rRef
.mpObj
, rRef
.mpnCount
); } return *this; }
175 template< typename Type2
>
176 inline this_type
& operator=( const ScfRef
< Type2
>& rRef
) { rel(); eat( rRef
.mpObj
, rRef
.mpnCount
); return *this; }
178 inline element_type
* get() const { return mpObj
; }
179 inline bool is() const { return mpObj
!= 0; }
181 inline element_type
* operator->() const { return mpObj
; }
182 inline element_type
& operator*() const { return *mpObj
; }
184 inline bool operator!() const { return mpObj
== 0; }
187 inline void eat( element_type
* pObj
, size_t* pnCount
= 0 ) { mpObj
= pObj
; mpnCount
= mpObj
? (pnCount
? pnCount
: new size_t( 0 )) : 0; if( mpnCount
) ++*mpnCount
; }
188 inline void rel() { if( mpnCount
&& !--*mpnCount
) { DELETEZ( mpObj
); DELETEZ( mpnCount
); } }
195 template< typename Type
>
196 inline bool operator==( const ScfRef
< Type
>& rxRef1
, const ScfRef
< Type
>& rxRef2
)
198 return rxRef1
.get() == rxRef2
.get();
201 template< typename Type
>
202 inline bool operator!=( const ScfRef
< Type
>& rxRef1
, const ScfRef
< Type
>& rxRef2
)
204 return rxRef1
.get() != rxRef2
.get();
207 template< typename Type
>
208 inline bool operator<( const ScfRef
< Type
>& rxRef1
, const ScfRef
< Type
>& rxRef2
)
210 return rxRef1
.get() < rxRef2
.get();
213 template< typename Type
>
214 inline bool operator>( const ScfRef
< Type
>& rxRef1
, const ScfRef
< Type
>& rxRef2
)
216 return rxRef1
.get() > rxRef2
.get();
219 template< typename Type
>
220 inline bool operator<=( const ScfRef
< Type
>& rxRef1
, const ScfRef
< Type
>& rxRef2
)
222 return rxRef1
.get() <= rxRef2
.get();
225 template< typename Type
>
226 inline bool operator>=( const ScfRef
< Type
>& rxRef1
, const ScfRef
< Type
>& rxRef2
)
228 return rxRef1
.get() >= rxRef2
.get();
231 // ----------------------------------------------------------------------------
233 /** Template for a map of ref-counted objects with additional accessor functions. */
234 template< typename KeyType
, typename ObjType
>
235 class ScfRefMap
: public ::std::map
< KeyType
, ScfRef
< ObjType
> >
238 typedef KeyType key_type
;
239 typedef ScfRef
< ObjType
> ref_type
;
240 typedef ::std::map
< key_type
, ref_type
> map_type
;
242 /** Returns true, if the object accossiated to the passed key exists. */
243 inline bool has( key_type nKey
) const
245 typename
map_type::const_iterator aIt
= find( nKey
);
246 return (aIt
!= this->end()) && aIt
->second
.is();
249 /** Returns a reference to the object accossiated to the passed key, or 0 on error. */
250 inline ref_type
get( key_type nKey
) const
252 typename
map_type::const_iterator aIt
= find( nKey
);
253 if( aIt
!= this->end() ) return aIt
->second
;
258 // ============================================================================
264 class ScStyleSheetPool
;
267 class SotStorageStreamRef
;
270 /** Contains static methods used anywhere in the filters. */
271 class ScfTools
: ScfNoInstance
275 // *** common methods *** -----------------------------------------------------
277 /** Reads a 10-byte-long-double and converts it to double. */
278 static double ReadLongDouble( SvStream
& rStrm
);
279 /** Returns system text encoding for byte string conversion. */
280 static rtl_TextEncoding
GetSystemTextEncoding();
281 /** Returns a string representing the hexadecimal value of nValue. */
282 static String
GetHexStr( sal_uInt16 nValue
);
284 /** Mixes RGB components with given transparence.
285 @param nTrans Foreground transparence (0x00 == full nFore ... 0x80 = full nBack). */
286 static sal_uInt8
GetMixedColorComp( sal_uInt8 nFore
, sal_uInt8 nBack
, sal_uInt8 nTrans
);
287 /** Mixes colors with given transparence.
288 @param nTrans Foreground transparence (0x00 == full rFore ... 0x80 = full rBack). */
289 static Color
GetMixedColor( const Color
& rFore
, const Color
& rBack
, sal_uInt8 nTrans
);
291 // *** conversion of names *** ------------------------------------------------
293 /** Converts a string to a valid Calc defined name or database range name.
294 @descr Defined names in Calc may contain letters, digits (*), underscores, periods (*),
295 colons (*), question marks, and dollar signs.
296 (*) = not allowed at first position. */
297 static void ConvertToScDefinedName( String
& rName
);
299 // *** streams and storages *** -----------------------------------------------
301 /** Tries to open an existing storage with the specified name in the passed storage (read-only). */
302 static SotStorageRef
OpenStorageRead( SotStorageRef xStrg
, const String
& rStrgName
);
303 /** Creates and opens a storage with the specified name in the passed storage (read/write). */
304 static SotStorageRef
OpenStorageWrite( SotStorageRef xStrg
, const String
& rStrgName
);
306 /** Tries to open an existing stream with the specified name in the passed storage (read-only). */
307 static SotStorageStreamRef
OpenStorageStreamRead( SotStorageRef xStrg
, const String
& rStrmName
);
308 /** Creates and opens a stream with the specified name in the passed storage (read/write). */
309 static SotStorageStreamRef
OpenStorageStreamWrite( SotStorageRef xStrg
, const String
& rStrmName
);
311 // *** item handling *** ------------------------------------------------------
313 /** Returns true, if the passed item set contains the item.
314 @param bDeep true = Searches in parent item sets too. */
315 static bool CheckItem( const SfxItemSet
& rItemSet
, USHORT nWhichId
, bool bDeep
);
316 /** Returns true, if the passed item set contains at least one of the items.
317 @param pnWhichIds Zero-terminated array of Which-IDs.
318 @param bDeep true = Searches in parent item sets too. */
319 static bool CheckItems( const SfxItemSet
& rItemSet
, const USHORT
* pnWhichIds
, bool bDeep
);
321 /** Puts the item into the passed item set.
322 @descr The item will be put into the item set, if bSkipPoolDef is false,
323 or if the item differs from the default pool item.
324 @param rItemSet The destination item set.
325 @param rItem The item to put into the item set.
326 @param nWhichId The Which-ID to set with the item.
327 @param bSkipPoolDef true = Do not put item if it is equal to pool default; false = Always put the item. */
329 SfxItemSet
& rItemSet
, const SfxPoolItem
& rItem
,
330 USHORT nWhichId
, bool bSkipPoolDef
);
332 /** Puts the item into the passed item set.
333 @descr The item will be put into the item set, if bSkipPoolDef is false,
334 or if the item differs from the default pool item.
335 @param rItemSet The destination item set.
336 @param rItem The item to put into the item set.
337 @param bSkipPoolDef true = Do not put item if it is equal to pool default; false = Always put the item. */
338 static void PutItem( SfxItemSet
& rItemSet
, const SfxPoolItem
& rItem
, bool bSkipPoolDef
);
340 // *** style sheet handling *** -----------------------------------------------
342 /** Creates and returns a cell style sheet and inserts it into the pool.
343 @descr If the style sheet is already in the pool, another unused style name is used.
344 @param bForceName Controls behaviour, if the style already exists:
345 true = Old existing style will be renamed; false = New style gets another name. */
346 static ScStyleSheet
& MakeCellStyleSheet(
347 ScStyleSheetPool
& rPool
,
348 const String
& rStyleName
, bool bForceName
);
349 /** Creates and returns a page style sheet and inserts it into the pool.
350 @descr If the style sheet is already in the pool, another unused style name is used.
351 @param bForceName Controls behaviour, if the style already exists:
352 true = Old existing style will be renamed; false = New style gets another name. */
353 static ScStyleSheet
& MakePageStyleSheet(
354 ScStyleSheetPool
& rPool
,
355 const String
& rStyleName
, bool bForceName
);
357 // *** byte string import operations *** --------------------------------------
359 /** Reads and returns a zero terminted byte string. */
360 static ByteString
ReadCString( SvStream
& rStrm
);
361 /** Reads and returns a zero terminted byte string. */
362 inline static String
ReadCString( SvStream
& rStrm
, rtl_TextEncoding eTextEnc
)
363 { return String( ReadCString( rStrm
), eTextEnc
); }
365 /** Reads and returns a zero terminted byte string and decreases a stream counter. */
366 static ByteString
ReadCString( SvStream
& rStrm
, sal_Int32
& rnBytesLeft
);
367 /** Reads and returns a zero terminted byte string and decreases a stream counter. */
368 inline static String
ReadCString( SvStream
& rStrm
, sal_Int32
& rnBytesLeft
, rtl_TextEncoding eTextEnc
)
369 { return String( ReadCString( rStrm
, rnBytesLeft
), eTextEnc
); }
371 /** Appends a zero terminted byte string. */
372 static void AppendCString( SvStream
& rStrm
, ByteString
& rString
);
373 /** Appends a zero terminted byte string. */
374 static void AppendCString( SvStream
& rStrm
, String
& rString
, rtl_TextEncoding eTextEnc
);
376 // *** HTML table names <-> named range names *** -----------------------------
378 /** Returns the built-in range name for an HTML document. */
379 static const String
& GetHTMLDocName();
380 /** Returns the built-in range name for all HTML tables. */
381 static const String
& GetHTMLTablesName();
382 /** Returns the built-in range name for an HTML table, specified by table index. */
383 static String
GetNameFromHTMLIndex( sal_uInt32 nIndex
);
384 /** Returns the built-in range name for an HTML table, specified by table name. */
385 static String
GetNameFromHTMLName( const String
& rTabName
);
387 /** Returns true, if rSource is the built-in range name for an HTML document. */
388 static bool IsHTMLDocName( const String
& rSource
);
389 /** Returns true, if rSource is the built-in range name for all HTML tables. */
390 static bool IsHTMLTablesName( const String
& rSource
);
391 /** Converts a built-in range name to an HTML table name.
392 @param rSource The string to be determined.
393 @param rName The HTML table name.
394 @return true, if conversion was successful. */
395 static bool GetHTMLNameFromName( const String
& rSource
, String
& rName
);
398 /** Returns the prefix for table index names. */
399 static const String
& GetHTMLIndexPrefix();
400 /** Returns the prefix for table names. */
401 static const String
& GetHTMLNamePrefix();
404 // Containers =================================================================
406 typedef ::std::vector
< sal_uInt8
> ScfUInt8Vec
;
407 typedef ::std::vector
< sal_Int16
> ScfInt16Vec
;
408 typedef ::std::vector
< sal_uInt16
> ScfUInt16Vec
;
409 typedef ::std::vector
< sal_Int32
> ScfInt32Vec
;
410 typedef ::std::vector
< sal_uInt32
> ScfUInt32Vec
;
411 typedef ::std::vector
< sal_Int64
> ScfInt64Vec
;
412 typedef ::std::vector
< sal_uInt64
> ScfUInt64Vec
;
413 typedef ::std::vector
< String
> ScfStringVec
;
415 // ----------------------------------------------------------------------------
417 /** Template for a list that owns the contained objects.
418 @descr This list stores pointers to objects and deletes the objects itself
419 on destruction. The Clear() method deletes all objects too. */
420 template< typename Type
> class ScfDelList
423 inline explicit ScfDelList( USHORT nInitSize
= 16, USHORT nResize
= 16 ) :
424 maList( nInitSize
, nResize
) {}
425 /** Creates a deep copy of the passed list (copy-constructs all contained objects). */
426 inline explicit ScfDelList( const ScfDelList
& rSrc
) { *this = rSrc
; }
427 virtual ~ScfDelList();
429 /** Creates a deep copy of the passed list (copy-constructs all contained objects). */
430 ScfDelList
& operator=( const ScfDelList
& rSrc
);
432 inline void Insert( Type
* pObj
, ULONG nIndex
) { if( pObj
) maList
.Insert( pObj
, nIndex
); }
433 inline void Append( Type
* pObj
) { if( pObj
) maList
.Insert( pObj
, LIST_APPEND
); }
434 /** Removes the object without deletion. */
435 inline Type
* Remove( ULONG nIndex
) { return static_cast< Type
* >( maList
.Remove( nIndex
) ); }
436 /** Removes and deletes the object. */
437 inline void Delete( ULONG nIndex
) { delete Remove( nIndex
); }
438 /** Exchanges the contained object with the passed, returns the old. */
439 inline Type
* Exchange( Type
* pObj
, ULONG nIndex
) { return static_cast< Type
* >( maList
.Replace( pObj
, nIndex
) ); }
440 /** Replaces (deletes) the contained object. */
441 inline void Replace( Type
* pObj
, ULONG nIndex
) { delete Exchange( pObj
, nIndex
); }
444 inline ULONG
Count() const { return maList
.Count(); }
445 inline bool Empty() const { return maList
.Count() == 0; }
447 inline Type
* GetCurObject() const { return static_cast< Type
* >( maList
.GetCurObject() ); }
448 inline ULONG
GetCurPos() const { return maList
.GetCurPos(); }
449 inline Type
* GetObject( sal_uInt32 nIndex
) const { return static_cast< Type
* >( maList
.GetObject( nIndex
) ); }
451 inline Type
* First() const { return static_cast< Type
* >( maList
.First() ); }
452 inline Type
* Last() const { return static_cast< Type
* >( maList
.Last() ); }
453 inline Type
* Next() const { return static_cast< Type
* >( maList
.Next() ); }
454 inline Type
* Prev() const { return static_cast< Type
* >( maList
.Prev() ); }
457 mutable List maList
; /// The base container object.
460 template< typename Type
> ScfDelList
< Type
>& ScfDelList
< Type
>::operator=( const ScfDelList
& rSrc
)
463 for( const Type
* pObj
= rSrc
.First(); pObj
; pObj
= rSrc
.Next() )
464 Append( new Type( *pObj
) );
468 template< typename Type
> ScfDelList
< Type
>::~ScfDelList()
473 template< typename Type
> void ScfDelList
< Type
>::Clear()
475 for( Type
* pObj
= First(); pObj
; pObj
= Next() )
480 // ----------------------------------------------------------------------------
482 /** Template for a stack that owns the contained objects.
483 @descr This stack stores pointers to objects and deletes the objects
484 itself on destruction. The Clear() method deletes all objects too.
485 The Pop() method removes the top object from stack without deletion. */
486 template< typename Type
>
487 class ScfDelStack
: private ScfDelList
< Type
>
490 inline ScfDelStack( USHORT nInitSize
= 16, USHORT nResize
= 16 ) :
491 ScfDelList
< Type
>( nInitSize
, nResize
) {}
493 inline void Push( Type
* pObj
) { Append( pObj
); }
494 /** Removes the top object without deletion. */
495 inline Type
* Pop() { return Remove( Count() - 1 ); }
497 inline Type
* Top() const { return GetObject( Count() - 1 ); }
499 using ScfDelList
< Type
>::Clear
;
500 using ScfDelList
< Type
>::Count
;
501 using ScfDelList
< Type
>::Empty
;
504 // ----------------------------------------------------------------------------
505 class ScFormatFilterPluginImpl
: public ScFormatFilterPlugin
{
507 ScFormatFilterPluginImpl();
508 // various import filters
509 virtual FltError
ScImportLotus123( SfxMedium
&, ScDocument
*, CharSet eSrc
= RTL_TEXTENCODING_DONTKNOW
);
510 virtual FltError
ScImportQuattroPro( SfxMedium
&rMedium
, ScDocument
*pDoc
);
511 virtual FltError
ScImportExcel( SfxMedium
&, ScDocument
*, const EXCIMPFORMAT
);
512 // eFormat == EIF_AUTO -> passender Filter wird automatisch verwendet
513 // eFormat == EIF_BIFF5 -> nur Biff5-Stream fuehrt zum Erfolg (auch wenn in einem Excel97-Doc)
514 // eFormat == EIF_BIFF8 -> nur Biff8-Stream fuehrt zum Erfolg (nur in Excel97-Docs)
515 // eFormat == EIF_BIFF_LE4 -> nur Nicht-Storage-Dateien _koennen_ zum Erfolg fuehren
516 virtual FltError
ScImportStarCalc10( SvStream
&, ScDocument
* );
517 virtual FltError
ScImportDif( SvStream
&, ScDocument
*, const ScAddress
& rInsPos
,
518 const CharSet eSrc
= RTL_TEXTENCODING_DONTKNOW
, UINT32 nDifOption
= SC_DIFOPT_EXCEL
);
519 virtual FltError
ScImportRTF( SvStream
&, const String
& rBaseURL
, ScDocument
*, ScRange
& rRange
);
520 virtual FltError
ScImportHTML( SvStream
&, const String
& rBaseURL
, ScDocument
*, ScRange
& rRange
,
521 double nOutputFactor
= 1.0, BOOL bCalcWidthHeight
= TRUE
,
522 SvNumberFormatter
* pFormatter
= NULL
, bool bConvertDate
= true );
524 virtual ScEEAbsImport
*CreateRTFImport( ScDocument
* pDoc
, const ScRange
& rRange
);
525 virtual ScEEAbsImport
*CreateHTMLImport( ScDocument
* pDocP
, const String
& rBaseURL
, const ScRange
& rRange
, BOOL bCalcWidthHeight
);
526 virtual String
GetHTMLRangeNameList( ScDocument
* pDoc
, const String
& rOrigName
);
528 // various export filters
529 #if ENABLE_LOTUS123_EXPORT
530 virtual FltError
ScExportLotus123( SvStream
&, ScDocument
*, ExportFormatLotus
, CharSet eDest
);
532 virtual FltError
ScExportExcel5( SfxMedium
&, ScDocument
*, ExportFormatExcel eFormat
, CharSet eDest
);
533 virtual FltError
ScExportDif( SvStream
&, ScDocument
*, const ScAddress
& rOutPos
, const CharSet eDest
,
534 UINT32 nDifOption
= SC_DIFOPT_EXCEL
);
535 virtual FltError
ScExportDif( SvStream
&, ScDocument
*, const ScRange
& rRange
, const CharSet eDest
,
536 UINT32 nDifOption
= SC_DIFOPT_EXCEL
);
537 virtual FltError
ScExportHTML( SvStream
&, const String
& rBaseURL
, ScDocument
*, const ScRange
& rRange
, const CharSet eDest
, BOOL bAll
,
538 const String
& rStreamPath
, String
& rNonConvertibleChars
);
539 virtual FltError
ScExportRTF( SvStream
&, ScDocument
*, const ScRange
& rRange
, const CharSet eDest
);
542 // ============================================================================