summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2014-08-29 21:04:26 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-09-03 05:41:39 -0500
commit9a69d111c1f563b5a4f484154d1be36a5a92f3e6 (patch)
treea0b936e20a33ebed6dbc2e5b745cb8c98e49cb20
parentbee7674a602123229b62cad23536f103496a5298 (diff)
fdo#67615 TextField in table should use same formatting as floating TextField
Change-Id: Ia6333d12f9f1ecdd5a552089f0df8703c5fce88a Reviewed-on: https://gerrit.libreoffice.org/11197 Tested-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--svx/Library_svxcore.mk1
-rw-r--r--svx/source/fmcomp/gridcell.cxx18
-rw-r--r--svx/source/inc/gridcell.hxx1
3 files changed, 4 insertions, 16 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index b1cbc0215531..ee4322d89e37 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_use_libraries,svxcore,\
comphelper \
cppuhelper \
cppu \
+ dbtools \
drawinglayer \
editeng \
fwe \
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index cf24b3518553..0863c60b69f5 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1083,7 +1083,6 @@ DbTextField::DbTextField(DbGridColumn& _rColumn)
:DbLimitedLengthField(_rColumn)
,m_pEdit( NULL )
,m_pPainterImplementation( NULL )
- ,m_nKeyType(::com::sun::star::util::NumberFormat::TEXT)
,m_bIsSimpleEdit( true )
{
}
@@ -1160,9 +1159,6 @@ void DbTextField::Init( Window& rParent, const Reference< XRowSet >& xCursor)
implAdjustGenericFieldSetting( xModel );
- if (m_rColumn.GetParent().getNumberFormatter().is() && m_rColumn.GetKey())
- m_nKeyType = comphelper::getNumberFormatType(m_rColumn.GetParent().getNumberFormatter()->getNumberFormatsSupplier()->getNumberFormats(), m_rColumn.GetKey());
-
DbLimitedLengthField::Init( rParent, xCursor );
}
@@ -1184,18 +1180,10 @@ void DbTextField::PaintFieldToCell( OutputDevice& _rDev, const Rectangle& _rRect
OUString DbTextField::GetFormatText(const Reference< 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();
- }
+ const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xPS(_rxField, UNO_QUERY);
+ ::dbtools::FormattedColumnValue fmter( xFormatter, xPS );
- return aString;
+ return fmter.getFormattedValue();
}
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 6275c3f8ee80..9e86abd2526b 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -393,7 +393,6 @@ class DbTextField : public DbLimitedLengthField
{
::svt::IEditImplementation* m_pEdit;
::svt::IEditImplementation* m_pPainterImplementation;
- sal_Int16 m_nKeyType;
bool m_bIsSimpleEdit;
protected: