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
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <utility>
#include "formula/FormulaOpCodeMapperObj.hxx"
#include "formula/opcode.hxx"
#include <comphelper/sequence.hxx>
@ -30,12 +35,10 @@ sal_Bool SAL_CALL FormulaOpCodeMapperObj::supportsService( const OUString& _rSer
return cppu::supportsService(this, _rServiceName);
}
SAL_WNODEPRECATED_DECLARATIONS_PUSH
FormulaOpCodeMapperObj::FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler)
: m_pCompiler(_pCompiler)
FormulaOpCodeMapperObj::FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler> && _pCompiler)
: m_pCompiler(std::move(_pCompiler))
{
}
SAL_WNODEPRECATED_DECLARATIONS_POP
FormulaOpCodeMapperObj::~FormulaOpCodeMapperObj()
{
@ -102,16 +105,11 @@ uno::Sequence< OUString > SAL_CALL FormulaOpCodeMapperObj::getSupportedServiceNa
return aSeq;
}
SAL_WNODEPRECATED_DECLARATIONS_PUSH
uno::Reference< uno::XInterface > SAL_CALL FormulaOpCodeMapperObj::create(
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

View File

@ -133,7 +133,7 @@ namespace formula
public:
mutable uno::Reference< sheet::XFormulaOpCodeMapper> m_xOpCodeMapper;
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 const sheet::FormulaOpCodeMapEntry* m_pSpecialOpCodesEnd;
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::lang::XServiceInfo >
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<FormulaCompiler> m_pCompiler;
SAL_WNODEPRECATED_DECLARATIONS_POP
::std::unique_ptr<FormulaCompiler> m_pCompiler;
public:
static OUString getImplementationName_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);
protected:
SAL_WNODEPRECATED_DECLARATIONS_PUSH
FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler);
SAL_WNODEPRECATED_DECLARATIONS_POP
FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler> && _pCompiler);
virtual ~FormulaOpCodeMapperObj();
private:

View File

@ -147,7 +147,7 @@ namespace formula
virtual void setReferenceInput(const FormEditData* _pData) = 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::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const = 0;

View File

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

View File

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

View File

@ -253,20 +253,13 @@ table::CellAddress FormulaDialog::getReferencePosition() const
return table::CellAddress();
}
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<formula::FormulaTokenArray> FormulaDialog::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
::std::unique_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);
return pArray;
}
} // 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: */

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::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
virtual void ShowReference(const OUString& _sRef) SAL_OVERRIDE;

View File

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

View File

@ -645,17 +645,11 @@ table::CellAddress ScFormulaDlg::getReferencePosition() const
return table::CellAddress(aCursorPos.Tab(),aCursorPos.Col(),aCursorPos.Row());
}
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<formula::FormulaTokenArray> ScFormulaDlg::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
::std::unique_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());
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: */

View File

@ -76,7 +76,7 @@ public:
virtual OUString getCurrentFormula() const 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::XFormulaOpCodeMapper> getFormulaOpCodeMapper() 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;
}
SAL_WNODEPRECATED_DECLARATIONS_PUSH
ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::FormulaCompiler> _pCompiler)
: formula::FormulaOpCodeMapperObj(_pCompiler)
ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::unique_ptr<formula::FormulaCompiler> && _pCompiler)
: formula::FormulaOpCodeMapperObj(std::move(_pCompiler))
{
}
SAL_WNODEPRECATED_DECLARATIONS_POP
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */