Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 19759 → Rev 19760

/trunk/Scribus/scribus/appmodehelper.cpp
126,6 → 126,9
 
switch (oldMode)
{
case modeDrawBezierLine:
setSpecialEditMode(false);
break;
case modeEdit:
{
if (newMode != modeEdit)
147,6 → 150,9
doc->view()->horizRuler->update();
}
break;
case modeEditArc:
setSpecialEditMode(false);
break;
case modeEditClip:
{
if (newMode != modeEditClip)
153,9 → 159,6
scmw->NoFrameEdit();
}
break;
case modeDrawBezierLine:
setSpecialEditMode(false);
break;
case modeEditGradientVectors:
setSpecialEditMode(false);
break;
165,6 → 168,12
case modeEditMeshPatch:
setSpecialEditMode(false);
break;
case modeEditPolygon:
setSpecialEditMode(false);
break;
case modeEditSpiral:
setSpecialEditMode(false);
break;
case modeEditTable:
if (newMode != modeEditTable)
{
175,15 → 184,9
a_actMgr->restoreActionShortcutsPostEditMode();
}
break;
case modeEditArc:
case modeEditWeldPoint:
setSpecialEditMode(false);
break;
case modeEditSpiral:
setSpecialEditMode(false);
break;
case modeEditPolygon:
setSpecialEditMode(false);
break;
case modeLinkFrames:
doc->regionsChanged()->update(QRect());
break;
200,6 → 203,38
scmw->outlinePalette->setEnabled(true);
}
break;
case modeCopyProperties:
{
if (!doc->m_Selection->isEmpty())
{
doc->ElemToLink = doc->m_Selection->itemAt(0);
doc->view()->Deselect(true);
(*a_scrActions)["toolsCopyProperties"]->setEnabled(true);
}
}
break;
case modeDrawArc:
break;
case modeDrawBezierLine:
{
setSpecialEditMode(true);
if ((doc->m_Selection->count() != 0) && (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools))
doc->view()->Deselect(true);
doc->view()->FirstPoly = true;
}
break;
case modeDrawCalligraphicLine:
break;
case modeDrawFreehandLine:
break;
case modeDrawImage:
break;
case modeDrawLatex:
break;
case modeDrawLine:
break;
case modeDrawRegularPolygon:
break;
case modeDrawShapes:
{
doc->SubMode = scmw->modeToolBar->SubMode;
208,18 → 243,14
scmw->emitUpdateRequest(reqCustomShapeUpdate);
}
break;
case modeStoryEditor:
{
scmw->slotStoryEditor(oldMode == modeEditTable);
scmw->slotSelect();
}
case modeDrawSpiral:
break;
case modeDrawImage:
case modeDrawTable:
break;
case modeDrawTable2:
break;
case modeDrawText:
break;
case modeMagnifier:
break;
case modeEdit:
{
if (oldMode != modeEdit)
253,6 → 284,9
}
}
break;
case modeEditArc:
setSpecialEditMode(true);
break;
case modeEditClip:
{
if (oldMode != modeEditClip)
259,79 → 293,12
scmw->ToggleFrameEdit();
}
break;
case modeDrawLine:
break;
case modeRotation:
break;
case modeLinkFrames:
{
doc->regionsChanged()->update(QRect());
doc->ElemToLink = doc->m_Selection->itemAt(0);
}
break;
case modeImportImage:
break;
case modeUnlinkFrames:
doc->regionsChanged()->update(QRect());
break;
case modeDrawRegularPolygon:
break;
case modeDrawBezierLine:
{
setSpecialEditMode(true);
if ((doc->m_Selection->count() != 0) && (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools))
doc->view()->Deselect(true);
doc->view()->FirstPoly = true;
}
break;
case modeInsertPDFButton:
break;
case modeInsertPDFTextfield:
break;
case modeInsertPDFCheckbox:
break;
case modeInsertPDFCombobox:
break;
case modeInsertPDFListbox:
break;
case modeInsertPDFTextAnnotation:
break;
case modeInsertPDFLinkAnnotation:
break;
case modeDrawFreehandLine:
break;
case modeDrawTable:
break;
case modeDrawTable2:
break;
case modePanning:
break;
case modeMeasurementTool:
break;
case modeEyeDropper:
break;
case modeCopyProperties:
{
if (!doc->m_Selection->isEmpty())
{
doc->ElemToLink = doc->m_Selection->itemAt(0);
doc->view()->Deselect(true);
(*a_scrActions)["toolsCopyProperties"]->setEnabled(true);
}
}
break;
case modeDrawLatex:
break;
case modeImportObject:
break;
case modeInsertPDF3DAnnotation:
break;
case modeEditGradientVectors:
{
setSpecialEditMode(true);
scmw->propertiesPalette->setGradientEditMode(true);
}
break;
break;
case modeEditMeshGradient:
setSpecialEditMode(true);
break;
338,18 → 305,9
case modeEditMeshPatch:
setSpecialEditMode(true);
break;
case modeDrawCalligraphicLine:
break;
case modeDrawArc:
break;
case modeEditArc:
setSpecialEditMode(true);
break;
case modeEditPolygon:
setSpecialEditMode(true);
break;
case modeDrawSpiral:
break;
case modeEditSpiral:
setSpecialEditMode(true);
break;
373,9 → 331,55
}
break;
case modeEditWeldPoint:
setSpecialEditMode(true);
break;
case modeEyeDropper:
break;
case modeImportImage:
break;
case modeImportObject:
break;
case modeInsertPDF3DAnnotation:
break;
case modeInsertPDFButton:
break;
case modeInsertPDFCheckbox:
break;
case modeInsertPDFCombobox:
break;
case modeInsertPDFLinkAnnotation:
break;
case modeInsertPDFListbox:
break;
case modeInsertPDFRadioButton:
break;
case modeInsertPDFTextAnnotation:
break;
case modeInsertPDFTextfield:
break;
case modeLinkFrames:
{
doc->regionsChanged()->update(QRect());
doc->ElemToLink = doc->m_Selection->itemAt(0);
}
break;
case modeMagnifier:
break;
case modeMeasurementTool:
break;
case modePanning:
break;
case modeRotation:
break;
case modeStoryEditor:
{
scmw->slotStoryEditor(oldMode == modeEditTable);
scmw->slotSelect();
}
break;
case modeUnlinkFrames:
doc->regionsChanged()->update(QRect());
break;
default:
//No doc open?
break;
405,10 → 409,13
}
assert (docSelectionCount == 0 || currItem != NULL); // help coverity analysis
 
