32 #include <document.hxx>
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() )
238 double fValue =
pStrm->ReadDouble();
239 if(
pStrm->IsValid() )
248 OUString sString =
pStrm->ReadUniString();
249 if(
pStrm->IsValid() )
258 double fValue =
static_cast<double>(
pStrm->ReaduInt16() != 0);
259 if(
pStrm->IsValid() )
269 std::unique_ptr<ScTokenArray> pTokenArray;
271 if(
pStrm->IsValid() && pTokenArray )
279 OSL_FAIL(
"XclImpChangeTrack::ReadCell - unknown data type" );
294 OSL_FAIL(
"XclImpChangeTrack::ReadChTrInsert - unknown action" );
301 sal_uInt16 nFlags =
pStrm->ReaduInt16();
302 bool bEndOfList = (nFlags & 0x0001);
310 bool bValid =
pStrm->IsValid();
325 pStrm->DisableDecryption();
327 OUString sUsername(
pStrm->ReadUniString() );
328 if( !
pStrm->IsValid() )
return;
330 if( !sUsername.isEmpty() )
333 if( !
pStrm->IsValid() )
return;
337 if(
pStrm->IsValid() )
350 sal_uInt16 nValueType;
351 nValueType =
pStrm->ReaduInt16();
357 nOldSize =
pStrm->ReaduInt16();
360 "XclImpChangeTrack::ReadChTrCellContent - old value mismatch" );
365 case 0x1100:
pStrm->Ignore( 16 );
break;
366 case 0x1300:
pStrm->Ignore( 8 );
break;
367 default: OSL_FAIL(
"XclImpChangeTrack::ReadChTrCellContent - unknown format info" );
372 sal_uInt32 nOldFormat;
373 sal_uInt32 nNewFormat;
374 ReadCell(aOldCell, nOldFormat, nOldValueType, aPosition);
375 ReadCell(aNewCell, nNewFormat, nNewValueType, aPosition);
376 if( !
pStrm->IsValid() || (
pStrm->GetRecLeft() > 0) )
378 OSL_FAIL(
"XclImpChangeTrack::ReadChTrCellContent - bytes left, action ignored" );
385 pChangeTrack->AppendContentOnTheFly(aPosition, aOldCell, aNewCell, nOldFormat, nNewFormat);
411 bool bValid =
pStrm->IsValid();
417 pChangeTrack->AppendMove( aSourceRange, aDestRange,
nullptr );
428 if(
pStrm->IsValid() )
438 OSL_ENSURE(
eNestedMode ==
nmBase,
"XclImpChangeTrack::InitNestedMode - unexpected nested mode" );
445 OSL_ENSURE(
eNestedMode ==
nmFound,
"XclImpChangeTrack::StartNestedMode - missing nested mode" );
455 OSL_ENSURE(
eNestedMode !=
nmBase,
"XclImpChangeTrack::EndNestedMode - missing nested mode" );
463 bool bExitLoop =
false;
467 switch(
pStrm->GetRecId() )
503 rChangeTrack( rXclChTr ) {}
virtual bool Read3DTabReference(sal_uInt16 nIxti, SCTAB &rFirstTab, SCTAB &rLastTab, ExternalTabInfo &rExtInfo) override
ScDocumentImport & GetDocImport()
#define EXC_CHTR_TYPE_EMPTY
SvStream & WriteUInt16(sal_uInt16 nUInt16)
#define EXC_CHTR_OP_DELFLAG
SC_DLLPUBLIC void SetChangeViewSettings(const ScChangeViewSettings &rNew)
#define STREAM_SEEK_TO_END
#define EXC_CHTR_OP_INSTAB
virtual ~XclImpChTrFmlConverter() override
sal_uInt16 getExternalFileId(const OUString &rFile)
void DoAcceptRejectAction(ScChangeAction *pAction)
#define EXC_CHTR_OP_COLFLAG
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
SvNumberFormatter & GetFormatter() const
Returns the number formatter of the Calc document.
const XclImpRoot & GetRoot() const
Returns this root instance - for code readability in derived classes.
Store arbitrary cell value of any kind.
XclImpChangeTrack(const XclImpRoot &rRoot, const XclImpStream &rBookStrm)
#define EXC_CHTR_TYPE_DOUBLE
void ReadCell(ScCellValue &rCell, sal_uInt32 &rFormat, sal_uInt16 nFlags, const ScAddress &rPosition)
ScFormulaCell * mpFormula
void convertToAbsName(OUString &rFile) const
Takes a flat file name, and convert it to an absolute URL path.
SC_DLLPUBLIC ScExternalRefManager * GetExternalRefManager() const
void SetYear(sal_Int16 nNewYear)
bool StartNextRecord()
Sets stream pointer to the start of the next record content.
#define EXC_CHTR_TYPE_FORMATMASK
sal_uInt16 GetCurrentIndex(sal_uInt16 nCreatedId, sal_uInt16 nMaxTabId) const
Returns the current sheet index calculated from creation index.
#define EXC_CHTR_OP_DELROW
XclImpTabInfo & GetTabInfo() const
Returns the buffer that contains the sheet creation order.
virtual ~XclImpChangeTrack() override
void SetDay(sal_uInt16 nNewDay)
XclImpChTrFmlConverter(XclImpRoot &rRoot, XclImpChangeTrack &rXclChTr)
enum XclImpChangeTrack::@3 eNestedMode
#define STREAM_SEEK_TO_BEGIN
svl::SharedString * mpString
void DoDeleteRange(const ScRange &rRange)
void ReadFormula(std::unique_ptr< ScTokenArray > &rpTokenArray, const ScAddress &rPosition)
static SC_DLLPUBLIC LanguageType eLnge
#define EXC_CHTR_OP_DELCOL
#define EXC_CHTR_TYPE_FORMULA
XclImpChangeTrack & rChangeTrack
constexpr OUStringLiteral EXC_STREAM_REVLOG
#define SAL_WARN_IF(condition, area, stream)
constexpr OUStringLiteral EXC_STREAM_USERNAMES
SC_DLLPUBLIC void SetChangeTrack(std::unique_ptr< ScChangeTrack > pTrack)
only for import filter, deletes any existing ChangeTrack via EndChangeTracking() and takes ownership ...
void ReadChTrCellContent()
#define EXC_CHTR_OP_UNKNOWN
tools::SvRef< SotStorageStream > xInStrm
#define EXC_CHTR_TYPE_STRING
#define EXC_CHTR_OP_INSCOL
#define EXC_CHTR_OP_INSROW
void Read2DRange(ScRange &rRange)
virtual ConvErr Convert(std::unique_ptr< ScTokenArray > &rpTokArray, XclImpStream &rStrm, std::size_t nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT=FT_CellFormula) override
#define EXC_CHTR_TYPE_MASK
bool CheckRecord(sal_uInt16 nOpCode)
This class is used to import record oriented streams.
void Read3DTabRefInfo(SCTAB &rFirstTab, SCTAB &rLastTab, ExcelToSc8::ExternalTabInfo &rExtInfo)
void DoInsertRange(const ScRange &rRange, bool bEndOfList)
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.
void Read2DAddress(ScAddress &rAddress)
#define EXC_CHTR_TYPE_BOOL
virtual sal_uInt64 TellEnd() override
Access to global data from other classes.
void ReadDateTime(DateTime &rDateTime)
std::unique_ptr< ScChangeTrack > pChangeTrack
void SetMonth(sal_uInt16 nNewMonth)
std::unique_ptr< XclImpStream > pStrm
XclImpChTrRecHeader aRecHeader
bool m_bDetectedRangeSegmentation false
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.
void SetShowChanges(bool bFlag)