formula: std::auto_ptr -> std::unique_ptr

Change-Id: I7b4784abf5177e22a9df33c5d4faccfd39801b11
This commit is contained in:
Stephan Bergmann
2014-09-26 15:46:31 +02:00
parent 296371d5d8
commit 1df1c5eed9
12 changed files with 24 additions and 51 deletions

View File

@@ -16,6 +16,11 @@
* except in compliance with the License. You may obtain a copy of * except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <sal/config.h>
#include <utility>
#include "formula/FormulaOpCodeMapperObj.hxx" #include "formula/FormulaOpCodeMapperObj.hxx"
#include "formula/opcode.hxx" #include "formula/opcode.hxx"
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
@@ -30,12 +35,10 @@ sal_Bool SAL_CALL FormulaOpCodeMapperObj::supportsService( const OUString& _rSer
return cppu::supportsService(this, _rServiceName); return cppu::supportsService(this, _rServiceName);
} }
SAL_WNODEPRECATED_DECLARATIONS_PUSH FormulaOpCodeMapperObj::FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler> && _pCompiler)
FormulaOpCodeMapperObj::FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler) : m_pCompiler(std::move(_pCompiler))
: m_pCompiler(_pCompiler)
{ {
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
FormulaOpCodeMapperObj::~FormulaOpCodeMapperObj() FormulaOpCodeMapperObj::~FormulaOpCodeMapperObj()
{ {
@@ -102,16 +105,11 @@ uno::Sequence< OUString > SAL_CALL FormulaOpCodeMapperObj::getSupportedServiceNa
return aSeq; return aSeq;
} }
SAL_WNODEPRECATED_DECLARATIONS_PUSH
uno::Reference< uno::XInterface > SAL_CALL FormulaOpCodeMapperObj::create( uno::Reference< uno::XInterface > SAL_CALL FormulaOpCodeMapperObj::create(
uno::Reference< uno::XComponentContext > const & /*_xContext*/) uno::Reference< uno::XComponentContext > const & /*_xContext*/)
{ {
return static_cast<sheet::XFormulaOpCodeMapper*>(new FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler>(new FormulaCompiler()))); return static_cast<sheet::XFormulaOpCodeMapper*>(new FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler>(new FormulaCompiler())));
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
} // formula } // formula

View File

@@ -133,7 +133,7 @@ namespace formula
public: public:
mutable uno::Reference< sheet::XFormulaOpCodeMapper> m_xOpCodeMapper; mutable uno::Reference< sheet::XFormulaOpCodeMapper> m_xOpCodeMapper;
uno::Sequence< sheet::FormulaToken > m_aTokenList; uno::Sequence< sheet::FormulaToken > m_aTokenList;
::std::auto_ptr<FormulaTokenArray> m_pTokenArray; ::std::unique_ptr<FormulaTokenArray> m_pTokenArray;
mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aSpecialOpCodes; mutable uno::Sequence< sheet::FormulaOpCodeMapEntry > m_aSpecialOpCodes;
mutable const sheet::FormulaOpCodeMapEntry* m_pSpecialOpCodesEnd; mutable const sheet::FormulaOpCodeMapEntry* m_pSpecialOpCodesEnd;
mutable uno::Sequence< sheet::FormulaToken > m_aSeparatorsOpCodes; mutable uno::Sequence< sheet::FormulaToken > m_aSeparatorsOpCodes;

View File

@@ -36,18 +36,14 @@ class FORMULA_DLLPUBLIC FormulaOpCodeMapperObj : public ::cppu::WeakImplHelper2<
::com::sun::star::sheet::XFormulaOpCodeMapper, ::com::sun::star::sheet::XFormulaOpCodeMapper,
::com::sun::star::lang::XServiceInfo > ::com::sun::star::lang::XServiceInfo >
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr<FormulaCompiler> m_pCompiler;
::std::auto_ptr<FormulaCompiler> m_pCompiler;
SAL_WNODEPRECATED_DECLARATIONS_POP
public: public:
static OUString getImplementationName_Static(); static OUString getImplementationName_Static();
static ::com::sun::star::uno::Sequence< OUString> getSupportedServiceNames_Static(); static ::com::sun::star::uno::Sequence< OUString> getSupportedServiceNames_Static();
static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext);
protected: protected:
SAL_WNODEPRECATED_DECLARATIONS_PUSH FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler> && _pCompiler);
FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler);
SAL_WNODEPRECATED_DECLARATIONS_POP
virtual ~FormulaOpCodeMapperObj(); virtual ~FormulaOpCodeMapperObj();
private: private:

