Renamed dubious method to fix misleading name.

This commit is contained in:
Georgy Litvinov 2020-01-15 22:45:50 +01:00
parent c7bb1056c3
commit 06e9835f2a
18 changed files with 75 additions and 75 deletions

View file

@ -96,7 +96,7 @@ public class BibTeXDocument implements OutputFile {
* @return the export name * @return the export name
*/ */
public String getExportName(String sIdentifier) { public String getExportName(String sIdentifier) {
return exportNames.getExportName(sIdentifier); return exportNames.addToExport(sIdentifier);
} }
/** Returns the document name without file extension /** Returns the document name without file extension
@ -137,7 +137,7 @@ public class BibTeXDocument implements OutputFile {
osw.write("@"); osw.write("@");
osw.write(entry.getEntryType().toUpperCase()); osw.write(entry.getEntryType().toUpperCase());
osw.write("{"); osw.write("{");
osw.write(exportNames.getExportName(entry.getIdentifier())); osw.write(exportNames.addToExport(entry.getIdentifier()));
osw.write(",\n"); osw.write(",\n");
for (EntryType entryType : EntryType.values()) { for (EntryType entryType : EntryType.values()) {
String sValue = entry.getField(entryType); String sValue = entry.getField(entryType);

View file

@ -146,7 +146,7 @@ public class CharStyleConverter extends StyleConverter {
applyFont(style,false,true,baText,new Context()); applyFont(style,false,true,baText,new Context());
applyFontEffects(style,true,baText); applyFontEffects(style,true,baText);
// declare the text style (\newcommand) // declare the text style (\newcommand)
String sTeXName = styleNames.getExportName(ofr.getTextStyles().getDisplayName(sName)); String sTeXName = styleNames.addToExport(ofr.getTextStyles().getDisplayName(sName));
styleMap.put(sName,"\\textstyle"+sTeXName+"{","}"); styleMap.put(sName,"\\textstyle"+sTeXName+"{","}");
declarations.append("\\newcommand\\textstyle") declarations.append("\\newcommand\\textstyle")
.append(sTeXName).append("[1]{") .append(sTeXName).append("[1]{")

View file

@ -121,7 +121,7 @@ public final class ConverterPalette extends ConverterBase {
// fill out inner converter method // fill out inner converter method
public void convertInner() throws IOException { public void convertInner() throws IOException {
sTargetFileName = Misc.trimDocumentName(sTargetFileName,".tex"); sTargetFileName = Misc.trimDocumentName(sTargetFileName,".tex");
String sSafeTargetFileName = new ExportNameCollection(true).getExportName(sTargetFileName); String sSafeTargetFileName = new ExportNameCollection(true).addToExport(sTargetFileName);
imageConverter.setBaseFileName(sSafeTargetFileName+"-img"); imageConverter.setBaseFileName(sSafeTargetFileName+"-img");
if (config.saveImagesInSubdir()) { if (config.saveImagesInSubdir()) {
imageConverter.setUseSubdir(sSafeTargetFileName+"-img"); imageConverter.setUseSubdir(sSafeTargetFileName+"-img");

View file

@ -163,7 +163,7 @@ public class FieldConverter extends ConverterHelper {
} }
// Create counter // Create counter
decl.append("\\newcounter{") decl.append("\\newcounter{")
.append(seqnames.getExportName(sName)) .append(seqnames.addToExport(sName))
.append("}"); .append("}");
String sPrefix = ""; String sPrefix = "";
if (nLevel>0) { if (nLevel>0) {
@ -176,10 +176,10 @@ public class FieldConverter extends ConverterHelper {
} }
decl.nl() decl.nl()
.append("\\renewcommand\\the") .append("\\renewcommand\\the")
.append(seqnames.getExportName(sName)) .append(seqnames.addToExport(sName))
.append("{").append(sPrefix) .append("{").append(sPrefix)
.append(ListConverter.numFormat(sNumFormat)) .append(ListConverter.numFormat(sNumFormat))
.append("{").append(seqnames.getExportName(sName)) .append("{").append(seqnames.addToExport(sName))
.append("}}").nl(); .append("}}").nl();
} }
} }
@ -218,7 +218,7 @@ public class FieldConverter extends ConverterHelper {
// Export \label only, assuming the number is generated by \caption // Export \label only, assuming the number is generated by \caption
if (sRefName!=null && ofr.hasSequenceRefTo(sRefName)) { if (sRefName!=null && ofr.hasSequenceRefTo(sRefName)) {
ldp.append("\\label{seq:") ldp.append("\\label{seq:")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}"); .append("}");
} }
} }
@ -231,16 +231,16 @@ public class FieldConverter extends ConverterHelper {
if (sRefName!=null && ofr.hasSequenceRefTo(sRefName)) { if (sRefName!=null && ofr.hasSequenceRefTo(sRefName)) {
// Export as {\refstepcounter{name}\thename\label{refname}} // Export as {\refstepcounter{name}\thename\label{refname}}
ldp.append("{").append(changeCounter(sName,sFormula,true)) ldp.append("{").append(changeCounter(sName,sFormula,true))
.append("\\the").append(seqnames.getExportName(sName)) .append("\\the").append(seqnames.addToExport(sName))
.append("\\label{seq:") .append("\\label{seq:")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}}"); .append("}}");
} }
else { else {
// Export as \stepcounter{name}{\thename} // Export as \stepcounter{name}{\thename}
ldp.append(changeCounter(sName,sFormula,false)) ldp.append(changeCounter(sName,sFormula,false))
.append("{\\the") .append("{\\the")
.append(seqnames.getExportName(sName)) .append(seqnames.addToExport(sName))
.append("}"); .append("}");
} }
} }
@ -256,7 +256,7 @@ public class FieldConverter extends ConverterHelper {
String sRefName = Misc.getAttribute(node,XMLString.TEXT_REF_NAME); String sRefName = Misc.getAttribute(node,XMLString.TEXT_REF_NAME);
if (sRefName!=null && ofr.hasSequenceRefTo(sRefName)) { if (sRefName!=null && ofr.hasSequenceRefTo(sRefName)) {
ldp.append("\\label{seq:") ldp.append("\\label{seq:")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}"); .append("}");
} }
} }
@ -327,10 +327,10 @@ public class FieldConverter extends ConverterHelper {
private String stepCounter(String sName, boolean bRef) { private String stepCounter(String sName, boolean bRef) {
if (bRef) { if (bRef) {
return "\\refstepcounter{" + seqnames.getExportName(sName) + "}"; return "\\refstepcounter{" + seqnames.addToExport(sName) + "}";
} }
else { else {
return "\\stepcounter{" + seqnames.getExportName(sName) + "}"; return "\\stepcounter{" + seqnames.addToExport(sName) + "}";
} }
} }
@ -339,12 +339,12 @@ public class FieldConverter extends ConverterHelper {
return stepCounter(sName, bRef); return stepCounter(sName, bRef);
} }
else if (bRef) { else if (bRef) {
return "\\addtocounter{" + seqnames.getExportName(sName) + "}" return "\\addtocounter{" + seqnames.addToExport(sName) + "}"
+ "{" + Integer.toString(nValue-1) + "}" + "{" + Integer.toString(nValue-1) + "}"
+ "\\refstepcounter{" + seqnames.getExportName(sName) + "}"; + "\\refstepcounter{" + seqnames.addToExport(sName) + "}";
} }
else if (nValue!=0) { else if (nValue!=0) {
return "\\addtocounter{" + seqnames.getExportName(sName) + "}" return "\\addtocounter{" + seqnames.addToExport(sName) + "}"
+ "{" + Integer.toString(nValue) + "}"; + "{" + Integer.toString(nValue) + "}";
} }
else { else {
@ -354,12 +354,12 @@ public class FieldConverter extends ConverterHelper {
private String setCounter(String sName, int nValue, boolean bRef) { private String setCounter(String sName, int nValue, boolean bRef) {
if (bRef) { if (bRef) {
return "\\setcounter{" + seqnames.getExportName(sName) + "}" return "\\setcounter{" + seqnames.addToExport(sName) + "}"
+ "{" + Integer.toString(nValue-1) + "}" + "{" + Integer.toString(nValue-1) + "}"
+ "\\refstepcounter{" + seqnames.getExportName(sName) + "}"; + "\\refstepcounter{" + seqnames.addToExport(sName) + "}";
} }
else { else {
return "\\setcounter{" + seqnames.getExportName(sName) + "}" return "\\setcounter{" + seqnames.addToExport(sName) + "}"
+ "{" + Integer.toString(nValue) + "}"; + "{" + Integer.toString(nValue) + "}";
} }
} }
@ -377,12 +377,12 @@ public class FieldConverter extends ConverterHelper {
if (sRefName!=null) { if (sRefName!=null) {
if (sFormat==null || "page".equals(sFormat)) { if (sFormat==null || "page".equals(sFormat)) {
ldp.append("\\pageref{seq:") ldp.append("\\pageref{seq:")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}"); .append("}");
} }
else if ("value".equals(sFormat)) { else if ("value".equals(sFormat)) {
ldp.append("\\ref{seq:") ldp.append("\\ref{seq:")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}"); .append("}");
} }
else if ("category-and-value".equals(sFormat)) { else if ("category-and-value".equals(sFormat)) {
@ -399,13 +399,13 @@ public class FieldConverter extends ConverterHelper {
} }
} }
ldp.append("\\ref{seq:") ldp.append("\\ref{seq:")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}"); .append("}");
} }
else if ("caption".equals(sFormat) && config.useTitleref() && else if ("caption".equals(sFormat) && config.useTitleref() &&
(ofr.isFigureSequenceName(sName) || ofr.isTableSequenceName(sName))) { (ofr.isFigureSequenceName(sName) || ofr.isTableSequenceName(sName))) {
ldp.append("\\titleref{seq:") ldp.append("\\titleref{seq:")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}"); .append("}");
bUsesTitleref = true; bUsesTitleref = true;
} }
@ -420,9 +420,9 @@ public class FieldConverter extends ConverterHelper {
ldp.append("\\tablename"); ldp.append("\\tablename");
} }
ldp.append("~\\ref{seq:") ldp.append("~\\ref{seq:")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}:~\\titleref{") .append("}:~\\titleref{")
.append(seqrefnames.getExportName(sRefName)) .append(seqrefnames.addToExport(sRefName))
.append("}"); .append("}");
bUsesTitleref = true; bUsesTitleref = true;
} }
@ -707,7 +707,7 @@ public class FieldConverter extends ConverterHelper {
&& (!bConvertJabRef || !handleJabRefReferenceName(sName, ldp, oc))) { && (!bConvertJabRef || !handleJabRefReferenceName(sName, ldp, oc))) {
// Plain reference mark // Plain reference mark
// Note: Always include \label here, even when it's not used // Note: Always include \label here, even when it's not used
ldp.append("\\label{ref:"+refnames.getExportName(shortenRefname(sName))+"}"); ldp.append("\\label{ref:"+refnames.addToExport(shortenRefname(sName))+"}");
} }
} }
else { else {
@ -726,11 +726,11 @@ public class FieldConverter extends ConverterHelper {
String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT); String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
String sName = node.getAttribute(XMLString.TEXT_REF_NAME); String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
if (("page".equals(sFormat) || "".equals(sFormat)) && sName!=null) { if (("page".equals(sFormat) || "".equals(sFormat)) && sName!=null) {
ldp.append("\\pageref{ref:"+refnames.getExportName(shortenRefname(sName))+"}"); ldp.append("\\pageref{ref:"+refnames.addToExport(shortenRefname(sName))+"}");
} }
else if ("chapter".equals(sFormat) && ofr.referenceMarkInHeading(sName)) { else if ("chapter".equals(sFormat) && ofr.referenceMarkInHeading(sName)) {
// This is safe if the reference mark is contained in a heading // This is safe if the reference mark is contained in a heading
ldp.append("\\ref{ref:"+refnames.getExportName(shortenRefname(sName))+"}"); ldp.append("\\ref{ref:"+refnames.addToExport(shortenRefname(sName))+"}");
} }
else { // use current value else { // use current value
palette.getInlineCv().traversePCDATA(node,ldp,oc); palette.getInlineCv().traversePCDATA(node,ldp,oc);
@ -753,7 +753,7 @@ public class FieldConverter extends ConverterHelper {
// for a reference. We export whatever is actually used: // for a reference. We export whatever is actually used:
addTarget(node,"",ldp); addTarget(node,"",ldp);
if (ofr.hasBookmarkRefTo(sName)) { if (ofr.hasBookmarkRefTo(sName)) {
ldp.append("\\label{bkm:"+bookmarknames.getExportName(sName)+"}"); ldp.append("\\label{bkm:"+bookmarknames.addToExport(sName)+"}");
} }
} }
} }
@ -773,11 +773,11 @@ public class FieldConverter extends ConverterHelper {
String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT); String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
String sName = node.getAttribute(XMLString.TEXT_REF_NAME); String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
if (("page".equals(sFormat) || "".equals(sFormat)) && sName!=null) { if (("page".equals(sFormat) || "".equals(sFormat)) && sName!=null) {
ldp.append("\\pageref{bkm:"+bookmarknames.getExportName(sName)+"}"); ldp.append("\\pageref{bkm:"+bookmarknames.addToExport(sName)+"}");
} }
else if ("chapter".equals(sFormat) && ofr.bookmarkInHeading(sName)) { else if ("chapter".equals(sFormat) && ofr.bookmarkInHeading(sName)) {
// This is safe if the bookmark is contained in a heading // This is safe if the bookmark is contained in a heading
ldp.append("\\ref{bkm:"+bookmarknames.getExportName(sName)+"}"); ldp.append("\\ref{bkm:"+bookmarknames.addToExport(sName)+"}");
} }
else if (("number".equals(sFormat) || "number-no-superior".equals(sFormat) || "number-all-superior".equals(sFormat)) && else if (("number".equals(sFormat) || "number-no-superior".equals(sFormat) || "number-all-superior".equals(sFormat)) &&
(ofr.bookmarkInHeading(sName) || ofr.bookmarkInList(sName))) { (ofr.bookmarkInHeading(sName) || ofr.bookmarkInList(sName))) {
@ -803,7 +803,7 @@ public class FieldConverter extends ConverterHelper {
sSuffix = style.getLevelProperty(nLevel, XMLString.STYLE_NUM_SUFFIX); sSuffix = style.getLevelProperty(nLevel, XMLString.STYLE_NUM_SUFFIX);
} }
if (sPrefix!=null) ldp.append(palette.getI18n().convert(sPrefix,false,oc.getLang())); if (sPrefix!=null) ldp.append(palette.getI18n().convert(sPrefix,false,oc.getLang()));
ldp.append("\\ref{bkm:").append(bookmarknames.getExportName(sName)).append("}"); ldp.append("\\ref{bkm:").append(bookmarknames.addToExport(sName)).append("}");
if (sSuffix!=null) ldp.append(palette.getI18n().convert(sSuffix,false,oc.getLang())); if (sSuffix!=null) ldp.append(palette.getI18n().convert(sSuffix,false,oc.getLang()));
} }
else { // use current value else { // use current value
@ -858,7 +858,7 @@ public class FieldConverter extends ConverterHelper {
// TODO: hyperlinks to headings (?) and objects // TODO: hyperlinks to headings (?) and objects
if (bUseHyperref) { if (bUseHyperref) {
ldp.append("\\hyperlink{") ldp.append("\\hyperlink{")
.append(targets.getExportName(Misc.urlDecode(sHref.substring(1)))) .append(targets.addToExport(Misc.urlDecode(sHref.substring(1))))
.append("}{"); .append("}{");
// ignore text style (let hyperref.sty handle the decoration): // ignore text style (let hyperref.sty handle the decoration):
palette.getInlineCv().traverseInlineText(node,ldp,oc); palette.getInlineCv().traverseInlineText(node,ldp,oc);
@ -909,7 +909,7 @@ public class FieldConverter extends ConverterHelper {
if (sName == null || !bUseHyperref) { return; } if (sName == null || !bUseHyperref) { return; }
if (!ofr.hasLinkTo(sName+sSuffix)) { return; } if (!ofr.hasLinkTo(sName+sSuffix)) { return; }
ldp.append("\\hypertarget{") ldp.append("\\hypertarget{")
.append(targets.getExportName(sName+sSuffix)) .append(targets.addToExport(sName+sSuffix))
.append("}{}"); .append("}{}");
} }
@ -923,7 +923,7 @@ public class FieldConverter extends ConverterHelper {
public void addTarget(String sName, String sSuffix, LaTeXDocumentPortion ldp) { public void addTarget(String sName, String sSuffix, LaTeXDocumentPortion ldp) {
if (sName!=null && bUseHyperref && ofr.hasLinkTo(sName+sSuffix)) { if (sName!=null && bUseHyperref && ofr.hasLinkTo(sName+sSuffix)) {
ldp.append("\\hypertarget{") ldp.append("\\hypertarget{")
.append(targets.getExportName(sName+sSuffix)) .append(targets.addToExport(sName+sSuffix))
.append("}{}"); .append("}{}");
} }
} }

View file

@ -241,7 +241,7 @@ public class ListConverter extends StyleConverter {
if (!listStyleLevelNames.containsKey(oc.getListStyleName())) { if (!listStyleLevelNames.containsKey(oc.getListStyleName())) {
createListStyleLabels(oc.getListStyleName()); createListStyleLabels(oc.getListStyleName());
} }
ba.add("\\liststyle"+styleNames.getExportName(getDisplayName(oc.getListStyleName()))+"\n",""); ba.add("\\liststyle"+styleNames.addToExport(getDisplayName(oc.getListStyleName()))+"\n","");
} }
if (oc.getListLevel()<=4) { if (oc.getListLevel()<=4) {
String sCounterName = listStyleLevelNames.get(oc.getListStyleName())[oc.getListLevel()]; String sCounterName = listStyleLevelNames.get(oc.getListStyleName())[oc.getListLevel()];
@ -266,7 +266,7 @@ public class ListConverter extends StyleConverter {
if (!styleNames.containsName(getDisplayName(oc.getListStyleName()))) { if (!styleNames.containsName(getDisplayName(oc.getListStyleName()))) {
createListStyle(oc.getListStyleName()); createListStyle(oc.getListStyleName());
} }
String sTeXName="list"+styleNames.getExportName(getDisplayName(oc.getListStyleName())) String sTeXName="list"+styleNames.addToExport(getDisplayName(oc.getListStyleName()))
+"level"+Misc.int2roman(oc.getListLevel()); +"level"+Misc.int2roman(oc.getListLevel());
if (!oc.isInContinuedList() && style.isNumber(oc.getListLevel())) { if (!oc.isInContinuedList() && style.isNumber(oc.getListLevel())) {
int nStartValue = Misc.getPosInteger(style.getLevelProperty(oc.getListLevel(),XMLString.TEXT_START_VALUE),1)-1; int nStartValue = Misc.getPosInteger(style.getLevelProperty(oc.getListLevel(),XMLString.TEXT_START_VALUE),1)-1;
@ -317,7 +317,7 @@ public class ListConverter extends StyleConverter {
} }
// Step 4: Export with formatting, as "Writer style" custom lists // Step 4: Export with formatting, as "Writer style" custom lists
if (nLevel<=4 && !bHeader) { // TODO: Max level should not be fixed if (nLevel<=4 && !bHeader) { // TODO: Max level should not be fixed
String sTeXName="list"+styleNames.getExportName(getDisplayName(sStyleName)) String sTeXName="list"+styleNames.addToExport(getDisplayName(sStyleName))
+"level"+Misc.int2roman(nLevel); +"level"+Misc.int2roman(nLevel);
if (bRestart && style.isNumber(nLevel)) { if (bRestart && style.isNumber(nLevel)) {
ba.add("\\setcounter{"+sTeXName+"}{"+(nStartValue-1)+"}\n",""); ba.add("\\setcounter{"+sTeXName+"}{"+(nStartValue-1)+"}\n","");
@ -331,7 +331,7 @@ public class ListConverter extends StyleConverter {
* a List Style * a List Style
*/ */
private void createListStyleLabels(String sStyleName) { private void createListStyleLabels(String sStyleName) {
String sTeXName = styleNames.getExportName(getDisplayName(sStyleName)); String sTeXName = styleNames.addToExport(getDisplayName(sStyleName));
declarations.append("\\newcommand\\liststyle") declarations.append("\\newcommand\\liststyle")
.append(sTeXName).append("{%").nl(); .append(sTeXName).append("{%").nl();
ListStyle style = ofr.getListStyle(sStyleName); ListStyle style = ofr.getListStyle(sStyleName);
@ -358,7 +358,7 @@ public class ListConverter extends StyleConverter {
ListStyle style = ofr.getListStyle(sStyleName); ListStyle style = ofr.getListStyle(sStyleName);
// Create labels // Create labels
String sTeXName = styleNames.getExportName(getDisplayName(sStyleName)); String sTeXName = styleNames.addToExport(getDisplayName(sStyleName));
String[] sLevelName = new String[5]; String[] sLevelName = new String[5];
for (int i=1; i<=4; i++) { for (int i=1; i<=4; i++) {
sLevelName[i]="list"+sTeXName+"level"+Misc.int2roman(i); sLevelName[i]="list"+sTeXName+"level"+Misc.int2roman(i);

View file

@ -98,7 +98,7 @@ public class NoteConverter extends ConverterHelper {
ldp.append("\\footnote"); ldp.append("\\footnote");
ldp.append("{"); ldp.append("{");
if (sId != null && ofr.hasFootnoteRefTo(sId)) { if (sId != null && ofr.hasFootnoteRefTo(sId)) {
ldp.append("\\label{fnt:"+footnotenames.getExportName(sId)+"}"); ldp.append("\\label{fnt:"+footnotenames.addToExport(sId)+"}");
} }
traverseNoteBody(fntbody,ldp,ic); traverseNoteBody(fntbody,ldp,ic);
ldp.append("}"); ldp.append("}");
@ -172,7 +172,7 @@ public class NoteConverter extends ConverterHelper {
} }
ldp.append("{"); ldp.append("{");
if (sId != null && ofr.hasEndnoteRefTo(sId)) { if (sId != null && ofr.hasEndnoteRefTo(sId)) {
ldp.append("\\label{ent:"+endnotenames.getExportName(sId)+"}"); ldp.append("\\label{ent:"+endnotenames.addToExport(sId)+"}");
} }
traverseNoteBody(entbody,ldp,ic); traverseNoteBody(entbody,ldp,ic);
ldp.append("}"); ldp.append("}");
@ -215,10 +215,10 @@ public class NoteConverter extends ConverterHelper {
String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT); String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
String sName = node.getAttribute(XMLString.TEXT_REF_NAME); String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
if (("page".equals(sFormat) || "".equals(sFormat)) && sName!=null) { if (("page".equals(sFormat) || "".equals(sFormat)) && sName!=null) {
ldp.append("\\pageref{fnt:"+footnotenames.getExportName(sName)+"}"); ldp.append("\\pageref{fnt:"+footnotenames.addToExport(sName)+"}");
} }
else if ("text".equals(sFormat) && sName!=null) { else if ("text".equals(sFormat) && sName!=null) {
ldp.append("\\ref{fnt:"+footnotenames.getExportName(sName)+"}"); ldp.append("\\ref{fnt:"+footnotenames.addToExport(sName)+"}");
} }
else { // use current value else { // use current value
palette.getInlineCv().traversePCDATA(node,ldp,oc); palette.getInlineCv().traversePCDATA(node,ldp,oc);
@ -235,10 +235,10 @@ public class NoteConverter extends ConverterHelper {
String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT); String sFormat = node.getAttribute(XMLString.TEXT_REFERENCE_FORMAT);
String sName = node.getAttribute(XMLString.TEXT_REF_NAME); String sName = node.getAttribute(XMLString.TEXT_REF_NAME);
if (("page".equals(sFormat) || "".equals(sFormat)) && sName!=null) { if (("page".equals(sFormat) || "".equals(sFormat)) && sName!=null) {
ldp.append("\\pageref{ent:"+endnotenames.getExportName(sName)+"}"); ldp.append("\\pageref{ent:"+endnotenames.addToExport(sName)+"}");
} }
else if ("text".equals(sFormat) && sName!=null) { else if ("text".equals(sFormat) && sName!=null) {
ldp.append("\\ref{ent:"+endnotenames.getExportName(sName)+"}"); ldp.append("\\ref{ent:"+endnotenames.addToExport(sName)+"}");
} }
else { // use current value else { // use current value
palette.getInlineCv().traversePCDATA(node,ldp,oc); palette.getInlineCv().traversePCDATA(node,ldp,oc);

View file

@ -136,11 +136,11 @@ public class PageStyleConverter extends StyleConverter {
String sNextName = style.getProperty(XMLString.STYLE_NEXT_STYLE_NAME); String sNextName = style.getProperty(XMLString.STYLE_NEXT_STYLE_NAME);
MasterPage nextStyle = ofr.getMasterPage(sNextName); MasterPage nextStyle = ofr.getMasterPage(sNextName);
if (style==nextStyle || nextStyle==null) { if (style==nextStyle || nextStyle==null) {
ba.add("\\pagestyle{"+styleNames.getExportName(getDisplayName(sName))+"}\n", ""); ba.add("\\pagestyle{"+styleNames.addToExport(getDisplayName(sName))+"}\n", "");
} }
else { else {
ba.add("\\pagestyle{"+styleNames.getExportName(getDisplayName(sNextName))+"}\n"+ ba.add("\\pagestyle{"+styleNames.addToExport(getDisplayName(sNextName))+"}\n"+
"\\thispagestyle{"+styleNames.getExportName(getDisplayName(sName))+"}\n",""); "\\thispagestyle{"+styleNames.addToExport(getDisplayName(sName))+"}\n","");
} }
// todo: should warn the user if next master also contains a next-style-name; // todo: should warn the user if next master also contains a next-style-name;
// LaTeX's page style mechanism cannot handle that // LaTeX's page style mechanism cannot handle that
@ -174,7 +174,7 @@ public class PageStyleConverter extends StyleConverter {
if (config.useFancyhdr()) { if (config.useFancyhdr()) {
ldp.append("\\fancypagestyle{") ldp.append("\\fancypagestyle{")
.append(styleNames.getExportName(getDisplayName(sName))) .append(styleNames.addToExport(getDisplayName(sName)))
.append("}{\\fancyhf{}").nl(); .append("}{\\fancyhf{}").nl();
// Header - odd or both // Header - odd or both
ldp.append(" \\fancyhead[") ldp.append(" \\fancyhead[")
@ -216,7 +216,7 @@ public class PageStyleConverter extends StyleConverter {
} }
else { // use low-level page styles else { // use low-level page styles
ldp.append("\\newcommand\\ps@") ldp.append("\\newcommand\\ps@")
.append(styleNames.getExportName(getDisplayName(sName))) .append(styleNames.addToExport(getDisplayName(sName)))
.append("{").nl(); .append("{").nl();
// Header // Header
ldp.append(" \\renewcommand\\@oddhead{"); ldp.append(" \\renewcommand\\@oddhead{");

View file

@ -475,7 +475,7 @@ public class ParConverter extends StyleConverter {
ba.add("\\writerlistlabel",""); ba.add("\\writerlistlabel","");
ba.add("\\ignorespaces",""); ba.add("\\ignorespaces","");
// Declare the paragraph style (\newenvironment) // Declare the paragraph style (\newenvironment)
String sTeXName = "style" + styleNames.getExportName(style.getDisplayName()); String sTeXName = "style" + styleNames.addToExport(style.getDisplayName());
styleMap.put(style.getName(),"\\begin{"+sTeXName+"}","\\end{"+sTeXName+"}"); styleMap.put(style.getName(),"\\begin{"+sTeXName+"}","\\end{"+sTeXName+"}");
declarations.append("\\newenvironment{").append(sTeXName) declarations.append("\\newenvironment{").append(sTeXName)
.append("}{").append(ba.getBefore()).append("}{") .append("}{").append(ba.getBefore()).append("}{")

View file

@ -157,11 +157,11 @@ public class SectionConverter extends ConverterHelper {
String sFileName = null; String sFileName = null;
Element source = Misc.getChildByTagName(node,XMLString.TEXT_SECTION_SOURCE); Element source = Misc.getChildByTagName(node,XMLString.TEXT_SECTION_SOURCE);
if (config.splitLinkedSections() && source!=null) { if (config.splitLinkedSections() && source!=null) {
sFileName = fileNames.getExportName(Misc.removeExtension(Misc.urlDecode(source.getAttribute(XMLString.XLINK_HREF)))); sFileName = fileNames.addToExport(Misc.removeExtension(Misc.urlDecode(source.getAttribute(XMLString.XLINK_HREF))));
} }
else if (config.splitToplevelSections() && isToplevel(node)) { else if (config.splitToplevelSections() && isToplevel(node)) {
//sFileName = fileNames.getExportName(palette.getOutFileName()+node.getAttribute(XMLString.TEXT_NAME)); //sFileName = fileNames.getExportName(palette.getOutFileName()+node.getAttribute(XMLString.TEXT_NAME));
sFileName = fileNames.getExportName(node.getAttribute(XMLString.TEXT_NAME)); sFileName = fileNames.addToExport(node.getAttribute(XMLString.TEXT_NAME));
} }
LaTeXDocumentPortion sectionLdp = ldp; LaTeXDocumentPortion sectionLdp = ldp;

View file

@ -109,7 +109,7 @@ public class ExportNameCollection{
} }
} }
public String getExportName(String sName) { public String addToExport(String sName) {
// add the name, if it does not exist // add the name, if it does not exist
if (!containsName(sName)) { addName(sName); } if (!containsName(sName)) { addName(sName); }
return sPrefix + exportNames.get(sName); return sPrefix + exportNames.get(sName);

View file

@ -320,11 +320,11 @@ public class Converter extends ConverterBase {
if (targetIndex!=null) { if (targetIndex!=null) {
int nTargetIndex = targetIndex.intValue(); int nTargetIndex = targetIndex.intValue();
if (nTargetIndex == ld.nIndex) { // same file if (nTargetIndex == ld.nIndex) { // same file
ld.element.setAttribute("href","#"+targetNames.getExportName(ld.sId)); ld.element.setAttribute("href","#"+targetNames.addToExport(ld.sId));
} }
else { else {
ld.element.setAttribute("href",getOutFileName(nTargetIndex,true) ld.element.setAttribute("href",getOutFileName(nTargetIndex,true)
+"#"+targetNames.getExportName(ld.sId)); +"#"+targetNames.addToExport(ld.sId));
} }
} }
} }
@ -804,14 +804,14 @@ public class Converter extends ConverterBase {
// create a target // create a target
public Element createTarget(String sId) { public Element createTarget(String sId) {
Element a = htmlDOM.createElement("a"); Element a = htmlDOM.createElement("a");
a.setAttribute("id",targetNames.getExportName(sId)); a.setAttribute("id",targetNames.addToExport(sId));
targets.put(sId, new Integer(nOutFileIndex)); targets.put(sId, new Integer(nOutFileIndex));
return a; return a;
} }
// put a target id on an existing element // put a target id on an existing element
public void addTarget(Element node,String sId) { public void addTarget(Element node,String sId) {
node.setAttribute("id",targetNames.getExportName(sId)); node.setAttribute("id",targetNames.addToExport(sId));
targets.put(sId, new Integer(nOutFileIndex)); targets.put(sId, new Integer(nOutFileIndex));
} }

View file

@ -78,7 +78,7 @@ public class FrameStyleConverter extends StyleWithPropertiesConverterHelper {
buf.append(sIndent) buf.append(sIndent)
.append(getDefaultTagName(null)) .append(getDefaultTagName(null))
.append(".").append(getClassNamePrefix()) .append(".").append(getClassNamePrefix())
.append(styleNames.getExportName(sDisplayName)) .append(styleNames.addToExport(sDisplayName))
.append(" p {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " "); .append(" p {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " ");
} }
} }

View file

@ -71,7 +71,7 @@ public class HeadingStyleConverter extends StyleConverterHelper {
CSVList props = new CSVList(";"); CSVList props = new CSVList(";");
getParSc().applyProperties(style,props,true); getParSc().applyProperties(style,props,true);
props.addValue("clear","left"); props.addValue("clear","left");
buf.append(sIndent).append("h").append(i).append(".").append(styleNames.getExportName(sDisplayName)) buf.append(sIndent).append("h").append(i).append(".").append(styleNames.addToExport(sDisplayName))
.append(" {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " "); .append(" {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " ");
} }
} }
@ -113,7 +113,7 @@ public class HeadingStyleConverter extends StyleConverterHelper {
} }
else if (style!=ofr.getHeadingStyle(nLevel)) { else if (style!=ofr.getHeadingStyle(nLevel)) {
// This is not the main style for this level, add class and remember // This is not the main style for this level, add class and remember
info.sClass = styleNames.getExportName(sDisplayName); info.sClass = styleNames.addToExport(sDisplayName);
if (1<=nLevel && nLevel<=6) { if (1<=nLevel && nLevel<=6) {
otherLevelStyles.get(nLevel).add(sDisplayName); otherLevelStyles.get(nLevel).add(sDisplayName);
} }

View file

@ -73,7 +73,7 @@ public class ListStyleConverter extends StyleConverterHelper {
} }
else { else {
info.sClass = "listlevel"+Integer.toString(nLevel) info.sClass = "listlevel"+Integer.toString(nLevel)
+styleNames.getExportName(sDisplayName); +styleNames.addToExport(sDisplayName);
} }
} }
} }
@ -99,7 +99,7 @@ public class ListStyleConverter extends StyleConverterHelper {
buf.append(sIndent); buf.append(sIndent);
buf.append(".listlevel"); buf.append(".listlevel");
buf.append(nLevel); buf.append(nLevel);
buf.append(styleNames.getExportName(sDisplayName)); buf.append(styleNames.addToExport(sDisplayName));
buf.append(" {"); buf.append(" {");
buf.append(props.toString()); buf.append(props.toString());
buf.append("}"); buf.append("}");
@ -112,7 +112,7 @@ public class ListStyleConverter extends StyleConverterHelper {
buf.append(sIndent) buf.append(sIndent)
.append(".listlevel") .append(".listlevel")
.append(nLevel) .append(nLevel)
.append(styleNames.getExportName(sDisplayName)) .append(styleNames.addToExport(sDisplayName))
.append(" p {").append(parProps.toString()).append("}").append(config.prettyPrint() ? "\n" : " "); .append(" p {").append(parProps.toString()).append("}").append(config.prettyPrint() ? "\n" : " ");
} }
} }

View file

@ -120,7 +120,7 @@ public class PageStyleConverter extends StyleConverterHelper {
String sDisplayName = masterPage.getDisplayName(); String sDisplayName = masterPage.getDisplayName();
if (ofr.isPresentation()) { if (ofr.isPresentation()) {
// Always generates class name // Always generates class name
info.sClass="masterpage"+styleNames.getExportName(sDisplayName); info.sClass="masterpage"+styleNames.addToExport(sDisplayName);
} }
} }
} }
@ -152,7 +152,7 @@ public class PageStyleConverter extends StyleConverterHelper {
} }
// Then export the results // Then export the results
buf.append(sIndent) buf.append(sIndent)
.append(".masterpage").append(styleNames.getExportName(sDisplayName)) .append(".masterpage").append(styleNames.addToExport(sDisplayName))
.append(" {").append(info.props.toString()).append("}") .append(" {").append(info.props.toString()).append("}")
.append(config.prettyPrint() ? "\n" : " "); .append(config.prettyPrint() ? "\n" : " ");
} }

View file

@ -100,7 +100,7 @@ public class PresentationStyleConverter extends FrameStyleConverter {
if (!props.isEmpty()) { if (!props.isEmpty()) {
buf.append(sIndent) buf.append(sIndent)
.append("li.outline") .append("li.outline")
.append(styleNames.getExportName(sDisplayName)) .append(styleNames.addToExport(sDisplayName))
.append(" p {").append(props.toString()).append("}") .append(" p {").append(props.toString()).append("}")
.append(config.prettyPrint() ? "\n" : " "); .append(config.prettyPrint() ? "\n" : " ");
} }
@ -147,7 +147,7 @@ public class PresentationStyleConverter extends FrameStyleConverter {
public void applyOutlineStyle(int nLevel, StyleInfo info) { public void applyOutlineStyle(int nLevel, StyleInfo info) {
if (2<=nLevel && nLevel<=9 && sCurrentOutlineStyle!=null) { if (2<=nLevel && nLevel<=9 && sCurrentOutlineStyle!=null) {
if (outlineStyles.containsKey(sCurrentOutlineStyle)) { if (outlineStyles.containsKey(sCurrentOutlineStyle)) {
info.sClass = "outline"+outlineStyleNames.getExportName(outlineStyles.get(sCurrentOutlineStyle)[nLevel]); info.sClass = "outline"+outlineStyleNames.addToExport(outlineStyles.get(sCurrentOutlineStyle)[nLevel]);
} }
} }
} }

View file

@ -83,7 +83,7 @@ public abstract class StyleWithPropertiesConverterHelper
else { else {
// Generate class name from display name // Generate class name from display name
info.sClass = getClassNamePrefix() info.sClass = getClassNamePrefix()
+ styleNames.getExportName(sDisplayName); + styleNames.addToExport(sDisplayName);
} }
} }
} }
@ -107,7 +107,7 @@ public abstract class StyleWithPropertiesConverterHelper
buf.append(getDefaultTagName(null)); buf.append(getDefaultTagName(null));
buf.append("."); buf.append(".");
buf.append(getClassNamePrefix()); buf.append(getClassNamePrefix());
buf.append(styleNames.getExportName(sDisplayName)); buf.append(styleNames.addToExport(sDisplayName));
buf.append(" {"); buf.append(" {");
buf.append(props.toString()); buf.append(props.toString());
buf.append("}"); buf.append("}");

View file

@ -132,11 +132,11 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
// This combination is not seen before, but the base style may be known // This combination is not seen before, but the base style may be known
// In that case, use the visited style name as well // In that case, use the visited style name as well
if (anchorStyleNames.containsName(sStyleName)) { if (anchorStyleNames.containsName(sStyleName)) {
sExportName = anchorStyleNames.getExportName(sStyleName) sExportName = anchorStyleNames.addToExport(sStyleName)
+anchorVisitedStyleNames.getExportName(sVisitedStyleName); +anchorVisitedStyleNames.addToExport(sVisitedStyleName);
} }
else { else {
sExportName = anchorStyleNames.getExportName(sStyleName); sExportName = anchorStyleNames.addToExport(sStyleName);
} }
anchorCombinedStyleNames.put(sName,sExportName); anchorCombinedStyleNames.put(sName,sExportName);
orgAnchorStyleNames.put(sExportName,sStyleName); orgAnchorStyleNames.put(sExportName,sStyleName);