/** helper function to select all objects in an SdrMarkList;
* implementation: see below */ staticvoid lcl_SelectSdrMarkList( SwEditShell* pShell, const SdrMarkList* pSdrMarkList );
void SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext)
{ // do nothing if somebody has locked controllers! if (CursorsLocked())
{ return;
}
if (pSelFormat) // select frame
{ if (RES_DRAWFRMFMT == pSelFormat->Which())
{
SdrObject* pSObj = pSelFormat->FindSdrObject();
// Before layout calc, inline anchored textboxes have to be synced unless crash. if (pSelFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR
&& pSelFormat->GetOtherTextBoxFormats())
SwTextBoxHelper::synchronizeGroupTextBoxProperty(SwTextBoxHelper::changeAnchor,
pSelFormat, pSObj);
static_cast<SwFEShell*>(this)->SelectObj(
pSObj->GetCurrentBoundRect().Center() );
} else
{
Point aPt;
SwFlyFrame *const pFly = static_cast<SwFlyFrameFormat*>(pSelFormat)->GetFrame(& aPt); if (pFly)
{ // fdo#36681: Invalidate the content and layout to refresh // the picture anchoring properly
SwPageFrame* pPageFrame = pFly->FindPageFrameOfAnchor();
pPageFrame->InvalidateFlyLayout();
pPageFrame->InvalidateContent();
static_cast<SwFEShell*>(this)->SelectFlyFrame(*pFly);
}
}
} elseif (pMarkList)
{
lcl_SelectSdrMarkList( this, pMarkList );
} elseif (GetCursor()->GetNext() != GetCursor())
{ // current cursor is the last one: // go around the ring, to the first cursor
GoNextCursor();
}
}
// current undo state was not saved
::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
StartAllAction();
{ // Actually it should be enough to just work on the current Cursor, i.e. if there is a cycle // cancel the latter temporarily, so that an insert during Undo is not done in all areas.
KillPams();
SetMark(); // Bound1 and Bound2 in the same Node
ClearMark();
// Keep Cursor - so that we're able to set it at // the same position for autoformat or autocorrection
SwUndoId nLastUndoId(SwUndoId::EMPTY);
GetLastUndoInfo(nullptr, & nLastUndoId); constbool bRestoreCursor = nCount == 1
&& ( SwUndoId::AUTOFORMAT == nLastUndoId
|| SwUndoId::AUTOCORRECT == nLastUndoId
|| SwUndoId::SETDEFTATTR == nLastUndoId );
Push();
// Destroy stored TableBoxPtr. A detection is only permitted for the new "Box"!
ClearTableBoxContent();
try { for (sal_uInt16 i = 0; i < nCount; ++i)
{
GetDoc()->GetIDocumentUndoRedo().UndoWithOffset(nOffset);
}
} catch (const css::uno::Exception &) {
TOOLS_WARN_EXCEPTION("sw.core", "SwEditShell::Undo()");
}
if (bRestoreCursor)
{ // fdo#39003 Pop does not touch the rest of the cursor ring
KillPams(); // so call this first to get rid of unwanted cursors
}
Pop(bRestoreCursor ? PopMode::DeleteCurrent : PopMode::DeleteStack);
// undo state was not saved
::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
StartAllAction();
{ // Actually it should be enough to just work on the current Cursor, i.e. if there is a cycle // cancel the latter temporarily, so that an insert during Undo is not done in all areas.
KillPams();
SetMark(); // Bound1 and Bound2 in the same Node
ClearMark();
// the old implementation would always unselect // objects, even if no new ones were selected. If this // is a problem, we need to re-work this a little.
OSL_ENSURE( pSdrMarkList->GetMarkCount() != 0, "empty mark list" );
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.