[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/dlg/generalpage.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 5e3cb1833da113d6ec09001e7e365d24bd4289ee Author: Julien Nabet AuthorDate: Fri Feb 21 08:06:51 2020 +0100 Commit: Thorsten Behrens CommitDate: Thu Apr 9 16:09:27 2020 +0200 Set Firebird creation option experimental See: http://document-foundation-mail-archive.969070.n3.nabble.com/About-putting-Firebird-creation-option-experimental-tt4274028.html http://document-foundation-mail-archive.969070.n3.nabble.com/ESC-meeting-minutes-2020-02-20-tt4274082.html for rationale Change-Id: I73d1563575252ebbcfb764753294bceb29e9bf12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89167 Tested-by: Jenkins Reviewed-by: Julien Nabet (cherry picked from commit dc3c6e64650f0347648598dae0fa67c296ad36f5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89132 Reviewed-by: Michael Stahl Reviewed-by: Xisco Faulí (cherry picked from commit 2898943ed765290e2c58f8dd84053b4ef9ac158e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90629 Reviewed-by: Thorsten Behrens diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 5da530c6b201..5f205634b497 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include namespace dbaui @@ -157,6 +158,9 @@ namespace dbaui DisplayedTypes aDisplayedTypes; ::dbaccess::ODsnTypeCollection::TypeIterator aEnd = m_pCollection->end(); + +SvtMiscOptions aMiscOptions; + for ( ::dbaccess::ODsnTypeCollection::TypeIterator aTypeLoop = m_pCollection->begin(); aTypeLoop != aEnd; ++aTypeLoop @@ -169,6 +173,8 @@ namespace dbaui if ( m_pEmbeddedDBType->GetEntryPos( sDisplayName ) == LISTBOX_ENTRY_NOTFOUND && dbaccess::ODsnTypeCollection::isEmbeddedDatabase( sURLPrefix ) ) { +if( !aMiscOptions.IsExperimentalMode() && sURLPrefix.startsWith("sdbc:embedded:firebird") ) +continue; aDisplayedTypes.emplace_back( sURLPrefix, sDisplayName ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/dlg/dlgsize.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit c38e37606d71cfbefa9d9c9eb92b7a8b28f6ebea Author: Caolán McNamara AuthorDate: Tue Feb 25 12:30:38 2020 + Commit: Xisco Faulí CommitDate: Wed Feb 26 11:20:39 2020 +0100 Resolves: tdf130874 reversed logic Change-Id: I2ccac01f271ec803547ab36359f2273312df87e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89437 Tested-by: Jenkins Reviewed-by: Xisco Faulí diff --git a/dbaccess/source/ui/dlg/dlgsize.cxx b/dbaccess/source/ui/dlg/dlgsize.cxx index aca0710c5fc7..79504e3dc4ed 100644 --- a/dbaccess/source/ui/dlg/dlgsize.cxx +++ b/dbaccess/source/ui/dlg/dlgsize.cxx @@ -66,8 +66,8 @@ sal_Int32 DlgSize::GetValue() IMPL_LINK_NOARG(DlgSize, CbClickHdl, weld::ToggleButton&, void) { -m_xMF_VALUE->set_sensitive(m_xCB_STANDARD->get_active()); -if (!m_xCB_STANDARD->get_active()) +m_xMF_VALUE->set_sensitive(!m_xCB_STANDARD->get_active()); +if (m_xCB_STANDARD->get_active()) { // don't use getValue as this will use m_xCB_STANDARD->to determine if we're standard m_nPrevValue = static_cast(m_xMF_VALUE->get_value(FieldUnit::CM)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/core/dataaccess/databasedocument.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 79fdc6e0a3a44642ac8d49225f14241872097fb7 Author: Caolán McNamara AuthorDate: Mon Dec 9 16:52:54 2019 + Commit: Michael Stahl CommitDate: Tue Dec 10 09:44:40 2019 +0100 tdf#129210 don't assert with clear on already cleared mutex reset it after load completes, seeing as the comment suggests that's why the clear exists in the first place Change-Id: I3af633c5a1f99b5d0dd754c21e220c6c94b66634 Reviewed-on: https://gerrit.libreoffice.org/84789 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 9f72c08fe95a..9cd69e92ca65 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -685,6 +685,7 @@ void SAL_CALL ODatabaseDocument::recoverFromFile( const OUString& i_SourceLocati aGuard.clear(); // (load has an own guarding scheme) load( aMediaDescriptor.getPropertyValues() ); +aGuard.reset(); // Without a controller, we are unable to recover the sub components, as they're always tied to a controller. // So, everything else is done when the first controller is connected. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/dlg/paramdialog.cxx | 27 --- dbaccess/source/ui/inc/paramdialog.hxx |2 +- 2 files changed, 13 insertions(+), 16 deletions(-) New commits: commit 20fa796a88042e2d9d881c02f0aca5f461c63a80 Author: Caolán McNamara AuthorDate: Thu Nov 21 11:02:00 2019 + Commit: Adolfo Jayme Barrientos CommitDate: Fri Nov 22 16:11:39 2019 +0100 tdf#128748 replace warning dialog with tooltip so the TreeList does not get the mouse release it expects stolen from it by the dialog, leaving it stuck in "selecting" limbo Change-Id: If83dcdd8697b2a67e67fb062ae65ad947f49e8cd Reviewed-on: https://gerrit.libreoffice.org/83375 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 448676f7c6bf..526af7cdab50 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -144,10 +144,10 @@ namespace dbaui IMPL_LINK_NOARG(OParameterDialog, OnValueLoseFocusHdl, weld::Widget&, void) { -CheckValueForError(false); +CheckValueForError(); } -bool OParameterDialog::CheckValueForError(bool bShowDialog) +bool OParameterDialog::CheckValueForError() { if (m_nCurrentlySelected != -1) { @@ -156,6 +156,8 @@ namespace dbaui return false; } +bool bRet = false; + Reference< XPropertySet > xParamAsSet; m_xParams->getByIndex(m_nCurrentlySelected) >>= xParamAsSet; if (xParamAsSet.is()) @@ -166,6 +168,7 @@ namespace dbaui bool bValid = m_aPredicateInput.normalizePredicateString( sParamValue, xParamAsSet ); m_xParam->set_text(sParamValue); m_xParam->set_message_type(bValid ? weld::EntryMessageType::Normal : weld::EntryMessageType::Error); +OUString sToolTip; if ( bValid ) { // with this the value isn't dirty anymore @@ -184,22 +187,16 @@ namespace dbaui DBG_UNHANDLED_EXCEPTION("dbaccess"); } -if (bShowDialog) -{ -OUString sMessage(DBA_RES(STR_COULD_NOT_CONVERT_PARAM)); -sMessage = sMessage.replaceAll( "$name$", sName ); -std::unique_ptr xDialog(Application::CreateMessageDialog(m_xDialog.get(), - VclMessageType::Warning, VclButtonsType::Ok, - sMessage)); -xDialog->run(); -m_xParam->grab_focus(); -} -return true; +OUString sMessage(DBA_RES(STR_COULD_NOT_CONVERT_PARAM)); +sToolTip = sMessage.replaceAll( "$name$", sName ); +m_xParam->grab_focus(); +bRet = true; } +m_xParam->set_tooltip_text(sToolTip); } } -return false; +return bRet; } IMPL_LINK(OParameterDialog, OnButtonClicked, weld::Button&, rButton, void) @@ -280,7 +277,7 @@ namespace dbaui if (m_nCurrentlySelected != -1) { // do the transformation of the current text -if (CheckValueForError(true)) +if (CheckValueForError()) { // there was an error interpreting the text m_xAllParams->select(m_nCurrentlySelected); return true; diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index 5a434e49e1cb..bf3f453c9e3f 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -98,7 +98,7 @@ namespace dbaui DECL_LINK(OnEntryListBoxSelected, weld::TreeView&, void); DECL_LINK(OnButtonClicked, weld::Button&, void); DECL_LINK(OnValueLoseFocusHdl, weld::Widget&, void); -bool CheckValueForError(bool bShowDialog); +bool CheckValueForError(); bool OnEntrySelected(); }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/dlg/paramdialog.cxx | 42 - dbaccess/source/ui/inc/paramdialog.hxx |4 --- 2 files changed, 17 insertions(+), 29 deletions(-) New commits: commit 91ed8daea449c6c33217d891f431dcebb8a4bd4e Author: Caolán McNamara AuthorDate: Wed Nov 13 14:34:14 2019 + Commit: Xisco Faulí CommitDate: Tue Nov 19 12:52:18 2019 +0100 Resolves: tdf#128748 warning dialog appearing on focus change so can't use cancel because focus out of the entry happens on the effort to get to the cancel button instead only show the dialog on ok, next and selecting a new param in the treeview. Show an error indicator in the entry on focus-out instead. Reviewed-on: https://gerrit.libreoffice.org/82613 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit e151c12a14c1a2536393c82fa6027f251be1a7d6) Reviewed-on: https://gerrit.libreoffice.org/82625 Change-Id: I5770142d7a1e7c62bb9ed89a171e72129a43f6c8 Reviewed-on: https://gerrit.libreoffice.org/82787 Tested-by: Jenkins Reviewed-by: Xisco Faulí diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index bd988c210316..448676f7c6bf 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -55,7 +55,6 @@ namespace dbaui , m_nCurrentlySelected(-1) , m_xConnection(_rxConnection) , m_aPredicateInput( rxContext, _rxConnection, getParseContext() ) -, m_bNeedErrorOnCurrent(true) , m_xAllParams(m_xBuilder->weld_tree_view("allParamTreeview")) , m_xParam(m_xBuilder->weld_entry("paramEntry")) , m_xTravelNext(m_xBuilder->weld_button("next")) @@ -145,10 +144,10 @@ namespace dbaui IMPL_LINK_NOARG(OParameterDialog, OnValueLoseFocusHdl, weld::Widget&, void) { -OnValueLoseFocus(); +CheckValueForError(false); } -bool OParameterDialog::OnValueLoseFocus() +bool OParameterDialog::CheckValueForError(bool bShowDialog) { if (m_nCurrentlySelected != -1) { @@ -166,6 +165,7 @@ namespace dbaui OUString sParamValue(m_xParam->get_text()); bool bValid = m_aPredicateInput.normalizePredicateString( sParamValue, xParamAsSet ); m_xParam->set_text(sParamValue); +m_xParam->set_message_type(bValid ? weld::EntryMessageType::Normal : weld::EntryMessageType::Error); if ( bValid ) { // with this the value isn't dirty anymore @@ -174,9 +174,6 @@ namespace dbaui } else { -if (!m_bNeedErrorOnCurrent) -return true; - OUString sName; try { @@ -187,13 +184,16 @@ namespace dbaui DBG_UNHANDLED_EXCEPTION("dbaccess"); } -OUString sMessage(DBA_RES(STR_COULD_NOT_CONVERT_PARAM)); -sMessage = sMessage.replaceAll( "$name$", sName ); -std::unique_ptr xDialog(Application::CreateMessageDialog(m_xDialog.get(), - VclMessageType::Warning, VclButtonsType::Ok, - sMessage)); -xDialog->run(); -m_xParam->grab_focus(); +if (bShowDialog) +{ +OUString sMessage(DBA_RES(STR_COULD_NOT_CONVERT_PARAM)); +sMessage = sMessage.replaceAll( "$name$", sName ); +std::unique_ptr xDialog(Application::CreateMessageDialog(m_xDialog.get(), + VclMessageType::Warning, VclButtonsType::Ok, + sMessage)); +xDialog->run(); +m_xParam->grab_focus(); +} return true; } } @@ -208,7 +208,6 @@ namespace dbaui { // no interpreting of the given values anymore m_xParam->connect_focus_out(Link()); // no direct call from the control anymore ... -m_bNeedErrorOnCurrent = false; // in case of any indirect calls -> no error message m_xDialog->response(RET_CANCEL); } else if (m_xOKBtn.get() == ) @@ -216,10 +215,6 @@ namespace dbaui // transfer the current values into the Any if (OnEntrySelected()) { // there was an error interpreting the current text -m_bNeedErrorOnCurrent = true; -// we're are out of the complex web :) of
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/dlg/detailpages.cxx | 16 +++- dbaccess/source/ui/dlg/detailpages.hxx |3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) New commits: commit 09dfad2098d1737c0519c8ad74dd67b4292e73d1 Author: Caolán McNamara AuthorDate: Fri Aug 2 10:43:27 2019 +0100 Commit: Xisco Faulí CommitDate: Wed Oct 30 09:23:42 2019 +0100 dispose MySQLNativePage Reviewed-on: https://gerrit.libreoffice.org/76854 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara (cherry picked from commit 2598f8a127c6ce2ec85a0d1ae1b1c706951e4e9d) Change-Id: I2506d08b8c2e5b501bccb8b5ef2e6d829a912852 Reviewed-on: https://gerrit.libreoffice.org/81683 Tested-by: Jenkins Reviewed-by: Xisco Faulí diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index a9c19e8d2e27..9a47c1b73ba1 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -502,7 +502,7 @@ namespace dbaui MySQLNativePage::MySQLNativePage(TabPageParent pParent, const SfxItemSet& rCoreAttrs) : OCommonBehaviourTabPage(pParent, "dbaccess/ui/mysqlnativepage.ui", "MysqlNativePage", rCoreAttrs, OCommonBehaviourTabPageFlags::UseCharset) , m_xMySQLSettingsContainer(m_xBuilder->weld_widget("MySQLSettingsContainer")) -, m_aMySQLSettings(m_xMySQLSettingsContainer.get(), LINK(this,OGenericAdministrationPage,OnControlModified)) +, m_xMySQLSettings(new DBMySQLNativeSettings(m_xMySQLSettingsContainer.get(), LINK(this,OGenericAdministrationPage,OnControlModified))) , m_xSeparator1(m_xBuilder->weld_label("connectionheader")) , m_xSeparator2(m_xBuilder->weld_label("userheader")) , m_xUserNameLabel(m_xBuilder->weld_label("usernamelabel")) @@ -512,6 +512,12 @@ namespace dbaui m_xUserName->connect_changed(LINK(this,OGenericAdministrationPage,OnControlEntryModifyHdl)); } +void MySQLNativePage::dispose() +{ +m_xMySQLSettings.reset(); +OCommonBehaviourTabPage::dispose(); +} + MySQLNativePage::~MySQLNativePage() { disposeOnce(); @@ -520,7 +526,7 @@ namespace dbaui void MySQLNativePage::fillControls(std::vector< std::unique_ptr >& _rControlList) { OCommonBehaviourTabPage::fillControls( _rControlList ); -m_aMySQLSettings.fillControls( _rControlList ); +m_xMySQLSettings->fillControls( _rControlList ); _rControlList.emplace_back(new OSaveValueWidgetWrapper(m_xUserName.get())); _rControlList.emplace_back(new OSaveValueWidgetWrapper(m_xPasswordRequired.get())); @@ -529,7 +535,7 @@ namespace dbaui void MySQLNativePage::fillWindows(std::vector< std::unique_ptr >& _rControlList) { OCommonBehaviourTabPage::fillWindows( _rControlList ); -m_aMySQLSettings.fillWindows( _rControlList); +m_xMySQLSettings->fillWindows( _rControlList); _rControlList.emplace_back(new ODisableWidgetWrapper(m_xSeparator1.get())); _rControlList.emplace_back(new ODisableWidgetWrapper(m_xSeparator2.get())); @@ -540,7 +546,7 @@ namespace dbaui { bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet( _rSet ); -bChangedSomething |= m_aMySQLSettings.FillItemSet( _rSet ); +bChangedSomething |= m_xMySQLSettings->FillItemSet( _rSet ); if (m_xUserName->get_value_changed_from_saved()) { @@ -558,7 +564,7 @@ namespace dbaui bool bValid, bReadonly; getFlags(_rSet, bValid, bReadonly); -m_aMySQLSettings.implInitControls( _rSet ); +m_xMySQLSettings->implInitControls( _rSet ); const SfxStringItem* pUidItem = _rSet.GetItem(DSID_USER); const SfxBoolItem* pAllowEmptyPwd = _rSet.GetItem(DSID_PASSWORDREQUIRED); diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index 8de9f2f3e757..ffb8d96cec12 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -194,11 +194,12 @@ namespace dbaui { public: MySQLNativePage(TabPageParent pParent, const SfxItemSet& rCoreAttrs); +virtual void dispose() override; virtual ~MySQLNativePage() override; private: std::unique_ptr m_xMySQLSettingsContainer; -DBMySQLNativeSettings m_aMySQLSettings; +std::unique_ptr m_xMySQLSettings; std::unique_ptr m_xSeparator1; std::unique_ptr m_xSeparator2; std::unique_ptr m_xUserNameLabel; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/inc/DExport.hxx |3 --- dbaccess/source/ui/uno/copytablewizard.cxx |6 -- 2 files changed, 9 deletions(-) New commits: commit 8a9ce8164aedda16e6732845adfdae03a7c810de Author: Tamas Bunth AuthorDate: Tue Sep 3 15:28:05 2019 +0200 Commit: Xisco Faulí CommitDate: Wed Sep 4 11:55:57 2019 +0200 Revert "tdf#127093, tdf#127092 Fix pasting autoincremented" This reverts commit fa177231cd20bf3c3f4bb9b50f6646da139c6766. Change-Id: Ia0c2d83c840c0ff8981b721766a6a1df810f971d Reviewed-on: https://gerrit.libreoffice.org/78559 Tested-by: Jenkins Reviewed-by: Tamás Bunth (cherry picked from commit d783017c1ccb4e62e99f26b42250ac4e15780cff) Reviewed-on: https://gerrit.libreoffice.org/78581 Reviewed-by: Xisco Faulí diff --git a/dbaccess/source/ui/inc/DExport.hxx b/dbaccess/source/ui/inc/DExport.hxx index 7dbcbf31fc6a..397b527d6d7d 100644 --- a/dbaccess/source/ui/inc/DExport.hxx +++ b/dbaccess/source/ui/inc/DExport.hxx @@ -61,9 +61,6 @@ namespace dbaui public: typedef std::map TColumns; typedef std::vector TColumnVector; - -// first value is the position in the destination table. The second -// value is the position of the column in the source table. typedef std::vector< std::pair > TPositions; protected: diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index d8dd195701cf..e7004aa8d29b 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1183,12 +1183,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou // otherwise we don't get the correct value when only the 2nd source column was selected continue; } -else if( xMeta->isAutoIncrement( rColumnPos.second ) ) -{ -// it is auto incremented. Let the DBMS deal with it. -++nSourceColumn; -continue; -} if ( ( nSourceColumn < 1 ) || ( nSourceColumn >= static_cast(aSourceColTypes.size()) ) ) { // ( we have to check here against 1 because the parameters are 1 based) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/uno/copytablewizard.cxx | 11 --- 1 file changed, 11 deletions(-) New commits: commit 3ae4ce3919a4e61afa94c7eb02c03c05cb1cc3f5 Author: Tamas Bunth AuthorDate: Sat Aug 31 18:27:44 2019 +0200 Commit: Xisco Faulí CommitDate: Mon Sep 2 17:24:30 2019 +0200 dbaccess: delete old paste autoincrement logic Change-Id: I6a4392c9e93842838022370fe6c54908adcc627b Reviewed-on: https://gerrit.libreoffice.org/78358 Tested-by: Jenkins Reviewed-by: Tamás Bunth (cherry picked from commit 376cc3ea0fc2e0f209763a2a27c5852136332c86) Reviewed-on: https://gerrit.libreoffice.org/78400 Reviewed-by: Xisco Faulí diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 8d9bc43a4193..d8dd195701cf 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1096,7 +1096,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou const OCopyTableWizard& rWizard = impl_getDialog_throw(); ODatabaseExport::TPositions aColumnPositions = rWizard.GetColumnPositions(); -bool bAutoIncrement = rWizard.shouldCreatePrimaryKey(); Reference< XRow > xRow ( _rxSourceResultSet, UNO_QUERY_THROW ); Reference< XRowLocate > xRowLocate ( _rxSourceResultSet, UNO_QUERY_THROW ); @@ -1168,7 +1167,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aCopyEvent.Error.clear(); try { -bool bInsertAutoIncrement = true; // notify listeners m_aCopyTableListeners.notifyEach( ::copyingRow, aCopyEvent ); @@ -1188,19 +1186,10 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou else if( xMeta->isAutoIncrement( rColumnPos.second ) ) { // it is auto incremented. Let the DBMS deal with it. -// TODO initial value could be set when defining the -// table ++nSourceColumn; continue; } -if ( bAutoIncrement && bInsertAutoIncrement ) -{ -xStatementParams->setInt( 1, nRowCount ); -bInsertAutoIncrement = false; -continue; -} - if ( ( nSourceColumn < 1 ) || ( nSourceColumn >= static_cast(aSourceColTypes.size()) ) ) { // ( we have to check here against 1 because the parameters are 1 based) ::dbtools::throwSQLException("Internal error: invalid column type index.", ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/misc/WCopyTable.cxx | 12 1 file changed, 12 insertions(+) New commits: commit 0eb27ca7e8e2e07a478b7eb1a7ecc08aa6d472af Author: Tamas Bunth AuthorDate: Fri Aug 30 14:01:19 2019 +0200 Commit: Xisco Faulí CommitDate: Mon Sep 2 17:24:55 2019 +0200 Query MySQL schema name when pasting table In case of a MySQL direct connection the current schema in use cannot be queried with the getUserName() method of the DatabaseMetadata interface, because the user name and the schema name can (and usually do) differ. Instead, we can always query for the current schema with the DATABASE() SQL function. Change-Id: Ibb026519e1a63e29c5a7c9b04ab64901faec0f85 Reviewed-on: https://gerrit.libreoffice.org/78297 Tested-by: Jenkins Reviewed-by: Tamás Bunth (cherry picked from commit c635364120ab8b6cea1e78ebeda4fb028df7678a) Reviewed-on: https://gerrit.libreoffice.org/78387 Reviewed-by: Xisco Faulí diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index ca8dac4694f4..14608b3c5d71 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -1204,7 +1205,18 @@ Reference< XPropertySet > OCopyTableWizard::createTable() if ( sSchema.isEmpty() && xMetaData->supportsSchemasInTableDefinitions() ) { +// query of current schema is quite inconsistent. In case of some +// DBMS's each user has their own schema. sSchema = xMetaData->getUserName(); +// In case of mysql it is not that simple +if(xMetaData->getDatabaseProductName() == "MySQL") +{ +Reference< XStatement > xSelect = m_xDestConnection->createStatement(); +Reference< XResultSet > xRs = xSelect->executeQuery("select database()"); +xRs->next(); // first and only result +Reference< XRow > xRow( xRs, UNO_QUERY_THROW ); +sSchema = xRow->getString(1); +} } xTable->setPropertyValue(PROPERTY_CATALOGNAME,makeAny(sCatalog)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/ui/inc/DExport.hxx |3 +++ dbaccess/source/ui/uno/copytablewizard.cxx |8 2 files changed, 11 insertions(+) New commits: commit 2ddd1a5ca306ed6bfdcd375af094cdbd9e6212ca Author: Tamas Bunth AuthorDate: Fri Aug 30 14:57:31 2019 +0200 Commit: Xisco Faulí CommitDate: Mon Sep 2 15:19:12 2019 +0200 tdf#127093, tdf#127092 Fix pasting autoincremented Fix copy/paste functionality when trying to paste a table with auto incremental column in it. In that case we should let the DBMS handle the values in that column. Change-Id: Ia40a0056402ec540f469b94694629dd6db7d4e71 Reviewed-on: https://gerrit.libreoffice.org/78298 Tested-by: Jenkins Reviewed-by: Tamás Bunth (cherry picked from commit fa177231cd20bf3c3f4bb9b50f6646da139c6766) Reviewed-on: https://gerrit.libreoffice.org/78388 Reviewed-by: Xisco Faulí diff --git a/dbaccess/source/ui/inc/DExport.hxx b/dbaccess/source/ui/inc/DExport.hxx index 397b527d6d7d..7dbcbf31fc6a 100644 --- a/dbaccess/source/ui/inc/DExport.hxx +++ b/dbaccess/source/ui/inc/DExport.hxx @@ -61,6 +61,9 @@ namespace dbaui public: typedef std::map TColumns; typedef std::vector TColumnVector; + +// first value is the position in the destination table. The second +// value is the position of the column in the source table. typedef std::vector< std::pair > TPositions; protected: diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 295575187044..8d9bc43a4193 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1185,6 +1185,14 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou // otherwise we don't get the correct value when only the 2nd source column was selected continue; } +else if( xMeta->isAutoIncrement( rColumnPos.second ) ) +{ +// it is auto incremented. Let the DBMS deal with it. +// TODO initial value could be set when defining the +// table +++nSourceColumn; +continue; +} if ( bAutoIncrement && bInsertAutoIncrement ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/core/dataaccess/datasource.cxx | 16 +++- dbaccess/source/ui/dlg/dbwizsetup.cxx |1 + 2 files changed, 16 insertions(+), 1 deletion(-) New commits: commit 2b0d0863ebe39a964a927b3867aef277700f0066 Author: Xisco Fauli AuthorDate: Mon Jul 15 17:52:23 2019 +0200 Commit: Thorsten Behrens CommitDate: Wed Aug 7 23:27:17 2019 +0200 tdf#121599, tdf#123099: ignore migration dialog when 1. a new HSQLDB database is created 2. the HSQLDB database is not opened interactively Change-Id: I7287e467e06be5eec1e5c661123e1332cdaeef9b Reviewed-on: https://gerrit.libreoffice.org/75643 Tested-by: Jenkins Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens (cherry picked from commit 77ef0a92b3bd19f836d0fcb2a41af5e643129283) Reviewed-on: https://gerrit.libreoffice.org/76843 diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index c3b6214e7bc8..d2afd8cc78aa 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -602,8 +602,22 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString Reference< XDriverManager > xManager; #if ENABLE_FIREBIRD_SDBC +bool bIgnoreMigration = false; bool bNeedMigration = false; -if(m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb") +Reference< XModel > xModel = m_pImpl->getModel_noCreate(); +if ( xModel) +{ +//See ODbTypeWizDialogSetup::SaveDatabaseDocument +::comphelper::NamedValueCollection aArgs( xModel->getArgs() ); +aArgs.get("IgnoreFirebirdMigration") >>= bIgnoreMigration; +} +else +{ +//ignore when we don't have a model. E.g. Mailmerge, data sources, fields... +bIgnoreMigration = true; +} + +if(!bIgnoreMigration && m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb") { Reference const xRootStorage = m_pImpl->getOrCreateRootStorage(); OUString sMigrEnvVal; diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 5076997c30ed..76405e537cfe 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -681,6 +681,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument() aArgs.put( "Overwrite", true ); aArgs.put( "InteractionHandler", xHandler ); aArgs.put( "MacroExecutionMode", MacroExecMode::USE_CONFIG ); +aArgs.put( "IgnoreFirebirdMigration", true ); OUString sPath = ODbDataSourceAdministrationHelper::getDocumentUrl( *m_pOutSet ); xStore->storeAsURL( sPath, aArgs.getPropertyValues() ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/filter/hsqldb/parseschema.cxx | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) New commits: commit 47d6c43c19aa6ea05f0f65db58e5cdcf1c603660 Author: Tamas Bunth AuthorDate: Tue Jul 16 21:44:38 2019 +0200 Commit: Christian Lohmaier CommitDate: Thu Jul 18 12:05:03 2019 +0200 tdf#123020 dbahsql: Support string delimiter Support multi-word table names while migrating HSQLDB data. Change-Id: I5129f995ea90a3fdbcbcb844774cf074f3ffddb2 Reviewed-on: https://gerrit.libreoffice.org/75734 Tested-by: Jenkins Reviewed-by: Xisco Faulí (cherry picked from commit b5890bf269214a47833bc9514b80650455e77ef6) Reviewed-on: https://gerrit.libreoffice.org/75820 Reviewed-by: Christian Lohmaier diff --git a/dbaccess/source/filter/hsqldb/parseschema.cxx b/dbaccess/source/filter/hsqldb/parseschema.cxx index be08037b7be5..60e7103cdfa2 100644 --- a/dbaccess/source/filter/hsqldb/parseschema.cxx +++ b/dbaccess/source/filter/hsqldb/parseschema.cxx @@ -28,6 +28,7 @@ #include #include #include +#include namespace { @@ -74,8 +75,17 @@ public: OUString getTableName() const { -// SET TABLE -return string::split(m_sql, u' ')[2]; +// SET TABLE or SET TABLE "" +OUString sName = string::split(m_sql, u' ')[2]; +if (sName.indexOf('"') >= 0) +{ +// Table name with string delimiter +OUStringBuffer sMultiName("\""); +sMultiName.append(string::split(m_sql, u'"')[1]); +sMultiName.append("\""); +sName = sMultiName.makeStringAndClear(); +} +return sName; } }; @@ -169,6 +179,12 @@ void SchemaParser::parseSchema() std::vector SchemaParser::getTableColumnTypes(const OUString& sTableName) const { +if (m_ColumnTypes.count(sTableName) < 1) +{ +constexpr char NOT_EXIST[] = "Internal error while getting column information of table"; +SAL_WARN("dbaccess", NOT_EXIST << ". Table name is: " << sTableName); +dbtools::throwGenericSQLException(NOT_EXIST, ::comphelper::getProcessComponentContext()); +} return m_ColumnTypes.at(sTableName); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source dbaccess/uiconfig
dbaccess/source/core/inc/migrwarndlg.hxx |2 ++ dbaccess/source/core/misc/migrwarndlg.cxx |2 ++ dbaccess/uiconfig/ui/migrwarndlg.ui | 29 ++--- 3 files changed, 26 insertions(+), 7 deletions(-) New commits: commit c0ac81cdce09823861042441dc4deb71357aa395 Author: Caolán McNamara AuthorDate: Thu Jun 6 16:24:26 2019 +0100 Commit: Caolán McNamara CommitDate: Thu Jun 13 17:42:57 2019 +0200 add link to hsqldb->firebird migration dialog 1. keep presenting the migration dialog 2. but, default to 'later' 3. add a link to a URL that someone will have to fill in Change-Id: I4c67fe0b65fd78e942ca0760c0f9e128e5ac7be6 Reviewed-on: https://gerrit.libreoffice.org/73966 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/dbaccess/source/core/inc/migrwarndlg.hxx b/dbaccess/source/core/inc/migrwarndlg.hxx index 3e0935bd732c..e01c2b9f0099 100644 --- a/dbaccess/source/core/inc/migrwarndlg.hxx +++ b/dbaccess/source/core/inc/migrwarndlg.hxx @@ -15,6 +15,8 @@ namespace dbaccess { class MigrationWarnDialog : public weld::MessageDialogController { +std::unique_ptr m_xLater; + public: MigrationWarnDialog(weld::Window* pParent); }; diff --git a/dbaccess/source/core/misc/migrwarndlg.cxx b/dbaccess/source/core/misc/migrwarndlg.cxx index cbbe6e3ca90c..d1712fba3f16 100644 --- a/dbaccess/source/core/misc/migrwarndlg.cxx +++ b/dbaccess/source/core/misc/migrwarndlg.cxx @@ -13,7 +13,9 @@ namespace dbaccess { MigrationWarnDialog::MigrationWarnDialog(weld::Window* pParent) : MessageDialogController(pParent, "dbaccess/ui/migrwarndlg.ui", "MigrationWarnDialog") +, m_xLater(m_xBuilder->weld_button("no")) { +m_xLater->grab_focus(); } } diff --git a/dbaccess/uiconfig/ui/migrwarndlg.ui b/dbaccess/uiconfig/ui/migrwarndlg.ui index 5f25d767a182..97a89cb6f67f 100644 --- a/dbaccess/uiconfig/ui/migrwarndlg.ui +++ b/dbaccess/uiconfig/ui/migrwarndlg.ui @@ -1,5 +1,5 @@ - + @@ -11,12 +11,12 @@ The document contains embedded HSQL data, which is deprecated. Would you like to migrate to Firebird now? - + False vertical -2 +12 - + False @@ -37,6 +37,8 @@ _Later True True +True +True True True @@ -50,17 +52,30 @@ False False +end 0 + + +Click for important information about migration. +True +True +True +none +https://wiki.documentfoundation.org/Documentation/HowTo/MigrateFromHSQLDB + + +False +True +2 + + yes no - - - ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - dbaccess/source
dbaccess/source/core/misc/dsntypes.cxx |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 27bd20cf5333a5df29286794b7384520fbc55012 Author: Julien Nabet AuthorDate: Sun May 19 21:08:52 2019 +0200 Commit: Xisco Faulí CommitDate: Wed Jun 12 12:39:47 2019 +0200 tdf#125381: Manage URLs beginning with an "~" in cutPrefix (dbaccess/dsntypes) On Windows or with other renderings than gtk3, the urls may begin with an ~ In this case, cutPrefix returns only empty string When trying to access Index management for odb files related to dBase indexes don't display because cutPrefix returns empty url in dbaccess/source/ui/dlg/detailpages.cxx line 200 198 ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : nullptr; 199 if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength()) 200 m_sDsn = pTypeCollection->cutPrefix(pUrlItem->GetValue()); Change-Id: I47360e205ddea7b060a31da697bbe9857ad3f4c0 Reviewed-on: https://gerrit.libreoffice.org/72568 Reviewed-by: Julien Nabet (cherry picked from commit d34ed0008f12cfe47dd239672f1941f3c54d97fd) Reviewed-on: https://gerrit.libreoffice.org/73709 Tested-by: Jenkins Reviewed-by: Xisco Faulí diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index 05e64ba5a001..7332ccffa196 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -83,17 +83,20 @@ OUString ODsnTypeCollection::cutPrefix(const OUString& _sURL) const OUString sRet; OUString sOldPattern; +// on Windows or with gen rendering, the urls may begin with an ~ +const OUString& sCleanURL = comphelper::string::stripStart(_sURL, '~'); + for (auto const& dsnPrefix : m_aDsnPrefixes) { WildCard aWildCard(dsnPrefix); -if ( sOldPattern.getLength() < dsnPrefix.getLength() && aWildCard.Matches(_sURL) ) +if ( sOldPattern.getLength() < dsnPrefix.getLength() && aWildCard.Matches(sCleanURL) ) { // This relies on the fact that all patterns are of the form // foo* // that is, the very concept of "prefix" applies. OUString prefix(comphelper::string::stripEnd(dsnPrefix, '*')); -OSL_ENSURE(prefix.getLength() <= _sURL.getLength(), "How can A match B when A shorter than B?"); -sRet = _sURL.copy(prefix.getLength()); +OSL_ENSURE(prefix.getLength() <= sCleanURL.getLength(), "How can A match B when A shorter than B?"); +sRet = sCleanURL.copy(prefix.getLength()); sOldPattern = dsnPrefix; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits