summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg/AdabasStat.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-08-02 14:38:24 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-08-02 14:38:24 +0000
commit27608cb6fe577afd62b2755e3cc2c72d40dcade1 (patch)
tree5dd9436ec846ed61251f3be2a46e4134e2fdcbc1 /dbaccess/source/ui/dlg/AdabasStat.cxx
parente689ce5c47ef978b7c303b73d7e489e76a34e81d (diff)
INTEGRATION: CWS insight01 (1.10.104); FILE MERGED
2004/01/02 14:07:46 oj 1.10.104.3: RESYNC: (1.10-1.11); FILE MERGED 2003/11/05 11:41:19 oj 1.10.104.2: #111075# ongoing work 2003/07/29 12:45:42 oj 1.10.104.1: #111075# insight changes
Diffstat (limited to 'dbaccess/source/ui/dlg/AdabasStat.cxx')
-rw-r--r--dbaccess/source/ui/dlg/AdabasStat.cxx39
1 files changed, 31 insertions, 8 deletions
diff --git a/dbaccess/source/ui/dlg/AdabasStat.cxx b/dbaccess/source/ui/dlg/AdabasStat.cxx
index 3ba4de609e01..c38aa1e48a81 100644
--- a/dbaccess/source/ui/dlg/AdabasStat.cxx
+++ b/dbaccess/source/ui/dlg/AdabasStat.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AdabasStat.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: rt $ $Date: 2003-12-01 10:36:58 $
+ * last change: $Author: hr $ $Date: 2004-08-02 15:38:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -150,10 +150,11 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent,
::rtl::OUString aStmt;
::rtl::OUString sSchema = _rUser.toAsciiUpperCase();
- Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData();
+ Reference<XDatabaseMetaData> xMetaData;
// first read the sizes
try
{
+ xMetaData = m_xConnection->getMetaData();
bCanSelect = checkSystemTable(::rtl::OUString::createFromAscii("SERVERDBSTATISTICS"),sSchema);
if(bCanSelect)
@@ -176,7 +177,7 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent,
m_ET_SIZE.SetText(::rtl::OUString::valueOf((INT32)nUsedPages));
m_ET_FREESIZE.SetText(::rtl::OUString::valueOf((INT32)nFreePages));
- m_ET_MEMORYUSING.SetValue(((nUsedPages-nFreePages)/nUsedPages)*100);
+ m_ET_MEMORYUSING.SetValue(static_cast<sal_Int32>(((nUsedPages-nFreePages)/nUsedPages)*100));
}
else
showError();
@@ -194,7 +195,14 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent,
{
OSL_ENSURE(sal_False, "OAdabasStatistics::OAdabasStatistics: caught an exception!");
}
- ::comphelper::disposeComponent(xStmt);
+ try
+ {
+ ::comphelper::disposeComponent(xStmt);
+ }
+ catch(const Exception&)
+ {
+ OSL_ENSURE(sal_False, "OAdabasStatistics::OAdabasStatistics: caught an exception!");
+ }
// now fill the datadev spaces
if(bCanSelect)
@@ -231,7 +239,14 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent,
{
OSL_ENSURE(sal_False, "OAdabasStatistics::OAdabasStatistics: caught an exception!");
}
- ::comphelper::disposeComponent(xStmt);
+ try
+ {
+ ::comphelper::disposeComponent(xStmt);
+ }
+ catch(const Exception&)
+ {
+ OSL_ENSURE(sal_False, "OAdabasStatistics::OAdabasStatistics: caught an exception!");
+ }
// now fill the sysdatadev spaces
if(bCanSelect)
@@ -278,7 +293,14 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent,
{
OSL_ENSURE(sal_False, "OAdabasStatistics::OAdabasStatistics: caught an exception!");
}
- ::comphelper::disposeComponent(xStmt);
+ try
+ {
+ ::comphelper::disposeComponent(xStmt);
+ }
+ catch(const Exception&)
+ {
+ OSL_ENSURE(sal_False, "OAdabasStatistics::OAdabasStatistics: caught an exception!");
+ }
}
}
}
@@ -308,7 +330,7 @@ sal_Bool OAdabasStatistics::checkSystemTable(const ::rtl::OUString& _rsSystemTab
Reference<XRow> xRow(xRes,UNO_QUERY);
static const ::rtl::OUString sSelect = ::rtl::OUString::createFromAscii("SELECT");
// first the db sizes
- while(xRes.is() && xRes->next())
+ while( xRow.is() && xRes->next() )
{
_rsSchemaName = xRow->getString(2);
if(sSelect == xRow->getString(6) && !xRow->wasNull())
@@ -320,6 +342,7 @@ sal_Bool OAdabasStatistics::checkSystemTable(const ::rtl::OUString& _rsSystemTab
::comphelper::disposeComponent(xRes);
}
}
+
return bCanSelect;
}
// -----------------------------------------------------------------------------