ParIterator end = buffer()->par_iterator_end();
for (ParIterator it = buffer()->par_iterator_begin();
it != end; ++it) {
- Paragraph * par = &*(*it);
bool changed_inset = false;
- for (InsetList::iterator it2 = par->insetlist.begin();
- it2 != par->insetlist.end(); ++it2) {
+ for (InsetList::iterator it2 = it->insetlist.begin();
+ it2 != it->insetlist.end(); ++it2) {
if (it2.getInset()->lyxCode() == code) {
InsetCommand * inset = static_cast<InsetCommand *>(it2.getInset());
if (inset->getContents() == from) {
// The test it.size()==1 was needed to prevent crashes.
// How to set the cursor corretly when it.size()>1 ??
if (it.size() == 1) {
- text->setCursorIntern(par, 0);
+ text->setCursorIntern(*it, 0);
text->redoParagraphs(text->cursor,
boost::next(text->cursor.par()));
text->fullRebreak();
+2003-05-22 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * tabular.C (SetMultiColumn): ws changes
+
+ * rowpainter.C (paintFirst): get rid of a ->previous
+
+ * lyx_cb.C (getPossibleLabel): parlist simplification
+
+ * BufferView.C (ChangeInsets): simplify slightly.
+
2003-05-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* LyXAction.C: new lfun space-insert, kill protected-space-insert
* BufferView.C:
* BufferView_pimpl.C:
- * buffer.[Ch]:
+ * buffer.[Ch]:
* lyxfunc.C:
* undo_funcs.C: return a ParIterator from getParFromID.
+2003-05-22 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * insetfloat.C (addToToc): parlist simplfication
+
2003-05-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* insetspace.[Ch]: added (new space insets)
ParIterator pit(inset.paragraphs.begin(), inset.paragraphs);
ParIterator end(inset.paragraphs.end(), inset.paragraphs);
- // Find a caption layout in one of the (child inset's) pars
+a // Find a caption layout in one of the (child inset's) pars
for (; pit != end; ++pit) {
- Paragraph * tmp = &*(*pit);
-
- if (tmp->layout()->name() == caplayout) {
+ if (pit->layout()->name() == caplayout) {
string const name = floatname(params_.type, buf->params);
string const str =
tostr(toclist[name].size() + 1)
- + ". " + tmp->asString(buf, false);
- toc::TocItem const item(tmp->id(), 0 , str);
+ + ". " + pit->asString(buf, false);
+ toc::TocItem const item(pit->id(), 0 , str);
toclist[name].push_back(item);
}
}
string const getPossibleLabel(BufferView const & bv)
{
- Paragraph * par = &*bv.getLyXText()->cursor.par();
- LyXLayout_ptr layout = par->layout();
- if (layout->latextype == LATEX_PARAGRAPH && par->previous()) {
- Paragraph * par2 = par->previous();
+ ParagraphList::iterator pit = bv.getLyXText()->cursor.par();
+ ParagraphList & plist = bv.getLyXText()->ownerParagraphs();
- LyXLayout_ptr const & layout2 = par2->layout();
+ LyXLayout_ptr layout = pit->layout();
+
+ if (layout->latextype == LATEX_PARAGRAPH && pit != plist.begin()) {
+ ParagraphList::iterator pit2 = boost::prior(pit);
+
+ LyXLayout_ptr const & layout2 = pit2->layout();
if (layout2->latextype != LATEX_PARAGRAPH) {
- par = par2;
+ pit = pit2;
layout = layout2;
}
}
lyxrc.label_init_length < 0)
text.erase();
- string par_text = par->asString(bv.buffer(), false);
+ string par_text = pit->asString(bv.buffer(), false);
for (int i = 0; i < lyxrc.label_init_length; ++i) {
if (par_text.empty())
break;
LyXLayout_ptr const & layout = pit_->layout();
if (buffer->params.paragraph_separation == BufferParams::PARSEP_SKIP) {
- if (pit_->previous()) {
+ if (pit_ != text_.ownerParagraphs().begin()) {
if (layout->latextype == LATEX_PARAGRAPH
&& !pit_->getDepth()) {
y_top += buffer->params.getDefSkip().inPixels(bv_);
+2003-05-22 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * lstrings.[Ch] (prefixIs,suffixIs,subst): remove variants taking
+ char const *.
2003-05-19 André Pönitz <poenitz@gmx.net>
2003-05-12 André Pönitz <poenitz@gmx.net>
* lstrings.[Ch]: bformat() as wrapper around boost::format
-
+
* lyxstring.h: enable templatized constructor
2003-05-06 Lars Gullik Bjønnes <larsbj@gullik.net>
}
-bool prefixIs(string const & a, char const * pre)
-{
- lyx::Assert(pre);
-
- size_t const l = strlen(pre);
- string::size_type const alen = a.length();
-
- if (l > alen || a.empty())
- return false;
- else {
-#if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD)
- // Delete this code when the compilers get a bit better.
- return ::strncmp(a.c_str(), pre, l) == 0;
-#else
- // This is the code that we really want to use
- // but until gcc ships with a basic_string that
- // implements std::string correctly we have to
- // use the code above.
- return a.compare(0, l, pre, l) == 0;
-#endif
- }
-}
-
-
bool prefixIs(string const & a, string const & pre)
{
string::size_type const prelen = pre.length();
}
-bool suffixIs(string const & a, char const * suf)
-{
- lyx::Assert(suf);
-
- size_t const suflen = strlen(suf);
- string::size_type const alen = a.length();
-
- if (suflen > alen)
- return false;
- else {
-#if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD)
- // Delete this code when the compilers get a bit better.
- string tmp(a, alen - suflen);
- return ::strncmp(tmp.c_str(), suf, suflen) == 0;
-#else
- // This is the code that we really want to use
- // but until gcc ships with a basic_string that
- // implements std::string correctly we have to
- // use the code above.
- return a.compare(alen - suflen, suflen, suf) == 0;
-#endif
- }
-}
-
-
bool suffixIs(string const & a, string const & suf)
{
string::size_type const suflen = suf.length();
}
-string const subst(string const & a,
- char const * oldstr, string const & newstr)
-{
- lyx::Assert(oldstr);
-
- string lstr(a);
- string::size_type i = 0;
- string::size_type olen = strlen(oldstr);
- while ((i = lstr.find(oldstr, i)) != string::npos) {
- lstr.replace(i, olen, newstr);
- i += newstr.length(); // We need to be sure that we dont
- // use the same i over and over again.
- }
- return lstr;
-}
-
-
string const subst(string const & a,
string const & oldstr, string const & newstr)
{
% STRCONV(arg3) % STRCONV(arg4)).str());
}
-#else
+#else
string bformat(string const & fmt, string const & arg1)
{
///
string const uppercase(string const &);
-/// Does the string start with this prefix?
-bool prefixIs(string const &, char const *);
-
/// Does the string start with this prefix?
bool prefixIs(string const &, string const &);
/// Does the string end with this char?
bool suffixIs(string const &, char);
-/// Does the string end with this suffix?
-bool suffixIs(string const &, char const *);
-
/// Does the string end with this suffix?
bool suffixIs(string const &, string const &);
/// Substitute all \a oldchar with \a newchar
string const subst(string const & a, char oldchar, char newchar);
-/// Substitutes all instances of \a oldstr with \a newstr
-string const subst(string const & a,
- char const * oldstr, string const & newstr);
-
/// substitutes all instances of \a oldstr with \a newstr
string const subst(string const & a,
string const & oldstr, string const & newstr);
cellinfo_of_cell(cell)->right_line = column_info[column_of_cell(cell+number-1)].right_line;
#if 1
for (int i = 1; i < number; ++i) {
- cellinfo_of_cell(cell+i)->multicolumn = CELL_PART_OF_MULTICOLUMN;
+ cellinfo_of_cell(cell + i)->multicolumn = CELL_PART_OF_MULTICOLUMN;
cellinfo_of_cell(cell)->inset.appendParagraphs(buffer,
cellinfo_of_cell(cell+i)->inset.paragraphs);
- cellinfo_of_cell(cell+i)->inset.clear(false);
+ cellinfo_of_cell(cell + i)->inset.clear(false);
}
#else
for (number--; number > 0; --number) {
- cellinfo_of_cell(cell+number)->multicolumn = CELL_PART_OF_MULTICOLUMN;
+ cellinfo_of_cell(cell + number)->multicolumn = CELL_PART_OF_MULTICOLUMN;
}
#endif
set_row_column_number_info();