[Libreoffice-commits] core.git: 2 commits - connectivity/source sfx2/source

Caolán McNamara caolanm at redhat.com
Mon Dec 1 06:08:09 PST 2014


 connectivity/source/drivers/hsqldb/HView.cxx |   81 +++++++++++++++++----------
 connectivity/source/inc/hsqldb/HView.hxx     |   11 +++
 sfx2/source/appl/appinit.cxx                 |    2 
 3 files changed, 64 insertions(+), 30 deletions(-)

New commits:
commit 8fc14413d9dadede63743ec76603d95eb587f580
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 1 11:15:35 2014 +0000

    Resolves: fdo#86799 fix insert special char in Find/Find and Replace
    
    regression from
    
    7f7d2213209dd8e23292ec5a85fbab6127824c49
    author	Caolán McNamara <caolanm at redhat.com>	2014-10-13 09:25:26 (GMT)
    osl_Module -> osl::Module
    
    Change-Id: Idb8fec23bdd0ee3ea0488047aadaf21e3cd2900f

diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 77067dd..2c64e34 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -181,7 +181,7 @@ OUString GetSpecialCharsForEdit(vcl::Window* pParent, const vcl::Font& rFont)
 
 #ifndef DISABLE_DYNLOADING
         osl::Module aMod;
-        aMod.loadRelative(&thisModule, "cui", 0);
+        aMod.loadRelative(&thisModule, SVLIBRARY("cui"), 0);
 
         // get symbol
         OUString aSymbol( "GetSpecialCharsForEdit"  );
commit 6269b62b525ec22471db56015ac2daed813ec5ff
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 1 10:57:05 2014 +0000

    Resolves: fdo#80938 fix SQL view to be editable
    
    regression from
    
    commit d60392fb5b387175dbd2e575848993c02c56922f
    Author: Caolán McNamara <caolanm at redhat.com>
    Date:   Thu Mar 6 12:05:24 2014 +0000
        coverity#706316 help out coverity re tortured logic
    
    Change-Id: I2ee7bd3b7421ae46878d1b565ef14dd7b0bbd10e

diff --git a/connectivity/source/drivers/hsqldb/HView.cxx b/connectivity/source/drivers/hsqldb/HView.cxx
index bd4fa1b..72e9e8a 100644
--- a/connectivity/source/drivers/hsqldb/HView.cxx
+++ b/connectivity/source/drivers/hsqldb/HView.cxx
@@ -101,7 +101,7 @@ namespace connectivity { namespace hsqldb
         aRestoreCommand.appendAscii( "CREATE VIEW " );
         aRestoreCommand.append     ( sQualifiedName );
         aRestoreCommand.appendAscii( " AS " );
-        aRestoreCommand.append     ( impl_getCommand_throw() );
+        aRestoreCommand.append     ( impl_getCommand_throwSQLException() );
         OUString sRestoreCommand( aRestoreCommand.makeStringAndClear() );
 
         bool bDropSucceeded( false );
@@ -150,45 +150,47 @@ namespace connectivity { namespace hsqldb
         {
             // retrieve the very current command, don't rely on the base classes cached value
             // (which we initialized empty, anyway)
-            try
-            {
-                _rValue <<= impl_getCommand_throw();
-            }
-            catch (const SQLException& e)
-            {
-                throw WrappedTargetException(e.Message,
-                    static_cast< XAlterView* >( const_cast< HView* >( this ) ),
-                        ::cppu::getCaughtException() );
-            }
+            _rValue <<= impl_getCommand_wrapSQLException();
+            return;
         }
 
         HView_Base::getFastPropertyValue( _rValue, _nHandle );
     }
 
+    OUString HView::impl_getCommand() const
+    {
+        OUStringBuffer aCommand;
+        aCommand.appendAscii( "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS " );
+        HTools::appendTableFilterCrit( aCommand, m_CatalogName, m_SchemaName, m_Name, false );
+        ::utl::SharedUNOComponent< XStatement > xStatement; xStatement.set( m_xConnection->createStatement(), UNO_QUERY_THROW );
+        Reference< XResultSet > xResult( xStatement->executeQuery( aCommand.makeStringAndClear() ), UNO_QUERY_THROW );
+        if ( !xResult->next() )
+        {
+            // hmm. There is no view view the name as we know it. Can only mean some other instance
+            // dropped this view meanwhile ...
+            throw DisposedException();
+        }
 
-    OUString HView::impl_getCommand_throw() const
+        Reference< XRow > xRow( xResult, UNO_QUERY_THROW );
+        return xRow->getString( 1 );
+    }
+
+    OUString HView::impl_getCommand_wrapSQLException() const
     {
         OUString sCommand;
 
         try
         {
-            OUStringBuffer aCommand;
-            aCommand.appendAscii( "SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.SYSTEM_VIEWS " );
-            HTools::appendTableFilterCrit( aCommand, m_CatalogName, m_SchemaName, m_Name, false );
-            ::utl::SharedUNOComponent< XStatement > xStatement; xStatement.set( m_xConnection->createStatement(), UNO_QUERY_THROW );
-            Reference< XResultSet > xResult( xStatement->executeQuery( aCommand.makeStringAndClear() ), UNO_QUERY_THROW );
-            if ( !xResult->next() )
-            {
-                // hmm. There is no view view the name as we know it. Can only mean some other instance
-                // dropped this view meanwhile ...
-                throw DisposedException();
-            }
-
-            Reference< XRow > xRow( xResult, UNO_QUERY_THROW );
-            sCommand = xRow->getString( 1 );
+            sCommand = impl_getCommand();
+        }
+        catch( const RuntimeException& )
+        {
+            throw;
+        }
+        catch( const SQLException& e )
+        {
+            throw WrappedTargetException( e.Message, static_cast< XAlterView* >( const_cast< HView* >( this ) ), ::cppu::getCaughtException() );
         }
-        catch( const RuntimeException& ) { throw; }
-        catch( const SQLException& ) { throw; }
         catch( const Exception& )
         {
             DBG_UNHANDLED_EXCEPTION();
@@ -197,6 +199,29 @@ namespace connectivity { namespace hsqldb
         return sCommand;
     }
 
+    OUString HView::impl_getCommand_throwSQLException() const
+    {
+        OUString sCommand;
+
+        try
+        {
+            sCommand = impl_getCommand();
+        }
+        catch( const RuntimeException& )
+        {
+            throw;
+        }
+        catch( const SQLException& )
+        {
+            throw;
+        }
+        catch( const Exception& )
+        {
+            DBG_UNHANDLED_EXCEPTION();
+        }
+
+        return sCommand;
+    }
 
 } } // namespace connectivity::hsqldb
 
diff --git a/connectivity/source/inc/hsqldb/HView.hxx b/connectivity/source/inc/hsqldb/HView.hxx
index e13ff79..3e3d7cc 100644
--- a/connectivity/source/inc/hsqldb/HView.hxx
+++ b/connectivity/source/inc/hsqldb/HView.hxx
@@ -63,12 +63,21 @@ namespace connectivity { namespace hsqldb
         virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const SAL_OVERRIDE;
 
     private:
+        /** retrieves the current command of the View */
+        OUString impl_getCommand() const;
+
+        /** retrieves the current command of the View
+
+            @throws ::com::sun::star::lang::WrappedTargetException
+                if an error occurs while retrieving the command from the database.
+        */
+        OUString impl_getCommand_wrapSQLException() const;
         /** retrieves the current command of the View
 
             @throws ::com::sun::star::sdbc::SQLException
                 if an error occurs while retrieving the command from the database.
         */
-        OUString impl_getCommand_throw() const;
+        OUString impl_getCommand_throwSQLException() const;
 
     private:
         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;


More information about the Libreoffice-commits mailing list