summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-05-02 11:47:51 +0000
committerOcke Janssen <oj@openoffice.org>2001-05-02 11:47:51 +0000
commitb551c7c73bafaadcc1dba3494dda1f0c041ef5be (patch)
tree22fbffc64ca721881497bb061ef37f89e78fd8bb /dbaccess
parenta3371f4892d5c6158386453329e49e0becda8430 (diff)
some changes for ref vector
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/CRowSetDataColumn.cxx14
-rw-r--r--dbaccess/source/core/api/CRowSetDataColumn.hxx17
-rw-r--r--dbaccess/source/core/api/RowSet.cxx16
-rw-r--r--dbaccess/source/core/api/column.cxx25
-rw-r--r--dbaccess/source/core/api/querycomposer.cxx21
-rw-r--r--dbaccess/source/core/inc/column.hxx18
-rw-r--r--dbaccess/source/core/misc/userinformation.cxx10
7 files changed, 69 insertions, 52 deletions
diff --git a/dbaccess/source/core/api/CRowSetDataColumn.cxx b/dbaccess/source/core/api/CRowSetDataColumn.cxx
index 1c87027ad..8c9b81cb4 100644
--- a/dbaccess/source/core/api/CRowSetDataColumn.cxx
+++ b/dbaccess/source/core/api/CRowSetDataColumn.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: CRowSetDataColumn.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: oj $ $Date: 2001-04-20 11:44:05 $
+ * last change: $Author: oj $ $Date: 2001-05-02 12:47:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -172,7 +172,7 @@ void SAL_CALL ORowSetDataColumn::getFastPropertyValue( Any& rValue, sal_Int32 nH
if(!m_aColumnValue.isNull() && m_aColumnValue != m_rEnd && m_aColumnValue->isValid())
{
ORowSetRow aRow = *m_aColumnValue;
- OSL_ENSURE(aRow->size() > m_nPos,"Pos is greater than size of vector");
+ OSL_ENSURE((sal_Int32)aRow->size() > m_nPos,"Pos is greater than size of vector");
rValue = (*(*m_aColumnValue))[m_nPos].makeAny();
}
break;
@@ -263,8 +263,8 @@ Reference< ::com::sun::star::container::XNamed > ORowSetDataColumns::createObjec
{
Reference< ::com::sun::star::container::XNamed > xNamed;
- ORowSetDataColumns_COLLECTION::const_iterator first = m_aColumns.begin();
- ORowSetDataColumns_COLLECTION::const_iterator last = m_aColumns.end();
+ ::connectivity::OSQLColumns::const_iterator first = m_aColumns->begin();
+ ::connectivity::OSQLColumns::const_iterator last = m_aColumns->end();
::comphelper::UStringMixEqual aCase(isCaseSensitive());
@@ -279,12 +279,12 @@ Reference< ::com::sun::star::container::XNamed > ORowSetDataColumns::createObjec
void SAL_CALL ORowSetDataColumns::disposing(void)
{
// clear_NoDispose();
- m_aColumns.clear();
+ m_aColumns->clear();
ORowSetDataColumns_BASE::disposing();
// m_aColumns.clear();
}
// -----------------------------------------------------------------------------
-void ORowSetDataColumns::assign(const ORowSetDataColumns_COLLECTION& _rColumns,const ::std::vector< ::rtl::OUString> &_rVector)
+void ORowSetDataColumns::assign(const ::vos::ORef< ::connectivity::OSQLColumns>& _rColumns,const ::std::vector< ::rtl::OUString> &_rVector)
{
m_aColumns = _rColumns;
for(::std::vector< ::rtl::OUString>::const_iterator i=_rVector.begin(); i != _rVector.end();++i)
diff --git a/dbaccess/source/core/api/CRowSetDataColumn.hxx b/dbaccess/source/core/api/CRowSetDataColumn.hxx
index fe218736e..676095fc8 100644
--- a/dbaccess/source/core/api/CRowSetDataColumn.hxx
+++ b/dbaccess/source/core/api/CRowSetDataColumn.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: CRowSetDataColumn.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: oj $ $Date: 2001-04-20 11:44:05 $
+ * last change: $Author: oj $ $Date: 2001-05-02 12:47:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -122,13 +122,13 @@ namespace dbaccess
virtual void fireValueChange(const ::com::sun::star::uno::Any& _rOldValue);
};
// -------------------------------------------------------------------------
- typedef connectivity::ORefVector< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> >
- ORowSetDataColumns_COLLECTION;
+// typedef connectivity::ORefVector< ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> >
+// ORowSetDataColumns_COLLECTION;
typedef connectivity::sdbcx::OCollection ORowSetDataColumns_BASE;
class ORowSetDataColumns : public ORowSetDataColumns_BASE
{
- ORowSetDataColumns_COLLECTION m_aColumns;
+ ::vos::ORef< ::connectivity::OSQLColumns> m_aColumns;
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > createObject(const ::rtl::OUString& _rName);
virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException) {}
@@ -139,18 +139,19 @@ namespace dbaccess
public:
ORowSetDataColumns(
sal_Bool _bCase,
- const ORowSetDataColumns_COLLECTION& _rColumns,
+ const ::vos::ORef< ::connectivity::OSQLColumns>& _rColumns,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< ::rtl::OUString> &_rVector
) : connectivity::sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
,m_aColumns(_rColumns)
- {}
+ {
+ }
~ORowSetDataColumns()
{}
// only the name is identical to ::cppu::OComponentHelper
virtual void SAL_CALL disposing(void);
- void assign(const ORowSetDataColumns_COLLECTION& _rColumns,const ::std::vector< ::rtl::OUString> &_rVector);
+ void assign(const ::vos::ORef< ::connectivity::OSQLColumns>& _rColumns,const ::std::vector< ::rtl::OUString> &_rVector);
};
}
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 6c5df8826..97d5d51e0 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: RowSet.cxx,v $
*
- * $Revision: 1.63 $
+ * $Revision: 1.64 $
*
- * last change: $Author: fs $ $Date: 2001-04-26 11:20:06 $
+ * last change: $Author: oj $ $Date: 2001-05-02 12:47:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1920,7 +1920,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ClearableMutexGuard& _rClearForNotific
}
}
- ORowSetDataColumns_COLLECTION aColumns;
+ ::vos::ORef< ::connectivity::OSQLColumns> aColumns = new ::connectivity::OSQLColumns();
::std::vector< ::rtl::OUString> aNames;
::rtl::OUString aDescription;
sal_Int32 nFormatKey = 0;
@@ -1945,7 +1945,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ClearableMutexGuard& _rClearForNotific
aDescription,
m_aCurrentRow,
m_pCache->getEnd());
- aColumns.push_back(pColumn);
+ aColumns->push_back(pColumn);
pColumn->setName(aName);
aNames.push_back(aName);
@@ -1996,7 +1996,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ClearableMutexGuard& _rClearForNotific
aDescription,
m_aCurrentRow,
m_pCache->getEnd());
- aColumns.push_back(pColumn);
+ aColumns->push_back(pColumn);
pColumn->setName(sName);
aNames.push_back(sName);
@@ -2765,7 +2765,7 @@ ORowSetClone::ORowSetClone(ORowSet& rParent,::osl::Mutex& _rMutex)
m_aCurrentRow = m_pCache->createIterator();
m_xNumberFormatTypes = rParent.m_xNumberFormatTypes;
- ORowSetDataColumns_COLLECTION aColumns;
+ ::vos::ORef< ::connectivity::OSQLColumns> aColumns = new ::connectivity::OSQLColumns();
::std::vector< ::rtl::OUString> aNames;
::rtl::OUString aDescription;
@@ -2779,7 +2779,7 @@ ORowSetClone::ORowSetClone(ORowSet& rParent,::osl::Mutex& _rMutex)
for(sal_Int32 i=1;pBegin != pEnd ;++pBegin,++i)
{
Reference<XPropertySet> xColumn;
- ::cppu::extractInterface(xColumn,rParent.m_pColumns->getByName(*pBegin));
+ rParent.m_pColumns->getByName(*pBegin) >>= xColumn;
if(xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_DESCRIPTION))
aDescription = comphelper::getString(xColumn->getPropertyValue(PROPERTY_DESCRIPTION));
@@ -2789,7 +2789,7 @@ ORowSetClone::ORowSetClone(ORowSet& rParent,::osl::Mutex& _rMutex)
aDescription,
m_aCurrentRow,
m_pCache->getEnd());
- aColumns.push_back(pColumn);
+ aColumns->push_back(pColumn);
pColumn->setName(*pBegin);
aNames.push_back(*pBegin);
diff --git a/dbaccess/source/core/api/column.cxx b/dbaccess/source/core/api/column.cxx
index 37ae38469..9a7faa543 100644
--- a/dbaccess/source/core/api/column.cxx
+++ b/dbaccess/source/core/api/column.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: column.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: oj $ $Date: 2001-04-24 14:40:19 $
+ * last change: $Author: oj $ $Date: 2001-05-02 12:47:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -301,7 +301,26 @@ sal_Int64 OColumn::getSomething( const Sequence< sal_Int8 > & rId ) throw (Runti
return 0;
}
-
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OColumn::getName( ) throw(::com::sun::star::uno::RuntimeException)
+{
+ return m_sName;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OColumn::setName( const ::rtl::OUString& _rName ) throw(::com::sun::star::uno::RuntimeException)
+{
+ m_sName = _rName;
+}
+// -----------------------------------------------------------------------------
+OColumnSettings* OColumn::getSettings()
+{
+ return NULL;
+}
+// -----------------------------------------------------------------------------
+void OColumn::fireValueChange(const ::com::sun::star::uno::Any& _rOldValue)
+{
+}
+// -----------------------------------------------------------------------------
//============================================================
//= OColumnSettings
//============================================================
diff --git a/dbaccess/source/core/api/querycomposer.cxx b/dbaccess/source/core/api/querycomposer.cxx
index 82646e7f1..050df86ba 100644
--- a/dbaccess/source/core/api/querycomposer.cxx
+++ b/dbaccess/source/core/api/querycomposer.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: querycomposer.cxx,v $
*
- * $Revision: 1.30 $
+ * $Revision: 1.31 $
*
- * last change: $Author: oj $ $Date: 2001-04-30 10:15:35 $
+ * last change: $Author: oj $ $Date: 2001-05-02 12:47:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -162,7 +162,7 @@ namespace dbaccess
typedef connectivity::sdbcx::OCollection OPrivateColumns_Base;
class OPrivateColumns : public OPrivateColumns_Base
{
- OSQLColumns m_aColumns;
+ ::vos::ORef< ::connectivity::OSQLColumns> m_aColumns;
protected:
virtual Reference< XNamed > createObject(const ::rtl::OUString& _rName);
virtual void impl_refresh() throw(RuntimeException) {}
@@ -171,7 +171,7 @@ namespace dbaccess
return NULL;
}
public:
- OPrivateColumns(const OSQLColumns& _rColumns,
+ OPrivateColumns(const ::vos::ORef< ::connectivity::OSQLColumns>& _rColumns,
sal_Bool _bCase,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
@@ -191,7 +191,10 @@ namespace dbaccess
// -------------------------------------------------------------------------
Reference< XNamed > OPrivateColumns::createObject(const ::rtl::OUString& _rName)
{
- return Reference< XNamed >(*find(m_aColumns.begin(),m_aColumns.end(),_rName,isCaseSensitive()),UNO_QUERY);
+ ::connectivity::OSQLColumns::const_iterator aIter = find(m_aColumns->begin(),m_aColumns->end(),_rName,isCaseSensitive());
+ if(aIter != m_aColumns->end())
+ return Reference< XNamed >(*aIter,UNO_QUERY);
+ return NULL;
}
typedef connectivity::sdbcx::OCollection OPrivateTables_BASE;
@@ -437,7 +440,7 @@ void SAL_CALL OQueryComposer::setQuery( const ::rtl::OUString& command ) throw(S
Reference<XStatement> xStmt = m_xConnection->createStatement();
::std::vector< ::rtl::OUString> aNames;
- const ::vos::ORef< OSQLColumns>& aCols = m_aSqlIterator.getSelectColumns();
+ ::vos::ORef< OSQLColumns> aCols = m_aSqlIterator.getSelectColumns();
if(xStmt.is())
{
::rtl::OUString sSql = m_aWorkSql;
@@ -470,7 +473,7 @@ void SAL_CALL OQueryComposer::setQuery( const ::rtl::OUString& command ) throw(S
for(OSQLColumns::const_iterator aIter = aCols->begin(); aIter != aCols->end();++aIter)
aNames.push_back(getString((*aIter)->getPropertyValue(PROPERTY_NAME)));
}
- m_pColumns = new OPrivateColumns(*aCols,m_xConnection->getMetaData()->storesMixedCaseQuotedIdentifiers(),*this,m_aMutex,aNames);
+ m_pColumns = new OPrivateColumns(aCols,m_xConnection->getMetaData()->storesMixedCaseQuotedIdentifiers(),*this,m_aMutex,aNames);
getTables();
getParameters();
@@ -1229,11 +1232,11 @@ Reference< XIndexAccess > SAL_CALL OQueryComposer::getParameters( ) throw(Runti
// now set the Parameters
if(!m_pParameters)
{
- const ::vos::ORef< OSQLColumns>& aCols = m_aSqlIterator.getParameters();
+ ::vos::ORef< OSQLColumns> aCols = m_aSqlIterator.getParameters();
::std::vector< ::rtl::OUString> aNames;
for(OSQLColumns::const_iterator aIter = aCols->begin(); aIter != aCols->end();++aIter)
aNames.push_back(getString((*aIter)->getPropertyValue(PROPERTY_NAME)));
- m_pParameters = new OPrivateColumns(*aCols,m_xConnection->getMetaData()->storesMixedCaseQuotedIdentifiers(),*this,m_aMutex,aNames);
+ m_pParameters = new OPrivateColumns(aCols,m_xConnection->getMetaData()->storesMixedCaseQuotedIdentifiers(),*this,m_aMutex,aNames);
}
return m_pParameters;
diff --git a/dbaccess/source/core/inc/column.hxx b/dbaccess/source/core/inc/column.hxx
index b240b9f74..e4fbf476b 100644
--- a/dbaccess/source/core/inc/column.hxx
+++ b/dbaccess/source/core/inc/column.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: column.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: oj $ $Date: 2001-04-23 10:07:41 $
+ * last change: $Author: oj $ $Date: 2001-05-02 12:47:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -205,21 +205,15 @@ namespace dbaccess
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
// XNamed
- virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException)
- {
- return m_sName;
- }
- virtual void SAL_CALL setName( const ::rtl::OUString& _rName ) throw(::com::sun::star::uno::RuntimeException)
- {
- m_sName = _rName;
- }
+ virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& _rName ) throw(::com::sun::star::uno::RuntimeException);
/** return a pointer to the object which holds the UI-settings for this column, if any.
@see OColumnSettings
@see OColumns::loadSettings
*/
- virtual OColumnSettings* getSettings() { return NULL; }
- virtual void fireValueChange(const ::com::sun::star::uno::Any& _rOldValue){}
+ virtual OColumnSettings* getSettings();
+ virtual void fireValueChange(const ::com::sun::star::uno::Any& _rOldValue);
};
//************************************************************
diff --git a/dbaccess/source/core/misc/userinformation.cxx b/dbaccess/source/core/misc/userinformation.cxx
index 71418f2e1..adbe44fe3 100644
--- a/dbaccess/source/core/misc/userinformation.cxx
+++ b/dbaccess/source/core/misc/userinformation.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: userinformation.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: fs $ $Date: 2000-11-09 13:14:32 $
+ * last change: $Author: oj $ $Date: 2001-05-02 12:47:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,8 +78,8 @@
#ifndef _UTL_CONFIGMGR_HXX_
#include <unotools/configmgr.hxx>
#endif
-#ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
-#include <connectivity/CommonTools.hxx>
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
#endif
using namespace ::utl;
@@ -91,7 +91,7 @@ using namespace ::com::sun::star::registry;
UserInformation::UserInformation()
{
Any aValue = ConfigManager::GetDirectConfigProperty(ConfigManager::LOCALE);
- LanguageType eLanguage = ConvertIsoStringToLanguage(connectivity::getString(aValue),'-');
+ LanguageType eLanguage = ConvertIsoStringToLanguage(comphelper::getString(aValue),'-');
UniString sLanguage, sCountry;
ConvertLanguageToIsoNames(eLanguage, sLanguage, sCountry);
m_aUserLocale = Locale(sLanguage,sCountry,::rtl::OUString());