- /** pos points at the beginning of the next cell (if there is one)
- */
- int WidthOfCell(LyXParagraph * par,
- LyXParagraph::size_type & pos) const;
- ///
- void CheckParagraphInTable(LyXParagraph * par,
- LyXParagraph::size_type pos);
- ///
- void InsertCharInTable(char c);
- ///
- void BackspaceInTable();
- ///
- bool HitInTable(Row * row, int x) const;
- ///
- bool MouseHitInTable(int x, long y) const;
- /* table stuff -- end*/
- ///
- LyXParagraph * GetParFromID(int id);
-
- // undo functions
- /// returns false if no undo possible
- bool TextUndo();
- /// returns false if no redo possible
- bool TextRedo();
- /// used by TextUndo/TextRedo
- bool TextHandleUndo(Undo * undo);
- /// makes sure the next operation will be stored
- void FinishUndo();
- /// this is dangerous and for internal use only
- void FreezeUndo();
- /// this is dangerous and for internal use only
- void UnFreezeUndo();
- /// the flag used by FinishUndo();
- mutable bool undo_finished;
- /// a flag
- bool undo_frozen;
- ///
- void SetUndo(Undo::undo_kind kind,
- LyXParagraph const * before,
- LyXParagraph const * end) const;
- ///
- void SetRedo(Undo::undo_kind kind,
- LyXParagraph const * before,
- LyXParagraph const * end);
- ///
- Undo * CreateUndo(Undo::undo_kind kind,
- LyXParagraph const * before,
- LyXParagraph const * end) const;
- /// for external use in lyx_cb.C
- void SetCursorParUndo();
- ///
- void CursorLeftIntern() const;
- ///
- void CursorRightIntern() const;
- ///
- void RemoveTableRow(LyXCursor * cursor) const;
- ///
- bool IsEmptyTableCell() const;
- ///
- void toggleAppendix();
- ///
- unsigned short paperWidth() const { return paperwidth; }
+ /// Maps positions in the logical string to positions in visual string.
+ inline
+ lyx::pos_type vis2log(lyx::pos_type pos) const {
+ if (bidi_start == -1)
+ return pos;
+ else
+ return vis2log_list[pos-bidi_start];
+ }
+ ///
+ inline
+ lyx::pos_type bidi_level(lyx::pos_type pos) const {
+ if (bidi_start == -1)
+ return 0;
+ else
+ return bidi_levels[pos-bidi_start];
+ }
+ ///
+ inline
+ bool bidi_InRange(lyx::pos_type pos) const {
+ return bidi_start == -1 ||
+ (bidi_start <= pos && pos <= bidi_end);
+ }