commit 25fbec095f251340d1bb0178a18e7459dd111b00
parent f1d0a3c1af62d3ac983dcce6d7bd79986c271ed8
Author: Simon Kornblith <simon@simonster.com>
Date: Mon, 31 Jan 2011 20:16:06 +0000
fix hasBibliography call for dependent styles
Diffstat:
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js
@@ -447,7 +447,22 @@ Zotero.Style.prototype.__defineGetter__("hasBibliography",
* @type String
*/
function() {
- if(!this._hasBibliography) this.getXML();
+ if(this.source) {
+ // use hasBibliography from source style
+ var parentStyle = Zotero.Styles.get(this.source);
+ if(!parentStyle) {
+ throw(new Error('Style references '+this.source+', but this style is not installed',
+ Zotero.Styles.ios.newFileURI(this.file).spec, null));
+ }
+ return parentStyle.hasBibliography;
+ }
+
+ if(!this._hasBibliography) {
+ // if we don't know whether this style has a bibliography, it's because it's an ens style
+ // and we have to parse it to know
+ this.getXML();
+ }
+
return this._hasBibliography;
});