Change the type of the context menu name to string

There is no need for GUI-elements to use docstring.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40058 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2011-10-29 14:48:55 +00:00
parent 3ec0733fce
commit 7287a259c5
60 changed files with 107 additions and 107 deletions

View File

@ -561,7 +561,7 @@ docstring BufferView::toolTip(int x, int y) const
}
docstring BufferView::contextMenu(int x, int y) const
string BufferView::contextMenu(int x, int y) const
{
//If there is a selection, return the containing inset menu
if (d->cursor_.selection())

View File

@ -124,7 +124,7 @@ public:
/// \return Tool tip for the given position.
docstring toolTip(int x, int y) const;
/// \return the context menu for the given position.
docstring contextMenu(int x, int y) const;
std::string contextMenu(int x, int y) const;
/// Save the current position as bookmark.
/// if idx == 0, save to temp_bookmark

View File

@ -716,7 +716,7 @@ bool GuiWorkArea::event(QEvent * e)
void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
{
docstring name;
string name;
if (e->reason() == QContextMenuEvent::Mouse)
// the menu name is set on mouse press
name = d->context_menu_name_;

View File

@ -181,7 +181,7 @@ struct GuiWorkArea::Private
/// pressed. This is used to get the correct context menu
/// when the menu is actually shown (after releasing on Windows)
/// and after the DEPM has done its job.
docstring context_menu_name_;
std::string context_menu_name_;
}; // GuiWorkArea
} // namespace frontend

View File

@ -258,15 +258,15 @@ void Inset::forToc(docstring &, size_t) const
}
docstring Inset::contextMenu(BufferView const &, int, int) const
string Inset::contextMenu(BufferView const &, int, int) const
{
return contextMenuName();
}
docstring Inset::contextMenuName() const
string Inset::contextMenuName() const
{
return docstring();
return string();
}

View File

@ -408,11 +408,11 @@ public:
/// \return Context menu identifier. This function determines
/// whose Inset's menu should be shown for the given position.
virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
virtual std::string contextMenu(BufferView const & bv, int x, int y) const;
/// \return Context menu identifier for this inset.
/// This default implementation returns an empty string.
virtual docstring contextMenuName() const;
virtual std::string contextMenuName() const;
virtual docstring layoutName() const;

View File

@ -992,9 +992,9 @@ docstring InsetBibtex::xhtml(XHTMLStream & xs, OutputParams const &) const
}
docstring InsetBibtex::contextMenuName() const
string InsetBibtex::contextMenuName() const
{
return from_ascii("context-bibtex");
return "context-bibtex";
}

View File

@ -58,7 +58,7 @@ public:
///
docstring xhtml(XHTMLStream &, OutputParams const &) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
//@}
/// \name Static public methods obligated for InsetCommand derived classes

View File

@ -530,9 +530,9 @@ void InsetBox::validate(LaTeXFeatures & features) const
}
docstring InsetBox::contextMenuName() const
string InsetBox::contextMenuName() const
{
return from_ascii("context-box");
return "context-box";
}

View File

@ -133,7 +133,7 @@ private:
/// used by the constructors
void init();
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
InsetBoxParams params_;

View File

@ -257,9 +257,9 @@ void InsetBranch::validate(LaTeXFeatures & features) const
}
docstring InsetBranch::contextMenuName() const
string InsetBranch::contextMenuName() const
{
return from_ascii("context-branch");
return "context-branch";
}

View File

@ -79,7 +79,7 @@ private:
///
void validate(LaTeXFeatures &) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
void addToToc(DocIterator const &) const;
///

View File

@ -611,9 +611,9 @@ void InsetCitation::validate(LaTeXFeatures & features) const
}
docstring InsetCitation::contextMenuName() const
string InsetCitation::contextMenuName() const
{
return from_ascii("context-citation");
return "context-citation";
}

View File

@ -63,7 +63,7 @@ public:
///
void addToToc(DocIterator const &) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
//@}
/// \name Static public methods obligated for InsetCommand derived classes

View File

@ -618,15 +618,15 @@ InsetLayout::InsetDecoration InsetCollapsable::decoration() const
}
docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
string InsetCollapsable::contextMenu(BufferView const & bv, int x,
int y) const
{
docstring context_menu = contextMenuName();
docstring const it_context_menu = InsetText::contextMenuName();
string context_menu = contextMenuName();
string const it_context_menu = InsetText::contextMenuName();
if (decoration() == InsetLayout::CONGLOMERATE)
return context_menu + ";" + it_context_menu;
docstring const ic_context_menu = InsetCollapsable::contextMenuName();
string const ic_context_menu = InsetCollapsable::contextMenuName();
if (ic_context_menu != context_menu)
context_menu += ";" + ic_context_menu;
@ -641,12 +641,12 @@ docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
}
docstring InsetCollapsable::contextMenuName() const
string InsetCollapsable::contextMenuName() const
{
if (decoration() == InsetLayout::CONGLOMERATE)
return from_ascii("context-conglomerate");
return "context-conglomerate";
else
return from_ascii("context-collapsable");
return "context-collapsable";
}
} // namespace lyx

View File

@ -141,9 +141,9 @@ public:
///
virtual bool usePlainLayout() const { return true; }
///
docstring contextMenu(BufferView const & bv, int x, int y) const;
std::string contextMenu(BufferView const & bv, int x, int y) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
docstring floatName(std::string const & type) const;
protected:

View File

@ -210,9 +210,9 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
}
docstring InsetCommand::contextMenuName() const
string InsetCommand::contextMenuName() const
{
return from_ascii("context-") + from_ascii(insetName(p_.code()));
return "context-" + insetName(p_.code());
}

View File

@ -91,7 +91,7 @@ protected:
/// \name Methods relaying to the InsetCommandParams p_
//@{
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
bool showInsetDialog(BufferView * bv) const;
///

View File

@ -38,8 +38,8 @@ public:
///
static std::string params2string(CollapseStatus);
docstring contextMenuName() const
{ return from_ascii("context-ert"); }
std::string contextMenuName() const
{ return "context-ert"; }
private:
///
InsetCode lyxCode() const { return ERT_CODE; }

View File

@ -802,9 +802,9 @@ void InsetExternal::addPreview(DocIterator const & /*inset_pos*/,
}
docstring InsetExternal::contextMenuName() const
string InsetExternal::contextMenuName() const
{
return from_ascii("context-external");
return "context-external";
}

View File

@ -111,7 +111,7 @@ public:
/// \returns the number of rows (\n's) of generated code.
void latex(otexstream &, OutputParams const &) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
bool setMouseHover(BufferView const * bv, bool mouse_hover);
///

View File

@ -1054,9 +1054,9 @@ void InsetGraphics::addToToc(DocIterator const & cpit) const
}
docstring InsetGraphics::contextMenuName() const
string InsetGraphics::contextMenuName() const
{
return from_ascii("context-graphics");
return "context-graphics";
}

View File

@ -98,7 +98,7 @@ private:
///
void addToToc(DocIterator const &) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
/// Force inset into LTR environment if surroundings are RTL
bool forceLTR() const { return true; }
///

View File

@ -271,9 +271,9 @@ void InsetHyperlink::validate(LaTeXFeatures & features) const
}
docstring InsetHyperlink::contextMenuName() const
string InsetHyperlink::contextMenuName() const
{
return from_ascii("context-hyperlink");
return "context-hyperlink";
}

View File

@ -42,7 +42,7 @@ public:
///
docstring toolTip(BufferView const & bv, int x, int y) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
void validate(LaTeXFeatures &) const;
///

View File

@ -985,9 +985,9 @@ void InsetInclude::draw(PainterInfo & pi, int x, int y) const
}
docstring InsetInclude::contextMenuName() const
string InsetInclude::contextMenuName() const
{
return from_ascii("context-include");
return "context-include";
}

View File

@ -103,7 +103,7 @@ public:
///
void updateBuffer(ParIterator const &, UpdateType);
///
docstring contextMenuName() const;
std::string contextMenuName() const;
//@}
/// \name Static public methods obligated for InsetCommand derived classes

View File

@ -373,9 +373,9 @@ void InsetIndex::validate(LaTeXFeatures & features) const
}
docstring InsetIndex::contextMenuName() const
string InsetIndex::contextMenuName() const
{
return from_ascii("context-index");
return "context-index";
}
@ -572,10 +572,10 @@ void InsetPrintIndex::validate(LaTeXFeatures & features) const
}
docstring InsetPrintIndex::contextMenuName() const
string InsetPrintIndex::contextMenuName() const
{
return buffer().masterBuffer()->params().use_indices ?
from_ascii("context-indexprint") : docstring();
"context-indexprint" : string();
}

View File

