https://issues.apache.org/ooo/show_bug.cgi?id=124069

--- Comment #10 from Andre <[email protected]> ---
Problem 1 (horizontal axis shows dates) has also two components:

A) A general problem with the horizontal (X) axis (Y and Z axis are treated
specially and differently) leads to use dates for its tick marks whenever
possible.  And that seems to be most of the time.

B) A) is triggered by a) copying the chart (to clipboard) and b) it having an
internal data provider.

Details:  Copying the chart starts with a call do ScDrawView::DoCopy().  This
leads eventually to a call to
chart::AxisHelper::getExplicitNumberFormatKeyForAxis().  Other methods on the
call stack are: ChartHelper::tryToGetChartContentAsPrimitive2DSequence(),
chart::ChartView::update(), chart::ChartView::createShapes().

In getExplicitNumberFormatKeyForAxis() the XPropertySet of the axis returns 0
at first.  This would lead to exactly the desired formatting (plain numbers). 
But when the chart document has an internal data provider then the number
format is updated by this code snippet (AxisHelper.cxx:187, reformatted):
  else if( xChartDoc.is() && xChartDoc->hasInternalDataProvider()
     && nDimensionIndex == 0 ) //maybe date axis
  {
     Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram() );
     if( DiagramHelper::isSupportingDateAxis( xDiagram ) )
     {
       nNumberFormatKey = DiagramHelper::getDateNumberFormat( 
         xNumberFormatsSupplier );
     }
     ...

isSupportingDateAxis returns true. It does that for the majority of chart types
and, more importantly, it does that with checking the chart type and otherwise
only static data.  If the user sets the axis type explicitly to, say, text,
then that is ignored.
That means, the pure existence of the internal data provider causes the bug,
not any of the values it does provide.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.

Reply via email to