diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 023bd17bd3ff..8f87621baa07 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FieldDescControl.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-05-31 13:37:37 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:44:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2120,6 +2120,17 @@ void OFieldDescControl::LoseFocus() TabPage::LoseFocus(); } // ----------------------------------------------------------------------------- +sal_Bool OFieldDescControl::isCopyAllowed() +{ + sal_Bool bAllowed = (m_pActFocusWindow != NULL) && + (m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample || + m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength || + m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName) && + reinterpret_cast(m_pActFocusWindow)->GetSelected().Len() != 0; + + return bAllowed; +} +// ----------------------------------------------------------------------------- sal_Bool OFieldDescControl::isCutAllowed() { sal_Bool bAllowed = (m_pActFocusWindow != NULL) && diff --git a/dbaccess/source/ui/control/SqlNameEdit.cxx b/dbaccess/source/ui/control/SqlNameEdit.cxx index 1b94a222c003..acdee9d78a01 100644 --- a/dbaccess/source/ui/control/SqlNameEdit.cxx +++ b/dbaccess/source/ui/control/SqlNameEdit.cxx @@ -2,9 +2,9 @@ * * $RCSfile: SqlNameEdit.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-07-06 09:01:34 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:44:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,26 +74,49 @@ namespace dbaui } //------------------------------------------------------------------ - void OSQLNameEdit::Modify() + sal_Bool OSQLNameChecker::checkString( const ::rtl::OUString& _sOldValue, + const ::rtl::OUString& _sToCheck, + ::rtl::OUString& _rsCorrected) { + sal_Bool bCorrected = sal_False; if(m_bCheck) { - XubString sSavedValue = GetSavedValue(); - XubString sText = GetText(); - xub_StrLen nMatch = 0;//sText.Search(sSavedValue); + XubString sSavedValue = _sOldValue; + XubString sText = _sToCheck; + xub_StrLen nMatch = 0; for(xub_StrLen i=nMatch;i < sText.Len();++i) { if(!isCharOk(sText.GetBuffer()[i],i == 0,m_bOnlyUpperCase,m_sAllowedChars)) { if(i) // only set when not first char sSavedValue = sText.Copy(nMatch,i-nMatch); - SetText(sSavedValue); + _rsCorrected = sSavedValue; + bCorrected = sal_True; break; } } + } + return bCorrected; + } + //------------------------------------------------------------------ + void OSQLNameEdit::Modify() + { + ::rtl::OUString sCorrected; + if(checkString(GetSavedValue(),GetText(),sCorrected)) + SetText(sCorrected); + SaveValue(); + Edit::Modify(); + } + //------------------------------------------------------------------ + void OSQLNameComboBox::Modify() + { + ::rtl::OUString sCorrected; + if(checkString(GetSavedValue(),GetText(),sCorrected)) + { + SetText(sCorrected); SaveValue(); } - Edit::Modify(); + ComboBox::Modify(); } } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index df56982d2b7c..fbed966ec700 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sqledit.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-04-18 13:20:48 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:44:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -208,7 +208,6 @@ void OSqlEdit::OverloadedSetText(const String& rNewText) MultiLineEdit::SetText(rNewText); m_strOrigText = rNewText; - static_cast(m_pView->GetParent())->getView()->getRealView()->getController()->setModified(sal_True); } // ----------------------------------------------------------------------------- void OSqlEdit::stopTimer() diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index 44ab77f17c76..5434b5ea34a4 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: UserAdmin.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-07-09 07:07:20 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:46:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -264,7 +264,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) Reference xUser; m_xUsers->getByName(GetUser()) >>= xUser; if(xUser.is()) - xUser->changePassword(sOldPwd,aPwdDlg.GetPassword()); + xUser->changePassword(sOldPwd.ToUpperAscii(),aPwdDlg.GetPassword().ToUpperAscii()); } } } diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index 57be840ee615..4681ed4a8f3a 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgsave.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: oj $ $Date: 2001-07-06 09:01:35 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:46:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,9 @@ #ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_ #include #endif +#ifndef _COM_SUN_STAR_SDBC_XROW_HPP_ +#include +#endif #ifndef _DBAUI_SQLMESSAGE_HXX_ #include "sqlmessage.hxx" #endif @@ -149,24 +152,6 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, break; case CommandType::TABLE: { - OSL_ENSURE(m_xMetaData.is(),"The metadata can not be null!"); - if(m_aName.Search('.') != STRING_NOTFOUND) - { - ::rtl::OUString sCatalog,sSchema,sTable; - ::dbtools::qualifiedNameComponents(_rxMetaData, - m_aName, - sCatalog, - sSchema, - sTable); - - m_aCatalog.SetText(sCatalog); - m_aSchema.SetText(sSchema); - m_aTitle.SetText(sTable); - } - else - m_aTitle.SetText(m_aName); - - m_aLabel.SetText(m_sTblLabel); Point aPos(m_aPB_OK.GetPosPixel()); if(!_rxMetaData->supportsCatalogsInTableDefinitions()) @@ -182,6 +167,25 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, m_aSchemaLbl.SetPosPixel(m_aCatalogLbl.GetPosPixel()); m_aSchema.SetPosPixel(m_aCatalog.GetPosPixel()); } + else + { + // now fill the catalogs + try + { + Reference xRes = m_xMetaData->getCatalogs(); + Reference xRow(xRes,UNO_QUERY); + ::rtl::OUString sCatalog; + while(xRes.is() && xRes->next()) + { + sCatalog = xRow->getString(1); + if(!xRow->wasNull()) + m_aCatalog.InsertEntry(sCatalog); + } + } + catch(const SQLException&) + { + } + } if(!_rxMetaData->supportsSchemasInTableDefinitions()) { @@ -193,6 +197,46 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, m_aLabel.SetPosPixel(m_aSchemaLbl.GetPosPixel()); m_aTitle.SetPosPixel(m_aSchema.GetPosPixel()); } + else + { + // now fill the schemata + try + { + Reference xRes = m_xMetaData->getSchemas(); + Reference xRow(xRes,UNO_QUERY); + ::rtl::OUString sSchema; + while(xRes.is() && xRes->next()) + { + sSchema = xRow->getString(1); + if(!xRow->wasNull() && m_aSchema.GetEntryPos(XubString(sSchema)) == COMBOBOX_ENTRY_NOTFOUND) + m_aSchema.InsertEntry(sSchema); + } + + m_aSchema.SetText(m_xMetaData->getUserName()); + } + catch(const SQLException&) + { + } + } + + OSL_ENSURE(m_xMetaData.is(),"The metadata can not be null!"); + if(m_aName.Search('.') != STRING_NOTFOUND) + { + ::rtl::OUString sCatalog,sSchema,sTable; + ::dbtools::qualifiedNameComponents(_rxMetaData, + m_aName, + sCatalog, + sSchema, + sTable); + + m_aCatalog.SetText(sCatalog); + if(sSchema.getLength()) + m_aSchema.SetText(sSchema); + m_aTitle.SetText(sTable); + } + else + m_aTitle.SetText(m_aName); + m_aPB_OK.SetPosPixel(Point(m_aPB_OK.GetPosPixel().X(),aPos.Y())); m_aPB_CANCEL.SetPosPixel(Point(m_aPB_CANCEL.GetPosPixel().X(),aPos.Y())); m_aPB_HELP.SetPosPixel(Point(m_aPB_HELP.GetPosPixel().X(),aPos.Y())); diff --git a/dbaccess/source/ui/dlg/dlgsave.src b/dbaccess/source/ui/dlg/dlgsave.src index 8c5df74976d4..7c0ba526812f 100644 --- a/dbaccess/source/ui/dlg/dlgsave.src +++ b/dbaccess/source/ui/dlg/dlgsave.src @@ -2,9 +2,9 @@ * * $RCSfile: dlgsave.src,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: kz $ $Date: 2001-07-13 21:16:00 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:47:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,13 +136,15 @@ ModalDialog DLG_SAVE_AS Text[ catalan ] = "~Catálogo"; Text[ finnish ] = "~Catalog"; }; - Edit ET_CATALOG + ComboBox ET_CATALOG { Border = TRUE ; Pos = MAP_APPFONT ( 77 , 25 ) ; Size = MAP_APPFONT ( 89 , 12 ) ; - Text = "" ; - TabStop = TRUE ; + SVLook = TRUE ; + TabStop = TRUE ; + DropDown = TRUE ; + AutoHScroll = TRUE ; }; FixedText FT_SCHEMA { @@ -171,13 +173,15 @@ ModalDialog DLG_SAVE_AS Text[ catalan ] = "~Esquema"; Text[ finnish ] = "~Schema"; }; - Edit ET_SCHEMA + ComboBox ET_SCHEMA { Border = TRUE ; Pos = MAP_APPFONT ( 77 , 42 ) ; Size = MAP_APPFONT ( 89 , 12 ) ; - Text = "" ; - TabStop = TRUE ; + SVLook = TRUE ; + TabStop = TRUE ; + DropDown = TRUE ; + AutoHScroll = TRUE ; }; FixedText FT_TITLE { diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index 6e090d561bca..1ca9de687f7c 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: FieldDescControl.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-03-22 07:47:44 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:50:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -227,6 +227,8 @@ namespace dbaui // Resize aufegrufen void CheckScrollBars(); sal_Bool isCutAllowed(); + sal_Bool isCopyAllowed(); + void cut(); void copy(); void paste(); diff --git a/dbaccess/source/ui/inc/SqlNameEdit.hxx b/dbaccess/source/ui/inc/SqlNameEdit.hxx index 84e46e2249a7..ccf00dbde639 100644 --- a/dbaccess/source/ui/inc/SqlNameEdit.hxx +++ b/dbaccess/source/ui/inc/SqlNameEdit.hxx @@ -2,9 +2,9 @@ * * $RCSfile: SqlNameEdit.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: oj $ $Date: 2001-07-06 09:01:35 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:50:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,28 +64,21 @@ #ifndef _SV_EDIT_HXX #include #endif +#ifndef _SV_COMBOBOX_HXX +#include +#endif namespace dbaui { - //================================================================== - class OSQLNameEdit : public Edit + class OSQLNameChecker { ::rtl::OUString m_sAllowedChars; sal_Bool m_bOnlyUpperCase; sal_Bool m_bCheck; // true when we should check for invalid chars public: - OSQLNameEdit(Window* _pParent,const ::rtl::OUString& _rAllowedChars, WinBits nStyle = WB_BORDER) - : Edit(_pParent,nStyle) - ,m_sAllowedChars(_rAllowedChars) + OSQLNameChecker(const ::rtl::OUString& _rAllowedChars) + :m_sAllowedChars(_rAllowedChars) ,m_bOnlyUpperCase(sal_False) - ,m_bCheck(sal_True) - { - } - OSQLNameEdit(Window* _pParent,const ResId& _rRes,const ::rtl::OUString& _rAllowedChars = ::rtl::OUString()) - : Edit(_pParent,_rRes) - ,m_sAllowedChars(_rAllowedChars) - ,m_bOnlyUpperCase(sal_False) - ,m_bCheck(sal_True) { } @@ -102,6 +95,23 @@ namespace dbaui { m_bCheck = _bCheck; } + sal_Bool checkString(const ::rtl::OUString& _sOldValue,const ::rtl::OUString& _sToCheck,::rtl::OUString& _rsCorrected); + }; + //================================================================== + class OSQLNameEdit : public Edit + ,public OSQLNameChecker + { + public: + OSQLNameEdit(Window* _pParent,const ::rtl::OUString& _rAllowedChars, WinBits nStyle = WB_BORDER) + : Edit(_pParent,nStyle) + ,OSQLNameChecker(_rAllowedChars) + { + } + OSQLNameEdit(Window* _pParent,const ResId& _rRes,const ::rtl::OUString& _rAllowedChars = ::rtl::OUString()) + : Edit(_pParent,_rRes) + ,OSQLNameChecker(_rAllowedChars) + { + } // Window overload // virtual long PreNotify( NotifyEvent& rNEvt ); @@ -109,6 +119,26 @@ namespace dbaui virtual void Modify(); }; + class OSQLNameComboBox : public ComboBox + ,public OSQLNameChecker + { + public: + OSQLNameComboBox(Window* _pParent,const ::rtl::OUString& _rAllowedChars, WinBits nStyle = WB_BORDER) + : ComboBox(_pParent,nStyle) + ,OSQLNameChecker(_rAllowedChars) + { + } + OSQLNameComboBox(Window* _pParent,const ResId& _rRes,const ::rtl::OUString& _rAllowedChars = ::rtl::OUString()) + : ComboBox(_pParent,_rRes) + ,OSQLNameChecker(_rAllowedChars) + { + } + + // Window overload + // Edit + virtual void Modify(); + }; + } #endif // DBAUI_SQLNAMEEDIT_HXX diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx index f5be27a6120d..c2dd4634ea04 100644 --- a/dbaccess/source/ui/inc/TableController.hxx +++ b/dbaccess/source/ui/inc/TableController.hxx @@ -2,9 +2,9 @@ * * $RCSfile: TableController.hxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: oj $ $Date: 2001-07-06 08:13:55 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:50:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx index 2305ee044723..327875d528eb 100644 --- a/dbaccess/source/ui/inc/TableDesignView.hxx +++ b/dbaccess/source/ui/inc/TableDesignView.hxx @@ -2,9 +2,9 @@ * * $RCSfile: TableDesignView.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-04-24 14:34:10 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:50:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -137,6 +137,7 @@ namespace dbaui ::com::sun::star::lang::Locale getLocale() const { return m_aLocale;} virtual sal_Bool isCutAllowed(); + virtual sal_Bool isCopyAllowed(); virtual void copy(); virtual void cut(); virtual void paste(); diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index c986c7062c10..e08507a3d6b4 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -2,9 +2,9 @@ * * $RCSfile: UITools.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: oj $ $Date: 2001-07-02 10:31:49 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:50:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -153,6 +153,10 @@ namespace dbaui class OFieldDescription; void setColumnProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn, const OFieldDescription* _pFieldDesc); + + ::rtl::OUString createDefaultName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData, + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xTables, + const ::rtl::OUString& _sName); // ......................................................................... } // ......................................................................... diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx index 0a53a8e6013e..d87ff0219c5a 100644 --- a/dbaccess/source/ui/inc/dlgsave.hxx +++ b/dbaccess/source/ui/inc/dlgsave.hxx @@ -2,9 +2,9 @@ * * $RCSfile: dlgsave.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: oj $ $Date: 2001-03-29 06:46:52 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:50:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -98,25 +98,25 @@ namespace dbaui class OSaveAsDlg : public ModalDialog { private: - FixedText m_aDescription; - FixedText m_aCatalogLbl; - OSQLNameEdit m_aCatalog; - FixedText m_aSchemaLbl; - OSQLNameEdit m_aSchema; - FixedText m_aLabel; - OSQLNameEdit m_aTitle; - OKButton m_aPB_OK; - CancelButton m_aPB_CANCEL; - HelpButton m_aPB_HELP; - String m_aQryLabel; - String m_sTblLabel; - String m_aName; - String m_aExists; - String m_aExistsOverwrite; + FixedText m_aDescription; + FixedText m_aCatalogLbl; + OSQLNameComboBox m_aCatalog; + FixedText m_aSchemaLbl; + OSQLNameComboBox m_aSchema; + FixedText m_aLabel; + OSQLNameEdit m_aTitle; + OKButton m_aPB_OK; + CancelButton m_aPB_CANCEL; + HelpButton m_aPB_HELP; + String m_aQryLabel; + String m_sTblLabel; + String m_aName; + String m_aExists; + String m_aExistsOverwrite; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xNames; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xMetaData; - sal_Int32 m_nType; - sal_Int32 m_nFlags; + sal_Int32 m_nType; + sal_Int32 m_nFlags; public: diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx index bd6941e6281b..fd74a58d6f2f 100644 --- a/dbaccess/source/ui/querydesign/QueryTextView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx @@ -2,9 +2,9 @@ * * $RCSfile: QueryTextView.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fs $ $Date: 2001-06-08 08:41:55 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:54:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -303,8 +303,7 @@ void OQueryTextView::clear() // ----------------------------------------------------------------------------- void OQueryTextView::setStatement(const ::rtl::OUString& _rsStatement) { - m_pEdit->SetText(_rsStatement); - m_pEdit->Modify(); + m_pEdit->OverloadedSetText(_rsStatement); } // ----------------------------------------------------------------------------- void OQueryTextView::copy() diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 5bf3c30d32ab..18b4417c3ca9 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.45 $ + * $Revision: 1.46 $ * - * last change: $Author: fs $ $Date: 2001-06-21 17:45:28 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:54:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -196,6 +196,9 @@ #ifndef _COM_SUN_STAR_UTIL_XFLUSHABLE_HPP_ #include #endif +#ifndef DBAUI_TOOLS_HXX +#include "UITools.hxx" +#endif extern "C" void SAL_CALL createRegistryInfo_OQueryControl() { @@ -1074,6 +1077,9 @@ void OQueryController::askForNewName(const Reference& _xElements,sa bNew = bNew || _bSaveAs; if(bNew) { + Reference xMetaData; + if(m_xConnection.is()) + xMetaData = m_xConnection->getMetaData(); String aDefaultName; if(_bSaveAs && !bNew) aDefaultName = String(m_sName); @@ -1081,15 +1087,16 @@ void OQueryController::askForNewName(const Reference& _xElements,sa { String aName = String(ModuleRes(m_bCreateView ? STR_VIEW_TITLE : STR_QRY_TITLE)); aName = aName.GetToken(0,' '); - aDefaultName = String(::dbtools::createUniqueName(_xElements,aName)); + if(m_bCreateView && m_xConnection.is()) + aDefaultName = ::dbaui::createDefaultName(xMetaData,_xElements,aName); + else + aDefaultName = String(::dbtools::createUniqueName(_xElements,aName)); } - Reference xMeta; - if(m_xConnection.is()) - xMeta = m_xConnection->getMetaData(); + OSaveAsDlg aDlg( getView(), m_bCreateView ? CommandType::TABLE : CommandType::QUERY, _xElements, - xMeta, aDefaultName, + xMetaData, aDefaultName, _bSaveAs ? SAD_OVERWRITE : SAD_DEFAULT); if(aDlg.Execute() == RET_OK) diff --git a/dbaccess/source/ui/tabledesign/table.src b/dbaccess/source/ui/tabledesign/table.src index aae912a7f6d9..35e4ecac7468 100644 --- a/dbaccess/source/ui/tabledesign/table.src +++ b/dbaccess/source/ui/tabledesign/table.src @@ -2,9 +2,9 @@ * * $RCSfile: table.src,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: kz $ $Date: 2001-07-13 20:48:40 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:56:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -951,6 +951,11 @@ ToolBox RID_BRW_TABLEDESIGN_TOOLBOX Text[ finnish ] = "Tallenna"; }; ToolBoxItem + { + ITEM_FILE_SAVEASDOC + Command = ".uno:SaveAsDoc"; + }; + ToolBoxItem { Type = TOOLBOXITEM_SEPARATOR ; }; @@ -1980,6 +1985,11 @@ Menu RID_TABLE_DESIGN_MAIN_MENU Command = ".uno:Save"; }; MenuItem + { + ITEM_FILE_SAVEASDOC + Command = ".uno:SaveAsDoc"; + }; + MenuItem { Separator = TRUE ; };