Replace auto_ptr

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

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

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

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

@ -992,7 +992,7 @@ bool KoDocument::saveNativeFormat( const TQString & file )
TQCString mimeType = d->outputMimeType;
TQCString nativeOasisMime = nativeOasisMimeType();
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
KoStore* store = KoStore::createStore( file, KoStore::Write, mimeType, backend );
if ( store->bad() )

Loading…
Cancel
Save