Kaydet (Commit) ded97cfe authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

remove ::svxform::OStaticDataAccessTools from DbCellControl

Change-Id: Icd93a418fad8c9f05b49fcd412a1e2ba4b9c240b
üst d6d45867
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include <vcl/longcurr.hxx> #include <vcl/longcurr.hxx>
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
#include <connectivity/dbtools.hxx>
#include <connectivity/dbconversion.hxx> #include <connectivity/dbconversion.hxx>
#include <math.h> #include <math.h>
...@@ -81,6 +82,7 @@ using namespace ::com::sun::star::sdb; ...@@ -81,6 +82,7 @@ using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::form; using namespace ::com::sun::star::form;
using namespace ::dbtools::DBTypeConversion; using namespace ::dbtools::DBTypeConversion;
using namespace ::dbtools;
using ::com::sun::star::util::XNumberFormatter; using ::com::sun::star::util::XNumberFormatter;
namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior; namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
...@@ -1171,7 +1173,7 @@ void DbTextField::PaintFieldToCell( OutputDevice& _rDev, const Rectangle& _rRect ...@@ -1171,7 +1173,7 @@ void DbTextField::PaintFieldToCell( OutputDevice& _rDev, const Rectangle& _rRect
OUString DbTextField::GetFormatText(const Reference< XColumn >& _rxField, const Reference< XNumberFormatter >& xFormatter, Color** /*ppColor*/) OUString DbTextField::GetFormatText(const Reference< XColumn >& _rxField, const Reference< XNumberFormatter >& xFormatter, Color** /*ppColor*/)
{ {
const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xPS(_rxField, UNO_QUERY); const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xPS(_rxField, UNO_QUERY);
::dbtools::FormattedColumnValue fmter( xFormatter, xPS ); FormattedColumnValue fmter( xFormatter, xPS );
return fmter.getFormattedValue(); return fmter.getFormattedValue();
} }
...@@ -1324,7 +1326,7 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x ...@@ -1324,7 +1326,7 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
Reference< XRowSet > xCursorForm(xCursor, UNO_QUERY); Reference< XRowSet > xCursorForm(xCursor, UNO_QUERY);
if (xCursorForm.is()) if (xCursorForm.is())
{ // wenn wir vom Cursor den Formatter nehmen, dann auch den Key vom Feld, an das wir gebunden sind { // wenn wir vom Cursor den Formatter nehmen, dann auch den Key vom Feld, an das wir gebunden sind
m_xSupplier = getNumberFormats(getRowSetConnection(xCursorForm), false); m_xSupplier = getNumberFormats(getConnection(xCursorForm), false);
if (m_rColumn.GetField().is()) if (m_rColumn.GetField().is())
nFormatKey = ::comphelper::getINT32(m_rColumn.GetField()->getPropertyValue(FM_PROP_FORMATKEY)); nFormatKey = ::comphelper::getINT32(m_rColumn.GetField()->getPropertyValue(FM_PROP_FORMATKEY));
...@@ -1795,7 +1797,7 @@ OUString DbPatternField::impl_formatText( const OUString& _rText ) ...@@ -1795,7 +1797,7 @@ OUString DbPatternField::impl_formatText( const OUString& _rText )
OUString DbPatternField::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< XNumberFormatter >& /*xFormatter*/, Color** /*ppColor*/) OUString DbPatternField::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< XNumberFormatter >& /*xFormatter*/, Color** /*ppColor*/)
{ {
bool bIsForPaint = _rxField != m_rColumn.GetField(); bool bIsForPaint = _rxField != m_rColumn.GetField();
::std::unique_ptr< ::dbtools::FormattedColumnValue >& rpFormatter = bIsForPaint ? m_pPaintFormatter : m_pValueFormatter; ::std::unique_ptr< FormattedColumnValue >& rpFormatter = bIsForPaint ? m_pPaintFormatter : m_pValueFormatter;
if ( !rpFormatter.get() ) if ( !rpFormatter.get() )
{ {
...@@ -1918,7 +1920,7 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe ...@@ -1918,7 +1920,7 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe
if ( m_rColumn.GetParent().getDataSource() ) if ( m_rColumn.GetParent().getDataSource() )
xForm = Reference< XRowSet >( ( Reference< XInterface > )*m_rColumn.GetParent().getDataSource(), UNO_QUERY ); xForm = Reference< XRowSet >( ( Reference< XInterface > )*m_rColumn.GetParent().getDataSource(), UNO_QUERY );
if ( xForm.is() ) if ( xForm.is() )
xSupplier = getNumberFormats( getRowSetConnection( xForm ), true ); xSupplier = getNumberFormats( getConnection( xForm ), true );
SvNumberFormatter* pFormatterUsed = NULL; SvNumberFormatter* pFormatterUsed = NULL;
if ( xSupplier.is() ) if ( xSupplier.is() )
{ {
...@@ -2926,7 +2928,7 @@ bool DbFilterField::commitControl() ...@@ -2926,7 +2928,7 @@ bool DbFilterField::commitControl()
Reference< XRowSet > xDataSourceRowSet( Reference< XRowSet > xDataSourceRowSet(
(Reference< XInterface >)*m_rColumn.GetParent().getDataSource(), UNO_QUERY); (Reference< XInterface >)*m_rColumn.GetParent().getDataSource(), UNO_QUERY);
Reference< XConnection > xConnection(getRowSetConnection(xDataSourceRowSet)); Reference< XConnection > xConnection(getConnection(xDataSourceRowSet));
xParseNode->parseNodeToPredicateStr(aPreparedText, xParseNode->parseNodeToPredicateStr(aPreparedText,
xConnection, xConnection,
...@@ -3019,7 +3021,7 @@ void DbFilterField::Update() ...@@ -3019,7 +3021,7 @@ void DbFilterField::Update()
Reference< XTablesSupplier > xSupTab; Reference< XTablesSupplier > xSupTab;
xFormProp->getPropertyValue("SingleSelectQueryComposer") >>= xSupTab; xFormProp->getPropertyValue("SingleSelectQueryComposer") >>= xSupTab;
Reference< XConnection > xConnection(getRowSetConnection(xForm)); Reference< XConnection > xConnection(getConnection(xForm));
if (!xSupTab.is()) if (!xSupTab.is())
return; return;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "svx/dbtoolsclient.hxx" #include "svx/dbtoolsclient.hxx"
#include "svx/fmtools.hxx" #include "svx/fmtools.hxx"
#include <svtools/stringtransfer.hxx> #include <svtools/stringtransfer.hxx>
#include <connectivity/dbtools.hxx>
#include <connectivity/dbconversion.hxx> #include <connectivity/dbconversion.hxx>
#include "fmprop.hrc" #include "fmprop.hrc"
...@@ -59,6 +60,8 @@ ...@@ -59,6 +60,8 @@
#include <cstdlib> #include <cstdlib>
#include <map> #include <map>
using namespace ::dbtools;
using namespace ::dbtools::DBTypeConversion;
using namespace ::svxform; using namespace ::svxform;
using namespace ::svt; using namespace ::svt;
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
...@@ -1374,8 +1377,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt ...@@ -1374,8 +1377,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
// get a new formatter and data cursor // get a new formatter and data cursor
m_xFormatter = NULL; m_xFormatter = NULL;
OStaticDataAccessTools aStaticTools; Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = getNumberFormats(getConnection(_xCursor), true);
Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = aStaticTools.getNumberFormats(aStaticTools.getRowSetConnection(_xCursor), true);
if (xSupplier.is()) if (xSupplier.is())
{ {
m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter >( m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(
......
...@@ -197,8 +197,7 @@ private: ...@@ -197,8 +197,7 @@ private:
// benoetigt // benoetigt
class DbCellControl class DbCellControl
:public ::svxform::OStaticDataAccessTools :public FmMutexHelper // _before_ the listener, so the listener is to be destroyed first!
,public FmMutexHelper // _before_ the listener, so the listener is to be destroyed first!
,public ::comphelper::OPropertyChangeListener ,public ::comphelper::OPropertyChangeListener
{ {
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment