32#include <document.hxx>
55 sal_uInt64
const nStreamLen =
xInStrm->TellEnd();
60 pStrm->CopyDecrypterFrom( rBookStrm );
78 if( !pAction )
return;
119 sal_uInt8 nMonth, nDay, nHour, nMin, nSec;
121 nYear =
pStrm->ReaduInt16();
122 nMonth =
pStrm->ReaduInt8();
123 nDay =
pStrm->ReaduInt8();
124 nHour =
pStrm->ReaduInt8();
125 nMin =
pStrm->ReaduInt8();
126 nSec =
pStrm->ReaduInt8();
141 OSL_FAIL(
"XclImpChangeTrack::CheckRecord - unknown action" );
156 rLastTab = (nFillByte == 0x00) ?
163 OUString aEncUrl(
pStrm->ReadUniString() );
169 OUString aTabName(
pStrm->ReadUniString() );
177 rFirstTab = rLastTab = 0;
183 sal_uInt16 nFmlSize =
pStrm->ReaduInt16();
193 size_t nRead =
pStrm->CopyToStream( aMemStrm, nFmlSize );
198 if(nRead != nFmlSize)
200 rpTokenArray =
nullptr;
210 std::unique_ptr<ScTokenArray> pArray;
211 aFmlConv.
Reset( rPosition );
213 rpTokenArray = (bOK && pArray) ? std::move( pArray ) :
nullptr;
229 if(
pStrm->IsValid() )
237 double fValue =
pStrm->ReadDouble();
238 if(
pStrm->IsValid() )
246 OUString sString =
pStrm->ReadUniString();
247 if(
pStrm->IsValid() )
249 rCell.
set(
GetDoc().GetSharedStringPool().intern(sString));
255 double fValue =
static_cast<double>(
pStrm->ReaduInt16() != 0);
256 if(
pStrm->IsValid() )
265 std::unique_ptr<ScTokenArray> pTokenArray;
267 if(
pStrm->IsValid() && pTokenArray )
274 OSL_FAIL(
"XclImpChangeTrack::ReadCell - unknown data type" );
289 OSL_FAIL(
"XclImpChangeTrack::ReadChTrInsert - unknown action" );
296 sal_uInt16 nFlags =
pStrm->ReaduInt16();
297 bool bEndOfList = (nFlags & 0x0001);
305 bool bValid =
pStrm->IsValid();
320 pStrm->DisableDecryption();
322 OUString sUsername(
pStrm->ReadUniString() );
323 if( !
pStrm->IsValid() )
return;
325 if( !sUsername.isEmpty() )
328 if( !
pStrm->IsValid() )
return;
332 if(
pStrm->IsValid() )
345 sal_uInt16 nValueType;
346 nValueType =
pStrm->ReaduInt16();
352 nOldSize =
pStrm->ReaduInt16();
355 "XclImpChangeTrack::ReadChTrCellContent - old value mismatch" );
360 case 0x1100:
pStrm->Ignore( 16 );
break;
361 case 0x1300:
pStrm->Ignore( 8 );
break;
362 default: OSL_FAIL(
"XclImpChangeTrack::ReadChTrCellContent - unknown format info" );
367 sal_uInt32 nOldFormat;
368 sal_uInt32 nNewFormat;
369 ReadCell(aOldCell, nOldFormat, nOldValueType, aPosition);
370 ReadCell(aNewCell, nNewFormat, nNewValueType, aPosition);
371 if( !
pStrm->IsValid() || (
pStrm->GetRecLeft() > 0) )
373 OSL_FAIL(
"XclImpChangeTrack::ReadChTrCellContent - bytes left, action ignored" );
380 pChangeTrack->AppendContentOnTheFly(aPosition, aOldCell, aNewCell, nOldFormat, nNewFormat);
406 bool bValid =
pStrm->IsValid();
412 pChangeTrack->AppendMove( aSourceRange, aDestRange,
nullptr );
423 if(
pStrm->IsValid() )
433 OSL_ENSURE(
eNestedMode ==
nmBase,
"XclImpChangeTrack::InitNestedMode - unexpected nested mode" );
440 OSL_ENSURE(
eNestedMode ==
nmFound,
"XclImpChangeTrack::StartNestedMode - missing nested mode" );
450 OSL_ENSURE(
eNestedMode !=
nmBase,
"XclImpChangeTrack::EndNestedMode - missing nested mode" );
458 bool bExitLoop =
false;
462 switch(
pStrm->GetRecId() )
498 rChangeTrack( rXclChTr ) {}
void SetMonth(sal_uInt16 nNewMonth)
void SetYear(sal_Int16 nNewYear)
void SetDay(sal_uInt16 nNewDay)
virtual ConvErr Convert(std::unique_ptr< ScTokenArray > &rpTokArray, XclImpStream &rStrm, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT=FT_CellFormula) override
void SetShowChanges(bool bFlag)
SC_DLLPUBLIC void SetChangeTrack(std::unique_ptr< ScChangeTrack > pTrack)
only for import filter, deletes any existing ChangeTrack via EndChangeTracking() and takes ownership ...
SC_DLLPUBLIC ScExternalRefManager * GetExternalRefManager() const
SC_DLLPUBLIC void SetChangeViewSettings(const ScChangeViewSettings &rNew)
sal_uInt16 getExternalFileId(const OUString &rFile)
void convertToAbsName(OUString &rFile) const
Takes a flat file name, and convert it to an absolute URL path.
static SC_DLLPUBLIC LanguageType eLnge
SvStream & WriteUInt16(sal_uInt16 nUInt16)
virtual bool Read3DTabReference(sal_uInt16 nIxti, SCTAB &rFirstTab, SCTAB &rLastTab, ExternalTabInfo &rExtInfo) override
XclImpChTrFmlConverter(XclImpRoot &rRoot, XclImpChangeTrack &rXclChTr)
virtual ~XclImpChTrFmlConverter() override
XclImpChangeTrack & rChangeTrack
std::unique_ptr< XclImpStream > pStrm
XclImpChangeTrack(const XclImpRoot &rRoot, const XclImpStream &rBookStrm)
void ReadDateTime(DateTime &rDateTime)
virtual ~XclImpChangeTrack() override
void ReadFormula(std::unique_ptr< ScTokenArray > &rpTokenArray, const ScAddress &rPosition)
void ReadChTrCellContent()
void DoInsertRange(const ScRange &rRange, bool bEndOfList)
tools::SvRef< SotStorageStream > xInStrm
XclImpChTrRecHeader aRecHeader
void DoDeleteRange(const ScRange &rRange)
std::unique_ptr< ScChangeTrack > pChangeTrack
void Read3DTabRefInfo(SCTAB &rFirstTab, SCTAB &rLastTab, ExcelToSc8::ExternalTabInfo &rExtInfo)
enum XclImpChangeTrack::@3 eNestedMode
void DoAcceptRejectAction(ScChangeAction *pAction)
void Read2DAddress(ScAddress &rAddress)
bool CheckRecord(sal_uInt16 nOpCode)
void ReadCell(ScCellValue &rCell, sal_uInt32 &rFormat, sal_uInt16 nFlags, const ScAddress &rPosition)
void Read2DRange(ScRange &rRange)
Access to global data from other classes.
ScDocumentImport & GetDocImport()
const XclImpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
XclImpTabInfo & GetTabInfo() const
Returns the buffer that contains the sheet creation order.
This class is used to import record oriented streams.
bool StartNextRecord()
Sets stream pointer to the start of the next record content.
sal_uInt16 GetCurrentIndex(sal_uInt16 nCreatedId, sal_uInt16 nMaxTabId) const
Returns the current sheet index calculated from creation index.
static void DecodeUrl(OUString &rUrl, OUString &rTabName, bool &rbSameWb, const XclImpRoot &rRoot, const OUString &rEncodedUrl)
Decodes an encoded external document URL with optional sheet name.
SvNumberFormatter & GetFormatter() const
Returns the number formatter of the Calc document.
tools::SvRef< SotStorageStream > OpenStream(tools::SvRef< SotStorage > const &xStrg, const OUString &rStrmName) const
Tries to open a new stream in the specified storage for reading or writing.
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
#define EXC_CHTR_TYPE_STRING
constexpr OUStringLiteral EXC_STREAM_REVLOG
#define EXC_CHTR_TYPE_FORMATMASK
constexpr OUStringLiteral EXC_STREAM_USERNAMES
#define EXC_CHTR_TYPE_DOUBLE
#define EXC_CHTR_OP_DELCOL
#define EXC_CHTR_TYPE_MASK
#define EXC_CHTR_OP_DELFLAG
#define EXC_CHTR_OP_DELROW
#define EXC_CHTR_OP_INSCOL
#define EXC_CHTR_TYPE_FORMULA
#define EXC_CHTR_OP_COLFLAG
#define EXC_CHTR_OP_INSROW
#define EXC_CHTR_TYPE_EMPTY
#define EXC_CHTR_OP_INSTAB
#define EXC_CHTR_TYPE_BOOL
#define EXC_CHTR_OP_UNKNOWN
#define SAL_WARN_IF(condition, area, stream)
#define STREAM_SEEK_TO_END
#define STREAM_SEEK_TO_BEGIN
Store arbitrary cell value of any kind.