Zotero integration + EPUB split + a few other fixes
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@76 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
b415705e47
commit
2174e5cbf5
13 changed files with 2323 additions and 74 deletions
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.2 (2010-05-17)
|
||||
* Version 1.2 (2010-10-30)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -201,12 +201,7 @@ public class Converter extends ConverterBase {
|
|||
// Set locale to document language
|
||||
StyleWithProperties style = ofr.isSpreadsheet() ? ofr.getDefaultCellStyle() : ofr.getDefaultParStyle();
|
||||
if (style!=null) {
|
||||
String sLang = style.getProperty(XMLString.FO_LANGUAGE);
|
||||
String sCountry = style.getProperty(XMLString.FO_COUNTRY);
|
||||
if (sLang!=null) {
|
||||
if (sCountry==null) { l10n.setLocale(sLang); }
|
||||
else { l10n.setLocale(sLang+"-"+sCountry); }
|
||||
}
|
||||
l10n.setLocale(style.getProperty(XMLString.FO_LANGUAGE), style.getProperty(XMLString.FO_COUNTRY));
|
||||
}
|
||||
|
||||
// Traverse the body
|
||||
|
@ -463,16 +458,32 @@ public class Converter extends ConverterBase {
|
|||
|
||||
public void handleOfficeAnnotation(Node onode, Node hnode) {
|
||||
if (config.xhtmlNotes()) {
|
||||
// Extract the text from the paragraphs, seperate paragraphs with newline
|
||||
// Extract the text from the paragraphs, separate paragraphs with newline
|
||||
StringBuffer buf = new StringBuffer();
|
||||
Element creator = null;
|
||||
Element date = null;
|
||||
Node child = onode.getFirstChild();
|
||||
while (child!=null) {
|
||||
if (Misc.isElement(child, XMLString.TEXT_P)) {
|
||||
if (buf.length()>0) { buf.append('\n'); }
|
||||
buf.append(getPlainInlineText(child));
|
||||
}
|
||||
else if (Misc.isElement(child, XMLString.DC_CREATOR)) {
|
||||
creator = (Element) child;
|
||||
}
|
||||
else if (Misc.isElement(child, XMLString.DC_DATE)) {
|
||||
date = (Element) child;
|
||||
}
|
||||
child = child.getNextSibling();
|
||||
}
|
||||
if (creator!=null) {
|
||||
if (buf.length()>0) { buf.append('\n'); }
|
||||
buf.append(getPlainInlineText(creator));
|
||||
}
|
||||
if (date!=null) {
|
||||
if (buf.length()>0) { buf.append('\n'); }
|
||||
buf.append(Misc.formatDate(ofr.getTextContent(date), l10n.getLocale().getLanguage(), l10n.getLocale().getCountry()));
|
||||
}
|
||||
Node commentNode = htmlDOM.createComment(buf.toString());
|
||||
hnode.appendChild(commentNode);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue