removed doubled clone in model::paste
This commit is contained in:
@@ -48,6 +48,7 @@ void XQSimpleClipBoard::saveNodes( const QModelIndexList& list )
|
||||
for( auto entry : list )
|
||||
{
|
||||
XQNodePtr contentNode = XQItem::xqItemFromIndex( entry ).contentNode();
|
||||
qDebug() << " --- Cloned: " << contentNode->friendly_name();
|
||||
// im clipboard brauchen wir eine eltern-lose kopie des knotens
|
||||
push_back( {entry.row(), contentNode->own_pos(), contentNode->clone() } );
|
||||
}
|
||||
|
@@ -383,12 +383,10 @@ void XQViewModel::cmdPaste( XQCommand& command )
|
||||
// wir pasten das clipboard
|
||||
for (auto& entry : _clipBoard )
|
||||
{
|
||||
|
||||
// WARUM zwei mal klonen ?
|
||||
|
||||
// noch ein clone vom clone erzeugen ...
|
||||
// noch einen clone vom clone im clipboard erzeugen ...
|
||||
XQNodePtr newNode = entry.contentNode->clone(section.contentRootNode() );
|
||||
newNode->clone(section.contentRootNode() )->add_me_at( nodePos );
|
||||
// ... diesen einfügen ...
|
||||
newNode->add_me_at( nodePos );
|
||||
// ... und damit eine frische item-row erzeugen
|
||||
XQItemList list = _itemFactory.makeRow( XQItemFactory::mData, section.sheetRootNode(), newNode );
|
||||
insertRow( insRow, list );
|
||||
|
Reference in New Issue
Block a user