summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign/querycontroller.cxx
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-10-01 10:57:41 +0000
committerOcke Janssen <oj@openoffice.org>2001-10-01 10:57:41 +0000
commitdb0878abd840b78e9690096942ade12bc36fb925 (patch)
treeb61c9bea5d9605e7a0810dc3c6493f962bb5d999 /dbaccess/source/ui/querydesign/querycontroller.cxx
parent68e0c580dbeee880dbe8ff38fca26778b306312b (diff)
#92611# saveas corrected
Diffstat (limited to 'dbaccess/source/ui/querydesign/querycontroller.cxx')
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 6ff708db5c49..52cf3fcc7300 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: querycontroller.cxx,v $
*
- * $Revision: 1.57 $
+ * $Revision: 1.58 $
*
- * last change: $Author: oj $ $Date: 2001-09-27 09:48:55 $
+ * last change: $Author: oj $ $Date: 2001-10-01 11:57:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1028,8 +1028,9 @@ String OQueryController::getMenu() const
return String::CreateFromInt32(RID_QUERY_DESIGN_MAIN_MENU);
}
// -----------------------------------------------------------------------------
-void OQueryController::askForNewName(const Reference<XNameAccess>& _xElements,sal_Bool _bSaveAs)
+sal_Bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements,sal_Bool _bSaveAs)
{
+ sal_Bool bRet = sal_True;
sal_Bool bNew = 0 == m_sName.getLength();
bNew = bNew || _bSaveAs || (_xElements.is() && !_xElements->hasByName(m_sName));
if(bNew)
@@ -1056,18 +1057,19 @@ void OQueryController::askForNewName(const Reference<XNameAccess>& _xElements,sa
xMetaData, aDefaultName,
_bSaveAs ? SAD_OVERWRITE : SAD_DEFAULT);
- if(aDlg.Execute() == RET_OK)
+ if(bRet = (aDlg.Execute() == RET_OK))
{
m_sName = aDlg.getName();
if(m_bCreateView)
{
m_sUpdateCatalogName = aDlg.getCatalog();
- m_sUpdateSchemaName = aDlg.getSchema();
+ m_sUpdateSchemaName = aDlg.getSchema();
}
}
- else
+ else if(!_bSaveAs)
m_sName = ::rtl::OUString(); // reset the name because we don't want to save it
}
+ return bRet;
}
// -----------------------------------------------------------------------------
void OQueryController::doSaveAsDoc(sal_Bool _bSaveAs)
@@ -1092,10 +1094,8 @@ void OQueryController::doSaveAsDoc(sal_Bool _bSaveAs)
sal_Bool bNew = 0 == m_sName.getLength();
bNew = bNew || _bSaveAs || !xElements->hasByName(m_sName);
// first we need a name for our query so ask the user
- askForNewName(xElements,_bSaveAs);
-
// did we get a name
- if(m_sName.getLength())
+ if(askForNewName(xElements,_bSaveAs) && m_sName.getLength())
{
SQLExceptionInfo aInfo;
try