Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 16489 → Rev 16490

/trunk/Scribus/scribus/undomanager.h
586,6 → 586,8
static QString Copy;
static QString CopyPage;
static QString ToOutlines;
static QString LinkTextFrame;
static QString UnlinkTextFrame;
/*@}*/
 
/**
/trunk/Scribus/scribus/pageitem.h
1219,6 → 1219,7
 
void restoreShapeContour(UndoState *state, bool isUndo);
void restoreImageEffects(UndoState *state, bool isUndo);
void restoreLinkTextFrame(UndoState *state, bool isUndo);
/*@}*/
 
/**
/trunk/Scribus/scribus/pageitem.cpp
1132,6 → 1132,13
nxt->firstChar = 0;
nxt = nxt->NextBox;
}
if (UndoManager::undoEnabled())
{
ItemState<std::pair<PageItem*, PageItem*> > *is = new ItemState<std::pair<PageItem*, PageItem*> >(UndoManager::LinkTextFrame);
is->set("LINK_TEXT_FRAME", "linkTextFrame");
is->setItem(std::pair<PageItem*, PageItem*>(this, NextBox));
undoManager->action(this, is);
}
}
 
void PageItem::unlink()
1138,6 → 1145,7
{
if( NextBox )
{
PageItem *undoNextBox=NextBox;
// make sure lastInFrame is valid
layout();
/*
1175,6 → 1183,13
}
// NextBox == NULL now
NextBox = NULL;
if (UndoManager::undoEnabled())
{
ItemState<std::pair<PageItem*, PageItem*> > *is = new ItemState<std::pair<PageItem*, PageItem*> >(UndoManager::UnlinkTextFrame);
is->set("UNLINK_TEXT_FRAME", "unlinkTextFrame");
is->setItem(std::pair<PageItem*, PageItem*>(this, undoNextBox));
undoManager->action(this, is);
}
}
}
 
4089,6 → 4104,10
restoreShapeContour(ss, isUndo);
else if (ss->contains("APPLY_IMAGE_EFFECTS"))
restoreImageEffects(ss, isUndo);
else if (ss->contains("LINK_TEXT_FRAME"))
restoreLinkTextFrame(ss,isUndo);
else if (ss->contains("UNLINK_TEXT_FRAME"))
restoreUnlinkTextFrame(ss,isUndo);
}
if (!OnMasterPage.isEmpty())
m_Doc->setCurrentPage(oldCurrentPage);
4413,6 → 4432,36
m_Doc->itemSelection_SetImageOffset(ox, oy, &tempSelection);
}
 
void PageItem::restoreLinkTextFrame(UndoState *state, bool isUndo)
{
if (!isTextFrame())
return;
if (isUndo)
{
unlink();
}
else
{
ItemState<std::pair<PageItem*, PageItem*> > *is = dynamic_cast<ItemState<std::pair<PageItem*, PageItem*> >*>(state);
asTextFrame()->link(is->getItem().second->asTextFrame());
}
}
 
void PageItem::restoreUnlinkTextFrame(UndoState *state, bool isUndo)
{
if (!isTextFrame())
return;
if (isUndo)
{
ItemState<std::pair<PageItem*, PageItem*> > *is = dynamic_cast<ItemState<std::pair<PageItem*, PageItem*> >*>(state);
asTextFrame()->link(is->getItem().second->asTextFrame());
}
else
{
unlink();
}
}
 
void PageItem::restorePoly(SimpleState *state, bool isUndo, bool isContour)
{
int mode = state->getInt("MODE");
6369,6 → 6418,20
}
}
 
void PageItem::restoreLinkTextFrame(UndoState *state, bool isUndo)
{
if (!isTextFrame())
return;
if (isUndo)
{
unlink();
}
else
{
ItemState<std::pair<PageItem*, PageItem*> > *is = dynamic_cast<ItemState<std::pair<PageItem*, PageItem*> >*>(state);
asTextFrame()->link(is->getItem().second->asTextFrame());
}
}
 
 
void PageItem::convertClip()
/trunk/Scribus/scribus/undomanager.cpp
960,6 → 960,8
UndoManager::Copy = tr("Copy");
UndoManager::CopyPage = tr("Copy page");
UndoManager::ToOutlines = tr("Convert to outlines");
UndoManager::LinkTextFrame = tr("Link text frame");
UndoManager::UnlinkTextFrame = tr("Unlink text frame");
}
 
void UndoManager::initIcons()