diff options
-rw-r--r-- | sc/source/filter/excel/exctools.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xistyle.cxx | 18 | ||||
-rw-r--r-- | sc/source/filter/inc/xistyle.hxx | 7 |
3 files changed, 15 insertions, 12 deletions
diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx index ed14c51bbc9a..6d98540d8d96 100644 --- a/sc/source/filter/excel/exctools.cxx +++ b/sc/source/filter/excel/exctools.cxx @@ -199,8 +199,6 @@ ExcScenario::ExcScenario( XclImpStream& rIn, const RootData& rR ) if( nComment ) aComment = rIn.ReadUniString(); - else - aComment; sal_uInt16 n = nCref; sal_uInt16 nC, nR; diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 603d294fa2ee..4ff74b58780e 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1683,6 +1683,8 @@ ScStyleSheet* XclImpXFBuffer::CreateStyleSheet( sal_uInt16 nXFIndex ) // Buffer for XF indexes in cells ============================================= +IMPL_FIXEDMEMPOOL_NEWDEL( XclImpXFRange ) + bool XclImpXFRange::Expand( SCROW nScRow, const XclImpXFIndex& rXFIndex ) { if( maXFIndex != rXFIndex ) @@ -1720,7 +1722,7 @@ void XclImpXFRangeColumn::SetDefaultXF( const XclImpXFIndex& rXFIndex ) OSL_ENSURE( maIndexList.empty(), "XclImpXFRangeColumn::SetDefaultXF - Setting Default Column XF is not empty" ); // insert a complete row range with one insert. - maIndexList.push_back( XclImpXFRange( 0, MAXROW, rXFIndex ) ); + maIndexList.push_back( new XclImpXFRange( 0, MAXROW, rXFIndex ) ); } void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex ) @@ -1757,20 +1759,20 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex ) ++(pThisRange->mnScRow1); // try to concatenate with previous of this if( !pPrevRange || !pPrevRange->Expand( nScRow, rXFIndex ) ) - Insert( XclImpXFRange( nScRow, rXFIndex ), nIndex ); + Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex ); } else if( nLastScRow == nScRow ) // replace last XF { --(pThisRange->mnScRow2); if( !pNextRange || !pNextRange->Expand( nScRow, rXFIndex ) ) - Insert( XclImpXFRange( nScRow, rXFIndex ), nNextIndex ); + Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex ); } else // insert in the middle of the range { pThisRange->mnScRow1 = nScRow + 1; // List::Insert() moves entries towards end of list, so insert twice at nIndex - Insert( XclImpXFRange( nScRow, rXFIndex ), nIndex ); - Insert( XclImpXFRange( nFirstScRow, nScRow - 1, pThisRange->maXFIndex ), nIndex ); + Insert( new XclImpXFRange( nScRow, rXFIndex ), nIndex ); + Insert( new XclImpXFRange( nFirstScRow, nScRow - 1, pThisRange->maXFIndex ), nIndex ); } return; } @@ -1786,12 +1788,12 @@ void XclImpXFRangeColumn::SetXF( SCROW nScRow, const XclImpXFIndex& rXFIndex ) return; // create new range - Insert( XclImpXFRange( nScRow, rXFIndex ), nNextIndex ); + Insert( new XclImpXFRange( nScRow, rXFIndex ), nNextIndex ); } -void XclImpXFRangeColumn::Insert(const XclImpXFRange& rXFRange, sal_uLong nIndex) +void XclImpXFRangeColumn::Insert(XclImpXFRange* pXFRange, sal_uLong nIndex) { - maIndexList.insert( maIndexList.begin() + nIndex, rXFRange ); + maIndexList.insert( maIndexList.begin() + nIndex, pXFRange ); } void XclImpXFRangeColumn::Find( diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx index 183d47258a62..1fd2978d008f 100644 --- a/sc/source/filter/inc/xistyle.hxx +++ b/sc/source/filter/inc/xistyle.hxx @@ -25,6 +25,7 @@ #include <vector> #include <tools/mempool.hxx> #include <boost/noncopyable.hpp> +#include <boost/ptr_container/ptr_vector.hpp> #include "rangelst.hxx" #include "patattr.hxx" #include "xladdress.hxx" @@ -519,6 +520,8 @@ private: /** Contains an (encoded) XF index for a range of rows in a single column. */ class XclImpXFRange { + DECL_FIXEDMEMPOOL_NEWDEL( XclImpXFRange ) + public: SCROW mnScRow1; /// The first row of an equal-formatted range. SCROW mnScRow2; /// The last row of an equal-formatted range. @@ -559,7 +562,7 @@ inline bool XclImpXFRange::Contains( SCROW nScRow ) const class XclImpXFRangeColumn : private boost::noncopyable { public: - typedef std::vector<XclImpXFRange> IndexList; + typedef ::boost::ptr_vector<XclImpXFRange> IndexList; inline explicit XclImpXFRangeColumn() {} @@ -587,7 +590,7 @@ private: void TryConcatPrev( sal_uLong nIndex ); /** Insert a range into the list at the specified index. */ - void Insert(const XclImpXFRange& rXFRange, sal_uLong nIndex); + void Insert(XclImpXFRange* pXFRange, sal_uLong nIndex); private: IndexList maIndexList; /// The list of XF index range. |