SANKORE-242 fix text element CUT command from main Sankore menu

preferencesAboutTextFull
ivan.ilyin 13 years ago
parent 4e95d09c13
commit fb952f6c65
  1. 15
      src/board/UBBoardController.cpp
  2. 5
      src/domain/UBGraphicsItemDelegate.cpp

@ -1711,10 +1711,19 @@ UBGraphicsAudioItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool st
void UBBoardController::cut() void UBBoardController::cut()
{ {
QList<UBItem*> selected; //---------------------------------------------------------//
QList<QGraphicsItem*> selectedItems;
foreach(QGraphicsItem* gi, mActiveScene->selectedItems()) foreach(QGraphicsItem* gi, mActiveScene->selectedItems())
selectedItems << gi;
//---------------------------------------------------------//
QList<UBItem*> selected;
foreach(QGraphicsItem* gi, selectedItems)
{ {
gi->setSelected(false);
UBItem* ubItem = dynamic_cast<UBItem*>(gi); UBItem* ubItem = dynamic_cast<UBItem*>(gi);
UBGraphicsItem *ubGi = dynamic_cast<UBGraphicsItem*>(gi); UBGraphicsItem *ubGi = dynamic_cast<UBGraphicsItem*>(gi);
@ -1725,6 +1734,8 @@ void UBBoardController::cut()
} }
} }
//---------------------------------------------------------//
if (selected.size() > 0) if (selected.size() > 0)
{ {
QClipboard *clipboard = QApplication::clipboard(); QClipboard *clipboard = QApplication::clipboard();
@ -1736,6 +1747,8 @@ void UBBoardController::cut()
mActiveDocument->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); mActiveDocument->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
} }
//---------------------------------------------------------//
} }

@ -267,7 +267,6 @@ void UBGraphicsItemDelegate::positionHandles()
void UBGraphicsItemDelegate::remove(bool canUndo) void UBGraphicsItemDelegate::remove(bool canUndo)
{ {
QGraphicsScene* scene = mDelegated->scene(); QGraphicsScene* scene = mDelegated->scene();
if (scene) if (scene)
{ {
foreach(DelegateButton* button, mButtons) foreach(DelegateButton* button, mButtons)
@ -278,9 +277,7 @@ void UBGraphicsItemDelegate::remove(bool canUndo)
if (canUndo) if (canUndo)
{ {
UBGraphicsItemUndoCommand *uc = UBGraphicsItemUndoCommand *uc = new UBGraphicsItemUndoCommand((UBGraphicsScene*) scene, mDelegated, 0);
new UBGraphicsItemUndoCommand((UBGraphicsScene*) scene, mDelegated, 0);
UBApplication::undoStack->push(uc); UBApplication::undoStack->push(uc);
} }
} }

Loading…
Cancel
Save