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 (const OUString &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)
 

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, const OUString &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
 
ScExportTextOptions mExportTextOptions
 
std::unique_ptr< ScAsciiOptionspExtOptions
 

Detailed Description

Definition at line 46 of file impex.hxx.

Constructor & Destructor Documentation

ScImportExport::ScImportExport ( ScDocument r)

Definition at line 105 of file impex.cxx.

References pExtOptions, and pUndoDoc.

ScImportExport::ScImportExport ( ScDocument ,
const OUString &   
)
ScImportExport::ScImportExport ( ScDocument ,
const ScAddress  
)
ScImportExport::ScImportExport ( ScDocument r,
const ScRange rRange 
)

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

Definition at line 137 of file impex.cxx.

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

ScImportExport::~ScImportExport ( )

Definition at line 198 of file impex.cxx.

References pExtOptions, and pUndoDoc.

Member Function Documentation

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 544 of file impex.cxx.

References unicode::isCJKIVSCharacter(), unicode::isIVSSelector(), and nCode.

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

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

ScImportExport::CountVisualWidth.

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

Definition at line 568 of file impex.cxx.

References CountVisualWidth(), and SAL_MAX_INT32.

bool ScImportExport::Dif2Doc ( SvStream rStrm)
private
bool ScImportExport::Doc2Dif ( SvStream rStrm)
private

Definition at line 2322 of file impex.cxx.

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

Referenced by ExportStream().

bool ScImportExport::Doc2HTML ( SvStream rStrm,
const OUString &  rBaseURL 
)
private
bool ScImportExport::Doc2RTF ( SvStream rStrm)
private
bool ScImportExport::Doc2Sylk ( SvStream rStrm)
private
bool ScImportExport::Doc2Text ( SvStream rStrm)
private
void ScImportExport::EmbeddedNullTreatment ( OUString &  rStr)
static

Definition at line 1602 of file impex.cxx.

Referenced by ScImportAsciiDlg::GetLine().

void ScImportExport::EndPaste ( bool  bAutoRowHeight = true)
private
bool ScImportExport::ExportByteString ( OString &  rText,
rtl_TextEncoding  eEnc,
SotClipboardFormatId  nFmt 
)
bool ScImportExport::ExportData ( const OUString &  rMimeType,
css::uno::Any &  rValue 
)
bool ScImportExport::ExportStream ( SvStream rStrm,
const OUString &  rBaseURL,
SotClipboardFormatId  nFmt 
)
bool ScImportExport::ExportString ( OUString &  rText,
SotClipboardFormatId  nFmt 
)
bool ScImportExport::ExtText2Doc ( SvStream rStrm)
private

points to the next free or even rDoc.MaxCol()+2

Definition at line 1363 of file impex.cxx.

References document, and rStrm.

Referenced by ImportStream().

const OUString& ScImportExport::GetNonConvertibleChars ( ) const
inline

Definition at line 153 of file impex.hxx.

Referenced by ScDocShell::ConvertTo().

const ScRange& ScImportExport::GetRange ( ) const
inline

Definition at line 101 of file impex.hxx.

bool ScImportExport::HTML2Doc ( SvStream rStrm,
const OUString &  rBaseURL 
)
private
bool ScImportExport::ImportStream ( SvStream rStrm,
const OUString &  rBaseURL,
SotClipboardFormatId  nFmt 
)
bool ScImportExport::ImportString ( const OUString &  rText,
SotClipboardFormatId  nFmt 
)

no swapping in memory

Definition at line 303 of file impex.cxx.

References ImportStream(), and SetNoEndianSwap().

bool ScImportExport::IsFormatSupported ( SotClipboardFormatId  nFormat)
static

Definition at line 222 of file impex.cxx.

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

bool ScImportExport::IsOverflow ( ) const
inline

Definition at line 151 of file impex.hxx.

bool ScImportExport::IsOverflowCell ( ) const
inline

Definition at line 150 of file impex.hxx.

Referenced by ScDocShell::ConvertFrom().

bool ScImportExport::IsOverflowCol ( ) const
inline

Definition at line 149 of file impex.hxx.

Referenced by ScDocShell::ConvertFrom().

bool ScImportExport::IsOverflowRow ( ) const
inline

Definition at line 148 of file impex.hxx.

Referenced by ScDocShell::ConvertFrom().

bool ScImportExport::IsRef ( ) const
inline

Definition at line 99 of file impex.hxx.

Referenced by ScServerObject::GetData().

bool ScImportExport::RTF2Doc ( SvStream rStrm,
const OUString &  rBaseURL 
)
private
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
void ScImportExport::SetApi ( bool  bApi)
inline

Definition at line 155 of file impex.hxx.

Referenced by ScCellShell::ExecuteDB().

void ScImportExport::SetDelimiter ( sal_Unicode  c)
inline

Definition at line 131 of file impex.hxx.

Referenced by ScCellShell::ExecuteDB().

void ScImportExport::SetExportTextOptions ( const ScExportTextOptions options)
inline
void ScImportExport::SetExtOptions ( const ScAsciiOptions rOpt)
void ScImportExport::SetFilterOptions ( const OUString &  rFilterOptions)

Definition at line 217 of file impex.cxx.

References maFilterOptions.

Referenced by ScDocShell::ConvertTo().

void ScImportExport::SetFormulas ( bool  b)
inline
void ScImportExport::SetImportBroadcast ( bool  b)
inline

Definition at line 156 of file impex.hxx.

Referenced by ScCellShell::ExecuteDB().

void ScImportExport::SetIncludeFiltered ( bool  b)
inline

Definition at line 133 of file impex.hxx.

Referenced by ScTransferObj::GetData().

void ScImportExport::SetNoEndianSwap ( SvStream rStrm)
static

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

Definition at line 574 of file impex.cxx.

References SvStream::SetEndian().

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

void ScImportExport::SetOverwriting ( const bool  bOverwriting)
inline

Definition at line 157 of file impex.hxx.

Referenced by ScCellShell::ExecuteDB().

void ScImportExport::SetSeparator ( sal_Unicode  c)
inline

Definition at line 130 of file impex.hxx.

Referenced by ScServerObject::GetData().

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

Definition at line 135 of file impex.hxx.

Referenced by ScDocShell::ConvertTo().

bool ScImportExport::StartPaste ( )
private
bool ScImportExport::Sylk2Doc ( SvStream rStrm)
private
bool ScImportExport::Text2Doc ( SvStream rStrm)
private
void ScImportExport::WriteUnicodeOrByteEndl ( SvStream rStrm)
static
void ScImportExport::WriteUnicodeOrByteString ( SvStream rStrm,
const OUString &  rString,
bool  bZero = false 
)
static

Member Data Documentation

OUString ScImportExport::aNonConvertibleChars
private

Definition at line 53 of file impex.hxx.

Referenced by Doc2HTML().

ScRange ScImportExport::aRange
private
OUString ScImportExport::aStreamPath
private

Definition at line 52 of file impex.hxx.

Referenced by Doc2HTML().

bool ScImportExport::bAll
private

Definition at line 61 of file impex.hxx.

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

bool ScImportExport::bFormulas
private

Definition at line 59 of file impex.hxx.

Referenced by Doc2Sylk(), and Doc2Text().

bool ScImportExport::bIncludeFiltered
private

Definition at line 60 of file impex.hxx.

Referenced by Doc2Text().

bool ScImportExport::bOverflowCell
private

Definition at line 66 of file impex.hxx.

Referenced by Text2Doc().

bool ScImportExport::bOverflowCol
private

Definition at line 65 of file impex.hxx.

Referenced by Sylk2Doc(), and Text2Doc().

bool ScImportExport::bOverflowRow
private

Definition at line 64 of file impex.hxx.

Referenced by Sylk2Doc(), and Text2Doc().

bool ScImportExport::bSingle
private

Definition at line 62 of file impex.hxx.

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

bool ScImportExport::bUndo
private

Definition at line 63 of file impex.hxx.

Referenced by StartPaste().

sal_Unicode ScImportExport::cSep
private

Definition at line 57 of file impex.hxx.

Referenced by SetExtOptions(), and Text2Doc().

sal_Unicode ScImportExport::cStr
private

Definition at line 58 of file impex.hxx.

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

OUString ScImportExport::maFilterOptions
private

Definition at line 54 of file impex.hxx.

Referenced by Doc2HTML(), and SetFilterOptions().

bool ScImportExport::mbApi
private

Definition at line 67 of file impex.hxx.

bool ScImportExport::mbImportBroadcast
private

Definition at line 68 of file impex.hxx.

Referenced by Text2Doc().

bool ScImportExport::mbOverwriting
private

Definition at line 69 of file impex.hxx.

ScExportTextOptions ScImportExport::mExportTextOptions
private

Definition at line 72 of file impex.hxx.

Referenced by Doc2Text().

SCROW ScImportExport::nMaxImportRow
private

Definition at line 56 of file impex.hxx.

Referenced by Sylk2Doc().

sal_uInt32 ScImportExport::nSizeLimit
private

Definition at line 55 of file impex.hxx.

Referenced by Doc2Text(), and ExportByteString().

ScDocShell* ScImportExport::pDocSh
private

Definition at line 48 of file impex.hxx.

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

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

Definition at line 74 of file impex.hxx.

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

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

Definition at line 50 of file impex.hxx.

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

ScDocument& ScImportExport::rDoc
private

Definition at line 49 of file impex.hxx.

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


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