mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Remove using directives from headers
The only exceptions are: - The purpose of the header is to drag in the used symbol, e.g. unique_ptr.h - The used symbol is inside a class or a namespace other than lyx The reason for this is that global 'using' statements effectively forbid to use the used symbols in any other namespace in the whole program, since simply adding or removing an #include of the corresponding header subtly changes the name lookup. The namespace lyx is sort of global, so it should not have these statements either.
This commit is contained in:
parent
458d2015dc
commit
14fa2c7162
@ -22,7 +22,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
using lyx::frontend::Clipboard;
|
||||
|
||||
namespace lyx {
|
||||
|
||||
@ -89,11 +88,11 @@ void pasteSelection(Cursor & cur, ErrorList &);
|
||||
/// Does handle undo. Does only work in text, not mathed.
|
||||
/// \p asParagraphs is only considered if plain text is pasted.
|
||||
bool pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs,
|
||||
Clipboard::TextType preferedType = Clipboard::LyXOrPlainTextType);
|
||||
frontend::Clipboard::TextType preferedType = frontend::Clipboard::LyXOrPlainTextType);
|
||||
/// Replace the current selection with the clipboard contents as graphic.
|
||||
/// Does handle undo. Does only work in text, not mathed.
|
||||
void pasteClipboardGraphics(Cursor & cur, ErrorList & errorList,
|
||||
Clipboard::GraphicsType preferedType = Clipboard::AnyGraphicsType);
|
||||
frontend::Clipboard::GraphicsType preferedType = frontend::Clipboard::AnyGraphicsType);
|
||||
/// Replace the current selection with cut buffer \c sel_index
|
||||
/// Does handle undo. Does only work in text, not mathed.
|
||||
bool pasteFromStack(Cursor & cur, ErrorList & errorList, size_t sel_index);
|
||||
|
@ -97,6 +97,7 @@ using cap::replaceSelection;
|
||||
using cap::grabAndEraseSelection;
|
||||
using cap::selClearOrDel;
|
||||
using cap::pasteSimpleText;
|
||||
using frontend::Clipboard;
|
||||
|
||||
// globals...
|
||||
static Font freefont(ignore_font, ignore_language);
|
||||
|
@ -26,8 +26,6 @@
|
||||
#include <stack>
|
||||
|
||||
|
||||
using std::shared_ptr;
|
||||
|
||||
namespace lyx {
|
||||
|
||||
class Buffer;
|
||||
@ -125,7 +123,7 @@ private:
|
||||
class TocBuilder
|
||||
{
|
||||
public:
|
||||
TocBuilder(shared_ptr<Toc> const toc);
|
||||
TocBuilder(std::shared_ptr<Toc> const toc);
|
||||
/// When entering a float
|
||||
void pushItem(DocIterator const & dit, docstring const & s,
|
||||
bool output_active, bool is_captioned = false);
|
||||
@ -142,7 +140,7 @@ private:
|
||||
bool is_captioned;
|
||||
};
|
||||
///
|
||||
shared_ptr<Toc> const toc_;
|
||||
std::shared_ptr<Toc> const toc_;
|
||||
///
|
||||
std::stack<frame> stack_;
|
||||
};
|
||||
@ -169,9 +167,9 @@ public:
|
||||
///
|
||||
TocList const & tocs() const { return tocs_; }
|
||||
/// never null
|
||||
shared_ptr<Toc const> toc(std::string const & type) const;
|
||||
std::shared_ptr<Toc const> toc(std::string const & type) const;
|
||||
/// never null
|
||||
shared_ptr<Toc> toc(std::string const & type);
|
||||
std::shared_ptr<Toc> toc(std::string const & type);
|
||||
/// \return the current TocBuilder for the Toc of type \param type, or
|
||||
/// creates one if it does not already exist.
|
||||
TocBuilder & builder(std::string const & type);
|
||||
|
@ -18,8 +18,6 @@
|
||||
|
||||
#include "support/strfwd.h"
|
||||
|
||||
using lyx::support::FileName;
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
@ -62,7 +60,7 @@ public:
|
||||
/// Get the contents of the window system clipboard in any text format except LyxTextType.
|
||||
virtual docstring const getAsText(TextType type) const = 0;
|
||||
/// Get the contents of the window system clipboard as graphics file.
|
||||
virtual FileName getAsGraphics(Cursor const & cur, GraphicsType type) const = 0;
|
||||
virtual support::FileName getAsGraphics(Cursor const & cur, GraphicsType type) const = 0;
|
||||
|
||||
/**
|
||||
* Fill the system clipboard. The format of \p lyx is as written in
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
*/
|
||||
//@{
|
||||
std::string const getAsLyX() const;
|
||||
FileName getAsGraphics(Cursor const & cur, GraphicsType type) const;
|
||||
support::FileName getAsGraphics(Cursor const & cur, GraphicsType type) const;
|
||||
docstring const getAsText(TextType type) const;
|
||||
void put(std::string const & text) const;
|
||||
void put(std::string const & lyx, docstring const & html, docstring const & text);
|
||||
@ -79,7 +79,7 @@ public:
|
||||
bool empty() const;
|
||||
//@}
|
||||
|
||||
FileName getPastedGraphicsFileName(Cursor const & cur,
|
||||
support::FileName getPastedGraphicsFileName(Cursor const & cur,
|
||||
Clipboard::GraphicsType & type) const;
|
||||
|
||||
private Q_SLOTS:
|
||||
|
@ -63,7 +63,7 @@ void InsetMarginal::addToToc(DocIterator const & cpit, bool output_active,
|
||||
docstring const str = tooltip;
|
||||
tooltip = support::wrapParas(tooltip, 0, 60, 2);
|
||||
|
||||
shared_ptr<Toc> toc = buffer().tocBackend().toc("marginalnote");
|
||||
std::shared_ptr<Toc> toc = buffer().tocBackend().toc("marginalnote");
|
||||
toc->push_back(TocItem(pit, 0, str, output_active, tooltip));
|
||||
|
||||
// Proceed with the rest of the inset.
|
||||
|
@ -33,8 +33,6 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
using std::shared_ptr;
|
||||
|
||||
namespace lyx {
|
||||
|
||||
class Buffer;
|
||||
@ -611,13 +609,13 @@ public:
|
||||
/// returns the VISIBLE cell at r,c, which may be the same as the
|
||||
/// cell at the previous row or column, if we're dealing with some
|
||||
/// multirow or multicell.
|
||||
shared_ptr<InsetTableCell> cellInset(idx_type cell);
|
||||
shared_ptr<InsetTableCell> cellInset(row_type row, col_type column);
|
||||
std::shared_ptr<InsetTableCell> cellInset(idx_type cell);
|
||||
std::shared_ptr<InsetTableCell> cellInset(row_type row, col_type column);
|
||||
InsetTableCell const * cellInset(idx_type cell) const;
|
||||
//@}
|
||||
///
|
||||
void setCellInset(row_type row, col_type column,
|
||||
shared_ptr<InsetTableCell>);
|
||||
std::shared_ptr<InsetTableCell>);
|
||||
/// Search for \param inset in the tabular, with the
|
||||
///
|
||||
void validate(LaTeXFeatures &) const;
|
||||
@ -674,7 +672,7 @@ public:
|
||||
///
|
||||
Length p_width; // this is only set for multicolumn!!!
|
||||
///
|
||||
shared_ptr<InsetTableCell> inset;
|
||||
std::shared_ptr<InsetTableCell> inset;
|
||||
};
|
||||
///
|
||||
CellData const & cellInfo(idx_type cell) const;
|
||||
@ -921,9 +919,9 @@ public:
|
||||
/// number of cells
|
||||
size_t nargs() const { return tabular.numberofcells; }
|
||||
///
|
||||
shared_ptr<InsetTableCell const> cell(idx_type) const;
|
||||
std::shared_ptr<InsetTableCell const> cell(idx_type) const;
|
||||
///
|
||||
shared_ptr<InsetTableCell> cell(idx_type);
|
||||
std::shared_ptr<InsetTableCell> cell(idx_type);
|
||||
///
|
||||
Text * getText(int) const;
|
||||
|
||||
|
@ -1579,7 +1579,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
cap::replaceSelection(cur);
|
||||
docstring topaste;
|
||||
if (cmd.argument().empty() && !theClipboard().isInternal())
|
||||
topaste = theClipboard().getAsText(Clipboard::PlainTextType);
|
||||
topaste = theClipboard().getAsText(frontend::Clipboard::PlainTextType);
|
||||
else {
|
||||
idocstringstream is(cmd.argument());
|
||||
int n = 0;
|
||||
|
@ -578,7 +578,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
replaceSelection(cur);
|
||||
docstring topaste;
|
||||
if (cmd.argument().empty() && !theClipboard().isInternal())
|
||||
topaste = theClipboard().getAsText(Clipboard::PlainTextType);
|
||||
topaste = theClipboard().getAsText(frontend::Clipboard::PlainTextType);
|
||||
else {
|
||||
size_t n = 0;
|
||||
idocstringstream is(cmd.argument());
|
||||
|
@ -24,8 +24,6 @@
|
||||
#include <memory>
|
||||
|
||||
|
||||
using std::shared_ptr;
|
||||
|
||||
namespace lyx {
|
||||
namespace support {
|
||||
|
||||
@ -44,7 +42,7 @@ public:
|
||||
///
|
||||
virtual ~ForkedProcess() {}
|
||||
///
|
||||
virtual shared_ptr<ForkedProcess> clone() const = 0;
|
||||
virtual std::shared_ptr<ForkedProcess> clone() const = 0;
|
||||
|
||||
/** A SignalType signal can be emitted once the forked process
|
||||
* has finished. It passes:
|
||||
@ -65,7 +63,7 @@ public:
|
||||
*
|
||||
* It doesn't matter if the slot disappears, SigC takes care of that.
|
||||
*/
|
||||
typedef shared_ptr<SignalType> SignalTypePtr;
|
||||
typedef std::shared_ptr<SignalType> SignalTypePtr;
|
||||
|
||||
/** Invoking the following methods makes sense only if the command
|
||||
* is running asynchronously!
|
||||
@ -157,7 +155,7 @@ public:
|
||||
ForkedCall(std::string const & path = empty_string(),
|
||||
std::string const & lpath = empty_string());
|
||||
///
|
||||
virtual shared_ptr<ForkedProcess> clone() const {
|
||||
virtual std::shared_ptr<ForkedProcess> clone() const {
|
||||
return std::make_shared<ForkedCall>(*this);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user