2001-06-25 00:06:33 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-06-10 21:04:06 +00:00
|
|
|
|
/**
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \file paragraph.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Asger Alstrup
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-10 21:04:06 +00:00
|
|
|
|
*/
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
#ifndef PARAGRAPH_H
|
|
|
|
|
#define PARAGRAPH_H
|
|
|
|
|
|
2003-09-06 18:38:02 +00:00
|
|
|
|
#include "changes.h"
|
|
|
|
|
#include "InsetList.h"
|
2002-06-24 20:28:12 +00:00
|
|
|
|
#include "lyxlayout_ptr_fwd.h"
|
2003-09-06 18:38:02 +00:00
|
|
|
|
#include "RowList_fwd.h"
|
2002-08-07 16:31:45 +00:00
|
|
|
|
|
2001-11-26 16:42:04 +00:00
|
|
|
|
#include "support/types.h"
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2003-10-07 06:45:25 +00:00
|
|
|
|
#include <string>
|
2002-08-07 16:31:45 +00:00
|
|
|
|
|
2003-05-28 06:47:15 +00:00
|
|
|
|
class Buffer;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
class BufferParams;
|
|
|
|
|
class BufferView;
|
2002-08-07 16:31:45 +00:00
|
|
|
|
class Counters;
|
2003-02-21 09:20:18 +00:00
|
|
|
|
class InsetBibitem;
|
2003-09-18 10:52:29 +00:00
|
|
|
|
class InsetOld_code;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
class Language;
|
2002-08-07 16:31:45 +00:00
|
|
|
|
class LaTeXFeatures;
|
2003-05-22 18:59:10 +00:00
|
|
|
|
class LatexRunParams;
|
2003-09-18 10:52:29 +00:00
|
|
|
|
class LyXFont;
|
2003-09-16 13:43:30 +00:00
|
|
|
|
class LyXFont_size;
|
2002-08-07 16:31:45 +00:00
|
|
|
|
class ParagraphParameters;
|
|
|
|
|
class TexRow;
|
2003-06-04 07:14:05 +00:00
|
|
|
|
class UpdatableInset;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
/// A Paragraph holds all text, attributes and insets in a text paragraph
|
|
|
|
|
class Paragraph {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
enum META_KIND {
|
2003-03-12 19:16:42 +00:00
|
|
|
|
/// Note that this is 1 right now to avoid
|
|
|
|
|
/// crashes where getChar() is called wrongly
|
|
|
|
|
/// (returning 0) - if this was 0, then we'd
|
|
|
|
|
/// try getInset() and crash. We should fix
|
|
|
|
|
/// all these places.
|
|
|
|
|
META_INSET = 1
|
2001-06-25 00:06:33 +00:00
|
|
|
|
};
|
|
|
|
|
///
|
|
|
|
|
typedef char value_type;
|
2003-09-06 17:23:08 +00:00
|
|
|
|
///
|
|
|
|
|
typedef lyx::depth_type depth_type;
|
2003-09-16 14:08:05 +00:00
|
|
|
|
///
|
|
|
|
|
typedef std::vector<value_type> TextContainer;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
Paragraph();
|
2003-05-22 18:29:02 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-05-25 08:49:48 +00:00
|
|
|
|
Paragraph(Paragraph const &);
|
|
|
|
|
///
|
2003-06-04 07:14:05 +00:00
|
|
|
|
void operator=(Paragraph const &);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
/// the destructor removes the new paragraph from the list
|
|
|
|
|
~Paragraph();
|
|
|
|
|
|
2003-10-14 13:01:49 +00:00
|
|
|
|
///
|
|
|
|
|
int id() const;
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
Language const * getParLanguage(BufferParams const &) const;
|
|
|
|
|
///
|
|
|
|
|
bool isRightToLeftPar(BufferParams const &) const;
|
|
|
|
|
///
|
|
|
|
|
void changeLanguage(BufferParams const & bparams,
|
|
|
|
|
Language const * from, Language const * to);
|
|
|
|
|
///
|
|
|
|
|
bool isMultiLingual(BufferParams const &);
|
|
|
|
|
|
2001-11-26 16:52:24 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const asString(Buffer const &, bool label) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const asString(Buffer const &, lyx::pos_type beg, lyx::pos_type end,
|
2002-11-08 01:08:27 +00:00
|
|
|
|
bool label) const;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void write(Buffer const &, std::ostream &, BufferParams const &,
|
2003-09-06 18:38:02 +00:00
|
|
|
|
depth_type & depth) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
void validate(LaTeXFeatures &) const;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
|
|
|
|
///
|
2002-07-01 14:31:57 +00:00
|
|
|
|
int startTeXParParams(BufferParams const &, std::ostream &, bool) const;
|
2002-01-19 20:24:04 +00:00
|
|
|
|
|
2002-03-21 17:27:08 +00:00
|
|
|
|
///
|
2002-07-01 14:31:57 +00:00
|
|
|
|
int endTeXParParams(BufferParams const &, std::ostream &, bool) const;
|
2002-01-19 20:24:04 +00:00
|
|
|
|
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
bool simpleTeXOnePar(Buffer const &, BufferParams const &,
|
2003-04-15 00:11:03 +00:00
|
|
|
|
LyXFont const & outerfont, std::ostream &,
|
2003-05-23 08:59:47 +00:00
|
|
|
|
TexRow & texrow, LatexRunParams const &);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
///
|
2003-04-29 10:56:15 +00:00
|
|
|
|
bool hasSameLayout(Paragraph const & par) const;
|
2001-07-29 15:34:18 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-04-29 10:56:15 +00:00
|
|
|
|
void makeSameLayout(Paragraph const & par);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
///
|
2003-06-04 07:14:05 +00:00
|
|
|
|
UpdatableInset * inInset() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-06-04 07:14:05 +00:00
|
|
|
|
void setInsetOwner(UpdatableInset * inset);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
void deleteInsetsLyXText(BufferView *);
|
|
|
|
|
|
|
|
|
|
///
|
2003-09-16 14:08:05 +00:00
|
|
|
|
lyx::pos_type size() const { return text_.size(); }
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-09-16 14:08:05 +00:00
|
|
|
|
bool empty() const { return text_.empty(); }
|
2002-08-10 15:21:07 +00:00
|
|
|
|
///
|
2003-04-29 10:39:08 +00:00
|
|
|
|
void setContentsFromPar(Paragraph const & par);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
void clearContents();
|
|
|
|
|
|
|
|
|
|
///
|
2002-06-24 20:28:12 +00:00
|
|
|
|
LyXLayout_ptr const & layout() const;
|
2002-03-02 16:39:54 +00:00
|
|
|
|
///
|
2002-06-24 20:28:12 +00:00
|
|
|
|
void layout(LyXLayout_ptr const & new_layout);
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
2003-10-08 17:44:32 +00:00
|
|
|
|
/// This is the item depth, only used by enumerate and itemize
|
|
|
|
|
signed char itemdepth;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2002-03-21 17:27:08 +00:00
|
|
|
|
///
|
2003-05-27 22:41:04 +00:00
|
|
|
|
InsetBibitem * bibitem() const; // ale970302
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// initialise tracking for this par
|
|
|
|
|
void trackChanges(Change::Type = Change::UNCHANGED);
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// stop tracking
|
|
|
|
|
void untrackChanges();
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// set entire paragraph to new text for change tracking
|
|
|
|
|
void cleanChanges();
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// look up change type at given pos
|
|
|
|
|
Change::Type lookupChange(lyx::pos_type pos) const;
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// look up change at given pos
|
|
|
|
|
Change const lookupChangeFull(lyx::pos_type pos) const;
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// is there a change within the given range ?
|
|
|
|
|
bool isChanged(lyx::pos_type start, lyx::pos_type end) const;
|
|
|
|
|
|
|
|
|
|
/// is there a non-addition in this range ?
|
|
|
|
|
bool isChangeEdited(lyx::pos_type start, lyx::pos_type end) const;
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-03-04 19:52:35 +00:00
|
|
|
|
/// set change at pos
|
|
|
|
|
void setChange(lyx::pos_type pos, Change::Type type);
|
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// accept change
|
|
|
|
|
void acceptChange(lyx::pos_type start, lyx::pos_type end);
|
|
|
|
|
|
|
|
|
|
/// reject change
|
|
|
|
|
void rejectChange(lyx::pos_type start, lyx::pos_type end);
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// mark whole par as erased
|
|
|
|
|
void markErased();
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-05-29 11:19:52 +00:00
|
|
|
|
/// Paragraphs can contain "manual labels", for example, Description
|
|
|
|
|
/// environment. The text for this user-editable label is stored in
|
|
|
|
|
/// the paragraph alongside the text of the rest of the paragraph
|
|
|
|
|
/// (the body). This function returns the starting position of the
|
|
|
|
|
/// body of the text in the paragraph.
|
2003-03-09 12:37:22 +00:00
|
|
|
|
int beginningOfBody() const;
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const & getLabelstring() const;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
/// the next two functions are for the manual labels
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const getLabelWidthString() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void setLabelWidthString(std::string const & s);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
char getAlign() const;
|
2002-02-28 15:07:11 +00:00
|
|
|
|
/// The nesting depth of a paragraph
|
2001-06-25 00:06:33 +00:00
|
|
|
|
depth_type getDepth() const;
|
2002-02-28 15:07:11 +00:00
|
|
|
|
/// The maximal possible depth of a paragraph after this one
|
2002-06-24 20:28:12 +00:00
|
|
|
|
depth_type getMaxDepthAfter() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2002-06-24 20:28:12 +00:00
|
|
|
|
void applyLayout(LyXLayout_ptr const & new_layout);
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-03-04 19:52:35 +00:00
|
|
|
|
/// definite erase
|
|
|
|
|
void eraseIntern(lyx::pos_type pos);
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/// erase the char at the given position
|
2003-05-01 09:15:15 +00:00
|
|
|
|
bool erase(lyx::pos_type pos);
|
2003-04-29 09:40:49 +00:00
|
|
|
|
/// erase the given range. Returns the number of chars actually erased
|
|
|
|
|
int erase(lyx::pos_type start, lyx::pos_type end);
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
/** Get uninstantiated font setting. Returns the difference
|
2001-06-25 00:06:33 +00:00
|
|
|
|
between the characters font and the layoutfont.
|
|
|
|
|
This is what is stored in the fonttable
|
|
|
|
|
*/
|
|
|
|
|
LyXFont const
|
2001-11-27 10:34:16 +00:00
|
|
|
|
getFontSettings(BufferParams const &, lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
LyXFont const getFirstFontSettings() const;
|
|
|
|
|
|
|
|
|
|
/** Get fully instantiated font. If pos == -1, use the layout
|
|
|
|
|
font attached to this paragraph.
|
|
|
|
|
If pos == -2, use the label font of the layout attached here.
|
|
|
|
|
In all cases, the font is instantiated, i.e. does not have any
|
2002-03-21 17:27:08 +00:00
|
|
|
|
attributes with values LyXFont::INHERIT, LyXFont::IGNORE or
|
2001-06-25 00:06:33 +00:00
|
|
|
|
LyXFont::TOGGLE.
|
|
|
|
|
*/
|
2003-04-15 00:11:03 +00:00
|
|
|
|
LyXFont const getFont(BufferParams const &, lyx::pos_type pos,
|
|
|
|
|
LyXFont const & outerfont) const;
|
2003-04-15 00:49:11 +00:00
|
|
|
|
LyXFont const getLayoutFont(BufferParams const &,
|
|
|
|
|
LyXFont const & outerfont) const;
|
|
|
|
|
LyXFont const getLabelFont(BufferParams const &,
|
|
|
|
|
LyXFont const & outerfont) const;
|
2003-07-27 10:42:11 +00:00
|
|
|
|
/**
|
|
|
|
|
* The font returned by the above functions is the same in a
|
|
|
|
|
* span of characters. This method will return the last position
|
|
|
|
|
* in the paragraph for which that font is the same.
|
|
|
|
|
* This can be used to avoid unnecessary calls to getFont.
|
|
|
|
|
*/
|
|
|
|
|
lyx::pos_type getEndPosOfFontSpan(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
value_type getChar(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
value_type getUChar(BufferParams const &, lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
/// The position must already exist.
|
2001-11-27 10:34:16 +00:00
|
|
|
|
void setChar(lyx::pos_type pos, value_type c);
|
2002-05-30 03:37:24 +00:00
|
|
|
|
/// pos <= size() (there is a dummy font change at the end of each par)
|
2001-11-27 10:34:16 +00:00
|
|
|
|
void setFont(lyx::pos_type pos, LyXFont const & font);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
/// Returns the height of the highest font in range
|
2003-09-16 13:43:30 +00:00
|
|
|
|
LyXFont_size highestFontInRange(lyx::pos_type startpos,
|
|
|
|
|
lyx::pos_type endpos,
|
|
|
|
|
LyXFont_size def_size) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
void insertChar(lyx::pos_type pos, value_type c);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-02-08 19:18:01 +00:00
|
|
|
|
void insertChar(lyx::pos_type pos, value_type c, LyXFont const &, Change change = Change(Change::INSERTED));
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-07-27 12:03:36 +00:00
|
|
|
|
bool checkInsertChar(LyXFont &);
|
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
void insertInset(lyx::pos_type pos, InsetOld * inset);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
void insertInset(lyx::pos_type pos, InsetOld * inset, LyXFont const &, Change change = Change(Change::INSERTED));
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-09-18 10:52:29 +00:00
|
|
|
|
bool insetAllowed(InsetOld_code code);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld * getInset(lyx::pos_type pos);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld const * getInset(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
bool isHfill(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
bool isInset(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
bool isNewline(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
bool isSeparator(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
bool isLineSeparator(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
bool isKomma(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
/// Used by the spellchecker
|
2001-11-27 10:34:16 +00:00
|
|
|
|
bool isLetter(lyx::pos_type pos) const;
|
2002-03-21 17:27:08 +00:00
|
|
|
|
///
|
2001-11-27 10:34:16 +00:00
|
|
|
|
bool isWord(lyx::pos_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
/// returns -1 if inset not found
|
2003-07-25 21:20:24 +00:00
|
|
|
|
int getPositionOfInset(InsetOld const * inset) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
///
|
2002-06-24 20:28:12 +00:00
|
|
|
|
int stripLeadingSpaces();
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2003-06-07 17:45:43 +00:00
|
|
|
|
/// return true if we allow multiple spaces
|
2001-11-29 16:29:30 +00:00
|
|
|
|
bool isFreeSpacing() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
2003-06-07 17:45:43 +00:00
|
|
|
|
/// return true if we allow this par to stay empty
|
|
|
|
|
bool allowEmpty() const;
|
2003-10-27 12:41:26 +00:00
|
|
|
|
////
|
|
|
|
|
unsigned char transformChar(unsigned char c, lyx::pos_type pos) const;
|
2002-03-02 16:39:54 +00:00
|
|
|
|
///
|
2002-08-11 15:03:52 +00:00
|
|
|
|
ParagraphParameters & params();
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2002-08-11 15:03:52 +00:00
|
|
|
|
ParagraphParameters const & params() const;
|
2003-10-24 09:45:07 +00:00
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
RowList::iterator getRow(lyx::pos_type pos);
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
|
|
|
|
InsetList insetlist;
|
2003-06-03 15:10:14 +00:00
|
|
|
|
|
2003-08-15 08:03:54 +00:00
|
|
|
|
///
|
|
|
|
|
mutable RowList rows;
|
2003-08-26 14:50:16 +00:00
|
|
|
|
/// last draw y position (baseline of top row)
|
|
|
|
|
int y;
|
2003-10-23 08:15:57 +00:00
|
|
|
|
/// total height of paragraph
|
|
|
|
|
unsigned int height;
|
|
|
|
|
/// total width of paragraph, may differ from workwidth
|
|
|
|
|
unsigned int width;
|
2003-08-15 08:03:54 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
private:
|
2002-08-11 15:03:52 +00:00
|
|
|
|
///
|
|
|
|
|
LyXLayout_ptr layout_;
|
2003-09-16 14:08:05 +00:00
|
|
|
|
/// keeping this here instead of in the pimpl makes LyX >10% faster
|
|
|
|
|
// for average tasks as buffer loading/switching etc.
|
|
|
|
|
TextContainer text_;
|
2003-05-24 16:11:27 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
struct Pimpl;
|
|
|
|
|
///
|
|
|
|
|
friend struct Paragraph::Pimpl;
|
|
|
|
|
///
|
|
|
|
|
Pimpl * pimpl_;
|
2003-04-29 14:05:54 +00:00
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
};
|
|
|
|
|
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-26 17:04:10 +00:00
|
|
|
|
inline bool isInsertedText(Paragraph const & par, lyx::pos_type pos)
|
2003-02-08 19:18:01 +00:00
|
|
|
|
{
|
2003-02-26 17:04:10 +00:00
|
|
|
|
return par.lookupChange(pos) == Change::INSERTED;
|
2003-02-08 19:18:01 +00:00
|
|
|
|
}
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
|
|
|
|
|
2003-02-26 17:04:10 +00:00
|
|
|
|
inline bool isDeletedText(Paragraph const & par, lyx::pos_type pos)
|
2003-02-08 19:18:01 +00:00
|
|
|
|
{
|
2003-02-26 17:04:10 +00:00
|
|
|
|
return par.lookupChange(pos) == Change::DELETED;
|
2003-02-08 19:18:01 +00:00
|
|
|
|
}
|
2003-03-03 21:15:49 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
#endif // PARAGRAPH_H
|