[Libreoffice-commits] core.git: 2 commits - include/connectivity svx/Library_svxcore.mk svx/source

Lionel Elie Mamane lionel at mamane.lu
Fri Sep 26 06:21:55 PDT 2014


 include/connectivity/dbconversion.hxx    |   63 +++++++++++-------------
 svx/Library_svxcore.mk                   |    1 
 svx/source/fmcomp/gridcell.cxx           |   16 +++---
 svx/source/fmcomp/gridctrl.cxx           |    9 ++-
 svx/source/form/typeconversionclient.cxx |   44 ----------------
 svx/source/inc/gridcell.hxx              |    5 -
 svx/source/inc/typeconversionclient.hxx  |   81 -------------------------------
 7 files changed, 48 insertions(+), 171 deletions(-)

New commits:
commit ded97cfe65ed168e83ecbaf9e94710082b42dffa
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Sep 26 15:10:41 2014 +0200

    remove ::svxform::OStaticDataAccessTools from DbCellControl
    
    Change-Id: Icd93a418fad8c9f05b49fcd412a1e2ba4b9c240b

diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index f7516e8..8ecaf4f 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -63,6 +63,7 @@
 #include <tools/diagnose_ex.h>
 #include <vcl/longcurr.hxx>
 #include <vcl/settings.hxx>
+#include <connectivity/dbtools.hxx>
 #include <connectivity/dbconversion.hxx>
 
 #include <math.h>
@@ -81,6 +82,7 @@ using namespace ::com::sun::star::sdb;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::form;
 using namespace ::dbtools::DBTypeConversion;
+using namespace ::dbtools;
 
 using ::com::sun::star::util::XNumberFormatter;
 namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
@@ -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*/)
 {
     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();
 }
