diff --git a/source/distro/changelog.txt b/source/distro/changelog.txt
index 3e4a1c7..4e1b200 100644
--- a/source/distro/changelog.txt
+++ b/source/distro/changelog.txt
@@ -2,6 +2,9 @@ Changelog for Writer2LaTeX version 1.4 -> 1.6
---------- version 1.5.1 ----------
-[w2x] Added toolbar with two buttons to publish directly to XHTML/EPUB.
+[w2x] Added toolbar with four buttons: Publish directly to XHTML, publish directly to EPUB, edit EPUB metadata
+ and edit custom configuration. Publishing directly implies that the export dialog is not displayed. Instead
+ the document will be exported to the same directory as the currently open document and with the same name.
+ This feature bypasses the filter logic, which gives a significant performance gain for large documents.
[all] Filter: Refactored filter code, the actual conversion has been separated from the XExportFilter implementation
\ No newline at end of file
diff --git a/source/java/org/openoffice/da/comp/w2lcommon/filter/UNOPublisher.java b/source/java/org/openoffice/da/comp/w2lcommon/filter/UNOPublisher.java
new file mode 100644
index 0000000..9d9e621
--- /dev/null
+++ b/source/java/org/openoffice/da/comp/w2lcommon/filter/UNOPublisher.java
@@ -0,0 +1,253 @@
+/************************************************************************
+ *
+ * UNOPublisher.java
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * Copyright: 2002-2014 by Henrik Just
+ *
+ * All Rights Reserved.
+ *
+ * Version 1.6 (2014-10-22)
+ *
+ */
+package org.openoffice.da.comp.w2lcommon.filter;
+
+import java.io.IOException;
+
+import org.openoffice.da.comp.w2lcommon.helper.MessageBox;
+import writer2latex.util.Misc;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertyAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XFrame;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XStorable;
+import com.sun.star.io.XInputStream;
+import com.sun.star.task.XStatusIndicator;
+import com.sun.star.task.XStatusIndicatorFactory;
+import com.sun.star.ucb.XSimpleFileAccess2;
+import com.sun.star.ui.dialogs.ExecutableDialogResults;
+import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.util.XModifiable;
+
+/** This class converts an open office document to another format
+ */
+public class UNOPublisher {
+
+ public enum TargetFormat { xhtml, xhtml11, xhtml_mathml, html5, epub, latex };
+
+ private XComponentContext xContext;
+ private XFrame xFrame;
+ private XModel xModel=null;
+ private PropertyValue[] mediaProps = null;
+
+ /** Create a new UNOPublisher
based on a loaded office document
+ *
+ * @param xContext the component context from which new UNO services are instantiated
+ * @param xFrame the current frame
+ */
+ public UNOPublisher(XComponentContext xContext, XFrame xFrame) {
+ this.xContext = xContext;
+ this.xFrame = xFrame;
+ // Get the model for the document from the frame
+ XController xController = xFrame.getController();
+ if (xController!=null) {
+ xModel = xController.getModel();
+ }
+ }
+
+ /** Publish the document associated with this UNOPublisher
. This involves four steps:
+ * (1) Check that the document is saved in the local file system.
+ * (2) Display the options dialog.
+ * (3) Save the document (if the modified flag is true).
+ * (4) Convert the document.
+ *
+ * @param format the target format
+ * @return the URL of the converted document, or null if the document was not converted
+ */
+ public String publish(TargetFormat format) {
+ if (documentSaved() && updateMediaProperties(format)) {
+ // Create a (somewhat coarse grained) status indicator/progress bar
+ XStatusIndicatorFactory xFactory = (com.sun.star.task.XStatusIndicatorFactory)
+ UnoRuntime.queryInterface(com.sun.star.task.XStatusIndicatorFactory.class, xFrame);
+ XStatusIndicator xStatus = xFactory.createStatusIndicator();
+ xStatus.start("Writer2xhtml",10);
+ xStatus.setValue(1); // At least we have started, that's 10% :-)
+
+ try {
+ // Save document if required
+ saveDocument();
+ xStatus.setValue(4);
+
+ // Convert to desired format
+ UNOConverter converter = new UNOConverter(mediaProps, xContext);
+ // Initialize the file access (to read the office document)
+ XSimpleFileAccess2 sfa2 = null;
+ try {
+ Object sfaObject = xContext.getServiceManager().createInstanceWithContext(
+ "com.sun.star.ucb.SimpleFileAccess", xContext);
+ sfa2 = (XSimpleFileAccess2) UnoRuntime.queryInterface(XSimpleFileAccess2.class, sfaObject);
+ }
+ catch (com.sun.star.uno.Exception e) {
+ // failed to get SimpleFileAccess service (should not happen)
+ }
+ XInputStream xis = sfa2.openFileRead(xModel.getURL());
+ converter.convert(xis);
+ xis.closeInput();
+ }
+ catch (IOException e) {
+ xStatus.end();
+ MessageBox msgBox = new MessageBox(xContext, xFrame);
+ msgBox.showMessage("Writer2xhtml","Error: Failed to export document");
+ return null;
+ }
+ catch (com.sun.star.uno.Exception e) {
+ xStatus.end();
+ MessageBox msgBox = new MessageBox(xContext, xFrame);
+ msgBox.showMessage("Writer2xhtml","Error: Failed to export document");
+ return null;
+ }
+ xStatus.setValue(10); // Export is finished (The user will usually not see this...)
+ xStatus.end();
+ return getTargetURL(format);
+ }
+ return null;
+ }
+
+ private boolean documentSaved() {
+ String sDocumentUrl = xModel.getURL();
+ if (sDocumentUrl.length()==0) { // The document has no location
+ MessageBox msgBox = new MessageBox(xContext, xFrame);
+ msgBox.showMessage("Writer2xhtml","Please save the document before publishing the file");
+ return false;
+ }
+ else if (!".odt".equals(Misc.getFileExtension(sDocumentUrl)) && !".fodt".equals(Misc.getFileExtension(sDocumentUrl))) {
+ MessageBox msgBox = new MessageBox(xContext, xFrame);
+ msgBox.showMessage("Writer2xhtml","Please save the document in OpenDocument format (.odt)");
+ return false;
+ }
+ else if (!sDocumentUrl.startsWith("file:")) {
+ MessageBox msgBox = new MessageBox(xContext, xFrame);
+ msgBox.showMessage("Writer2xhtml","Please save the document in the local file system");
+ return false;
+ }
+ return true;
+ }
+
+ private boolean saveDocument() {
+ XModifiable xModifiable = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, xModel);
+ if (xModifiable.isModified()) { // The document is modified and need to be saved
+ XStorable xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xModel);
+ try {
+ xStorable.store();
+ } catch (com.sun.star.io.IOException e) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // Some utility methods
+ private String getTargetURL(TargetFormat format) {
+ return Misc.removeExtension(xModel.getURL())+getTargetExtension(format);
+ }
+
+ private void prepareMediaProperties(TargetFormat format) {
+ // Create inital media properties
+ mediaProps = new PropertyValue[2];
+ mediaProps[0] = new PropertyValue();
+ mediaProps[0].Name = "FilterName";
+ mediaProps[0].Value = getFilterName(format);
+ mediaProps[1] = new PropertyValue();
+ mediaProps[1].Name = "URL";
+ mediaProps[1].Value = getTargetURL(format);
+ }
+
+ private boolean updateMediaProperties(TargetFormat format) {
+ prepareMediaProperties(format);
+
+ try {
+ // Display options dialog
+ Object dialog = xContext.getServiceManager()
+ .createInstanceWithContext(getDialogName(format), xContext);
+
+ XPropertyAccess xPropertyAccess = (XPropertyAccess)
+ UnoRuntime.queryInterface(XPropertyAccess.class, dialog);
+ xPropertyAccess.setPropertyValues(mediaProps);
+
+ XExecutableDialog xDialog = (XExecutableDialog)
+ UnoRuntime.queryInterface(XExecutableDialog.class, dialog);
+ if (xDialog.execute()==ExecutableDialogResults.OK) {
+ mediaProps = xPropertyAccess.getPropertyValues();
+ return true;
+ }
+ else {
+ mediaProps = null;
+ return false;
+ }
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e) {
+ // setPropertyValues will not fail..
+ mediaProps = null;
+ return false;
+ }
+ catch (com.sun.star.uno.Exception e) {
+ // getServiceManager will not fail..
+ mediaProps = null;
+ return false;
+ }
+ }
+
+ private static String getTargetExtension(TargetFormat format) {
+ switch (format) {
+ case xhtml: return ".html";
+ case xhtml11: return ".xhtml";
+ case xhtml_mathml: return ".xhtml";
+ case html5: return ".html";
+ case epub: return ".epub";
+ case latex: return ".tex";
+ default: return "";
+ }
+ }
+
+ private static String getDialogName(TargetFormat format) {
+ switch (format) {
+ case xhtml: return "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialog";
+ case xhtml11: return "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialog";
+ case xhtml_mathml: return "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialogMath";
+ case html5: return "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialogMath";
+ case epub: return "org.openoffice.da.comp.writer2xhtml.EpubOptionsDialog";
+ case latex: return "org.openoffice.da.comp.writer2xhtml.LaTeXOptionsDialog";
+ default: return "";
+ }
+ }
+
+ private static String getFilterName(TargetFormat format) {
+ switch (format) {
+ case xhtml: return "org.openoffice.da.writer2xhtml";
+ case xhtml11: return "org.openoffice.da.writer2xhtml11";
+ case xhtml_mathml: return "org.openoffice.da.writer2xhtml.mathml";
+ case html5: return "org.openoffice.da.writer2xhtml5";
+ case epub: return "org.openoffice.da.writer2xhtml.epub";
+ case latex: return "org.openoffice.da.writer2latex.latex";
+ default: return "";
+ }
+ }
+
+}
diff --git a/source/java/org/openoffice/da/comp/writer2xhtml/Writer2xhtml.java b/source/java/org/openoffice/da/comp/writer2xhtml/Writer2xhtml.java
index 7467b29..50d30f7 100644
--- a/source/java/org/openoffice/da/comp/writer2xhtml/Writer2xhtml.java
+++ b/source/java/org/openoffice/da/comp/writer2xhtml/Writer2xhtml.java
@@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
- * Version 1.6 (2014-10-09)
+ * Version 1.6 (2014-10-21)
*
*/
@@ -33,27 +33,20 @@ import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+
import com.sun.star.beans.PropertyValue;
-import com.sun.star.beans.XPropertyAccess;
-import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatchHelper;
+import com.sun.star.frame.XDispatchProvider;
import com.sun.star.frame.XFrame;
-import com.sun.star.frame.XModel;
-import com.sun.star.frame.XStorable;
-import com.sun.star.io.XInputStream;
+import com.sun.star.lang.XComponent;
import com.sun.star.lib.uno.helper.WeakBase;
-import com.sun.star.task.XStatusIndicator;
-import com.sun.star.task.XStatusIndicatorFactory;
-import com.sun.star.ucb.XSimpleFileAccess2;
-import com.sun.star.ui.dialogs.ExecutableDialogResults;
import com.sun.star.ui.dialogs.XExecutableDialog;
+import com.sun.star.uno.Exception;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
-import com.sun.star.util.XModifiable;
-
-import org.openoffice.da.comp.w2lcommon.filter.UNOConverter;
+import org.openoffice.da.comp.w2lcommon.filter.UNOPublisher;
+import org.openoffice.da.comp.w2lcommon.filter.UNOPublisher.TargetFormat;
import org.openoffice.da.comp.w2lcommon.helper.MessageBox;
-
-import writer2latex.util.Misc;
/** This class implements the ui (dispatch) commands provided by Writer2xhtml.
*/
@@ -65,56 +58,19 @@ public final class Writer2xhtml extends WeakBase
private static final String PROTOCOL = "org.openoffice.da.writer2xhtml:";
- private enum TargetFormat { xhtml, xhtml11, xhtml_mathml, html5, epub };
-
// From constructor+initialization
private final XComponentContext m_xContext;
private XFrame m_xFrame;
- private XModel xModel = null;
+ private UNOPublisher unoPublisher = null;
// Global data
- private PropertyValue[] mediaProps = null;
-
public static final String __implementationName = Writer2xhtml.class.getName();
public static final String __serviceName = "com.sun.star.frame.ProtocolHandler";
private static final String[] m_serviceNames = { __serviceName };
// TODO: These should be configurable
private TargetFormat xhtmlFormat = TargetFormat.xhtml_mathml;
- private TargetFormat epubFormat = TargetFormat.epub;
-
- private String getTargetExtension(TargetFormat format) {
- switch (format) {
- case xhtml: return ".html";
- case xhtml11: return ".xhtml";
- case xhtml_mathml: return ".xhtml";
- case html5: return ".html";
- case epub: return ".epub";
- default: return "";
- }
- }
-
- private String getDialogName(TargetFormat format) {
- switch (format) {
- case xhtml: return "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialog";
- case xhtml11: return "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialog";
- case xhtml_mathml: return "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialogMath";
- case html5: return "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialogMath";
- case epub: return "org.openoffice.da.comp.writer2xhtml.EpubOptionsDialog";
- default: return "";
- }
- }
-
- private String getFilterName(TargetFormat format) {
- switch (format) {
- case xhtml: return "org.openoffice.da.writer2xhtml";
- case xhtml11: return "org.openoffice.da.writer2xhtml11";
- case xhtml_mathml: return "org.openoffice.da.writer2xhtml.mathml";
- case html5: return "org.openoffice.da.writer2xhtml5";
- case epub: return "org.openoffice.da.writer2xhtml.epub";
- default: return "";
- }
- }
+ private TargetFormat epubFormat = TargetFormat.epub;
public Writer2xhtml(XComponentContext xContext) {
m_xContext = xContext;
@@ -127,11 +83,6 @@ public final class Writer2xhtml extends WeakBase
// The first item is the current frame
m_xFrame = (com.sun.star.frame.XFrame) UnoRuntime.queryInterface(
com.sun.star.frame.XFrame.class, object[0]);
- // Get the model for the document from the frame
- XController xController = m_xFrame.getController();
- if (xController!=null) {
- xModel = xController.getModel();
- }
}
}
@@ -163,6 +114,8 @@ public final class Writer2xhtml extends WeakBase
return this;
else if ( aURL.Path.compareTo("PublishAsEPUB") == 0 )
return this;
+ else if ( aURL.Path.compareTo("EditEPUBDocumentProperties") == 0 )
+ return this;
}
return null;
}
@@ -186,7 +139,6 @@ public final class Writer2xhtml extends WeakBase
public void dispatch( com.sun.star.util.URL aURL,
com.sun.star.beans.PropertyValue[] aArguments ) {
if ( aURL.Protocol.compareTo(PROTOCOL) == 0 ) {
- System.out.println(aURL.Protocol+" "+aURL.Path);
if ( aURL.Path.compareTo("PublishAsXHTML") == 0 ) {
publish(xhtmlFormat);
return;
@@ -195,6 +147,10 @@ public final class Writer2xhtml extends WeakBase
publish(epubFormat);
return;
}
+ else if ( aURL.Path.compareTo("EditEPUBDocumentProperties") == 0 ) {
+ editDocumentProperties();
+ return;
+ }
}
}
@@ -207,141 +163,43 @@ public final class Writer2xhtml extends WeakBase
}
// The actual commands...
+ private void editDocumentProperties() {
+ Object dialog;
+ try {
+ dialog = m_xContext.getServiceManager().createInstanceWithContext("org.openoffice.da.writer2xhtml.EpubMetadataDialog", m_xContext);
+ XExecutableDialog xDialog = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, dialog);
+ xDialog.execute();
+ // Dispose the dialog after execution (to free up the memory)
+ XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, dialog);
+ if (xComponent!=null) {
+ xComponent.dispose();
+ }
+ } catch (Exception e) {
+ // Failed to get dialog
+ }
+ }
private void publish(TargetFormat format) {
- if (saveDocument() && updateMediaProperties(xhtmlFormat)) {
- // Create a (somewhat coarse grained) status indicator/progress bar
- XStatusIndicatorFactory xFactory = (com.sun.star.task.XStatusIndicatorFactory)
- UnoRuntime.queryInterface(com.sun.star.task.XStatusIndicatorFactory.class, m_xFrame);
- XStatusIndicator xStatus = xFactory.createStatusIndicator();
- xStatus.start("Writer2xhtml",10);
- xStatus.setValue(1); // At least we have started, that's 10% :-)
-
- System.out.println("Document location "+xModel.getURL());
-
- try {
- // Convert to desired format
- UNOConverter converter = new UNOConverter(mediaProps, m_xContext);
- // Initialize the file access (to read the office document)
- XSimpleFileAccess2 sfa2 = null;
- try {
- Object sfaObject = m_xContext.getServiceManager().createInstanceWithContext(
- "com.sun.star.ucb.SimpleFileAccess", m_xContext);
- sfa2 = (XSimpleFileAccess2) UnoRuntime.queryInterface(XSimpleFileAccess2.class, sfaObject);
+ if (unoPublisher==null) {
+ unoPublisher = new UNOPublisher(m_xContext,m_xFrame);
+ }
+ String sTargetURL = unoPublisher.publish(format);
+ // Display the result
+ File file = urlToFile(sTargetURL);
+ if (file.exists()) {
+ // Open the file in the default application on this system (if any)
+ if (Desktop.isDesktopSupported()) {
+ Desktop desktop = Desktop.getDesktop();
+ try {
+ desktop.open(file);
+ } catch (IOException e) {
+ System.err.println(e.getMessage());
}
- catch (com.sun.star.uno.Exception e) {
- // failed to get SimpleFileAccess service (should not happen)
- }
- XInputStream xis = sfa2.openFileRead(xModel.getURL());
- converter.convert(xis);
- xis.closeInput();
- }
- catch (IOException | com.sun.star.uno.Exception e) {
- xStatus.end();
- MessageBox msgBox = new MessageBox(m_xContext, m_xFrame);
- msgBox.showMessage("Writer2xhtml Error","Failed to export document");
- return;
- }
- xStatus.setValue(6); // Export is finished, that's more than half :-)
-
- if (xModel.getURL().startsWith("file:")) {
- File file = urlToFile(getTargetURL(format));
- if (file.exists()) {
- // Open the file in the default application on this system (if any)
- if (Desktop.isDesktopSupported()) {
- Desktop desktop = Desktop.getDesktop();
- try {
- desktop.open(file);
- } catch (IOException e) {
- System.err.println(e.getMessage());
- }
- }
- }
- else {
- MessageBox msgBox = new MessageBox(m_xContext, m_xFrame);
- msgBox.showMessage("Writer2xhtml Error","Failed to open exported document");
- }
- }
- else {
- MessageBox msgBox = new MessageBox(m_xContext, m_xFrame);
- msgBox.showMessage("Writer2xhtml Error","Cannot open document on the location "+getTargetURL(format));
- }
-
- xStatus.setValue(10); // The user will usually not see this...
-
- xStatus.end();
+ }
}
- }
-
- private boolean saveDocument() {
- String sDocumentUrl = xModel.getURL();
- if (sDocumentUrl.length()!=0) { // The document has a location
- XModifiable xModifiable = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, xModel);
- if (xModifiable.isModified()) { // It is modified and need to be saved
- XStorable xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xModel);
- try {
- xStorable.store();
- } catch (com.sun.star.io.IOException e) {
- return false;
- }
- }
- }
- else { // No location, ask the user to save the document
+ else {
MessageBox msgBox = new MessageBox(m_xContext, m_xFrame);
- msgBox.showMessage("Document not saved!","Please save the document before publishing the file");
- return false;
- }
- return true;
- }
-
- // Some utility methods
- private String getTargetURL(TargetFormat format) {
- return Misc.removeExtension(xModel.getURL())+getTargetExtension(format);
- }
-
- private void prepareMediaProperties(TargetFormat format) {
- // Create inital media properties
- mediaProps = new PropertyValue[2];
- mediaProps[0] = new PropertyValue();
- mediaProps[0].Name = "FilterName";
- mediaProps[0].Value = getFilterName(format);
- mediaProps[1] = new PropertyValue();
- mediaProps[1].Name = "URL";
- mediaProps[1].Value = getTargetURL(format);
- }
-
- private boolean updateMediaProperties(TargetFormat format) {
- prepareMediaProperties(format);
-
- try {
- // Display options dialog
- Object dialog = m_xContext.getServiceManager()
- .createInstanceWithContext(getDialogName(format), m_xContext);
-
- XPropertyAccess xPropertyAccess = (XPropertyAccess)
- UnoRuntime.queryInterface(XPropertyAccess.class, dialog);
- xPropertyAccess.setPropertyValues(mediaProps);
-
- XExecutableDialog xDialog = (XExecutableDialog)
- UnoRuntime.queryInterface(XExecutableDialog.class, dialog);
- if (xDialog.execute()==ExecutableDialogResults.OK) {
- mediaProps = xPropertyAccess.getPropertyValues();
- return true;
- }
- else {
- mediaProps = null;
- return false;
- }
- }
- catch (com.sun.star.beans.UnknownPropertyException e) {
- // setPropertyValues will not fail..
- mediaProps = null;
- return false;
- }
- catch (com.sun.star.uno.Exception e) {
- // getServiceManager will not fail..
- mediaProps = null;
- return false;
+ msgBox.showMessage("Writer2xhtml","Error: Failed to open exported document");
}
}
@@ -353,6 +211,8 @@ public final class Writer2xhtml extends WeakBase
return new File(".");
}
}
+
+
}
\ No newline at end of file
diff --git a/source/java/writer2latex/api/ConverterFactory.java b/source/java/writer2latex/api/ConverterFactory.java
index 2b59025..8ce439f 100644
--- a/source/java/writer2latex/api/ConverterFactory.java
+++ b/source/java/writer2latex/api/ConverterFactory.java
@@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
- * Version 1.6 (2014-10-06)
+ * Version 1.6 (2014-10-22)
*
*/
@@ -33,7 +33,7 @@ public class ConverterFactory {
// Version information
private static final String VERSION = "1.5.1";
- private static final String DATE = "2014-10-06";
+ private static final String DATE = "2014-10-22";
/** Return the Writer2LaTeX version in the form
* (major version).(minor version).(patch level)
diff --git a/source/java/writer2latex/util/Misc.java b/source/java/writer2latex/util/Misc.java
index a45f6b4..8790e15 100644
--- a/source/java/writer2latex/util/Misc.java
+++ b/source/java/writer2latex/util/Misc.java
@@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
- * Version 1.4 (2014-10-10)
+ * Version 1.4 (2014-10-21)
*
*/
@@ -33,7 +33,6 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.Math;
import java.net.URI;
-import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.net.URLDecoder;
import java.text.Collator;
@@ -44,7 +43,6 @@ import java.util.Arrays;
import java.util.Date;
import java.util.Locale;
import java.util.Set;
-//import java.util.Hashtable;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -303,14 +301,7 @@ public class Misc{
* @return the file name
*/
public static final String getFileName(String sURL) {
- try {
- URI uri = new URI(sURL);
- String sPath = uri.getPath();
- return sPath.substring(sPath.lastIndexOf('/')+1);
- } catch (URISyntaxException e) {
- e.printStackTrace();
- return "";
- }
+ return sURL.substring(sURL.lastIndexOf('/')+1);
}
/** Get the file extension from an URL
diff --git a/source/oxt/writer2xhtml/Addons.xcu b/source/oxt/writer2xhtml/Addons.xcu
index 41bfb93..169d50e 100644
--- a/source/oxt/writer2xhtml/Addons.xcu
+++ b/source/oxt/writer2xhtml/Addons.xcu
@@ -8,24 +8,6 @@
com.sun.star.text.TextDocument
-
- Publish as EPUB
- Publicer som EPUB
-
-
- _self
-
-
- org.openoffice.da.writer2xhtml:PublishAsEPUB
-
-
- %origin%/icons/epub
-
-
-
-
- com.sun.star.text.TextDocument
-
Publish as XHTML
Publicer som XHTML
@@ -40,6 +22,60 @@
%origin%/icons/html5
+
+
+ com.sun.star.text.TextDocument
+
+
+ Publish as EPUB
+ Publicer som EPUB
+
+
+ _self
+
+
+ org.openoffice.da.writer2xhtml:PublishAsEPUB
+
+
+ %origin%/icons/epub
+
+
+
+
+ com.sun.star.text.TextDocument
+
+
+ Edit EPUB document properties
+ Rediger EPUB-dokumentegenskaber
+
+
+ _self
+
+
+ org.openoffice.da.writer2xhtml:EditEPUBDocumentProperties
+
+
+ %origin%/icons/metadata
+
+
+
+
+ com.sun.star.text.TextDocument
+
+
+ Edit custom style
+ Rediger brugerdefineret typografi
+
+
+ _self
+
+
+ .uno:OptionsTreeDialog?OptionsPageURL:string=%origin%/W2XDialogs2/General.xdl
+
+
+ %origin%/icons/customh
+
+
diff --git a/source/oxt/writer2xhtml/icons/customh_16.bmp b/source/oxt/writer2xhtml/icons/customh_16.bmp
new file mode 100755
index 0000000..5fbc697
Binary files /dev/null and b/source/oxt/writer2xhtml/icons/customh_16.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/customh_26.bmp b/source/oxt/writer2xhtml/icons/customh_26.bmp
new file mode 100755
index 0000000..c502eca
Binary files /dev/null and b/source/oxt/writer2xhtml/icons/customh_26.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/epub_16.bmp b/source/oxt/writer2xhtml/icons/epub_16.bmp
index 0446323..01e99e3 100644
Binary files a/source/oxt/writer2xhtml/icons/epub_16.bmp and b/source/oxt/writer2xhtml/icons/epub_16.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/epub_16h.bmp b/source/oxt/writer2xhtml/icons/epub_16h.bmp
index da608c3..27e6954 100644
Binary files a/source/oxt/writer2xhtml/icons/epub_16h.bmp and b/source/oxt/writer2xhtml/icons/epub_16h.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/epub_26.bmp b/source/oxt/writer2xhtml/icons/epub_26.bmp
index 06f1ffa..ee3a0f9 100644
Binary files a/source/oxt/writer2xhtml/icons/epub_26.bmp and b/source/oxt/writer2xhtml/icons/epub_26.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/epub_26h.bmp b/source/oxt/writer2xhtml/icons/epub_26h.bmp
index fe561d6..6c7f22b 100644
Binary files a/source/oxt/writer2xhtml/icons/epub_26h.bmp and b/source/oxt/writer2xhtml/icons/epub_26h.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/html5_16.bmp b/source/oxt/writer2xhtml/icons/html5_16.bmp
index ad2b2f6..1671410 100644
Binary files a/source/oxt/writer2xhtml/icons/html5_16.bmp and b/source/oxt/writer2xhtml/icons/html5_16.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/html5_16h.bmp b/source/oxt/writer2xhtml/icons/html5_16h.bmp
index 04491b2..e5de010 100644
Binary files a/source/oxt/writer2xhtml/icons/html5_16h.bmp and b/source/oxt/writer2xhtml/icons/html5_16h.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/html5_26.bmp b/source/oxt/writer2xhtml/icons/html5_26.bmp
index 0ab5dc1..c64de21 100644
Binary files a/source/oxt/writer2xhtml/icons/html5_26.bmp and b/source/oxt/writer2xhtml/icons/html5_26.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/html5_26h.bmp b/source/oxt/writer2xhtml/icons/html5_26h.bmp
index 1a93e05..9a19d1f 100644
Binary files a/source/oxt/writer2xhtml/icons/html5_26h.bmp and b/source/oxt/writer2xhtml/icons/html5_26h.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/metadata_16.bmp b/source/oxt/writer2xhtml/icons/metadata_16.bmp
new file mode 100755
index 0000000..32924a5
Binary files /dev/null and b/source/oxt/writer2xhtml/icons/metadata_16.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/metadata_16h.bmp b/source/oxt/writer2xhtml/icons/metadata_16h.bmp
new file mode 100755
index 0000000..b39510a
Binary files /dev/null and b/source/oxt/writer2xhtml/icons/metadata_16h.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/metadata_26.bmp b/source/oxt/writer2xhtml/icons/metadata_26.bmp
new file mode 100755
index 0000000..796713a
Binary files /dev/null and b/source/oxt/writer2xhtml/icons/metadata_26.bmp differ
diff --git a/source/oxt/writer2xhtml/icons/metadata_26h.bmp b/source/oxt/writer2xhtml/icons/metadata_26h.bmp
new file mode 100755
index 0000000..1199cfd
Binary files /dev/null and b/source/oxt/writer2xhtml/icons/metadata_26h.bmp differ