using std::ostream;
using std::ifstream;
+using std::endl;
using std::min;
using std::max;
extern unsigned char getCurrentTextClass(Buffer *);
+
InsetText::InsetText(Buffer * buf)
{
par = new LyXParagraph();
autoBreakRows = ins.autoBreakRows;
}
+
void InsetText::init(Buffer * buf, InsetText const * ins)
{
the_locking_inset = 0;
no_selection = false;
}
+
bool InsetText::LockInsetInInset(BufferView * bv, UpdatableInset * inset)
{
lyxerr[Debug::INSETS] << "InsetText::LockInsetInInset(" << inset << "): ";
return false;
}
+
bool InsetText::UnlockInsetInInset(BufferView * bv, UpdatableInset * inset,
bool lr)
{
}
-int InsetText::Latex(ostream & os, bool /*fragile*/, bool) const
+int InsetText::Latex(ostream & os, bool /*fragile*/, bool /*fp*/) const
{
TexRow texrow;
int ret = par->SimpleTeXOnePar(os, texrow);
return tmpfont;
}
+
// the font for drawing may be different from the real font
LyXFont InsetText::GetDrawFont(LyXParagraph * par, int pos) const
{
return GetFont(par, pos);
}
+
int InsetText::BeginningOfMainBody(LyXParagraph * par) const
{
if (textclasslist.Style(buffer->params.textclass,
cursor.y = top_baseline;
actrow = 0;
- for(unsigned int i = 0; (i < (rows.size()-1)) && (rows[i].pos <= cursor.pos);
+ for(unsigned int i = 0;
+ (i < (rows.size()-1)) && (rows[i].pos <= cursor.pos);
++i) {
cursor.y = rows[i].baseline;
actrow = i;
(par->GetChar(p + 1)==LyXParagraph::META_INSET))
inset = par->GetInset(p + 1);
if (inset) {
- inset->setOwner(this);
+ inset->setOwner(const_cast<InsetText*>(this)); // is this safe?
if (inset->display()) {
if (!is_first_word_in_row && (width >= maxWidth)) {
// we have to split also the row above
}
}
-void InsetText::UpdateLocal(BufferView *bv, bool flag)
+
+void InsetText::UpdateLocal(BufferView * bv, bool flag)
{
if (flag) {
computeTextRows(bv->painter(), xpos);
resetPos(bv->painter());
}
+
bool InsetText::cutSelection()
{
if (!hasSelection())
CutAndPaste cap;
- LyXParagraph *endpar = par;
+ LyXParagraph * endpar = par;
int start, end;
if (selection_start > selection_end) {
start = selection_end;
return cap.cutSelection(par, &endpar, start, end,buffer->params.textclass);
}
+
bool InsetText::copySelection()
{
if (!hasSelection())
return cap.copySelection(par, par, start, end, buffer->params.textclass);
}
+
bool InsetText::pasteSelection()
{
CutAndPaste cap;
buffer->params.textclass);
}
+
bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
int button)
{
return false;
}
+
int InsetText::getMaxTextWidth(Painter & pain, UpdatableInset const * inset,
int x) const
{