Replace auto_ptr

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/60/head
Michele Calgaro 11 months ago
parent c0332621bc
commit 56ddbe04dc
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -458,8 +458,8 @@ void KFCAddReplacing::unexecute()
// ****** Add index command // ****** Add index command
KFCAddGenericIndex::KFCAddGenericIndex(Container* document, ElementIndexPtr _index) KFCAddGenericIndex::KFCAddGenericIndex(Container* document, ElementIndexPtr &_index)
: KFCAdd(i18n("Add Index"), document), index(_index) : KFCAdd(i18n("Add Index"), document), index(std::move(_index))
{ {
addElement(new SequenceElement()); addElement(new SequenceElement());
} }

@ -435,7 +435,9 @@ class KFCAddGenericIndex : public KFCAdd
{ {
public: public:
KFCAddGenericIndex(Container* document, ElementIndexPtr index); KFCAddGenericIndex(Container* document, ElementIndexPtr &index);
KFCAddGenericIndex(KFCAddGenericIndex const &) = delete;
KFCAddGenericIndex& operator=(KFCAddGenericIndex const &) = delete;
virtual void execute(); virtual void execute();

@ -276,7 +276,7 @@ public:
virtual BasicElement* getElement() = 0; virtual BasicElement* getElement() = 0;
}; };
typedef std::auto_ptr<ElementIndex> ElementIndexPtr; typedef std::unique_ptr<ElementIndex> ElementIndexPtr;
enum RequestID { enum RequestID {
req_addBracket, req_addBracket,

@ -992,7 +992,7 @@ bool KoDocument::saveNativeFormat( const TQString & file )
TQCString mimeType = d->outputMimeType; TQCString mimeType = d->outputMimeType;
TQCString nativeOasisMime = nativeOasisMimeType(); TQCString nativeOasisMime = nativeOasisMimeType();
bool oasis = !mimeType.isEmpty() && ( mimeType == nativeOasisMime || mimeType == nativeOasisMime + "-template" ); bool oasis = !mimeType.isEmpty() && ( mimeType == nativeOasisMime || mimeType == nativeOasisMime + "-template" );
// TODO: use std::auto_ptr or create store on stack [needs API fixing], // TODO: use std::unique_ptr or create store on stack [needs API fixing],
// to remove all the 'delete store' in all the branches // to remove all the 'delete store' in all the branches
KoStore* store = KoStore::createStore( file, KoStore::Write, mimeType, backend ); KoStore* store = KoStore::createStore( file, KoStore::Write, mimeType, backend );
if ( store->bad() ) if ( store->bad() )

Loading…
Cancel
Save