mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
Rename InsetOptArg as InsetArgument.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34596 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f9377c8bcc
commit
8480d1dd9a
@ -152,6 +152,7 @@ SOURCES += \
|
||||
../../src/insets/ExternalSupport.cpp \
|
||||
../../src/insets/ExternalTemplate.cpp \
|
||||
../../src/insets/ExternalTransforms.cpp \
|
||||
../../src/insets/InsetArgument.cpp \
|
||||
../../src/insets/InsetBibitem.cpp \
|
||||
../../src/insets/InsetBibtex.cpp \
|
||||
../../src/insets/InsetBox.cpp \
|
||||
@ -185,7 +186,6 @@ SOURCES += \
|
||||
../../src/insets/InsetNewpage.cpp \
|
||||
../../src/insets/InsetNomencl.cpp \
|
||||
../../src/insets/InsetNote.cpp \
|
||||
../../src/insets/InsetOptArg.cpp \
|
||||
../../src/insets/InsetPhantom.cpp \
|
||||
../../src/insets/InsetQuotes.cpp \
|
||||
../../src/insets/InsetRef.cpp \
|
||||
@ -494,6 +494,7 @@ HEADERS += \
|
||||
../../src/insets/ExternalTemplate.h \
|
||||
../../src/insets/ExternalTransforms.h \
|
||||
../../src/insets/Inset.h \
|
||||
../../src/insets/InsetArgument.h \
|
||||
../../src/insets/InsetBibitem.h \
|
||||
../../src/insets/InsetBibtex.h \
|
||||
../../src/insets/InsetBox.h \
|
||||
@ -527,7 +528,6 @@ HEADERS += \
|
||||
../../src/insets/InsetNewpage.h \
|
||||
../../src/insets/InsetNomencl.h \
|
||||
../../src/insets/InsetNote.h \
|
||||
../../src/insets/InsetOptArg.h \
|
||||
../../src/insets/InsetQuotes.h \
|
||||
../../src/insets/InsetPhantom.h \
|
||||
../../src/insets/InsetRef.h \
|
||||
|
@ -1003,6 +1003,7 @@ src_insets_header_files = Split('''
|
||||
ExternalTemplate.h
|
||||
ExternalTransforms.h
|
||||
Inset.h
|
||||
InsetArgument.h
|
||||
InsetBibitem.h
|
||||
InsetBibtex.h
|
||||
InsetBox.h
|
||||
@ -1036,7 +1037,6 @@ src_insets_header_files = Split('''
|
||||
InsetNewpage.h
|
||||
InsetNomencl.h
|
||||
InsetNote.h
|
||||
InsetOptArg.h
|
||||
InsetPhantom.h
|
||||
InsetPreview.h
|
||||
InsetQuotes.h
|
||||
@ -1060,6 +1060,7 @@ src_insets_files = Split('''
|
||||
ExternalTemplate.cpp
|
||||
ExternalTransforms.cpp
|
||||
Inset.cpp
|
||||
InsetArgument.cpp
|
||||
InsetBibitem.cpp
|
||||
InsetBibtex.cpp
|
||||
InsetBox.cpp
|
||||
@ -1092,7 +1093,6 @@ src_insets_files = Split('''
|
||||
InsetNewpage.cpp
|
||||
InsetNomencl.cpp
|
||||
InsetNote.cpp
|
||||
InsetOptArg.cpp
|
||||
InsetPhantom.cpp
|
||||
InsetPreview.cpp
|
||||
InsetQuotes.cpp
|
||||
|
@ -514,6 +514,7 @@ SOURCEFILESINSETS = \
|
||||
insets/RenderGraphic.cpp \
|
||||
insets/RenderPreview.cpp \
|
||||
insets/Inset.cpp \
|
||||
insets/InsetArgument.cpp \
|
||||
insets/InsetBibitem.cpp \
|
||||
insets/InsetBibtex.cpp \
|
||||
insets/InsetBox.cpp \
|
||||
@ -546,7 +547,6 @@ SOURCEFILESINSETS = \
|
||||
insets/InsetNewpage.cpp \
|
||||
insets/InsetNomencl.cpp \
|
||||
insets/InsetNote.cpp \
|
||||
insets/InsetOptArg.cpp \
|
||||
insets/InsetPhantom.cpp \
|
||||
insets/InsetPreview.cpp \
|
||||
insets/InsetQuotes.cpp \
|
||||
@ -568,6 +568,7 @@ HEADERFILESINSETS = \
|
||||
insets/RenderGraphic.h \
|
||||
insets/RenderPreview.h \
|
||||
insets/Inset.h \
|
||||
insets/InsetArgument.h \
|
||||
insets/InsetBibitem.h \
|
||||
insets/InsetBibtex.h \
|
||||
insets/InsetBox.h \
|
||||
@ -602,7 +603,6 @@ HEADERFILESINSETS = \
|
||||
insets/InsetNewpage.h \
|
||||
insets/InsetNomencl.h \
|
||||
insets/InsetNote.h \
|
||||
insets/InsetOptArg.h \
|
||||
insets/InsetPhantom.h \
|
||||
insets/InsetQuotes.h \
|
||||
insets/InsetRef.h \
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "frontends/FontMetrics.h"
|
||||
|
||||
#include "insets/InsetBibitem.h"
|
||||
#include "insets/InsetOptArg.h"
|
||||
#include "insets/InsetArgument.h"
|
||||
|
||||
#include "support/lassert.h"
|
||||
#include "support/debug.h"
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include "insets/InsetLine.h"
|
||||
#include "insets/InsetNewline.h"
|
||||
#include "insets/InsetNewpage.h"
|
||||
#include "insets/InsetOptArg.h"
|
||||
#include "insets/InsetArgument.h"
|
||||
#include "insets/InsetSpace.h"
|
||||
#include "insets/InsetSpecialChar.h"
|
||||
#include "insets/InsetTabular.h"
|
||||
|
@ -2342,10 +2342,10 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
code = INFO_CODE;
|
||||
break;
|
||||
case LFUN_OPTIONAL_INSERT: {
|
||||
code = OPTARG_CODE;
|
||||
code = ARG_CODE;
|
||||
Layout const & lay = cur.paragraph().layout();
|
||||
int const numargs = lay.reqargs + lay.optargs;
|
||||
enable = cur.paragraph().insetList().count(OPTARG_CODE) < numargs;
|
||||
enable = cur.paragraph().insetList().count(ARG_CODE) < numargs;
|
||||
break;
|
||||
}
|
||||
case LFUN_INDEX_INSERT:
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "ParIterator.h"
|
||||
#include "TextClass.h"
|
||||
|
||||
#include "insets/InsetOptArg.h"
|
||||
#include "insets/InsetArgument.h"
|
||||
|
||||
#include "support/convert.h"
|
||||
#include "support/debug.h"
|
||||
@ -142,11 +142,11 @@ bool TocBackend::updateItem(DocIterator const & dit)
|
||||
InsetList::const_iterator end = par.insetList().end();
|
||||
for (; it != end; ++it) {
|
||||
Inset & inset = *it->inset;
|
||||
if (inset.lyxCode() == OPTARG_CODE) {
|
||||
if (inset.lyxCode() == ARG_CODE) {
|
||||
if (!tocstring.empty())
|
||||
break;
|
||||
Paragraph const & inset_par =
|
||||
*static_cast<InsetOptArg&>(inset).paragraphs().begin();
|
||||
*static_cast<InsetArgument&>(inset).paragraphs().begin();
|
||||
if (!par.labelString().empty())
|
||||
tocstring = par.labelString() + ' ';
|
||||
tocstring += inset_par.asString(AS_STR_INSETS);
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "insets/InsetNewpage.h"
|
||||
#include "insets/InsetNomencl.h"
|
||||
#include "insets/InsetNote.h"
|
||||
#include "insets/InsetOptArg.h"
|
||||
#include "insets/InsetArgument.h"
|
||||
#include "insets/InsetPhantom.h"
|
||||
#include "insets/InsetPreview.h"
|
||||
#include "insets/InsetRef.h"
|
||||
@ -145,7 +145,7 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
|
||||
return new InsetMarginal(buf);
|
||||
|
||||
case LFUN_OPTIONAL_INSERT:
|
||||
return new InsetOptArg(buf);
|
||||
return new InsetArgument(buf);
|
||||
|
||||
case LFUN_FLOAT_INSERT:
|
||||
return new InsetFloat(buf, to_utf8(cmd.argument()));
|
||||
@ -563,7 +563,7 @@ Inset * readInset(Lexer & lex, Buffer * buf)
|
||||
} else if (tmptok == "Newline") {
|
||||
inset.reset(new InsetNewline);
|
||||
} else if (tmptok == "OptArg") {
|
||||
inset.reset(new InsetOptArg(buf));
|
||||
inset.reset(new InsetArgument(buf));
|
||||
} else if (tmptok == "Float") {
|
||||
inset.reset(new InsetFloat(buf, string()));
|
||||
} else if (tmptok == "Wrap") {
|
||||
|
@ -102,7 +102,7 @@ static void build_translator()
|
||||
insetnames[FLOAT_LIST_CODE] = InsetName("floatlist");
|
||||
insetnames[INDEX_PRINT_CODE] = InsetName("index_print");
|
||||
insetnames[NOMENCL_PRINT_CODE] = InsetName("nomencl_print");
|
||||
insetnames[OPTARG_CODE] = InsetName("optarg");
|
||||
insetnames[ARG_CODE] = InsetName("optarg");
|
||||
insetnames[NEWLINE_CODE] = InsetName("newline");
|
||||
insetnames[LINE_CODE] = InsetName("line");
|
||||
insetnames[BRANCH_CODE] = InsetName("branch", _("Branch"));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* \file InsetOptArg.cpp
|
||||
* \file InsetArgument.cpp
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "InsetOptArg.h"
|
||||
#include "InsetArgument.h"
|
||||
|
||||
#include "support/debug.h"
|
||||
#include "support/docstream.h"
|
||||
@ -21,42 +21,42 @@ using namespace std;
|
||||
namespace lyx {
|
||||
|
||||
|
||||
InsetOptArg::InsetOptArg(Buffer * buf)
|
||||
InsetArgument::InsetArgument(Buffer * buf)
|
||||
: InsetCollapsable(buf)
|
||||
{}
|
||||
|
||||
|
||||
void InsetOptArg::write(ostream & os) const
|
||||
void InsetArgument::write(ostream & os) const
|
||||
{
|
||||
os << "OptArg" << "\n";
|
||||
InsetCollapsable::write(os);
|
||||
}
|
||||
|
||||
|
||||
int InsetOptArg::latex(odocstream &, OutputParams const &) const
|
||||
int InsetArgument::latex(odocstream &, OutputParams const &) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int InsetOptArg::plaintext(odocstream &, OutputParams const &) const
|
||||
int InsetArgument::plaintext(odocstream &, OutputParams const &) const
|
||||
{
|
||||
return 0; // do not output optional arguments
|
||||
}
|
||||
|
||||
|
||||
int InsetOptArg::docbook(odocstream &, OutputParams const &) const
|
||||
int InsetArgument::docbook(odocstream &, OutputParams const &) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
docstring InsetOptArg::xhtml(XHTMLStream &, OutputParams const &) const
|
||||
docstring InsetArgument::xhtml(XHTMLStream &, OutputParams const &) const
|
||||
{
|
||||
return docstring();
|
||||
}
|
||||
|
||||
int InsetOptArg::latexArgument(odocstream & os,
|
||||
int InsetArgument::latexArgument(odocstream & os,
|
||||
OutputParams const & runparams, bool optional) const
|
||||
{
|
||||
odocstringstream ss;
|
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file InsetOptArg.h
|
||||
* \file InsetArgument.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -20,14 +20,14 @@ namespace lyx {
|
||||
|
||||
|
||||
/**
|
||||
* InsetOptArg. Used to insert a short version of sectioning header etc.
|
||||
* InsetArgument. Used to insert a short version of sectioning header etc.
|
||||
* automatically, or other optional LaTeX arguments
|
||||
*/
|
||||
class InsetOptArg : public InsetCollapsable
|
||||
class InsetArgument : public InsetCollapsable
|
||||
{
|
||||
public:
|
||||
///
|
||||
InsetOptArg(Buffer *);
|
||||
InsetArgument(Buffer *);
|
||||
|
||||
/// Outputting the parameter of a LaTeX command
|
||||
int latexArgument(odocstream &, OutputParams const &,
|
||||
@ -37,7 +37,7 @@ public:
|
||||
|
||||
private:
|
||||
/// code of the inset
|
||||
InsetCode lyxCode() const { return OPTARG_CODE; }
|
||||
InsetCode lyxCode() const { return ARG_CODE; }
|
||||
///
|
||||
docstring name() const { return from_ascii("OptArg"); }
|
||||
/// Standard LaTeX output -- short-circuited
|
||||
@ -53,7 +53,7 @@ private:
|
||||
/// should paragraph indendation be ommitted in any case?
|
||||
bool neverIndent() const { return true; }
|
||||
///
|
||||
Inset * clone() const { return new InsetOptArg(*this); }
|
||||
Inset * clone() const { return new InsetArgument(*this); }
|
||||
};
|
||||
|
||||
|
@ -199,7 +199,7 @@ bool InsetCaption::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
return true;
|
||||
|
||||
case LFUN_OPTIONAL_INSERT:
|
||||
status.setEnabled(cur.paragraph().insetList().find(OPTARG_CODE) == -1);
|
||||
status.setEnabled(cur.paragraph().insetList().find(ARG_CODE) == -1);
|
||||
return true;
|
||||
|
||||
case LFUN_INSET_TOGGLE:
|
||||
|
@ -83,7 +83,7 @@ enum InsetCode {
|
||||
///
|
||||
INDEX_PRINT_CODE,
|
||||
///
|
||||
OPTARG_CODE,
|
||||
ARG_CODE,
|
||||
///
|
||||
CELL_CODE,
|
||||
///
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "InsetText.h"
|
||||
|
||||
#include "insets/InsetOptArg.h"
|
||||
#include "insets/InsetArgument.h"
|
||||
|
||||
#include "buffer_funcs.h"
|
||||
#include "Buffer.h"
|
||||
@ -700,12 +700,12 @@ void InsetText::addToToc(DocIterator const & cdit)
|
||||
//lyxerr << (void*)&inset << " code: " << inset.lyxCode() << std::endl;
|
||||
inset.addToToc(dit);
|
||||
switch (inset.lyxCode()) {
|
||||
case OPTARG_CODE: {
|
||||
case ARG_CODE: {
|
||||
if (!tocstring.empty())
|
||||
break;
|
||||
dit.pos() = 0;
|
||||
Paragraph const & insetpar =
|
||||
*static_cast<InsetOptArg&>(inset).paragraphs().begin();
|
||||
*static_cast<InsetArgument&>(inset).paragraphs().begin();
|
||||
if (!par.labelString().empty())
|
||||
tocstring = par.labelString() + ' ';
|
||||
tocstring += insetpar.asString(AS_STR_INSETS);
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "VSpace.h"
|
||||
|
||||
#include "insets/InsetBibitem.h"
|
||||
#include "insets/InsetOptArg.h"
|
||||
#include "insets/InsetArgument.h"
|
||||
|
||||
#include "support/lassert.h"
|
||||
#include "support/debug.h"
|
||||
@ -284,18 +284,18 @@ int latexArgInsets(Paragraph const & par, odocstream & os,
|
||||
unsigned int optargs)
|
||||
{
|
||||
unsigned int totalargs = reqargs + optargs;
|
||||
list<InsetOptArg const *> ilist;
|
||||
list<InsetArgument const *> ilist;
|
||||
|
||||
InsetList::const_iterator it = par.insetList().begin();
|
||||
InsetList::const_iterator end = par.insetList().end();
|
||||
for (; it != end; ++it) {
|
||||
if (it->inset->lyxCode() == OPTARG_CODE) {
|
||||
if (it->inset->lyxCode() == ARG_CODE) {
|
||||
if (ilist.size() >= totalargs) {
|
||||
LYXERR0("WARNING: Found extra argument inset.");
|
||||
continue;
|
||||
}
|
||||
InsetOptArg const * ins =
|
||||
static_cast<InsetOptArg const *>(it->inset);
|
||||
InsetArgument const * ins =
|
||||
static_cast<InsetArgument const *>(it->inset);
|
||||
ilist.push_back(ins);
|
||||
}
|
||||
}
|
||||
@ -308,7 +308,7 @@ int latexArgInsets(Paragraph const & par, odocstream & os,
|
||||
if (have_optional_args) {
|
||||
unsigned int todo = ilist.size() - reqargs;
|
||||
for (unsigned int i = 0; i < todo; ++i) {
|
||||
InsetOptArg const * ins = ilist.front();
|
||||
InsetArgument const * ins = ilist.front();
|
||||
ilist.pop_front();
|
||||
lines += ins->latexArgument(os, runparams, true);
|
||||
}
|
||||
@ -325,7 +325,7 @@ int latexArgInsets(Paragraph const & par, odocstream & os,
|
||||
// a required argument wasn't given, so we output {}
|
||||
os << "{}";
|
||||
else {
|
||||
InsetOptArg const * ins = ilist.front();
|
||||
InsetArgument const * ins = ilist.front();
|
||||
ilist.pop_front();
|
||||
lines += ins->latexArgument(os, runparams, false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user