@@ -1324,7 +1326,7 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
         Reference< XRowSet >  xCursorForm(xCursor, UNO_QUERY);
         if (xCursorForm.is())
         {   // 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())
                 nFormatKey = ::comphelper::getINT32(m_rColumn.GetField()->getPropertyValue(FM_PROP_FORMATKEY));
@@ -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*/)
 {
     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() )
     {
@@ -1918,7 +1920,7 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe
         if ( m_rColumn.GetParent().getDataSource() )
             xForm = Reference< XRowSet >( ( Reference< XInterface > )*m_rColumn.GetParent().getDataSource(), UNO_QUERY );
         if ( xForm.is() )
-            xSupplier = getNumberFormats( getRowSetConnection( xForm ), true );
+            xSupplier = getNumberFormats( getConnection( xForm ), true );
         SvNumberFormatter* pFormatterUsed = NULL;
         if ( xSupplier.is() )
         {
@@ -2926,7 +2928,7 @@ bool DbFilterField::commitControl()
 
                 Reference< XRowSet > xDataSourceRowSet(
                     (Reference< XInterface >)*m_rColumn.GetParent().getDataSource(), UNO_QUERY);
-                Reference< XConnection >  xConnection(getRowSetConnection(xDataSourceRowSet));
+                Reference< XConnection >  xConnection(getConnection(xDataSourceRowSet));
 
                 xParseNode->parseNodeToPredicateStr(aPreparedText,
                                                     xConnection,
@@ -3019,7 +3021,7 @@ void DbFilterField::Update()
         Reference< XTablesSupplier > xSupTab;
         xFormProp->getPropertyValue("SingleSelectQueryComposer") >>= xSupTab;
 
-        Reference< XConnection >  xConnection(getRowSetConnection(xForm));
+        Reference< XConnection >  xConnection(getConnection(xForm));
         if (!xSupTab.is())
             return;
 
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index dd5b477..0673bfe 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -24,6 +24,7 @@
 #include "svx/dbtoolsclient.hxx"
 #include "svx/fmtools.hxx"
 #include <svtools/stringtransfer.hxx>
+#include <connectivity/dbtools.hxx>
 #include <connectivity/dbconversion.hxx>
 
 #include "fmprop.hrc"
@@ -59,6 +60,8 @@
 #include <cstdlib>
 #include <map>
 
+using namespace ::dbtools;
+using namespace ::dbtools::DBTypeConversion;
 using namespace ::svxform;
 using namespace ::svt;
 using namespace ::com::sun::star::beans;
@@ -1374,8 +1377,7 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
 
     // get a new formatter and data cursor
     m_xFormatter = NULL;
-    OStaticDataAccessTools aStaticTools;
-    Reference< ::com::sun::star::util::XNumberFormatsSupplier >  xSupplier = aStaticTools.getNumberFormats(aStaticTools.getRowSetConnection(_xCursor), true);
+    Reference< ::com::sun::star::util::XNumberFormatsSupplier >  xSupplier = getNumberFormats(getConnection(_xCursor), true);
     if (xSupplier.is())
     {
         m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 00d602a..5d23f19 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -197,8 +197,7 @@ private:
 // benoetigt
 
 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
 {
 private:
commit d6d458671f1c79be3373271871518caa04ef2208
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Sep 26 14:18:37 2014 +0200

    rip out all remaining uses of svxform::OTypeConversionClient and remove it
    
    It just wraps around dbtools, which is linked directly now.
    
    Change-Id: If8d281962018a48a54858421e3490f5032658691

diff --git a/include/connectivity/dbconversion.hxx b/include/connectivity/dbconversion.hxx
index f99de9a..169682a 100644
--- a/include/connectivity/dbconversion.hxx
+++ b/include/connectivity/dbconversion.hxx
@@ -69,11 +69,10 @@ namespace dbtools
 {
 
 
-    class OOO_DLLPUBLIC_DBTOOLS DBTypeConversion
+    namespace DBTypeConversion
     {
-    public:
-        static ::com::sun::star::util::Date getStandardDate();
-        static void setValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumnUpdate>& xVariant,
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::Date getStandardDate();
+        OOO_DLLPUBLIC_DBTOOLS void setValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumnUpdate>& xVariant,
                                     const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter,
                                     const ::com::sun::star::util::Date& rNullDate,
                                     const OUString& rString,
@@ -81,68 +80,68 @@ namespace dbtools
                                     sal_Int16 nFieldType,
                                     sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException);
 
-        static void setValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumnUpdate>& xVariant,
+        OOO_DLLPUBLIC_DBTOOLS void setValue(const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumnUpdate>& xVariant,
                              const ::com::sun::star::util::Date& rNullDate,
                              const double& rValue,
                              sal_Int16 nKeyType) throw(::com::sun::star::lang::IllegalArgumentException);
 
-        static double getValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& xVariant, const ::com::sun::star::util::Date& rNullDate );
+        OOO_DLLPUBLIC_DBTOOLS double getValue( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& xVariant, const ::com::sun::star::util::Date& rNullDate );
 
         // get the columnvalue as string with a default format given by the column or a default format
         // for the type
-        static OUString getFormattedValue(
+        OOO_DLLPUBLIC_DBTOOLS OUString getFormattedValue(
                                         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn,
                                         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter,
                                         const ::com::sun::star::lang::Locale& _rLocale,
                                         const ::com::sun::star::util::Date& rNullDate);
 
-        static OUString getFormattedValue(
+        OOO_DLLPUBLIC_DBTOOLS OUString getFormattedValue(
                                         const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _xColumn,
                                         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& xFormatter,
                                         const ::com::sun::star::util::Date& rNullDate,
                                         sal_Int32 nKey,
                                         sal_Int16 nKeyType);
 
-        static ::com::sun::star::util::Date     toDate(double dVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
-        static ::com::sun::star::util::Date     toDate(const OUString& _sSQLDate);
-        static ::com::sun::star::util::Time     toTime(double dVal, short nDigits = 9);
-        static ::com::sun::star::util::Time     toTime(const OUString& _sSQLDate);
-        static ::com::sun::star::util::DateTime toDateTime(double dVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
-        static ::com::sun::star::util::DateTime toDateTime(const OUString& _sSQLDate);
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::Date     toDate(double dVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::Date     toDate(const OUString& _sSQLDate);
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::Time     toTime(double dVal, short nDigits = 9);
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::Time     toTime(const OUString& _sSQLDate);
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::DateTime toDateTime(double dVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::DateTime toDateTime(const OUString& _sSQLDate);
 
-        static sal_Int64 getNsFromTime(const ::com::sun::star::util::Time& rVal);
+        OOO_DLLPUBLIC_DBTOOLS sal_Int64 getNsFromTime(const ::com::sun::star::util::Time& rVal);
 
-        static sal_Int32 toDays(const ::com::sun::star::util::Date& _rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+        OOO_DLLPUBLIC_DBTOOLS sal_Int32 toDays(const ::com::sun::star::util::Date& _rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
 
-        static double   toDouble(const ::com::sun::star::util::Date& rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
-        static double   toDouble(const ::com::sun::star::util::Time& rVal);
-        static double   toDouble(const ::com::sun::star::util::DateTime& rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+        OOO_DLLPUBLIC_DBTOOLS double   toDouble(const ::com::sun::star::util::Date& rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
+        OOO_DLLPUBLIC_DBTOOLS double   toDouble(const ::com::sun::star::util::Time& rVal);
+        OOO_DLLPUBLIC_DBTOOLS double   toDouble(const ::com::sun::star::util::DateTime& rVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate());
 
-        static ::com::sun::star::util::Date toDate(sal_Int32 _nVal);
-        static ::com::sun::star::util::Time toTime(sal_Int64 _nVal);
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::Date toDate(sal_Int32 _nVal);
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::Time toTime(sal_Int64 _nVal);
 
         /** convert a double which is a date value relative to a given fixed date into a date value relative
             to the standard db null date.
         */
-        static double toStandardDbDate(const ::com::sun::star::util::Date& _rNullDate, double _rVal) { return _rVal + toDays(_rNullDate); }
+        OOO_DLLPUBLIC_DBTOOLS inline double toStandardDbDate(const ::com::sun::star::util::Date& _rNullDate, double _rVal) { return _rVal + toDays(_rNullDate); }
         /** convert a double which is a date value relative to the standard db null date into a date value relative
             to a given fixed date.
         */
-        static double toNullDate(const ::com::sun::star::util::Date& _rNullDate, double _rVal) { return _rVal - toDays(_rNullDate); }
+        OOO_DLLPUBLIC_DBTOOLS inline double toNullDate(const ::com::sun::star::util::Date& _rNullDate, double _rVal) { return _rVal - toDays(_rNullDate); }
 
         // return the date from the numberformatsupplier or the STANDARD_DATE (1900,1,1)
-        static ::com::sun::star::util::Date getNULLDate(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > &xSupplier);
+        OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::util::Date getNULLDate(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > &xSupplier);
 
         // return the date in the format %04d-%02d-%02d
-        static OUString toDateString(const ::com::sun::star::util::Date& rDate);
+        OOO_DLLPUBLIC_DBTOOLS OUString toDateString(const ::com::sun::star::util::Date& rDate);
         // return the time in the format %02d:%02d:%02d
-        static OUString toTimeStringS(const ::com::sun::star::util::Time& rTime);
+        OOO_DLLPUBLIC_DBTOOLS OUString toTimeStringS(const ::com::sun::star::util::Time& rTime);
         // return the time in the format %02d:%02d:%02d.%09d
-        static OUString toTimeString(const ::com::sun::star::util::Time& rTime);
+        OOO_DLLPUBLIC_DBTOOLS OUString toTimeString(const ::com::sun::star::util::Time& rTime);
         // return the DateTime in the format %04d-%02d-%02d %02d:%02d:%02d.%09d
-        static OUString toDateTimeString(const ::com::sun::star::util::DateTime& _rDateTime);
+        OOO_DLLPUBLIC_DBTOOLS OUString toDateTimeString(const ::com::sun::star::util::DateTime& _rDateTime);
         // return the any in an sql standard format
-        static OUString toSQLString(sal_Int32 eType, const ::com::sun::star::uno::Any& _rVal, bool bQuote,
+        OOO_DLLPUBLIC_DBTOOLS OUString toSQLString(sal_Int32 eType, const ::com::sun::star::uno::Any& _rVal, bool bQuote,
             const ::com::sun::star::uno::Reference< ::com::sun::star::script::XTypeConverter >&  _rxTypeConverter);
 
         /** converts a Unicode string into a 8-bit string, using the given encoding
@@ -161,7 +160,7 @@ namespace dbtools
             @return
                 the length of the converted string
         */
-        static sal_Int32 convertUnicodeString(
+        OOO_DLLPUBLIC_DBTOOLS sal_Int32 convertUnicodeString(
             const OUString& _rSource,
             OString&  _rDest,
             rtl_TextEncoding _eEncoding
@@ -190,13 +189,13 @@ namespace dbtools
             @return
                 the length of the converted string
         */
-        static sal_Int32 convertUnicodeStringToLength(
+        OOO_DLLPUBLIC_DBTOOLS sal_Int32 convertUnicodeStringToLength(
             const OUString& _rSource,
             OString&  _rDest,
             sal_Int32 _nMaxLen,
             rtl_TextEncoding _eEncoding
        );
-    };
+    }
 
 
 }   // namespace dbtools
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index fadb007..24b5788 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -444,7 +444,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
     svx/source/form/sdbdatacolumn \
     svx/source/form/sqlparserclient \
     svx/source/form/stringlistresource \
-    svx/source/form/typeconversionclient \
     svx/source/form/typemap \
     svx/source/form/xfm_addcondition \
 ))
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index dbafe52..f7516e8 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -63,6 +63,7 @@
 #include <tools/diagnose_ex.h>
 #include <vcl/longcurr.hxx>
 #include <vcl/settings.hxx>
+#include <connectivity/dbconversion.hxx>
 
 #include <math.h>
 #include <stdio.h>
@@ -79,6 +80,7 @@ using namespace ::com::sun::star::sdbcx;
 using namespace ::com::sun::star::sdb;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::form;
+using namespace ::dbtools::DBTypeConversion;
 
 using ::com::sun::star::util::XNumberFormatter;
 namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 7a8cbab..dd5b477 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -24,6 +24,7 @@
 #include "svx/dbtoolsclient.hxx"
 #include "svx/fmtools.hxx"
 #include <svtools/stringtransfer.hxx>
+#include <connectivity/dbconversion.hxx>
 
 #include "fmprop.hrc"
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
@@ -874,7 +875,7 @@ DbGridControl::DbGridControl(
             ,m_pSeekCursor(NULL)
             ,m_nSeekPos(-1)
             ,m_nTotalCount(-1)
-            ,m_aNullDate(OTypeConversionClient().getStandardDate())
+            ,m_aNullDate(::dbtools::DBTypeConversion::getStandardDate())
             ,m_nMode(DEFAULT_BROWSE_MODE)
             ,m_nCurrentPos(-1)
             ,m_nDeleteEvent(0)
diff --git a/svx/source/form/typeconversionclient.cxx b/svx/source/form/typeconversionclient.cxx
deleted file mode 100644
index 8914d4e..0000000
--- a/svx/source/form/typeconversionclient.cxx
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "typeconversionclient.hxx"
-
-
-namespace svxform
-{
-
-    OTypeConversionClient::OTypeConversionClient()
-    {
-    }
-
-
-    bool OTypeConversionClient::ensureLoaded() const
-    {
-        if ( !ODbtoolsClient::ensureLoaded() )
-            return false;
-         m_xTypeConversion = getFactory()->getTypeConversionHelper();
-        return m_xTypeConversion.is();
-    }
-
-
-}   // namespace svxform
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 2051498..00d602a 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -23,7 +23,6 @@
 #include <svx/gridctrl.hxx>
 
 #include "sqlparserclient.hxx"
-#include "typeconversionclient.hxx"
 
 #include <com/sun/star/sdb/XColumn.hpp>
 #include <com/sun/star/form/XBoundControl.hpp>
@@ -198,8 +197,7 @@ private:
 // benoetigt
 
 class DbCellControl
-        :public ::svxform::OTypeConversionClient
-        ,public ::svxform::OStaticDataAccessTools
+        :public ::svxform::OStaticDataAccessTools
         ,public FmMutexHelper           // _before_ the listener, so the listener is to be destroyed first!
         ,public ::comphelper::OPropertyChangeListener
 {
diff --git a/svx/source/inc/typeconversionclient.hxx b/svx/source/inc/typeconversionclient.hxx
deleted file mode 100644
index 909d1f8..0000000
--- a/svx/source/inc/typeconversionclient.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_SOURCE_INC_TYPECONVERSIONCLIENT_HXX
-#define INCLUDED_SVX_SOURCE_INC_TYPECONVERSIONCLIENT_HXX
-
-#include "svx/dbtoolsclient.hxx"
-
-
-namespace svxform
-{
-
-    class OTypeConversionClient : public ODbtoolsClient
-    {
-    protected:
-        mutable ::rtl::Reference< ::connectivity::simple::IDataAccessTypeConversion >
-                m_xTypeConversion;
-        virtual bool ensureLoaded() const SAL_OVERRIDE;
-
-    public:
-        OTypeConversionClient();
-
-
-        inline ::com::sun::star::util::Date getStandardDate() const
-        {
-            ::com::sun::star::util::Date aReturn;
-            if ( ensureLoaded() )
-                aReturn = m_xTypeConversion->getStandardDate();
-            return aReturn;
-        }
-
-
-        inline double getValue(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn>& _rxVariant,
-            const ::com::sun::star::util::Date& _rNullDate ) const
-        {
-            double nReturn(0);
-            if ( ensureLoaded() )
-                nReturn = m_xTypeConversion->getValue( _rxVariant, _rNullDate );
-            return nReturn;
-        }
-
-
-        inline OUString getFormattedValue(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XColumn >& _rxColumn,
-            const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter,
-            const ::com::sun::star::util::Date& _rNullDate,
-            sal_Int32 _nKey,
-            sal_Int16 _nKeyType) const
-        {
-            OUString sReturn;
-            if ( ensureLoaded() )
-                sReturn = m_xTypeConversion->getFormattedValue(_rxColumn, _rxFormatter, _rNullDate, _nKey, _nKeyType);
-            return sReturn;
-        }
-    };
-
-
-}   // namespace svxform
-
-
-#endif // INCLUDED_SVX_SOURCE_INC_TYPECONVERSIONCLIENT_HXX
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list