[Libreoffice-commits] .: 3 commits - editeng/inc sfx2/source sysui/desktop

Caolán McNamara caolan at kemper.freedesktop.org
Thu Apr 7 03:02:43 PDT 2011


 editeng/inc/editeng/splwrap.hxx                 |    2 -
 sfx2/source/appl/imestatuswindow.cxx            |   47 ++++++++++++++++++++++--
 sfx2/source/appl/imestatuswindow.hxx            |    2 +
 sysui/desktop/debian/postinst                   |    1 
 sysui/desktop/menus/writer.desktop              |    2 -
 sysui/desktop/mimetypes/openoffice.applications |    2 -
 sysui/desktop/redhat/redhat-menus.spec          |    1 
 sysui/desktop/solaris/mailcap                   |    1 
 sysui/desktop/suse/suse-menus.spec              |    1 
 9 files changed, 53 insertions(+), 6 deletions(-)

New commits:
commit 126dca023ae7ec45c448e671ca7e551789b7c73a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 7 09:58:10 2011 +0100

    WaE: class vs struct

diff --git a/editeng/inc/editeng/splwrap.hxx b/editeng/inc/editeng/splwrap.hxx
index bc45535..2646497 100644
--- a/editeng/inc/editeng/splwrap.hxx
+++ b/editeng/inc/editeng/splwrap.hxx
@@ -57,7 +57,7 @@ class EDITENG_DLLPUBLIC SvxSpellWrapper {
 private:
     friend class SvxSpellCheckDialog;
     friend class SvxHyphenWordDialog;
-    friend class SvxHyphenWordDialog_Impl;
+    friend struct SvxHyphenWordDialog_Impl;
 
     Window*		pWin;
     ::com::sun::star::uno::Reference<
commit 47a5206ac5f375846f3df3d72816814d2736bc62
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 7 08:54:13 2011 +0100

    add application/vnd.lotus-wordpro to .desktop etc.

diff --git a/sysui/desktop/debian/postinst b/sysui/desktop/debian/postinst
index 5312512..062014c 100755
--- a/sysui/desktop/debian/postinst
+++ b/sysui/desktop/debian/postinst
@@ -154,6 +154,7 @@ application/vnd.writerperfect; %PREFIX -view %s
 application/wordperfect5.1; %PREFIX -view %s
 application/x-wordperfect; %PREFIX -view %s
 application/wordperfect; %PREFIX -view %s
+application/vnd.lotus-wordpro; %PREFIX -view %s
 application/wpwin; %PREFIX -view %s
 application/vnd.openofficeorg.extension; %PREFIX %s
 END
diff --git a/sysui/desktop/menus/writer.desktop b/sysui/desktop/menus/writer.desktop
index 2222019..8ba463b 100755
--- a/sysui/desktop/menus/writer.desktop
+++ b/sysui/desktop/menus/writer.desktop
@@ -5,7 +5,7 @@ Icon=writer
 Type=Application
 Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Wordprocessors;
 Exec=${UNIXBASISROOTNAME} --writer %U
-MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-flat-xml;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/vnd.stardivision.writer;application/msword;application/vnd.ms-word;application/x-doc;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;
+MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-flat-xml;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/vnd.stardivision.writer;application/msword;application/vnd.ms-word;application/x-doc;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.lotus-wordpro;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;
 Name=%PRODUCTNAME Writer
 Name[pt_BR]=%PRODUCTNAME_BR Writer
 GenericName=Word Processor
diff --git a/sysui/desktop/mimetypes/openoffice.applications b/sysui/desktop/mimetypes/openoffice.applications
index 6d87801..4c3b31a 100755
--- a/sysui/desktop/mimetypes/openoffice.applications
+++ b/sysui/desktop/mimetypes/openoffice.applications
@@ -5,5 +5,5 @@ OFFICENAME
 	expects_uris=true
 	requires_terminal=false
 	uses_gnomevfs=true
-	mime_types=application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.text-flat-xml,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.text-web,application/vnd.oasis.opendocument.text-master,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-flat-xml,application/vnd.oasis.opendocument.graphics-template,application/vnd.oasis.opendocument.presentation,application/vnd.oasis.opendocument.presentation-flat-xml,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.spreadsheet-flat-xml,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.formula,application/vnd.oasis.opendocument.database,application/vnd.ms-excel,application/rtf,application/msword,application/vnd.ms-powerpoint,application/vnd.stardivision.calc,application/vnd.stardivision.chart,application/vnd.stardivision.dr
 aw,application/vnd.stardivision.impress,application/vnd.stardivision.mail,application/vnd.stardivision.math,application/vnd.stardivision.writer,application/vnd.sun.xml.calc,application/vnd.sun.xml.calc.template,application/vnd.sun.xml.draw,application/vnd.sun.xml.draw.template,application/vnd.sun.xml.impress,application/vnd.sun.xml.impress.template,application/vnd.sun.xml.math,application/vnd.sun.xml.writer,application/vnd.sun.xml.writer.global,application/vnd.sun.xml.writer.template,application/vnd.sun.xml.base,image/x-emf,image/x-pcx,image/x-photo-cd,image/x-pict;application/vnd.wordperfect;application/vnd.openofficeorg.extension;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroenabl
 ed.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;
+	mime_types=application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.text-flat-xml,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.text-web,application/vnd.oasis.opendocument.text-master,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-flat-xml,application/vnd.oasis.opendocument.graphics-template,application/vnd.oasis.opendocument.presentation,application/vnd.oasis.opendocument.presentation-flat-xml,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.spreadsheet-flat-xml,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.formula,application/vnd.oasis.opendocument.database,application/vnd.ms-excel,application/rtf,application/msword,application/vnd.ms-powerpoint,application/vnd.stardivision.calc,application/vnd.stardivision.chart,application/vnd.stardivision.dr
 aw,application/vnd.stardivision.impress,application/vnd.stardivision.mail,application/vnd.stardivision.math,application/vnd.stardivision.writer,application/vnd.sun.xml.calc,application/vnd.sun.xml.calc.template,application/vnd.sun.xml.draw,application/vnd.sun.xml.draw.template,application/vnd.sun.xml.impress,application/vnd.sun.xml.impress.template,application/vnd.sun.xml.math,application/vnd.sun.xml.writer,application/vnd.sun.xml.writer.global,application/vnd.sun.xml.writer.template,application/vnd.sun.xml.base,image/x-emf,image/x-pcx,image/x-photo-cd,image/x-pict;application/vnd.wordperfect;application/vnd.lotus-wordpro;application/vnd.openofficeorg.extension;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application
 /vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;
 
diff --git a/sysui/desktop/redhat/redhat-menus.spec b/sysui/desktop/redhat/redhat-menus.spec
index 865703b..cab8cc5 100755
--- a/sysui/desktop/redhat/redhat-menus.spec
+++ b/sysui/desktop/redhat/redhat-menus.spec
@@ -220,6 +220,7 @@ application/vnd.writerperfect; %unixfilename -view %s
 application/wordperfect5.1; %unixfilename -view %s
 application/x-wordperfect; %unixfilename -view %s
 application/wordperfect; %unixfilename -view %s
+application/vnd.lotus-wordpro; %unixfilename -view %s
 application/wpwin; %unixfilename -view %s
 application/vnd.openofficeorg.extension; %unixfilename %s
 application/vnd.openxmlformats-officedocument.wordprocessingml.document; %unixfilename -view %s
diff --git a/sysui/desktop/solaris/mailcap b/sysui/desktop/solaris/mailcap
index 19407fd..f9fc623 100755
--- a/sysui/desktop/solaris/mailcap
+++ b/sysui/desktop/solaris/mailcap
@@ -72,6 +72,7 @@ application/vnd.writerperfect; %PREFIX -view %s
 application/wordperfect5.1; %PREFIX -view %s
 application/x-wordperfect; %PREFIX -view %s
 application/wordperfect; %PREFIX -view %s
+application/vnd.lotus-wordpro; %PREFIX -view %s
 application/wpwin; %PREFIX -view %s
 application/vnd.openofficeorg.extension; %PREFIX %s
 END
diff --git a/sysui/desktop/suse/suse-menus.spec b/sysui/desktop/suse/suse-menus.spec
index 74eb0a5..6f4ef8a 100755
--- a/sysui/desktop/suse/suse-menus.spec
+++ b/sysui/desktop/suse/suse-menus.spec
@@ -231,6 +231,7 @@ application/vnd.wordperfect; %unixfilename -view %s
 application/wordperfect5.1; %unixfilename -view %s
 application/x-wordperfect; %unixfilename -view %s
 application/wordperfect; %unixfilename -view %s
+application/vnd.lotus-wordpro; %unixfilename -view %s
 application/wpwin; %unixfilename -view %s
 application/vnd.openofficeorg.extension; %unixfilename %s
 application/vnd.openxmlformats-officedocument.wordprocessingml.document; %unixfilename -view %s
commit abe703e7a282c317838f198e04341874115b99f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 6 16:39:19 2011 +0100

    fix ownership cycle and leak

diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx
index 6cfafda..16db45a 100644
--- a/sfx2/source/appl/imestatuswindow.cxx
+++ b/sfx2/source/appl/imestatuswindow.cxx
@@ -53,6 +53,44 @@
 #include "vcl/svapp.hxx"
 #include "osl/mutex.hxx"
 
+//TO-Do, merge into framework/inc/helpers/mischelpers.hxx and deliver
+class WeakPropertyChangeListener : public ::cppu::WeakImplHelper1<com::sun::star::beans::XPropertyChangeListener>
+{
+    private:
+        com::sun::star::uno::WeakReference<com::sun::star::beans::XPropertyChangeListener> mxOwner;
+
+    public:
+        WeakPropertyChangeListener(com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener> xOwner)
+            : mxOwner(xOwner)
+        {
+        }
+
+        virtual ~WeakPropertyChangeListener()
+        {
+        }
+
+        virtual void SAL_CALL propertyChange(const com::sun::star::beans::PropertyChangeEvent &rEvent )
+            throw(com::sun::star::uno::RuntimeException)
+        {
+            com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener> xOwner(mxOwner.get(),
+                com::sun::star::uno::UNO_QUERY);
+            if (xOwner.is())
+                xOwner->propertyChange(rEvent);
+
+        }
+
+        // lang.XEventListener
+        virtual void SAL_CALL disposing(const com::sun::star::lang::EventObject& rEvent)
+            throw(com::sun::star::uno::RuntimeException)
+        {
+            com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener> xOwner(mxOwner.get(),
+                com::sun::star::uno::UNO_QUERY);
+            if (xOwner.is())
+                xOwner->disposing(rEvent);
+
+        }
+};
+
 namespace css = com::sun::star;
 
 using sfx2::appl::ImeStatusWindow;
@@ -133,13 +171,13 @@ bool ImeStatusWindow::canToggle() const
 
 ImeStatusWindow::~ImeStatusWindow()
 {
-    if (m_xConfig.is())
+    if (m_xConfig.is() && m_xConfigListener.is())
         // We should never get here, but just in case...
         try
         {
             m_xConfig->removePropertyChangeListener(
                 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowStatusWindow")),
-                this);
+                m_xConfigListener);
         }
         catch (css::uno::Exception &)
         {
@@ -221,12 +259,15 @@ css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig()
         xConfig = m_xConfig;
     }
     if (bAdd)
+    {
         // Exceptions here could be handled individually, to support graceful
         // degradation (no update notification mechanism in this case---but also
         // no dispose notifications):
+        m_xConfigListener = new WeakPropertyChangeListener(this);
         xConfig->addPropertyChangeListener(
             rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowStatusWindow")),
-            this);
+            m_xConfigListener);
+    }
     return xConfig;
 }
 
diff --git a/sfx2/source/appl/imestatuswindow.hxx b/sfx2/source/appl/imestatuswindow.hxx
index 7c3ca11..9901168 100644
--- a/sfx2/source/appl/imestatuswindow.hxx
+++ b/sfx2/source/appl/imestatuswindow.hxx
@@ -118,6 +118,8 @@ private:
     osl::Mutex m_aMutex;
     com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >
         m_xConfig;
+    com::sun::star::uno::Reference< com::sun::star::beans::XPropertyChangeListener >
+        m_xConfigListener;
     bool m_bDisposed;
 };
 


More information about the Libreoffice-commits mailing list