From 2f71b9d2352543f8c6a891cc7c6d84378eb0387d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 4 Mar 2003 09:27:27 +0000 Subject: [PATCH] ws changes only git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6333 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.C | 2 +- src/BufferView.h | 2 +- src/ChangeLog | 2 + src/CutAndPaste.C | 34 +++++------ src/InsetList.C | 2 +- src/LaTeX.C | 4 +- src/MenuBackend.C | 6 +- src/MenuBackend.h | 6 +- src/author.h | 24 ++++---- src/bufferlist.C | 2 +- src/bufferview_funcs.C | 2 +- src/changes.C | 136 ++++++++++++++++++++--------------------- src/format.C | 8 +-- src/funcrequest.C | 2 +- src/graph.C | 2 - src/graph.h | 2 +- src/ispell.C | 4 +- src/lyxfind.C | 20 +++--- src/lyxfind.h | 8 +-- src/lyxrc.C | 6 +- src/lyxrow.C | 4 +- src/lyxrow.h | 4 +- src/lyxtext.h | 4 +- src/rowpainter.C | 36 +++++------ 24 files changed, 161 insertions(+), 161 deletions(-) diff --git a/src/BufferView.C b/src/BufferView.C index 8459e042f4..293e0f9f4e 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -157,7 +157,7 @@ Change const BufferView::getCurrentChange() return pimpl_->getCurrentChange(); } - + void BufferView::beforeChange(LyXText * text) { pimpl_->beforeChange(text); diff --git a/src/BufferView.h b/src/BufferView.h index b2261ff69f..77aff425ef 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -104,7 +104,7 @@ public: void restorePosition(unsigned int i); /// does the given bookmark have a saved position ? bool isSavedPosition(unsigned int i); - + /// return the current change at the cursor Change const getCurrentChange(); diff --git a/src/ChangeLog b/src/ChangeLog index 2bb76a43a1..78521d1a22 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2003-03-04 Lars Gullik Bjønnes + * several files: ws changes only + * paragraph_funcs.C (TeXOnePar): take ParagraphList::iterator as args (TeXEnvironment): ditto (TeXDeeper): ditto diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index f9ba675a22..78dddda128 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -55,7 +55,7 @@ extern BufferView * current_view; namespace { -// FIXME: stupid name +// FIXME: stupid name Paragraph * buf = 0; textclass_type textclass = 0; @@ -99,27 +99,27 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar, } return true; } - + bool actually_erased = false; - + // clear end/begin fragments of the first/last par in selection actually_erased |= (startpar)->erase(start, startpar->size()); if ((*endpar)->erase(0, end)) { - actually_erased = true; + actually_erased = true; end = 0; } - + // Loop through the deleted pars if any, erasing as needed - + Paragraph * pit = startpar->next(); - + while (1) { // *endpar can be 0 if (!pit) break; - + Paragraph * next = pit->next(); - + // "erase" the contents of the par if (pit != *endpar) { actually_erased |= pit->erase(0, pit->size()); @@ -130,29 +130,29 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar, if (next) { next->previous(pit->previous()); } - + delete pit; } } - + if (pit == *endpar) break; - + pit = next; } -#if 0 // FIXME: why for cut but not copy ? +#if 0 // FIXME: why for cut but not copy ? // the cut selection should begin with standard layout if (realcut) { buf->params().clear(); buf->bibkey = 0; buf->layout(textclasslist[buffer->params.textclass].defaultLayoutName()); } -#endif +#endif if (!startpar->next()) return true; - + Buffer * buffer = current_view->buffer(); if (doclear) { @@ -161,7 +161,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar, if (!actually_erased) return true; - + // paste the paragraphs again, if possible if (startpar->hasSameLayout(startpar->next()) || startpar->next()->empty()) { @@ -173,7 +173,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar, return true; } - + bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar, int start, int end, char tc) { diff --git a/src/InsetList.C b/src/InsetList.C index dab5287baf..9547133383 100644 --- a/src/InsetList.C +++ b/src/InsetList.C @@ -19,7 +19,7 @@ struct MatchIt { /// used by lower_bound and upper_bound inline int operator()(InsetList::InsetTable const & a, - InsetList::InsetTable const & b) const + InsetList::InsetTable const & b) const { return a.pos < b.pos; } diff --git a/src/LaTeX.C b/src/LaTeX.C index 5995025dee..69f46d63f2 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -79,7 +79,7 @@ void showRunMessage(LyXFunc * lf, unsigned int count) lf->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str()))); } - + }; /* * CLASS TEXERRORS @@ -213,7 +213,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) ++count; lyxerr[Debug::LATEX] << "Run #" << count << endl; if (lfun) { - showRunMessage(lfun, count); + showRunMessage(lfun, count); } this->operator()(); diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 6fdec55cb2..86c79e2485 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -113,7 +113,7 @@ string const MenuItem::binding() const { if (kind_ != Command) return string(); - + // Get the keys bound to this action, but keep only the // first one later string bindings = toplevel_keymap->findbinding(action_); @@ -131,7 +131,7 @@ Menu & Menu::add(MenuItem const & i, LyXView const * view) items_.push_back(i); return *this; } - + switch (i.kind()) { case MenuItem::Command: { @@ -173,7 +173,7 @@ Menu & Menu::add(MenuItem const & i, LyXView const * view) break; default: items_.push_back(i); - } + } return *this; } diff --git a/src/MenuBackend.h b/src/MenuBackend.h index 136814ad80..c768623d4b 100644 --- a/src/MenuBackend.h +++ b/src/MenuBackend.h @@ -89,11 +89,11 @@ public: /// returns true if the entry should be ommited when disabled bool optional() const { return optional_; } /// returns the status of the lfun associated with this entry - FuncStatus const & status() const { return status_; } + FuncStatus const & status() const { return status_; } /// returns the status of the lfun associated with this entry - FuncStatus & status() { return status_; } + FuncStatus & status() { return status_; } /// returns the status of the lfun associated with this entry - void status(FuncStatus const & status) { status_ = status; } + void status(FuncStatus const & status) { status_ = status; } /// returns the binding associated to this action string const binding() const; /// the description of the submenu (if relevant) diff --git a/src/author.h b/src/author.h index d362d7f9d5..2764923d13 100644 --- a/src/author.h +++ b/src/author.h @@ -15,11 +15,11 @@ #include #include "LString.h" - + class Author { public: Author() {} - + Author(string n, string e) : name_(n), email_(e) {} @@ -30,7 +30,7 @@ public: string const email() const { return email_; } - + friend std::istream & operator>>(std::istream & os, Author & a); private: @@ -38,18 +38,18 @@ private: string email_; }; - + class AuthorList { public: int record(Author const & a); void record(int id, Author const & a); - + Author const & get(int id); typedef std::map Authors; - + Authors::const_iterator begin() const; Authors::const_iterator end() const; @@ -57,11 +57,11 @@ public: private: Authors authors_; }; - + bool operator==(Author const & l, Author const & r); - -std::ostream & operator<<(std::ostream & os, Author const & a); - -std::istream & operator>>(std::istream & os, Author & a); - + +std::ostream & operator<<(std::ostream & os, Author const & a); + +std::istream & operator>>(std::istream & os, Author & a); + #endif // AUTHOR_H diff --git a/src/bufferlist.C b/src/bufferlist.C index a68a8a9adf..0739d30c39 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -145,7 +145,7 @@ Buffer * BufferList::newBuffer(string const & s, bool ronly) bstore.push_back(tmpbuf); return tmpbuf; } - + void BufferList::closeAll() { diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index 58ed8fdaf1..4ed3413732 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -169,7 +169,7 @@ string const currentState(BufferView * bv) state << _(" at ") << ctime(&change.changetime); state << " : "; } - + // I think we should only show changes from the default // font. (Asger) LyXFont font = text->real_current_font; diff --git a/src/changes.C b/src/changes.C index 3f827db07d..c97ec91703 100644 --- a/src/changes.C +++ b/src/changes.C @@ -9,34 +9,34 @@ */ #include - -#include "changes.h" + +#include "changes.h" #include "debug.h" #include "author.h" - + #include "support/LAssert.h" #include "support/LOstream.h" - + using std::vector; using std::endl; using lyx::pos_type; - + bool operator==(Change const & l, Change const & r) { return l.type == r.type && l.author == r.author && l.changetime == r.changetime; } - + bool operator!=(Change const & l, Change const & r) { return !(l == r); } - + bool operator==(Changes::Range const & r1, Changes::Range const & r2) { - return r1.start == r2.start && r1.end == r2.end; + return r1.start == r2.start && r1.end == r2.end; } @@ -44,8 +44,8 @@ bool operator!=(Changes::Range const & r1, Changes::Range const & r2) { return !(r1 == r2); } - - + + bool Changes::Range::contains(Range const & r) const { return r.start >= start && r.end <= end; @@ -56,27 +56,27 @@ bool Changes::Range::contained(Range const & r) const { return r.contains(*this); } - + bool Changes::Range::contains(pos_type pos) const { return pos >= start && pos < end; } - + bool Changes::Range::loose_contains(pos_type pos) const { return pos >= start && pos <= end; } - + bool Changes::Range::intersects(Range const & r) const { return contained(r) || contains(r) || contains(r.start) || contains(r.end); } - - + + Changes::Changes(Change::Type type) : empty_type_(type) { @@ -119,19 +119,19 @@ void Changes::set(Change change, pos_type pos) set(change, pos, pos + 1); } - + void Changes::set(Change::Type type, pos_type pos) { set(type, pos, pos + 1); } - + void Changes::set(Change::Type type, pos_type start, pos_type end) { set(Change(type), start, end); } - + void Changes::set(Change change, pos_type start, pos_type end) { ChangeTable::iterator it = table_.begin(); @@ -139,9 +139,9 @@ void Changes::set(Change change, pos_type start, pos_type end) lyxerr[Debug::CHANGES] << "changeset of " << change.type << " author " << change.author << " time " << change.changetime << " in range " << start << "," << end << endl; - + Range const new_range(start, end); - + // remove all sub-ranges for (; it != table_.end();) { if (new_range != it->range && it->range.contained(new_range)) { @@ -176,11 +176,11 @@ void Changes::set(Change change, pos_type start, pos_type end) } ChangeRange c(*it); - + lyxerr[Debug::CHANGES] << "Using change of type " << c.change.type << " over " << c.range.start << "," << c.range.end << endl; - - // split head + + // split head if (c.range.start < start) { it = table_.insert(it, ChangeRange(c.range.start, start, c.change)); lyxerr[Debug::CHANGES] << "Splitting head of type " << c.change.type @@ -193,7 +193,7 @@ void Changes::set(Change change, pos_type start, pos_type end) it->range.end = end; it->change = change; lyxerr[Debug::CHANGES] << "Resetting to new change" << endl; - + // split tail if (c.range.end > end) { ++it; @@ -213,13 +213,13 @@ void Changes::erase(pos_type pos) ChangeTable::iterator end = table_.end(); bool found = false; - + for (; it != end; ++it) { Range & range(it->range); - + lyxerr[Debug::CHANGES] << "era:Range of type " << it->change.type << " is " - << it->range.start << "," << it->range.end << endl; - + << it->range.start << "," << it->range.end << endl; + if (range.contains(pos)) { found = true; --range.end; @@ -231,7 +231,7 @@ void Changes::erase(pos_type pos) --range.end; } } - check(); + check(); merge(); } @@ -243,12 +243,12 @@ void Changes::del(Change change, ChangeTable::size_type pos) set(change, pos); return; } - + ChangeTable::iterator it = table_.begin(); for (; it != table_.end(); ++it) { Range & range(it->range); - + if (range.contains(pos)) { if (it->change.type != Change::INSERTED) { set(change, pos); @@ -264,21 +264,21 @@ void Changes::del(Change change, ChangeTable::size_type pos) } } - + void Changes::add(Change change, ChangeTable::size_type pos) { ChangeTable::iterator it = table_.begin(); ChangeTable::iterator end = table_.end(); bool found = false; - + for (; it != end; ++it) { Range & range(it->range); - + if (!found && range.loose_contains(pos)) { found = true; lyxerr[Debug::CHANGES] << "Found range of " - << range.start << "," << range.end << endl; + << range.start << "," << range.end << endl; ++range.end; continue; } @@ -291,14 +291,14 @@ void Changes::add(Change change, ChangeTable::size_type pos) set(change, pos); } - + Change const Changes::lookupFull(pos_type pos) const { if (!table_.size()) { lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl; return Change(empty_type_); } - + ChangeTable::const_iterator it = table_.begin(); ChangeTable::const_iterator end = table_.end(); @@ -306,12 +306,12 @@ Change const Changes::lookupFull(pos_type pos) const if (it->range.contains(pos)) return it->change; } - + check(); lyx::Assert(0); return Change(Change::UNCHANGED); } - + Change::Type Changes::lookup(pos_type pos) const { @@ -319,7 +319,7 @@ Change::Type Changes::lookup(pos_type pos) const lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl; return empty_type_; } - + ChangeTable::const_iterator it = table_.begin(); ChangeTable::const_iterator end = table_.end(); @@ -327,7 +327,7 @@ Change::Type Changes::lookup(pos_type pos) const if (it->range.contains(pos)) return it->change.type; } - + check(); lyx::Assert(0); return Change::UNCHANGED; @@ -340,14 +340,14 @@ bool Changes::isChange(pos_type start, pos_type end) const lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl; return empty_type_ != Change::UNCHANGED; } - + ChangeTable::const_iterator it = table_.begin(); ChangeTable::const_iterator itend = table_.end(); for (; it != itend; ++it) { lyxerr[Debug::CHANGES] << "Looking for " << start << "," - << end << " in " << it->range.start << "," - << it->range.end << "of type " << it->change.type << endl; + << end << " in " << it->range.start << "," + << it->range.end << "of type " << it->change.type << endl; if (it->range.intersects(Range(start, end)) && it->change.type != Change::UNCHANGED) { lyxerr[Debug::CHANGES] << "Found intersection of " @@ -357,18 +357,18 @@ bool Changes::isChange(pos_type start, pos_type end) const return true; } } - + return false; } - + bool Changes::isChangeEdited(lyx::pos_type start, lyx::pos_type end) const { if (!table_.size()) { lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl; return empty_type_ != Change::INSERTED; } - + ChangeTable::const_iterator it = table_.begin(); ChangeTable::const_iterator itend = table_.end(); @@ -376,12 +376,12 @@ bool Changes::isChangeEdited(lyx::pos_type start, lyx::pos_type end) const if (it->range.intersects(Range(start, end ? end - 1 : 0)) && it->change.type != Change::INSERTED) { return true; - } - } + } + } return false; } - + void Changes::merge() { lyxerr[Debug::CHANGES] << "Starting merge" << endl; @@ -389,8 +389,8 @@ void Changes::merge() while (it != table_.end()) { lyxerr[Debug::CHANGES] << "Range of type " << it->change.type << " is " - << it->range.start << "," << it->range.end << endl; - + << it->range.start << "," << it->range.end << endl; + if (it->range.start == it->range.end) { lyxerr[Debug::CHANGES] << "Removing empty range for pos " << it->range.start << endl; @@ -399,15 +399,15 @@ void Changes::merge() it = table_.begin(); continue; } - + if (it + 1 == table_.end()) break; - + if (it->change == (it + 1)->change) { lyxerr[Debug::CHANGES] << "Merging equal ranges " << it->range.start << "," << it->range.end << " and " << (it + 1)->range.start << "," - << (it + 1)->range.end << endl; + << (it + 1)->range.end << endl; (it + 1)->range.start = it->range.start; table_.erase(it); // start again @@ -417,24 +417,24 @@ void Changes::merge() ++it; } - + lyxerr[Debug::CHANGES] << "Merge ended" << endl; check(); } - + void Changes::check() const { ChangeTable::const_iterator it = table_.begin(); ChangeTable::const_iterator end = table_.end(); bool dont_assert(true); - + lyxerr[Debug::CHANGES] << "Changelist:" << endl; for (; it != end; ++it) { lyxerr[Debug::CHANGES] << "Range of type " << it->change.type << " is " << it->range.start << "," << it->range.end << " author " - << it->change.author << " time " << it->change.changetime << endl; + << it->change.author << " time " << it->change.changetime << endl; if (it + 1 == end) break; @@ -443,13 +443,13 @@ void Changes::check() const if (range.end != next.start) dont_assert = false; } - lyxerr[Debug::CHANGES] << "End" << endl; + lyxerr[Debug::CHANGES] << "End" << endl; lyx::Assert(dont_assert); } - + int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type change) -{ +{ if (old == change) return 0; @@ -457,14 +457,14 @@ int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type c string const end("\\changeend{}"); string const son("\\overstrikeon{}"); string const soff("\\overstrikeoff{}"); - + int column = 0; - + if (old == Change::DELETED) { os << soff; column += soff.length(); } - + switch (change) { case Change::UNCHANGED: os << end; @@ -487,7 +487,7 @@ int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type c } break; } - + return column; } @@ -499,7 +499,7 @@ void Changes::lyxMarkChange(std::ostream & os, int & column, lyx::time_type curt return; column = 0; - + switch (change.type) { case Change::UNCHANGED: os << "\n\\change_unchanged\n"; @@ -511,7 +511,7 @@ void Changes::lyxMarkChange(std::ostream & os, int & column, lyx::time_type curt t = curtime; os << "\n\\change_deleted " << change.author << " " << t << "\n"; - + break; } diff --git a/src/format.C b/src/format.C index 79cfdf78b6..e3ad3f0503 100644 --- a/src/format.C +++ b/src/format.C @@ -43,11 +43,11 @@ bool operator<(Format const & a, Format const & b) } Format::Format(string const & n, string const & e, string const & p, - string const & s, string const & v): name_(n), - extension_(e), - prettyname_(p), + string const & s, string const & v): name_(n), + extension_(e), + prettyname_(p), shortcut_(s), - viewer_(v) + viewer_(v) {} diff --git a/src/funcrequest.C b/src/funcrequest.C index 7b486f199f..28007f08e6 100644 --- a/src/funcrequest.C +++ b/src/funcrequest.C @@ -112,7 +112,7 @@ void split(vector & args, string str) char c; string s; is >> c; - if (c == '"') + if (c == '"') getline(is, s, '"'); else { is.putback(c); diff --git a/src/graph.C b/src/graph.C index c31861588a..6c7ef87476 100644 --- a/src/graph.C +++ b/src/graph.C @@ -194,5 +194,3 @@ void Graph::addEdge(int s, int t) } vector Graph::vertices_; - - diff --git a/src/graph.h b/src/graph.h index e7c4ac60b9..d8cc03498b 100644 --- a/src/graph.h +++ b/src/graph.h @@ -19,7 +19,7 @@ #include class Graph { -public: +public: Graph() : numedges_(0) {}; /// typedef std::vector EdgePath; diff --git a/src/ispell.C b/src/ispell.C index a4f91c517d..4cd221f182 100644 --- a/src/ispell.C +++ b/src/ispell.C @@ -183,7 +183,7 @@ ISpell::ISpell(BufferParams const & params, string const & lang) // static due to the setvbuf. Ugly. static char o_buf[BUFSIZ]; - + // We need to throw an exception not do this pipein[0] = pipein[1] = pipeout[0] = pipeout[1] = pipeerr[0] = pipeerr[1] = -1; @@ -232,7 +232,7 @@ ISpell::ISpell(BufferParams const & params, string const & lang) child_.reset(li); if (li->start() == -1) { error_ = _("Could not create an ispell process.\nYou may not have " - " the right languages installed."); + " the right languages installed."); child_.reset(0); return; } diff --git a/src/lyxfind.C b/src/lyxfind.C index 598ce0e1ac..781377babf 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -310,7 +310,7 @@ SearchResult SearchBackward(BufferView * bv, LyXText * text, } } - + SearchResult nextChange(BufferView * bv, LyXText * text, pos_type & length) { Paragraph * par = text->cursor.par(); @@ -363,8 +363,8 @@ SearchResult nextChange(BufferView * bv, LyXText * text, pos_type & length) return SR_NOT_FOUND; } } - - + + SearchResult findNextChange(BufferView * bv, LyXText * text, pos_type & length) { if (text->selection.set()) @@ -386,15 +386,15 @@ bool findNextChange(BufferView * bv) bv->update(bv->getLyXText(), BufferView::SELECT | BufferView::FITCUR); pos_type length; - + if (bv->theLockingInset()) { bool found = bv->theLockingInset()->nextChange(bv, length); - + // We found the stuff inside the inset so we don't have to // do anything as the inset did all the update for us! if (found) return true; - + // We now are in the main text but if we did a forward // search we have to put the cursor behind the inset. bv->text->cursorRight(bv, true); @@ -409,13 +409,13 @@ bool findNextChange(BufferView * bv) bv->toggleSelection(); text->clearSelection(); - + SearchResult result = nextChange(bv, text, length); lyxerr << "Result is " << result << endl; - + bool found = true; - + // If we found the cursor inside an inset we will get back // SR_FOUND_NOUPDATE and we don't have to do anything as the // inset did it already. @@ -433,5 +433,5 @@ bool findNextChange(BufferView * bv) return found; } - + } // end lyxfind namespace diff --git a/src/lyxfind.h b/src/lyxfind.h index 03a70e3408..5177e8f6cb 100644 --- a/src/lyxfind.h +++ b/src/lyxfind.h @@ -48,11 +48,11 @@ SearchResult LyXFind(BufferView *, LyXText * text, /// find the next change in the buffer bool findNextChange(BufferView * bv); - + SearchResult findNextChange(BufferView * bv, LyXText * text, lyx::pos_type & length); - + SearchResult nextChange(BufferView * bv, LyXText * text, lyx::pos_type & length); - + } // end namespace LyXFind - + #endif // LYXFIND_H diff --git a/src/lyxrc.C b/src/lyxrc.C index d3170f7c0f..b59080a5c1 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -263,9 +263,9 @@ void LyXRC::setDefaults() { // should be moved from the LyXRC class). use_gui = true; pdf_mode = false; - + user_name = lyx::user_name(); - + user_email = lyx::user_email(); if (user_email.empty()) @@ -1109,7 +1109,7 @@ int LyXRC::read(string const & filename) if (lexrc.next()) user_email = lexrc.getString(); break; - + case RC_LAST: break; // this is just a dummy } } diff --git a/src/lyxrow.C b/src/lyxrow.C index e5cb15826f..7351b7f248 100644 --- a/src/lyxrow.C +++ b/src/lyxrow.C @@ -93,13 +93,13 @@ void Row::top_of_text(unsigned int top) top_of_text_ = top; } - + unsigned int Row::top_of_text() const { return top_of_text_; } - + void Row::baseline(unsigned int b) { baseline_ = b; diff --git a/src/lyxrow.h b/src/lyxrow.h index ab94db1a4c..fb53c7d454 100644 --- a/src/lyxrow.h +++ b/src/lyxrow.h @@ -77,14 +77,14 @@ public: lyx::pos_type lastPos() const; /// return the position of the last normal, printable character in this row lyx::pos_type lastPrintablePos() const; - + /** * Returns the number of separators. * The separator on the very last column doesnt count. */ int numberOfSeparators() const; - /** + /** * Returns the number of hfills. It works like a LaTeX \hfill: * the hfills at the beginning and at the end are ignored. * This is much more useful than not to ignore! diff --git a/src/lyxtext.h b/src/lyxtext.h index 7fc88c31ea..84ae9e2e2d 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -281,9 +281,9 @@ public: /// accept selected change void acceptChange(BufferView * bv); - /// reject selected change + /// reject selected change void rejectChange(BufferView * bv); - + /** 'selects" the next word, where the cursor is not in and returns this word as string. THe cursor will be moved to the beginning of this word. diff --git a/src/rowpainter.C b/src/rowpainter.C index 31c3df5130..287832afa3 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -249,10 +249,10 @@ void RowPainter::paintChars(pos_type & vpos, bool hebrew, bool arabic) unsigned char c = str[0]; str[0] = transformChar(c, pos); } - + bool prev_struckout(isDeletedText(par_, pos)); bool prev_newtext(isInsertedText(par_, pos)); - + ++vpos; // collect as much similar chars as we can @@ -264,10 +264,10 @@ void RowPainter::paintChars(pos_type & vpos, bool hebrew, bool arabic) if (prev_struckout != isDeletedText(par_, pos)) break; - + if (prev_newtext != isInsertedText(par_, pos)) break; - + if (arabic && Encodings::IsComposeChar_arabic(c)) break; if (hebrew && Encodings::IsComposeChar_hebrew(c)) @@ -525,17 +525,17 @@ void RowPainter::paintChangeBar() pos_type const start = row_.pos(); pos_type const end = row_.lastPrintablePos(); - if (!par_.isChanged(start, end)) + if (!par_.isChanged(start, end)) return; - + int const height = (row_.next() - ? row_.height() + row_.next()->top_of_text() + ? row_.height() + row_.next()->top_of_text() : row_.baseline()); - + pain_.fillRectangle(4, yo_, 5, height, LColor::changebar); } - + void RowPainter::paintAppendix() { // FIXME: can be just width_ ? @@ -628,7 +628,7 @@ int RowPainter::paintLengthMarker(string const & prefix, VSpace const & vsp, int } else { // adding or removing space bool const added = vsp.kind() != VSpace::LENGTH || - vsp.length().len().value() > 0.0; + vsp.length().len().value() > 0.0; ty1 = added ? (start + arrow_size) : start; ty2 = added ? start : (start + arrow_size); by1 = added ? (end - arrow_size) : end; @@ -942,26 +942,26 @@ bool RowPainter::paintText() bool running_strikeout = false; bool is_struckout = false; float last_strikeout_x = 0.0; - + pos_type vpos = row_.pos(); while (vpos <= last) { if (x_ > bv_.workWidth()) break; pos_type pos = text_.vis2log(vpos); - + if (x_ + singleWidth(pos) < 0) { x_ += singleWidth(pos); ++vpos; continue; } - + is_struckout = isDeletedText(par_, pos); if (is_struckout && !running_strikeout) { running_strikeout = true; last_strikeout_x = x_; } - + bool const highly_editable_inset = par_.isInset(pos) && isHighlyEditableInset(par_.getInset(pos)); @@ -974,7 +974,7 @@ bool RowPainter::paintText() LColor::strikeout, Painter::line_solid, Painter::line_thin); running_strikeout = false; } - + if (main_body > 0 && pos == main_body - 1) { int const lwidth = font_metrics::width(layout->labelsep, getLabelFont()); @@ -1021,10 +1021,10 @@ bool RowPainter::paintText() ++vpos; } else { if (paintFromPos(vpos)) - return true; + return true; } } - + // if we reach the end of a struck out range, paint it if (running_strikeout) { int const middle = yo_ + row_.top_of_text() @@ -1073,7 +1073,7 @@ bool RowPainter::paint(int y_offset, int x_offset, int y, bool cleared) // changebar paintChangeBar(); - + if (row_.isParStart()) { paintFirst(); } -- 2.39.2