Kaydet (Commit) 523fcec5 authored tarafından Takeshi Abe's avatar Takeshi Abe

Replace deprecated std::auto_ptr with boost::scoped_ptr

Change-Id: I72b0e8b07bd7309a23d5635b7e0b7dbdc9c2c721
üst 295bc870
...@@ -82,6 +82,8 @@ ...@@ -82,6 +82,8 @@
#include "textapi.hxx" #include "textapi.hxx"
#include "optsitem.hxx" #include "optsitem.hxx"
#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::drawing;
...@@ -454,7 +456,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq ) ...@@ -454,7 +456,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
TextApiObject* pTextApi = getTextApiObject( xAnnotation ); TextApiObject* pTextApi = getTextApiObject( xAnnotation );
if( pTextApi ) if( pTextApi )
{ {
std::auto_ptr< ::Outliner > pOutliner( new ::Outliner(GetAnnotationPool(),OUTLINERMODE_TEXTOBJECT) ); boost::scoped_ptr< ::Outliner > pOutliner( new ::Outliner(GetAnnotationPool(),OUTLINERMODE_TEXTOBJECT) );
mpDoc->SetCalcFieldValueHdl( pOutliner.get() ); mpDoc->SetCalcFieldValueHdl( pOutliner.get() );
pOutliner->SetUpdateMode( sal_True ); pOutliner->SetUpdateMode( sal_True );
...@@ -490,7 +492,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq ) ...@@ -490,7 +492,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
pOutliner->QuickSetAttribs( aAnswerSet, aSel ); pOutliner->QuickSetAttribs( aAnswerSet, aSel );
} }
std::auto_ptr< OutlinerParaObject > pOPO( pOutliner->CreateParaObject() ); boost::scoped_ptr< OutlinerParaObject > pOPO( pOutliner->CreateParaObject() );
pTextApi->SetText( *pOPO.get() ); pTextApi->SetText( *pOPO.get() );
SvtUserOptions aUserOptions; SvtUserOptions aUserOptions;
...@@ -968,7 +970,7 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation ...@@ -968,7 +970,7 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation
if( bReadOnly && !pAnnotationWindow ) if( bReadOnly && !pAnnotationWindow )
return; return;
std::auto_ptr< PopupMenu > pMenu( new PopupMenu( SdResId( pAnnotationWindow ? RID_ANNOTATION_CONTEXTMENU : RID_ANNOTATION_TAG_CONTEXTMENU ) ) ); boost::scoped_ptr< PopupMenu > pMenu( new PopupMenu( SdResId( pAnnotationWindow ? RID_ANNOTATION_CONTEXTMENU : RID_ANNOTATION_TAG_CONTEXTMENU ) ) );
SvtUserOptions aUserOptions; SvtUserOptions aUserOptions;
OUString sCurrentAuthor( aUserOptions.GetFullName() ); OUString sCurrentAuthor( aUserOptions.GetFullName() );
......
...@@ -86,6 +86,8 @@ ...@@ -86,6 +86,8 @@
#include "textapi.hxx" #include "textapi.hxx"
#include "sdresid.hxx" #include "sdresid.hxx"
#include <boost/scoped_ptr.hpp>
using namespace ::sd; using namespace ::sd;
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
...@@ -548,7 +550,7 @@ void AnnotationWindow::setAnnotation( const Reference< XAnnotation >& xAnnotatio ...@@ -548,7 +550,7 @@ void AnnotationWindow::setAnnotation( const Reference< XAnnotation >& xAnnotatio
if( pTextApi ) if( pTextApi )
{ {
std::auto_ptr< OutlinerParaObject > pOPO( pTextApi->CreateText() ); boost::scoped_ptr< OutlinerParaObject > pOPO( pTextApi->CreateText() );
Engine()->SetText( *pOPO.get() ); Engine()->SetText( *pOPO.get() );
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "drawdoc.hxx" #include "drawdoc.hxx"
#include <svx/svxdlg.hxx> #include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc> #include <svx/dialogs.hrc>
#include <boost/scoped_ptr.hpp>
namespace sd { namespace sd {
...@@ -58,7 +59,7 @@ void FuConnectionDlg::DoExecute( SfxRequest& rReq ) ...@@ -58,7 +59,7 @@ void FuConnectionDlg::DoExecute( SfxRequest& rReq )
if( !pArgs ) if( !pArgs )
{ {
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
::std::auto_ptr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( NULL, aNewAttr, mpView, RID_SVXPAGE_CONNECTION) : 0); boost::scoped_ptr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( NULL, aNewAttr, mpView, RID_SVXPAGE_CONNECTION) : 0);
if( pDlg.get() && (pDlg->Execute() == RET_OK) ) if( pDlg.get() && (pDlg->Execute() == RET_OK) )
{ {
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "drawdoc.hxx" #include "drawdoc.hxx"
#include <svx/svxdlg.hxx> #include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc> #include <svx/dialogs.hrc>
#include <boost/scoped_ptr.hpp>
namespace sd { namespace sd {
...@@ -58,7 +59,7 @@ void FuMeasureDlg::DoExecute( SfxRequest& rReq ) ...@@ -58,7 +59,7 @@ void FuMeasureDlg::DoExecute( SfxRequest& rReq )
if( !pArgs ) if( !pArgs )
{ {
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
::std::auto_ptr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( NULL, aNewAttr, mpView, RID_SVXPAGE_MEASURE) : 0 ); boost::scoped_ptr<SfxAbstractDialog> pDlg( pFact ? pFact->CreateSfxDialog( NULL, aNewAttr, mpView, RID_SVXPAGE_MEASURE) : 0 );
if( pDlg.get() && (pDlg->Execute() == RET_OK) ) if( pDlg.get() && (pDlg->Execute() == RET_OK) )
{ {
......
...@@ -67,6 +67,8 @@ ...@@ -67,6 +67,8 @@
#include "sdundogr.hxx" #include "sdundogr.hxx"
#include "helpids.h" #include "helpids.h"
#include <boost/scoped_ptr.hpp>
namespace sd { namespace sd {
class Window; class Window;
...@@ -276,7 +278,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) ...@@ -276,7 +278,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
} }
} }
std::auto_ptr< SfxItemSet > pTempSet; boost::scoped_ptr< SfxItemSet > pTempSet;
if( GetSlotID() == SID_SELECT_BACKGROUND ) if( GetSlotID() == SID_SELECT_BACKGROUND )
{ {
...@@ -306,7 +308,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) ...@@ -306,7 +308,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent )
{ {
// create the dialog // create the dialog
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
std::auto_ptr<SfxAbstractTabDialog> pDlg( pFact ? pFact->CreateSdTabPageDialog(NULL, &aMergedAttr, mpDocSh, mbDisplayBackgroundTabPage ) : 0 ); boost::scoped_ptr<SfxAbstractTabDialog> pDlg( pFact ? pFact->CreateSdTabPageDialog(NULL, &aMergedAttr, mpDocSh, mbDisplayBackgroundTabPage ) : 0 );
if( pDlg.get() && pDlg->Execute() == RET_OK ) if( pDlg.get() && pDlg->Execute() == RET_OK )
pTempSet.reset( new SfxItemSet(*pDlg->GetOutputItemSet()) ); pTempSet.reset( new SfxItemSet(*pDlg->GetOutputItemSet()) );
} }
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "tools/TimerBasedTaskExecution.hxx" #include "tools/TimerBasedTaskExecution.hxx"
#include "pres.hxx" #include "pres.hxx"
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <boost/scoped_ptr.hpp>
#include <boost/weak_ptr.hpp> #include <boost/weak_ptr.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -800,7 +801,7 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage ( ...@@ -800,7 +801,7 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage (
{ {
// Update an existing MasterPageDescriptor. // Update an existing MasterPageDescriptor.
aResult = (*aEntry)->maToken; aResult = (*aEntry)->maToken;
::std::auto_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > pEventTypes( boost::scoped_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > pEventTypes(
(*aEntry)->Update(*rpDescriptor)); (*aEntry)->Update(*rpDescriptor));
if (pEventTypes.get()!=NULL && pEventTypes->size()>0) if (pEventTypes.get()!=NULL && pEventTypes->size()>0)
{ {
......
...@@ -63,6 +63,8 @@ ...@@ -63,6 +63,8 @@
#include "sdresid.hxx" #include "sdresid.hxx"
#include "undo/undoobjects.hxx" #include "undo/undoobjects.hxx"
#include <boost/scoped_ptr.hpp>
using namespace ::sd; using namespace ::sd;
using namespace ::sdr::table; using namespace ::sdr::table;
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -127,7 +129,7 @@ void DrawViewShell::FuTable(SfxRequest& rReq) ...@@ -127,7 +129,7 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
if( (nColumns == 0) || (nRows == 0) ) if( (nColumns == 0) || (nRows == 0) )
{ {
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
::std::auto_ptr<SvxAbstractNewTableDialog> pDlg( pFact ? pFact->CreateSvxNewTableDialog( NULL ) : 0); boost::scoped_ptr<SvxAbstractNewTableDialog> pDlg( pFact ? pFact->CreateSvxNewTableDialog( NULL ) : 0);
if( !pDlg.get() || (pDlg->Execute() != RET_OK) ) if( !pDlg.get() || (pDlg->Execute() != RET_OK) )
break; break;
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include "tableobjectbar.hxx" #include "tableobjectbar.hxx"
#include <boost/scoped_ptr.hpp>
using namespace sd; using namespace sd;
using namespace sd::ui::table; using namespace sd::ui::table;
...@@ -158,7 +160,7 @@ void TableObjectBar::Execute( SfxRequest& rReq ) ...@@ -158,7 +160,7 @@ void TableObjectBar::Execute( SfxRequest& rReq )
case SID_TABLE_INSERT_COL_DLG: case SID_TABLE_INSERT_COL_DLG:
{ {
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
::std::auto_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( mpView->GetViewShell()->GetParentWindow(), nSlotId == SID_TABLE_INSERT_COL_DLG, SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) : 0); boost::scoped_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( mpView->GetViewShell()->GetParentWindow(), nSlotId == SID_TABLE_INSERT_COL_DLG, SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) : 0);
if( pDlg.get() && (pDlg->Execute() == 1) ) if( pDlg.get() && (pDlg->Execute() == 1) )
{ {
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
#include "Outliner.hxx" #include "Outliner.hxx"
#include "futext.hxx" #include "futext.hxx"
#include <boost/scoped_ptr.hpp>
namespace sd { namespace sd {
/** /**
...@@ -81,9 +83,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) ...@@ -81,9 +83,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
sal_uInt16 nSlot = rReq.GetSlot(); sal_uInt16 nSlot = rReq.GetSlot();
OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
SAL_WNODEPRECATED_DECLARATIONS_PUSH boost::scoped_ptr< OutlineViewModelChangeGuard > aGuard;
std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
SAL_WNODEPRECATED_DECLARATIONS_POP
if (mpView->ISA(OutlineView)) if (mpView->ISA(OutlineView))
{ {
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "OutlineViewShell.hxx" #include "OutlineViewShell.hxx"
#include "ViewShellImplementation.hxx" #include "ViewShellImplementation.hxx"
#include <memory>
#include "helpids.h" #include "helpids.h"
#include "app.hrc" #include "app.hrc"
#include <svx/hyperdlg.hxx> #include <svx/hyperdlg.hxx>
...@@ -88,6 +87,8 @@ ...@@ -88,6 +87,8 @@
#include "DrawController.hxx" #include "DrawController.hxx"
#include "framework/FrameworkHelper.hxx" #include "framework/FrameworkHelper.hxx"
#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
...@@ -462,9 +463,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq) ...@@ -462,9 +463,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
sal_Bool bPreviewState = sal_False; sal_Bool bPreviewState = sal_False;
sal_uLong nSlot = rReq.GetSlot(); sal_uLong nSlot = rReq.GetSlot();
SAL_WNODEPRECATED_DECLARATIONS_PUSH boost::scoped_ptr< OutlineViewModelChangeGuard > aGuard;
std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
SAL_WNODEPRECATED_DECLARATIONS_POP
if( pOlView && ( if( pOlView && (
(nSlot == SID_TRANSLITERATE_SENTENCE_CASE) || (nSlot == SID_TRANSLITERATE_SENTENCE_CASE) ||
(nSlot == SID_TRANSLITERATE_TITLE_CASE) || (nSlot == SID_TRANSLITERATE_TITLE_CASE) ||
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::frame; using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
...@@ -292,7 +294,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, com::sun::star::uno::An ...@@ -292,7 +294,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, com::sun::star::uno::An
{ {
// attempt to protect the document against the script tampering with its Undo Context // attempt to protect the document against the script tampering with its Undo Context
::std::auto_ptr< ::framework::DocumentUndoGuard > pUndoGuard; boost::scoped_ptr< ::framework::DocumentUndoGuard > pUndoGuard;
if ( bIsDocBasic ) if ( bIsDocBasic )
pUndoGuard.reset( new ::framework::DocumentUndoGuard( pDoc->GetModel() ) ); pUndoGuard.reset( new ::framework::DocumentUndoGuard( pDoc->GetModel() ) );
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <boost/scoped_ptr.hpp>
using namespace basegfx; using namespace basegfx;
using namespace basegfx::tools; using namespace basegfx::tools;
using namespace drawinglayer::attribute; using namespace drawinglayer::attribute;
...@@ -1382,7 +1384,7 @@ BitmapEx ThumbnailView::readThumbnail(const OUString &msURL) ...@@ -1382,7 +1384,7 @@ BitmapEx ThumbnailView::readThumbnail(const OUString &msURL)
BitmapEx aThumbnail; BitmapEx aThumbnail;
if (xIStream.is()) if (xIStream.is())
{ {
::std::auto_ptr<SvStream> pStream ( boost::scoped_ptr<SvStream> pStream (
::utl::UcbStreamHelper::CreateStream (xIStream)); ::utl::UcbStreamHelper::CreateStream (xIStream));
::vcl::PNGReader aReader (*pStream); ::vcl::PNGReader aReader (*pStream);
aThumbnail = aReader.Read (); aThumbnail = aReader.Read ();
......
...@@ -131,6 +131,8 @@ using namespace ::com::sun::star::container; ...@@ -131,6 +131,8 @@ using namespace ::com::sun::star::container;
#include "appbaslib.hxx" #include "appbaslib.hxx"
#include <openflag.hxx> #include <openflag.hxx>
#include <boost/scoped_ptr.hpp>
// class SfxHeaderAttributes_Impl ---------------------------------------- // class SfxHeaderAttributes_Impl ----------------------------------------
class SfxHeaderAttributes_Impl : public SvKeyValueIterator class SfxHeaderAttributes_Impl : public SvKeyValueIterator
...@@ -1561,7 +1563,7 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon ...@@ -1561,7 +1563,7 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon
if ( bCaughtException && bRaiseError ) if ( bCaughtException && bRaiseError )
{ {
::std::auto_ptr< VclAbstractDialog > pScriptErrDlg; boost::scoped_ptr< VclAbstractDialog > pScriptErrDlg;
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
if ( pFact ) if ( pFact )
pScriptErrDlg.reset( pFact->CreateScriptErrorDialog( NULL, aException ) ); pScriptErrDlg.reset( pFact->CreateScriptErrorDialog( NULL, aException ) );
......
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