[ooo-build-commit] Branch 'ooo-build-3-1-1' - patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Dec 9 23:00:44 PST 2009
patches/dev300/apply | 1
patches/dev300/calc-perf-import-dbf-dbaccess.diff | 156 ++++++++++++++++++++++
patches/dev300/calc-perf-import-dbf-sc.diff | 19 ++
3 files changed, 176 insertions(+)
New commits:
commit 5c862fe370a20413c6db96a1b813884cb730b284
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Thu Dec 10 01:55:52 2009 -0500
Disable property change notification during DBF import.
* patches/dev300/apply:
* patches/dev300/calc-perf-import-dbf-dbaccess.diff:
* patches/dev300/calc-perf-import-dbf-sc.diff:
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 418fd20..3db3dbd 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3497,6 +3497,7 @@ sal-strintern-speed-char-upper.diff, kohei
# speed optimization for dbf import.
calc-perf-import-dbf-connectivity.diff, kohei
+calc-perf-import-dbf-dbaccess.diff, kohei
calc-perf-import-dbf-sc.diff, kohei
[ AutoLayout ]
diff --git a/patches/dev300/calc-perf-import-dbf-dbaccess.diff b/patches/dev300/calc-perf-import-dbf-dbaccess.diff
new file mode 100644
index 0000000..e077192
--- /dev/null
+++ b/patches/dev300/calc-perf-import-dbf-dbaccess.diff
@@ -0,0 +1,156 @@
+diff --git dbaccess/source/core/api/RowSet.cxx dbaccess/source/core/api/RowSet.cxx
+index 1a0a6cb..58a031c 100644
+--- dbaccess/source/core/api/RowSet.cxx
++++ dbaccess/source/core/api/RowSet.cxx
+@@ -36,6 +36,7 @@
+ #include "sdbcoretools.hxx"
+ #include "SingleSelectQueryComposer.hxx"
+ #include "module_dba.hxx"
++#include "dbastrings.hrc"
+
+ #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+ #include <com/sun/star/beans/PropertyAttribute.hpp>
+@@ -274,6 +275,7 @@ ORowSet::ORowSet( const Reference< ::com::sun::star::lang::XMultiServiceFactory
+ ,m_bNew(sal_False)
+ ,m_bCanUpdateInsertedRows(sal_True)
+ ,m_bOwnConnection(sal_False)
++ ,m_bPropChangeNotifyEnabled(sal_True)
+ {
+ m_nResultSetType = ResultSetType::SCROLL_SENSITIVE;
+ m_nResultSetConcurrency = ResultSetConcurrency::UPDATABLE;
+@@ -325,6 +327,9 @@ ORowSet::ORowSet( const Reference< ::com::sun::star::lang::XMultiServiceFactory
+ registerProperty(PROPERTY_UPDATE_CATALOGNAME, PROPERTY_ID_UPDATE_CATALOGNAME, PropertyAttribute::BOUND, &m_aUpdateCatalogName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
+ registerProperty(PROPERTY_UPDATE_SCHEMANAME, PROPERTY_ID_UPDATE_SCHEMANAME, PropertyAttribute::BOUND, &m_aUpdateSchemaName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
+ registerProperty(PROPERTY_UPDATE_TABLENAME, PROPERTY_ID_UPDATE_TABLENAME, PropertyAttribute::BOUND, &m_aUpdateTableName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL)));
++
++ // ???
++ registerProperty(PROPERTY_CHANGE_NOTIFICATION_ENABLED, PROPERTY_ID_PROPCHANGE_NOTIFY, PropertyAttribute::BOUND, &m_bPropChangeNotifyEnabled, ::getBooleanCppuType());
+ }
+
+ ORowSet::~ORowSet()
+@@ -476,6 +481,9 @@ void SAL_CALL ORowSet::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const
+ case PROPERTY_ID_TYPEMAP:
+ ::cppu::extractInterface(m_xTypeMap,m_aTypeMap);
+ break;
++ case PROPERTY_ID_PROPCHANGE_NOTIFY:
++ m_bPropChangeNotifyEnabled = ::cppu::any2bool(rValue);
++ break;
+ default:
+ break;
+ };
+@@ -516,6 +524,9 @@ void SAL_CALL ORowSet::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
+ case PROPERTY_ID_TYPEMAP:
+ rValue <<= m_xTypeMap;
+ break;
++ case PROPERTY_ID_PROPCHANGE_NOTIFY:
++ rValue <<= m_bPropChangeNotifyEnabled;
++ break;
+ default:
+ ORowSetBase::getFastPropertyValue(rValue,nHandle);
+ }
+@@ -2728,6 +2739,12 @@ sal_Bool ORowSet::isNew( )
+ }
+
+ // -----------------------------------------------------------------------------
++sal_Bool ORowSet::isPropertyChangeNotificationEnabled() const
++{
++ return m_bPropChangeNotifyEnabled;
++}
++
++// -----------------------------------------------------------------------------
+ void ORowSet::checkUpdateIterator()
+ {
+ if(!m_bModified && !m_bNew)
+diff --git dbaccess/source/core/api/RowSet.hxx dbaccess/source/core/api/RowSet.hxx
+index 278ffa6..d6a7711 100644
+--- dbaccess/source/core/api/RowSet.hxx
++++ dbaccess/source/core/api/RowSet.hxx
+@@ -178,6 +178,7 @@ namespace dbaccess
+ sal_Bool m_bNew ;
+ sal_Bool m_bCanUpdateInsertedRows;
+ sal_Bool m_bOwnConnection;
++ sal_Bool m_bPropChangeNotifyEnabled;
+
+ private:
+ /** builds m_aActiveCommand from our settings
+@@ -280,6 +281,7 @@ namespace dbaccess
+ virtual sal_Bool isModification( );
+ virtual sal_Bool isModified( );
+ virtual sal_Bool isNew( );
++ virtual sal_Bool isPropertyChangeNotificationEnabled() const;
+
+ virtual ~ORowSet();
+
+diff --git dbaccess/source/core/api/RowSetBase.cxx dbaccess/source/core/api/RowSetBase.cxx
+index bbd2e82..4375733 100644
+--- dbaccess/source/core/api/RowSetBase.cxx
++++ dbaccess/source/core/api/RowSetBase.cxx
+@@ -1239,6 +1239,9 @@ void SAL_CALL ORowSetBase::clearWarnings( ) throw(SQLException, RuntimeExceptio
+ // -------------------------------------------------------------------------
+ void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow)
+ {
++ if (!isPropertyChangeNotificationEnabled())
++ return;
++
+ DBG_TRACE2("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL));
+ OSL_ENSURE(m_pColumns,"Columns can not be NULL here!");
+ #if OSL_DEBUG_LEVEL > 1
+@@ -1279,6 +1282,12 @@ void ORowSetBase::notifyAllListeners(::osl::ResettableMutexGuard& /*_rGuard*/)
+ }
+
+ // -----------------------------------------------------------------------------
++sal_Bool ORowSetBase::isPropertyChangeNotificationEnabled() const
++{
++ return sal_True;
++}
++
++// -----------------------------------------------------------------------------
+ void ORowSetBase::fireProperty( sal_Int32 _nProperty, sal_Bool _bNew, sal_Bool _bOld )
+ {
+ Any aNew = bool2any( _bNew );
+diff --git dbaccess/source/core/api/RowSetBase.hxx dbaccess/source/core/api/RowSetBase.hxx
+index b21c053..2dd6206 100644
+--- dbaccess/source/core/api/RowSetBase.hxx
++++ dbaccess/source/core/api/RowSetBase.hxx
+@@ -190,6 +190,9 @@ namespace dbaccess
+ virtual sal_Bool isModified( ) = 0;
+ // return <TRUE/> if and only if the current row is the insert row
+ virtual sal_Bool isNew( ) = 0;
++ // return <TRUE/> if the property change notification should be fired
++ // upon property change.
++ virtual sal_Bool isPropertyChangeNotificationEnabled() const;
+ // notify the change of a boolean property
+ void fireProperty( sal_Int32 _nProperty, sal_Bool _bNew, sal_Bool _bOld );
+
+diff --git dbaccess/source/inc/stringconstants.hrc dbaccess/source/inc/stringconstants.hrc
+index 1154751..840f79d 100644
+--- dbaccess/source/inc/stringconstants.hrc
++++ dbaccess/source/inc/stringconstants.hrc
+@@ -183,6 +183,7 @@
+ #define PROPERTY_ID_THOUSAND_DELIMITER 140
+ #define PROPERTY_ID_ENCODING 141
+ #define PROPERTY_ID_HELP_URL 142
++#define PROPERTY_ID_PROPCHANGE_NOTIFY 143
+
+ //============================================================
+ //= property names
+@@ -339,6 +340,7 @@ DECLARE_CONSTASCII_USTRING(PROPERTY_AS_TEMPLATE);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_HAVING_CLAUSE);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_GROUP_BY);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_EDIT_WIDTH);
++DECLARE_CONSTASCII_USTRING(PROPERTY_CHANGE_NOTIFICATION_ENABLED);
+
+ //============================================================
+ //= service names
+diff --git dbaccess/source/inc/stringconstants.inc dbaccess/source/inc/stringconstants.inc
+index 8803d0e..e9be544 100644
+--- dbaccess/source/inc/stringconstants.inc
++++ dbaccess/source/inc/stringconstants.inc
+@@ -185,6 +185,7 @@ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_AS_TEMPLATE, "AsTemplate");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HAVING_CLAUSE, "HavingClause");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_GROUP_BY, "GroupBy");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EDIT_WIDTH, "EditWidth");
++IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHANGE_NOTIFICATION_ENABLED, "PropertyChangeNotificationEnabled");
+
+ //============================================================
+ //= service names
diff --git a/patches/dev300/calc-perf-import-dbf-sc.diff b/patches/dev300/calc-perf-import-dbf-sc.diff
index a5959fc..1eca80a 100644
--- a/patches/dev300/calc-perf-import-dbf-sc.diff
+++ b/patches/dev300/calc-perf-import-dbf-sc.diff
@@ -873,6 +873,14 @@ index c01cda9..fbc8976 100644
#include <vector>
+@@ -104,6 +104,7 @@ using ::std::vector;
+ #define SC_DBPROP_ACTIVECONNECTION "ActiveConnection"
+ #define SC_DBPROP_COMMAND "Command"
+ #define SC_DBPROP_COMMANDTYPE "CommandType"
++#define SC_DBPROP_PROPCHANGE_NOTIFY "PropertyChangeNotificationEnabled"
+
+ #define SC_DBPROP_NAME "Name"
+ #define SC_DBPROP_TYPE "Type"
@@ -248,9 +250,11 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales
}
}
@@ -887,6 +895,17 @@ index c01cda9..fbc8976 100644
ULONG nErr = eERR_OK;
long i;
+@@ -356,6 +357,10 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
+ xRowProp->setPropertyValue(
+ rtl::OUString::createFromAscii(SC_DBPROP_COMMAND), aAny );
+
++ aAny <<= sal_False;
++ xRowProp->setPropertyValue(
++ rtl::OUString::createFromAscii(SC_DBPROP_PROPCHANGE_NOTIFY), aAny );
++
+ xRowSet->execute();
+
+ long nColCount = 0;
@@ -407,16 +411,33 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
BOOL bEnd = FALSE;
while ( !bEnd && xRowSet->next() )
More information about the ooo-build-commit
mailing list