LibreOffice Module sc (master) 1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ScImportExport Class Reference

#include <impex.hxx>

Collaboration diagram for ScImportExport:
[legend]

Public Member Functions

 ScImportExport (ScDocument &)
 
 ScImportExport (ScDocument &, const OUString &)
 
 ScImportExport (ScDocument &, const ScAddress &)
 
 ScImportExport (ScDocument &, const ScRange &)
 ctor with a string (and bSingle=true) is also used for DdeSetData More...
 
 ~ScImportExport () COVERITY_NOEXCEPT_FALSE
 
void SetExtOptions (const ScAsciiOptions &rOpt)
 
void SetFilterOptions (const OUString &rFilterOptions)
 
bool IsRef () const
 
const ScRangeGetRange () const
 
void SetSeparator (sal_Unicode c)
 
void SetDelimiter (sal_Unicode c)
 
void SetFormulas (bool b)
 
void SetIncludeFiltered (bool b)
 
void SetStreamPath (const OUString &rPath)
 
bool ImportString (const OUString &, SotClipboardFormatId)
 
bool ExportString (OUString &, SotClipboardFormatId)
 
bool ExportByteString (OString &, rtl_TextEncoding, SotClipboardFormatId)
 
bool ImportStream (SvStream &, const OUString &rBaseURL, SotClipboardFormatId)
 
bool ExportStream (SvStream &, const OUString &rBaseURL, SotClipboardFormatId)
 
bool ExportData (std::u16string_view rMimeType, css::uno::Any &rValue)
 
bool IsOverflowRow () const
 
bool IsOverflowCol () const
 
bool IsOverflowCell () const
 
bool IsOverflow () const
 
const OUString & GetNonConvertibleChars () const
 
void SetApi (bool bApi)
 
void SetImportBroadcast (bool b)
 
void SetOverwriting (const bool bOverwriting)
 
void SetExportTextOptions (const ScExportTextOptions &options)
 
bool GetIncludeBOM () const
 

Static Public Member Functions

static void EmbeddedNullTreatment (OUString &rStr)
 
static bool IsFormatSupported (SotClipboardFormatId nFormat)
 
static const sal_UnicodeScanNextFieldFromString (const sal_Unicode *p, OUString &rField, sal_Unicode cStr, const sal_Unicode *pSeps, bool bMergeSeps, bool &rbIsQuoted, bool &rbOverflowCell, bool bRemoveSpace)
 
static void WriteUnicodeOrByteString (SvStream &rStrm, std::u16string_view rString, bool bZero=false)
 
static void WriteUnicodeOrByteEndl (SvStream &rStrm)
 
static sal_Int32 CountVisualWidth (const OUString &rStr, sal_Int32 &nIdx, sal_Int32 nMaxWidth)
 ScImportExport::CountVisualWidth Count the width of string visually ( in multiple of western characters), considering CJK ideographs and CJK symbols (U+3000-U+303F) as twice the width of western characters. More...
 
static sal_Int32 CountVisualWidth (const OUString &rStr)
 ScImportExport::CountVisualWidth. More...
 
static void SetNoEndianSwap (SvStream &rStrm)
 only if stream is only used in own (!) memory More...
 

Private Member Functions

bool StartPaste ()
 
void EndPaste (bool bAutoRowHeight=true)
 
bool Doc2Text (SvStream &)
 
bool Text2Doc (SvStream &)
 
bool Doc2Sylk (SvStream &)
 
bool Sylk2Doc (SvStream &)
 
bool Doc2HTML (SvStream &, const OUString &)
 
bool Doc2RTF (SvStream &)
 
bool Doc2Dif (SvStream &)
 
bool Dif2Doc (SvStream &)
 
bool ExtText2Doc (SvStream &)
 
bool RTF2Doc (SvStream &, const OUString &rBaseURL)
 
bool HTML2Doc (SvStream &, const OUString &rBaseURL)
 

Private Attributes

ScDocShellpDocSh
 
ScDocumentrDoc
 
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > pUndoDoc
 
ScRange aRange
 
OUString aStreamPath
 
OUString aNonConvertibleChars
 
OUString maFilterOptions
 
sal_uInt32 nSizeLimit
 
SCROW nMaxImportRow
 
sal_Unicode cSep
 
sal_Unicode cStr
 
bool bFormulas
 
bool bIncludeFiltered
 
bool bAll
 
bool bSingle
 
bool bUndo
 
bool bOverflowRow
 
bool bOverflowCol
 
bool bOverflowCell
 
bool mbApi
 
bool mbImportBroadcast
 
bool mbOverwriting
 
bool mbIncludeBOM
 
ScExportTextOptions mExportTextOptions
 
std::unique_ptr< ScAsciiOptionspExtOptions
 

Detailed Description

Definition at line 48 of file impex.hxx.

Constructor & Destructor Documentation

◆ ScImportExport() [1/4]

ScImportExport::ScImportExport ( ScDocument r)

Definition at line 112 of file impex.cxx.

References pExtOptions, and pUndoDoc.

◆ ScImportExport() [2/4]

ScImportExport::ScImportExport ( ScDocument ,
const OUString &   
)

◆ ScImportExport() [3/4]

ScImportExport::ScImportExport ( ScDocument ,
const ScAddress  
)

◆ ScImportExport() [4/4]

ScImportExport::ScImportExport ( ScDocument r,
const ScRange rRange 
)

ctor with a string (and bSingle=true) is also used for DdeSetData

Definition at line 142 of file impex.cxx.

References ScRange::aEnd, aRange, ScRange::aStart, pExtOptions, pUndoDoc, ScAddress::SetTab(), and ScAddress::Tab().

◆ ~ScImportExport()

ScImportExport::~ScImportExport ( )

Definition at line 201 of file impex.cxx.

References pExtOptions, and pUndoDoc.

Member Function Documentation

◆ CountVisualWidth() [1/2]

sal_Int32 ScImportExport::CountVisualWidth ( const OUString &  rStr)
static

ScImportExport::CountVisualWidth.

Returns
the sum of the visual width of the whole string.

Definition at line 584 of file impex.cxx.

References CountVisualWidth(), and SAL_MAX_INT32.

◆ CountVisualWidth() [2/2]

sal_Int32 ScImportExport::CountVisualWidth ( const OUString &  rStr,
sal_Int32 &  nIdx,
sal_Int32  nMaxWidth 
)
static

ScImportExport::CountVisualWidth Count the width of string visually ( in multiple of western characters), considering CJK ideographs and CJK symbols (U+3000-U+303F) as twice the width of western characters.

Parameters
rStrthe string.
nIdxthe starting index, index is incremented for each counted character.
nMaxWidththe maximum width to count.
Returns
the sum of the width of counted characters.

Definition at line 559 of file impex.cxx.

Referenced by CountVisualWidth(), ScCsvGrid::ImplSetTextLineFix(), and ScCsvGrid::ImplSetTextLineSep().

◆ Dif2Doc()

bool ScImportExport::Dif2Doc ( SvStream rStrm)
private

◆ Doc2Dif()

bool ScImportExport::Doc2Dif ( SvStream rStrm)
private

Definition at line 2577 of file impex.cxx.

References aRange, ScFormatFilter::Get(), rDoc, rStrm, and ScFormatFilterPlugin::ScExportDif().

Referenced by ExportStream().

◆ Doc2HTML()

bool ScImportExport::Doc2HTML ( SvStream rStrm,
const OUString &  rBaseURL 
)
private

◆ Doc2RTF()

bool ScImportExport::Doc2RTF ( SvStream rStrm)
private

◆ Doc2Sylk()

bool ScImportExport::Doc2Sylk ( SvStream rStrm)
private

◆ Doc2Text()

bool ScImportExport::Doc2Text ( SvStream rStrm)
private

◆ EmbeddedNullTreatment()

void ScImportExport::EmbeddedNullTreatment ( OUString &  rStr)
static

Definition at line 1855 of file impex.cxx.

References pos, and u.

Referenced by ScImportAsciiDlg::GetLine().

◆ EndPaste()

void ScImportExport::EndPaste ( bool  bAutoRowHeight = true)
private

◆ ExportByteString()

bool ScImportExport::ExportByteString ( OString &  rText,
rtl_TextEncoding  eEnc,
SotClipboardFormatId  nFmt 
)

◆ ExportData()

bool ScImportExport::ExportData ( std::u16string_view  rMimeType,
css::uno::Any &  rValue 
)

◆ ExportStream()

bool ScImportExport::ExportStream ( SvStream rStrm,
const OUString &  rBaseURL,
SotClipboardFormatId  nFmt 
)

◆ ExportString()

bool ScImportExport::ExportString ( OUString &  rText,
SotClipboardFormatId  nFmt 
)

◆ ExtText2Doc()

bool ScImportExport::ExtText2Doc ( SvStream rStrm)
private

◆ GetIncludeBOM()

bool ScImportExport::GetIncludeBOM ( ) const
inline

Definition at line 163 of file impex.hxx.

Referenced by ScDocShell::ConvertFrom().

◆ GetNonConvertibleChars()

const OUString & ScImportExport::GetNonConvertibleChars ( ) const
inline

Definition at line 156 of file impex.hxx.

Referenced by ScDocShell::ConvertTo().

◆ GetRange()

const ScRange & ScImportExport::GetRange ( ) const
inline

Definition at line 104 of file impex.hxx.

Referenced by ScViewFunc::PasteRTF().

