1. mst
  2. ooo340

Commits

Frank Schoenheit [fs]  committed 06ee153 Merge

dba34d: pulled and merged remote changes

  • Participants
  • Parent commits b454965, 897fee0
  • Branches default

Comments (0)

Files changed (1)

File dbaccess/source/core/misc/DatabaseDataProvider.cxx

View file
  • Ignore whitespace
 #include <com/sun/star/task/XInteractionHandler.hpp>
 #include <com/sun/star/sdb/XCompletedExecution.hpp>
 #include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/chart/ChartDataRowSource.hpp>
 #include <com/sun/star/chart/XChartDataArray.hpp>
+#include <com/sun/star/chart/XDateCategories.hpp>
 
 #include <vector>
 #include <list>
     }
 
     ::std::vector< ::rtl::OUString > aRowLabels;
+	::std::vector< double > aDateRowLabels;
     ::std::vector< ::std::vector< double > > aDataValues;
     sal_Int32 nRowCount = 0;
     ::connectivity::ORowSetValue aValue;
         ++nRowCount;
         
         aValue.fill( aColumns[0].nResultSetPosition, aColumns[0].nDataType, xRow );
-        aRowLabels.push_back( aValue.getString() );
+		switch(aColumns[0].nDataType)
+		{
+			case sdbc::DataType::DATE:
+			case sdbc::DataType::TIMESTAMP:
+				aDateRowLabels.push_back( aValue.getDouble() );
+				break;
+			default:
+				aRowLabels.push_back( aValue.getString() );
+				break;
+		}
 
         ::std::vector< double > aRow;
         for (   ColumnDescriptions::const_iterator col = aColumns.begin();
         }
     } // if ( !nRowCount )
         
-    uno::Reference< chart::XChartDataArray> xData(m_xInternal,uno::UNO_QUERY);
-    xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size()));
+	uno::Reference< chart::XChartDataArray> xData(m_xInternal,uno::UNO_QUERY);
+	if ( aDateRowLabels.empty() )
+	{		
+		xData->setRowDescriptions(uno::Sequence< ::rtl::OUString >(&(*aRowLabels.begin()),aRowLabels.size()));
+	}
+	else
+	{
+		uno::Reference< chart::XDateCategories> xDate(m_xInternal,uno::UNO_QUERY);
+		xDate->setDateCategories(uno::Sequence< double >(&(*aDateRowLabels.begin()),aDateRowLabels.size()));
+	}
+    
 
     const size_t nOffset = bFirstColumnIsCategory ? 1 : 0;
     uno::Sequence< ::rtl::OUString > aColumnDescriptions( aColumns.size() - nOffset );