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
}
else
{
std::auto_ptr<SvXMLAttrContainerData> pNewImpl(new SvXMLAttrContainerData);
std::unique_ptr<SvXMLAttrContainerData> pNewImpl(new SvXMLAttrContainerData);
try
{
......
......@@ -44,56 +44,54 @@ sal_uLong SvxEditSourceHint::GetValue() const
}
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<SfxHint> SvxEditSourceHelper::EENotification2Hint( EENotify* aNotify )
::std::unique_ptr<SfxHint> SvxEditSourceHelper::EENotification2Hint( EENotify* aNotify )
{
if( aNotify )
{
switch( aNotify->eNotificationType )
{
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:
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:
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:
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:
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:
return ::std::auto_ptr<SfxHint>( new TextHint( TEXT_HINT_VIEWSCROLLED ) );
return ::std::unique_ptr<SfxHint>( new TextHint( TEXT_HINT_VIEWSCROLLED ) );
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:
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:
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:
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:
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:
return ::std::auto_ptr<SfxHint>( new SvxEditSourceHintEndPara( EDITSOURCE_HINT_SELECTIONCHANGED ) );
return ::std::unique_ptr<SfxHint>( new SvxEditSourceHintEndPara( EDITSOURCE_HINT_SELECTIONCHANGED ) );
default:
OSL_FAIL( "SvxEditSourceHelper::EENotification2Hint unknown notification" );
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 )
{
......
......@@ -261,9 +261,7 @@ namespace accessibility
private:
/// @dyn
SAL_WNODEPRECATED_DECLARATIONS_PUSH
const std::auto_ptr< AccessibleStaticTextBase_Impl > mpImpl;
SAL_WNODEPRECATED_DECLARATIONS_POP
const std::unique_ptr< AccessibleStaticTextBase_Impl > mpImpl;
};
......
......@@ -95,9 +95,7 @@ namespace editeng
};
private:
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr< HangulHanjaConversion_Impl > m_pImpl;
SAL_WNODEPRECATED_DECLARATIONS_POP
::std::unique_ptr< HangulHanjaConversion_Impl > m_pImpl;
// 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
......
......@@ -73,9 +73,7 @@ public:
@return the translated hint
*/
SAL_WNODEPRECATED_DECLARATIONS_PUSH
static ::std::auto_ptr<SfxHint> EENotification2Hint( EENotify* aNotify );
SAL_WNODEPRECATED_DECLARATIONS_POP
static ::std::unique_ptr<SfxHint> EENotification2Hint( EENotify* aNotify );
/** Calculate attribute run for EditEngines
......
......@@ -943,9 +943,7 @@ IMPL_LINK(ScAccessibleCellTextData, NotifyHdl, EENotify*, aNotify)
{
if( aNotify )
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
SAL_WNODEPRECATED_DECLARATIONS_POP
::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
if( aHint.get() )
GetBroadcaster().Broadcast( *aHint.get() );
......@@ -1062,9 +1060,7 @@ IMPL_LINK(ScAccessibleEditObjectTextData, NotifyHdl, EENotify*, aNotify)
{
if( aNotify )
{
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
SAL_WNODEPRECATED_DECLARATIONS_POP
::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
if( aHint.get() )
GetBroadcaster().Broadcast( *aHint.get() );
......
......@@ -207,7 +207,7 @@ namespace accessibility
{
if( aNotify )
{
::std::auto_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) );
::std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) );
if( aHint.get() )
Broadcast( *aHint.get() );
......
......@@ -964,7 +964,7 @@ IMPL_LINK(SmTextForwarder, NotifyHdl, EENotify*, aNotify)
{
if (aNotify)
{
::std::auto_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
::std::unique_ptr< SfxHint > aHint = SvxEditSourceHelper::EENotification2Hint( aNotify );
if (aHint.get())
rEditSource.GetBroadcaster().Broadcast( *aHint.get() );
}
......
......@@ -17,6 +17,10 @@
* 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 <vcl/svapp.hxx>
......@@ -47,7 +51,6 @@
#include <svx/svdotable.hxx>
#include "../table/cell.hxx"
#include <svx/sdrpaintwindow.hxx>
#include <boost/scoped_ptr.hpp>
using namespace ::osl;
using namespace ::rtl;
......@@ -1020,7 +1023,7 @@ IMPL_LINK(SvxTextEditSourceImpl, NotifyHdl, EENotify*, aNotify)
{
if( aNotify && !mbNotificationsDisabled )
{
boost::scoped_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) );
std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( aNotify) );
if( aHint.get() )
Broadcast( *aHint.get() );
......
......@@ -35,8 +35,6 @@
#include <svx/AccessibleTextHelper.hxx>
#include <editeng/outliner.hxx>
#include <boost/scoped_ptr.hpp>
namespace sw { namespace sidebarwindows {
// declaration and implementation of <SvxEditSource>
......@@ -119,7 +117,7 @@ IMPL_LINK(SidebarTextEditSource, NotifyHdl, EENotify*, pNotify)
{
if ( pNotify )
{
boost::scoped_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( pNotify ) );
std::unique_ptr< SfxHint > aHint( SvxEditSourceHelper::EENotification2Hint( pNotify ) );
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