bool inAnEditMode=doc->inAnEditMode();
bool inAnEditMode = doc->inAnEditMode();
 
(*a_scrActions)["editSelectAllOnLayer"]->setEnabled(true);
(*a_scrActions)["editDeselectAll"]->setEnabled(SelectedType != -1);
if (!doc->inASpecialEditMode()) // #12897: Using Undo/Redo those actions are re-enabled causing crash
{
(*a_scrActions)["editSelectAllOnLayer"]->setEnabled(true);
(*a_scrActions)["editDeselectAll"]->setEnabled(SelectedType != -1);
}
(*a_scrActions)["itemDetachTextFromPath"]->setEnabled(false);
(*a_scrActions)["itemUpdateImage"]->setEnabled(SelectedType==PageItem::ImageFrame && (currItem->PictureIsAvailable || currItem->asLatexFrame()));
(*a_scrActions)["itemAdjustFrameToImage"]->setEnabled(SelectedType==PageItem::ImageFrame && currItem->PictureIsAvailable);
/trunk/Scribus/scribus/scribusdoc.cpp
757,22 → 757,37
 
bool ScribusDoc::inAnEditMode() const
{
bool inEditMode = (appMode == modeEdit ||
appMode == modeEditTable ||
appMode == modeEditSpiral ||
bool inEditMode = (appMode == modeDrawBezierLine ||
appMode == modeEdit ||
appMode == modeEditArc ||
appMode == modeEditClip ||
appMode == modeEditGradientVectors ||
appMode == modeEditClip ||
appMode == modeEditMeshGradient ||
appMode == modeEditArc ||
appMode == modeEditMeshPatch ||
appMode == modeEditWeldPoint ||
appMode == modeEditPolygon ||
appMode == modeDrawBezierLine
appMode == modeEditSpiral ||
appMode == modeEditTable ||
appMode == modeEditWeldPoint
) ? true : false;
 
return inEditMode;
}
 
bool ScribusDoc::inASpecialEditMode() const
{ // #12897, modes that use setSpecialEditMode() function in appmodehelper.cpp
bool inSpecialEditMode = (appMode == modeDrawBezierLine ||
appMode == modeEditArc ||
appMode == modeEditGradientVectors ||
appMode == modeEditMeshGradient ||
appMode == modeEditMeshPatch ||
appMode == modeEditPolygon ||
appMode == modeEditSpiral ||
appMode == modeEditWeldPoint
) ? true : false;
 
return inSpecialEditMode;
}
 
QList<PageItem*> ScribusDoc::getAllItems(QList<PageItem*> &items)
{
QList<PageItem*> ret;
/trunk/Scribus/scribus/scribusdoc.h
129,6 → 129,7
~ScribusDoc();
void init();
bool inAnEditMode() const;
bool inASpecialEditMode() const;
QList<PageItem*> getAllItems(QList<PageItem*> &items);
QList<PageItem*> *parentGroup(PageItem* item, QList<PageItem*> *list);
void setup(const int, const int, const int, const int, const int, const QString&, const QString&);