[Libreoffice-commits] core.git: 2 commits - vcl/unx xmloff/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 17 16:07:45 UTC 2020


 vcl/unx/gtk3/gtk3gtkframe.cxx         |    7 +++++--
 xmloff/source/transform/OOo2Oasis.cxx |   29 ++++++++++++-----------------
 2 files changed, 17 insertions(+), 19 deletions(-)

New commits:
commit 27756f26b17ae5c0f7bcd560c5ede84776c1c5e4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 17 16:24:09 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Oct 17 18:07:13 2020 +0200

    Resolves: tdf#134939 don't update IM position if focus is in another widget
    
    Change-Id: Ia078ed9c1896d4a3541525ea2907760ce235dfd8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104466
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index e7e3f96eccfe..d14574489956 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -3188,10 +3188,13 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe
 
     GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
 
+    bool bFocusInAnotherGtkWidget = false;
+
     if (GTK_IS_WINDOW(pThis->m_pWindow))
     {
         GtkWidget* pFocusWindow = gtk_window_get_focus(GTK_WINDOW(pThis->m_pWindow));
-        if (pFocusWindow && pFocusWindow != GTK_WIDGET(pThis->m_pFixedContainer))
+        bFocusInAnotherGtkWidget = pFocusWindow && pFocusWindow != GTK_WIDGET(pThis->m_pFixedContainer);
+        if (bFocusInAnotherGtkWidget)
         {
             if (!gtk_widget_get_realized(pFocusWindow))
                 return true;
@@ -3306,7 +3309,7 @@ gboolean GtkSalFrame::signalKey(GtkWidget* pWidget, GdkEventKey* pEvent, gpointe
             pThis->m_nKeyModifiers = ModKeyFlags::NONE;
     }
 
-    if( !aDel.isDeleted() && pThis->m_pIMHandler )
+    if (!bFocusInAnotherGtkWidget && !aDel.isDeleted() && pThis->m_pIMHandler)
         pThis->m_pIMHandler->updateIMSpotLocation();
 
     return bStopProcessingKey;
commit f71debf3fa65493ebb1a1538023987d76c66374c
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 17 15:44:30 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 17 18:07:02 2020 +0200

    OOo2Oasis: use the fastparser API when possible
    
    part of the process of making SvXMLImport fastparser-only
    
    Change-Id: Ib8b4a02fff94653adf9d48ac07404d392572b1f3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104464
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 7b17554bdb6f..4e860b64f620 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -42,6 +42,7 @@
 #include "OOo2Oasis.hxx"
 #include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/typeprovider.hxx>
+#include <tools/diagnose_ex.h>
 
 using namespace ::xmloff::token;
 using namespace ::com::sun::star::uno;
@@ -1915,32 +1916,26 @@ void OOo2OasisTransformer::Initialize(
 {
     OSL_ENSURE( !GetDocHandler().is(), "duplication initialization" );
 
-    Reference< XDocumentHandler > xDocHandler;
+    Reference< XInterface > xFilter;
     if( !m_aSubServiceName.isEmpty() )
     {
-        Reference< XComponentContext > xContext =
-            comphelper::getProcessComponentContext();
-        try
-        {
-            // get filter component
-            xDocHandler.set(
-                    xContext->getServiceManager()->createInstanceWithArgumentsAndContext(m_aSubServiceName, rArguments, xContext),
-                    UNO_QUERY);
-        }
-        catch( Exception& )
-        {
-        }
+        Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
+        // get filter component
+        xFilter =
+            xContext->getServiceManager()->createInstanceWithArgumentsAndContext(m_aSubServiceName, rArguments, xContext);
+        SAL_WARN_IF(!xFilter, "xmloff", "could not instantiate " << m_aSubServiceName);
     }
+    else
+        SAL_WARN("xmloff", "no subservice name");
 
-    OSL_ENSURE( xDocHandler.is(), "can't instantiate filter component" );
-    if( xDocHandler.is() )
+    if (xFilter.is())
     {
         Sequence<Any> aArgs( 1 + rArguments.getLength() );
-        aArgs[0] <<= xDocHandler;
+        aArgs[0] <<= xFilter;
         std::copy(rArguments.begin(), rArguments.end(), std::next(aArgs.begin()));
         XMLTransformerBase::initialize( aArgs );
 
-        OSL_ENSURE( GetDocHandler() == xDocHandler,
+        OSL_ENSURE( GetDocHandler() == xFilter,
                     "duplicate doc handler" );
     }
     else


More information about the Libreoffice-commits mailing list