summaryrefslogtreecommitdiff
path: root/connectivity/source/sdbcx
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-08-24 05:19:41 +0000
committerOcke Janssen <oj@openoffice.org>2001-08-24 05:19:41 +0000
commit2d7388c15291c6b0ca4ea29837c7c1b92ad23a53 (patch)
tree162ed438d04c164f892a2936a4ff2828d07ab820 /connectivity/source/sdbcx
parentbb6d7df690687f1e066b09d72fb0a2204d12b5aa (diff)
#90015# code corrcetions for some speedup's
Diffstat (limited to 'connectivity/source/sdbcx')
-rw-r--r--connectivity/source/sdbcx/VCatalog.cxx13
-rw-r--r--connectivity/source/sdbcx/VCollection.cxx13
-rw-r--r--connectivity/source/sdbcx/VDescriptor.cxx20
-rw-r--r--connectivity/source/sdbcx/VGroup.cxx10
-rw-r--r--connectivity/source/sdbcx/VUser.cxx10
-rw-r--r--connectivity/source/sdbcx/VView.cxx8
6 files changed, 41 insertions, 33 deletions
diff --git a/connectivity/source/sdbcx/VCatalog.cxx b/connectivity/source/sdbcx/VCatalog.cxx
index dca34fae78c2..f10ae522a205 100644
--- a/connectivity/source/sdbcx/VCatalog.cxx
+++ b/connectivity/source/sdbcx/VCatalog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: VCatalog.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:03 $
+ * last change: $Author: oj $ $Date: 2001-08-24 06:06:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -140,6 +140,8 @@ Reference< XNameAccess > SAL_CALL OCatalog::getTables( ) throw(RuntimeException
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OCatalog_BASE::rBHelper.bDisposed);
+ if(!m_pTables)
+ refreshTables();
return const_cast<OCatalog*>(this)->m_pTables;
}
@@ -150,6 +152,8 @@ Reference< XNameAccess > SAL_CALL OCatalog::getViews( ) throw(RuntimeException)
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OCatalog_BASE::rBHelper.bDisposed);
+ if(!m_pViews)
+ refreshViews();
return const_cast<OCatalog*>(this)->m_pViews;
}
@@ -160,6 +164,8 @@ Reference< XNameAccess > SAL_CALL OCatalog::getUsers( ) throw(RuntimeException)
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OCatalog_BASE::rBHelper.bDisposed);
+ if(!m_pUsers)
+ refreshUsers();
return const_cast<OCatalog*>(this)->m_pUsers;
}
@@ -171,6 +177,9 @@ Reference< XNameAccess > SAL_CALL OCatalog::getGroups( ) throw(RuntimeException
checkDisposed(OCatalog_BASE::rBHelper.bDisposed);
+ if(!m_pGroups)
+ refreshGroups();
+
return const_cast<OCatalog*>(this)->m_pGroups;
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx
index f6229ed4c965..422cefa77985 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: VCollection.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: oj $ $Date: 2001-08-13 13:58:56 $
+ * last change: $Author: oj $ $Date: 2001-08-24 06:06:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,6 +99,7 @@ OCollection::OCollection(::cppu::OWeakObject& _rParent,sal_Bool _bCase, ::osl::M
,m_aRefreshListeners(_rMutex)
,m_aNameMap(_bCase ? true : false)
{
+ m_aElements.reserve(_rVector.size());
for(TStringVector::const_iterator i=_rVector.begin(); i != _rVector.end();++i)
m_aElements.push_back(m_aNameMap.insert(m_aNameMap.begin(), ObjectMap::value_type(*i,WeakReference< ::com::sun::star::container::XNamed >())));
}
@@ -144,7 +145,7 @@ void OCollection::disposing(void)
Any SAL_CALL OCollection::getByIndex( sal_Int32 Index ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
{
::osl::MutexGuard aGuard(m_rMutex);
- if (Index < 0 || Index >= getCount())
+ if (Index < 0 || Index >= m_aNameMap.size())
throw IndexOutOfBoundsException(::rtl::OUString::valueOf(Index),*this);
ObjectIter aIter = m_aElements[Index];
@@ -162,7 +163,7 @@ Any SAL_CALL OCollection::getByIndex( sal_Int32 Index ) throw(IndexOutOfBoundsEx
(*aIter).second = xName;
}
- return makeAny( Reference< XPropertySet >(xName,UNO_QUERY));
+ return makeAny(xName);
}
// -------------------------------------------------------------------------
Any SAL_CALL OCollection::getByName( const ::rtl::OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
@@ -186,7 +187,7 @@ Any SAL_CALL OCollection::getByName( const ::rtl::OUString& aName ) throw(NoSuch
(*aIter).second = xName;
}
- return makeAny( Reference< XPropertySet >(xName,UNO_QUERY));
+ return makeAny(xName);
}
// -------------------------------------------------------------------------
Sequence< ::rtl::OUString > SAL_CALL OCollection::getElementNames( ) throw(RuntimeException)
@@ -226,6 +227,8 @@ void SAL_CALL OCollection::refresh( ) throw(RuntimeException)
void OCollection::reFill(const TStringVector &_rVector)
{
OSL_ENSURE(!m_aNameMap.size(),"OCollection::reFill: collection isn't empty");
+ m_aElements.reserve(_rVector.size());
+
for(TStringVector::const_iterator i=_rVector.begin(); i != _rVector.end();++i)
m_aElements.push_back(m_aNameMap.insert(m_aNameMap.begin(), ObjectMap::value_type(*i,WeakReference< ::com::sun::star::container::XNamed >())));
}
diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx
index 8cabd3a325ae..9f605ad4adf9 100644
--- a/connectivity/source/sdbcx/VDescriptor.cxx
+++ b/connectivity/source/sdbcx/VDescriptor.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: VDescriptor.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: fs $ $Date: 2001-03-19 07:33:30 $
+ * last change: $Author: oj $ $Date: 2001-08-24 06:06:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,10 +89,11 @@ namespace connectivity
// com::sun::star::lang::XUnoTunnel
sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 >& rId ) throw(RuntimeException)
{
- if (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
- return (sal_Int64)this;
-
- return 0;
+ return (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ ?
+ (sal_Int64)this
+ :
+ 0;
}
// -----------------------------------------------------------------------------
@@ -115,9 +116,7 @@ namespace connectivity
Any SAL_CALL ODescriptor::queryInterface( const Type & rType ) throw(RuntimeException)
{
Any aRet = ::cppu::queryInterface(rType,static_cast< XUnoTunnel*> (this));
- if(!aRet.hasValue())
- aRet = ODescriptor_PBASE::queryInterface(rType);
- return aRet;
+ return aRet.hasValue() ? aRet : ODescriptor_PBASE::queryInterface(rType);
}
// -----------------------------------------------------------------------------
@@ -142,6 +141,9 @@ namespace connectivity
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.1 2001/03/19 07:33:30 fs
+ * initial checkin - implementation of ODescriptor
+ *
*
* Revision 1.0 19.03.01 08:21:59 fs
************************************************************************/
diff --git a/connectivity/source/sdbcx/VGroup.cxx b/connectivity/source/sdbcx/VGroup.cxx
index 46143cf57e78..54a3a5ffa79f 100644
--- a/connectivity/source/sdbcx/VGroup.cxx
+++ b/connectivity/source/sdbcx/VGroup.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: VGroup.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:03 $
+ * last change: $Author: oj $ $Date: 2001-08-24 06:06:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -110,10 +110,8 @@ OGroup::~OGroup()
// -------------------------------------------------------------------------
Any SAL_CALL OGroup::queryInterface( const Type & rType ) throw(RuntimeException)
{
- Any aRet = ODescriptor::queryInterface( rType);
- if(aRet.hasValue())
- return aRet;
- return OGroup_BASE::queryInterface( rType);
+ Any aRet = ODescriptor::queryInterface( rType);
+ return aRet.hasValue() ? aRet : OGroup_BASE::queryInterface( rType);
}
// -------------------------------------------------------------------------
Sequence< Type > SAL_CALL OGroup::getTypes( ) throw(RuntimeException)
diff --git a/connectivity/source/sdbcx/VUser.cxx b/connectivity/source/sdbcx/VUser.cxx
index 8e83142b8784..1c51f49055fb 100644
--- a/connectivity/source/sdbcx/VUser.cxx
+++ b/connectivity/source/sdbcx/VUser.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: VUser.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:03 $
+ * last change: $Author: oj $ $Date: 2001-08-24 06:06:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -122,10 +122,8 @@ void OUser::disposing(void)
// -------------------------------------------------------------------------
Any SAL_CALL OUser::queryInterface( const Type & rType ) throw(RuntimeException)
{
- Any aRet = ODescriptor::queryInterface( rType);
- if(aRet.hasValue())
- return aRet;
- return OUser_BASE::queryInterface( rType);
+ Any aRet = ODescriptor::queryInterface( rType);
+ return aRet.hasValue() ? aRet : OUser_BASE::queryInterface( rType);
}
// -------------------------------------------------------------------------
Sequence< Type > SAL_CALL OUser::getTypes( ) throw(RuntimeException)
diff --git a/connectivity/source/sdbcx/VView.cxx b/connectivity/source/sdbcx/VView.cxx
index d63103f02804..22425d08edfb 100644
--- a/connectivity/source/sdbcx/VView.cxx
+++ b/connectivity/source/sdbcx/VView.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: VView.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: oj $ $Date: 2001-05-14 11:34:03 $
+ * last change: $Author: oj $ $Date: 2001-08-24 06:06:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -148,9 +148,7 @@ Any SAL_CALL OView::queryInterface( const Type & rType ) throw(RuntimeException)
{
Any aRet = ::cppu::queryInterface(rType,static_cast< ::com::sun::star::container::XNamed*> (this),
static_cast< XServiceInfo*> (this));
- if(aRet.hasValue())
- return aRet;
- return ODescriptor::queryInterface( rType);
+ return aRet.hasValue() ? aRet : ODescriptor::queryInterface( rType);
}
// -------------------------------------------------------------------------
::cppu::IPropertyArrayHelper* OView::createArrayHelper(sal_Int32 _nId) const