[writer2latex] Adapt to LibreOffice 4.0 API changes

sbergmann sbergmann at fedoraproject.org
Fri Feb 22 16:04:38 UTC 2013


commit 2455ca7e3d94bc2ec76e9716d4950006e7c0fffd
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 22 16:21:08 2013 +0100

    Adapt to LibreOffice 4.0 API changes

 XDocumentPropertiesSupplier.patch |   30 ++++++++++++++++++++++++++++++
 writer2latex.spec                 |    5 +++++
 2 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/XDocumentPropertiesSupplier.patch b/XDocumentPropertiesSupplier.patch
new file mode 100644
index 0000000..94b3d98
--- /dev/null
+++ b/XDocumentPropertiesSupplier.patch
@@ -0,0 +1,30 @@
+Index: trunk/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java
+===================================================================
+--- trunk/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java	(revision 150)
++++ trunk/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java	(working copy)
+@@ -33,7 +33,7 @@
+ 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 @@
+             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 "";
diff --git a/writer2latex.spec b/writer2latex.spec
index d800678..e76ac88 100644
--- a/writer2latex.spec
+++ b/writer2latex.spec
@@ -9,6 +9,10 @@ License:       LGPLv2
 Url:           http://writer2latex.sourceforge.net/
 Source0:       http://writer2latex.svn.sourceforge.net/viewvc/writer2latex/tags/%{version}.tar.gz
 Patch0:        writer2latex05.rh.patch
+Patch1:        XDocumentPropertiesSupplier.patch
+    # upstreamed as <https://sourceforge.net/tracker/?func=detail&aid=3605657&
+    # group_id=253780&atid=1313919> "LibreOffice 4 doesn't show LaTeX Options
+    # dialog upon export"
 BuildRequires: ant, libreoffice-core
 Group:         Text Processing/Markup/XML
 Buildroot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -67,6 +71,7 @@ XHTML export filters.
 %prep
 %setup -q -n %{version}
 %patch0 -p1 -b .rh.patch
+%patch1 -p1 -b .XDocumentPropertiesSupplier.patch
 sed -i -e 's#name="OFFICE_CLASSES" location="/usr/share/java/openoffice"#name="OFFICE_CLASSES" location="%{_libdir}/libreoffice/program/classes"#' build.xml
 sed -i -e 's#name="URE_CLASSES" location="/usr/share/java/openoffice"#name="URE_CLASSES" location="%{_libdir}/libreoffice/ure/share/java"#' build.xml
 


More information about the scm-commits mailing list