Kaydet (Commit) a9246068 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

editeng: std::auto_ptr -> std::unique_ptr

Change-Id: I25e3599a37d720cbcf70ea13ab30234e54637d53
üst 09b13e1e
...@@ -108,7 +108,7 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, sal ...@@ -108,7 +108,7 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, sal
} }
else else
{ {
std::auto_ptr<SvXMLAttrContainerData> pNewImpl(new SvXMLAttrContainerData); std::unique_ptr<SvXMLAttrContainerData> pNewImpl(new SvXMLAttrContainerData);
try try
{ {
......
...@@ -44,56 +44,54 @@ sal_uLong SvxEditSourceHint::GetValue() const ...@@ -44,56 +44,54 @@ sal_uLong SvxEditSourceHint::GetValue() const
} }
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr<SfxHint> SvxEditSourceHelper::EENotification2Hint( EENotify* aNotify )
::std::auto_ptr<SfxHint> SvxEditSourceHelper::EENotification2Hint( EENotify* aNotify )
{ {
if( aNotify ) if( aNotify )
{ {
switch( aNotify->eNotificationType ) switch( aNotify->eNotificationType )
{ {
case EE_NOTIFY_TEXTMODIFIED: case EE_NOTIFY_TEXTMODIFIED:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_MODIFIED, aNotify->nParagraph ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_MODIFIED, aNotify->nParagraph ) );
case EE_NOTIFY_PARAGRAPHINSERTED: case EE_NOTIFY_PARAGRAPHINSERTED:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_PARAINSERTED, aNotify->nParagraph ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_PARAINSERTED, aNotify->nParagraph ) );
case EE_NOTIFY_PARAGRAPHREMOVED: case EE_NOTIFY_PARAGRAPHREMOVED:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_PARAREMOVED, aNotify->nParagraph ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_PARAREMOVED, aNotify->nParagraph ) );
case EE_NOTIFY_PARAGRAPHSMOVED: case EE_NOTIFY_PARAGRAPHSMOVED:
return ::std::auto_ptr<SfxHint>( new SvxEditSourceHint( EDITSOURCE_HINT_PARASMOVED, aNotify->nParagraph, aNotify->nParam1, aNotify->nParam2 ) ); return ::std::unique_ptr<SfxHint>( new SvxEditSourceHint( EDITSOURCE_HINT_PARASMOVED, aNotify->nParagraph, aNotify->nParam1, aNotify->nParam2 ) );
case EE_NOTIFY_TEXTHEIGHTCHANGED: case EE_NOTIFY_TEXTHEIGHTCHANGED:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_TEXTHEIGHTCHANGED, aNotify->nParagraph ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_TEXTHEIGHTCHANGED, aNotify->nParagraph ) );
case EE_NOTIFY_TEXTVIEWSCROLLED: case EE_NOTIFY_TEXTVIEWSCROLLED:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_VIEWSCROLLED ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_VIEWSCROLLED ) );
case EE_NOTIFY_TEXTVIEWSELECTIONCHANGED: case EE_NOTIFY_TEXTVIEWSELECTIONCHANGED:
return ::std::auto_ptr<SfxHint>( new SvxEditSourceHint( EDITSOURCE_HINT_SELECTIONCHANGED ) ); return ::std::unique_ptr<SfxHint>( new SvxEditSourceHint( EDITSOURCE_HINT_SELECTIONCHANGED ) );
case EE_NOTIFY_BLOCKNOTIFICATION_START: case EE_NOTIFY_BLOCKNOTIFICATION_START:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_BLOCKNOTIFICATION_START, 0 ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_BLOCKNOTIFICATION_START, 0 ) );
case EE_NOTIFY_BLOCKNOTIFICATION_END: case EE_NOTIFY_BLOCKNOTIFICATION_END:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_BLOCKNOTIFICATION_END, 0 ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_BLOCKNOTIFICATION_END, 0 ) );
case EE_NOTIFY_INPUT_START: case EE_NOTIFY_INPUT_START:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_INPUT_START, 0 ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_INPUT_START, 0 ) );
case EE_NOTIFY_INPUT_END: case EE_NOTIFY_INPUT_END:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_INPUT_END, 0 ) ); return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_INPUT_END, 0 ) );
case EE_NOTIFY_TEXTVIEWSELECTIONCHANGED_ENDD_PARA: case EE_NOTIFY_TEXTVIEWSELECTIONCHANGED_ENDD_PARA:
return ::std::auto_ptr<SfxHint>( new SvxEditSourceHintEndPara( EDITSOURCE_HINT_SELECTIONCHANGED ) ); return ::std::unique_ptr<SfxHint>( new SvxEditSourceHintEndPara( EDITSOURCE_HINT_SELECTIONCHANGED ) );
default: default:
OSL_FAIL( "SvxEditSourceHelper::EENotification2Hint unknown notification" ); OSL_FAIL( "SvxEditSourceHelper::EENotification2Hint unknown notification" );
break; break;
} }
} }
return ::std::auto_ptr<SfxHint>( new SfxHint() ); return ::std::unique_ptr<SfxHint>( new SfxHint() );
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
bool SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, const EditEngine& rEE, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell ) bool SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, const EditEngine& rEE, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell )
{ {
......
...@@ -261,9 +261,7 @@ namespace accessibility ...@@ -261,9 +261,7 @@ namespace accessibility
private: private:
/// @dyn /// @dyn
SAL_WNODEPRECATED_DECLARATIONS_PUSH const std::unique_ptr< AccessibleStaticTextBase_Impl > mpImpl;
const std::auto_ptr< AccessibleStaticTextBase_Impl > mpImpl;
SAL_WNODEPRECATED_DECLARATIONS_POP
}; };
......
...@@ -95,9 +95,7 @@ namespace editeng ...@@ -95,9 +95,7 @@ namespace editeng
}; };
private: private:
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr< HangulHanjaConversion_Impl > m_pImpl;
::std::auto_ptr< HangulHanjaConversion_Impl > m_pImpl;
SAL_WNODEPRECATED_DECLARATIONS_POP
// used to set initial values of m_pImpl object from saved ones // used to set initial values of m_pImpl object from saved ones
static bool m_bUseSavedValues; // defines if the followng two values should be used for initialization static bool m_bUseSavedValues; // defines if the followng two values should be used for initialization
......
...@@ -73,9 +73,7 @@ public: ...@@ -73,9 +73,7 @@ public:
@return the translated hint @return the translated hint
*/ */
SAL_WNODEPRECATED_DECLARATIONS_PUSH static ::std::unique_ptr<SfxHint> EENotification2Hint( EENotify* aNotify );
static ::std::auto_ptr<SfxHint> EENotification2Hint( EENotify* aNotify );
SAL_WNODEPRECATED_DECLARATIONS_POP
/** Calculate attribute run for EditEngines /** Calculate attribute run for EditEngines
......
...@@ -943,9 +943,7 @@ IMPL_LINK(ScAccessibleCellTextData, NotifyHdl, EENotify*, aNotify) ...@@ -943,9 +943,7 @@ IMPL_LINK(ScAccessibleCellTextData, NotifyHdl, EENotify*, aNotify)
{ {
if( aNotify ) if( aNotify )
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
::std::auto_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
SAL_WNODEPRECATED_DECLARATIONS_POP
if( aHint.get() ) if( aHint.get() )
GetBroadcaster().Broadcast( *aHint.get() ); GetBroadcaster().Broadcast( *aHint.get() );
...@@ -1062,9 +1060,7 @@ IMPL_LINK(ScAccessibleEditObjectTextData, NotifyHdl, EENotify*, aNotify) ...@@ -1062,9 +1060,7 @@ IMPL_LINK(ScAccessibleEditObjectTextData, NotifyHdl, EENotify*, aNotify)
{ {
if( aNotify ) if( aNotify )
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
::std::auto_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
SAL_WNODEPRECATED_DECLARATIONS_POP
if( aHint.get() ) if( aHint.get() )
GetBroadcaster().Broadcast( *aHint.get() ); GetBroadcaster().Broadcast( *aHint.get() );
......
...@@ -207,7 +207,7 @@ namespace accessibility ...@@ -207,7 +207,7 @@ namespace accessibility
{ {
if( aNotify ) if( aNotify )
{ {
::std::auto_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) ); ::std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) );
if( aHint.get() ) if( aHint.get() )
Broadcast( *aHint.get() ); Broadcast( *aHint.get() );
......
...@@ -964,7 +964,7 @@ IMPL_LINK(SmTextForwarder, NotifyHdl, EENotify*, aNotify) ...@@ -964,7 +964,7 @@ IMPL_LINK(SmTextForwarder, NotifyHdl, EENotify*, aNotify)
{ {
if (aNotify) if (aNotify)
{ {
::std::auto_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify ); ::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
if (aHint.get()) if (aHint.get())
rEditSource.GetBroadcaster().Broadcast( *aHint.get() ); rEditSource.GetBroadcaster().Broadcast( *aHint.get() );
} }
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
* 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 <memory>
#include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/uno/XInterface.hpp>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
...@@ -47,7 +51,6 @@ ...@@ -47,7 +51,6 @@
#include <svx/svdotable.hxx> #include <svx/svdotable.hxx>
#include "../table/cell.hxx" #include "../table/cell.hxx"
#include <svx/sdrpaintwindow.hxx> #include <svx/sdrpaintwindow.hxx>
#include <boost/scoped_ptr.hpp>
using namespace ::osl; using namespace ::osl;
using namespace ::rtl; using namespace ::rtl;
...@@ -1020,7 +1023,7 @@ IMPL_LINK(SvxTextEditSourceImpl, NotifyHdl, EENotify*, aNotify) ...@@ -1020,7 +1023,7 @@ IMPL_LINK(SvxTextEditSourceImpl, NotifyHdl, EENotify*, aNotify)
{ {
if( aNotify && !mbNotificationsDisabled ) if( aNotify && !mbNotificationsDisabled )
{ {
boost::scoped_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) ); std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) );
if( aHint.get() ) if( aHint.get() )
Broadcast( *aHint.get() ); Broadcast( *aHint.get() );
......
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#include <svx/AccessibleTextHelper.hxx> #include <svx/AccessibleTextHelper.hxx>
#include <editeng/outliner.hxx> #include <editeng/outliner.hxx>
#include <boost/scoped_ptr.hpp>
namespace sw { namespace sidebarwindows { namespace sw { namespace sidebarwindows {
// declaration and implementation of <SvxEditSource> // declaration and implementation of <SvxEditSource>
...@@ -119,7 +117,7 @@ IMPL_LINK(SidebarTextEditSource, NotifyHdl, EENotify*, pNotify) ...@@ -119,7 +117,7 @@ IMPL_LINK(SidebarTextEditSource, NotifyHdl, EENotify*, pNotify)
{ {
if ( pNotify ) if ( pNotify )
{ {
boost::scoped_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( pNotify ) ); std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( pNotify ) );
if( aHint.get() ) if( aHint.get() )
{ {
......
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