MCPcopy Create free account
hub / github.com/KDE/okular / EditFormComboCommand

Method EditFormComboCommand

core/documentcommands.cpp:520–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520EditFormComboCommand::EditFormComboCommand(Okular::DocumentPrivate *docPriv, FormFieldChoice *form, int pageNumber, const QString &newContents, int newCursorPos, const QString &prevContents, int prevCursorPos, int prevAnchorPos)
521 : EditTextCommand(newContents, newCursorPos, prevContents, prevCursorPos, prevAnchorPos)
522 , m_docPriv(docPriv)
523 , m_form(form)
524 , m_pageNumber(pageNumber)
525 , m_newIndex(-1)
526 , m_prevIndex(-1)
527{
528 setText(i18nc("Edit a combo form's selection", "edit combo form selection"));
529
530 // Determine new and previous choice indices (if any)
531 for (int i = 0; i < m_form->choices().size(); i++) {
532 if (m_form->choices().at(i) == m_prevContents) {
533 m_prevIndex = i;
534 }
535
536 if (m_form->choices().at(i) == m_newContents) {
537 m_newIndex = i;
538 }
539 }
540}
541
542void EditFormComboCommand::undo()
543{

Callers

nothing calls this directly

Calls 2

choicesMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected