2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1998-2000 The LyX Team.
9 * ======================================================
20 #pragma implementation
23 #include "insettext.h"
24 #include "lyxparagraph.h"
28 #include "commandtags.h"
31 #include "BufferView.h"
33 #include "LaTeXFeatures.h"
35 #include "lyx_gui_misc.h"
37 #include "lyxcursor.h"
38 #include "CutAndPaste.h"
40 #include "minibuffer.h"
43 #include "support/textutils.h"
44 #include "support/LAssert.h"
48 #include "trans_mgr.h"
49 #include "lyxscreen.h"
57 extern unsigned char getCurrentTextClass(Buffer *);
58 #warning BAAAAAAAADDDDDDD current_view (but Lars wanted it :) !!!
59 extern BufferView * current_view;
62 InsetText::InsetText()
64 par = new LyXParagraph();
66 text = new LyXText(this);
70 InsetText::InsetText(InsetText const & ins)
75 text = new LyXText(this);
76 autoBreakRows = ins.autoBreakRows;
80 InsetText & InsetText::operator=(InsetText const & it)
83 text = new LyXText(this);
84 autoBreakRows = it.autoBreakRows;
88 void InsetText::init(InsetText const * ins)
90 the_locking_inset = 0;
91 cursor_visible = false;
95 drawTextXOffset = drawTextYOffset = 0;
96 autoBreakRows = drawLockedFrame = false;
99 SetParagraphData(ins->par);
100 autoBreakRows = ins->autoBreakRows;
101 drawLockedFrame = ins->drawLockedFrame;
103 par->SetInsetOwner(this);
104 // selection_start_cursor = selection_end_cursor = cursor;
105 frame_color = LColor::insetframe;
111 InsetText::~InsetText()
124 Inset * InsetText::Clone() const
126 InsetText * t = new InsetText(*this);
131 void InsetText::Write(Buffer const * buf, ostream & os) const
134 WriteParagraphData(buf, os);
138 void InsetText::WriteParagraphData(Buffer const * buf, ostream & os) const
140 par->writeFile(buf, os, buf->params, 0, 0);
144 void InsetText::Read(Buffer const * buf, LyXLex & lex)
146 string token, tmptok;
148 LyXParagraph * return_par = 0;
149 char depth = 0; // signed or unsigned?
150 LyXParagraph::footnote_flag footnoteflag = LyXParagraph::NO_FOOTNOTE;
151 LyXParagraph::footnote_kind footnotekind = LyXParagraph::FOOTNOTE;
152 LyXFont font(LyXFont::ALL_INHERIT);
162 par = new LyXParagraph;
165 token = lex.GetString();
168 if (token == "\\end_inset")
170 if (const_cast<Buffer*>(buf)->parseSingleLyXformat2Token(lex, par, return_par,
174 // the_end read this should NEVER happen
175 lex.printError("\\the_end read in inset! Error in document!");
183 return_par->SetInsetOwner(this);
184 return_par = return_par->next;
187 if (token != "\\end_inset") {
188 lex.printError("Missing \\end_inset at this point. "
195 int InsetText::ascent(Painter &, LyXFont const &) const
198 Row * row = text->GetRowNearY(y_temp);
199 return row->ascent_of_text() + 2;
203 int InsetText::descent(Painter &, LyXFont const &) const
206 Row * row = text->GetRowNearY(y);
207 return text->height - row->ascent_of_text() + 2;
211 int InsetText::width(Painter & pain, LyXFont const &) const
213 return std::max(static_cast<long int>(getMaxTextWidth(pain, this)),
218 void InsetText::draw(Painter & pain, LyXFont const & f,
219 int baseline, float & x) const
222 UpdatableInset::draw(pain, f, baseline, x);
224 top_baseline = baseline;
227 if (the_locking_inset && (cpos() == inset_pos)) {
228 inset_x = cx() - top_x + drawTextXOffset;
229 inset_y = cy() + drawTextYOffset;
231 x += TEXT_TO_INSET_OFFSET; // place for border
233 Row * row = text->GetRowNearY(y);
234 y += baseline - row->ascent_of_text() + 1;
236 text->GetVisibleRow(current_view, y, x, row, y);
240 x += width(pain, f) - TEXT_TO_INSET_OFFSET;
241 if (drawLockedFrame && locked) {
242 pain.rectangle(top_x, baseline - ascent(pain, f), width(pain, f),
243 ascent(pain,f) + descent(pain, f), frame_color);
248 void InsetText::update(BufferView * bv, LyXFont const &) const
254 // Dump all rowinformation:
256 Row * tmprow = text->GetRowNearY(y_dummy);
257 lyxerr << "Width = " << text->width << endl;
258 lyxerr << "Baseline Paragraph Pos Height Ascent Fill\n";
260 lyxerr << tmprow->baseline() << '\t'
261 << tmprow->par() << '\t'
262 << tmprow->pos() << '\t'
263 << tmprow->height() << '\t'
264 << tmprow->ascent_of_text() << '\t'
265 << tmprow->fill() << '\n';
266 tmprow = tmprow->next();
274 char const * InsetText::EditMessage() const
276 return _("Opened Text Inset");
280 void InsetText::Edit(BufferView * bv, int x, int y, unsigned int button)
282 par->SetInsetOwner(this);
283 UpdatableInset::Edit(bv, x, y, button);
285 if (!bv->lockInset(this)) {
286 lyxerr[Debug::INSETS] << "Cannot lock inset" << endl;
290 the_locking_inset = 0;
291 inset_pos = inset_x = inset_y = 0;
292 // setPos(bv->painter(), x, y);
293 checkAndActivateInset(bv, x, y, button);
294 // selection_start_cursor = selection_end_cursor = cursor;
295 text->sel_cursor = text->cursor;
296 bv->text->FinishUndo();
297 UpdateLocal(bv, true, false);
301 void InsetText::InsetUnlock(BufferView * bv)
303 if (the_locking_inset) {
304 the_locking_inset->InsetUnlock(bv);
305 the_locking_inset = 0;
308 lyxerr[Debug::INSETS] << "InsetText::InsetUnlock(" << this <<
310 // selection_start_cursor = selection_end_cursor = cursor;
311 no_selection = false;
313 UpdateLocal(bv, true, false);
317 bool InsetText::LockInsetInInset(BufferView * bv, UpdatableInset * inset)
319 lyxerr[Debug::INSETS] << "InsetText::LockInsetInInset(" << inset << "): ";
322 if (inset == par->GetInset(cpos())) {
323 lyxerr[Debug::INSETS] << "OK" << endl;
324 the_locking_inset = inset;
325 // resetPos(bv->painter());
326 inset_x = cx() - top_x + drawTextXOffset;
327 inset_y = cy() + drawTextYOffset;
330 } else if (the_locking_inset && (the_locking_inset == inset)) {
331 if (cpos() == inset_pos) {
332 lyxerr[Debug::INSETS] << "OK" << endl;
333 // resetPos(bv->painter());
334 inset_x = cx() - top_x + drawTextXOffset;
335 inset_y = cy() + drawTextYOffset;
337 lyxerr[Debug::INSETS] << "cursor.pos != inset_pos" << endl;
339 } else if (the_locking_inset) {
340 lyxerr[Debug::INSETS] << "MAYBE" << endl;
341 return the_locking_inset->LockInsetInInset(bv, inset);
343 lyxerr[Debug::INSETS] << "NOT OK" << endl;
348 bool InsetText::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
351 if (!the_locking_inset)
353 if (the_locking_inset == inset) {
354 the_locking_inset->InsetUnlock(bv);
355 the_locking_inset = 0;
357 moveRight(bv, false);
360 return the_locking_inset->UnlockInsetInInset(bv, inset, lr);
364 bool InsetText::UpdateInsetInInset(BufferView * bv, Inset * inset)
366 if (!the_locking_inset)
368 if (the_locking_inset != inset)
369 return the_locking_inset->UpdateInsetInInset(bv, inset);
370 lyxerr[Debug::INSETS] << "InsetText::UpdateInsetInInset(" << inset <<
372 UpdateLocal(bv, true, false);
373 if (cpos() == inset_pos) {
374 inset_x = cx() - top_x + drawTextXOffset;
375 inset_y = cy() + drawTextYOffset;
381 void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
383 if (text->selection) {
385 UpdateLocal(bv, false, false);
387 no_selection = false;
388 // setPos(bv->painter(), x, y);
390 text->SetCursorFromCoordinates(bv, x, y+bv->screen()->first);
391 if (the_locking_inset) {
392 UpdatableInset * inset = 0;
393 if (par->GetChar(cpos()) == LyXParagraph::META_INSET)
394 inset = static_cast<UpdatableInset*>(par->GetInset(cpos()));
395 if (the_locking_inset == inset) {
396 the_locking_inset->InsetButtonPress(bv,x-inset_x,y-inset_y,button);
399 // otherwise unlock the_locking_inset and lock the new inset
400 the_locking_inset->InsetUnlock(bv);
401 inset_x = cx() - top_x + drawTextXOffset;
402 inset_y = cy() + drawTextYOffset;
403 inset->InsetButtonPress(bv, x - inset_x, y - inset_y, button);
404 inset->Edit(bv, x - inset_x, y - inset_y, button);
405 UpdateLocal(bv, true, false);
408 // otherwise only unlock the_locking_inset
409 the_locking_inset->InsetUnlock(bv);
410 the_locking_inset = 0;
412 if (bv->the_locking_inset) {
413 if ((par->GetChar(cpos()) == LyXParagraph::META_INSET) &&
414 par->GetInset(cpos()) &&
415 (par->GetInset(cpos())->Editable() == Inset::HIGHLY_EDITABLE)) {
416 UpdatableInset * inset =
417 static_cast<UpdatableInset*>(par->GetInset(cpos()));
418 inset_x = cx() - top_x + drawTextXOffset;
419 inset_y = cy() + drawTextYOffset;
420 inset->InsetButtonPress(bv, x - inset_x, y - inset_y, button);
421 inset->Edit(bv, x - inset_x, y - inset_y, 0);
422 UpdateLocal(bv, true, false);
425 // selection_start_cursor = selection_end_cursor = cursor;
429 void InsetText::InsetButtonRelease(BufferView * bv, int x, int y, int button)
431 UpdatableInset * inset = 0;
433 if (the_locking_inset) {
434 the_locking_inset->InsetButtonRelease(bv, x-inset_x, y-inset_y,button);
436 if (par->GetChar(cpos()) == LyXParagraph::META_INSET) {
437 inset = static_cast<UpdatableInset*>(par->GetInset(cpos()));
438 if (inset->Editable() == Inset::HIGHLY_EDITABLE) {
439 inset->InsetButtonRelease(bv, x - inset_x, y - inset_y,button);
441 inset_x = cx() - top_x + drawTextXOffset;
442 inset_y = cy() + drawTextYOffset;
443 inset->InsetButtonRelease(bv, x - inset_x, y - inset_y,button);
444 inset->Edit(bv, x - inset_x, y - inset_y, button);
448 no_selection = false;
452 void InsetText::InsetMotionNotify(BufferView * bv, int x, int y, int state)
454 if (the_locking_inset) {
455 the_locking_inset->InsetMotionNotify(bv, x - inset_x,
459 #warning REDO this (Jug)
461 // LyXCursor old = selection_end_cursor;
463 // setPos(bv->painter(), x, y);
464 // selection_end_cursor = cursor;
465 // if (old != selection_end_cursor)
466 // UpdateLocal(bv, false, false);
469 no_selection = false;
473 void InsetText::InsetKeyPress(XKeyEvent * xke)
475 if (the_locking_inset) {
476 the_locking_inset->InsetKeyPress(xke);
482 UpdatableInset::RESULT
483 InsetText::LocalDispatch(BufferView * bv,
484 int action, string const & arg)
486 no_selection = false;
487 UpdatableInset::RESULT
488 result= UpdatableInset::LocalDispatch(bv, action, arg);
489 if (result != UNDISPATCHED) {
490 // resetPos(bv->painter());
495 if ((action < 0) && arg.empty())
498 if (the_locking_inset) {
499 result = the_locking_inset->LocalDispatch(bv, action, arg);
500 if (result == DISPATCHED_NOUPDATE)
502 else if (result == DISPATCHED) {
503 the_locking_inset->ToggleInsetCursor(bv);
504 UpdateLocal(bv, false, false);
505 the_locking_inset->ToggleInsetCursor(bv);
507 } else if (result == FINISHED) {
512 // text->cursor.pos(inset_pos + 1);
513 // resetPos(bv->painter());
519 the_locking_inset = 0;
527 if (bv->buffer()->isReadonly()) {
529 // setErrorMessage(N_("Document is read only"));
533 /* Automatically delete the currently selected
534 * text and replace it with what is being
535 * typed in now. Depends on lyxrc settings
536 * "auto_region_delete", which defaults to
539 bv->text->SetUndo(bv->buffer(), Undo::INSERT,
540 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
541 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next);
542 if (lyxrc.auto_region_delete) {
543 if (text->selection){
544 text->CutSelection(bv, false);
547 text->ClearSelection();
548 for (string::size_type i = 0; i < arg.length(); ++i) {
549 bv->owner()->getIntl()->getTrans()->TranslateAndInsert(arg[i], text);
552 UpdateLocal(bv, true, true);
554 // --- Cursor Movements ---------------------------------------------
556 bv->text->FinishUndo();
557 moveRight(bv, false);
558 text->SetSelection();
559 UpdateLocal(bv, false, false);
562 bv->text->FinishUndo();
563 result = moveRight(bv);
565 text->sel_cursor = text->cursor;
566 UpdateLocal(bv, false, false);
569 bv->text->FinishUndo();
571 text->SetSelection();
572 UpdateLocal(bv, false, false);
575 bv->text->FinishUndo();
576 result= moveLeft(bv);
578 text->sel_cursor = text->cursor;
579 UpdateLocal(bv, false, false);
582 bv->text->FinishUndo();
584 text->SetSelection();
585 UpdateLocal(bv, false, false);
588 bv->text->FinishUndo();
589 result = moveDown(bv);
591 text->sel_cursor = text->cursor;
592 UpdateLocal(bv, false, false);
595 bv->text->FinishUndo();
597 text->SetSelection();
598 UpdateLocal(bv, false, false);
601 bv->text->FinishUndo();
604 text->sel_cursor = text->cursor;
605 UpdateLocal(bv, false, false);
608 bv->text->FinishUndo();
609 text->CursorHome(bv);
611 text->sel_cursor = text->cursor;
612 UpdateLocal(bv, false, false);
617 text->sel_cursor = text->cursor;
618 UpdateLocal(bv, false, false);
621 bv->text->SetUndo(bv->buffer(), Undo::DELETE,
622 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
623 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next);
625 UpdateLocal(bv, true, true);
628 bv->text->SetUndo(bv->buffer(), Undo::DELETE,
629 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
630 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next);
632 UpdateLocal(bv, true, true);
635 bv->text->SetUndo(bv->buffer(), Undo::DELETE,
636 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
637 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next);
638 text->CutSelection(bv);
639 UpdateLocal(bv, true, true);
642 bv->text->FinishUndo();
643 text->CopySelection(bv);
644 UpdateLocal(bv, true, false);
647 bv->text->SetUndo(bv->buffer(), Undo::INSERT,
648 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
649 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next);
650 text->PasteSelection(bv);
651 UpdateLocal(bv, true, true);
653 case LFUN_BREAKPARAGRAPH:
656 text->BreakParagraph(bv, 0);
657 UpdateLocal(bv, true, true);
662 bv->text->SetUndo(bv->buffer(), Undo::INSERT,
663 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
664 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next);
665 text->InsertChar(bv, LyXParagraph::META_NEWLINE);
666 UpdateLocal(bv, true, true);
670 static LyXTextClass::size_type cur_layout = par->layout;
672 // Derive layout number from given argument (string)
673 // and current buffer's textclass (number). */
674 LyXTextClassList::ClassList::size_type tclass =
675 bv->buffer()->params.textclass;
676 std::pair <bool, LyXTextClass::size_type> layout =
677 textclasslist.NumberOfLayout(tclass, arg);
679 // If the entry is obsolete, use the new one instead.
681 string obs = textclasslist.Style(tclass,layout.second).
684 layout = textclasslist.NumberOfLayout(tclass, obs);
687 // see if we found the layout number:
689 string msg = string(N_("Layout ")) + arg + N_(" not known");
691 bv->owner()->getMiniBuffer()->Set(msg);
695 if (cur_layout != layout.second) {
696 cur_layout = layout.second;
697 text->SetLayout(bv, layout.second);
698 bv->owner()->getToolbar()->combox->select(cpar()->GetLayout()+1);
699 UpdateLocal(bv, true, true);
704 result = UNDISPATCHED;
707 if (result != FINISHED) {
710 bv->unlockInset(this);
715 int InsetText::Latex(Buffer const * buf, ostream & os, bool, bool) const
718 buf->latexParagraphs(os, par, 0, texrow);
719 return texrow.rows();
723 void InsetText::Validate(LaTeXFeatures & features) const
725 par->validate(features);
729 int InsetText::BeginningOfMainBody(Buffer const * buf, LyXParagraph * p) const
731 if (textclasslist.Style(buf->params.textclass,
732 p->GetLayout()).labeltype != LABEL_MANUAL)
735 return p->BeginningOfMainBody();
739 void InsetText::GetCursorPos(int & x, int & y) const
746 int InsetText::InsetInInsetY()
748 if (!the_locking_inset)
751 return (inset_y + the_locking_inset->InsetInInsetY());
755 void InsetText::ToggleInsetCursor(BufferView * bv)
757 if (the_locking_inset) {
758 the_locking_inset->ToggleInsetCursor(bv);
762 LyXFont font = text->GetFont(bv->buffer(), cpar(), cpos());
764 int asc = lyxfont::maxAscent(font);
765 int desc = lyxfont::maxDescent(font);
768 bv->hideLockedInsetCursor();
770 bv->showLockedInsetCursor(cx(), cy(),
772 cursor_visible = !cursor_visible;
776 void InsetText::ShowInsetCursor(BufferView * bv)
778 if (the_locking_inset) {
779 the_locking_inset->ShowInsetCursor(bv);
782 if (!cursor_visible) {
783 LyXFont font = text->GetFont(bv->buffer(), cpar(), cpos());
785 int asc = lyxfont::maxAscent(font);
786 int desc = lyxfont::maxDescent(font);
788 bv->fitLockedInsetCursor(cx(), cy(), asc, desc);
789 bv->showLockedInsetCursor(cx(), cy(), asc, desc);
790 cursor_visible = true;
795 void InsetText::HideInsetCursor(BufferView * bv)
797 if (cursor_visible) {
798 bv->hideLockedInsetCursor();
799 cursor_visible = false;
801 if (the_locking_inset)
802 the_locking_inset->HideInsetCursor(bv);
806 UpdatableInset::RESULT
807 InsetText::moveRight(BufferView * bv, bool activate_inset)
809 if (!cpar()->next && (cpos() >= cpar()->Last()))
811 if (activate_inset && checkAndActivateInset(bv)) {
814 text->CursorRight(bv);
815 // real_current_font = current_font = GetFont(bv->buffer(), cpar(), cpos());
816 return DISPATCHED_NOUPDATE;
820 UpdatableInset::RESULT
821 InsetText::moveLeft(BufferView * bv, bool activate_inset)
823 if (!cpar()->previous && (cpos() <= 0))
825 text->CursorLeft(bv);
827 if (checkAndActivateInset(bv, -1, -1))
829 return DISPATCHED_NOUPDATE;
833 UpdatableInset::RESULT
834 InsetText::moveUp(BufferView * bv)
836 if (!crow()->previous())
839 return DISPATCHED_NOUPDATE;
843 UpdatableInset::RESULT
844 InsetText::moveDown(BufferView * bv)
848 text->CursorDown(bv);
849 return DISPATCHED_NOUPDATE;
853 bool InsetText::Delete()
855 if ((par->GetChar(cpos())==LyXParagraph::META_INSET) &&
856 !par->GetInset(cpos())->Deletable()) {
864 bool InsetText::InsertInset(BufferView * bv, Inset * inset)
866 if (the_locking_inset) {
867 if (the_locking_inset->InsertInsetAllowed(inset))
868 return the_locking_inset->InsertInset(bv, inset);
871 bv->text->SetUndo(bv->buffer(), Undo::INSERT,
872 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
873 bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next);
874 if (inset->Editable() == Inset::IS_EDITABLE) {
875 UpdatableInset * i = static_cast<UpdatableInset *>(inset);
876 i->setOwner(static_cast<UpdatableInset *>(this));
878 par->InsertChar(cpos(), LyXParagraph::META_INSET);
879 par->InsertInset(cpos(), inset);
881 UpdateLocal(bv, true, true);
882 static_cast<UpdatableInset*>(inset)->Edit(bv, 0, 0, 0);
887 UpdatableInset * InsetText::GetLockingInset()
889 return the_locking_inset ? the_locking_inset->GetLockingInset() : this;
893 UpdatableInset * InsetText::GetFirstLockingInsetOfType(Inset::Code c)
897 if (the_locking_inset)
898 return the_locking_inset->GetFirstLockingInsetOfType(c);
903 void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall)
905 text->SetFont(bv, font, toggleall);
909 void InsetText::UpdateLocal(BufferView * bv, bool what, bool mark_dirty)
912 text->FullRebreak(bv);
914 bv->updateInset(this, mark_dirty);
916 // resetPos(bv->painter());
917 if (old_par != cpar()) {
918 bv->owner()->getToolbar()->combox->select(cpar()->GetLayout()+1);
924 bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
927 if (par->GetChar(cpos()) == LyXParagraph::META_INSET) {
928 UpdatableInset * inset =
929 static_cast<UpdatableInset*>(par->GetInset(cpos()));
930 LyXFont font = text->GetFont(bv->buffer(), cpar(), cpos());
932 x = inset->width(bv->painter(), font);
934 y = inset->descent(bv->painter(), font);
935 inset_x = cx() - top_x + drawTextXOffset;
936 inset_y = cy() + drawTextYOffset;
937 inset->Edit(bv, x - inset_x, y - inset_y, button);
938 if (!the_locking_inset)
940 UpdateLocal(bv, true, false);
947 int InsetText::getMaxTextWidth(Painter & pain, UpdatableInset const * inset) const
949 return getMaxWidth(pain, inset) - 4; // 2+2 width of eventual border
952 void InsetText::SetParagraphData(LyXParagraph *p)
966 par->SetInsetOwner(this);
970 np->next = p->Clone();
971 np->next->previous = np;
977 void InsetText::SetAutoBreakRows(bool flag)
979 if (flag != autoBreakRows) {
980 autoBreakRows = flag;
985 void InsetText::SetDrawLockedFrame(bool flag)
987 if (flag != drawLockedFrame) {
988 drawLockedFrame = flag;
993 void InsetText::SetFrameColor(LColor::color col)
995 if (frame_color != col) {
1001 LyXFont InsetText::GetDrawFont(Buffer const * buf, LyXParagraph * par, int pos) const
1003 return text->GetFont(buf, par, pos);
1006 int InsetText::cx() const
1008 return text->cursor.x() + top_x + 1;
1011 int InsetText::cy() const
1013 long int y_dummy = 0;
1014 Row * tmprow = text->GetRowNearY(y_dummy);
1015 return text->cursor.y() - tmprow->baseline();
1018 int InsetText::cpos() const
1020 return text->cursor.pos();
1023 LyXParagraph * InsetText::cpar() const
1025 return text->cursor.par();
1028 Row * InsetText::crow() const
1030 return text->cursor.row();