[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - forms/source
forms/source/component/ListBox.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 39ea36bf8602744c27c16369c88db2858653b59f Author: Lionel Elie MamaneDate: Sat Jun 24 15:10:59 2017 +0200 tdf#108732 ListBox: in absence of a field, treat data as string so that one meaningfully compare it; default is DataType::OTHER, which is not comparable Change-Id: Ifc1e1c9b801f45d0a95a83d30cc205b91e647880 Reviewed-on: https://gerrit.libreoffice.org/39211 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index d5599d55859e..b875eef1d15c 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -1070,7 +1070,9 @@ namespace frm sal_Int32 OListBoxModel::getValueType() const { -return (m_nBoundColumnType != css::sdbc::DataType::SQLNULL) ? m_nBoundColumnType : getFieldType(); +return (m_nBoundColumnType != css::sdbc::DataType::SQLNULL) ? +m_nBoundColumnType : +( hasField() ? getFieldType() : DataType::VARCHAR); } ValueList OListBoxModel::impl_getValues() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - forms/source
forms/source/component/FormComponent.cxx | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) New commits: commit bb50f9d66540a87065f30da8fd8cadde8e730704 Author: Lionel Elie MamaneDate: Tue May 9 12:53:25 2017 +0200 tdf#107720 Bound Control initFromField: consider the case of the insert row loplugin: simplifybool (cherry picked from commit 95b25532d24bfb08c4846b991451a36475dd439f) Change-Id: If18e161c994c926fd86453ab5736df1e89bb61de Reviewed-on: https://gerrit.libreoffice.org/37427 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 80e85758801c..743f4d47986b 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -1981,7 +1981,17 @@ void OBoundControlModel::initFromField( const Reference< XRowSet >& _rxRowSet ) // but only if the rowset is positioned on a valid record if ( hasField() && _rxRowSet.is() ) { -if ( !_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast() ) +bool shouldTransfer(!_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast()); +if (!shouldTransfer) +{ +const Reference< XPropertySet > xPS(_rxRowSet, UNO_QUERY); +if (xPS.is()) +{ +assert(!shouldTransfer); +xPS->getPropertyValue("IsNew") >>= shouldTransfer; +} +} +if ( shouldTransfer ) transferDbValueToControl(); else // reset the field if the row set is empty ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - forms/source
forms/source/component/ListBox.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 23b8a097090ad544c596e644cf477feb360c9469 Author: Lionel Elie MamaneDate: Thu Mar 9 19:44:38 2017 +0100 tdf#106462 old value and new value were swapped in commit 66ccfcd2908445b8194c364c89778056374b02af Author: Jochen Nitschke Date: Fri Oct 21 09:36:10 2016 +0200 remove use of tryPropertyValue Any specialisation Change-Id: I3180cf5b9e63a3da9257b03ba02967a2d5402ec3 Reviewed-by: Stephan Bergmann Change-Id: I90dd3f6dba799eec9210dbb7560be105cb50e6d1 Reviewed-on: https://gerrit.libreoffice.org/35021 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 00e1e7a..d5599d5 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -421,8 +421,8 @@ namespace frm Any _rCurrentValue = getCurrentSingleValue(); if (_rCurrentValue != _rValue) { -_rOldValue = _rValue; -_rConvertedValue = _rCurrentValue; +_rOldValue = _rCurrentValue; +_rConvertedValue = _rValue; bModified = true; } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - forms/source
forms/source/misc/InterfaceContainer.cxx | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) New commits: commit 46885644fe87a6e9f86a79b7fd1eafbe3ea0e5a6 Author: Noel GrandinDate: Fri Feb 24 11:24:46 2017 +0200 better fix for tdf#103830 the first fix in commit 3a404ea870f1eed86f9765447ce0a364d39ae8f8 did not take into account that this a multimap, not a map. Thanks to Aron Budea for spotting that. Change-Id: I86d2d2a9d6cb08fd3cee3965a5b787d5691f0352 Reviewed-on: https://gerrit.libreoffice.org/34604 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit e146741ec96292ef092c6eebfd7fe18fa5ca3cc0) Reviewed-on: https://gerrit.libreoffice.org/34606 diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index cf64c97..e90880f 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -660,13 +660,15 @@ throw (css::uno::RuntimeException, std::exception) { if (evt.PropertyName == PROPERTY_NAME) { ::osl::MutexGuard aGuard( m_rMutex ); -OInterfaceMap::iterator i = m_aMap.find(::comphelper::getString(evt.OldValue)); -if (i != m_aMap.end() && i->second == evt.Source) -{ -css::uno::Reference xCorrectType(i->second); -m_aMap.erase(i); -m_aMap.insert(::std::pair >(::comphelper::getString(evt.NewValue),xCorrectType)); -} +auto range = m_aMap.equal_range(::comphelper::getString(evt.OldValue)); +for (auto it = range.first; it != range.second; ++it) +if (it->second == evt.Source) +{ +css::uno::Reference xCorrectType(it->second); +m_aMap.erase(it); +m_aMap.insert(::std::pair >(::comphelper::getString(evt.NewValue),xCorrectType)); +break; +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - forms/source
forms/source/misc/InterfaceContainer.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 81e5ba515c66bc23520f3d9c06c54c63d927e467 Author: Noel GrandinDate: Fri Feb 24 09:28:19 2017 +0200 tdf#103830 Form field names not update in python macro regression from commit 5f15cc01b31ccaed0c6482a36556dece084ce302 "new loplugin: use more efficient find() methods" Regression found by Aron Budea. Change-Id: I0e84376dfd754738de97882979058f86c2476bd6 Reviewed-on: https://gerrit.libreoffice.org/34600 Reviewed-by: Julien Nabet Tested-by: Julien Nabet (cherry picked from commit 3a404ea870f1eed86f9765447ce0a364d39ae8f8) Reviewed-on: https://gerrit.libreoffice.org/34601 diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index e8973e7..cf64c97 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -661,9 +661,9 @@ throw (css::uno::RuntimeException, std::exception) { { ::osl::MutexGuard aGuard( m_rMutex ); OInterfaceMap::iterator i = m_aMap.find(::comphelper::getString(evt.OldValue)); -if (i != m_aMap.end() && (*i).second != evt.Source) +if (i != m_aMap.end() && i->second == evt.Source) { -css::uno::Reference xCorrectType((*i).second); +css::uno::Reference xCorrectType(i->second); m_aMap.erase(i); m_aMap.insert(::std::pair >(::comphelper::getString(evt.NewValue),xCorrectType)); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits