summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xcu5
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx2
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx18
-rw-r--r--connectivity/source/drivers/hsqldb/HTerminateListener.cxx1
-rwxr-xr-xconnectivity/source/drivers/jdbc/jdbc.xcu5
-rw-r--r--connectivity/source/drivers/jdbc/tools.cxx1
-rwxr-xr-xconnectivity/source/drivers/odbc/odbc.xcu5
-rw-r--r--connectivity/source/inc/hsqldb/HDriver.hxx1
-rw-r--r--svx/source/form/fmundo.cxx78
-rw-r--r--xmloff/source/forms/elementimport.cxx6
10 files changed, 66 insertions, 56 deletions
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
index e95e1a676c12..58bfcf8975a9 100755
--- a/connectivity/source/drivers/ado/ado.xcu
+++ b/connectivity/source/drivers/ado/ado.xcu
@@ -117,6 +117,11 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="RespectDriverResultSetType" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsTableCreation" oor:op="replace">
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 4dc27265b585..b18c577030b0 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -159,7 +159,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
}
++nRowCount;
}
- while(nRowCount < nMaxRowsToScan && m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding));
+ while(nRowCount < nMaxRowsToScan && m_pFileStream->ReadByteStringLine(aFirstLine,nEncoding) && !m_pFileStream->IsEof());
for (xub_StrLen i = 0; i < nFieldCount; i++)
{
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index a0b755c107c9..3760b914cc1d 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/util/XFlushable.hpp>
#include "HTerminateListener.hxx"
#include "hsqldb/HCatalog.hxx"
#include "diagnose_ex.h"
@@ -70,6 +71,7 @@ namespace connectivity
using namespace ::com::sun::star::embed;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::task;
+ using namespace ::com::sun::star::util;
using namespace ::com::sun::star::reflection;
namespace hsqldb
@@ -616,6 +618,22 @@ namespace connectivity
m_bInShutDownConnections = sal_True;
}
//------------------------------------------------------------------
+ void ODriverDelegator::flushConnections()
+ {
+ TWeakPairVector::iterator aEnd = m_aConnections.end();
+ for (TWeakPairVector::iterator i = m_aConnections.begin(); aEnd != i; ++i)
+ {
+ try
+ {
+ Reference<XFlushable> xCon(i->second.second.first.get(),UNO_QUERY);
+ xCon->flush();
+ }
+ catch(Exception&)
+ {
+ }
+ }
+ }
+ //------------------------------------------------------------------
void SAL_CALL ODriverDelegator::preCommit( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
::osl::MutexGuard aGuard(m_aMutex);
diff --git a/connectivity/source/drivers/hsqldb/HTerminateListener.cxx b/connectivity/source/drivers/hsqldb/HTerminateListener.cxx
index c386334acd70..52d53fa99227 100644
--- a/connectivity/source/drivers/hsqldb/HTerminateListener.cxx
+++ b/connectivity/source/drivers/hsqldb/HTerminateListener.cxx
@@ -51,6 +51,7 @@ throw( RuntimeException )
void SAL_CALL OConnectionController::queryTermination( const EventObject& /*aEvent*/ )
throw( TerminationVetoException, RuntimeException )
{
+ m_pDriver->flushConnections();
}
void SAL_CALL OConnectionController::notifyTermination( const EventObject& /*aEvent*/ )
diff --git a/connectivity/source/drivers/jdbc/jdbc.xcu b/connectivity/source/drivers/jdbc/jdbc.xcu
index f4f599a701d9..2afaa54a9e90 100755
--- a/connectivity/source/drivers/jdbc/jdbc.xcu
+++ b/connectivity/source/drivers/jdbc/jdbc.xcu
@@ -147,6 +147,11 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="RespectDriverResultSetType" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsTableCreation" oor:op="replace">
diff --git a/connectivity/source/drivers/jdbc/tools.cxx b/connectivity/source/drivers/jdbc/tools.cxx
index 65315774a601..1be627b6d4ac 100644
--- a/connectivity/source/drivers/jdbc/tools.cxx
+++ b/connectivity/source/drivers/jdbc/tools.cxx
@@ -152,6 +152,7 @@ java_util_Properties* connectivity::createStringPropertyArray(const Sequence< Pr
&& pBegin->Name.compareToAscii( "Authentication" )
&& pBegin->Name.compareToAscii( "PreferDosLikeLineEnds" )
&& pBegin->Name.compareToAscii( "PrimaryKeySupport" )
+ && pBegin->Name.compareToAscii( "RespectDriverResultSetType" )
)
{
::rtl::OUString aStr;
diff --git a/connectivity/source/drivers/odbc/odbc.xcu b/connectivity/source/drivers/odbc/odbc.xcu
index 74ba8815d021..c0d3939aa0e0 100755
--- a/connectivity/source/drivers/odbc/odbc.xcu
+++ b/connectivity/source/drivers/odbc/odbc.xcu
@@ -152,6 +152,11 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="RespectDriverResultSetType" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
<node oor:name="MetaData">
<node oor:name="SupportsTableCreation" oor:op="replace">
diff --git a/connectivity/source/inc/hsqldb/HDriver.hxx b/connectivity/source/inc/hsqldb/HDriver.hxx
index 72d21d5774e1..33be38e8de48 100644
--- a/connectivity/source/inc/hsqldb/HDriver.hxx
+++ b/connectivity/source/inc/hsqldb/HDriver.hxx
@@ -123,6 +123,7 @@ namespace connectivity
virtual void SAL_CALL reverted( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
void shutdownConnections();
+ void flushConnections();
protected:
/// dtor
virtual ~ODriverDelegator();
diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx
index eee61c5c2dee..ecbfc8afbe1a 100644
--- a/svx/source/form/fmundo.cxx
+++ b/svx/source/form/fmundo.cxx
@@ -66,6 +66,7 @@
#include <comphelper/property.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/stl_types.hxx>
+#include <comphelper/componentcontext.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
@@ -88,7 +89,9 @@ typedef cppu::WeakImplHelper1< XScriptListener > ScriptEventListener_BASE;
class ScriptEventListenerWrapper : public ScriptEventListener_BASE
{
public:
- ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException ) : pModel(&_rModel)
+ ScriptEventListenerWrapper( FmFormModel& _rModel) throw ( RuntimeException )
+ :m_rModel( _rModel )
+ ,m_attemptedListenerCreation( false )
{
}
@@ -98,7 +101,7 @@ public:
// XScriptListener
virtual void SAL_CALL firing(const ScriptEvent& evt) throw(RuntimeException)
{
- setModel();
+ attemptListenerCreation();
if ( m_vbaListener.is() )
{
m_vbaListener->firing( evt );
@@ -107,7 +110,7 @@ public:
virtual Any SAL_CALL approveFiring(const ScriptEvent& evt) throw( com::sun::star::reflection::InvocationTargetException, RuntimeException)
{
- setModel();
+ attemptListenerCreation();
if ( m_vbaListener.is() )
{
return m_vbaListener->approveFiring( evt );
@@ -116,61 +119,32 @@ public:
}
private:
- void setModel()
+ void attemptListenerCreation()
{
- if ( !m_vbaListener.is() )
- {
- Reference < XPropertySet > xProps(
- ::comphelper::getProcessServiceFactory(), UNO_QUERY );
- if ( xProps.is() )
- {
- Reference< XComponentContext > xCtx( xProps->getPropertyValue(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY );
- if ( xCtx.is() )
- {
- Reference< XMultiComponentFactory > xMFac(
- xCtx->getServiceManager(), UNO_QUERY );
-
- // SfxObjectShellRef is good here since the model controls the lifetime of the shell
- SfxObjectShellRef xObjSh = pModel->GetObjectShell();
- Reference< XMultiServiceFactory > xDocFac;
- if ( xObjSh.Is() )
- xDocFac.set( xObjSh->GetModel(), UNO_QUERY );
+ if ( m_attemptedListenerCreation )
+ return;
+ m_attemptedListenerCreation = true;
- if ( xMFac.is() )
- {
- m_vbaListener.set( xMFac->createInstanceWithContext(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "ooo.vba.EventListener" ) ), xCtx ),
- UNO_QUERY_THROW );
- }
- }
- }
+ try
+ {
+ ::comphelper::ComponentContext const aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XScriptListener > const xScriptListener( aContext.createComponent( "ooo.vba.EventListener" ), UNO_QUERY_THROW );
+ Reference< XPropertySet > const xListenerProps( xScriptListener, UNO_QUERY_THROW );
+ // SfxObjectShellRef is good here since the model controls the lifetime of the shell
+ SfxObjectShellRef const xObjectShell = m_rModel.GetObjectShell();
+ ENSURE_OR_THROW( xObjectShell.Is(), "no object shell!" );
+ xListenerProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ), makeAny( xObjectShell->GetModel() ) );
+
+ m_vbaListener = xScriptListener;
}
- Reference< XPropertySet > xProps( m_vbaListener, UNO_QUERY );
- if ( xProps.is() )
+ catch( Exception const & )
{
- try
- {
- // SfxObjectShellRef is good here since the model controls the lifetime of the shell
- SfxObjectShellRef xObjSh = pModel->GetObjectShell();
- if ( xObjSh.Is() && m_vbaListener.is() )
- {
- Any aVal;
- aVal <<= xObjSh->GetModel();
- xProps->setPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ),
- aVal );
- }
- }
- catch( Exception& )
- {
- //swallow any errors
- }
+ DBG_UNHANDLED_EXCEPTION();
}
}
- FmFormModel* pModel;
- Reference< XScriptListener > m_vbaListener;
+ FmFormModel& m_rModel;
+ Reference< XScriptListener > m_vbaListener;
+ bool m_attemptedListenerCreation;
};
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index d917ea31b8c7..0172a185acd4 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -890,12 +890,12 @@ namespace xmloff
if (!bRetrievedValues)
{
getValuePropertyNames(m_eElementType, nClassId, pCurrentValueProperty, pValueProperty);
- ENSURE_OR_BREAK( pCurrentValueProperty && pValueProperty, "OControlImport::StartElement: illegal value property names!" );
+ ENSURE_OR_BREAK( pValueProperty, "OControlImport::StartElement: illegal value property names!" );
bRetrievedValues = sal_True;
}
- OSL_ENSURE((PROPID_VALUE != aValueProps->Handle) || pValueProperty,
+ ENSURE_OR_BREAK((PROPID_VALUE != aValueProps->Handle) || pValueProperty,
"OControlImport::StartElement: the control does not have a value property!");
- OSL_ENSURE((PROPID_CURRENT_VALUE != aValueProps->Handle) || pCurrentValueProperty,
+ ENSURE_OR_BREAK((PROPID_CURRENT_VALUE != aValueProps->Handle) || pCurrentValueProperty,
"OControlImport::StartElement: the control does not have a current-value property!");
// transfer the name