Kaydet (Commit) 024a0753 authored tarafından Noel Grandin's avatar Noel Grandin

sc: boost::ptr_vector->std::vector<std::unique_ptr>

Change-Id: I2c43a1dd3bee277dfd79f1806233b4d27d6b5cac
üst 526f2f86
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "excimp8.hxx" #include "excimp8.hxx"
#include "scextopt.hxx" #include "scextopt.hxx"
#include "document.hxx" #include "document.hxx"
#include <o3tl/make_unique.hxx>
// *** Implementation *** // *** Implementation ***
...@@ -276,7 +277,7 @@ void XclImpNameManager::ReadName( XclImpStream& rStrm ) ...@@ -276,7 +277,7 @@ void XclImpNameManager::ReadName( XclImpStream& rStrm )
{ {
sal_uLong nCount = maNameList.size(); sal_uLong nCount = maNameList.size();
if( nCount < 0xFFFF ) if( nCount < 0xFFFF )
maNameList.push_back( new XclImpName( rStrm, static_cast< sal_uInt16 >( nCount + 1 ) ) ); maNameList.push_back( o3tl::make_unique<XclImpName>( rStrm, static_cast< sal_uInt16 >( nCount + 1 ) ) );
} }
const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB nScTab ) const const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB nScTab ) const
...@@ -285,12 +286,12 @@ const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB n ...@@ -285,12 +286,12 @@ const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB n
const XclImpName* pLocalName = nullptr; // a found local name const XclImpName* pLocalName = nullptr; // a found local name
for( XclImpNameList::const_iterator itName = maNameList.begin(); itName != maNameList.end() && !pLocalName; ++itName ) for( XclImpNameList::const_iterator itName = maNameList.begin(); itName != maNameList.end() && !pLocalName; ++itName )
{ {
if( itName->GetXclName() == rXclName ) if( (*itName)->GetXclName() == rXclName )
{ {
if( itName->GetScTab() == nScTab ) if( (*itName)->GetScTab() == nScTab )
pLocalName = &(*itName); pLocalName = itName->get();
else if( itName->IsGlobal() ) else if( (*itName)->IsGlobal() )
pGlobalName = &(*itName); pGlobalName = itName->get();
} }
} }
return pLocalName ? pLocalName : pGlobalName; return pLocalName ? pLocalName : pGlobalName;
...@@ -299,14 +300,14 @@ const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB n ...@@ -299,14 +300,14 @@ const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB n
const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const
{ {
OSL_ENSURE( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" ); OSL_ENSURE( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" );
return ( nXclNameIdx <= 0 || nXclNameIdx > maNameList.size() ) ? nullptr : &(maNameList.at( nXclNameIdx - 1 )); return ( nXclNameIdx <= 0 || nXclNameIdx > maNameList.size() ) ? nullptr : maNameList.at( nXclNameIdx - 1 ).get();
} }
void XclImpNameManager::ConvertAllTokens() void XclImpNameManager::ConvertAllTokens()
{ {
XclImpNameList::iterator it = maNameList.begin(), itEnd = maNameList.end(); XclImpNameList::iterator it = maNameList.begin(), itEnd = maNameList.end();
for (; it != itEnd; ++it) for (; it != itEnd; ++it)
it->ConvertTokens(); (*it)->ConvertTokens();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#ifndef INCLUDED_SC_SOURCE_FILTER_INC_XINAME_HXX #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XINAME_HXX
#define INCLUDED_SC_SOURCE_FILTER_INC_XINAME_HXX #define INCLUDED_SC_SOURCE_FILTER_INC_XINAME_HXX
#include <boost/ptr_container/ptr_vector.hpp>
#include "xlname.hxx" #include "xlname.hxx"
#include "xiroot.hxx" #include "xiroot.hxx"
#include "xistream.hxx" #include "xistream.hxx"
...@@ -29,6 +28,7 @@ ...@@ -29,6 +28,7 @@
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <memory> #include <memory>
#include <vector>
class ScRangeData; class ScRangeData;
class ScTokenArray; class ScTokenArray;
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
void ConvertAllTokens(); void ConvertAllTokens();
private: private:
typedef boost::ptr_vector< XclImpName > XclImpNameList; typedef std::vector< std::unique_ptr<XclImpName> > XclImpNameList;
XclImpNameList maNameList; XclImpNameList maNameList;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment