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:
henrikjust 2014-08-04 08:11:41 +00:00
parent d62ce9ad22
commit 8d15813690
4 changed files with 18 additions and 42 deletions

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2011 by Henrik Just
* Copyright: 2002-2014 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2011-06-07)
* Version 1.3.1 (2014-08-04)
*
*/
@ -33,7 +33,7 @@ import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertyAccess;
import com.sun.star.beans.XPropertySet;
import com.sun.star.container.XNameAccess;
import com.sun.star.document.XDocumentInfoSupplier;
import com.sun.star.document.XDocumentPropertiesSupplier;
import com.sun.star.frame.XDesktop;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiServiceFactory;
@ -179,13 +179,9 @@ public abstract class OptionsDialogBase extends DialogBase implements
XComponent xComponent = xDesktop.getCurrentComponent();
// Get the document info property set
XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier)
UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xComponent);
Object docInfo = xDocInfoSuppl.getDocumentInfo();
XPropertySet xDocInfo = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, docInfo);
return XPropertySetHelper.getPropertyValueAsString(xDocInfo,"Template");
XDocumentPropertiesSupplier xDocPropsSuppl =
UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xComponent);
return xDocPropsSuppl.getDocumentProperties().getTemplateName();
}
catch (Exception e) {
return "";