◆ HTML2Doc()

bool ScImportExport::HTML2Doc ( SvStream rStrm,
const OUString &  rBaseURL 
)
private

◆ ImportStream()

bool ScImportExport::ImportStream ( SvStream rStrm,
const OUString &  rBaseURL,
SotClipboardFormatId  nFmt 
)

◆ ImportString()

bool ScImportExport::ImportString ( const OUString &  rText,
SotClipboardFormatId  nFmt 
)

no swapping in memory

Definition at line 316 of file impex.cxx.

References ImportStream(), SetNoEndianSwap(), and SvStream::SetStreamCharSet().

Referenced by ScViewFunc::PasteRTF().

◆ IsFormatSupported()

bool ScImportExport::IsFormatSupported ( SotClipboardFormatId  nFormat)
static

Definition at line 225 of file impex.cxx.

Referenced by ScTransferObj::GetData(), and ScViewFunc::PasteDataFormat().

◆ IsOverflow()

bool ScImportExport::IsOverflow ( ) const
inline

Definition at line 154 of file impex.hxx.

◆ IsOverflowCell()

bool ScImportExport::IsOverflowCell ( ) const
inline

Definition at line 153 of file impex.hxx.

Referenced by ScDocShell::ConvertFrom().

◆ IsOverflowCol()

bool ScImportExport::IsOverflowCol ( ) const
inline

Definition at line 152 of file impex.hxx.

Referenced by ScDocShell::ConvertFrom().

◆ IsOverflowRow()

bool ScImportExport::IsOverflowRow ( ) const
inline

Definition at line 151 of file impex.hxx.

Referenced by ScDocShell::ConvertFrom().

◆ IsRef()

bool ScImportExport::IsRef ( ) const
inline

Definition at line 102 of file impex.hxx.

Referenced by ScServerObject::GetData().

◆ RTF2Doc()

bool ScImportExport::RTF2Doc ( SvStream rStrm,
const OUString &  rBaseURL 
)
private

◆ ScanNextFieldFromString()

const sal_Unicode * ScImportExport::ScanNextFieldFromString ( const sal_Unicode p,
OUString &  rField,
sal_Unicode  cStr,
const sal_Unicode pSeps,
bool  bMergeSeps,
bool &  rbIsQuoted,
bool &  rbOverflowCell,
bool  bRemoveSpace 
)
static

◆ SetApi()

void ScImportExport::SetApi ( bool  bApi)
inline

Definition at line 158 of file impex.hxx.

Referenced by ScCellShell::ExecuteDB().

◆ SetDelimiter()

void ScImportExport::SetDelimiter ( sal_Unicode  c)
inline

Definition at line 134 of file impex.hxx.

Referenced by ScCellShell::ExecuteDB().

◆ SetExportTextOptions()

void ScImportExport::SetExportTextOptions ( const ScExportTextOptions options)
inline

◆ SetExtOptions()

void ScImportExport::SetExtOptions ( const ScAsciiOptions rOpt)

◆ SetFilterOptions()

void ScImportExport::SetFilterOptions ( const OUString &  rFilterOptions)

Definition at line 220 of file impex.cxx.

References maFilterOptions.

Referenced by ScDocShell::ConvertTo().

◆ SetFormulas()

void ScImportExport::SetFormulas ( bool  b)
inline

◆ SetImportBroadcast()

void ScImportExport::SetImportBroadcast ( bool  b)
inline

Definition at line 159 of file impex.hxx.

Referenced by ScCellShell::ExecuteDB().

◆ SetIncludeFiltered()

void ScImportExport::SetIncludeFiltered ( bool  b)
inline

Definition at line 136 of file impex.hxx.

Referenced by ScTransferObj::GetData().

◆ SetNoEndianSwap()

void ScImportExport::SetNoEndianSwap ( SvStream rStrm)
static

only if stream is only used in own (!) memory

Definition at line 590 of file impex.cxx.

References rStrm, and SvStream::SetEndian().

Referenced by ScCellShell::ExecuteDB(), ExportByteString(), ExportString(), and ImportString().

◆ SetOverwriting()

void ScImportExport::SetOverwriting ( const bool  bOverwriting)
inline

Definition at line 160 of file impex.hxx.

Referenced by ScCellShell::ExecuteDB().

◆ SetSeparator()

void ScImportExport::SetSeparator ( sal_Unicode  c)
inline

Definition at line 133 of file impex.hxx.

Referenced by ScServerObject::GetData().

◆ SetStreamPath()

void ScImportExport::SetStreamPath ( const OUString &  rPath)
inline

Definition at line 138 of file impex.hxx.

Referenced by ScDocShell::ConvertTo().

◆ StartPaste()

bool ScImportExport::StartPaste ( )
private

◆ Sylk2Doc()