View File

@@ -147,7 +147,7 @@ namespace formula
virtual void setReferenceInput(const FormEditData* _pData) = 0; virtual void setReferenceInput(const FormEditData* _pData) = 0;
virtual IFunctionManager* getFunctionManager() = 0; virtual IFunctionManager* getFunctionManager() = 0;
virtual ::std::auto_ptr<FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList) = 0; virtual ::std::unique_ptr<FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList) = 0;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const = 0; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const = 0;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0;

View File

@@ -59,9 +59,7 @@ public:
virtual ~FormulaModalDialog(); virtual ~FormulaModalDialog();
private: private:
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr<FormulaDlg_Impl> m_pImpl;
::std::auto_ptr<FormulaDlg_Impl> m_pImpl;
SAL_WNODEPRECATED_DECLARATIONS_POP
protected: protected:
@@ -99,9 +97,7 @@ public:
, IControlReferenceHandler* _pDlg = NULL ); , IControlReferenceHandler* _pDlg = NULL );
virtual ~FormulaDlg(); virtual ~FormulaDlg();
private: private:
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr<FormulaDlg_Impl> m_pImpl;
::std::auto_ptr<FormulaDlg_Impl> m_pImpl;
SAL_WNODEPRECATED_DECLARATIONS_POP
DECL_LINK( UpdateFocusHdl, void*); DECL_LINK( UpdateFocusHdl, void*);
protected: protected:

View File

@@ -33,7 +33,7 @@ namespace formula
{ {
class FORMULA_DLLPUBLIC FormulaHelper class FORMULA_DLLPUBLIC FormulaHelper
{ {
::std::auto_ptr<SvtSysLocale> m_pSysLocale; ::std::unique_ptr<SvtSysLocale> m_pSysLocale;
const CharClass* m_pCharClass; const CharClass* m_pCharClass;
const IFunctionManager* m_pFunctionManager; const IFunctionManager* m_pFunctionManager;
const sal_Unicode open; const sal_Unicode open;

View File

@@ -253,20 +253,13 @@ table::CellAddress FormulaDialog::getReferencePosition() const
return table::CellAddress(); return table::CellAddress();
} }
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr<formula::FormulaTokenArray> FormulaDialog::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
::std::auto_ptr<formula::FormulaTokenArray> FormulaDialog::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
{ {
::std::auto_ptr<formula::FormulaTokenArray> pArray(new FormulaTokenArray()); ::std::unique_ptr<formula::FormulaTokenArray> pArray(new FormulaTokenArray());
pArray->Fill(_aTokenList, mrStringPool, NULL); pArray->Fill(_aTokenList, mrStringPool, NULL);
return pArray; return pArray;
} }
} // rptui } // rptui
// for mysterious reasons Apple llvm-g++ 4.2.1 needs these explicit
// template instantiations; otherwise linking fails with unresolved symbols
template class ::std::auto_ptr<formula::FormulaTokenArray>;
template std::auto_ptr<formula::FormulaTokenArray>::operator std::auto_ptr_ref<formula::FormulaTokenArray>();
SAL_WNODEPRECATED_DECLARATIONS_POP
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -93,7 +93,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const SAL_OVERRIDE;
virtual ::com::sun::star::table::CellAddress getReferencePosition() const SAL_OVERRIDE; virtual ::com::sun::star::table::CellAddress getReferencePosition() const SAL_OVERRIDE;
virtual ::std::auto_ptr<formula::FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList) SAL_OVERRIDE; virtual ::std::unique_ptr<formula::FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList) SAL_OVERRIDE;
// IControlReferenceHandler // IControlReferenceHandler
virtual void ShowReference(const OUString& _sRef) SAL_OVERRIDE; virtual void ShowReference(const OUString& _sRef) SAL_OVERRIDE;

View File

@@ -136,9 +136,7 @@ public:
class ScFormulaOpCodeMapperObj : public formula::FormulaOpCodeMapperObj class ScFormulaOpCodeMapperObj : public formula::FormulaOpCodeMapperObj
{ {
public: public:
SAL_WNODEPRECATED_DECLARATIONS_PUSH ScFormulaOpCodeMapperObj(::std::unique_ptr<formula::FormulaCompiler> && _pCompiler);
ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::FormulaCompiler> _pCompiler);
SAL_WNODEPRECATED_DECLARATIONS_POP
}; };
#endif #endif

View File

@@ -645,17 +645,11 @@ table::CellAddress ScFormulaDlg::getReferencePosition() const
return table::CellAddress(aCursorPos.Tab(),aCursorPos.Col(),aCursorPos.Row()); return table::CellAddress(aCursorPos.Tab(),aCursorPos.Col(),aCursorPos.Row());
} }
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr<formula::FormulaTokenArray> ScFormulaDlg::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
::std::auto_ptr<formula::FormulaTokenArray> ScFormulaDlg::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
{ {
::std::auto_ptr<formula::FormulaTokenArray> pArray(new ScTokenArray()); ::std::unique_ptr<formula::FormulaTokenArray> pArray(new ScTokenArray());
pArray->Fill(_aTokenList, pDoc->GetSharedStringPool(), pDoc->GetExternalRefManager()); pArray->Fill(_aTokenList, pDoc->GetSharedStringPool(), pDoc->GetExternalRefManager());
return pArray; return pArray;
} }
// for mysterious reasons Apple llvm-g++ 4.2.1 needs these explicit
// template instantiations; otherwise linking fails with unresolved symbols
template class ::std::auto_ptr<formula::FormulaTokenArray>;
template std::auto_ptr<formula::FormulaTokenArray>::operator std::auto_ptr_ref<formula::FormulaTokenArray>();
SAL_WNODEPRECATED_DECLARATIONS_POP
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -76,7 +76,7 @@ public:
virtual OUString getCurrentFormula() const SAL_OVERRIDE; virtual OUString getCurrentFormula() const SAL_OVERRIDE;
virtual formula::IFunctionManager* getFunctionManager() SAL_OVERRIDE; virtual formula::IFunctionManager* getFunctionManager() SAL_OVERRIDE;
virtual ::std::auto_ptr<formula::FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList) SAL_OVERRIDE; virtual ::std::unique_ptr<formula::FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const SAL_OVERRIDE;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const SAL_OVERRIDE; virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const SAL_OVERRIDE;
virtual ::com::sun::star::table::CellAddress getReferencePosition() const SAL_OVERRIDE; virtual ::com::sun::star::table::CellAddress getReferencePosition() const SAL_OVERRIDE;

View File

@@ -491,11 +491,9 @@ bool ScTokenConversion::ConvertToTokenSequence( const ScDocument& rDoc,
return !bError; return !bError;
} }
SAL_WNODEPRECATED_DECLARATIONS_PUSH ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::unique_ptr<formula::FormulaCompiler> && _pCompiler)
ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::FormulaCompiler> _pCompiler) : formula::FormulaOpCodeMapperObj(std::move(_pCompiler))
: formula::FormulaOpCodeMapperObj(_pCompiler)
{ {
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */