mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Remove Nameref support. Too many issues involving translation, quotes,
etc. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34920 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
be3fba333b
commit
7d4c560f87
@ -7,6 +7,10 @@ The good example would be 2010-01-10 entry.
|
||||
|
||||
-----------------------
|
||||
|
||||
2010-07-16 Richard Heck <rgheck@comcast.net>
|
||||
* Format incremented to 397 (r34884)
|
||||
Remove Nameref support
|
||||
|
||||
2010-07-13 Richard Heck <rgheck@comcast.net>
|
||||
* Format incremented to 396 (r34884)
|
||||
nameref support
|
||||
|
@ -2001,6 +2001,35 @@ def revert_nameref(document):
|
||||
add_to_preamble(document, "\usepackage{nameref}")
|
||||
|
||||
|
||||
def remove_Nameref(document):
|
||||
" Convert Nameref commands to nameref commands "
|
||||
i = 0
|
||||
while 1:
|
||||
# It seems better to look for this, as most of the reference
|
||||
# insets won't be ones we care about.
|
||||
i = find_token(document.body, "LatexCommand Nameref" , i)
|
||||
if i == -1:
|
||||
break
|
||||
cmdloc = i
|
||||
i += 1
|
||||
|
||||
# Make sure it is actually in an inset!
|
||||
# We could just check document.lines[i-1], but that relies
|
||||
# upon something that might easily change.
|
||||
# We'll look back a few lines.
|
||||
stins = cmdloc - 10
|
||||
if stins < 0:
|
||||
stins = 0
|
||||
stins = find_token(document.body, "\\begin_inset CommandInset ref", stins)
|
||||
if stins == -1 or stins > cmdloc:
|
||||
continue
|
||||
endins = find_end_of_inset(document.body, stins)
|
||||
if endins == -1:
|
||||
document.warning("Can't find end of inset at line " + stins + "!!")
|
||||
continue
|
||||
if endins < cmdloc:
|
||||
continue
|
||||
document.body[cmdloc] = "LatexCommand nameref"
|
||||
|
||||
|
||||
##
|
||||
@ -2058,10 +2087,12 @@ convert = [[346, []],
|
||||
[393, [convert_optarg]],
|
||||
[394, []],
|
||||
[395, []],
|
||||
[396, []]
|
||||
[396, []],
|
||||
[397, [remove_Nameref]]
|
||||
]
|
||||
|
||||
revert = [[395, [revert_nameref]],
|
||||
revert = [[396, []],
|
||||
[395, [revert_nameref]],
|
||||
[394, [revert_DIN_C_pagesizes]],
|
||||
[393, [revert_makebox]],
|
||||
[392, [revert_argument]],
|
||||
|
@ -92,7 +92,6 @@ Menuset
|
||||
Item "<Reference> on Page <Page>|f" "inset-modify changetype vref"
|
||||
Item "Formatted Reference|t" "inset-modify changetype prettyref"
|
||||
Item "Textual Reference|x" "inset-modify changetype nameref"
|
||||
Item "Textual Reference plus <page>|l" "inset-modify changetype Nameref"
|
||||
Separator
|
||||
Item "Settings...|S" "inset-settings"
|
||||
End
|
||||
|
@ -126,7 +126,7 @@ namespace {
|
||||
|
||||
// Do not remove the comment below, so we get merge conflict in
|
||||
// independent branches. Instead add your own.
|
||||
int const LYX_FORMAT = 396; // rgh: nameref
|
||||
int const LYX_FORMAT = 397; // rgh: remove Nameref support
|
||||
|
||||
typedef map<string, bool> DepClean;
|
||||
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
|
||||
|
@ -53,8 +53,7 @@ bool InsetRef::isCompatibleCommand(string const & s) {
|
||||
|| s == "vpageref"
|
||||
|| s == "prettyref"
|
||||
|| s == "eqref"
|
||||
|| s == "nameref"
|
||||
|| s == "Nameref";
|
||||
|| s == "nameref";
|
||||
}
|
||||
|
||||
|
||||
@ -137,7 +136,7 @@ docstring InsetRef::xhtml(XHTMLStream & xs, OutputParams const &) const
|
||||
else if (cmd == "prettyref"
|
||||
// we don't really have the ability to handle these
|
||||
// properly in XHTML output
|
||||
|| cmd == "nameref" || cmd == "Nameref")
|
||||
|| cmd == "nameref")
|
||||
display_string = il->prettyCounter();
|
||||
} else
|
||||
display_string = ref;
|
||||
@ -217,7 +216,7 @@ void InsetRef::validate(LaTeXFeatures & features) const
|
||||
features.require("prettyref");
|
||||
else if (cmd == "eqref")
|
||||
features.require("amsmath");
|
||||
else if (cmd == "nameref" || cmd == "Nameref")
|
||||
else if (cmd == "nameref")
|
||||
features.require("nameref");
|
||||
}
|
||||
|
||||
@ -230,7 +229,6 @@ InsetRef::type_info InsetRef::types[] = {
|
||||
{ "vref", N_("Standard+Textual Page"), N_("Ref+Text: ")},
|
||||
{ "prettyref", N_("PrettyRef"), N_("FrmtRef: ")},
|
||||
{ "nameref", N_("Reference to Name"), N_("NameRef:")},
|
||||
{ "Nameref", N_("Name+Textual Page"), N_("NamePgRef:")},
|
||||
{ "", "", "" }
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user