mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
patch from Dekel
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@767 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2649fe2b52
commit
b18c63a393
@ -1,3 +1,9 @@
|
||||
2000-05-21 Dekel Tsur <dekel@math.tau.ac.il>
|
||||
|
||||
* src/paragraph.C (String): Several fixes/improvements
|
||||
|
||||
* src/insets/insetbib.[Ch] (InsetCitation::Ascii) New method
|
||||
|
||||
2000-05-22 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* src/paragraph.C (String): give more correct output.
|
||||
|
@ -204,6 +204,11 @@ string InsetCitation::getScreenLabel() const
|
||||
return temp + ']';
|
||||
}
|
||||
|
||||
int InsetCitation::Ascii(ostream & os) const
|
||||
{
|
||||
os << getScreenLabel();;
|
||||
return 0;
|
||||
}
|
||||
|
||||
InsetBibKey::InsetBibKey(string const & key, string const & label):
|
||||
InsetCommand("bibitem", key, label)
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
EDITABLE Editable() const {
|
||||
return IS_EDITABLE;
|
||||
}
|
||||
int Ascii(std::ostream &) const;
|
||||
///
|
||||
struct Holder {
|
||||
InsetCitation * inset;
|
||||
|
@ -4276,7 +4276,7 @@ bool LyXParagraph::isMultiLingual()
|
||||
string LyXParagraph::String(bool label)
|
||||
{
|
||||
string s;
|
||||
if (label && !IsDummy())
|
||||
if (label && !IsDummy() && !labelstring.empty())
|
||||
s += labelstring + ' ';
|
||||
string::size_type len = s.size();
|
||||
|
||||
@ -4313,6 +4313,20 @@ string LyXParagraph::String(LyXParagraph::size_type beg,
|
||||
LyXParagraph::size_type end)
|
||||
{
|
||||
string s;
|
||||
int actcell = 0;
|
||||
int cell = 1;
|
||||
if (table)
|
||||
for (LyXParagraph::size_type i = 0; i < beg; ++i)
|
||||
if (IsNewline(i)) {
|
||||
if (cell >= table->NumberOfCellsInRow(actcell))
|
||||
cell = 1;
|
||||
else
|
||||
++cell;
|
||||
++actcell;
|
||||
}
|
||||
|
||||
if (beg == 0 && !IsDummy() && !labelstring.empty())
|
||||
s += labelstring + ' ';
|
||||
|
||||
for (LyXParagraph::size_type i = beg; i < end; ++i) {
|
||||
unsigned char c = GetChar(i);
|
||||
@ -4327,16 +4341,21 @@ string LyXParagraph::String(LyXParagraph::size_type beg,
|
||||
GetInset(i)->Ascii(ost);
|
||||
ost << '\0';
|
||||
#endif
|
||||
s += subst(ost.str(),'\n',' ');
|
||||
s += ost.str();
|
||||
} else if (table && IsNewlineChar(c)) {
|
||||
if (cell >= table->NumberOfCellsInRow(actcell)) {
|
||||
s += '\n';
|
||||
cell = 1;
|
||||
} else {
|
||||
s += ' ';
|
||||
++cell;
|
||||
}
|
||||
++actcell;
|
||||
}
|
||||
}
|
||||
|
||||
//if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
|
||||
// s += NextAfterFootnote()->String(false);
|
||||
|
||||
if (!IsDummy()) {
|
||||
if (isRightToLeftPar())
|
||||
reverse(s.begin(), s.end());
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
@ -1086,13 +1086,14 @@ string LyXText::selectionAsString() const
|
||||
|
||||
// First paragraph in selection
|
||||
result += sel_start_cursor.par->String(sel_start_cursor.pos,
|
||||
sel_start_cursor.par->Last());
|
||||
sel_start_cursor.par->Last())
|
||||
+ "\n\n";
|
||||
|
||||
// The paragraphs in between (if any)
|
||||
LyXCursor tmpcur(sel_start_cursor);
|
||||
tmpcur.par = tmpcur.par->Next();
|
||||
while (tmpcur.par != sel_end_cursor.par) {
|
||||
result += tmpcur.par->String(false);
|
||||
result += tmpcur.par->String(0, tmpcur.par->Last()) + "\n\n";
|
||||
tmpcur.par = tmpcur.par->Next(); // Or NextAfterFootnote??
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user