sw/source/filter/html/htmlform.cxx |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 032a96621d88097b62fd4613f13e7f617a9c01f3
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Sun Jan 9 09:36:14 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Jan 9 16:51:41 2022 +0100

    Try a different approach to fix ofz#39303
    
    ... to get rid of all the "unused, assigned variable" compiler
    warnings.
    
    Reverts commit 619dcf67c1f770685c6b40477f15657f70c05865.
    
    Change-Id: I5a8bf190f00e7698f806b807b2cbfeb8fb63c766
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128182
    Tested-by: Jenkins
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/filter/html/htmlform.cxx 
b/sw/source/filter/html/htmlform.cxx
index 60e6ea0f2924..e2685f6bf5ae 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -17,9 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <config_features.h>
-#include <config_fuzzers.h>
-
 #include <sal/config.h>
 
 #include <string_view>
@@ -30,6 +27,7 @@
 #include <vcl/svapp.hxx>
 #include <tools/UnitConversion.hxx>
 
+#include <tools/diagnose_ex.h>
 #include <vcl/unohelp.hxx>
 #include <svtools/htmlkywd.hxx>
 #include <svtools/htmltokn.h>
@@ -1298,25 +1296,28 @@ void SwHTMLParser::NewForm( bool bAppend )
         }
     }
 
-#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
     const uno::Reference< XMultiServiceFactory > & rSrvcMgr =
         m_pFormImpl->GetServiceFactory();
     if( !rSrvcMgr.is() )
         return;
 
     uno::Reference< XInterface > xInt;
+    uno::Reference<XForm> xForm;
     try
     {
         xInt = rSrvcMgr->createInstance("com.sun.star.form.component.Form");
+        if (!xInt.is())
+            return;
+        xForm.set(xInt, UNO_QUERY);
+        SAL_WARN_IF(!xForm.is(), "sw", "no XForm for 
com.sun.star.form.component.Form?");
+        if (!xForm.is())
+            return;
     }
-    catch (const css::lang::ServiceNotRegisteredException&)
+    catch (...)
     {
-    }
-    if( !xInt.is() )
+        TOOLS_WARN_EXCEPTION("sw", "");
         return;
-
-    uno::Reference< XForm >  xForm( xInt, UNO_QUERY );
-    OSL_ENSURE( xForm.is(), "no Form?" );
+    }
 
     uno::Reference< container::XIndexContainer > xFormComps( xForm, UNO_QUERY 
);
     m_pFormImpl->SetFormComps( xFormComps );
@@ -1367,7 +1368,6 @@ void SwHTMLParser::NewForm( bool bAppend )
         if (bHasEvents)
             NotifyMacroEventRead();
     }
-#endif
 }
 
 void SwHTMLParser::EndForm( bool bAppend )

Reply via email to