mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
parlist-16-a.diff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6999 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b3608133b0
commit
b1fb034c3b
@ -764,10 +764,9 @@ bool BufferView::ChangeInsets(Inset::Code code,
|
|||||||
ParIterator end = buffer()->par_iterator_end();
|
ParIterator end = buffer()->par_iterator_end();
|
||||||
for (ParIterator it = buffer()->par_iterator_begin();
|
for (ParIterator it = buffer()->par_iterator_begin();
|
||||||
it != end; ++it) {
|
it != end; ++it) {
|
||||||
Paragraph * par = &*(*it);
|
|
||||||
bool changed_inset = false;
|
bool changed_inset = false;
|
||||||
for (InsetList::iterator it2 = par->insetlist.begin();
|
for (InsetList::iterator it2 = it->insetlist.begin();
|
||||||
it2 != par->insetlist.end(); ++it2) {
|
it2 != it->insetlist.end(); ++it2) {
|
||||||
if (it2.getInset()->lyxCode() == code) {
|
if (it2.getInset()->lyxCode() == code) {
|
||||||
InsetCommand * inset = static_cast<InsetCommand *>(it2.getInset());
|
InsetCommand * inset = static_cast<InsetCommand *>(it2.getInset());
|
||||||
if (inset->getContents() == from) {
|
if (inset->getContents() == from) {
|
||||||
@ -784,7 +783,7 @@ bool BufferView::ChangeInsets(Inset::Code code,
|
|||||||
// The test it.size()==1 was needed to prevent crashes.
|
// The test it.size()==1 was needed to prevent crashes.
|
||||||
// How to set the cursor corretly when it.size()>1 ??
|
// How to set the cursor corretly when it.size()>1 ??
|
||||||
if (it.size() == 1) {
|
if (it.size() == 1) {
|
||||||
text->setCursorIntern(par, 0);
|
text->setCursorIntern(*it, 0);
|
||||||
text->redoParagraphs(text->cursor,
|
text->redoParagraphs(text->cursor,
|
||||||
boost::next(text->cursor.par()));
|
boost::next(text->cursor.par()));
|
||||||
text->fullRebreak();
|
text->fullRebreak();
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
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>
|
2003-05-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||||
|
|
||||||
* LyXAction.C: new lfun space-insert, kill protected-space-insert
|
* LyXAction.C: new lfun space-insert, kill protected-space-insert
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
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>
|
2003-05-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||||
|
|
||||||
* insetspace.[Ch]: added (new space insets)
|
* insetspace.[Ch]: added (new space insets)
|
||||||
|
@ -365,16 +365,14 @@ void InsetFloat::addToToc(toc::TocList & toclist, Buffer const * buf) const
|
|||||||
ParIterator pit(inset.paragraphs.begin(), inset.paragraphs);
|
ParIterator pit(inset.paragraphs.begin(), inset.paragraphs);
|
||||||
ParIterator end(inset.paragraphs.end(), 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) {
|
for (; pit != end; ++pit) {
|
||||||
Paragraph * tmp = &*(*pit);
|
if (pit->layout()->name() == caplayout) {
|
||||||
|
|
||||||
if (tmp->layout()->name() == caplayout) {
|
|
||||||
string const name = floatname(params_.type, buf->params);
|
string const name = floatname(params_.type, buf->params);
|
||||||
string const str =
|
string const str =
|
||||||
tostr(toclist[name].size() + 1)
|
tostr(toclist[name].size() + 1)
|
||||||
+ ". " + tmp->asString(buf, false);
|
+ ". " + pit->asString(buf, false);
|
||||||
toc::TocItem const item(tmp->id(), 0 , str);
|
toc::TocItem const item(pit->id(), 0 , str);
|
||||||
toclist[name].push_back(item);
|
toclist[name].push_back(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
17
src/lyx_cb.C
17
src/lyx_cb.C
@ -420,15 +420,18 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap
|
|||||||
|
|
||||||
string const getPossibleLabel(BufferView const & bv)
|
string const getPossibleLabel(BufferView const & bv)
|
||||||
{
|
{
|
||||||
Paragraph * par = &*bv.getLyXText()->cursor.par();
|
ParagraphList::iterator pit = bv.getLyXText()->cursor.par();
|
||||||
LyXLayout_ptr layout = par->layout();
|
ParagraphList & plist = bv.getLyXText()->ownerParagraphs();
|
||||||
if (layout->latextype == LATEX_PARAGRAPH && par->previous()) {
|
|
||||||
Paragraph * par2 = par->previous();
|
|
||||||
|
|
||||||
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) {
|
if (layout2->latextype != LATEX_PARAGRAPH) {
|
||||||
par = par2;
|
pit = pit2;
|
||||||
layout = layout2;
|
layout = layout2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -442,7 +445,7 @@ string const getPossibleLabel(BufferView const & bv)
|
|||||||
lyxrc.label_init_length < 0)
|
lyxrc.label_init_length < 0)
|
||||||
text.erase();
|
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) {
|
for (int i = 0; i < lyxrc.label_init_length; ++i) {
|
||||||
if (par_text.empty())
|
if (par_text.empty())
|
||||||
break;
|
break;
|
||||||
|
@ -634,7 +634,7 @@ void RowPainter::paintFirst()
|
|||||||
LyXLayout_ptr const & layout = pit_->layout();
|
LyXLayout_ptr const & layout = pit_->layout();
|
||||||
|
|
||||||
if (buffer->params.paragraph_separation == BufferParams::PARSEP_SKIP) {
|
if (buffer->params.paragraph_separation == BufferParams::PARSEP_SKIP) {
|
||||||
if (pit_->previous()) {
|
if (pit_ != text_.ownerParagraphs().begin()) {
|
||||||
if (layout->latextype == LATEX_PARAGRAPH
|
if (layout->latextype == LATEX_PARAGRAPH
|
||||||
&& !pit_->getDepth()) {
|
&& !pit_->getDepth()) {
|
||||||
y_top += buffer->params.getDefSkip().inPixels(bv_);
|
y_top += buffer->params.getDefSkip().inPixels(bv_);
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
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-19 André Pönitz <poenitz@gmx.net>
|
||||||
|
|
||||||
|
@ -280,30 +280,6 @@ string const ascii_lowercase(string const & a)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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)
|
bool prefixIs(string const & a, string const & pre)
|
||||||
{
|
{
|
||||||
string::size_type const prelen = pre.length();
|
string::size_type const prelen = pre.length();
|
||||||
@ -328,31 +304,6 @@ bool suffixIs(string const & a, char c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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)
|
bool suffixIs(string const & a, string const & suf)
|
||||||
{
|
{
|
||||||
string::size_type const suflen = suf.length();
|
string::size_type const suflen = suf.length();
|
||||||
@ -462,23 +413,6 @@ string const subst(string const & a, char oldchar, char newchar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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 subst(string const & a,
|
||||||
string const & oldstr, string const & newstr)
|
string const & oldstr, string const & newstr)
|
||||||
{
|
{
|
||||||
|
@ -84,18 +84,12 @@ string const lowercase(string const &);
|
|||||||
///
|
///
|
||||||
string const uppercase(string const &);
|
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?
|
/// Does the string start with this prefix?
|
||||||
bool prefixIs(string const &, string const &);
|
bool prefixIs(string const &, string const &);
|
||||||
|
|
||||||
/// Does the string end with this char?
|
/// Does the string end with this char?
|
||||||
bool suffixIs(string const &, 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?
|
/// Does the string end with this suffix?
|
||||||
bool suffixIs(string const &, string const &);
|
bool suffixIs(string const &, string const &);
|
||||||
|
|
||||||
@ -152,10 +146,6 @@ bool regexMatch(string const & a, string const & pattern);
|
|||||||
/// Substitute all \a oldchar with \a newchar
|
/// Substitute all \a oldchar with \a newchar
|
||||||
string const subst(string const & a, char oldchar, char 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
|
/// substitutes all instances of \a oldstr with \a newstr
|
||||||
string const subst(string const & a,
|
string const subst(string const & a,
|
||||||
string const & oldstr, string const & newstr);
|
string const & oldstr, string const & newstr);
|
||||||
|
@ -1337,14 +1337,14 @@ void LyXTabular::SetMultiColumn(Buffer * buffer, int cell, int number)
|
|||||||
cellinfo_of_cell(cell)->right_line = column_info[column_of_cell(cell+number-1)].right_line;
|
cellinfo_of_cell(cell)->right_line = column_info[column_of_cell(cell+number-1)].right_line;
|
||||||
#if 1
|
#if 1
|
||||||
for (int i = 1; i < number; ++i) {
|
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)->inset.appendParagraphs(buffer,
|
||||||
cellinfo_of_cell(cell+i)->inset.paragraphs);
|
cellinfo_of_cell(cell+i)->inset.paragraphs);
|
||||||
cellinfo_of_cell(cell+i)->inset.clear(false);
|
cellinfo_of_cell(cell + i)->inset.clear(false);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
for (number--; number > 0; --number) {
|
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
|
#endif
|
||||||
set_row_column_number_info();
|
set_row_column_number_info();
|
||||||
|
Loading…
Reference in New Issue
Block a user