diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-02-20 11:02:54 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-02-20 11:25:30 +0900 |
commit | c92753e39575b4b823ce9df8f10fc8ecb8a9915e (patch) | |
tree | 788b8420e98a56fca51e15f7d0473d75888c8d69 | |
parent | 22b709e84a7b6d38cab2dd37f2f2b28e0fc9d062 (diff) |
Replace deprecated std::auto_ptr with boost::scoped_ptr
Change-Id: Iafdebacd43ed24a30fb8e2d041fe975a1adbcfa0
-rw-r--r-- | connectivity/source/drivers/jdbc/Object.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 14 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppIconControl.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/control/FieldDescControl.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/propertystorage.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx | 14 |
7 files changed, 22 insertions, 36 deletions
diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 461c1badaa76..f2a9ece8c85b 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -30,7 +30,7 @@ #include <comphelper/logging.hxx> -#include <memory> +#include <boost/scoped_ptr.hpp> using namespace connectivity; using namespace ::com::sun::star::uno; @@ -172,14 +172,14 @@ namespace if ( _pEnvironment->IsInstanceOf( jThrow, java_sql_SQLException_BASE::st_getMyClass() ) ) { - ::std::auto_ptr< java_sql_SQLException_BASE > pException( new java_sql_SQLException_BASE( _pEnvironment, jThrow ) ); + boost::scoped_ptr< java_sql_SQLException_BASE > pException( new java_sql_SQLException_BASE( _pEnvironment, jThrow ) ); _out_rException = SQLException( pException->getMessage(), _rxContext, pException->getSQLState(), pException->getErrorCode(), Any() ); return true; } else if ( _pEnvironment->IsInstanceOf( jThrow, java_lang_Throwable::st_getMyClass() ) ) { - ::std::auto_ptr< java_lang_Throwable > pThrow( new java_lang_Throwable( _pEnvironment, jThrow ) ); + boost::scoped_ptr< java_lang_Throwable > pThrow( new java_lang_Throwable( _pEnvironment, jThrow ) ); #if OSL_DEBUG_LEVEL > 0 pThrow->printStackTrace(); #endif diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index a5b3d5ec5dd0..7a324e998096 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -55,7 +55,7 @@ #include <unotools/configmgr.hxx> #include <unotools/sharedunocomponent.hxx> -#include <memory> +#include <boost/scoped_ptr.hpp> using namespace ::dbaccess; using namespace ::dbtools; @@ -676,9 +676,7 @@ void OSingleSelectQueryComposer::setSingleAdditiveClause( SQLPart _ePart, const aClauses.push_back( getSQLPart( eLoopParts, m_aSqlIterator, sal_True ) ); // overwrite the one part in question here - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< TokenComposer > pComposer; - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr< TokenComposer > pComposer; if ( ( _ePart == Where ) || ( _ePart == Having ) ) pComposer.reset( new FilterCreator ); else @@ -816,9 +814,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr OUString sSQL( aSQL.makeStringAndClear() ); // normalize the statement so that it doesn't contain any application-level features anymore OUString sError; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - const ::std::auto_ptr< OSQLParseNode > pStatementTree( m_aSqlParser.parseTree( sError, sSQL, false ) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + const boost::scoped_ptr< OSQLParseNode > pStatementTree( m_aSqlParser.parseTree( sError, sSQL, false ) ); OSL_ENSURE( pStatementTree.get(), "OSingleSelectQueryComposer::getColumns: could not parse the column retrieval statement!" ); if ( pStatementTree.get() ) if ( !pStatementTree->parseNodeToExecutableStatement( sSQL, m_xConnection, m_aSqlParser, NULL ) ) @@ -1738,9 +1734,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC const OSQLParseNode* pTempNode = m_aAdditiveIterator.getParseTree(); OUString aErrorMsg; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<OSQLParseNode> pSqlParseNode( m_aSqlParser.parseTree(aErrorMsg,aSql)); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr<OSQLParseNode> pSqlParseNode( m_aSqlParser.parseTree(aErrorMsg,aSql)); if ( pSqlParseNode.get() ) { m_aAdditiveIterator.setParseTree(pSqlParseNode.get()); diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 752ac35d7179..ad6f505bd694 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -25,7 +25,7 @@ #include <vcl/image.hxx> #include "callbacks.hxx" #include "AppElementType.hxx" -#include <memory> +#include <boost/scoped_ptr.hpp> using namespace ::dbaui; // class OApplicationIconControl @@ -68,7 +68,7 @@ OApplicationIconControl::~OApplicationIconControl() SvxIconChoiceCtrlEntry* pEntry = GetEntry( i ); if ( pEntry ) { - ::std::auto_ptr<ElementType> aType(static_cast<ElementType*>(pEntry->GetUserData())); + boost::scoped_ptr<ElementType> aType(static_cast<ElementType*>(pEntry->GetUserData())); pEntry->SetUserData(NULL); } } diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 2f33b1689328..a7c63001815d 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -50,7 +50,7 @@ #include <comphelper/numbers.hxx> #include <comphelper/string.hxx> #include "UITools.hxx" -#include <memory> +#include <boost/scoped_ptr.hpp> #include "dbu_control.hrc" #include "dbu_tbl.hrc" #include <osl/diagnose.h> @@ -212,15 +212,11 @@ OFieldDescControl::~OFieldDescControl() { { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<Window> aTemp(m_pVertScroll); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr<Window> aTemp(m_pVertScroll); m_pVertScroll = NULL; } { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<Window> aTemp(m_pHorzScroll); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr<Window> aTemp(m_pHorzScroll); m_pHorzScroll = NULL; } if ( m_bAdded ) diff --git a/dbaccess/source/ui/misc/propertystorage.cxx b/dbaccess/source/ui/misc/propertystorage.cxx index fd56ba1354c6..f13c3a1862e8 100644 --- a/dbaccess/source/ui/misc/propertystorage.cxx +++ b/dbaccess/source/ui/misc/propertystorage.cxx @@ -23,7 +23,8 @@ #include <svl/stritem.hxx> #include <svl/eitem.hxx> -#include <memory> +#include <cassert> +#include <boost/scoped_ptr.hpp> namespace dbaui { @@ -61,7 +62,8 @@ namespace dbaui // TODO: one could throw an IllegalArgumentException here - finally, this method // is (to be) used from within an XPropertySet::setPropertyValue implementation, // where this would be the appropriate reaction on wrong value types - ::std::auto_ptr< ITEMTYPE > pClone( dynamic_cast< ITEMTYPE* >( pTypedItem->Clone() ) ); + boost::scoped_ptr< ITEMTYPE > pClone( dynamic_cast< ITEMTYPE* >( pTypedItem->Clone() ) ); + assert(pClone.get()); pClone->SetValue( aValue ); _rSet.Put( *pClone ); return true; diff --git a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx index 912ee70128db..2677a5b395a7 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx @@ -21,7 +21,7 @@ #include <tools/debug.hxx> #include <svtools/svmedit.hxx> #include "dbaccess_helpid.hrc" -#include <memory> +#include <boost/scoped_ptr.hpp> using namespace dbaui; #define STANDARD_MARGIN 6 // class OTableDesignHelpBar @@ -37,7 +37,7 @@ OTableDesignHelpBar::OTableDesignHelpBar( Window* pParent ) : OTableDesignHelpBar::~OTableDesignHelpBar() { - ::std::auto_ptr<Window> aTemp(m_pTextWin); + boost::scoped_ptr<Window> aTemp(m_pTextWin); m_pTextWin = NULL; } diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx index da5c37e4e67c..04ea9cb6f31b 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx @@ -25,7 +25,7 @@ #include <vcl/fixed.hxx> #include "dbaccess_helpid.hrc" #include "moduledbu.hxx" -#include <memory> +#include <boost/scoped_ptr.hpp> #define STANDARD_MARGIN 6 #define DETAILS_HEADER_HEIGHT 25 @@ -70,21 +70,15 @@ OTableFieldDescWin::~OTableFieldDescWin() m_pHeader->Hide(); { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<Window> aTemp(m_pGenPage); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr<Window> aTemp(m_pGenPage); m_pGenPage = NULL; } { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<Window> aTemp(m_pHeader); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr<Window> aTemp(m_pHeader); m_pHeader = NULL; } { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<Window> aTemp(m_pHelpBar); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr<Window> aTemp(m_pHelpBar); m_pHelpBar = NULL; } } |