void DrawTextTool::setDrawingSymbol(const Symbol* symbol) { // Avoid using deleted symbol if (map()->findSymbolIndex(drawing_symbol) == -1) symbol = NULL; // End current editing if (text_editor) { if (symbol) finishEditing(); else abortEditing(); } // Handle new symbol drawing_symbol = symbol; deletePreviewText(); if (!symbol) deactivate(); else if (symbol->isHidden()) deactivate(); else if (symbol->getType() != Symbol::Text) switchToDefaultDrawTool(symbol); }
void CutoutTool::finishEditing() { if (editingInProgress()) { if (cutout_object_index >= 0) map()->getCurrentPart()->addObject(cutout_object, cutout_object_index); map()->clearObjectSelection(false); map()->addObjectToSelection(cutout_object, true); abortEditing(); } }