Patch from r151 applied to trunk + some minor edits
git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@154 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
parent
d62ce9ad22
commit
8d15813690
4 changed files with 18 additions and 42 deletions
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Version 1.0 (2009-02-16)
|
||||
* Version 1.3.1 (2014-08-04)
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -34,15 +34,13 @@ import java.net.URISyntaxException;
|
|||
import com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter;
|
||||
import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter;
|
||||
import com.sun.star.beans.PropertyValue;
|
||||
import com.sun.star.beans.UnknownPropertyException;
|
||||
import com.sun.star.beans.XPropertySet;
|
||||
import com.sun.star.document.XDocumentInfoSupplier;
|
||||
import com.sun.star.document.XDocumentProperties;
|
||||
import com.sun.star.document.XDocumentPropertiesSupplier;
|
||||
import com.sun.star.frame.XComponentLoader;
|
||||
import com.sun.star.frame.XStorable;
|
||||
import com.sun.star.io.NotConnectedException;
|
||||
import com.sun.star.io.XInputStream;
|
||||
import com.sun.star.io.XOutputStream;
|
||||
import com.sun.star.lang.WrappedTargetException;
|
||||
import com.sun.star.lang.XComponent;
|
||||
import com.sun.star.lang.XServiceInfo;
|
||||
import com.sun.star.lang.XServiceName;
|
||||
|
@ -367,32 +365,14 @@ public class BatchConverter implements
|
|||
}
|
||||
|
||||
// Get the title and the description of the document
|
||||
XDocumentInfoSupplier docInfo = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xDocument);
|
||||
XPropertySet infoProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, docInfo.getDocumentInfo());
|
||||
if (infoProps!=null) {
|
||||
try {
|
||||
Object loadedTitle = infoProps.getPropertyValue("Title");
|
||||
if (AnyConverter.isString(loadedTitle)) {
|
||||
String sLoadedTitle = AnyConverter.toString(loadedTitle);
|
||||
if (bUseTitle && sLoadedTitle.length()>0) {
|
||||
entry.setDisplayName(sLoadedTitle);
|
||||
}
|
||||
}
|
||||
|
||||
Object loadedDescription = infoProps.getPropertyValue("Description");
|
||||
if (AnyConverter.isString(loadedDescription)) {
|
||||
String sLoadedDescription = AnyConverter.toString(loadedDescription);
|
||||
if (bUseDescription && sLoadedDescription.length()>0) {
|
||||
entry.setDescription(sLoadedDescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (UnknownPropertyException e) {
|
||||
}
|
||||
catch (WrappedTargetException e) {
|
||||
}
|
||||
catch (com.sun.star.lang.IllegalArgumentException e) {
|
||||
}
|
||||
XDocumentProperties docProps = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xDocument).getDocumentProperties();
|
||||
String loadedTitle = docProps.getTitle();
|
||||
if (bUseTitle && loadedTitle.length()>0) {
|
||||
entry.setDisplayName(loadedTitle);
|
||||
}
|
||||
String loadedDescription = docProps.getDescription();
|
||||
if (bUseDescription && loadedDescription.length()>0) {
|
||||
entry.setDescription(loadedDescription);
|
||||
}
|
||||
|
||||
// Determine the type of the component
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue