summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx2
-rw-r--r--chart2/source/view/main/ChartView.cxx14
-rw-r--r--sw/qa/extras/layout/data/tdf133005.odtbin0 -> 13251 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx26
4 files changed, 31 insertions, 11 deletions
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 57375c33bfee..1add0435b0bc 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -191,7 +191,7 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel
if( nDimensionIndex==1 && nAxisIndex==1 && ChartTypeHelper::isSupportingBaseValue( xChartType ) )
m_bShowAxisOrigin = true;
- if ( nDimensionIndex == 0 && aData.AxisType == chart2::AxisType::CATEGORY )
+ if ( nDimensionIndex == 0 && ( aData.AxisType == chart2::AxisType::CATEGORY || aData.AxisType == chart2::AxisType::DATE ) )
{
ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get());
if (pModel)
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index bc9d7a18d1d3..d3b0e8832e36 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -628,19 +628,13 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
bool SeriesPlotterContainer::isCategoryPositionShifted(
const chart2::ScaleData& rSourceScale, bool bHasComplexCategories )
{
- if (rSourceScale.AxisType == AxisType::CATEGORY && rSourceScale.ShiftedCategoryPosition)
- return true;
-
- if (rSourceScale.AxisType == AxisType::CATEGORY && bHasComplexCategories)
- return true;
+ if (rSourceScale.AxisType == AxisType::CATEGORY)
+ return bHasComplexCategories || rSourceScale.ShiftedCategoryPosition;
if (rSourceScale.AxisType == AxisType::DATE)
- return true;
+ return rSourceScale.ShiftedCategoryPosition;
- if (rSourceScale.AxisType == AxisType::SERIES)
- return true;
-
- return false;
+ return rSourceScale.AxisType == AxisType::SERIES;
}
void SeriesPlotterContainer::initAxisUsageList(const Date& rNullDate)
diff --git a/sw/qa/extras/layout/data/tdf133005.odt b/sw/qa/extras/layout/data/tdf133005.odt
new file mode 100644
index 000000000000..660112d66712
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf133005.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 853d6b997381..adac583c8ed2 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -2347,6 +2347,32 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf123268)
41);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf133005)
+{
+ SwDoc* pDoc = createDoc("tdf133005.odt");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // Dump the rendering of the first page as an XML file.
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ sal_Int32 nXChartWall = getXPath(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/"
+ "push[1]/push[1]/polyline[1]/point[2]",
+ "x")
+ .toInt32();
+ sal_Int32 nXColumn = getXPath(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/push[1]/"
+ "push[1]/push[42]/polypolygon/polygon/point[1]",
+ "x")
+ .toInt32();
+
+ // This failed, if the value axis doesn't appear inside category.
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(nXChartWall, nXColumn, 5);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf115630)
{
SwDoc* pDoc = createDoc("tdf115630.docx");