diff options
author | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2010-11-30 01:45:03 +0100 |
---|---|---|
committer | Ingrid Halama [iha] <Ingrid.Halama@oracle.com> | 2010-11-30 01:45:03 +0100 |
commit | edaa216847e59ad93b8b99e95f293f8bb04344cc (patch) | |
tree | 7193a7fdd5a3520b21755c675cb4d3de4e3100cb /sc | |
parent | 0e5566e9ff510bedc9837e12ee37103c553897da (diff) |
chart46: #i25706# implement date axis
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/chartpos.cxx | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx index 58ee1b06f7f7..99eacac5b07a 100644 --- a/sc/source/core/tool/chartpos.cxx +++ b/sc/source/core/tool/chartpos.cxx @@ -36,6 +36,22 @@ #include "document.hxx" #include "rechead.hxx" +namespace +{ + bool lcl_hasValueDataButNoDates( ScDocument* pDocument, SCCOL nCol, SCROW nRow, SCTAB nTab ) + { + bool bReturn = false; + if (pDocument->HasValueData( nCol, nRow, nTab )) + { + //treat dates like text #i25706# + sal_uInt32 nNumberFormat = pDocument->GetNumberFormat( ScAddress( nCol, nRow, nTab ) ); + short nType = pDocument->GetFormatTable()->GetType(nNumberFormat); + bool bIsDate = (nType == NUMBERFORMAT_DATE) || (nType == NUMBERFORMAT_DATETIME); + bReturn = !bIsDate; + } + return bReturn; + } +} ScChartPositioner::ScChartPositioner( ScDocument* pDoc, SCTAB nTab, SCCOL nStartColP, SCROW nStartRowP, SCCOL nEndColP, SCROW nEndRowP) : @@ -290,12 +306,12 @@ void ScChartPositioner::CheckColRowHeaders() { for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++) { - if (pDocument->HasValueData( iCol, nRow1, nTab1 )) + if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 )) bColStrings = FALSE; } for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++) { - if (pDocument->HasValueData( nCol1, iRow, nTab1 )) + if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 )) bRowStrings = FALSE; } } @@ -315,7 +331,7 @@ void ScChartPositioner::CheckColRowHeaders() if ( nCol1 <= nCol2 ) for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++) { - if (pDocument->HasValueData( nCol1, iRow, nTab1 )) + if (lcl_hasValueDataButNoDates( pDocument, nCol1, iRow, nTab1 )) bRowStrings = FALSE; } } @@ -324,7 +340,7 @@ void ScChartPositioner::CheckColRowHeaders() if ( nRow1 <= nRow2 ) for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++) { - if (pDocument->HasValueData( iCol, nRow1, nTab1 )) + if (lcl_hasValueDataButNoDates( pDocument, iCol, nRow1, nTab1 )) bColStrings = FALSE; } } |