@ -79,7 +79,7 @@ private:
/// Updates needed features for this inset.
void validate(LaTeXFeatures & features) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
Inset * clone() const { return new InsetIndex(*this); }
@ -108,7 +108,7 @@ public:
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
/// Updates needed features for this inset.
void validate(LaTeXFeatures & features) const;
///

View File

@ -462,7 +462,7 @@ void InsetInfo::updateInfo()
}
docstring InsetInfo::contextMenu(BufferView const &, int, int) const
string InsetInfo::contextMenu(BufferView const &, int, int) const
{
//FIXME: We override the implementation of InsetCollapsable,
//because this inset is not a collapsable inset.
@ -470,9 +470,9 @@ docstring InsetInfo::contextMenu(BufferView const &, int, int) const
}
docstring InsetInfo::contextMenuName() const
string InsetInfo::contextMenuName() const
{
return from_ascii("context-info");
return "context-info";
}

View File

@ -126,9 +126,9 @@ public:
///
docstring toolTip(BufferView const & bv, int x, int y) const;
///
docstring contextMenu(BufferView const &, int, int) const;
std::string contextMenu(BufferView const &, int, int) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
/// should paragraph indendation be ommitted in any case?
bool neverIndent() const { return true; }

View File

@ -300,9 +300,9 @@ docstring InsetListings::xhtml(XHTMLStream & os, OutputParams const & rp) const
}
docstring InsetListings::contextMenuName() const
string InsetListings::contextMenuName() const
{
return from_ascii("context-listings");
return "context-listings";
}

View File

@ -67,7 +67,7 @@ private:
///
InsetListingsParams & params() { return params_; }
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///

View File

@ -259,9 +259,9 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
}
docstring InsetNewline::contextMenuName() const
string InsetNewline::contextMenuName() const
{
return from_ascii("context-newline");
return "context-newline";
}

View File

@ -77,7 +77,7 @@ private:
///
ColorCode ColorName() const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
Inset * clone() const { return new InsetNewline(*this); }
///

View File

@ -256,9 +256,9 @@ docstring InsetNewpage::xhtml(XHTMLStream & xs, OutputParams const &) const
}
docstring InsetNewpage::contextMenuName() const
string InsetNewpage::contextMenuName() const
{
return from_ascii("context-newpage");
return "context-newpage";
}

View File

@ -81,7 +81,7 @@ private:
///
ColorCode ColorName() const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
Inset * clone() const { return new InsetNewpage(*this); }
///

View File

@ -334,9 +334,9 @@ InsetCode InsetPrintNomencl::lyxCode() const
}
docstring InsetPrintNomencl::contextMenuName() const
string InsetPrintNomencl::contextMenuName() const
{
return from_ascii("context-nomenclprint");
return "context-nomenclprint";
}

View File

@ -98,7 +98,7 @@ public:
///
void latex(otexstream &, OutputParams const &) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
//@}
/// \name Static public methods obligated for InsetCommand derived classes

View File

@ -322,9 +322,9 @@ void InsetNote::validate(LaTeXFeatures & features) const
}
docstring InsetNote::contextMenuName() const
string InsetNote::contextMenuName() const
{
return from_ascii("context-note");
return "context-note";
}
bool InsetNote::allowSpellCheck() const

View File

@ -101,7 +101,7 @@ private:
/// used by the constructors
void init();
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
friend class InsetNoteParams;

View File

@ -358,9 +358,9 @@ docstring InsetPhantom::xhtml(XHTMLStream &, OutputParams const &) const
return docstring();
}
docstring InsetPhantom::contextMenuName() const
string InsetPhantom::contextMenuName() const
{
return from_ascii("context-phantom");
return "context-phantom";
}

View File

@ -94,7 +94,7 @@ private:
/// used by the constructors
void init();
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
friend class InsetPhantomParams;

View File

@ -49,8 +49,8 @@ public:
bool descendable(BufferView const & /*bv*/) const { return true; }
docstring contextMenuName() const
{ return from_ascii("context-preview"); }
std::string contextMenuName() const
{ return "context-preview"; }
void metrics(MetricsInfo & mi, Dimension & dim) const;

View File

@ -421,9 +421,9 @@ docstring InsetScript::xhtml(XHTMLStream & xs, OutputParams const & runparams) c
}
docstring InsetScript::contextMenuName() const
string InsetScript::contextMenuName() const
{
return from_ascii("context-script");
return "context-script";
}

View File

@ -109,7 +109,7 @@ public:
///
Inset * clone() const { return new InsetScript(*this); }
///
docstring contextMenuName() const;
std::string contextMenuName() const;
//@}
/// \name Public functions inherited from InsetText class

View File

@ -837,9 +837,9 @@ bool InsetSpace::isStretchableSpace() const
}
docstring InsetSpace::contextMenuName() const
string InsetSpace::contextMenuName() const
{
return from_ascii("context-space");
return "context-space";
}

View File

@ -150,7 +150,7 @@ public:
// a line separator)?
bool isSpace() const { return true; }
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
bool clickable(int /* x */, int /* y */) const { return true; }
protected:

View File

@ -3399,7 +3399,7 @@ void InsetTabular::write(ostream & os) const
}
docstring InsetTabular::contextMenu(BufferView const &, int, int) const
string InsetTabular::contextMenu(BufferView const &, int, int) const
{
// FIXME: depending on the selection state,
// we could offer a different menu.
@ -3407,9 +3407,9 @@ docstring InsetTabular::contextMenu(BufferView const &, int, int) const
}
docstring InsetTabular::contextMenuName() const
string InsetTabular::contextMenuName() const
{
return from_ascii("context-tabular");
return "context-tabular";
}

View File

@ -824,9 +824,9 @@ public:
///
InsetCode lyxCode() const { return TABULAR_CODE; }
///
docstring contextMenu(BufferView const &, int, int) const;
std::string contextMenu(BufferView const &, int, int) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
/// get offset of this cursor slice relative to our upper left corner
void cursorPos(BufferView const & bv, CursorSlice const & sl,
bool boundary, int & x, int & y) const;

View File

@ -848,18 +848,18 @@ void InsetText::completionPosAndDim(Cursor const & cur, int & x, int & y,
}
docstring InsetText::contextMenu(BufferView const &, int, int) const
string InsetText::contextMenu(BufferView const &, int, int) const
{
docstring context_menu = contextMenuName();
string context_menu = contextMenuName();
if (context_menu != InsetText::contextMenuName())
context_menu += ";" + InsetText::contextMenuName();
return context_menu;
}
docstring InsetText::contextMenuName() const
string InsetText::contextMenuName() const
{
return from_ascii("context-edit");
return "context-edit";
}

View File

@ -203,9 +203,9 @@ public:
size_t numlines = 5, size_t len = 80) const;
///
docstring contextMenu(BufferView const &, int, int) const;
std::string contextMenu(BufferView const &, int, int) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
protected:

View File

@ -232,9 +232,9 @@ docstring InsetVSpace::xhtml(XHTMLStream &, OutputParams const &) const
}
docstring InsetVSpace::contextMenuName() const
string InsetVSpace::contextMenuName() const
{
return from_ascii("context-vspace");
return "context-vspace";
}

View File

@ -32,7 +32,7 @@ public:
///
bool hasSettings() const { return true; }
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
static void string2params(std::string const &, VSpace &);
///

View File

@ -2252,9 +2252,9 @@ void InsetMathHull::forToc(docstring & os, size_t) const
}
docstring InsetMathHull::contextMenuName() const
string InsetMathHull::contextMenuName() const
{
return from_ascii("context-math");
return "context-math";
}

View File

@ -163,7 +163,7 @@ public:
void recordLocation(DocIterator const & di);
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
InsetCode lyxCode() const { return MATH_HULL_CODE; }

View File

@ -288,9 +288,9 @@ InsetSpaceParams InsetMathSpace::params() const
}
docstring InsetMathSpace::contextMenuName() const
string InsetMathSpace::contextMenuName() const
{
return from_ascii("context-mathspace");
return "context-mathspace";
}

View File

@ -61,7 +61,7 @@ public:
///
bool hasSettings() const { return true; }
///
docstring contextMenuName() const;
std::string contextMenuName() const;
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
///

View File

@ -1367,9 +1367,9 @@ void MathMacroTemplate::infoize(odocstream & os) const
}
docstring MathMacroTemplate::contextMenuName() const
string MathMacroTemplate::contextMenuName() const
{
return from_ascii("context-math-macro-definition");
return "context-math-macro-definition";
}
} // namespace lyx

View File

@ -104,7 +104,7 @@ public:
///
void infoize(odocstream & os) const;
///
docstring contextMenuName() const;
std::string contextMenuName() const;
protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);