#include "support/docstring.h"
#include <map>
-#include <iosfwd>
namespace lyx {
-
class Author {
public:
+ ///
Author() {}
-
+ ///
Author(docstring const & name, docstring const & email)
: name_(name), email_(email), used_(true) {}
-
- docstring const name() const {
- return name_;
- }
-
- docstring const email() const {
- return email_;
- }
-
- void used(bool u) const {
- used_ = u;
- }
-
- bool used() const {
- return used_;
- }
-
+ ///
+ docstring name() const { return name_; }
+ ///
+ docstring email() const { return email_; }
+ ///
+ void setUsed(bool u) const { used_ = u; }
+ ///
+ bool used() const { return used_; }
+ ///
friend std::istream & operator>>(std::istream & os, Author & a);
private:
+ /// The author's name
docstring name_;
-
+ /// The author's email address
docstring email_;
-
+ ///
mutable bool used_;
};
class AuthorList {
public:
+ ///
AuthorList();
-
+ ///
int record(Author const & a);
-
+ ///
void record(int id, Author const & a);
-
+ ///
Author const & get(int id) const;
-
+ ///
typedef std::map<int, Author> Authors;
-
+ ///
Authors::const_iterator begin() const;
-
+ ///
Authors::const_iterator end() const;
-
+ ///
private:
+ ///
int last_id_;
-
+ ///
Authors authors_;
};
#include "insets/InsetInclude.h"
#include "support/lstrings.h"
+#include "support/docstream.h"
#include "boost/regex.hpp"
#include "Bidi.h"
#include "Buffer.h"
#include "BufferView.h"
+#include "Cursor.h"
#include "Font.h"
#include "Row.h"
#include "LyXRC.h"
new_level = rtl_par ? 1 : 0;
new_rtl0 = rtl_par;
new_rtl = rtl_par;
- } else if (new_rtl0)
+ } else if (new_rtl0) {
new_level = new_rtl ? 1 : 2;
- else
+ } else {
new_level = rtl_par ? 2 : 0;
+ }
if (is_space && new_level >= lev) {
new_level = lev;
log2vis_list_[lpos - start_] = rtl ? -1 : 1;
if (new_level > 0 && !rtl_par)
same_direction_ = false;
- } else
+ } else {
log2vis_list_[lpos - start_] = new_rtl ? -1 : 1;
+ }
rtl = new_rtl;
rtl0 = new_rtl0;
levels_[lpos - start_] = new_level;
#define BIDI_H
#include "support/types.h"
-#include "Cursor.h"
+
#include <vector>
namespace lyx {
class Buffer;
+class Cursor;
class Paragraph;
class Row;
class Font;
#ifndef BOX_H
#define BOX_H
-#include <iosfwd>
+#include "support/strfwd.h"
namespace lyx {
}
-pair<Buffer::LogType, string> Buffer::logName() const
+string Buffer::logName(LogType * type) const
{
string const filename = latexName(false);
- if (filename.empty())
- return make_pair(Buffer::latexlog, string());
+ if (filename.empty()) {
+ if (type)
+ *type = latexlog;
+ return string();
+ }
string const path = temppath();
if (bname.exists() &&
(!fname.exists() || fname.lastModified() < bname.lastModified())) {
LYXERR(Debug::FILES) << "Log name calculated as: " << bname << endl;
- return make_pair(Buffer::buildlog, bname.absFilename());
+ if (type)
+ *type = buildlog;
+ return bname.absFilename();
}
LYXERR(Debug::FILES) << "Log name calculated as: " << fname << endl;
- return make_pair(Buffer::latexlog, fname.absFilename());
+ if (type)
+ *type = latexlog;
+ return fname.absFilename();
}
AuthorList::Authors::const_iterator a_it = params().authors().begin();
AuthorList::Authors::const_iterator a_end = params().authors().end();
for (; a_it != a_end; ++a_it)
- a_it->second.used(false);
+ a_it->second.setUsed(false);
ParIterator const end = par_iterator_end();
ParIterator it = par_iterator_begin();
#include "insets/InsetCode.h"
#include "support/FileName.h"
-#include "support/docstring.h"
-#include "support/docstream.h"
+#include "support/strfwd.h"
#include "support/types.h"
-#include <iosfwd>
#include <string>
-#include <utility>
#include <vector>
std::string latexName(bool no_path = true) const;
/// Get thee name and type of the log.
- std::pair<LogType, std::string> logName() const;
+ std::string logName(LogType * type = 0) const;
/// Change name of buffer. Updates "read-only" flag.
void setFileName(std::string const & newfile);
#include "insets/InsetListingsParams.h"
#include "support/convert.h"
+#include "support/docstream.h"
#include "support/filetools.h"
#include "support/Translator.h"
#include "support/lstrings.h"
bool Change::isSimilarTo(Change const & change)
{
- if (type != change.type) {
+ if (type != change.type)
return false;
- }
- if (type == Change::UNCHANGED) {
+ if (type == Change::UNCHANGED)
return true;
- }
return author == change.author;
}
bool operator==(Change const & l, Change const & r)
{
- if (l.type != r.type) {
+ if (l.type != r.type)
return false;
- }
// two changes of type UNCHANGED are always equal
- if (l.type == Change::UNCHANGED) {
+ if (l.type == Change::UNCHANGED)
return true;
- }
- return l.author == r.author &&
- l.changetime == r.changetime;
+ return l.author == r.author && l.changetime == r.changetime;
}
}
// new change precedes existing change
- if (it->range.start >= end) {
+ if (it->range.start >= end)
break;
- }
// new change intersects with existing change
it->range.start = end;
for (; it != end; ++it) {
// range (pos,pos+x) becomes (pos,pos+x-1)
- if (it->range.start > pos) {
+ if (it->range.start > pos)
--(it->range.start);
- }
// range (pos-x,pos) stays (pos-x,pos)
- if (it->range.end > pos) {
+ if (it->range.end > pos)
--(it->range.end);
- }
}
merge();
for (; it != end; ++it) {
// range (pos,pos+x) becomes (pos+1,pos+x+1)
- if (it->range.start >= pos) {
+ if (it->range.start >= pos)
++(it->range.start);
- }
// range (pos-x,pos) stays as it is
- if (it->range.end > pos) {
+ if (it->range.end > pos)
++(it->range.end);
- }
}
set(change, pos, pos + 1); // set will call merge
ChangeTable::const_iterator endit = table_.end();
for ( ; it != endit ; ++it)
if (it->change.type != Change::UNCHANGED)
- authorList.get(it->change.author).used(true);
+ authorList.get(it->change.author).setUsed(true);
}
} // namespace lyx
#ifndef CHANGES_H
#define CHANGES_H
-#include "support/docstream.h"
+#include "support/strfwd.h"
#include "support/types.h"
#include "support/lyxtime.h"
#include "FuncRequest.h"
-#include "support/docstream.h"
+#include "support/strfwd.h"
#include <boost/shared_ptr.hpp>
#include <map>
+#include <string>
namespace lyx {
// we can't move into anything new during selection
if (depth() >= anchor_.depth())
return false;
- if (!ptr_cmp(t.nucleus(), &anchor_[depth()].inset()))
+ if (t.nucleus() != &anchor_[depth()].inset())
return false;
return true;
#include "Font.h"
#include "Undo.h"
-#include <iosfwd>
#include <vector>
#define CURSORSLICE_H
#include "support/types.h"
+#include "support/strfwd.h"
#include "insets/Inset.h"
-#include <cstddef>
-#include <iosfwd>
-
namespace lyx {
#include "CursorSlice.h"
#include <vector>
-#include <iosfwd>
namespace lyx {
class Paragraph;
-// only needed for gcc 2.95, remove when support terminated
-template <typename A, typename B>
-bool ptr_cmp(A const * a, B const * b)
-{
- return a == b;
-}
-
-
// The public inheritance should go in favour of a suitable data member
// (or maybe private inheritance) at some point of time.
class DocIterator // : public std::vector<CursorSlice>
#include "ColorCode.h"
#include "FontInfo.h"
-#include "support/docstream.h"
+#include "support/strfwd.h"
namespace lyx {
class TextMetrics;
-class FontIterator : std::iterator<std::forward_iterator_tag, Font>
+class FontIterator
{
public:
///
#include "support/docstring.h"
-#include <iosfwd>
-
namespace lyx {
#include "LyXAction.h"
#include "Lexer.h"
+#include "support/docstream.h"
#include "support/filetools.h"
#include <fstream>
#include "frontends/KeyModifier.h"
#include "frontends/KeySymbol.h"
-#include "support/docstream.h"
+#include "support/strfwd.h"
#include <boost/shared_ptr.hpp>
#include <boost/tuple/tuple.hpp>
#include "support/strfwd.h"
-#include <iosfwd>
-
namespace lyx {
}
}
else if (name == "latexlog")
- enable = FileName(buf->logName().second).isFileReadable();
+ enable = FileName(buf->logName()).isFileReadable();
else if (name == "spellchecker")
#if defined (USE_ASPELL) || defined (USE_ISPELL) || defined (USE_PSPELL)
enable = !buf->isReadonly();
if (!data.empty())
lyx_view_->getDialogs().show("character", data);
} else if (name == "latexlog") {
- pair<Buffer::LogType, string> const logfile =
- lyx_view_->buffer()->logName();
- switch (logfile.first) {
+ Buffer::LogType type;
+ string const logfile = lyx_view_->buffer()->logName(&type);
+ switch (type) {
case Buffer::latexlog:
data = "latex ";
break;
data = "literate ";
break;
}
- data += Lexer::quoteString(logfile.second);
+ data += Lexer::quoteString(logfile);
lyx_view_->getDialogs().show("log", data);
} else if (name == "vclog") {
string const data = "vc " +
#include "paper.h"
-#include <iosfwd>
+#include "support/strfwd.h"
+
#include <string>
public:
MenuNamesEqual(docstring const & name)
: name_(name) {}
- bool operator()(Menu const & menu) const
- {
+ bool operator()(Menu const & menu) const {
return menu.name() == name_;
}
private:
///
typedef ItemList::size_type size_type;
///
- explicit Menu(docstring const & name = docstring())
- : name_(name) {}
+ explicit Menu(docstring const & name = docstring()) : name_(name) {}
/// Add the menu item unconditionally
Menu & add(MenuItem const &);
/// Checks the associated FuncRequest status before adding the
///
bool hasFunc(FuncRequest const &) const;
///
- const_iterator begin() const {
- return items_.begin();
- }
+ const_iterator begin() const { return items_.begin(); }
///
- const_iterator end() const {
- return items_.end();
- }
+ const_iterator end() const { return items_.end(); }
// Check whether the menu shortcuts are unique
void checkShortcuts() const;
void expand(Menu const & frommenu, Menu & tomenu,
Buffer const *) const;
///
- const_iterator begin() const {
- return menulist_.begin();
- }
+ const_iterator begin() const { return menulist_.begin(); }
///
- iterator begin() {
- return menulist_.begin();
- }
+ iterator begin() { return menulist_.begin(); }
///
- const_iterator end() const {
- return menulist_.end();
- }
+ const_iterator end() const { return menulist_.end(); }
///
- iterator end() {
- return menulist_.end();
- }
+ iterator end() { return menulist_.end(); }
+
private:
///
MenuList menulist_;
} // namespace lyx
-#endif /* MENUBACKEND_H */
+#endif // MENUBACKEND_H
os << "\\pdf_quoted_options \"" << quoted_options << "\"\n";
}
-void PDFOptions::writeLaTeX(odocstringstream & os, bool hyper_required) const
+void PDFOptions::writeLaTeX(odocstream & os, bool hyper_required) const
{
if (!use_hyperref && !hyper_required)
return;
#ifndef PDFOPTIONS_H
#define PDFOPTIONS_H
-#include "support/docstream.h"
+#include "support/strfwd.h"
+
+#include <string>
namespace lyx {
/// output to lyx header
void writeFile(std::ostream &) const;
/// output to tex header
- void writeLaTeX(odocstringstream &, bool hyper_required) const;
+ void writeLaTeX(odocstream &, bool hyper_required) const;
/// read tokens from lyx header
std::string readToken(Lexer &lex, std::string const & token);
/// set implicit settings for hyperref
#include "support/strfwd.h"
#include "support/types.h"
-// FIXME: would be nice to forward declare odocstream instead of
-// including this:
-#include "support/docstream.h"
namespace lyx {
#include "support/types.h"
#include "support/docstring.h"
-#include <iosfwd>
-#include <string>
-
namespace lyx {
#include "tex2lyx/Spacing.h"
#else
-#include <iosfwd>
+#include "support/strfwd.h"
#include <string>
#include "insets/InsetSpecialChar.h"
#include "insets/InsetTabular.h"
+#include "support/docstream.h"
#include "support/lstrings.h"
#include "support/textutils.h"
#include "support/convert.h"
#include "ParIterator.h"
-#include "support/docstream.h"
+#include "support/strfwd.h"
namespace lyx {
///
typedef std::vector<TocItem> Toc;
typedef Toc::const_iterator TocIterator;
+
/// The ToC list.
/// A class and no typedef because we want to forward declare it.
-class TocList : public std::map<std::string, Toc>
-{
-};
+class TocList : public std::map<std::string, Toc> {};
///
#include "Paragraph.h"
#include "TexRow.h"
+#include "support/docstream.h"
+
#include <QTextCursor>
#include <QTextDocument>
#include <boost/tuple/tuple.hpp>
}
-Inset::Inset()
-{}
+docstring Inset::name() const
+{
+ return from_ascii("unknown");
+}
Dimension const Inset::dimension(BufferView const & bv) const
#include "ColorCode.h"
#include "InsetCode.h"
-#include "Dimension.h"
+#include "support/strfwd.h"
-#include "support/docstream.h"
-
-#include <memory>
#include <vector>
namespace lyx {
class Change;
class Cursor;
class CursorSlice;
+class Dimension;
class FuncRequest;
class FuncStatus;
class InsetIterator;
virtual bool hasFixedWidth() const { return false; }
///
- virtual docstring name() const { return from_ascii("unknown"); }
+ virtual docstring name() const;
///
virtual InsetLayout const & getLayout(BufferParams const & bp) const;
/// used to toggle insets
/// pit is the ParConstIterator of the paragraph containing the inset
virtual void addToToc(TocList &, Buffer const &, ParConstIterator const &) const {}
/// report files that can be embedded with the lyx file
- virtual void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const {};
+ virtual void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const {}
/// use embedded or external file after the embedding status of a file is changed
virtual void updateEmbeddedFile(Buffer const &, EmbeddedFile const &) {}
/// Fill keys with BibTeX information
virtual void fillWithBibKeys(Buffer const &,
- BiblioInfo &, InsetIterator const &) const { return; }
+ BiblioInfo &, InsetIterator const &) const {}
/// Update the counters of this inset and of its contents
virtual void updateLabels(Buffer const &, ParIterator const &) {}
enum { TEXT_TO_INSET_OFFSET = 4 };
protected:
- Inset();
+ Inset() {}
/// replicate ourselves
friend class InsetList;
#include "support/lstrings.h"
#include "support/std_ostream.h"
+#include "support/docstream.h"
#include "support/convert.h"
#include "frontends/alert.h"
#include "support/ExceptionMessage.h"
+#include "support/docstream.h"
#include "support/filetools.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
#include "OutputParams.h"
#include "support/lstrings.h"
+#include "support/docstream.h"
#include "support/convert.h"
#include "BufferParams.h"
#include "MetricsInfo.h"
+#include <iostream>
namespace lyx {
bool InsetFootlike::insetAllowed(InsetCode code) const
{
- if (code == FOOT_CODE || code == MARGIN_CODE
- || code == FLOAT_CODE)
+ if (code == FOOT_CODE || code == MARGIN_CODE || code == FLOAT_CODE)
return false;
return InsetCollapsable::insetAllowed(code);
}
#include "frontends/alert.h"
#include "support/convert.h"
+#include "support/docstream.h"
#include "support/filetools.h"
#include "support/lyxlib.h" // sum
#include "support/lstrings.h"
// Calculate the options part of the command, we must do it to a string
// stream since we copied the code from createLatexParams() ;-)
- // FIXME: av: need to translate spec -> Docbook XSL spec (http://www.sagehill.net/docbookxsl/ImageSizing.html)
+ // FIXME: av: need to translate spec -> Docbook XSL spec
+ // (http://www.sagehill.net/docbookxsl/ImageSizing.html)
// Right now it only works with my version of db2latex :-)
odocstringstream options;
#include "OutputParams.h"
#include "support/lstrings.h"
-
-#include "support/std_ostream.h"
+#include "support/docstream.h"
namespace lyx {
if (!url.empty()) {
// the chars_url[] characters must be handled for both, url and href
for (int k = 0; k < 2; k++) {
- for (int i = 0, pos;
+ for (size_t i = 0, pos;
(pos = url.find(chars_url[k], i)) != string::npos;
i = pos + 2) {
url.replace(pos,1,backslash + chars_url[k]);
// handle the "\" character, but only when the following character
// is not also a "\", because "\\" is valid code
- for (int i = 0, pos;
+ for (size_t i = 0, pos;
(pos = name.find("\\", i)) != string::npos;
i = pos + 2) {
if (name[pos+1] != '\\')
name.replace(pos,1,"\\textbackslash{}");
}
for (int k = 0; k < 6; k++) {
- for (int i = 0, pos;
+ for (size_t i = 0, pos;
(pos = name.find(chars_name[k], i)) != string::npos;
i = pos + 2) {
name.replace(pos,1,backslash + chars_name[k] + braces);
#include "insets/RenderPreview.h"
#include "insets/InsetListingsParams.h"
+#include "support/docstream.h"
#include "support/filetools.h"
#include "support/lstrings.h" // contains
#include "support/lyxalgo.h"
#include "MetricsInfo.h"
#include "ParagraphParameters.h"
#include "TextClassList.h"
+
+#include "support/docstream.h"
#include "support/lstrings.h"
#include "support/ExceptionMessage.h"
#include "InsetLine.h"
#include "debug.h"
+#include "Dimension.h"
#include "Font.h"
#include "MetricsInfo.h"
#include "LaTeXFeatures.h"
#include "OutputParams.h"
#include "Text.h"
+#include "support/docstream.h"
+
#include "frontends/Painter.h"
#include "Language.h"
#include "MetricsInfo.h"
+#include "support/docstream.h"
#include "support/lstrings.h"
#include <sstream>
os << from_utf8(param_string) << "]\n";
}
lines += 4;
- os << code
- << "\n\\end{lstlisting}\n\\endgroup\n";
+ os << code << "\n\\end{lstlisting}\n\\endgroup\n";
lines += 3;
}
docstring InsetListings::getCaption(Buffer const & buf,
- OutputParams const & runparams) const
+ OutputParams const & runparams) const
{
if (paragraphs().empty())
return docstring();
#include "InsetNewline.h"
#include "debug.h"
+#include "Dimension.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
#include "MetricsInfo.h"
#include "sgml.h"
+#include "support/docstream.h"
+
namespace lyx {
#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "support/docstream.h"
#include "support/Translator.h"
#include <algorithm>
#include "debug.h"
#include "gettext.h"
+#include "support/docstream.h"
+
namespace lyx {
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
+#include "support/docstring.h"
#include "support/lstrings.h"
// Index of chars used for the quote. Index is [side, language]
int quote_index[2][6] = {
{ 2, 1, 0, 0, 3, 4 }, // "'',,<>"
- { 1, 1, 2, 1, 4, 3 } }; // "`'`'><"
+ { 1, 1, 2, 1, 4, 3 } // "`'`'><"
+};
// Corresponding LaTeX code, for double and single quotes.
-char const * const latex_quote_t1[2][5] =
-{ { "\\quotesinglbase ", "'", "`",
+char const * const latex_quote_t1[2][5] = {
+ { "\\quotesinglbase ", "'", "`",
"\\guilsinglleft{}", "\\guilsinglright{}" },
- { ",,", "''", "``", "<<", ">>" } };
+ { ",,", "''", "``", "<<", ">>" }
+};
-char const * const latex_quote_ot1[2][5] =
-{ { "\\quotesinglbase ", "'", "`",
+char const * const latex_quote_ot1[2][5] = {
+ { "\\quotesinglbase ", "'", "`",
"\\guilsinglleft{}", "\\guilsinglright{}" },
{ "\\quotedblbase ", "''", "``",
- "\\guillemotleft{}", "\\guillemotright{}" } };
+ "\\guillemotleft{}", "\\guillemotright{}" }
+};
-char const * const latex_quote_babel[2][5] =
-{ { "\\glq ", "'", "`", "\\flq{}", "\\frq{}" },
- { "\\glqq ", "''", "``", "\\flqq{}", "\\frqq{}" } };
+char const * const latex_quote_babel[2][5] = {
+ { "\\glq ", "'", "`", "\\flq{}", "\\frq{}" },
+ { "\\glqq ", "''", "``", "\\flqq{}", "\\frqq{}" }
+};
} // namespace anon
}
+docstring InsetQuotes::name() const
+{
+ return from_ascii("Quotes");
+}
+
+
void InsetQuotes::getPosition(char_type c)
{
// Decide whether left or right
switch (c) {
- case ' ': case '(': case '[':
+ case ' ':
+ case '(':
+ case '[':
side_ = LeftQ; // left quote
break;
default:
retdisp = docstring(1, 0x2018);
#endif
else
- retdisp = lyx::from_ascii(disp);
+ retdisp = from_ascii(disp);
// in french, spaces are added inside double quotes
if (times_ == DoubleQ && prefixIs(loclang->code(), "fr")) {
if (side_ == LeftQ)
retdisp += ' ';
else
- retdisp.insert(docstring::size_type(0), 1, ' ');
+ retdisp.insert(size_t(0), 1, ' ');
}
return retdisp;
&& lyxrc.fontenc != "T1") {
if (times_ == SingleQ)
switch (type) {
- case ',': features.require("quotesinglbase"); break;
+ case ',': features.require("quotesinglbase"); break;
case '<': features.require("guilsinglleft"); break;
case '>': features.require("guilsinglright"); break;
default: break;
\item etc.
\end{itemize}
*/
- explicit
- InsetQuotes(std::string const & str = "eld");
+ explicit InsetQuotes(std::string const & str = "eld");
/// Create the right quote inset after character c
InsetQuotes(char_type c, BufferParams const & params);
/// Direct access to inner/outer quotation marks
InsetQuotes(char_type c, quote_language l, quote_times t);
///
- docstring name() const { return from_ascii("Quotes"); }
+ docstring name() const;
///
void metrics(MetricsInfo &, Dimension &) const;
///
#include "OutputParams.h"
#include "sgml.h"
+#include "support/docstream.h"
#include "support/lstrings.h"
///
static bool isCompatibleCommand(std::string const & s);
protected:
+ ///
InsetRef(InsetRef const &);
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
- virtual Inset * clone() const {
- return new InsetRef(*this);
- }
+ ///
+ Inset * clone() const { return new InsetRef(*this); }
///
bool isLatex;
};
#include "InsetSpace.h"
#include "debug.h"
+#include "Dimension.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
{
- frontend::FontMetrics const & fm =
- theFontMetrics(mi.base.font);
+ frontend::FontMetrics const & fm = theFontMetrics(mi.base.font);
dim.asc = fm.maxAscent();
dim.des = fm.maxDescent();
#include "InsetSpecialChar.h"
#include "debug.h"
+#include "Dimension.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "TextMetrics.h"
#include "support/convert.h"
+#include "support/docstream.h"
#include "support/lstrings.h"
#include "frontends/alert.h"
if (!cur.selection())
return;
- if (!ptr_cmp(&cur.inset(), this))
+ if (&cur.inset() != this)
return;
//resetPos(cur);
#include "Buffer.h"
#include "Cursor.h"
+#include "Dimension.h"
#include "DispatchResult.h"
#include "FuncRequest.h"
#include "gettext.h"
#include "TocBackend.h"
#include "support/convert.h"
+#include "support/docstream.h"
namespace lyx {
#ifndef LFUNS_H
#define LFUNS_H
-#include <iosfwd>
+#include "support/strfwd.h"
namespace lyx {
#include "InsetMathComment.h"
#include "InsetMathDelim.h"
#include "InsetMathHull.h"
-//#include "InsetMathMBox.h"
#include "InsetMathRef.h"
#include "InsetMathScript.h"
#include "InsetMathSpace.h"
// to touch all (math)inset's draw() methods. Right now, we'll store
// absolute value, and make them here relative, only to make them
// absolute again when actually drawing the cursor. What a mess.
- BOOST_ASSERT(ptr_cmp(&sl.inset(), this));
+ BOOST_ASSERT(&sl.inset() == this);
MathData const & ar = sl.cell();
CoordCache const & coord_cache = bv.coordCache();
if (!coord_cache.getArrays().has(&ar)) {
bool InsetMathNest::idxNext(Cursor & cur) const
{
- BOOST_ASSERT(ptr_cmp(&cur.inset(), this));
+ BOOST_ASSERT(&cur.inset() == this);
if (cur.idx() == cur.lastidx())
return false;
++cur.idx();
bool InsetMathNest::idxPrev(Cursor & cur) const
{
- BOOST_ASSERT(ptr_cmp(&cur.inset(), this));
+ BOOST_ASSERT(&cur.inset() == this);
if (cur.idx() == 0)
return false;
--cur.idx();
bool InsetMathNest::idxFirst(Cursor & cur) const
{
- BOOST_ASSERT(ptr_cmp(&cur.inset(), this));
+ BOOST_ASSERT(&cur.inset() == this);
if (nargs() == 0)
return false;
cur.idx() = 0;
bool InsetMathNest::idxLast(Cursor & cur) const
{
- BOOST_ASSERT(ptr_cmp(&cur.inset(), this));
+ BOOST_ASSERT(&cur.inset() == this);
if (nargs() == 0)
return false;
cur.idx() = cur.lastidx();
Cursor & cur = bv.cursor();
if (!cur.selection())
return;
- if (!ptr_cmp(&cur.inset(), this))
+ if (&cur.inset() != this)
return;
// FIXME: hack to get position cache warm
#ifndef OUTPUT_DOCBOOK_H
#define OUTPUT_DOCBOOK_H
-#include "support/docstream.h"
+#include "support/strfwd.h"
namespace lyx {
#ifndef OUTPUT_PLAINTEXT_H
#define OUTPUT_PLAINTEXT_H
-#include "support/docstream.h"
+#include "support/strfwd.h"
namespace lyx {
#include <config.h>
-#include <boost/any.hpp>
-#include <boost/array.hpp>
-#include <boost/assert.hpp>
-#include <boost/crc.hpp>
-#include <boost/cregex.hpp>
-#include <boost/current_function.hpp>
-#include <boost/function.hpp>
-#include <boost/iterator/indirect_iterator.hpp>
-#include <boost/optional.hpp>
-#include <boost/regex.hpp>
-#include <boost/scoped_array.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/tokenizer.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/noncopyable.hpp>
-#include <boost/version.hpp>
-
#include <algorithm>
-#include <cerrno>
-#include <clocale>
-#include <cmath>
-#include <csignal>
-#include <cstddef>
-#include <cstdio>
-#include <cstdlib>
#include <deque>
#include <exception>
#include <fstream>
#include "OutputParams.h"
#include "Paragraph.h"
-#include "support/docstring.h"
+#include "support/docstream.h"
#include "support/lstrings.h"
#include "support/std_ostream.h"
#include "support/convert.h"
#define SGML_H
#include "support/types.h"
-#include "support/docstream.h"
-
-#include <iosfwd>
-#include <string>
-#include <utility>
-
+#include "support/docstring.h"
namespace lyx {
/// String type for storing the main text in UCS4 encoding
typedef std::basic_string<char_type> docstring;
+/// Creates a docstring from a C string of ASCII characters
+docstring const from_ascii(char const *);
+
+/// Creates a docstring from a std::string of ASCII characters
+docstring const from_ascii(std::string const &);
+
+/// Creates a std::string of ASCII characters from a docstring
+std::string const to_ascii(docstring const &);
+
+/// Creates a docstring from a UTF8 string. This should go eventually.
+docstring const from_utf8(std::string const &);
+
+/// Creates a UTF8 string from a docstring. This should go eventually.
+std::string const to_utf8(docstring const &);
+
+/// convert \p s from the encoding of the locale to ucs4.
+docstring const from_local8bit(std::string const & s);
+
+/**
+ * Convert \p s from ucs4 to the encoding of the locale.
+ * This may fail and throw an exception, the caller is expected to act
+ * appropriately.
+ */
+std::string const to_local8bit(docstring const & s);
+
+/// convert \p s from the encoding of the file system to ucs4.
+docstring const from_filesystem8bit(std::string const & s);
+
+/// convert \p s from ucs4 to the encoding of the file system.
+std::string const to_filesystem8bit(docstring const & s);
+
+/// normalize \p s to precomposed form c
+docstring const normalize_c(docstring const & s);
+
+/// Compare a docstring with a C string of ASCII characters
+bool operator==(docstring const &, char const *);
+
+/// Compare a C string of ASCII characters with a docstring
+inline bool operator==(char const * l, docstring const & r) { return r == l; }
+
+/// Compare a docstring with a C string of ASCII characters
+inline bool operator!=(docstring const & l, char const * r) { return !(l == r); }
+
+/// Compare a C string of ASCII characters with a docstring
+inline bool operator!=(char const * l, docstring const & r) { return !(r == l); }
+
+/// Concatenate a docstring and a C string of ASCII characters
+docstring operator+(docstring const &, char const *);
+
+/// Concatenate a C string of ASCII characters and a docstring
+docstring operator+(char const *, docstring const &);
+
+/// Concatenate a docstring and a single ASCII character
+docstring operator+(docstring const & l, char r);
+
+/// Concatenate a single ASCII character and a docstring
+docstring operator+(char l, docstring const & r);
+
+/// Append a C string of ASCII characters to a docstring
+docstring & operator+=(docstring &, char const *);
+
+/// Append a single ASCII character to a docstring
+docstring & operator+=(docstring & l, char r);
+
} // namespace lyx
#include <config.h>
#include "support/environment.h"
+
+#include "support/docstring.h"
#include "support/os.h"
#include <boost/tokenizer.hpp>
#include <config.h>
#include "support/lyxlib.h"
+#include "support/docstring.h"
#include "support/os.h"
#include <boost/scoped_array.hpp>
#ifndef STRFWD_H
#define STRFWD_H
-namespace std {
-
-template<typename Char> struct char_traits;
-template<> struct char_traits<char>;
-template<> struct char_traits<wchar_t>;
-
-template<typename Alloc> class allocator;
-
-template<typename Char, typename Traits, typename Alloc> class basic_string;
-
-typedef basic_string<char, char_traits<char>, allocator<char> > string;
-
-}
-
-
#ifdef USE_WCHAR_T
// Prefer this if possible because GNU libstdc++ has usable
#endif
-namespace lyx {
-
-typedef std::basic_string<char_type, std::char_traits<char_type>,
- std::allocator<char_type> > docstring;
-
-/// Creates a docstring from a C string of ASCII characters
-docstring const from_ascii(char const *);
-
-/// Creates a docstring from a std::string of ASCII characters
-docstring const from_ascii(std::string const &);
-
-/// Creates a std::string of ASCII characters from a docstring
-std::string const to_ascii(docstring const &);
-
-/// Creates a docstring from a UTF8 string. This should go eventually.
-docstring const from_utf8(std::string const &);
-
-/// Creates a UTF8 string from a docstring. This should go eventually.
-std::string const to_utf8(docstring const &);
-
-/// convert \p s from the encoding of the locale to ucs4.
-docstring const from_local8bit(std::string const & s);
-
-/**
- * Convert \p s from ucs4 to the encoding of the locale.
- * This may fail and throw an exception, the caller is expected to act
- * appropriately.
- */
-std::string const to_local8bit(docstring const & s);
+namespace std {
-/// convert \p s from the encoding of the file system to ucs4.
-docstring const from_filesystem8bit(std::string const & s);
+template<typename Char> struct char_traits;
+template<> struct char_traits<char>;
+template<> struct char_traits<wchar_t>;
-/// convert \p s from ucs4 to the encoding of the file system.
-std::string const to_filesystem8bit(docstring const & s);
+template<typename Alloc> class allocator;
-/// normalize \p s to precomposed form c
-docstring const normalize_c(docstring const & s);
+template<typename Char, typename Traits, typename Alloc> class basic_string;
-/// Compare a docstring with a C string of ASCII characters
-bool operator==(docstring const &, char const *);
+typedef basic_string<char, char_traits<char>, allocator<char> > string;
-/// Compare a C string of ASCII characters with a docstring
-inline bool operator==(char const * l, docstring const & r) { return r == l; }
+template<class Char, class Traits> class basic_istream;
+template<class Char, class Traits> class basic_ostream;
-/// Compare a docstring with a C string of ASCII characters
-inline bool operator!=(docstring const & l, char const * r) { return !(l == r); }
+typedef basic_istream<char, char_traits<char> > istream;
+typedef basic_ostream<char, char_traits<char> > ostream;
-/// Compare a C string of ASCII characters with a docstring
-inline bool operator!=(char const * l, docstring const & r) { return !(r == l); }
+}
-/// Concatenate a docstring and a C string of ASCII characters
-docstring operator+(docstring const &, char const *);
-/// Concatenate a C string of ASCII characters and a docstring
-docstring operator+(char const *, docstring const &);
+namespace lyx {
-/// Concatenate a docstring and a single ASCII character
-docstring operator+(docstring const & l, char r);
+typedef std::basic_string<char_type, std::char_traits<char_type>,
+ std::allocator<char_type> > docstring;
-/// Concatenate a single ASCII character and a docstring
-docstring operator+(char l, docstring const & r);
+/// Base class for UCS4 input streams
+typedef std::basic_istream<char_type, std::char_traits<char_type> >
+ idocstream;
-/// Append a C string of ASCII characters to a docstring
-docstring & operator+=(docstring &, char const *);
+/// Base class for UCS4 output streams
+typedef std::basic_ostream<char_type, std::char_traits<char_type> >
+ odocstream;
-/// Append a single ASCII character to a docstring
-docstring & operator+=(docstring & l, char r);
} // namespace lyx
#include "support/userinfo.h"
#include "support/environment.h"
+#include "support/docstring.h"
#include <boost/assert.hpp>
return _("Unknown user");
return from_local8bit(name);
#else
- struct passwd * pw(getpwuid(geteuid()));
+ struct passwd * pw = getpwuid(geteuid());
BOOST_ASSERT(pw);
string name = pw->pw_gecos;