diff options
author | Noel Grandin <noel@peralex.com> | 2012-07-19 15:22:31 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-26 14:30:09 +0200 |
commit | ed24564ce11683731b820c29d5a46e073ab7a2a7 (patch) | |
tree | 9b5d5179d72f30469d01c7793e6c228df8c6597a | |
parent | a236f8318a0e05caeec53ccbee8b134f44a98008 (diff) |
SV_DECL_VARARR_SORT(ScRTFColTwips) o3tl::sorted_vector
Change-Id: I6d048af2b32ad02952cfe91d155ca17f5067ecee
-rw-r--r-- | sc/source/filter/inc/rtfparse.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/rtf/rtfparse.cxx | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sc/source/filter/inc/rtfparse.hxx b/sc/source/filter/inc/rtfparse.hxx index 3b436480e94c..c381378ddcc2 100644 --- a/sc/source/filter/inc/rtfparse.hxx +++ b/sc/source/filter/inc/rtfparse.hxx @@ -33,6 +33,7 @@ #ifdef SC_RTFPARSE_CXX #include <boost/ptr_container/ptr_vector.hpp> +#include <o3tl/sorted_vector.hxx> struct ScRTFCellDefault { @@ -46,7 +47,7 @@ struct ScRTFCellDefault }; // deswegen ULONG, typedef bringt's auch nicht :-( -SV_DECL_VARARR_SORT( ScRTFColTwips, sal_uLong, 16 ) +class ScRTFColTwips : public o3tl::sorted_vector<sal_uLong> {}; #else // SC_RTFPARSE_CXX diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx index 40e848f1f877..511d905ca784 100644 --- a/sc/source/filter/rtf/rtfparse.cxx +++ b/sc/source/filter/rtf/rtfparse.cxx @@ -46,9 +46,6 @@ -SV_IMPL_VARARR_SORT( ScRTFColTwips, sal_uLong ); - - ScRTFParser::ScRTFParser( EditEngine* pEditP ) : ScEEParser( pEditP ), @@ -126,12 +123,13 @@ inline void ScRTFParser::NextRow() sal_Bool ScRTFParser::SeekTwips( sal_uInt16 nTwips, SCCOL* pCol ) { - sal_uInt16 nPos; - sal_Bool bFound = pColTwips->Seek_Entry( nTwips, &nPos ); + ScRTFColTwips::const_iterator it = pColTwips->find( nTwips ); + sal_Bool bFound = it != pColTwips->end(); + sal_uInt16 nPos = it - pColTwips->end(); *pCol = static_cast<SCCOL>(nPos); if ( bFound ) return sal_True; - sal_uInt16 nCount = pColTwips->Count(); + sal_uInt16 nCount = pColTwips->size(); if ( !nCount ) return false; SCCOL nCol = *pCol; @@ -173,7 +171,7 @@ void ScRTFParser::ColAdjust() nColMax = nCol; } nStartAdjust = (sal_uLong)~0; - pColTwips->Remove( (sal_uInt16)0, pColTwips->Count() ); + pColTwips->clear(); } } @@ -252,7 +250,7 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ ) const ScRTFCellDefault& rD = maDefaultList[i]; SCCOL nCol; if ( !SeekTwips(rD.nTwips, &nCol) ) - pColTwips->Insert( rD.nTwips ); + pColTwips->insert( rD.nTwips ); } } pDefMerge = NULL; |