summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2014-12-21 18:44:26 +0100
committerAndras Timar <andras.timar@collabora.com>2015-01-08 15:09:36 +0100
commite0504b17b930d8056820b14d469fee1d82b60a3f (patch)
treeaf577b1fab18afb9673aa8329a71c0c153cc7618 /svx
parent49a428c5074e66d1905d68f8c0049ea0a85d9bdf (diff)
fdo#87555 ComboBox in table should use same formatting as floating ComboBox
Same as fdo#67615 for TexFields, but for ComboBox. Same problem, same cause, same solution. ListBox seems not to have this problem :) Change-Id: I953c5452f6c313b8940fbd1048b4c901b331fc58 Reviewed-on: https://gerrit.libreoffice.org/13580 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit b8dfd3ae3c322d9cabc78e76c5a9d18ead5823cd)
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/gridcell.cxx19
-rw-r--r--svx/source/inc/gridcell.hxx1
2 files changed, 4 insertions, 16 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 0863c60b69f5..3e866f3744b7 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -2452,7 +2452,6 @@ bool DbTimeField::commitControl()
DbComboBox::DbComboBox(DbGridColumn& _rColumn)
:DbCellControl(_rColumn)
- ,m_nKeyType(::com::sun::star::util::NumberFormat::UNDEFINED)
{
setAlignedController( false );
@@ -2524,9 +2523,6 @@ void DbComboBox::Init( Window& rParent, const Reference< XRowSet >& xCursor )
SetList( xModel->getPropertyValue( FM_PROP_STRINGITEMLIST ) );
implAdjustGenericFieldSetting( xModel );
- if (m_rColumn.GetParent().getNumberFormatter().is())
- m_nKeyType = comphelper::getNumberFormatType(m_rColumn.GetParent().getNumberFormatter()->getNumberFormatsSupplier()->getNumberFormats(), m_rColumn.GetKey());
-
DbCellControl::Init( rParent, xCursor );
}
@@ -2539,17 +2535,10 @@ CellControllerRef DbComboBox::CreateController() const
OUString DbComboBox::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< XNumberFormatter >& xFormatter, Color** /*ppColor*/)
{
- OUString aString;
- if (_rxField.is())
- try
- {
- aString = getFormattedValue( _rxField, xFormatter, m_rColumn.GetParent().getNullDate(), m_rColumn.GetKey(), m_nKeyType );
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- return aString;
+ const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xPS(_rxField, UNO_QUERY);
+ ::dbtools::FormattedColumnValue fmter( xFormatter, xPS );
+
+ return fmter.getFormattedValue();
}
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 9e86abd2526b..6c1a37267e95 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -473,7 +473,6 @@ protected:
class DbComboBox : public DbCellControl
{
- sal_Int16 m_nKeyType;
public:
TYPEINFO_OVERRIDE();