diff options
-rw-r--r-- | sc/source/filter/inc/XclExpChangeTrack.hxx | 12 | ||||
-rw-r--r-- | sc/source/filter/xcl97/XclExpChangeTrack.cxx | 26 |
2 files changed, 38 insertions, 0 deletions
diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx b/sc/source/filter/inc/XclExpChangeTrack.hxx index 9701ba6e29f5..a6cdeff93cab 100644 --- a/sc/source/filter/inc/XclExpChangeTrack.hxx +++ b/sc/source/filter/inc/XclExpChangeTrack.hxx @@ -378,6 +378,9 @@ protected: // override to get action size without header, called by GetLen() virtual std::size_t GetActionByteCount() const = 0; + // true if export would attempt to get the tab id of an unknown tab + virtual bool UsesDeletedTab() const = 0; + // do something before writing the record virtual void PrepareSaveAction( XclExpStream& rStrm ) const; // do something after writing the record @@ -479,6 +482,8 @@ class XclExpChTrCellContent final : public XclExpChTrAction, protected XclExpRoo const XclExpRoot& rRoot, const ScCellValue& rScCell, std::unique_ptr<XclExpChTrData>& rpData, sal_uInt32& rXclLength1, sal_uInt16& rXclLength2 ); + virtual bool UsesDeletedTab() const override; + virtual void SaveActionData( XclExpStream& rStrm ) const override; public: @@ -505,6 +510,8 @@ protected: XclExpChTrInsert( const XclExpChTrInsert& rCopy ); + virtual bool UsesDeletedTab() const override; + virtual void SaveActionData( XclExpStream& rStrm ) const override; virtual void PrepareSaveAction( XclExpStream& rStrm ) const override; virtual void CompleteSaveAction( XclExpStream& rStrm ) const override; @@ -531,6 +538,9 @@ private: SCTAB nTab; protected: + + virtual bool UsesDeletedTab() const override; + virtual void SaveActionData( XclExpStream& rStrm ) const override; public: @@ -553,6 +563,8 @@ class XclExpChTrMoveRange final : public XclExpChTrAction ScRange aSourceRange; ScRange aDestRange; + virtual bool UsesDeletedTab() const override; + virtual void SaveActionData( XclExpStream& rStrm ) const override; virtual void PrepareSaveAction( XclExpStream& rStrm ) const override; virtual void CompleteSaveAction( XclExpStream& rStrm ) const override; diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 71156df08e04..24da37109d29 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -717,6 +717,11 @@ void XclExpChTrAction::CompleteSaveAction( XclExpStream& /*rStrm*/ ) const void XclExpChTrAction::Save( XclExpStream& rStrm ) { + if (UsesDeletedTab()) + { + SAL_WARN("sc", "XclExpChTrAction : unable to export position with tab of EXC_TAB_DELETED"); + return; + } PrepareSaveAction( rStrm ); ExcRecord::Save( rStrm ); if( pAddAction ) @@ -927,6 +932,11 @@ void XclExpChTrCellContent::GetCellData( } } +bool XclExpChTrCellContent::UsesDeletedTab() const +{ + return IsDeletedTab(aPosition.Tab()); +} + void XclExpChTrCellContent::SaveActionData( XclExpStream& rStrm ) const { WriteTabId( rStrm, aPosition.Tab() ); @@ -1117,6 +1127,11 @@ XclExpChTrInsert::~XclExpChTrInsert() { } +bool XclExpChTrInsert::UsesDeletedTab() const +{ + return IsDeletedTab(aRange.aStart.Tab()); +} + void XclExpChTrInsert::SaveActionData( XclExpStream& rStrm ) const { WriteTabId( rStrm, aRange.aStart.Tab() ); @@ -1206,6 +1221,11 @@ XclExpChTrInsertTab::~XclExpChTrInsertTab() { } +bool XclExpChTrInsertTab::UsesDeletedTab() const +{ + return IsDeletedTab(nTab); +} + void XclExpChTrInsertTab::SaveActionData( XclExpStream& rStrm ) const { WriteTabId( rStrm, nTab ); @@ -1262,6 +1282,12 @@ XclExpChTrMoveRange::~XclExpChTrMoveRange() { } +bool XclExpChTrMoveRange::UsesDeletedTab() const +{ + return IsDeletedTab(aDestRange.aStart.Tab()) || + IsDeletedTab(aSourceRange.aStart.Tab()); +} + void XclExpChTrMoveRange::SaveActionData( XclExpStream& rStrm ) const { WriteTabId( rStrm, aDestRange.aStart.Tab() ); |