summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-29 17:12:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-29 21:37:18 +0200
commite3216e799f3bfe8f2aee6a516050135b462ffbfb (patch)
treed8e26cc595d2da7f6b6c2dfa3150922f26bd2436
parentd76ac8dd74d7c642d90dc5ac861f048becb902be (diff)
update DbFilterField to use the new replacement controls
Change-Id: I5b138a776ebbad9e5f7a50f3f44ab56fa283cba9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99719 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--svx/source/fmcomp/gridcell.cxx28
-rw-r--r--svx/source/form/filtnav.cxx1
-rw-r--r--svx/source/form/formcontroller.cxx11
3 files changed, 18 insertions, 22 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 21323cd9ad48..c325b519ed4f 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -285,13 +285,11 @@ bool DbGridColumn::Commit()
return bResult;
}
-
DbGridColumn::~DbGridColumn()
{
Clear();
}
-
void DbGridColumn::setModel(const css::uno::Reference< css::beans::XPropertySet >& _xModel)
{
if ( m_pCell.is() )
@@ -674,7 +672,6 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent)
implAdjustGenericFieldSetting( xSourceProps );
}
-
bool DbCellControl::Commit()
{
// lock the listening for value property changes
@@ -695,7 +692,6 @@ bool DbCellControl::Commit()
return bReturn;
}
-
void DbCellControl::ImplInitWindow( vcl::Window const & rParent, const InitWindowFacet _eInitWhat )
{
vcl::Window* pWindows[] = { m_pPainter, m_pWindow };
@@ -2820,8 +2816,16 @@ bool DbFilterField::commitControl()
}
return true;
}
+ case css::form::FormComponentType::COMBOBOX:
+ {
+ aText = static_cast<ComboBoxControl*>(m_pWindow.get())->get_widget().get_active_text();
+ break;
+ }
default:
- aText = m_pWindow->GetText();
+ {
+ aText = static_cast<EditControlBase*>(m_pWindow.get())->get_widget().get_text();
+ break;
+ }
}
if (m_aText != aText)
@@ -2898,8 +2902,16 @@ void DbFilterField::SetText(const OUString& rText)
sal_Int32 nPos = ::comphelper::findValue(m_aValueList, m_aText);
static_cast<ListBoxControl*>(m_pWindow.get())->get_widget().set_active(nPos);
} break;
+ case css::form::FormComponentType::COMBOBOX:
+ {
+ static_cast<ComboBoxControl*>(m_pWindow.get())->get_widget().set_entry_text(m_aText);
+ break;
+ }
default:
- m_pWindow->SetText(m_aText);
+ {
+ static_cast<EditControlBase*>(m_pWindow.get())->get_widget().set_text(m_aText);
+ break;
+ }
}
// now force a repaint on the window
@@ -4235,23 +4247,19 @@ sal_Bool SAL_CALL FmXFilterCell::isEditable()
return true;
}
-
void SAL_CALL FmXFilterCell::setEditable( sal_Bool /*bEditable*/ )
{
}
-
sal_Int16 SAL_CALL FmXFilterCell::getMaxTextLen()
{
return 0;
}
-
void SAL_CALL FmXFilterCell::setMaxTextLen( sal_Int16 /*nLen*/ )
{
}
-
IMPL_LINK_NOARG(FmXFilterCell, OnCommit, DbFilterField&, void)
{
::comphelper::OInterfaceIteratorHelper2 aIt( m_aTextListeners );
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 9e32c52af0d6..272bfa3a29da 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -348,7 +348,6 @@ namespace
}
// XFilterControllerListener
-
void FmFilterAdapter::predicateExpressionChanged( const FilterEvent& Event )
{
SolarMutexGuard aGuard;
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 000b568662f4..b3d493a3d7c3 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -1408,7 +1408,6 @@ IMPL_LINK_NOARG(FormController, OnToggleAutoFields, void*, void)
}
// XTextListener
-
void SAL_CALL FormController::textChanged(const TextEvent& e)
{
// SYNCHRONIZED -->
@@ -1465,7 +1464,6 @@ void SAL_CALL FormController::textChanged(const TextEvent& e)
}
// XItemListener
-
void SAL_CALL FormController::itemStateChanged(const ItemEvent& /*rEvent*/)
{
OSL_ENSURE( !impl_isDisposed_nofail(), "FormController: already disposed!" );
@@ -1473,7 +1471,6 @@ void SAL_CALL FormController::itemStateChanged(const ItemEvent& /*rEvent*/)
}
// XModificationBroadcaster
-
void SAL_CALL FormController::addModifyListener(const Reference< XModifyListener > & l)
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -1481,7 +1478,6 @@ void SAL_CALL FormController::addModifyListener(const Reference< XModifyListener
m_aModifyListeners.addInterface( l );
}
-
void FormController::removeModifyListener(const Reference< XModifyListener > & l)
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -1490,7 +1486,6 @@ void FormController::removeModifyListener(const Reference< XModifyListener > & l
}
// XModificationListener
-
void FormController::modified( const EventObject& _rEvent )
{
OSL_ENSURE( !impl_isDisposed_nofail(), "FormController: already disposed!" );
@@ -1517,14 +1512,12 @@ void FormController::modified( const EventObject& _rEvent )
impl_onModify();
}
-
void FormController::impl_checkDisposed_throw() const
{
if ( impl_isDisposed_nofail() )
throw DisposedException( OUString(), *const_cast< FormController* >( this ) );
}
-
void FormController::impl_onModify()
{
OSL_ENSURE( !impl_isDisposed_nofail(), "FormController: already disposed!" );
@@ -1539,7 +1532,6 @@ void FormController::impl_onModify()
m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvt );
}
-
void FormController::impl_addFilterRow( const FmFilterRow& _row )
{
m_aFilterRows.push_back( _row );
@@ -1551,7 +1543,6 @@ void FormController::impl_addFilterRow( const FmFilterRow& _row )
}
}
-
void FormController::impl_appendEmptyFilterRow( ::osl::ClearableMutexGuard& _rClearBeforeNotify )
{
// SYNCHRONIZED -->
@@ -1566,7 +1557,6 @@ void FormController::impl_appendEmptyFilterRow( ::osl::ClearableMutexGuard& _rCl
m_aFilterListeners.notifyEach( &XFilterControllerListener::disjunctiveTermAdded, aEvent );
}
-
bool FormController::determineLockState() const
{
OSL_ENSURE( !impl_isDisposed_nofail(), "FormController: already disposed!" );
@@ -1583,7 +1573,6 @@ bool FormController::determineLockState() const
}
// FocusListener
-
void FormController::focusGained(const FocusEvent& e)
{
// SYNCHRONIZED -->