From 5e9dfc86787cdbad061ab44cef03be2eaaaf8f8d Mon Sep 17 00:00:00 2001 From: henrikjust Date: Wed, 1 Jul 2015 07:11:19 +0000 Subject: [PATCH] w2l BibTeX bugfixes git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@262 f0f2a975-2e09-46c8-9428-3b39399b9f3c --- source/java/writer2latex/bibtex/BibTeXDocument.java | 5 +++-- source/java/writer2latex/latex/BibConverter.java | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/java/writer2latex/bibtex/BibTeXDocument.java b/source/java/writer2latex/bibtex/BibTeXDocument.java index 1c4314b..a885a26 100644 --- a/source/java/writer2latex/bibtex/BibTeXDocument.java +++ b/source/java/writer2latex/bibtex/BibTeXDocument.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.6 (2015-06-22) + * Version 1.6 (2015-07-01) * */ @@ -65,6 +65,7 @@ public class BibTeXDocument implements OutputFile { * @param ofr the office document */ public BibTeXDocument(String sName, boolean bIsMaster, OfficeReader ofr) { + this.sName = sName; this.bIsMaster = bIsMaster; loadEntries(ofr); // Use default config (only ascii, no extra font packages) @@ -87,7 +88,7 @@ public class BibTeXDocument implements OutputFile { * @return true if there is one or more entries in the document */ public boolean isEmpty() { - return entries.size()>0; + return entries.size()==0; } /** Get export name for an identifier diff --git a/source/java/writer2latex/latex/BibConverter.java b/source/java/writer2latex/latex/BibConverter.java index cdefb2c..1998676 100644 --- a/source/java/writer2latex/latex/BibConverter.java +++ b/source/java/writer2latex/latex/BibConverter.java @@ -20,7 +20,7 @@ * * All Rights Reserved. * - * Version 1.6 (2015-06-22) + * Version 1.6 (2015-07-01) * */ @@ -59,6 +59,7 @@ import writer2latex.util.Misc; class BibConverter extends ConverterHelper { private BibTeXDocument bibDoc = null; + private boolean bUseBibTeX; /** Construct a new BibConverter. * @@ -72,6 +73,9 @@ class BibConverter extends ConverterHelper { if (!(config.useBibtex() && config.externalBibtexFiles().length()>0)) { bibDoc = new BibTeXDocument(palette.getOutFileName(),false,ofr); } + + // We need to export it + bUseBibTeX = config.useBibtex(); } /** Export the bibliography directly as a thebibliography environment (as an alternative to using BibTeX) @@ -228,7 +232,7 @@ class BibConverter extends ConverterHelper { * @return the BiBTeXDocument, or null if no BibTeX file is needed */ BibTeXDocument getBibTeXDocument() { - if (bibDoc!=null && !bibDoc.isEmpty()) { + if (bUseBibTeX && bibDoc!=null && !bibDoc.isEmpty()) { return bibDoc; } return null;