summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-07-18 10:13:17 +0000
committerFrank Schönheit <fs@openoffice.org>2001-07-18 10:13:17 +0000
commit6b366a27bcfe43391502f2dc415cd2c334e1bcc6 (patch)
tree363d3b718fe48992bfaccb11f605d4822d997b2c /dbaccess/source/ui
parent65a3ab4d076de14d13417f96b24829ee4277f3ef (diff)
#88848# allow commands (not only tables/queries) to be the current documents data source
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx25
1 files changed, 21 insertions, 4 deletions
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index ee1e2bf1c345..1d3e821b6530 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unodatbr.cxx,v $
*
- * $Revision: 1.92 $
+ * $Revision: 1.93 $
*
- * last change: $Author: fs $ $Date: 2001-07-18 10:42:18 $
+ * last change: $Author: fs $ $Date: 2001-07-18 11:13:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -990,8 +990,25 @@ void SbaTableQueryBrowser::checkDocumentDataSource()
sal_Bool bKnownDocDataSource = (NULL != pObjectEntry);
if (!bKnownDocDataSource)
{
- // TODO: should we expand the object container? This may be too expensive just for checking ....
- bKnownDocDataSource = (NULL != pDataSourceEntry) && (NULL != pContainerEntry);
+ if (NULL != pDataSourceEntry)
+ { // at least the data source is know
+ if (NULL != pContainerEntry)
+ bKnownDocDataSource = sal_True; // assume we know it.
+ // TODO: should we expand the object container? This may be too expensive just for checking ....
+ else
+ {
+ if ((NULL == pObjectEntry) && m_aDocumentDataSource.has(daCommandType) && m_aDocumentDataSource.has(daCommand))
+ { // maybe we have a command to be displayed ?
+ sal_Int32 nCommandType = CommandType::TABLE;
+ m_aDocumentDataSource[daCommandType] >>= nCommandType;
+
+ ::rtl::OUString sCommand;
+ m_aDocumentDataSource[daCommand] >>= sCommand;
+
+ bKnownDocDataSource = (CommandType::COMMAND == nCommandType) && (0 != sCommand.getLength());
+ }
+ }
+ }
}
m_aDispatchStates[ID_BROWSER_DOCUMENT_DATASOURCE] = m_aDispatchStates[ID_BROWSER_DOCUMENT_DATASOURCE] && bKnownDocDataSource;