bool ScImportExport::Sylk2Doc ( SvStream rStrm)
private

◆ Text2Doc()

bool ScImportExport::Text2Doc ( SvStream rStrm)
private

◆ WriteUnicodeOrByteEndl()

void ScImportExport::WriteUnicodeOrByteEndl ( SvStream rStrm)
static

◆ WriteUnicodeOrByteString()

void ScImportExport::WriteUnicodeOrByteString ( SvStream rStrm,
std::u16string_view  rString,
bool  bZero = false 
)
static

Member Data Documentation

◆ aNonConvertibleChars

OUString ScImportExport::aNonConvertibleChars
private

Definition at line 55 of file impex.hxx.

Referenced by Doc2HTML().

◆ aRange

ScRange ScImportExport::aRange
private

◆ aStreamPath

OUString ScImportExport::aStreamPath
private

Definition at line 54 of file impex.hxx.

Referenced by Doc2HTML().

◆ bAll

bool ScImportExport::bAll
private

Definition at line 63 of file impex.hxx.

Referenced by Doc2HTML(), ExportStream(), and StartPaste().

◆ bFormulas

bool ScImportExport::bFormulas
private

Definition at line 61 of file impex.hxx.

Referenced by Doc2Sylk(), and Doc2Text().

◆ bIncludeFiltered

bool ScImportExport::bIncludeFiltered
private

Definition at line 62 of file impex.hxx.

Referenced by Doc2Text().

◆ bOverflowCell

bool ScImportExport::bOverflowCell
private

Definition at line 68 of file impex.hxx.

Referenced by Text2Doc().

◆ bOverflowCol

bool ScImportExport::bOverflowCol
private

Definition at line 67 of file impex.hxx.

Referenced by Sylk2Doc(), and Text2Doc().

◆ bOverflowRow

bool ScImportExport::bOverflowRow
private

Definition at line 66 of file impex.hxx.

Referenced by Sylk2Doc(), and Text2Doc().

◆ bSingle

bool ScImportExport::bSingle
private

Definition at line 64 of file impex.hxx.

Referenced by ExportStream(), Sylk2Doc(), and Text2Doc().

◆ bUndo

bool ScImportExport::bUndo
private

Definition at line 65 of file impex.hxx.

Referenced by StartPaste().

◆ cSep

sal_Unicode ScImportExport::cSep
private

Definition at line 59 of file impex.hxx.

Referenced by Doc2Text(), SetExtOptions(), and Text2Doc().

◆ cStr

sal_Unicode ScImportExport::cStr
private

Definition at line 60 of file impex.hxx.

Referenced by Doc2Text(), ScanNextFieldFromString(), SetExtOptions(), and Text2Doc().

◆ maFilterOptions

OUString ScImportExport::maFilterOptions
private

Definition at line 56 of file impex.hxx.

Referenced by Doc2HTML(), and SetFilterOptions().

◆ mbApi

bool ScImportExport::mbApi
private

Definition at line 69 of file impex.hxx.

◆ mbImportBroadcast

bool ScImportExport::mbImportBroadcast
private

Definition at line 70 of file impex.hxx.

Referenced by Text2Doc().

◆ mbIncludeBOM

bool ScImportExport::mbIncludeBOM
private

Definition at line 74 of file impex.hxx.

◆ mbOverwriting

bool ScImportExport::mbOverwriting
private

Definition at line 71 of file impex.hxx.

◆ mExportTextOptions

ScExportTextOptions ScImportExport::mExportTextOptions
private

Definition at line 75 of file impex.hxx.

Referenced by Doc2Text().

◆ nMaxImportRow

SCROW ScImportExport::nMaxImportRow
private

Definition at line 58 of file impex.hxx.

Referenced by Sylk2Doc().

◆ nSizeLimit

sal_uInt32 ScImportExport::nSizeLimit
private

Definition at line 57 of file impex.hxx.

Referenced by Doc2Text(), and ExportByteString().

◆ pDocSh

ScDocShell* ScImportExport::pDocSh
private

Definition at line 50 of file impex.hxx.

Referenced by EndPaste(), HTML2Doc(), StartPaste(), and Text2Doc().

◆ pExtOptions

std::unique_ptr<ScAsciiOptions> ScImportExport::pExtOptions
private

Definition at line 77 of file impex.hxx.

Referenced by HTML2Doc(), ScImportExport(), SetExtOptions(), and ~ScImportExport().

◆ pUndoDoc

std::unique_ptr<ScDocument, o3tl::default_delete<ScDocument> > ScImportExport::pUndoDoc
private

Definition at line 52 of file impex.hxx.

Referenced by EndPaste(), ScImportExport(), StartPaste(), and ~ScImportExport().

◆ rDoc

ScDocument& ScImportExport::rDoc
private

The documentation for this class was generated from the following files: