core.git: chart2/qa chart2/source oox/source

2024-06-18 Thread Attila Szűcs (via logerrit)
 chart2/qa/extras/chart2export2.cxx |   27 
+++
 chart2/qa/extras/data/xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx |binary
 chart2/source/view/charttypes/PieChart.cxx |   26 
+--
 oox/source/drawingml/chart/seriesconverter.cxx |   29 

 oox/source/export/chartexport.cxx  |   34 
++
 5 files changed, 107 insertions(+), 9 deletions(-)

New commits:
commit ada05b8874aa2c5161550dbc87d79b47f40f0df8
Author: Attila Szűcs 
AuthorDate: Thu Jun 13 21:33:13 2024 +0200
Commit: Caolán McNamara 
CommitDate: Tue Jun 18 09:49:07 2024 +0200

tdf#161607 Chart: import-export LeaderLines data

Implemented Importexport of some leaderLines data
(color and width of the lines) from/to OOXML.

It now supports only the solidFill color.
Used properties: "LineColor" and "LineWidth"

Change-Id: Ib33392d0404e1186328176fd93322e02b4006f3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168974
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Tested-by: Caolán McNamara 

diff --git a/chart2/qa/extras/chart2export2.cxx 
b/chart2/qa/extras/chart2export2.cxx
index 7d81dbb6f6a7..440c526cb5fc 100644
--- a/chart2/qa/extras/chart2export2.cxx
+++ b/chart2/qa/extras/chart2export2.cxx
@@ -549,6 +549,33 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testLeaderLines)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, 
testTdf161607PieChartLeaderLinesColorWidth)
+{
+// FIXME: validation error in OOXML export
+skipValidation();
+
+loadFromFile(u"xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx");
+save(u"Calc Office Open XML"_ustr);
+xmlDocUniquePtr pXmlDoc = parseExport(u"xl/charts/chart1.xml"_ustr);
+CPPUNIT_ASSERT(pXmlDoc);
+
+// test LeaderLines width
+OUString aWidth = getXPath(
+pXmlDoc,
+
"/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:leaderLines/c:spPr/"
+"a:ln"_ostr,
+"w"_ostr);
+sal_Int32 nWidth = aWidth.toInt32();
+CPPUNIT_ASSERT_LESSEQUAL(static_cast(100), std::abs(nWidth - 
88900));
+
+// test LeaderLines Color
+assertXPath(
+pXmlDoc,
+
"/c:chartSpace/c:chart/c:plotArea/c:doughnutChart/c:ser/c:dLbls/c:leaderLines/c:spPr/"
+"a:ln/a:solidFill/a:srgbClr"_ostr,
+"val"_ostr, u"7030a0"_ustr);
+}
+
 CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testNumberFormatExportPPTX)
 {
 loadFromFile(u"pptx/tdf115859.pptx");
diff --git 
a/chart2/qa/extras/data/xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx 
b/chart2/qa/extras/data/xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx
new file mode 100644
index ..c8c4e06a44c3
Binary files /dev/null and 
b/chart2/qa/extras/data/xlsx/tdf161607PieChartLeaderLinesColorWidth.xlsx differ
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index fcb79ef1907a..58193df880d6 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -27,7 +27,8 @@
 #include 
 #include 
 #include 
-
+#include "../../model/main/DataPointProperties.hxx"
+#include 
 #include 
 #include 
 
@@ -686,14 +687,21 @@ void PieChart::createTextLabelShape(
 drawing::PointSequenceSequence aPoints{ { {nX1, nY1}, 
{nX2, nY2} } };
 
 VLineProperties aVLineProperties;
-if (aPieLabelInfo.xTextShape.is())
-{
-sal_Int32 nColor = 0;
-
aPieLabelInfo.xTextShape->SvxShape::getPropertyValue(u"CharColor"_ustr) >>= 
nColor;
-//automatic font color does not work for lines -> 
fallback to black
-if (nColor != -1)
-aVLineProperties.Color <<= nColor;
-}
+
+sal_Int32 nColor = 0;
+nColor = rSeries.getModel()
+ ->getFastPropertyValue(
+ 
DataPointProperties::PROP_DATAPOINT_BORDER_COLOR)
+ .get();
+if (nColor != -1)
+aVLineProperties.Color <<= nColor;
+sal_Int32 nWidth = 0;
+nWidth = rSeries.getModel()
+ 
->getFastPropertyValue(LinePropertiesHelper::PROP_LINE_WIDTH)
+ .get();
+if (nWidth != -1)
+aVLineProperties.Width <<= nWidth;
+
 ShapeFactory::createLine2D(xTextTarget, aPoints, 
);
 }
 }
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx 
b/oox/source/drawingml/chart/seriesconverter.cxx
index 4efe54f3c2e8..b3c8b51c16b9 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ 

core.git: chart2/qa chart2/source

2024-05-10 Thread Kurt Nordback (via logerrit)
 chart2/qa/extras/chart2export.cxx  |   14 --
 chart2/source/view/inc/VDataSeries.hxx |1 -
 chart2/source/view/main/SeriesPlotterContainer.cxx |2 ++
 3 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit 4425741937fbd240fe414a68a7d5e9ac4b40affd
Author: Kurt Nordback 
AuthorDate: Fri May 10 09:59:52 2024 -0600
Commit: Noel Grandin 
CommitDate: Fri May 10 19:57:15 2024 +0200

tdf#161013 Rendering error when changing chart type for saved of-pie chart

Reset pie sub-type property in XDiagram after passing it down,
so that it does not persist and overwrite the modified sub-type

Change-Id: If23ef2b1cff29efa5232d49381676592a0f39d17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167487
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 1c4977f5d38b..4335ee9ff887 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -1147,11 +1147,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_barOfPie)
 xChartType->getChartType());
 
 // Verify that it saves and loads as bar-of-pie
-Reference< chart2::XDiagram> xDia(xChartDoc->getFirstDiagram());
-CPPUNIT_ASSERT(xDia.is());
-uno::Reference< beans::XPropertySet > xDiaProp( xDia, uno::UNO_QUERY );
-CPPUNIT_ASSERT(xDiaProp.is());
-uno::Any aAny = xDiaProp->getPropertyValue(u"SubPieType"_ustr);
+Reference< beans::XPropertySet > xPropSet( xChartType, 
uno::UNO_QUERY_THROW );
+uno::Any aAny = xPropSet->getPropertyValue(u"SubPieType"_ustr);
 CPPUNIT_ASSERT(aAny.hasValue());
 chart2::PieChartSubType subPieType;
 aAny >>= subPieType;
@@ -1173,11 +1170,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_pieOfPie)
 xChartType->getChartType());
 
 // Verify that it saves and loads as pie-of-pie
-Reference< chart2::XDiagram> xDia(xChartDoc->getFirstDiagram());
-CPPUNIT_ASSERT(xDia.is());
-uno::Reference< beans::XPropertySet > xDiaProp( xDia, uno::UNO_QUERY );
-CPPUNIT_ASSERT(xDiaProp.is());
-uno::Any aAny = xDiaProp->getPropertyValue(u"SubPieType"_ustr);
+Reference< beans::XPropertySet > xPropSet( xChartType, 
uno::UNO_QUERY_THROW );
+uno::Any aAny = xPropSet->getPropertyValue(u"SubPieType"_ustr);
 CPPUNIT_ASSERT(aAny.hasValue());
 chart2::PieChartSubType subPieType;
 aAny >>= subPieType;
diff --git a/chart2/source/view/inc/VDataSeries.hxx 
b/chart2/source/view/inc/VDataSeries.hxx
index dd5054d26bd8..72f5fca80089 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx 
b/chart2/source/view/main/SeriesPlotterContainer.cxx
index 557bbdae3c11..c76d96a4f20f 100644
--- a/chart2/source/view/main/SeriesPlotterContainer.cxx
+++ b/chart2/source/view/main/SeriesPlotterContainer.cxx
@@ -232,6 +232,8 @@ void 
SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
 {
 xChartType->setFastPropertyValue(PROP_PIECHARTTYPE_SUBTYPE,
  uno::Any(ePieChartSubType));
+// Reset the diagram-level property so it's not persistent.
+xDiagram->setPropertyValue(u"SubPieType"_ustr, 
uno::Any(PieChartSubType_NONE));
 }
 
 if (nT == 0)


core.git: chart2/qa chart2/source

2024-05-07 Thread Noel Grandin (via logerrit)
 chart2/qa/extras/PivotChartTest.cxx
|  168 +-
 chart2/qa/extras/chart2_trendcalculators.cxx   
|6 
 chart2/qa/extras/chart2dump/chart2dump.cxx 
|  176 +--
 chart2/qa/extras/chart2export.cxx  
|  398 +++---
 chart2/qa/extras/chart2export2.cxx 
|  578 +-
 chart2/qa/extras/chart2export3.cxx 
|  560 -
 chart2/qa/extras/chart2geometry.cxx
|  114 +
 chart2/qa/extras/chart2import.cxx  
|  420 +++
 chart2/qa/extras/chart2import2.cxx 
|  119 +-
 chart2/qa/extras/charttest.hxx 
|   18 
 chart2/qa/extras/uichart.cxx   
|   72 -
 chart2/qa/extras/xshape/chart2xshape.cxx   
|5 
 chart2/qa/unit/common_functor_test.cxx 
|   28 
 chart2/source/controller/accessibility/AccessibleBase.cxx  
|8 
 chart2/source/controller/accessibility/AccessibleChartElement.cxx  
|2 
 chart2/source/controller/accessibility/AccessibleChartShape.cxx
|2 
 chart2/source/controller/accessibility/AccessibleChartView.cxx 
|4 
 chart2/source/controller/chartapiwrapper/AreaWrapper.cxx   
|   14 
 chart2/source/controller/chartapiwrapper/AxisWrapper.cxx   
|   40 
 chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
|   12 
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx  
|   12 
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx  
|   64 -
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
|  112 -
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
|  132 +-
 chart2/source/controller/chartapiwrapper/GridWrapper.cxx   
|   12 
 chart2/source/controller/chartapiwrapper/LegendWrapper.cxx 
|   42 
 chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx 
|   18 
 chart2/source/controller/chartapiwrapper/TitleWrapper.cxx  
|   26 
 chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx  
|   12 
 chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx  
|   14 
 chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx  
|   16 
 
chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx 
   |   10 
 
chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
 |   12 
 chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
|6 
 chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx  
|2 
 chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx   
|6 
 chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx   
|2 
 chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
|6 
 chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx  
|2 
 chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
|2 
 chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx   
|2 
 chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
|   72 -
 chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
|   22 
 chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx   
|   44 
 chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx   
|2 
 chart2/source/controller/dialogs/ChartResourceGroupDlgs.cxx
|   22 
 chart2/source/controller/dialogs/ChartResourceGroups.cxx   
|   20 
 chart2/source/controller/dialogs/ChartTypeDialogController.cxx 
|   12 
 chart2/source/controller/dialogs/DataBrowser.cxx   
|   22 
 chart2/source/controller/dialogs/DataBrowserModel.cxx  
|4 
 chart2/source/controller/dialogs/DialogModel.cxx   
|   40 
 chart2/source/controller/dialogs/ObjectNameProvider.cxx
|   28 
 chart2/source/controller/dialogs/RangeSelectionHelper.cxx  
|8 
 

core.git: chart2/qa chart2/source

2024-04-27 Thread Mike Kaganski (via logerrit)
 chart2/qa/extras/chart2export3.cxx |4 
 chart2/qa/unit/common_functor_test.cxx |4 
 chart2/source/controller/main/DrawCommandDispatch.cxx  |6 
 chart2/source/inc/CommonFunctors.hxx   |   65 
 chart2/source/model/filter/XMLFilter.cxx   |2 
 chart2/source/model/main/ChartModel_Persistence.cxx|   20 --
 chart2/source/tools/CachedDataSequence.cxx |   76 +
 chart2/source/tools/ColorPerPointHelper.cxx|4 
 chart2/source/tools/InternalDataProvider.cxx   |   99 +++--
 chart2/source/tools/MeanValueRegressionCurveCalculator.cxx |   18 --
 chart2/source/tools/UncachedDataSequence.cxx   |   14 -
 chart2/source/view/main/ChartView.cxx  |   22 +-
 12 files changed, 99 insertions(+), 235 deletions(-)

New commits:
commit faeb8adf4b12a62919fbf961f65181964cce5325
Author: Mike Kaganski 
AuthorDate: Sat Apr 27 20:49:13 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sat Apr 27 20:50:48 2024 +0200

Simplify a bit

Change-Id: Ic6d0dd0f66a258fffd0be7f458316801516aaefc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166778
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/chart2/qa/extras/chart2export3.cxx 
b/chart2/qa/extras/chart2export3.cxx
index df96a70e8e1f..df70cd603d89 100644
--- a/chart2/qa/extras/chart2export3.cxx
+++ b/chart2/qa/extras/chart2export3.cxx
@@ -838,9 +838,9 @@ void checkCharacterProps(Reference 
const & xTitleProp)
 std::vector aValues = { "This", " is", "3", " a ", "custom", " 
erte1
", "2dfgd ch", "ar", "t ", "title" };
 for (sal_Int32 i = 0; i < xFormattedSubTitle.getLength(); i++)
 {
-const OUString aText = 
xFormattedSubTitle.getConstArray()[i]->getString();
+const OUString aText = xFormattedSubTitle[i]->getString();
 CPPUNIT_ASSERT_EQUAL(aValues[i], aText);
-Reference< beans::XPropertySet > 
xRunPropSet(xFormattedSubTitle.getConstArray()[i], uno::UNO_QUERY);
+Reference< beans::XPropertySet > xRunPropSet(xFormattedSubTitle[i], 
uno::UNO_QUERY);
 // common props
 uno::Any aAny = xRunPropSet->getPropertyValue("CharFontName");
 CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Aptos Narrow")), aAny);
diff --git a/chart2/qa/unit/common_functor_test.cxx 
b/chart2/qa/unit/common_functor_test.cxx
index b2e404e13508..a744945e6663 100644
--- a/chart2/qa/unit/common_functor_test.cxx
+++ b/chart2/qa/unit/common_functor_test.cxx
@@ -48,7 +48,7 @@ void CommonFunctorsTest::testAnyToString()
 
 std::vector aOutput;
 std::transform(aInput.begin(), aInput.end(),
-std::back_inserter(aOutput), chart::CommonFunctors::AnyToString());
+std::back_inserter(aOutput), chart::CommonFunctors::ToString());
 
 CPPUNIT_ASSERT_EQUAL(OUString("2"), aOutput[0]);
 CPPUNIT_ASSERT_EQUAL(OUString("10"), aOutput[1]);
@@ -65,7 +65,7 @@ void CommonFunctorsTest::testDoubleToString()
 
 std::vector aOutput;
 std::transform(aInput.begin(), aInput.end(),
-std::back_inserter(aOutput), 
chart::CommonFunctors::DoubleToOUString());
+std::back_inserter(aOutput), chart::CommonFunctors::ToString());
 
 CPPUNIT_ASSERT_EQUAL(OUString("2"), aOutput[0]);
 CPPUNIT_ASSERT_EQUAL(OUString("10"), aOutput[1]);
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx 
b/chart2/source/controller/main/DrawCommandDispatch.cxx
index 01771f1e7763..516c2d2ec5f3 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -346,13 +346,11 @@ void DrawCommandDispatch::execute( const OUString& 
rCommand, const Sequence< bea
 pDrawViewWrapper->SetCreateMode();
 }
 
-const beans::PropertyValue* pIter = rArgs.getConstArray();
-const beans::PropertyValue* pEnd  = pIter + rArgs.getLength();
-const beans::PropertyValue* pKeyModifier = std::find_if(pIter, pEnd,
+const beans::PropertyValue* pKeyModifier = std::find_if(rArgs.begin(), 
rArgs.end(),
 [](const 
beans::PropertyValue& lhs)
 {return lhs.Name == 
"KeyModifier";} );
 sal_Int16 nKeyModifier = 0;
-if ( !(pKeyModifier != pEnd && ( pKeyModifier->Value >>= nKeyModifier ) && 
nKeyModifier == KEY_MOD1) )
+if ( !(pKeyModifier != rArgs.end() && ( pKeyModifier->Value >>= 
nKeyModifier ) && nKeyModifier == KEY_MOD1) )
 return;
 
 if ( eDrawMode != CHARTDRAW_INSERT )
diff --git a/chart2/source/inc/CommonFunctors.hxx 
b/chart2/source/inc/CommonFunctors.hxx
index 7bb776490cda..2d01e7ad27ae 100644
--- a/chart2/source/inc/CommonFunctors.hxx
+++ b/chart2/source/inc/CommonFunctors.hxx
@@ -21,9 +21,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "charttoolsdllapi.hxx"
 
+#include 
 #include 

core.git: chart2/qa chart2/source oox/source xmloff/source

2024-04-18 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export3.cxx|  138 +-
 chart2/qa/extras/data/ods/tdf39052.ods|binary
 chart2/source/controller/chartapiwrapper/TitleWrapper.cxx |   46 +---
 chart2/source/model/main/Title.cxx|3 
 oox/source/export/chartexport.cxx |   12 -
 xmloff/source/chart/SchXMLAxisContext.cxx |   22 --
 xmloff/source/chart/SchXMLChartContext.cxx|   39 ---
 xmloff/source/chart/SchXMLChartContext.hxx|6 
 xmloff/source/chart/SchXMLExport.cxx  |   77 ---
 xmloff/source/chart/SchXMLParagraphContext.cxx|  131 +
 xmloff/source/chart/SchXMLParagraphContext.hxx|   44 
 xmloff/source/chart/SchXMLTools.cxx   |   92 +
 xmloff/source/chart/SchXMLTools.hxx   |4 
 xmloff/source/chart/transporttypes.hxx|2 
 14 files changed, 491 insertions(+), 125 deletions(-)

New commits:
commit d7214aba95bbdcbd40e87ef50fc66f2e2ec4f5ff
Author: Balazs Varga 
AuthorDate: Mon Apr 15 13:39:03 2024 +0200
Commit: Balazs Varga 
CommitDate: Thu Apr 18 18:07:57 2024 +0200

tdf#160517 - chart odf: import/export formatted chart titles

(main, sub, axis titles) texts properly to/from odf format.

Fix odf export of formatted chart titles. The exported data structure
will look like:



This
 is
.
.
.
3
 a 



Fix import of formatted chart titles. Put the properties and related texts
into the chart2::XFormattedString2 uno objects.

Follow-up commit of:
55e9a27afd2d6a13cf76b39641bf121c3ec4b45c
Related: tdf#39052 - chart ooxml: export formatted chart titles

4f994cec388377cc5c2bddb804bd92eb4cd7dc8d
tdf#39052 - Chart: make characters formatable in editable chart textshapes

--
TODO: chart data point / dataseries labels are handled differently
since those are not editable objects, but that is a completily different
issue.
--

Change-Id: I1842f2c69c132bdf578bb2d354f451cc9d49c63c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166122
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/chart2/qa/extras/chart2export3.cxx 
b/chart2/qa/extras/chart2export3.cxx
index 3d05495eff40..df96a70e8e1f 100644
--- a/chart2/qa/extras/chart2export3.cxx
+++ b/chart2/qa/extras/chart2export3.cxx
@@ -10,6 +10,9 @@
 #include "charttest.hxx"
 
 #include 
+#include 
+#include 
+#include 
 
 using uno::Reference;
 using beans::XPropertySet;
@@ -432,11 +435,17 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testChartSubTitle)
 xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml");
 CPPUNIT_ASSERT(pXmlDoc);
 // test properties of subtitle
+// paragraph props
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, 
"1100");
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, 
"1");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr"_ostr,
 "val"_ostr, "00a933");
+// run props
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr"_ostr, "sz"_ostr, 
"1100");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr"_ostr, "b"_ostr, "1");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:solidFill/a:srgbClr"_ostr,
 "val"_ostr, "00a933");
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:latin"_ostr, 
"typeface"_ostr, "Times New Roman");
+// text
 assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:t"_ostr, "It is a 
Subtitle");
+// shape props
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, 
"b2b2b2");
 }
 
@@ -447,13 +456,19 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, 
testChartMainWithSubTitle)
 xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml");
 CPPUNIT_ASSERT(pXmlDoc);
 // test properties of title
+// paragraph props
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr"_ostr, 
"sz"_ostr, "1300");
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr"_ostr, 
"b"_ostr, "0");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr"_ostr, 
"i"_ostr, "1");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr/a:solidFill/a:srgbClr"_ostr,
 "val"_ostr, "f10d0c");
+// run props
+assertXPath(pXmlDoc, 

core.git: chart2/qa chart2/source include/oox oox/source xmloff/source

2024-04-02 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export3.cxx |   70 ++-
 chart2/qa/extras/data/xlsx/tdf39052.xlsx   |binary
 chart2/source/controller/chartapiwrapper/TitleWrapper.cxx  |   65 ++
 chart2/source/controller/main/ChartController_TextEdit.cxx |   30 
 chart2/source/inc/TitleHelper.hxx  |2 
 chart2/source/tools/TitleHelper.cxx|   31 +++-
 include/oox/export/chartexport.hxx |4 
 oox/source/export/chartexport.cxx  |   81 +
 oox/source/export/drawingml.cxx|3 
 xmloff/source/chart/SchXMLAxisContext.cxx  |1 
 xmloff/source/chart/SchXMLChartContext.cxx |2 
 xmloff/source/chart/SchXMLExport.cxx   |3 
 12 files changed, 230 insertions(+), 62 deletions(-)

New commits:
commit 55e9a27afd2d6a13cf76b39641bf121c3ec4b45c
Author: Balazs Varga 
AuthorDate: Fri Mar 29 23:00:50 2024 +0100
Commit: Balazs Varga 
CommitDate: Tue Apr 2 23:27:26 2024 +0200

Related: tdf#39052 - chart ooxml: export formatted chart titles

texts properly to ooxml.

Also adding "FormattedStrings" property for title objects
to simplify the working of character formattings in editable
chart shapes.

TODO: odf import/export

Change-Id: Ie27b4dee72c24fa6a2a4e2a7db8da7fa50eb8937
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165583
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Balazs Varga 

diff --git a/chart2/qa/extras/chart2export3.cxx 
b/chart2/qa/extras/chart2export3.cxx
index e1229b07720c..3d05495eff40 100644
--- a/chart2/qa/extras/chart2export3.cxx
+++ b/chart2/qa/extras/chart2export3.cxx
@@ -447,12 +447,13 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, 
testChartMainWithSubTitle)
 xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml");
 CPPUNIT_ASSERT(pXmlDoc);
 // test properties of title
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "sz"_ostr, 
"1300");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "b"_ostr, 
"0");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr"_ostr, "i"_ostr, 
"1");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:pPr/a:defRPr/a:solidFill/a:srgbClr"_ostr,
 "val"_ostr, "f10d0c");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr/a:latin"_ostr, 
"typeface"_ostr, "Arial");
-assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:t"_ostr, "It is a Maintitle
It is a Subtitle");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr"_ostr, 
"sz"_ostr, "1300");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr"_ostr, 
"b"_ostr, "0");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr"_ostr, 
"i"_ostr, "1");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:pPr/a:defRPr/a:solidFill/a:srgbClr"_ostr,
 "val"_ostr, "f10d0c");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r/a:rPr/a:latin"_ostr, 
"typeface"_ostr, "Arial");
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r/a:t"_ostr, "It is a 
Maintitle");
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[2]/a:r/a:t"_ostr, "It is a 
Subtitle");
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:spPr/a:solidFill/a:srgbClr"_ostr, "val"_ostr, 
"81d41a");
 }
 
@@ -754,6 +755,63 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testTdf148142)
 CPPUNIT_ASSERT(!aScaleData2.ShiftedCategoryPosition);
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testFormattedChartTitles)
+{
+loadFromFile(u"xlsx/tdf39052.xlsx");
+save("Calc Office Open XML");
+xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml");
+CPPUNIT_ASSERT(pXmlDoc);
+
+// Check run level properties [1] - first paragraph
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:rPr"_ostr, "b"_ostr, 
"1");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:rPr"_ostr, 
"sz"_ostr, "1400");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:rPr/a:solidFill/a:srgbClr"_ostr,
 "val"_ostr, "ff");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:rPr/a:latin"_ostr, 
"typeface"_ostr, "Aptos Narrow");
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[1]/a:t"_ostr, "This");
+// Check run level properties [2]
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p[1]/a:r[2]/a:rPr"_ostr, "b"_ostr, 

core.git: chart2/qa chart2/source include/xmloff schema/libreoffice xmloff/source

2024-03-18 Thread Kurt Nordback (via logerrit)
 chart2/qa/extras/chart2export.cxx   |   53 
 chart2/qa/extras/data/ods/tdf50934_barOfPie.ods |binary
 chart2/qa/extras/data/ods/tdf50934_pieOfPie.ods |binary
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx |9 ++
 chart2/source/inc/ChartType.hxx |6 -
 include/xmloff/xmltoken.hxx |3 
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |   14 +++
 xmloff/source/chart/PropertyMap.hxx |1 
 xmloff/source/chart/SchXMLChartContext.cxx  |   23 -
 xmloff/source/chart/SchXMLChartContext.hxx  |3 
 xmloff/source/chart/SchXMLExport.cxx|7 +
 xmloff/source/chart/SchXMLTools.cxx |7 +
 xmloff/source/core/xmltoken.cxx |3 
 xmloff/source/token/tokens.txt  |3 
 14 files changed, 124 insertions(+), 8 deletions(-)

New commits:
commit 9ae8e74fb32254c81d36b1c95411605459e06372
Author: Kurt Nordback 
AuthorDate: Tue Mar 5 11:01:42 2024 -0700
Commit: Noel Grandin 
CommitDate: Mon Mar 18 07:07:24 2024 +0100

tdf#50934: Add a pie-with-remainder-as-another-pie chart type

Implement ODF import/export for bar-of-pie and pie-of-pie types,
and add simple tests for this capability. The associated ODF tags
are implemented in the loext namespace. This also required changing
the schema.

Change-Id: Ib55ae1c5818ad810f7b962d807a9163a3d02ba17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164436
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index b46bc776d587..86f2dee778e6 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using uno::Reference;
 using beans::XPropertySet;
@@ -1132,6 +1133,58 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, 
testErrorBarDataRangeODS)
 CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$C$1:$C$3"), aNegRange);
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_barOfPie)
+{
+loadFromFile(u"ods/tdf50934_barOfPie.ods");
+saveAndReload("calc8");
+
+uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 
0, mxComponent );
+CPPUNIT_ASSERT(xChartDoc.is());
+
+Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( 
xChartDoc, 0 );
+CPPUNIT_ASSERT(xChartType.is());
+
+CPPUNIT_ASSERT_EQUAL(u"com.sun.star.chart2.PieChartType"_ustr,
+xChartType->getChartType());
+
+// Verify that it saves and loads as bar-of-pie
+Reference< chart2::XDiagram> xDia(xChartDoc->getFirstDiagram());
+CPPUNIT_ASSERT(xDia.is());
+uno::Reference< beans::XPropertySet > xDiaProp( xDia, uno::UNO_QUERY );
+CPPUNIT_ASSERT(xDiaProp.is());
+uno::Any aAny = xDiaProp->getPropertyValue("SubPieType");
+CPPUNIT_ASSERT(aAny.hasValue());
+chart2::PieChartSubType subPieType;
+aAny >>= subPieType;
+CPPUNIT_ASSERT_EQUAL(chart2::PieChartSubType_BAR, subPieType);
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, tdf50934_pieOfPie)
+{
+loadFromFile(u"ods/tdf50934_pieOfPie.ods");
+saveAndReload("calc8");
+
+uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 
0, mxComponent );
+CPPUNIT_ASSERT(xChartDoc.is());
+
+Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( 
xChartDoc, 0 );
+CPPUNIT_ASSERT(xChartType.is());
+
+CPPUNIT_ASSERT_EQUAL(u"com.sun.star.chart2.PieChartType"_ustr,
+xChartType->getChartType());
+
+// Verify that it saves and loads as pie-of-pie
+Reference< chart2::XDiagram> xDia(xChartDoc->getFirstDiagram());
+CPPUNIT_ASSERT(xDia.is());
+uno::Reference< beans::XPropertySet > xDiaProp( xDia, uno::UNO_QUERY );
+CPPUNIT_ASSERT(xDiaProp.is());
+uno::Any aAny = xDiaProp->getPropertyValue("SubPieType");
+CPPUNIT_ASSERT(aAny.hasValue());
+chart2::PieChartSubType subPieType;
+aAny >>= subPieType;
+CPPUNIT_ASSERT_EQUAL(chart2::PieChartSubType_PIE, subPieType);
+}
+
 CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testChartCrash)
 {
 loadFromFile(u"docx/FDO75975.docx");
diff --git a/chart2/qa/extras/data/ods/tdf50934_barOfPie.ods 
b/chart2/qa/extras/data/ods/tdf50934_barOfPie.ods
new file mode 100644
index ..d9b577a38a36
Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf50934_barOfPie.ods 
differ
diff --git a/chart2/qa/extras/data/ods/tdf50934_pieOfPie.ods 
b/chart2/qa/extras/data/ods/tdf50934_pieOfPie.ods
new file mode 100644
index ..74a9f85f6981
Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf50934_pieOfPie.ods 
differ
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx 

core.git: chart2/qa chart2/source

2024-03-03 Thread Mike Kaganski (via logerrit)
 chart2/qa/extras/data/ods/tdf153706_XY_scatter_chart.ods  |binary
 chart2/qa/extras/uichart.cxx  |   54 ++
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx |   10 +
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.hxx |   11 +-
 4 files changed, 74 insertions(+), 1 deletion(-)

New commits:
commit 0c3580828811496052f41b09ad68fcc00a525f6f
Author: Mike Kaganski 
AuthorDate: Sun Mar 3 16:12:55 2024 +0600
Commit: Mike Kaganski 
CommitDate: Sun Mar 3 17:22:08 2024 +0100

tdf#153706: do not add categories, when source data doesn't have them

lcl_AllOperator is used in XChartDocument::attachData implementation.
When a data without existing categories is passed there, like an XY
scatter, lcl_AllOperator used to force creation of the categories in
the target, by returning 'true' unconditionally from setsCategories.
This meant, that a new sequence of numbers starting from 1 was used
as X values, and the old X data was interpreted as an extra Y series.

This changes lcl_AllOperator::setsCategories to try to check if its
data actually contains categories. Thus, XChartDocument::attachData
will use categories either when the chart already uses categories,
and ChartDataWrapper::applyData detects that using a call to
DataSourceHelper::detectRangeSegmentation; or when the new data has
it; but not when neither had it. When it's not possible to detect if
there were categories in the new data (e.g., with user data), old
behavior is used, setting categories.

It could be an alternative to detect the chart type using
xOldDoc->getDiagram()->getDiagramType() == "com.sun.star.chart.XYDiagram"
in XChartDocument::attachData; and then decide to force the creation
or not. But it seems hackish, and not really universal: other chart
types must be tested (bubble?), no idea how to handle hypothetical
cases when applied data contains categories in case of XY chart, etc.

Change-Id: I86b34f6799c30b103f7fc6b2faf6ec255a9d137b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164298
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/chart2/qa/extras/data/ods/tdf153706_XY_scatter_chart.ods 
b/chart2/qa/extras/data/ods/tdf153706_XY_scatter_chart.ods
new file mode 100644
index ..2c6153ed6ab2
Binary files /dev/null and 
b/chart2/qa/extras/data/ods/tdf153706_XY_scatter_chart.ods differ
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
index 84b8658d29ea..2638367c8506 100644
--- a/chart2/qa/extras/uichart.cxx
+++ b/chart2/qa/extras/uichart.cxx
@@ -436,6 +436,60 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf158223)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf153706)
+{
+// Load a spreadsheet with a to-page XY scatter chart with the sheet as 
data source
+loadFromFile(u"ods/tdf153706_XY_scatter_chart.ods");
+
+// Select the cell range around the chart, and copy the range to 
clipboard, including the chart
+dispatchCommand(mxComponent, u".uno:GoToCell"_ustr,
+{ comphelper::makePropertyValue(u"ToPoint"_ustr, 
u"D1:K23"_ustr) });
+dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
+
+// create a new document
+load(u"private:factory/scalc"_ustr);
+
+// Paste; this must create a chart with own data source having a proper 
copy of the data
+dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
+
+css::uno::Reference xChartDoc(getChartDocFromSheet(0, mxComponent), 
css::uno::UNO_SET_THROW);
+auto 
xDataArray(xChartDoc->getDataProvider().queryThrow());
+
+css::uno::Sequence> aData = xDataArray->getData();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aData.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aData[0].getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aData[1].getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aData[2].getLength());
+CPPUNIT_ASSERT_EQUAL(2.0, aData[0][0]);
+CPPUNIT_ASSERT_EQUAL(3.0, aData[0][1]);
+CPPUNIT_ASSERT_EQUAL(3.0, aData[1][0]);
+CPPUNIT_ASSERT_EQUAL(2.0, aData[1][1]);
+CPPUNIT_ASSERT_EQUAL(4.0, aData[2][0]);
+CPPUNIT_ASSERT_EQUAL(1.0, aData[2][1]);
+
+// Without the fix, this would fail with
+// - Expected: 1
+// - Actual  : 2
+// i.e., the X values were treated as another Y series
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc));
+
+auto xSeries(getDataSeriesFromDoc(xChartDoc, 
0).queryThrow());
+auto sequences = xSeries->getDataSequences();
+// Without the fix, this would fail with
+// - Expected: 2
+// - Actual  : 1
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), sequences.getLength());
+
+auto propX(sequences[0]->getValues().queryThrow());
+// Without the fix, this would fail with
+// - Expected: values-x
+// - Actual  : values-y
+CPPUNIT_ASSERT_EQUAL(u"values-x"_ustr, 

core.git: chart2/qa chart2/source

2024-02-19 Thread Kurt Nordback (via logerrit)
 chart2/qa/extras/chart2export.cxx |   22 +
 chart2/qa/extras/data/xlsx/barOfPieChart.xlsx |binary
 chart2/qa/extras/data/xlsx/pieOfPieChart.xlsx |binary
 chart2/source/view/charttypes/PieChart.cxx|   63 +++---
 chart2/source/view/charttypes/PieChart.hxx|2 
 5 files changed, 71 insertions(+), 16 deletions(-)

New commits:
commit 96e9c3a7fd2ce877d6d4d87c534790f7d85a
Author: Kurt Nordback 
AuthorDate: Wed Dec 13 16:16:11 2023 -0700
Commit: Noel Grandin 
CommitDate: Mon Feb 19 20:34:18 2024 +0100

tdf#50934: Fix compiler complaints and activate OOXML I/O tests

Add tests for input and output of very basic pie-of-pie and bar-of-pie
charts in OOXML.

Change-Id: I6441d99941ea2aca9bf58ede40dbe8f3d38a3291
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160742
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 81ed060e7acb..b46bc776d587 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -529,6 +529,28 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDoughnutChart)
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:doughnutChart"_ostr);
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testPieOfPieChart)
+{
+loadFromFile(u"xlsx/pieOfPieChart.xlsx");
+save("Calc Office Open XML");
+xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml");
+CPPUNIT_ASSERT(pXmlDoc);
+
+assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart"_ostr);
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:ofPieType[1]"_ostr, 
"val"_ostr, "pie");
+}
+
+CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testBarOfPieChart)
+{
+loadFromFile(u"xlsx/barOfPieChart.xlsx");
+save("Calc Office Open XML");
+xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml");
+CPPUNIT_ASSERT(pXmlDoc);
+
+assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:ofPieChart"_ostr);
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:ofPieType[1]"_ostr, 
"val"_ostr, "bar");
+}
+
 CPPUNIT_TEST_FIXTURE(Chart2ExportTest, testDisplayUnits)
 {
 loadFromFile(u"docx/DisplayUnits.docx");
diff --git a/chart2/qa/extras/data/xlsx/barOfPieChart.xlsx 
b/chart2/qa/extras/data/xlsx/barOfPieChart.xlsx
new file mode 100644
index ..227ab832a4ac
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/barOfPieChart.xlsx 
differ
diff --git a/chart2/qa/extras/data/xlsx/pieOfPieChart.xlsx 
b/chart2/qa/extras/data/xlsx/pieOfPieChart.xlsx
index efb1c05ca864..b3a1c3588427 100644
Binary files a/chart2/qa/extras/data/xlsx/pieOfPieChart.xlsx and 
b/chart2/qa/extras/data/xlsx/pieOfPieChart.xlsx differ
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index b70fde756c74..ff8cf62f133a 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -918,7 +918,7 @@ void PieChart::createShapes()
 
 // Default to regular pie if too few points for of-pie
 ::css::chart2::PieChartSubType eSubType =
-nPointCount >= OfPieDataSrc::minPoints() ?
+nPointCount >= OfPieDataSrc::minPoints ?
 m_eSubType :
 PieChartSubType_NONE;
 
@@ -1068,7 +1068,38 @@ void PieChart::createShapes()
 }//next x slot
 }
 
-void PieChart::createOneRing([[maybe_unused]]enum SubPieType eType,
+static sal_Int32 propIndex(
+sal_Int32 nPointIndex,
+enum SubPieType eType,
+const PieDataSrcBase *pDataSrc,
+VDataSeries* pSeries)
+{
+
+switch (eType) {
+case SubPieType::LEFT:
+if (nPointIndex == pDataSrc->getNPoints(pSeries,
+SubPieType::LEFT) - 1) {
+return pSeries->getTotalPointCount();
+} else {
+return nPointIndex;
+}
+break;
+case SubPieType::RIGHT:
+return pDataSrc->getNPoints(pSeries, SubPieType::LEFT) +
+nPointIndex - 1;
+break;
+case SubPieType::NONE:
+return nPointIndex;
+break;
+default: // shouldn't happen
+assert(false);
+return 0; // suppress compile warning
+}
+}
+
+
+void PieChart::createOneRing(
+enum SubPieType eType,
 double fSlotX,
 ShapeParam& aParam,
 const rtl::Reference& xSeriesTarget,
@@ -1187,11 +1218,9 @@ void PieChart::createOneRing([[maybe_unused]]enum 
SubPieType eType,
 bConcentricExplosion);
 
 // Handle coloring of the composite wedge
-const sal_Int32 nPropIdx = (
-eType == SubPieType::LEFT &&
-nPointIndex == pDataSrc->getNPoints(pSeries, 
SubPieType::LEFT) - 1 ?
-pSeries->getTotalPointCount() :
-nPointIndex);
+sal_Int32 nPropIdx = 

core.git: chart2/qa chart2/source

2024-01-31 Thread Justin Luth (via logerrit)
 chart2/qa/extras/xshape/chart2xshape.cxx  |4 
 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml |   86 --
 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml |   38 +++
 chart2/qa/extras/xshape/data/reference/tdf90839-4.xml |   86 --
 chart2/source/view/charttypes/PieChart.cxx|   18 ++-
 5 files changed, 114 insertions(+), 118 deletions(-)

New commits:
commit 9833ac64c43b140233eca4ebb98e445a462425fc
Author: Justin Luth 
AuthorDate: Tue Jan 30 09:08:13 2024 -0500
Commit: Miklos Vajna 
CommitDate: Wed Jan 31 10:46:34 2024 +0100

tdf#146756 pie chart2 import: use consistent outside-label max text len

This is a followup to commit 85f4395b6f40c0295a190cca09ecd51858fc3b31.

Although there is no pressing need for this patch in my opinion,
it DOES fix a 7.1 regression in importing MSO charts with long labels.
MSO wraps text at 1/5 the width of the chart.

7.1 Regression commit 75a8b367f2a06e0d485fc2b9f4472e8bb29d71e3
Author: Balazs Varga on Tue Aug 25 12:32:02 2020 +0200
tdf#136105 tdf#134883 pie chart: improve data label position

Before Balazs' commit, the text width for everything was simply
fTextMaximumFrameWidth = 0.8 * fPieRadius.

I personally think Balazs' no wrapping looks better
(for outside labels, when there is enough space)
but in order to be consistent with how we handle
wrapping for bestFit-that-didn't-fit labels,
and to have our charts be as interoperable with OOXML as possible,
it makes good sense to use the same logic as the previous patch here.

Interestingly, Balazs broke some unit tests that specifically
were testing to make sure that text wrapping existed.

Fixed: // text wrap: wrap all text labels except Yellow one
make CppunitTest_chart2_xshape CPPUNIT_TEST_NAME=testPieChartLabels2

Fixed: // text wrap: wrap no text label except Yellow one
make CppunitTest_chart2_xshape CPPUNIT_TEST_NAME=testPieChartLabels3

Interestingly, I couldn't just copy/paste Ctrl-F12 dump to fix
make CppunitTest_chart2_xshape CPPUNIT_TEST_NAME=testPieChartLabels4
so I instead did a copy/paste of SAL_WARN("DUH",getXShapeDumpString());

Change-Id: I19f2ce2ce9c7653ae92dd596f0aaca1ed83f41bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162764
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx 
b/chart2/qa/extras/xshape/chart2xshape.cxx
index f247b7507ace..b968a29c8940 100644
--- a/chart2/qa/extras/xshape/chart2xshape.cxx
+++ b/chart2/qa/extras/xshape/chart2xshape.cxx
@@ -196,7 +196,7 @@ void Chart2XShapeTest::testPieChartLabels2()
 if (!IsDefaultDPI())
 return;
 
-// text wrap: wrap all text labels except one
+// text wrap: wrap all text labels except Yellow one
 loadFromFile(u"xlsx/tdf90839-2.xlsx");
 compareAgainstReference(getXShapeDumpString(), u"tdf90839-2.xml");
 }
@@ -208,7 +208,7 @@ void Chart2XShapeTest::testPieChartLabels3()
 if (!IsDefaultDPI())
 return;
 
-// text wrap: wrap no text label except one
+// text wrap: wrap no text label except Yellow one
 loadFromFile(u"xlsx/tdf90839-3.xlsx");
 compareAgainstReference(getXShapeDumpString(), u"tdf90839-3.xml");
 }
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
index 9ea3f9c16c28..5a639abb0b53 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
@@ -14,7 +14,7 @@

   
  
- 
+ 
   

 
@@ -30,7 +30,7 @@
  
 

-   
+   
 
 
 
@@ -39,12 +39,12 @@
 
 
 
- 
- 
+ 
+ 
  
 

-   
+   
 
  
   
@@ -175,11 +175,11 @@

   
  
- 
+ 
   
-   
+   
 
- 
+ 
   

 
@@ -204,9 +204,9 @@
  
 

-   
+   
 
- 
+ 
   
   
   
@@ -215,21 +215,21 @@
   
   
   
-   
-   
+   
+   

   
  
 
 
- 
- 
+ 
+ 
  
 

-   
+   
 
- 
+ 
   
   
   
@@ -238,21 +238,21 @@
   
   
   
-   
-   
+   
+   

   
  
 
 
- 
- 
+ 
+ 
  
 

-   
+   

core.git: chart2/qa chart2/source

2024-01-30 Thread Justin Luth (via logerrit)
 chart2/qa/extras/chart2import.cxx |   23 ++
 chart2/qa/extras/chart2import2.cxx|4 -
 chart2/qa/extras/data/pptx/tdf146756_bestFit.pptx |binary
 chart2/qa/extras/xshape/data/reference/tdf90839-1.xml |2 
 chart2/source/view/charttypes/PieChart.cxx|   38 ++
 5 files changed, 56 insertions(+), 11 deletions(-)

New commits:
commit 85f4395b6f40c0295a190cca09ecd51858fc3b31
Author: Justin Luth 
AuthorDate: Mon Jan 29 10:20:16 2024 -0500
Commit: Miklos Vajna 
CommitDate: Tue Jan 30 10:42:48 2024 +0100

tdf#146756 pie chart2 import: improve response to bestFit failure

Fixes a 7.2 regression from
commit b0068342398786ca50304260434a18880dddf74d
author Tünde Tóth on Wed Dec 16 18:26:26 2020 +0100
tdf#138777 pie chart: improve long data label width

When a label fails to bestFit inside the pie slice,
it will be placed outside of the pie of course.
However, we can't assume that there is any chart space
available to place a label outside.

Tünde got that part right. He limited the space available
based on the chart edge. But there are some optimizations
that can improve that.

1.) Every little bit can help. As we go away from the
X-axis, we gain a little bit of space, so use that...
2.) Don't assume that the pie chart is in the middle of the page.
3.) Use a consistent algorithm for all degrees - much simpler.

make CppunitTest_chart2_import CPPUNIT_TEST_NAME=testTdf146756

Change-Id: I0d8528bc227768f91237cda6b74bf9365820bfa7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162704
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index b23e048c6949..8b5834df94c6 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -2009,6 +2009,29 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf146487)
 CPPUNIT_ASSERT_EQUAL(OUString("371"), getXPath(pXmlDoc, aPath, 
"sizeY"_ostr));
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf146756)
+{
+// FIXME: the DPI check should be removed when either (1) the test is 
fixed to work with
+// non-default DPI; or (2) unit tests on Windows are made to use svp VCL 
plugin.
+if (!IsDefaultDPI())
+return;
+
+// given a chart on page 2
+loadFromFile(u"pptx/tdf146756_bestFit.pptx");
+Reference xChartDoc = getChartDocFromDrawImpress(1, 
0);
+OString aXmlDump = OUStringToOString(getShapeDump(xChartDoc), 
RTL_TEXTENCODING_UTF8);
+xmlDocUniquePtr pXmlDoc(xmlParseDoc(reinterpret_cast(aXmlDump.getStr(;
+OString aPath("//XShape[@text='New service request and approval; 
18%']"_ostr);
+assertXPath(pXmlDoc, aPath, 1);
+// Expected something like 4 lines tall(1697), not 11 lines(3817).
+CPPUNIT_ASSERT_EQUAL(OUString("1697"), getXPath(pXmlDoc, aPath, 
"sizeY"_ostr));
+// Expected some reasonable maximum text length for the label like 2350, 
not 881.
+sal_Int32 nTextLength = getXPath(pXmlDoc, aPath, 
"textMaximumFrameWidth"_ostr).toInt32();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2350), nTextLength);
+// MSO doesn't allow much more than 1/5 of the total chart width, so never 
go higher than that
+CPPUNIT_ASSERT_LESS(sal_Int32(2370.6), nTextLength);
+}
+
 CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFixedSizeBarChartVeryLongLabel)
 {
 // Bar chart area size is fixed (not automatic) so we can't resize
diff --git a/chart2/qa/extras/chart2import2.cxx 
b/chart2/qa/extras/chart2import2.cxx
index 863d425ae9a5..dc9a2cddae46 100644
--- a/chart2/qa/extras/chart2import2.cxx
+++ b/chart2/qa/extras/chart2import2.cxx
@@ -513,8 +513,8 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf133376)
 CPPUNIT_ASSERT(xDataPointLabel.is());
 // Check the position of the 3rd data point label, which is out from the 
pie slice
 awt::Point aLabelPosition = xDataPointLabel->getPosition();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(1208, aLabelPosition.X, 30);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(5370, aLabelPosition.Y, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1624, aLabelPosition.X, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(5635, aLabelPosition.Y, 30);
 }
 
 CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testTdf134225)
diff --git a/chart2/qa/extras/data/pptx/tdf146756_bestFit.pptx 
b/chart2/qa/extras/data/pptx/tdf146756_bestFit.pptx
new file mode 100644
index ..628491079a52
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf146756_bestFit.pptx 
differ
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
index 222e595157fd..94258a1b351d 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
@@ -229,7 +229,7 @@


 
- 
+

core.git: chart2/qa chart2/source offapi/com oox/source

2024-01-30 Thread Justin Luth (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   22 +
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |1 
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx |1 
 chart2/source/model/main/DataPointProperties.cxx   |6 +
 chart2/source/model/main/DataPointProperties.hxx   |3 
 chart2/source/tools/DataSeriesHelper.cxx   |3 
 chart2/source/view/charttypes/PieChart.cxx |   38 
++
 chart2/source/view/inc/VDataSeries.hxx |1 
 chart2/source/view/main/VDataSeries.cxx|   21 +
 offapi/com/sun/star/chart2/DataPointProperties.idl |6 +
 oox/source/drawingml/chart/seriesconverter.cxx |3 
 oox/source/token/properties.txt|1 
 12 files changed, 92 insertions(+), 14 deletions(-)

New commits:
commit a77403d11a60ebe6aeb33d9b6ae611412d9ab1cc
Author: Justin Luth 
AuthorDate: Thu Jan 25 11:57:40 2024 -0500
Commit: Miklos Vajna 
CommitDate: Tue Jan 30 10:40:43 2024 +0100

tdf#146756 pie chart2 import: use manualLayout Width for pie chart labels

... and use a compatible 1/5 width if not specified.

This patch depends on the previous oox patch
(commit 301e27cbebf7d6e4c9b82290d7cd555c43f0c999)
which actually reads the width into the model.

Fixes a 7.2 regression from
commit b0068342398786ca50304260434a18880dddf74d
author Tünde Tóth on Wed Dec 16 18:26:26 2020 +0100
tdf#138777 pie chart: improve long data label width

and is basically a re-write of 7.1's
commit 20da1a5dd37c7edac620566c992d5a53b23a5f12
author Tünde Tóth   on Fri Oct 09 09:24:18 2020 +0200
tdf#134978 Chart OOXML Import: fix pie chart label custom position

This is very risky, but then ANYTHING changing chart2 is risky.
There were a lot of changes made in 7.1,
and they all invited regressions.
However, our chart implementation is not in a good state,
and certainly is not very interoperable,
so it is worth taking the risk.

Anything dealing with manualLayout at this point
should have originated as a pptx,
so forcing a compatible max width should be fairly safe.

It probably isn't actually all that risky after all.

largely copied code from
commit 4223ff2be69f03e571464b0b09ad0d278918631b
Author: Balazs Varga on Wed Jan 15 16:31:35 2020 +0100
tdf#48436 Chart: add CustomLabelPosition UNO API property

Fortunately this all goes away after a round-trip
since custom label placement is lost on export to OOXML,
and that really helps to reduce the risk.

make CppunitTest_chart2_import CPPUNIT_TEST_NAME=testTdf146487

Change-Id: I9722fc6c759c15ac3924780e6fc124f02fba07e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162590
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index fc8042a38393..b23e048c6949 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -37,6 +38,8 @@
 #include 
 #include 
 
+namespace
+{
 class Chart2ImportTest : public ChartTest
 {
 public:
@@ -46,6 +49,11 @@ protected:
 void testTransparentBackground(std::u16string_view filename);
 };
 
+OUString getShapeDump(css::uno::Reference const& 
doc)
+{
+return css::uno::Reference(doc, 
css::uno::UNO_QUERY_THROW)->dump("shapes");
+}
+
 // error bar import
 // split method up into smaller chunks for more detailed tests
 CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testFdo60083)
@@ -187,7 +195,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testSteppedLines)
 }
 }
 
-static uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< 
chart::XChartDocument > const & xChart1Doc)
+uno::Sequence < OUString > getChartColumnDescriptions( uno::Reference< 
chart::XChartDocument > const & xChart1Doc)
 {
 CPPUNIT_ASSERT(xChart1Doc.is());
 uno::Reference< chart::XChartDataArray > xChartData ( 
xChart1Doc->getData(), UNO_QUERY_THROW);
@@ -1988,6 +1996,17 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf146487)
 Reference xTitled(xChartDoc, uno::UNO_QUERY_THROW);
 uno::Reference xTitle = xTitled->getTitleObject();
 CPPUNIT_ASSERT_MESSAGE("chart doc should not have a title", !xTitle.is());
+
+// tdf#146756 use manualLayout Width that was provided (so Green;  
$7,654,321 is not wrapped
+if (!IsDefaultDPI())
+return;
+uno::Reference xDoc = getChartDocFromDrawImpress(0, 
0);
+OString aXmlDump = OUStringToOString(getShapeDump(xDoc), 
RTL_TEXTENCODING_UTF8);
+xmlDocUniquePtr 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2023-10-19 Thread Stephan Bergmann (via logerrit)
 chart2/qa/extras/chart2geometry.cxx  |   
28 +-
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx  |
2 
 chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx  |
2 
 chart2/source/controller/dialogs/DialogModel.cxx |
2 
 chart2/source/controller/dialogs/tp_DataSource.cxx   |
8 +-
 chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx |
4 -
 chart2/source/controller/sidebar/ChartColorWrapper.cxx   |
2 
 chart2/source/model/filter/XMLFilter.cxx |
6 +-
 chart2/source/model/main/CartesianCoordinateSystem.cxx   |
2 
 chart2/source/model/main/ChartModel.cxx  |
8 +-
 chart2/source/model/main/PolarCoordinateSystem.cxx   |
4 -
 chart2/source/model/template/PieChartTypeTemplate.cxx|
2 
 chart2/source/tools/CachedDataSequence.cxx   |
2 
 chart2/source/tools/ConfigColorScheme.cxx|
2 
 chart2/source/tools/ErrorBar.cxx |
2 
 chart2/source/tools/InternalDataProvider.cxx |   
10 +--
 chart2/source/tools/ObjectIdentifier.cxx |
8 +-
 chart2/source/tools/ReferenceSizeProvider.cxx|
2 
 chart2/source/tools/RegressionCurveHelper.cxx|
2 
 chart2/source/tools/Scaling.cxx  |
8 +-
 chart2/source/tools/StatisticsHelper.cxx |
2 
 chart2/source/tools/UncachedDataSequence.cxx |
4 -
 chart2/source/view/axes/DateScaling.cxx  |
6 +-
 chart2/source/view/axes/VCartesianAxis.cxx   |
2 
 chart2/source/view/main/ChartView.cxx|
8 +-
 chart2/source/view/main/VLegend.cxx  |
2 
 26 files changed, 65 insertions(+), 65 deletions(-)

New commits:
commit 27aea4de846810fcca5afe3788b0d0615d85bb30
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:05 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 19 14:05:52 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: chart2

Change-Id: Ifcb57548a594cbbaf70df8d9da17cf94a96667db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158146
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/chart2/qa/extras/chart2geometry.cxx 
b/chart2/qa/extras/chart2geometry.cxx
index fdd4e6daa11d..c4374e65c678 100644
--- a/chart2/qa/extras/chart2geometry.cxx
+++ b/chart2/qa/extras/chart2geometry.cxx
@@ -80,10 +80,10 @@ void Chart2GeometryTest::testTdf135184RoundLineCap()
 xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml");
 CPPUNIT_ASSERT(pXmlDoc);
 
-static constexpr OStringLiteral 
sStyleStart("/office:document-content/office:automatic-styles");
-static constexpr OStringLiteral 
sCap("/style:graphic-properties[@svg:stroke-linecap='round']");
-static constexpr OStringLiteral sChartStart(
-"/office:document-content/office:body/office:chart/chart:chart");
+static constexpr OString 
sStyleStart("/office:document-content/office:automatic-styles"_ostr);
+static constexpr OString 
sCap("/style:graphic-properties[@svg:stroke-linecap='round']"_ostr);
+static constexpr OString sChartStart(
+"/office:document-content/office:body/office:chart/chart:chart"_ostr);
 OString sPredicate;
 // chart area
 const OUString sOUAreaStyleName = getXPathContent(pXmlDoc, sChartStart + 
"/@chart:style-name");
@@ -109,10 +109,10 @@ void Chart2GeometryTest::testTdf135184RoundLineCap2()
 xmlDocUniquePtr pXmlDoc = parseExport("Object 1/content.xml");
 CPPUNIT_ASSERT(pXmlDoc);
 
-static constexpr OStringLiteral 
sStyleStart("/office:document-content/office:automatic-styles");
-static constexpr OStringLiteral 
sCap("/style:graphic-properties[@svg:stroke-linecap='round']");
-static constexpr OStringLiteral sChartStart(
-"/office:document-content/office:body/office:chart/chart:chart");
+static constexpr OString 
sStyleStart("/office:document-content/office:automatic-styles"_ostr);
+static constexpr OString 
sCap("/style:graphic-properties[@svg:stroke-linecap='round']"_ostr);
+static constexpr OString sChartStart(
+"/office:document-content/office:body/office:chart/chart:chart"_ostr);
 OString sPredicate;
 // legend
 const OString sLegend(sChartStart + "/chart:legend");
@@ -140,11 +140,11 @@ void Chart2GeometryTest::testTdf135184RoundLineCap3()
 xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart1.xml");
 CPPUNIT_ASSERT(pXmlDoc);
 
- 

[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/qa comphelper/source connectivity/source cppcanvas/qa cppuhelper/source desktop/qa editeng/source emfio/qa extensions/source filter/q

2023-10-06 Thread Stephan Bergmann (via logerrit)
 chart2/qa/extras/uichart.cxx|2 
 chart2/source/tools/ErrorBar.cxx|   30 
 comphelper/qa/string/test_string.cxx|   10 
 comphelper/source/misc/configuration.cxx|2 
 connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx  |2 
 cppcanvas/qa/unit/test.cxx  |4 
 cppuhelper/source/factory.cxx   |4 
 desktop/qa/desktop_lib/test_desktop_lib.cxx |4 
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |4 
 editeng/source/uno/unotext.cxx  |   12 
 emfio/qa/cppunit/wmf/wmfimporttest.cxx  |6 
 extensions/source/bibliography/bibload.cxx  |2 
 filter/qa/unit/textfilterdetect.cxx |6 
 filter/source/pdf/pdfexport.cxx |2 
 filter/source/svg/svgexport.cxx |   26 
 forms/source/richtext/richtextunowrapper.cxx|4 
 framework/source/uielement/langselectionstatusbarcontroller.cxx |2 
 i18nlangtag/source/languagetag/languagetag.cxx  |2 
 i18npool/qa/cppunit/test_characterclassification.cxx|   84 
 i18npool/qa/cppunit/test_defaultnumberingprovider.cxx   |   56 
 i18npool/qa/cppunit/test_textsearch.cxx |   18 
 lingucomponent/source/lingutil/lingutil.cxx |   10 
 lotuswordpro/source/filter/lwpfribptr.cxx   |2 
 lotuswordpro/source/filter/lwpnumericfmt.hxx|   10 
 o3tl/qa/test-string_view.cxx|4 
 oox/qa/unit/drawingml.cxx   |   14 
 oox/qa/unit/shape.cxx   |  180 
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |2 
 oox/source/drawingml/fontworkhelpers.cxx|  131 
 oox/source/drawingml/shape.cxx  |   42 
 oox/source/export/DMLPresetShapeExport.cxx  |   90 
 oox/source/export/drawingml.cxx |8 
 oox/source/shape/WpsContext.cxx |   53 
 sal/qa/rtl/math/test-rtl-math.cxx   |2 
 sal/qa/rtl/textenc/rtl_textcvt.cxx  |   24 
 sal/qa/rtl/uri/rtl_testuri.cxx  |6 
 sc/qa/extras/accessibility/basics.cxx   |4 
 sc/qa/extras/macros-test.cxx|6 
 sc/qa/extras/vba-macro-test.cxx |3 
 sc/qa/unit/subsequent_export_test2.cxx  |4 
 sc/qa/unit/subsequent_filters_test3.cxx |   28 
 sc/qa/unit/subsequent_filters_test4.cxx |   12 
 sc/qa/unit/tiledrendering/tiledrendering.cxx|4 
 sc/qa/unit/ucalc.cxx|4 
 sc/qa/unit/uicalc/uicalc2.cxx   |8 
 sc/source/filter/xml/SparklineGroupsExport.cxx  |   24 
 sc/source/ui/dialogs/SparklineDataRangeDialog.cxx   |2 
 sc/source/ui/dialogs/SparklineDialog.cxx|2 
 sc/source/ui/unoobj/condformatuno.cxx   |   46 
 sc/source/ui/unoobj/docuno.cxx  |2 
 sd/qa/unit/TextFittingTest.cxx  |   12 
 sd/qa/unit/a11y/layout.cxx  |6 
 sd/qa/unit/export-tests-ooxml1.cxx  |7 
 sd/qa/unit/export-tests-ooxml2.cxx  |2 
 sd/qa/unit/import-tests-smartart.cxx|6 
 sd/qa/unit/import-tests.cxx |   32 
 sd/qa/unit/layout-tests.cxx |3 
 sd/qa/unit/tiledrendering/tiledrendering.cxx|6 
 sd/qa/unit/uiimpress.cxx|   28 
 sd/source/core/stlsheet.cxx |   16 
 sd/source/core/text/textapi.cxx |8 
 sd/source/ui/slideshow/slideshow.cxx|   32 
 sd/source/ui/unoidl/unolayer.cxx|   12 
 sd/source/ui/unoidl/unomodel.cxx|8 
 sd/source/ui/unoidl/unoobj.cxx  |4 
 sd/source/ui/unoidl/unopage.cxx |  108 
 sd/source/ui/unoidl/unosrch.cxx |6 
 sdext/qa/unit/pdfimport.cxx |   20 
 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2023-07-16 Thread Laurent Balland (via logerrit)
 chart2/qa/extras/chart2export.cxx|   16 +---
 chart2/source/inc/RegressionCurveModel.hxx   |1 +
 chart2/source/tools/RegressionCurveModel.cxx |   11 ++-
 3 files changed, 24 insertions(+), 4 deletions(-)

New commits:
commit 6fc12ad600a1ee10253c269a5988907a2894be76
Author: Laurent Balland 
AuthorDate: Sun Jul 2 18:00:31 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sun Jul 16 14:32:03 2023 +0200

tdf#155526 Remove Insert R2 in all cases

When opening a file containing a Moving average trend line,
addRegressionCurve is not used, then MayHaveCorrelationCoefficient property 
is not
correctly set.
This change modify this property in all cases.
Update property in firePropertyChangeEvent() as it is not possible in
constructor: JunitTest_chart2_unoapi fails in MeanValue as SolarMutex
is not owned

Add QA test

Change-Id: I13bdb81239a7362431edcf28bfc38ac4820a7776
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153859
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 6e9a18efeed5..2f5f030ef3d1 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -52,7 +52,7 @@ void checkCommonTrendline(
 Reference const & xCurve,
 double aExpectedExtrapolateForward, double 
aExpectedExtrapolateBackward,
 bool aExpectedForceIntercept, double aExpectedInterceptValue,
-bool aExpectedShowEquation, bool aExpectedR2)
+bool aExpectedShowEquation, bool aExpectedR2, bool aExpectedMayHaveR2)
 {
 Reference xProperties( xCurve , uno::UNO_QUERY );
 CPPUNIT_ASSERT(xProperties.is());
@@ -86,6 +86,10 @@ void checkCommonTrendline(
 bool bShowCorrelationCoefficient = false;
 
CPPUNIT_ASSERT(xEquationProperties->getPropertyValue("ShowCorrelationCoefficient")
 >>= bShowCorrelationCoefficient);
 CPPUNIT_ASSERT_EQUAL(aExpectedR2, bShowCorrelationCoefficient);
+
+bool bMayHaveR2 = false;
+
CPPUNIT_ASSERT(xEquationProperties->getPropertyValue("MayHaveCorrelationCoefficient")
 >>= bMayHaveR2);
+CPPUNIT_ASSERT_EQUAL(aExpectedMayHaveR2, bMayHaveR2);
 }
 
 void checkNameAndType(Reference const & xProperties, const 
OUString& aExpectedName, const OUString& aExpectedServiceName)
@@ -115,7 +119,7 @@ void checkLinearTrendline(
 xCurve,
 aExpectedExtrapolateForward, aExpectedExtrapolateBackward,
 /*aExpectedForceIntercept*/false, aExpectedInterceptValue,
-/*aExpectedShowEquation*/true, /*aExpectedR2*/false);
+/*aExpectedShowEquation*/true, /*aExpectedR2*/false, 
/*aExpectedMayHaveR2*/true);
 }
 
 void checkPolynomialTrendline(
@@ -137,7 +141,7 @@ void checkPolynomialTrendline(
 xCurve,
 aExpectedExtrapolateForward, aExpectedExtrapolateBackward,
 /*aExpectedForceIntercept*/true, aExpectedInterceptValue,
-/*aExpectedShowEquation*/true, /*aExpectedR2*/true);
+/*aExpectedShowEquation*/true, /*aExpectedR2*/true, 
/*aExpectedMayHaveR2*/true);
 }
 
 void checkMovingAverageTrendline(
@@ -151,6 +155,12 @@ void checkMovingAverageTrendline(
 sal_Int32 aPeriod = 2;
 CPPUNIT_ASSERT(xProperties->getPropertyValue("MovingAveragePeriod") >>= 
aPeriod);
 CPPUNIT_ASSERT_EQUAL(aExpectedPeriod, aPeriod);
+
+checkCommonTrendline(
+xCurve,
+/*aExpectedExtrapolateForward*/0.0, 
/*aExpectedExtrapolateBackward*/0.0,
+/*aExpectedForceIntercept*/false, /*aExpectedInterceptValue*/0.0,
+/*aExpectedShowEquation*/false, /*aExpectedR2*/false, 
/*aExpectedMayHaveR2*/false);
 }
 
 void checkTrendlinesInChart(uno::Reference< chart2::XChartDocument > const & 
xChartDoc)
diff --git a/chart2/source/inc/RegressionCurveModel.hxx 
b/chart2/source/inc/RegressionCurveModel.hxx
index 89955f1314e4..ddd75a8391a1 100644
--- a/chart2/source/inc/RegressionCurveModel.hxx
+++ b/chart2/source/inc/RegressionCurveModel.hxx
@@ -119,6 +119,7 @@ private:
 
 rtl::Reference m_xModifyEventForwarder;
 css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties;
+void setPropertyMayHaveR2();
 };
 
 // implementations for factory instantiation
diff --git a/chart2/source/tools/RegressionCurveModel.cxx 
b/chart2/source/tools/RegressionCurveModel.cxx
index 5c1082e89a74..06be003ef106 100644
--- a/chart2/source/tools/RegressionCurveModel.cxx
+++ b/chart2/source/tools/RegressionCurveModel.cxx
@@ -183,12 +183,20 @@ void SAL_CALL 
RegressionCurveModel::setEquationProperties( const uno::Reference<
 ModifyListenerHelper::removeListener( m_xEquationProperties, 
m_xModifyEventForwarder );
 
 m_xEquationProperties.set( xEquationProperties );
-m_xEquationProperties->setPropertyValue( 
"MayHaveCorrelationCoefficient", uno::Any( m_eRegressionCurveType != 
CURVE_TYPE_MOVING_AVERAGE ) );
+setPropertyMayHaveR2();
 

[Libreoffice-commits] core.git: chart2/qa chart2/source sc/qa sw/qa

2023-01-16 Thread Gülşah Köse (via logerrit)
 chart2/qa/extras/chart2import.cxx   |  
 92 ++
 chart2/qa/extras/chart2import2.cxx  |  
 14 -
 chart2/qa/extras/charttest.hxx  |  
 38 
 chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx 
|binary
 chart2/source/view/main/ChartView.cxx   |  
 18 +
 sc/qa/uitest/chart/chartDataLabels.py   |  
  8 
 sw/qa/extras/layout/layout2.cxx |  
  4 
 7 files changed, 158 insertions(+), 16 deletions(-)

New commits:
commit 959fbfc000d2e3167b2b57b6d11bea231993b4f0
Author: Gülşah Köse 
AuthorDate: Wed Nov 23 17:05:28 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Tue Jan 17 07:19:32 2023 +

tdf#91265 Use same plot area distance as used in MSO

Changes the postion calculation for pie charts, where the margin
min distance is now constant for pie charts, but unchanged for
other chart types.

This changes the positions of various pie charts used in tests,
which have been changed to the new value after the cases have been
checked.

Added a new test with all 3 use cases (chart area width equals
height, width is greater than height, width is less than height).

Change-Id: I51f98f336a7c64a3e6762144fc7dc8d9df80f696
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143179
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index a9c301a94b93..b02f52c68411 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -138,6 +138,7 @@ public:
 void testFixedSizeBarChartVeryLongLabel();
 void testAutomaticSizeBarChartVeryLongLabel();
 void testTotalsRowIgnored();
+void testPieChartPlotAreaMarginWithAutomaticLayout();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -225,6 +226,7 @@ public:
 CPPUNIT_TEST(testFixedSizeBarChartVeryLongLabel);
 CPPUNIT_TEST(testAutomaticSizeBarChartVeryLongLabel);
 CPPUNIT_TEST(testTotalsRowIgnored);
+CPPUNIT_TEST(testPieChartPlotAreaMarginWithAutomaticLayout);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2303,6 +2305,96 @@ void Chart2ImportTest::testTotalsRowIgnored()
 }
 }
 
+void Chart2ImportTest::testPieChartPlotAreaMarginWithAutomaticLayout()
+{
+// tdf#91265
+// Checks the margin and calculation of the plot area for the pie chart 
inside the chart area.
+
+loadFromURL(u"pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx");
+
+OUString aCheckShapeName = "CID/D=0:CS=0:CT=0:Series=0";
+// Chart Wuse case Width == Height
+{
+// Load chart Chart_2_2 - 2cm x 2cm -
+auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_2_2");
+CPPUNIT_ASSERT(xDocument.is());
+
+uno::ReferencexChartDocument(xDocument, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDocument.is());
+
+// Get the shape of the diagram / chart
+uno::Reference 
xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDrawPageSupplier.is());
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+uno::Reference xChartDiagramShape = 
getShapeByName(xShapes, aCheckShapeName);
+CPPUNIT_ASSERT(xChartDiagramShape.is());
+
+// Size
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, 
xChartDiagramShape->getSize().Width, 5);  // calculated chart area size - 2 * 
margin
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, 
xChartDiagramShape->getSize().Height, 5); // calculated chart area size - 2 * 
margin
+// Position
+CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().X, 
5); // margin
+CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().Y, 
5); // margin
+}
+
+// Chart use case - Width < Height
+{
+// Load chart Chart_3_4 - 3cm x 4cm
+auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_3_4");
+CPPUNIT_ASSERT(xDocument.is());
+
+uno::ReferencexChartDocument(xDocument, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDocument.is());
+
+// Get the shape of the diagram / chart
+uno::Reference 
xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDrawPageSupplier.is());
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+uno::Reference xChartDiagramShape = 
getShapeByName(xShapes, aCheckShapeName);
+CPPUNIT_ASSERT(xChartDiagramShape.is());
+
+// Size
+CPPUNIT_ASSERT_DOUBLES_EQUAL(2300, 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2022-08-22 Thread Tomaž Vajngerl (via logerrit)
 chart2/qa/extras/chart2import2.cxx 
 |   16 ++
 
chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx 
|binary
 chart2/source/view/charttypes/VSeriesPlotter.cxx   
 |   78 --
 chart2/source/view/main/DataTableView.cxx  
 |   26 +--
 4 files changed, 38 insertions(+), 82 deletions(-)

New commits:
commit e5583150a3953f08782865e0f90d41f5c35cc6c5
Author: Tomaž Vajngerl 
AuthorDate: Mon Aug 22 16:46:41 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon Aug 22 19:50:28 2022 +0200

chart2: always use the series for the keys (symbols) in data table

In special case the legend keys are not series, but can be each
value of a series. This can't be done for the data table where so
this has been disabled.

This caused a crash when positioning the symbols, as in some cases
we got 0 symbols (due to another bug that didn't put the symbols
into the collection) or more symbols that there were series (and
the symbols couldn't be positioned correctly). With this change
we now get the correct number of symbols for the data table.

Also added the test document and test to open the document, to
make sure we don't crash anymore.

Change-Id: Idbebdd5295595a823b5420958e803b13258df035
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138697
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/chart2/qa/extras/chart2import2.cxx 
b/chart2/qa/extras/chart2import2.cxx
index eb983f7687f1..81e274400c67 100644
--- a/chart2/qa/extras/chart2import2.cxx
+++ b/chart2/qa/extras/chart2import2.cxx
@@ -61,6 +61,7 @@ public:
 void testTdf139658();
 void testTdf146066();
 void testTdf150434();
+void testChartDataTableWithMultipleLegendEntriesForOneDataSeries();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest2);
 
@@ -103,6 +104,7 @@ public:
 CPPUNIT_TEST(testTdf139658);
 CPPUNIT_TEST(testTdf146066);
 CPPUNIT_TEST(testTdf150434);
+CPPUNIT_TEST(testChartDataTableWithMultipleLegendEntriesForOneDataSeries);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -948,6 +950,20 @@ void Chart2ImportTest2::testTdf150434()
 CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), aPosition.Y);
 }
 
+void 
Chart2ImportTest2::testChartDataTableWithMultipleLegendEntriesForOneDataSeries()
+{
+load(u"/chart2/qa/extras/data/xlsx/", 
u"DataTable-MultipleLegendEntriesForOneDataSeries.xlsx");
+// Loading this file caused a crash in the data table code
+
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+   UNO_QUERY_THROW);
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xDataTableShape = getShapeByName(xShapes, 
"CID/D=0:DataTable=");
+CPPUNIT_ASSERT(xDataTableShape.is());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git 
a/chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx
 
b/chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx
new file mode 100644
index ..b077fd2e0315
Binary files /dev/null and 
b/chart2/qa/extras/data/xlsx/DataTable-MultipleLegendEntriesForOneDataSeries.xlsx
 differ
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index e34606cd1dc9..65d404fb0be8 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -2516,11 +2516,6 @@ std::vector 
VSeriesPlotter::createSymbols(const awt::Size& rEn
 if (!pSeries)
 continue;
 
-if 
(!pSeries->getPropertiesOfSeries()->getPropertyValue("ShowLegendEntry").get())
-{
-continue;
-}
-
 std::vector aSeriesSymbols = 
createSymbolsForSeries(rEntryKeyAspectRatio, *pSeries, xTarget, xContext);
 
 //add series entries to the result now
@@ -2887,75 +2882,16 @@ std::vector 
VSeriesPlotter::createSymbolsForSeries(
 try
 {
 ViewLegendSymbol aEntry;
-bool bVaryColorsByPoint = rSeries.isVaryColorsByPoint();
-bool bIsPie = 
m_xChartTypeModel->getChartType().equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE);
-try
-{
-if (bIsPie)
-{
-bool bDonut = false;
-if ((m_xChartTypeModel->getPropertyValue("UseRings") >>= 
bDonut) && bDonut)
-bIsPie = false;
-}
-}
-catch (const uno::Exception&)
-{
-}
-
-if (bVaryColorsByPoint || bIsPie)
-{
-Sequence< 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2022-08-18 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import2.cxx|   18 ++
 chart2/qa/extras/data/xlsx/tdf150434.xlsx |binary
 chart2/source/view/main/VLegend.cxx   |8 
 3 files changed, 26 insertions(+)

New commits:
commit e59db22b3b57c9e1a5678218cb56fb75bcc84c26
Author: Tünde Tóth 
AuthorDate: Wed Jul 27 08:58:35 2022 +0200
Commit: László Németh 
CommitDate: Thu Aug 18 13:39:31 2022 +0200

tdf#150434: chart2, XLSX import: strip long legend labels

Full text of legend labels could overflow the chart area,
if the legend text was too long. If it's longer than
520 characters, strip it at the first space from the
500th character (or if there is no space, at the 500th
character). This results better XLSX interoperability, too.

Change-Id: I23a94f6baaf620b40e9b2819738eba5c5a921722
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137492
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import2.cxx 
b/chart2/qa/extras/chart2import2.cxx
index ee41c37dd48a..eb983f7687f1 100644
--- a/chart2/qa/extras/chart2import2.cxx
+++ b/chart2/qa/extras/chart2import2.cxx
@@ -60,6 +60,7 @@ public:
 void testTdf121281();
 void testTdf139658();
 void testTdf146066();
+void testTdf150434();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest2);
 
@@ -101,6 +102,7 @@ public:
 CPPUNIT_TEST(testTdf121281);
 CPPUNIT_TEST(testTdf139658);
 CPPUNIT_TEST(testTdf146066);
+CPPUNIT_TEST(testTdf150434);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -930,6 +932,22 @@ void Chart2ImportTest2::testTdf146066()
 CPPUNIT_ASSERT_EQUAL(OUString("35"), xLabel7->getString());
 }
 
+void Chart2ImportTest2::testTdf150434()
+{
+load(u"/chart2/qa/extras/data/xlsx/", u"tdf150434.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+   UNO_QUERY_THROW);
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xLegend = getShapeByName(xShapes, 
"CID/D=0:Legend=");
+CPPUNIT_ASSERT(xLegend.is());
+awt::Point aPosition = xLegend->getPosition();
+
+// This failed, if the legend flowed out of the chart area.
+CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), aPosition.Y);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/tdf150434.xlsx 
b/chart2/qa/extras/data/xlsx/tdf150434.xlsx
new file mode 100644
index ..309a0c4c25f7
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf150434.xlsx differ
diff --git a/chart2/source/view/main/VLegend.cxx 
b/chart2/source/view/main/VLegend.cxx
index 7fc92b491ad2..e789baf62a62 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -167,6 +167,14 @@ awt::Size lcl_createTextShapes(
 if( i == 1 )
 break;
 
+// tdf#150034 limit legend label text
+if (aLabelSeq[i]->getString().getLength() > 520)
+{
+sal_Int32 nIndex = aLabelSeq[i]->getString().indexOf(' ', 
500);
+aLabelSeq[i]->setString(
+aLabelSeq[i]->getString().copy(0, nIndex > 500 ? 
nIndex : 500));
+}
+
 aLabelString += aLabelSeq[i]->getString();
 // workaround for Issue #i67540#
 if( aLabelString.isEmpty())


[Libreoffice-commits] core.git: chart2/qa chart2/source

2022-07-05 Thread Kurt Nordback (via logerrit)
 chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt |   10 -
 chart2/source/view/charttypes/PieChart.cxx |   60 
+++---
 chart2/source/view/charttypes/PieChart.hxx |4 
 3 files changed, 55 insertions(+), 19 deletions(-)

New commits:
commit 9b558357a3e7a4c908084134d56770809116b4f1
Author: Kurt Nordback 
AuthorDate: Fri Jun 3 15:19:28 2022 -0600
Commit: Noel Grandin 
CommitDate: Tue Jul 5 11:52:43 2022 +0200

tdf#104428 Improve rendering of exploded donut charts

This bug shows an exploded donut chart with more than one series. The
concern is that the standard pie/donut' explosion' rendering, with the shape
of the pieces unchanged but the pieces translated outward, gives
unsatisfactory results in the case of a donut with more than one series,
where the translated 'exploded' pieces can overlap with the inner ring.
This proposed fix renders this case differently, by increasing the radius
of the exploded ring but keeping the pieces concentric with the inner ring.

This commit also modifies the unit test values for donut_chart.ods.

Change-Id: I713b1f3ce4697d46d29914410056f0aa83c6aa8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135394
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt 
b/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt
index b2dfd33295a2..c1af41103de5 100644
--- a/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt
+++ b/chart2/qa/extras/chart2dump/reference/piecharttest/donut_chart.txt
@@ -35,15 +35,15 @@
 16728590
 /// /D=0:CS=0:CT=0:Series=0:Point=2
 // aSlicePosition.X
-8909
+9033
 // aSlicePosition.Y
-4532
+4635
 // aSliceSize.Height
-4689
+4659
 // aSliceSize.Width
-2544
+2458
 // aSliceTransformation
-2544;0;8909;0;4689;4532;0;0;1
+2458;0;9033;0;4659;4635;0;0;1
 // static_cast(aSliceFillStyle)
 1
 // static_cast(aSliceFillColor)
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 806bc468414c..a81428c24c15 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -246,17 +246,47 @@ bool PieChart::shouldSnapRectToUsedArea()
 rtl::Reference PieChart::createDataPoint(
 const rtl::Reference& xTarget,
 const uno::Reference& xObjectProperties,
-const ShapeParam& rParam )
+const ShapeParam& rParam,
+const sal_Int32 nPointCount,
+const bool bConcentricExplosion)
 {
 //transform position:
 drawing::Direction3D aOffset;
-if (rParam.mfExplodePercentage != 0.0)
-{
-double fAngle  = rParam.mfUnitCircleStartAngleDegree + 
rParam.mfUnitCircleWidthAngleDegree/2.0;
-double fRadius = 
(rParam.mfUnitCircleOuterRadius-rParam.mfUnitCircleInnerRadius)*rParam.mfExplodePercentage;
-drawing::Position3D aOrigin = 
m_pPosHelper->transformUnitCircleToScene(0, 0, rParam.mfLogicZ);
-drawing::Position3D aNewOrigin = 
m_pPosHelper->transformUnitCircleToScene(fAngle, fRadius, rParam.mfLogicZ);
-aOffset = aNewOrigin - aOrigin;
+double fExplodedInnerRadius = rParam.mfUnitCircleInnerRadius;
+double fExplodedOuterRadius = rParam.mfUnitCircleOuterRadius;
+double fStartAngle = rParam.mfUnitCircleStartAngleDegree;
+double fWidthAngle = rParam.mfUnitCircleWidthAngleDegree;
+
+if (rParam.mfExplodePercentage != 0.0) {
+double fRadius = 
(fExplodedOuterRadius-fExplodedInnerRadius)*rParam.mfExplodePercentage;
+
+if (bConcentricExplosion) {
+
+// For concentric explosion, increase the radius but retain the 
original
+// arc length of all ring segments together. This results in a gap
+// that's evenly divided among all segments, assuming they all have
+// the same explosion percentage
+assert(fExplodedInnerRadius >= 0 && fExplodedOuterRadius > 0);
+double fAngleRatio = (fExplodedInnerRadius + fExplodedOuterRadius) 
/
+(fExplodedInnerRadius + fExplodedOuterRadius + 2 * fRadius);
+
+assert(nPointCount > 0);
+double fAngleGap = 360 * (1.0 - fAngleRatio) / nPointCount;
+fStartAngle += fAngleGap / 2;
+fWidthAngle -= fAngleGap;
+
+fExplodedInnerRadius += fRadius;
+fExplodedOuterRadius += fRadius;
+
+} else {
+// For the non-concentric explosion case, keep the original radius
+// but shift the circle origin
+double fAngle  = fStartAngle + fWidthAngle/2.0;
+
+drawing::Position3D aOrigin = 
m_pPosHelper->transformUnitCircleToScene(0, 0, rParam.mfLogicZ);
+drawing::Position3D aNewOrigin = 
m_pPosHelper->transformUnitCircleToScene(fAngle, fRadius, rParam.mfLogicZ);
+aOffset = aNewOrigin - aOrigin;
+}
 }
 
 //create 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2022-05-04 Thread Stephan Bergmann (via logerrit)
 chart2/qa/extras/PivotChartTest.cxx|   12 
+-
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx   |4 
+--
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |2 -
 chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx |2 -
 chart2/source/controller/main/ChartController_Tools.cxx|4 
+--
 chart2/source/controller/main/ChartController_Window.cxx   |8 
+++---
 chart2/source/controller/sidebar/ChartColorWrapper.cxx |2 -
 chart2/source/controller/sidebar/ChartLinePanel.cxx|2 -
 chart2/source/inc/CommonFunctors.hxx   |2 -
 chart2/source/tools/TitleHelper.cxx|2 -
 chart2/source/view/main/VButton.cxx|6 
++---
 11 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit 6ad8a6398dbf2b4605ee4c3c222a0c2ee396c163
Author: Stephan Bergmann 
AuthorDate: Wed May 4 21:47:39 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Thu May 5 07:12:47 2022 +0200

Just use Any ctor instead of makeAny in chart2

Change-Id: I156cd5597a4b9e683913d9730b8d8bb22e8064f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133845
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/chart2/qa/extras/PivotChartTest.cxx 
b/chart2/qa/extras/PivotChartTest.cxx
index baa1c925132e..60dd561cb632 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -71,7 +71,7 @@ void 
lclModifyOrientation(uno::Reference const & xD
 OUString aName = xNamed->getName();
 uno::Reference xPropSet(xNamed, UNO_QUERY_THROW);
 if (aName == sFieldName)
-xPropSet->setPropertyValue("Orientation", 
uno::makeAny(eOrientation));
+xPropSet->setPropertyValue("Orientation", uno::Any(eOrientation));
 }
 }
 
@@ -87,7 +87,7 @@ void 
lclModifyFunction(uno::Reference const & xDesc
 OUString aName = xNamed->getName();
 uno::Reference xPropSet(xNamed, UNO_QUERY_THROW);
 if (aName == sFieldName)
-xPropSet->setPropertyValue("Function", uno::makeAny(eFunction));
+xPropSet->setPropertyValue("Function", uno::Any(eFunction));
 }
 }
 
@@ -134,13 +134,13 @@ void 
lclModifySubtotals(uno::Reference const & xDes
 void lclModifyColumnGrandTotal(uno::Reference 
const & xDataPilotDescriptor, bool bTotal)
 {
 uno::Reference xProperties(xDataPilotDescriptor, 
uno::UNO_QUERY_THROW);
-xProperties->setPropertyValue("ColumnGrand", uno::makeAny(bTotal));
+xProperties->setPropertyValue("ColumnGrand", uno::Any(bTotal));
 }
 
 void lclModifyRowGrandTotal(uno::Reference const 
& xDataPilotDescriptor, bool bTotal)
 {
 uno::Reference xProperties(xDataPilotDescriptor, 
uno::UNO_QUERY_THROW);
-xProperties->setPropertyValue("RowGrand", uno::makeAny(bTotal));
+xProperties->setPropertyValue("RowGrand", uno::Any(bTotal));
 }
 
 void lclCheckSequence(std::vector const & reference,
@@ -293,7 +293,7 @@ table::CellRangeAddress 
lclCreateTestData(uno::ReferencegetStandardFormat(util::NumberFormat::DATE, aLocale);
 uno::Reference xCellRange = 
xSheet->getCellRangeByPosition(nEndCol, 1, nEndCol, nEndRow);
 uno::Reference xCellProp(xCellRange, UNO_QUERY_THROW);
-xCellProp->setPropertyValue("NumberFormat", uno::makeAny(nDateKey));
+xCellProp->setPropertyValue("NumberFormat", uno::Any(nDateKey));
 
 table::CellRangeAddress sCellRangeAddress;
 sCellRangeAddress.Sheet = 0;
@@ -493,7 +493,7 @@ void PivotChartTest::testChangePivotTable()
 // Enable column totals and check the data is still unchanged
 {
 uno::Reference xProperties(xDataPilotTable, 
uno::UNO_QUERY_THROW);
-xProperties->setPropertyValue("ColumnGrand", uno::makeAny(true));
+xProperties->setPropertyValue("ColumnGrand", uno::Any(true));
 }
 
 CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getNumberOfDataSeries(xChartDoc));
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx 
b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 56d2d44f9ce6..abfa395ca5f0 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -138,7 +138,7 @@ namespace
 try
 {
 xSceneProperties->setPropertyValue( "D3DSceneLightColor" + aIndex,
-uno::makeAny( 
rLightSource.nDiffuseColor ));
+uno::Any( 
rLightSource.nDiffuseColor ));
 xSceneProperties->setPropertyValue( "D3DSceneLightDirection" + 
aIndex,
 uno::Any( 
rLightSource.aDirection ));
 xSceneProperties->setPropertyValue( "D3DSceneLightOn" 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2022-04-14 Thread Noel Grandin (via logerrit)
 chart2/qa/extras/PivotChartTest.cxx  |4 
 chart2/qa/extras/chart2_trendcalculators.cxx |2 
 chart2/qa/extras/chart2export.cxx|  186 +--
 chart2/qa/extras/chart2export2.cxx   |  142 
 chart2/qa/extras/chart2geometry.cxx  |   28 -
 chart2/qa/extras/chart2import.cxx|  162 -
 chart2/qa/extras/chart2import2.cxx   |   74 ++--
 chart2/qa/extras/charttest.hxx   |   22 -
 chart2/qa/extras/xshape/chart2xshape.cxx |   12 
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx  |   27 -
 chart2/source/controller/dialogs/ObjectNameProvider.cxx  |5 
 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx|4 
 chart2/source/controller/main/ChartController_Properties.cxx |9 
 chart2/source/controller/main/ChartController_Tools.cxx  |4 
 chart2/source/inc/ObjectIdentifier.hxx   |   12 
 chart2/source/tools/ObjectIdentifier.cxx |   85 ++---
 chart2/source/tools/XMLRangeHelper.cxx   |4 
 17 files changed, 393 insertions(+), 389 deletions(-)

New commits:
commit dbe92dcfa79e3336411661fc94106deeba9317d6
Author: Noel Grandin 
AuthorDate: Thu Apr 14 11:45:25 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 14 15:13:34 2022 +0200

use more string_view in chart2

Change-Id: I9ab6cd3905bfb7c811e7ad14b54ced6c42d2e077
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133003
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/PivotChartTest.cxx 
b/chart2/qa/extras/PivotChartTest.cxx
index ee024531e88b..baa1c925132e 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -316,7 +316,7 @@ void PivotChartTest::testRoundtrip()
 
 std::vector aReference2 { 101879.458079, 178636.929704, 
314626.484864 };
 
-load(u"/chart2/qa/extras/data/ods/", "PivotChartRoundTrip.ods");
+load(u"/chart2/qa/extras/data/ods/", u"PivotChartRoundTrip.ods");
 
 xChartDoc = getPivotChartDocFromSheet(1, mxComponent);
 CPPUNIT_ASSERT(xChartDoc.is());
@@ -371,7 +371,7 @@ void PivotChartTest::testChangePivotTable()
 uno::Sequence xSequence;
 Reference xChartDoc;
 
-load(u"/chart2/qa/extras/data/ods/", "PivotTableExample.ods");
+load(u"/chart2/qa/extras/data/ods/", u"PivotTableExample.ods");
 
 // Check we have the Pivot Table
 OUString sPivotTableName("DataPilot1");
diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx 
b/chart2/qa/extras/chart2_trendcalculators.cxx
index c13c1666725e..309df9f2bfb4 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -64,7 +64,7 @@ private:
 void Chart2TrendCalculators::setUp()
 {
 ChartTest::setUp();
-load(u"/chart2/qa/extras/data/ods/", "trend_calculators.ods");
+load(u"/chart2/qa/extras/data/ods/", u"trend_calculators.ods");
 }
 
 void Chart2TrendCalculators::tearDown()
diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index c333ab9d651e..fc6ffc4d4dbf 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -385,7 +385,7 @@ void checkTrendlinesInChart(uno::Reference< 
chart2::XChartDocument > const & xCh
 // improve the test
 void Chart2ExportTest::testErrorBarXLSX()
 {
-load(u"/chart2/qa/extras/data/ods/", "error_bar.ods");
+load(u"/chart2/qa/extras/data/ods/", u"error_bar.ods");
 {
 // make sure the ODS import was successful
 uno::Reference< chart2::XChartDocument > xChartDoc = 
getChartDocFromSheet( 0, mxComponent );
@@ -421,7 +421,7 @@ void Chart2ExportTest::testErrorBarXLSX()
 
 void Chart2ExportTest::testErrorBarPropXLSX()
 {
-load(u"/chart2/qa/extras/data/xlsx/", "testErrorBarProp.xlsx");
+load(u"/chart2/qa/extras/data/xlsx/", u"testErrorBarProp.xlsx");
 xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open 
XML");
 CPPUNIT_ASSERT(pXmlDoc);
 
@@ -441,7 +441,7 @@ void Chart2ExportTest::testErrorBarPropXLSX()
 void Chart2ExportTest::testTrendline()
 {
 mbSkipValidation = true;
-load(u"/chart2/qa/extras/data/ods/", "trendline.ods");
+load(u"/chart2/qa/extras/data/ods/", u"trendline.ods");
 checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
 reload("calc8");
 checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
@@ -449,7 +449,7 @@ void Chart2ExportTest::testTrendline()
 
 void Chart2ExportTest::testTrendlineOOXML()
 {
-load(u"/chart2/qa/extras/data/ods/", "trendline.ods");
+load(u"/chart2/qa/extras/data/ods/", u"trendline.ods");
 checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
 reload("Calc Office Open XML");
 checkTrendlinesInChart(getChartDocFromSheet( 0, 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2022-03-16 Thread Justin Luth (via logerrit)
 chart2/qa/extras/chart2export.cxx|   18 ++
 chart2/qa/extras/data/docx/TableOnPage3.docx |binary
 chart2/source/tools/InternalDataProvider.cxx |8 ++--
 3 files changed, 24 insertions(+), 2 deletions(-)

New commits:
commit cfd82e7a2cc2b45b738eb0efa0827196d2de61a4
Author: Justin Luth 
AuthorDate: Fri Mar 4 07:57:31 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Mar 16 10:28:42 2022 +0100

tdf#128747 chart2: don't overwrite labels

In almost every case, the values of a labeledDataSequence
create a new column, and therefore the label is attached
to the last column.

However, in the case where there are no values at all,
then this function is not called (for the value portion),
resulting in no new column being created,
and thus the label overwrote the previous series label.

Empty-value columns are excluded in later code,
so perhaps we shouldn't addDataSequenceToMap either,
but I don't know the implications of that.

Change-Id: Iad4ab54552b3c6b144feb2bc223ddae538316fa7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130946
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index bca7897025a0..c333ab9d651e 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -119,6 +119,7 @@ public:
 void testPlotVisOnlyXLSX();
 void testBarChartVaryColorsXLSX();
 void testTdf96161();
+void testTableOnPage3();
 void testMultipleAxisXLSX();
 void testSecondaryAxisXLSX();
 void testBarChartSecondaryAxisXLSX();
@@ -213,6 +214,7 @@ public:
 CPPUNIT_TEST(testPlotVisOnlyXLSX);
 CPPUNIT_TEST(testBarChartVaryColorsXLSX);
 CPPUNIT_TEST(testTdf96161);
+CPPUNIT_TEST(testTableOnPage3);
 CPPUNIT_TEST(testMultipleAxisXLSX);
 CPPUNIT_TEST(testSecondaryAxisXLSX);
 CPPUNIT_TEST(testBarChartSecondaryAxisXLSX);
@@ -1900,6 +1902,22 @@ void Chart2ExportTest::testTdf96161()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:varyColors", "val", "0");
 }
 
+void Chart2ExportTest::testTableOnPage3()
+{
+load(u"/chart2/qa/extras/data/docx/", "TableOnPage3.docx");
+reload("Office Open XML Text");
+
+Reference xChartDoc(getChartDocFromWriter(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference< chart::XChartDataArray > 
xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW);
+Sequence aColumnDesc = xDataArray->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", 
static_cast(4), aColumnDesc.getLength());
+CPPUNIT_ASSERT_EQUAL(OUString("If oversubscription relative to allowance 
increases at the same average rate B15-B17"), aColumnDesc[0]);
+CPPUNIT_ASSERT_EQUAL(OUString("Known requirements"), aColumnDesc[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("Allowance"), aColumnDesc[2]);
+CPPUNIT_ASSERT_EQUAL(OUString("If oversubscription relative to allowance 
holds steady at average oversubscription level B15-B17"), aColumnDesc[3]);
+}
+
 void Chart2ExportTest::testMultipleAxisXLSX()
 {
 load(u"/chart2/qa/extras/data/ods/", "multiple_axis.ods");
diff --git a/chart2/qa/extras/data/docx/TableOnPage3.docx 
b/chart2/qa/extras/data/docx/TableOnPage3.docx
new file mode 100644
index ..79763bd35290
Binary files /dev/null and b/chart2/qa/extras/data/docx/TableOnPage3.docx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index e1bf32b7ff10..6fe4ec94a8db 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -647,8 +647,12 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, st
 sal_Int32 nColSize = m_aInternalData.getColumnCount();
 if (!aRawElems.empty() && nColSize)
 {
-std::vector aLabels(1, uno::Any(aRawElems[0]));
-m_aInternalData.setComplexColumnLabel(nColSize-1, 
std::move(aLabels));
+// Do not overwrite an existing label (attempted by series with no 
data values)
+if 
(!m_aInternalData.getComplexColumnLabel(nColSize-1)[0].hasValue())
+{
+std::vector aLabels(1, uno::Any(aRawElems[0]));
+m_aInternalData.setComplexColumnLabel(nColSize-1, 
std::move(aLabels));
+}
 
 OUString aRangeRep = lcl_aLabelRangePrefix + 
OUString::number(nColSize-1);
 xSeq.set(new UncachedDataSequence(this, aRangeRep));


[Libreoffice-commits] core.git: chart2/qa chart2/source

2022-02-23 Thread Justin Luth (via logerrit)
 chart2/qa/extras/chart2import.cxx|   15 +++
 chart2/qa/extras/data/pptx/tdf127720.pptx|binary
 chart2/source/tools/InternalDataProvider.cxx |3 ++-
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit dfd0717b3f55eeb15a5634e52d7d0ed544d17578
Author: Justin Luth 
AuthorDate: Wed Feb 23 20:45:04 2022 +0200
Commit: Justin Luth 
CommitDate: Wed Feb 23 20:52:31 2022 +0100

tdf#127720 chart2: create new columns for error bars

This is basically a copy/paste of the bubble chart fix
for tdf#103984 against the same LO 4.4 regression.

No exist unit tests had error bars. Very interesting.

make CppunitTest_chart2_import CPPUNIT_TEST_NAME=testPPTXChartErrorBars

Change-Id: I81ff91ee2ba75277502a8e261106bf5837a8903b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130444
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 0c129d26978b..70cb393ba7b6 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -50,6 +50,7 @@ public:
 void testDOCXChartSeries();
 void testDOCXChartEmptySeries();
 void testTdf81396();
+void testPPTXChartErrorBars();
 void testDOCXChartValuesSize();
 void testPPTXChartSeries();
 void testPPTXSparseChartSeries();
@@ -147,6 +148,7 @@ public:
 CPPUNIT_TEST(testDOCXChartSeries);
 CPPUNIT_TEST(testDOCXChartEmptySeries);
 CPPUNIT_TEST(testTdf81396);
+CPPUNIT_TEST(testPPTXChartErrorBars);
 CPPUNIT_TEST(testDOCXChartValuesSize);
 CPPUNIT_TEST(testPPTChartSeries);
 CPPUNIT_TEST(testPPTXChartSeries);
@@ -481,6 +483,19 @@ void Chart2ImportTest::testTdf81396()
 CPPUNIT_ASSERT_EQUAL(105.210801910481, aDataSeriesYValues[0][0]);
 }
 
+void Chart2ImportTest::testPPTXChartErrorBars()
+{
+load(u"/chart2/qa/extras/data/pptx/", "tdf127720.pptx");
+Reference xChartDoc(getChartDocFromDrawImpress(0, 
0), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+uno::Reference< chart::XChartDataArray > 
xDataArray(xChartDoc->getDataProvider(), UNO_QUERY_THROW);
+Sequence aColumnDesc = xDataArray->getColumnDescriptions();
+// Number of columns = 4 (Y-values, X-values and positive/negative error 
bars).
+// Without the fix there would only be 2 columns (no error range).
+CPPUNIT_ASSERT_EQUAL_MESSAGE("There must be 4 columns and descriptions", 
static_cast(4), aColumnDesc.getLength());
+}
+
 void Chart2ImportTest::testDOCXChartValuesSize()
 {
 load( u"/chart2/qa/extras/data/docx/", "bubblechart.docx" );
diff --git a/chart2/qa/extras/data/pptx/tdf127720.pptx 
b/chart2/qa/extras/data/pptx/tdf127720.pptx
new file mode 100644
index ..b10a4c5ab4ed
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127720.pptx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index ffbfebe10522..e1bf32b7ff10 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -568,7 +568,8 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, st
 }
 
 if (rRole == u"values-y" || rRole == u"values-first" || rRole == 
u"values-last" ||
-rRole == u"values-min" || rRole == u"values-max" || rRole == 
u"values-size")
+rRole == u"values-min" || rRole == u"values-max" || rRole == 
u"values-size" ||
+rRole == u"error-bars-y-positive" || rRole == u"error-bars-y-negative")
 {
 // Column values.  Append a new data column and populate it.
 


[Libreoffice-commits] core.git: chart2/qa chart2/source

2022-01-31 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import2.cxx|   48 ++
 chart2/qa/extras/data/ods/tdf146066.ods   |binary
 chart2/source/view/axes/VCoordinateSystem.cxx |   22 +++
 3 files changed, 69 insertions(+), 1 deletion(-)

New commits:
commit 81abc0d7657f194804681415a786627ab71475e3
Author: Tünde Tóth 
AuthorDate: Thu Jan 6 15:05:10 2022 +0100
Commit: László Németh 
CommitDate: Mon Jan 31 16:07:06 2022 +0100

tdf#146066 chart: fix automatic axis scaling at dates

Automatic scaling of the Y axis was incorrect
when the X axis was a date axis and the last
Y value was the highest value. To fix this,
increase maximum date value by one month/year.

Regression from commit ed2c880a691a0b179bbc92a8ce4ee49eac004035
(tdf#133005 Chart: fix ODF import of date axis position).

Change-Id: I0989ae8002e55f4ecfaf530ab845badb4409ecf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128209
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import2.cxx 
b/chart2/qa/extras/chart2import2.cxx
index f84254c30c2a..17b762824f43 100644
--- a/chart2/qa/extras/chart2import2.cxx
+++ b/chart2/qa/extras/chart2import2.cxx
@@ -58,6 +58,7 @@ public:
 void testTdfCustomShapePos();
 void testTdf121281();
 void testTdf139658();
+void testTdf146066();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest2);
 
@@ -97,6 +98,7 @@ public:
 CPPUNIT_TEST(testTdfCustomShapePos);
 CPPUNIT_TEST(testTdf121281);
 CPPUNIT_TEST(testTdf139658);
+CPPUNIT_TEST(testTdf146066);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -857,6 +859,52 @@ void Chart2ImportTest2::testTdf139658()
 CPPUNIT_ASSERT_EQUAL(OUString("category\"3"), aCategories[2]);
 }
 
+void Chart2ImportTest2::testTdf146066()
+{
+load(u"/chart2/qa/extras/data/ods/", "tdf146066.ods");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+   UNO_QUERY_THROW);
+uno::Reference xDrawPageSupplier(xChartDoc, 
uno::UNO_QUERY);
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+uno::Reference xYAxisShape = getShapeByName(
+xShapes, "CID/D=0:CS=0:Axis=1,0", // Y Axis
+// Axis occurs twice in chart xshape representation so need to get the 
one related to labels
+[](const uno::Reference& rXShape) -> bool {
+uno::Reference xAxisShapes(rXShape, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xAxisShapes.is());
+uno::Reference 
xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY);
+uno::Reference 
xShapeDescriptor(xChildShape,
+   
uno::UNO_QUERY_THROW);
+return (xShapeDescriptor->getShapeType() == 
"com.sun.star.drawing.TextShape");
+});
+CPPUNIT_ASSERT(xYAxisShape.is());
+
+// Check label count
+uno::Reference xIndexAccess(xYAxisShape, 
UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(static_cast(8), xIndexAccess->getCount());
+
+// Check text
+uno::Reference xLabel0(xIndexAccess->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("0"), xLabel0->getString());
+uno::Reference xLabel1(xIndexAccess->getByIndex(1), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("5"), xLabel1->getString());
+uno::Reference xLabel2(xIndexAccess->getByIndex(2), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("10"), xLabel2->getString());
+uno::Reference xLabel3(xIndexAccess->getByIndex(3), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("15"), xLabel3->getString());
+uno::Reference xLabel4(xIndexAccess->getByIndex(4), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("20"), xLabel4->getString());
+uno::Reference xLabel5(xIndexAccess->getByIndex(5), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("25"), xLabel5->getString());
+uno::Reference xLabel6(xIndexAccess->getByIndex(6), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("30"), xLabel6->getString());
+uno::Reference xLabel7(xIndexAccess->getByIndex(7), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("35"), xLabel7->getString());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/ods/tdf146066.ods 
b/chart2/qa/extras/data/ods/tdf146066.ods
new file mode 100644
index ..03abe9ae68ca
Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf146066.ods differ
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx 
b/chart2/source/view/axes/VCoordinateSystem.cxx
index f98f66502857..222383c8c7be 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include "VCartesianCoordinateSystem.hxx"
 #include 

[Libreoffice-commits] core.git: chart2/qa chart2/source sw/qa

2022-01-06 Thread Noel Grandin (via logerrit)
 
chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt
   |   96 +-
 chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_bar_chart.txt  
   |   64 +++---
 
chart2/qa/extras/chart2dump/reference/columnbarcharttest/normal_column_chart.txt
  |   80 
 
chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_bar_chart.txt
|   76 +++
 
chart2/qa/extras/chart2dump/reference/columnbarcharttest/percent_stacked_column_chart.txt
 |   76 +++
 chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_bar_chart.txt 
   |   76 +++
 
chart2/qa/extras/chart2dump/reference/columnbarcharttest/stacked_column_chart.txt
 |   80 
 chart2/source/view/charttypes/BarChart.cxx 
   |   11 -
 chart2/source/view/inc/ShapeFactory.hxx
   |3 
 chart2/source/view/main/ShapeFactory.cxx   
   |   11 -
 sw/qa/extras/layout/layout2.cxx
   |7 
 11 files changed, 298 insertions(+), 282 deletions(-)

New commits:
commit 302b44125aa0c1d5216f986ecf8e341cd6e57418
Author: Noel Grandin 
AuthorDate: Thu Dec 9 11:45:36 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 6 12:20:22 2022 +0100

use background XShapeGroup for bar-chart area

which means we don't have to set the Z-order, which is expensive for
large charts.
Shaves 5% off the load time

Change-Id: I8c73df6ddc17a3cfedaa18dbe8ec3aeb768e3e42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126607
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git 
a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt
 
b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt
index b3192a728377..f9ec3b65a2f8 100644
--- 
a/chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt
+++ 
b/chart2/qa/extras/chart2dump/reference/columnbarcharttest/column_chart_small_spacing.txt
@@ -7,17 +7,17 @@
 1
 // static_cast(aSeriesColumnOrBarFillColor)
 16711807
-/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2
+/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0
 // aColumnOrBarPosition.X
-13522
+3698
 // aColumnOrBarPosition.Y
-4147
+4414
 // aColumnOrBarSize.Height
-3202
+2935
 // aColumnOrBarSize.Width
-1169
+1170
 // aColumnOrBarTransformation
-1169;0;13522;0;3202;4147;0;0;1
+1170;0;3698;0;2935;4414;0;0;1
 /// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1
 // aColumnOrBarPosition.X
 8610
@@ -29,17 +29,17 @@
 1170
 // aColumnOrBarTransformation
 1170;0;8610;0;5403;1946;0;0;1
-/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0
+/// CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2
 // aColumnOrBarPosition.X
-3698
+13522
 // aColumnOrBarPosition.Y
-4414
+4147
 // aColumnOrBarSize.Height
-2935
+3202
 // aColumnOrBarSize.Width
-1170
+1169
 // aColumnOrBarTransformation
-1170;0;3698;0;2935;4414;0;0;1
+1169;0;13522;0;3202;4147;0;0;1
 /// Series 1 ColumnsOrBars
 // nColumnOrBarCountInSeries
 3
@@ -47,17 +47,17 @@
 4
 // static_cast(aSeriesColumnOrBarFillColor)
 10079487
-/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2
+/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0
 // aColumnOrBarPosition.X
-14691
+4868
 // aColumnOrBarPosition.Y
-3747
+5247
 // aColumnOrBarSize.Height
-3602
+2102
 // aColumnOrBarSize.Width
-1170
+1169
 // aColumnOrBarTransformation
-1170;0;14691;0;3602;3747;0;0;1
+1169;0;4868;0;2102;5247;0;0;1
 /// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=1
 // aColumnOrBarPosition.X
 9780
@@ -69,17 +69,17 @@
 1169
 // aColumnOrBarTransformation
 1169;0;9780;0;3002;4347;0;0;1
-/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=0
+/// CID/MultiClick/D=0:CS=0:CT=0:Series=1:Point=2
 // aColumnOrBarPosition.X
-4868
+14691
 // aColumnOrBarPosition.Y
-5247
+3747
 // aColumnOrBarSize.Height
-2102
+3602
 // aColumnOrBarSize.Width
-1169
+1170
 // aColumnOrBarTransformation
-1169;0;4868;0;2102;5247;0;0;1
+1170;0;14691;0;3602;3747;0;0;1
 /// Series 2 ColumnsOrBars
 // nColumnOrBarCountInSeries
 3
@@ -87,17 +87,17 @@
 3
 // static_cast(aSeriesColumnOrBarFillColor)
 10079487
-/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2
+/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0
 // aColumnOrBarPosition.X
-15861
+6037
 // aColumnOrBarPosition.Y
-5214
+6281
 // aColumnOrBarSize.Height
-2135
+1068
 // aColumnOrBarSize.Width
-1169
+1170
 // aColumnOrBarTransformation
-1169;0;15861;0;2135;5214;0;0;1
+1170;0;6037;0;1068;6281;0;0;1
 /// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=1
 // aColumnOrBarPosition.X
 10949
@@ -109,17 +109,17 @@
 1169
 // aColumnOrBarTransformation
 1169;0;10949;0;2935;4414;0;0;1
-/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=0
+/// CID/MultiClick/D=0:CS=0:CT=0:Series=2:Point=2
 // aColumnOrBarPosition.X
-6037
+15861
 // 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2021-10-29 Thread Mike Kaganski (via logerrit)
 chart2/qa/extras/PivotChartTest.cxx|5 
 chart2/qa/extras/chart2_trendcalculators.cxx   |   36 
+++--
 chart2/qa/extras/charttest.hxx |3 
 chart2/source/controller/accessibility/AccessibleChartElement.cxx  |7 -
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx  |   16 
+-
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx  |5 
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx|4 
 chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx |9 -
 chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx  |9 -
 chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx   |   11 -
 chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx  |   15 
+-
 chart2/source/controller/dialogs/DialogModel.cxx   |4 
 chart2/source/controller/dialogs/RangeSelectionHelper.cxx  |   30 
++--
 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx  |3 
 chart2/source/controller/dialogs/tp_DataSource.cxx |2 
 chart2/source/controller/dialogs/tp_RangeChooser.cxx   |4 
 chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx  |4 
 chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx |2 
 chart2/source/controller/main/ChartController.cxx  |   11 -
 chart2/source/controller/main/ChartController_Window.cxx   |9 -
 chart2/source/controller/main/CommandDispatchContainer.cxx |3 
 chart2/source/controller/main/ConfigurationAccess.cxx  |6 
 chart2/source/inc/CommonConverters.hxx |3 
 chart2/source/model/filter/XMLFilter.cxx   |   61 
+++-
 chart2/source/model/main/Axis.cxx  |3 
 chart2/source/model/main/ChartModel.cxx|3 
 chart2/source/model/main/ChartModel_Persistence.cxx|   26 
+--
 chart2/source/model/template/BubbleDataInterpreter.cxx |   16 
--
 chart2/source/model/template/ChartTypeTemplate.cxx |   15 
--
 chart2/source/model/template/ColumnChartType.cxx   |6 
 chart2/source/model/template/ColumnLineDataInterpreter.cxx |5 
 chart2/source/model/template/DataInterpreter.cxx   |7 -
 chart2/source/model/template/StockDataInterpreter.cxx  |   47 
+++---
 chart2/source/model/template/XYDataInterpreter.cxx |   11 -
 chart2/source/tools/CommonConverters.cxx   |   70 
++
 chart2/source/tools/DataSourceHelper.cxx   |   15 
--
 chart2/source/tools/DiagramHelper.cxx  |   18 
+-
 chart2/source/tools/ErrorBar.cxx   |3 
 chart2/source/tools/ExplicitCategoriesProvider.cxx |9 -
 chart2/source/tools/ExponentialRegressionCurveCalculator.cxx   |7 -
 chart2/source/tools/InternalData.cxx   |   10 -
 chart2/source/tools/InternalDataProvider.cxx   |   43 
+++---
 chart2/source/tools/LinearRegressionCurveCalculator.cxx|7 -
 chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx   |7 -
 chart2/source/tools/MeanValueRegressionCurveCalculator.cxx |7 -
 chart2/source/tools/MediaDescriptorHelper.cxx  |   10 -
 chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx |9 -
 chart2/source/tools/NameContainer.cxx  |   13 -
 chart2/source/tools/PotentialRegressionCurveCalculator.cxx |7 -
 chart2/source/tools/RangeHighlighter.cxx   |   18 
+-
 chart2/source/tools/RegressionCurveCalculator.cxx  |5 
 chart2/source/tools/RegressionCurveHelper.cxx  |3 
 chart2/source/tools/StatisticsHelper.cxx   |3 
 chart2/source/tools/TitleHelper.cxx|6 
 chart2/source/tools/UncachedDataSequence.cxx   |2 
 chart2/source/tools/WrappedPropertySet.cxx |9 -
 chart2/source/view/axes/Tickmarks.cxx  |   17 
+-
 chart2/source/view/axes/Tickmarks_Equidistant.cxx  |   18 
+-
 chart2/source/view/axes/VCartesianGrid.cxx |   41 
++---
 chart2/source/view/axes/VCoordinateSystem.cxx  |8 -
 chart2/source/view/axes/VPolarCoordinateSystem.cxx |9 -
 

[Libreoffice-commits] core.git: chart2/qa chart2/source compilerplugins/clang connectivity/source cppu/source cui/source dbaccess/source desktop/source framework/source i18nlangtag/source i18npool/sou

2021-10-03 Thread Stephan Bergmann (via logerrit)
 chart2/qa/extras/chart2dump/chart2dump.cxx   |4 
 chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx |2 
 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx  |2 
 compilerplugins/clang/stringview.cxx |   24 -
 compilerplugins/clang/test/stringview.cxx|6 +
 connectivity/source/drivers/firebird/PreparedStatement.cxx   |2 
 connectivity/source/parse/sqlnode.cxx|2 
 cppu/source/uno/lbenv.cxx|2 
 cui/source/dialogs/scriptdlg.cxx |4 
 dbaccess/source/ui/dlg/dbwizsetup.cxx|4 
 dbaccess/source/ui/dlg/directsql.cxx |   10 +-
 desktop/source/pkgchk/unopkg/unopkg_app.cxx  |6 -
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx   |   16 +--
 desktop/source/pkgchk/unopkg/unopkg_misc.cxx |4 
 framework/source/uielement/subtoolbarcontroller.cxx  |2 
 i18nlangtag/source/languagetag/languagetag.cxx   |2 
 i18npool/source/indexentry/indexentrysupplier.cxx|4 
 i18npool/source/localedata/LocaleNode.cxx|2 
 include/rtl/string.hxx   |   12 ++
 include/rtl/stringconcat.hxx |   42 +
 include/rtl/ustring.hxx  |   12 ++
 l10ntools/source/po.cxx  |2 
 linguistic/source/dicimp.cxx |2 
 oox/source/core/xmlfilterbase.cxx|4 
 oox/source/export/drawingml.cxx  |   12 +-
 oox/source/export/shapes.cxx |2 
 oox/source/ole/vbaexport.cxx |   12 +-
 sal/qa/rtl/strings/test_oustring_compare.cxx |4 
 sal/qa/rtl/textenc/rtl_textcvt.cxx   |   34 +++
 sc/qa/extras/macros-test.cxx |2 
 sc/source/filter/excel/xecontent.cxx |2 
 sc/source/filter/excel/xelink.cxx|2 
 sd/qa/unit/import-tests.cxx  |2 
 sd/source/core/drawdoc3.cxx  |2 
 sd/source/filter/eppt/pptx-epptooxml.cxx |   20 ++--
 sdext/source/presenter/PresenterHelpView.cxx |2 
 sfx2/source/appl/newhelp.cxx |2 
 sfx2/source/view/classificationhelper.cxx|2 
 shell/source/backends/desktopbe/desktopbackend.cxx   |2 
 stoc/source/implementationregistration/implreg.cxx   |   16 +--
 svl/source/misc/lockfilecommon.cxx   |2 
 svl/source/misc/msodocumentlockfile.cxx  |2 
 svl/source/numbers/zformat.cxx   |4 
 svtools/source/dialogs/PlaceEditDialog.cxx   |2 
 svtools/source/dialogs/ServerDetailsControls.cxx |2 
 svtools/source/svhtml/HtmlWriter.cxx |4 
 svx/source/gallery2/gallerybinaryengineentry.cxx |2 
 sw/qa/extras/globalfilter/globalfilter.cxx   |2 
 sw/qa/extras/uiwriter/uiwriter.cxx   |2 
 sw/source/core/crsr/crossrefbookmark.cxx |2 
 sw/source/core/edit/edfcol.cxx   |2 
 sw/source/filter/ascii/ascatr.cxx|2 
 sw/source/filter/html/css1atr.cxx|8 -
 sw/source/filter/html/htmlatr.cxx|   48 +--
 sw/source/filter/html/htmldrawwriter.cxx |2 
 sw/source/filter/html/htmlfldw.cxx   |4 
 sw/source/filter/html/htmlflywriter.cxx  |   24 ++---
 sw/source/filter/html/htmlforw.cxx   |8 -
 sw/source/filter/html/htmlftn.cxx|   10 +-
 sw/source/filter/html/htmlnumwriter.cxx  |4 
 sw/source/filter/html/htmlplug.cxx   |   16 +--
 sw/source/filter/html/htmltabw.cxx   |   42 -
 sw/source/filter/html/wrthtml.cxx|   18 ++--
 sw/source/filter/ww8/docxattributeoutput.cxx |   10 +-
 sw/source/filter/ww8/docxexport.cxx  |4 
 sw/source/filter/ww8/ww8par5.cxx |2 
 sw/source/ui/dbui/dbinsdlg.cxx   |2 
 sw/source/ui/dbui/mmaddressblockpage.cxx |2 
 sw/source/ui/index/cnttab.cxx|2 
 unoidl/source/unoidl-check.cxx   |4 
 

[Libreoffice-commits] core.git: chart2/qa chart2/source dbaccess/source include/oox offapi/com oox/source sc/inc sc/source sw/inc sw/source

2021-09-06 Thread Dennis Francis (via logerrit)
 chart2/qa/extras/chart2dump/chart2dump.cxx  |1 
 chart2/qa/extras/chart2dump/data/date-categories.pptx   |binary
 chart2/qa/extras/chart2dump/reference/axislabeltest/date-categories.txt |  180 
++
 chart2/qa/extras/chart2export2.cxx  |   39 
++
 chart2/qa/extras/chart2import.cxx   |   46 
+-
 chart2/qa/extras/charttest.hxx  |   37 
++
 chart2/source/inc/InternalDataProvider.hxx  |6 
 chart2/source/tools/InternalDataProvider.cxx|   20 
-
 chart2/source/view/axes/ScaleAutomatism.cxx |4 
 chart2/source/view/axes/VCoordinateSystem.cxx   |6 
 chart2/source/view/charttypes/AreaChart.cxx |4 
 dbaccess/source/core/inc/DatabaseDataProvider.hxx   |2 
 dbaccess/source/core/misc/DatabaseDataProvider.cxx  |2 
 include/oox/drawingml/chart/chartconverter.hxx  |3 
 include/oox/drawingml/chart/datasourcemodel.hxx |3 
 include/oox/export/chartexport.hxx  |1 
 offapi/com/sun/star/chart2/data/XDataProvider.idl   |   23 
+
 oox/source/drawingml/chart/chartconverter.cxx   |4 
 oox/source/drawingml/chart/datasourcecontext.cxx|   23 
-
 oox/source/drawingml/chart/datasourceconverter.cxx  |6 
 oox/source/drawingml/chart/datasourcemodel.cxx  |4 
 oox/source/export/chartexport.cxx   |   43 
++
 sc/inc/PivotTableDataProvider.hxx   |3 
 sc/inc/chart2uno.hxx|3 
 sc/source/filter/inc/excelchartconverter.hxx|3 
 sc/source/filter/oox/excelchartconverter.cxx|2 
 sc/source/ui/unoobj/PivotTableDataProvider.cxx  |3 
 sc/source/ui/unoobj/chart2uno.cxx   |3 
 sw/inc/unochart.hxx |2 
 sw/source/core/unocore/unochart.cxx |3 
 30 files changed, 412 insertions(+), 67 deletions(-)

New commits:
commit f547cf17a179ebd7de5c2b4dd2d00d0027a25429
Author: Dennis Francis 
AuthorDate: Thu Sep 2 14:33:55 2021 +0530
Commit: Miklos Vajna 
CommitDate: Mon Sep 6 08:47:50 2021 +0200

[API CHANGE] oox: fix import of chart date categories

Before this fix, date categories imported in oox's DataSourceContext were
stored as formatted strings according to number format code in 

under the  tree. As a result chart2 could not recognize them
as dates. This causes problems like:

* The axis that is linked to date categories cannot use the
  scaling/range-selection(min/max)/increments specs mentioned as axis
  properties. This results in distorted/unreadable chart renders w.r.t
  the date axis.

* No re-formatting is attempted as per the number format provided for axis.

This patch introduces a role qualifer argument to the XDataProvider
interface method createDataSequenceByValueArray to support categories of
date type via this method.

When exporting to oox, write date categories and format code under

  


This patch also fixes some discrepancies in date axis interval
computation (auto mode) found by already existing unit tests.

Change-Id: Ibc53b0a56fdddba80ba452d5567ce98d80460ea7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121525
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx 
b/chart2/qa/extras/chart2dump/chart2dump.cxx
index 28768ca68957..fc3944f494e3 100644
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -616,6 +616,7 @@ DECLARE_DUMP_TEST(AxisLabelTest, Chart2DumpTest, false)
 "formated_axis_labels.odp",
 "percent_stacked_column_chart.odp",
 "tdf118150.xlsx",
+"date-categories.pptx",
 };
 
 for (const OUString& sTestFile : aTestFiles)
diff --git a/chart2/qa/extras/chart2dump/data/date-categories.pptx 
b/chart2/qa/extras/chart2dump/data/date-categories.pptx
new file mode 100644
index ..b9e0c69f32b7
Binary files /dev/null and 
b/chart2/qa/extras/chart2dump/data/date-categories.pptx differ
diff --git 
a/chart2/qa/extras/chart2dump/reference/axislabeltest/date-categories.txt 
b/chart2/qa/extras/chart2dump/reference/axislabeltest/date-categories.txt
new file mode 100644
index ..a9274fd7838a
--- /dev/null
+++ 

[Libreoffice-commits] core.git: chart2/qa chart2/source include/oox include/xmloff offapi/com oox/inc oox/source schema/libreoffice xmloff/source

2021-09-01 Thread Dennis Francis (via logerrit)
 chart2/qa/extras/chart2export2.cxx  |  125 ++-
 chart2/qa/extras/data/xlsx/tdf143942.xlsx   |binary
 chart2/source/model/main/FormattedString.cxx|   34 +++
 chart2/source/model/main/FormattedString.hxx|6 
 chart2/source/view/charttypes/VSeriesPlotter.cxx|9 
 include/oox/export/chartexport.hxx  |   40 +++
 include/xmloff/xmltoken.hxx |2 
 offapi/com/sun/star/chart2/XDataPointCustomLabelField.idl   |   28 ++
 oox/inc/drawingml/chart/datasourcecontext.hxx   |1 
 oox/inc/drawingml/chart/seriesmodel.hxx |   15 +
 oox/source/drawingml/chart/datasourcecontext.cxx|   21 +
 oox/source/drawingml/chart/seriescontext.cxx|   55 
 oox/source/drawingml/chart/seriesconverter.cxx  |   30 ++
 oox/source/drawingml/chart/seriesmodel.cxx  |4 
 oox/source/export/chartexport.cxx   |  133 +++-
 oox/source/token/tokens.txt |3 
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |   12 +
 xmloff/source/chart/SchXMLExport.cxx|   64 -
 xmloff/source/chart/SchXMLPlotAreaContext.cxx   |   16 +
 xmloff/source/chart/SchXMLPlotAreaContext.hxx   |4 
 xmloff/source/chart/SchXMLSeries2Context.cxx|   21 +
 xmloff/source/chart/transporttypes.hxx  |   20 +
 xmloff/source/core/xmltoken.cxx |2 
 xmloff/source/token/tokens.txt  |2 
 24 files changed, 588 insertions(+), 59 deletions(-)

New commits:
commit 9d8324524bdcd1244cd6e9d93b063b981d47c9be
Author: Dennis Francis 
AuthorDate: Wed Aug 25 20:51:56 2021 +0530
Commit: Miklos Vajna 
CommitDate: Wed Sep 1 09:15:03 2021 +0200

tdf#143942: oox: import/export labels from 

When  boolean flag is present, the imported
label texts are added as the first text field in oox data label model.
The cell-range associated is also preserved. The export part preserves
the how labels were store originally in .

However in order to make the custom labels reflect the contents of the
cells in the associated cell-range, more work needs to be done. For this
the labels present in  needs to be made available
as a data-sequence with a new "role" like "point-labels" in
XInternalDataProvider implementation and and make the label renderer
read this data source rather than consulting the custom label fields
property which is static after import.

Change-Id: Ibc7045fa5ea209d463680c96efb49a06662d2500
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121313
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/chart2/qa/extras/chart2export2.cxx 
b/chart2/qa/extras/chart2export2.cxx
index adde208d620c..3a1afef91bd6 100644
--- a/chart2/qa/extras/chart2export2.cxx
+++ b/chart2/qa/extras/chart2export2.cxx
@@ -98,6 +98,7 @@ public:
 void testCustomShapeText();
 void testuserShapesXLSX();
 void testNameRangeXLSX();
+void testTdf143942();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest2);
 CPPUNIT_TEST(testSetSeriesToSecondaryAxisXLSX);
@@ -159,6 +160,7 @@ public:
 CPPUNIT_TEST(testCustomShapeText);
 CPPUNIT_TEST(testuserShapesXLSX);
 CPPUNIT_TEST(testNameRangeXLSX);
+CPPUNIT_TEST(testTdf143942);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -1334,22 +1336,60 @@ void Chart2ExportTest2::testTdf138204()
 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLbl/c:tx/c:rich/a:p/a:fld",
 "type", "CELLRANGE");
 
+assertXPath(
+pXmlDoc,
+
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[2]/c:dLbls/c:dLbl/c:tx/c:rich/a:p/a:fld",
+"type", "CELLRANGE");
+
 Reference xChartDoc = getChartDocFromSheet(0, 
mxComponent);
 CPPUNIT_ASSERT(xChartDoc.is());
 
-uno::Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 1));
-CPPUNIT_ASSERT(xDataSeries.is());
+struct CustomLabelsTestData
+{
+sal_Int32 nSeriesIdx;
+sal_Int32 nNumFields;
+// First field attributes.
+chart2::DataPointCustomLabelFieldType eFieldType;
+OUString aCellRange;
+OUString aString;
+};
+
+const CustomLabelsTestData aTestEntries[2] = {
+{
+// series id of c:ser[1] is 0.
+0, // nSeriesIdx
+1, // nNumFields
+
chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE,
+"Munka1!$F$9", // aCellRange
+"67,5%", // aString
+},
+{
+
+// series id of c:ser[2] is 1.
+1, // nSeriesIdx
+1, // nNumFields
+
chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE,
+

[Libreoffice-commits] core.git: chart2/qa chart2/source dbaccess/source include/formula oox/source sc/inc sc/qa sc/source svtools/source sw/source vcl/source xmloff/source

2021-06-30 Thread BaiXiaochun (via logerrit)
 chart2/qa/extras/charttest.hxx |5 -
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx  |5 -
 chart2/source/controller/dialogs/DataBrowser.cxx   |   13 --
 chart2/source/controller/dialogs/DataBrowserModel.cxx  |   10 --
 chart2/source/inc/CommonFunctors.hxx   |   10 +-
 chart2/source/tools/CommonConverters.cxx   |5 -
 chart2/source/tools/DiagramHelper.cxx  |6 -
 chart2/source/tools/ExplicitCategoriesProvider.cxx |7 -
 chart2/source/tools/ExponentialRegressionCurveCalculator.cxx   |   20 +---
 chart2/source/tools/InternalData.cxx   |   26 +
 chart2/source/tools/InternalDataProvider.cxx   |   12 --
 chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx   |   19 +--
 chart2/source/tools/MeanValueRegressionCurveCalculator.cxx |9 +
 chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx |8 -
 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx|   12 --
 chart2/source/tools/PotentialRegressionCurveCalculator.cxx |   20 +---
 chart2/source/tools/RegressionCurveCalculator.cxx  |6 -
 chart2/source/tools/Scaling.cxx|   32 ++
 chart2/source/tools/StatisticsHelper.cxx   |   35 ++-
 chart2/source/view/axes/DateScaling.cxx|6 -
 chart2/source/view/axes/MinimumAndMaximumSupplier.cxx  |   14 +-
 chart2/source/view/axes/ScaleAutomatism.cxx|4 
 chart2/source/view/axes/VCartesianAxis.cxx |8 -
 chart2/source/view/charttypes/AreaChart.cxx|   10 +-
 chart2/source/view/charttypes/BarChart.cxx |8 -
 chart2/source/view/charttypes/BubbleChart.cxx  |   10 +-
 chart2/source/view/charttypes/NetChart.cxx |   11 +-
 chart2/source/view/charttypes/PieChart.cxx |7 -
 chart2/source/view/charttypes/VSeriesPlotter.cxx   |   46 -
 chart2/source/view/main/VDataSeries.cxx|   49 
+++---
 dbaccess/source/core/misc/DatabaseDataProvider.cxx |6 -
 include/formula/errorcodes.hxx |4 
 oox/source/export/chartexport.cxx  |6 -
 sc/inc/PivotTableDataSequence.hxx  |9 -
 sc/qa/unit/ucalc.cxx   |4 
 sc/source/core/data/column2.cxx|   19 +--
 sc/source/core/data/dociter.cxx|7 -
 sc/source/core/data/dpobject.cxx   |   12 +-
 sc/source/core/data/dpoutput.cxx   |5 -
 sc/source/core/data/dpresfilter.cxx|9 -
 sc/source/core/data/dptabres.cxx   |6 -
 sc/source/core/opencl/formulagroupcl.cxx   |5 -
 sc/source/core/tool/formulagroup.cxx   |7 -
 sc/source/core/tool/interpr4.cxx   |4 
 sc/source/filter/oox/biffhelper.cxx|4 
 sc/source/filter/orcus/interface.cxx   |7 -
 sc/source/filter/xml/xmlcelli.cxx  |5 -
 sc/source/ui/miscdlgs/solveroptions.cxx|2 
 sc/source/ui/unoobj/PivotTableDataProvider.cxx |7 -
 sc/source/ui/unoobj/chart2uno.cxx  |   13 +-
 svtools/source/table/cellvalueconversion.cxx   |   14 +-
 sw/source/core/unocore/unotbl.cxx  |   11 --
 vcl/source/control/fmtfield.cxx|   10 --
 xmloff/source/chart/SchXMLExport.cxx   |7 -
 xmloff/source/chart/SchXMLTableContext.cxx |   13 --
 55 files changed, 252 insertions(+), 377 deletions(-)

New commits:
commit 7838efe4b703945ccde963f8506c8c7744e04e6e
Author: BaiXiaochun 
AuthorDate: Tue Jun 29 17:38:29 2021 +0200
Commit: Mike Kaganski 
CommitDate: Wed Jun 30 09:52:45 2021 +0200

Purge out rtl::math::setNan

Change-Id: If8794c105e279afd4437517d3e61f2f900eb6490
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118123
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index 0a7b00cc884e..9b162acc06e8 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -442,9 +442,6 @@ std::vector > 
getDataSeriesYValuesFromChartType( const Refer
 CPPUNIT_ASSERT(xDSCont.is());
 const Sequence > aDataSeriesSeq = 
xDSCont->getDataSeries();
 
-double fNan;
-rtl::math::setNan();
-
 std::vector > aRet;
 for 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2021-06-10 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx|   22 ++
 chart2/qa/extras/data/docx/tdf139658.docx|binary
 chart2/source/tools/InternalDataProvider.cxx |   12 ++--
 3 files changed, 32 insertions(+), 2 deletions(-)

New commits:
commit c9f071ff49bace0809d3a55d4d4b76a26d933f9c
Author: Tünde Tóth 
AuthorDate: Fri Jun 4 13:10:51 2021 +0200
Commit: László Németh 
CommitDate: Thu Jun 10 15:04:50 2021 +0200

tdf#139658 OOXML: fix broken chart import at labels with quotes

During the import of the internal data table, incomplete
parsing of category labels with escaped quotation marks
resulted broken category labels and charts.

Change-Id: If5af3d527b80d1e055562f589bdaf17096ad49f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116714
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 3a8b77f48cdd..0c142a4e7f97 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -174,6 +174,7 @@ public:
 void testTdf137874();
 void testTdfCustomShapePos();
 void testTdf121281();
+void testTdf139658();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -297,6 +298,7 @@ public:
 CPPUNIT_TEST(testTdf137874);
 CPPUNIT_TEST(testTdfCustomShapePos);
 CPPUNIT_TEST(testTdf121281);
+CPPUNIT_TEST(testTdf139658);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2895,6 +2897,26 @@ void Chart2ImportTest::testTdf121281()
 CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), aLabelPosition.Y);
 }
 
+void Chart2ImportTest::testTdf139658()
+{
+load(u"/chart2/qa/extras/data/docx/", "tdf139658.docx");
+uno::Reference xChartDoc(getChartDocFromWriter(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+Reference 
xInternalProvider(xChartDoc->getDataProvider(),
+   uno::UNO_QUERY);
+CPPUNIT_ASSERT(xInternalProvider.is());
+
+Reference xDescAccess(xInternalProvider, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDescAccess.is());
+
+// Get the category labels.
+Sequence aCategories = xDescAccess->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aCategories.getLength());
+CPPUNIT_ASSERT_EQUAL(OUString("category1"), aCategories[0]);
+CPPUNIT_ASSERT_EQUAL(OUString("\"category2\""), aCategories[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("category\"3"), aCategories[2]);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/tdf139658.docx 
b/chart2/qa/extras/data/docx/tdf139658.docx
new file mode 100644
index ..59deda9f83f9
Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf139658.docx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index 1b2f6ae28351..9595cf2375d7 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -518,7 +518,14 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, st
 bool bInQuote = false;
 for (; p != pEnd; ++p)
 {
-if (*p == '"')
+// Skip next "" within the title text: it's an escaped double 
quotation mark.
+if (bInQuote && *p == '"' && *(p + 1) == '"')
+{
+if (!pElem)
+pElem = p;
+++p;
+}
+else if (*p == '"')
 {
 bInQuote = !bInQuote;
 if (bInQuote)
@@ -534,7 +541,8 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, st
 // Non empty string
 if (!aElem.isEmpty())
 bAllNumeric = false;
-aRawElems.push_back(aElem);
+// Restore also escaped double quotation marks
+aRawElems.push_back(aElem.replaceAll("\"\"", "\""));
 pElem = nullptr;
 aElem.clear();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source chart2/uiconfig include/xmloff offapi/com offapi/UnoApi_offapi.mk xmloff/source

2021-02-21 Thread Samuel Mehrbrodt (via logerrit)
 chart2/qa/extras/chart2_trendcalculators.cxx |   
12 -
 chart2/source/controller/dialogs/ObjectNameProvider.cxx  |
5 
 chart2/source/controller/dialogs/res_Trendline.cxx   |   
32 +++
 chart2/source/controller/dialogs/res_Trendline.hxx   |
2 
 chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx |   
13 +
 chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx  |   
14 +
 chart2/source/inc/LinearRegressionCurveCalculator.hxx|
3 
 chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx |
4 
 chart2/source/inc/RegressionCurveCalculator.hxx  |
4 
 chart2/source/inc/chartview/ChartSfxItemIds.hxx  |
3 
 chart2/source/tools/LinearRegressionCurveCalculator.cxx  |
6 
 chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx   |   
55 -
 chart2/source/tools/RegressionCurveCalculator.cxx|
4 
 chart2/source/tools/RegressionCurveModel.cxx |
9 
 chart2/source/view/charttypes/VSeriesPlotter.cxx |
8 
 chart2/source/view/main/ChartItemPool.cxx|
2 
 chart2/uiconfig/ui/tp_Trendline.ui   |   
95 +++---
 include/xmloff/xmltoken.hxx  |
3 
 offapi/UnoApi_offapi.mk  |
1 
 offapi/com/sun/star/chart2/MovingAverageType.idl |   
35 +++
 offapi/com/sun/star/chart2/RegressionCurve.idl   |
2 
 offapi/com/sun/star/chart2/XRegressionCurveCalculator.idl|
7 
 xmloff/source/chart/PropertyMap.hxx  |
5 
 xmloff/source/chart/PropertyMaps.cxx |   
29 +++
 xmloff/source/core/xmltoken.cxx  |
3 
 xmloff/source/token/tokens.txt   |
3 
 26 files changed, 305 insertions(+), 54 deletions(-)

New commits:
commit 4141533a3fb984fbaefe87b15fceeda7f2082061
Author: Samuel Mehrbrodt 
AuthorDate: Thu Feb 11 07:53:15 2021 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Feb 22 07:36:21 2021 +0100

[API CHANGE] tdf#133423 Implement chart:regression-moving-type

Change-Id: Icb967367fbf12e5a1566b7f18ebe5e3d8a3534f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110748
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
Reviewed-by: Samuel Mehrbrodt 

diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx 
b/chart2/qa/extras/chart2_trendcalculators.cxx
index b8eb367524bb..1eeea5d12e23 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -110,7 +110,7 @@ void Chart2TrendCalculators::checkCalculator(
 void Chart2TrendCalculators::testPotentialRegression1()
 {
 loadCalculatorFromSheet( SHEET_POTENTIAL1 );
-m_xRegressionCurveCalculator->setRegressionProperties( 0, false, 0, 0 );
+m_xRegressionCurveCalculator->setRegressionProperties( 0, false, 0, 0, 0 );
 Sequence< double > xValues( 7 );
 Sequence< double > yValues( 7 );
 for (int i=0; i<7; i++)
@@ -126,7 +126,7 @@ void Chart2TrendCalculators::testPotentialRegression1()
 void Chart2TrendCalculators::testPotentialRegression2()
 {
 loadCalculatorFromSheet( SHEET_POTENTIAL2 );
-m_xRegressionCurveCalculator->setRegressionProperties( 0, false, 0, 0 );
+m_xRegressionCurveCalculator->setRegressionProperties( 0, false, 0, 0, 0 );
 Sequence< double > xValues( 7 );
 Sequence< double > yValues( 7 );
 for (int i=0; i<7; i++)
@@ -142,7 +142,7 @@ void Chart2TrendCalculators::testPotentialRegression2()
 void Chart2TrendCalculators::testLinearRegression1()
 {
 loadCalculatorFromSheet( SHEET_LINEAR1 );
-m_xRegressionCurveCalculator->setRegressionProperties( 1, false, 0, 0 );
+m_xRegressionCurveCalculator->setRegressionProperties( 1, false, 0, 0, 0 );
 Sequence< double > xValues( 7 );
 Sequence< double > yValues( 7 );
 for (int i=0; i<7; i++)
@@ -158,7 +158,7 @@ void Chart2TrendCalculators::testLinearRegression1()
 void Chart2TrendCalculators::testPolynomialRegression1()
 {
 loadCalculatorFromSheet( SHEET_POLYNOMIAL1 );
-m_xRegressionCurveCalculator->setRegressionProperties( 2, false, 0, 0 );
+m_xRegressionCurveCalculator->setRegressionProperties( 2, false, 0, 0, 0 );
 Sequence< double > xValues( 7 );
 Sequence< double > yValues( 7 );
 for (int i=0; i<7; i++)
@@ -174,7 +174,7 @@ void Chart2TrendCalculators::testPolynomialRegression1()
 void Chart2TrendCalculators::testExponentialRegression1()
 {
 loadCalculatorFromSheet( SHEET_EXPONENTIAL1 );
-

[Libreoffice-commits] core.git: chart2/qa chart2/source chart2/uiconfig include/xmloff offapi/com oox/source sc/source xmloff/source

2021-02-07 Thread Samuel Mehrbrodt (via logerrit)
 chart2/qa/extras/chart2export.cxx |   
34 +++
 chart2/qa/extras/data/ods/ser_labels.ods  
|binary
 chart2/qa/extras/data/xlsx/ser_labels.xlsx
|binary
 chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx |
6 +
 chart2/source/controller/dialogs/res_DataLabel.cxx|   
16 ++-
 chart2/source/controller/dialogs/res_DataLabel.hxx|
1 
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx|
8 +
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx|
8 +
 chart2/source/controller/main/ChartController_Tools.cxx   |
1 
 chart2/source/inc/chartview/ChartSfxItemIds.hxx   |
3 
 chart2/source/model/main/DataPointProperties.cxx  |
3 
 chart2/source/tools/DataSeriesHelper.cxx  |   
13 ++
 chart2/source/view/charttypes/VSeriesPlotter.cxx  |   
15 ++-
 chart2/source/view/main/ChartItemPool.cxx |
1 
 chart2/source/view/main/VDataSeries.cxx   |
2 
 chart2/uiconfig/ui/dlg_DataLabel.ui   |   
44 +++---
 chart2/uiconfig/ui/tp_DataLabel.ui|   
44 +++---
 include/xmloff/xmltoken.hxx   |
1 
 offapi/com/sun/star/chart/ChartDataCaption.idl|
6 +
 offapi/com/sun/star/chart2/DataPointLabel.idl |
6 +
 oox/source/drawingml/chart/seriesconverter.cxx|
3 
 oox/source/export/chartexport.cxx |
2 
 sc/source/filter/excel/xichart.cxx|
2 
 xmloff/source/chart/PropertyMap.hxx   |
2 
 xmloff/source/chart/PropertyMaps.cxx  |   
14 +++
 xmloff/source/core/xmltoken.cxx   |
1 
 xmloff/source/token/tokens.txt|
1 
 27 files changed, 194 insertions(+), 43 deletions(-)

New commits:
commit b99f310d3b24dc45e3d84751e810c0bbff1d991b
Author: Samuel Mehrbrodt 
AuthorDate: Wed Feb 3 08:01:55 2021 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Feb 8 07:52:27 2021 +0100

tdf#94235 Add support for series name in data series labels

including ODF/OOXML import/export (and test)

Change-Id: Id5a5194630a67476f7c5390294400a00ea3ad42d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110338
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index a702d5113b13..c8b4c03755e7 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -140,6 +140,7 @@ public:
 void testAxisCrossBetweenDOCX();
 void testPieChartDataPointExplosionXLSX();
 void testCustomDataLabel();
+void testDataSeriesName();
 void testCustomPositionofDataLabel();
 void testCustomDataLabelMultipleSeries();
 void testLeaderLines();
@@ -288,6 +289,7 @@ public:
 CPPUNIT_TEST(testAxisCrossBetweenDOCX);
 CPPUNIT_TEST(testPieChartDataPointExplosionXLSX);
 CPPUNIT_TEST(testCustomDataLabel);
+CPPUNIT_TEST(testDataSeriesName);
 CPPUNIT_TEST(testCustomPositionofDataLabel);
 CPPUNIT_TEST(testCustomDataLabelMultipleSeries);
 CPPUNIT_TEST(testLeaderLines);
@@ -2310,6 +2312,38 @@ void Chart2ExportTest::testCustomDataLabel()
 CPPUNIT_ASSERT_EQUAL(OUString(" getString());
 }
 
+/// Test for tdf#94235
+void Chart2ExportTest::testDataSeriesName()
+{
+// ODF
+{
+load(u"/chart2/qa/extras/data/ods/", "ser_labels.ods");
+reload("calc8");
+uno::Reference xChartDoc = 
getChartDocFromSheet(0, mxComponent);
+uno::Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+CPPUNIT_ASSERT(xDataSeries.is());
+uno::Reference xPropertySet;
+chart2::DataPointLabel aDataPointLabel;
+xPropertySet.set(xDataSeries->getDataPointByIndex(0), 
uno::UNO_SET_THROW);
+xPropertySet->getPropertyValue("Label") >>= aDataPointLabel;
+CPPUNIT_ASSERT_EQUAL(sal_True, aDataPointLabel.ShowSeriesName);
+}
+
+// OOXML
+{
+load(u"/chart2/qa/extras/data/xlsx/", "ser_labels.xlsx");
+reload("Calc Office Open XML");
+uno::Reference xChartDoc = 
getChartDocFromSheet(0, mxComponent);
+uno::Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+CPPUNIT_ASSERT(xDataSeries.is());
+uno::Reference xPropertySet;
+chart2::DataPointLabel aDataPointLabel;
+

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-12-28 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx|   21 +++
 chart2/qa/extras/data/xlsx/incorrect_label_position.xlsx |binary
 chart2/source/view/charttypes/PieChart.cxx   |  101 +--
 chart2/source/view/inc/VSeriesPlotter.hxx|2 
 4 files changed, 87 insertions(+), 37 deletions(-)

New commits:
commit f22b77f204e433004aeb5fc2885881c03a62aa70
Author: Tünde Tóth 
AuthorDate: Wed Dec 16 11:29:48 2020 +0100
Commit: László Németh 
CommitDate: Mon Dec 28 11:55:40 2020 +0100

tdf#121281 pie chart: improve data label position

to avoid chart distortion.

Move the data label to inside the chart area when it
goes outside the border.

Change-Id: I78669ed601f28129944ac8f61c6478d386322b76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107829
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 9bb042fb6867..943cbd57ea99 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -171,6 +171,7 @@ public:
 void testTdf137734();
 void testTdf137874();
 void testTdfCustomShapePos();
+void testTdf121281();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -291,6 +292,7 @@ public:
 CPPUNIT_TEST(testTdf137734);
 CPPUNIT_TEST(testTdf137874);
 CPPUNIT_TEST(testTdfCustomShapePos);
+CPPUNIT_TEST(testTdf121281);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2802,6 +2804,25 @@ void Chart2ImportTest::testTdfCustomShapePos()
 }
 }
 
+void Chart2ImportTest::testTdf121281()
+{
+load("/chart2/qa/extras/data/xlsx/", "incorrect_label_position.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+   UNO_QUERY_THROW);
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xDataPointLabel(
+getShapeByName(xShapes,
+   
"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"),
+UNO_SET_THROW);
+
+CPPUNIT_ASSERT(xDataPointLabel.is());
+awt::Point aLabelPosition = xDataPointLabel->getPosition();
+// This failed, if the data label flowed out of the chart area.
+CPPUNIT_ASSERT_GREATEREQUAL(static_cast(0), aLabelPosition.Y);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/incorrect_label_position.xlsx 
b/chart2/qa/extras/data/xlsx/incorrect_label_position.xlsx
new file mode 100644
index ..4f133b558116
Binary files /dev/null and 
b/chart2/qa/extras/data/xlsx/incorrect_label_position.xlsx differ
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 3b61cb9c46e3..e77a7964ee71 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -468,49 +468,78 @@ void PieChart::createTextLabelShape(
 }
 
 bool bShowLeaderLine = rSeries.getPropertiesOfSeries()
-
->getPropertyValue("ShowCustomLeaderLines")
-.get();
-if (m_bPieLabelsAllowToMove && rSeries.isLabelCustomPos(nPointIndex) && 
bShowLeaderLine)
+   ->getPropertyValue("ShowCustomLeaderLines")
+   .get();
+if (m_bPieLabelsAllowToMove)
 {
-sal_Int32 nX1 = aPieLabelInfo.aOuterPosition.getX();
-sal_Int32 nY1 = aPieLabelInfo.aOuterPosition.getY();
-sal_Int32 nX2 = nX1;
-sal_Int32 nY2 = nY1;
 ::basegfx::B2IRectangle 
aRect(lcl_getRect(aPieLabelInfo.xLabelGroupShape));
-if (nX1 < aRect.getMinX())
-nX2 = aRect.getMinX();
-else if (nX1 > aRect.getMaxX())
-nX2 = aRect.getMaxX();
-
-if (nY1 < aRect.getMinY())
-nY2 = aRect.getMinY();
-else if (nY1 > aRect.getMaxY())
-nY2 = aRect.getMaxY();
+sal_Int32 nPageWidth = m_aPageReferenceSize.Width;
+sal_Int32 nPageHeight = m_aPageReferenceSize.Height;
+
+// the data label should be inside the chart area
+awt::Point aShapePos = aPieLabelInfo.xLabelGroupShape->getPosition();
+if (aRect.getMinX() < 0)
+aPieLabelInfo.xLabelGroupShape->setPosition(
+awt::Point(aShapePos.X - aRect.getMinX(), aShapePos.Y));
+if (aRect.getMinY() < 0)
+aPieLabelInfo.xLabelGroupShape->setPosition(
+awt::Point(aShapePos.X, aShapePos.Y - aRect.getMinY()));
+if (aRect.getMaxX() > nPageWidth)
+aPieLabelInfo.xLabelGroupShape->setPosition(
+awt::Point(aShapePos.X - (aRect.getMaxX() - nPageWidth), 

[Libreoffice-commits] core.git: chart2/qa chart2/source sw/qa

2020-12-16 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx |8 ++---
 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml |   12 +++-
 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml |6 +---
 chart2/qa/extras/xshape/data/reference/tdf90839-4.xml |   10 +++
 chart2/source/view/charttypes/PieChart.cxx|   25 +++---
 sw/qa/extras/layout/data/outside_long_data_label.docx |binary
 sw/qa/extras/layout/layout2.cxx   |   18 
 7 files changed, 44 insertions(+), 35 deletions(-)

New commits:
commit b0068342398786ca50304260434a18880dddf74d
Author: Tünde Tóth 
AuthorDate: Fri Dec 11 09:13:46 2020 +0100
Commit: László Németh 
CommitDate: Wed Dec 16 18:26:26 2020 +0100

tdf#138777 pie chart: improve long data label width

to avoid chart distortion.

Reduce the maximum text width of data point label shape based,
because in some cases the long data label flowed out of the chart.

Change-Id: I045c81ecc6ce579e1f472d7ea67e04315ce9c60b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107585
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index e4742405d967..9bb042fb6867 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -2581,8 +2581,8 @@ void Chart2ImportTest::testTdf133376()
 CPPUNIT_ASSERT(xDataPointLabel.is());
 // Check the position of the 3rd data point label, which is out from the 
pie slice
 awt::Point aLabelPosition = xDataPointLabel->getPosition();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(458, aLabelPosition.X, 30);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(5114, aLabelPosition.Y, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1082, aLabelPosition.X, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(5462, aLabelPosition.Y, 30);
 }
 
 void Chart2ImportTest::testTdf134225()
@@ -2652,8 +2652,8 @@ void Chart2ImportTest::testTdf136105()
 CPPUNIT_ASSERT(xDataPointLabel.is());
 // Check the position of the 1st data point label, which is out from 
the pie slice
 awt::Point aLabelPosition = xDataPointLabel->getPosition();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(8610, aLabelPosition.X, 500);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(1684, aLabelPosition.Y, 500);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(7978, aLabelPosition.X, 500);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1048, aLabelPosition.Y, 500);
 }
 }
 
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
index c8afb487a4ae..d7e5c4a364f9 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
@@ -206,7 +206,7 @@


 
- 
+ 
   
   
   
@@ -229,7 +229,7 @@


 
- 
+ 
   
   
   
@@ -252,7 +252,7 @@


 
- 
+ 
   
   
   
@@ -275,7 +275,7 @@


 
- 
+ 
   
   
   
@@ -331,6 +331,4 @@

   
  
-
-
-
+
\ No newline at end of file
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
index 7b67bd226da6..77a1ac06f80a 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
@@ -183,7 +183,7 @@
   

 
- 
+ 
   
   
   
@@ -331,6 +331,4 @@

   
  
-
-
-
+
\ No newline at end of file
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
index 7fabc697c751..6b182821f1c9 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
@@ -183,7 +183,7 @@
   

 
- 
+ 
   
   
   
@@ -206,7 +206,7 @@


 
- 
+ 
   
   
   
@@ -229,7 +229,7 @@


 
- 
+ 
   
   
   
@@ -252,7 +252,7 @@


 
- 
+ 
   
   
   
@@ -275,7 +275,7 @@


 
- 
+ 
   
   
   
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 

[Libreoffice-commits] core.git: chart2/qa chart2/source oox/source

2020-11-24 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2dump/chart2dump.cxx   |   23 
 chart2/qa/extras/chart2export.cxx|   29 ++-
 chart2/qa/extras/chart2import.cxx|   26 -
 chart2/qa/extras/charttest.hxx   |   26 +
 chart2/qa/extras/data/xlsx/piechart_deleted_legendentry.xlsx |binary
 chart2/source/view/charttypes/VSeriesPlotter.cxx |   19 ++-
 oox/source/drawingml/chart/titleconverter.cxx|9 +++
 oox/source/export/chartexport.cxx|9 +++
 8 files changed, 86 insertions(+), 55 deletions(-)

New commits:
commit 3be5e428d669accd841949662d601a6f6e1cdb3f
Author: Tünde Tóth 
AuthorDate: Mon Nov 16 15:12:43 2020 +0100
Commit: László Németh 
CommitDate: Tue Nov 24 10:34:19 2020 +0100

tdf#138181 Chart OOXML: fix deleted legend entries of pie charts

The legend of the pie chart showed deleted legend entries too
when VaryColorsByPoint was false.

Change-Id: I6fc978af0db6e2d39d7f451e765d7ef81c73a05c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105943
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx 
b/chart2/qa/extras/chart2dump/chart2dump.cxx
index 544eec6b5373..7fd7c4a8da61 100644
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -252,28 +251,6 @@ protected:
 OUString::number(rTransform.Line3.Column1) + ";" + 
OUString::number(rTransform.Line3.Column2) + ";" + 
OUString::number(rTransform.Line3.Column3);
 }
 
-uno::Reference getShapeByName(const 
uno::Reference& rShapes, const OUString& rName, bool 
(*pCondition)(const uno::Reference&) = nullptr)
-{
-for (sal_Int32 i = 0; i < rShapes->getCount(); ++i)
-{
-uno::Reference xShapes(rShapes->getByIndex(i), 
uno::UNO_QUERY);
-if (xShapes.is())
-{
-uno::Reference xRet = getShapeByName(xShapes, 
rName, pCondition);
-if (xRet.is())
-return xRet;
-}
-uno::Reference 
xNamedShape(rShapes->getByIndex(i), uno::UNO_QUERY);
-if (xNamedShape->getName() == rName)
-{
-uno::Reference xShape(xNamedShape, 
uno::UNO_QUERY);
-if (pCondition == nullptr || (*pCondition)(xShape))
-return xShape;
-}
-}
-return uno::Reference();
-}
-
 private:
 OUString m_sTestFileName;
 bool m_bDumpMode;
diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 9637aebd4e53..a39b36234862 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -183,6 +183,7 @@ public:
 void testDataLabelPlacementPieChart();
 void testTdf137917();
 void testTdf138204();
+void testTdf138181();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest);
 CPPUNIT_TEST(testErrorBarXLSX);
@@ -328,6 +329,7 @@ public:
 CPPUNIT_TEST(testDataLabelPlacementPieChart);
 CPPUNIT_TEST(testTdf137917);
 CPPUNIT_TEST(testTdf138204);
+CPPUNIT_TEST(testTdf138181);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2970,7 +2972,6 @@ void Chart2ExportTest::testDataLabelPlacementPieChart()
 sal_Int32 nLabelPlacement = 0;
 CPPUNIT_ASSERT(aAny >>= nLabelPlacement);
 CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::OUTSIDE, nLabelPlacement);
-
 }
 
 void Chart2ExportTest::testTdf137917()
@@ -3011,6 +3012,32 @@ void Chart2ExportTest::testTdf138204()
 //CPPUNIT_ASSERT_EQUAL(OUString("67.5%"), aFields[0]->getString()); TODO: 
Not implemented yet
 }
 
+void Chart2ExportTest::testTdf138181()
+{
+load("/chart2/qa/extras/data/xlsx/", "piechart_deleted_legendentry.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+   UNO_QUERY_THROW);
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xLegendEntry1, xLegendEntry2, xLegendEntry3;
+
+// first legend entry is visible
+xLegendEntry1
+= getShapeByName(xShapes, 
"CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0:LegendEntry=0");
+CPPUNIT_ASSERT(xLegendEntry1.is());
+
+// second legend entry is not visible
+xLegendEntry2
+= getShapeByName(xShapes, 
"CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=1:LegendEntry=0");
+CPPUNIT_ASSERT(!xLegendEntry2.is());
+
+// third legend entry is visible
+xLegendEntry3
+= getShapeByName(xShapes, 
"CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=2:LegendEntry=0");
+

[Libreoffice-commits] core.git: chart2/qa chart2/source offapi/com oox/source

2020-11-17 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx|   27 +++
 chart2/qa/extras/data/xlsx/tdf138204.xlsx|binary
 chart2/source/view/charttypes/VSeriesPlotter.cxx |1 
 offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl |3 -
 oox/source/drawingml/chart/seriesconverter.cxx   |2 
 oox/source/export/chartexport.cxx|3 +
 6 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 4930749294475cc28afd06cd11fdf56a157ad9ce
Author: Balazs Varga 
AuthorDate: Mon Nov 16 14:44:45 2020 +0100
Commit: László Németh 
CommitDate: Tue Nov 17 11:10:09 2020 +0100

tdf#138204 Chart OOXML Import: doesn't show placeholder

for CELLRANGE data label field type. Add CELLRANGE to enum
com::sun::star::chart2::DataPointCustomLabelFieldType, like
we do at CELLREF, while both of them are not implemented, see
commit 790f9abeb1a1167ad5ab84c5fb855b36669c125b
(tdf#114821 import complex data labels in bar chart).

Regression from commit: 0d2340998415fb4b2f794054c62ef61c83e32155
(tdf#136061 Chart ODF/OOXML: fix missing custom labels)

Change-Id: I8e0f4ca9db6e613a190cbda31504a7542fc13a86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105934
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 73f9166d176c..9637aebd4e53 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -182,6 +182,7 @@ public:
 void testTdf136267();
 void testDataLabelPlacementPieChart();
 void testTdf137917();
+void testTdf138204();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest);
 CPPUNIT_TEST(testErrorBarXLSX);
@@ -326,6 +327,7 @@ public:
 CPPUNIT_TEST(testTdf136267);
 CPPUNIT_TEST(testDataLabelPlacementPieChart);
 CPPUNIT_TEST(testTdf137917);
+CPPUNIT_TEST(testTdf138204);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2984,6 +2986,31 @@ void Chart2ExportTest::testTdf137917()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:dateAx/c:minorTimeUnit", "val", "days");
 }
 
+void Chart2ExportTest::testTdf138204()
+{
+load("/chart2/qa/extras/data/xlsx/", "tdf138204.xlsx");
+xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
+CPPUNIT_ASSERT(pXmlDoc);
+
+// Check the first data label field type
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:dLbls/c:dLbl/c:tx/c:rich/a:p/a:fld",
 "type", "CELLRANGE");
+
+Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, 
mxComponent);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+uno::Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 1));
+CPPUNIT_ASSERT(xDataSeries.is());
+
+uno::Reference xPropertySet;
+uno::Sequence> aFields;
+xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
+xPropertySet->getPropertyValue("CustomLabelFields") >>= aFields;
+CPPUNIT_ASSERT_EQUAL(static_cast(1), aFields.getLength());
+
+
CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE,
 aFields[0]->getFieldType());
+//CPPUNIT_ASSERT_EQUAL(OUString("67.5%"), aFields[0]->getString()); TODO: 
Not implemented yet
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/tdf138204.xlsx 
b/chart2/qa/extras/data/xlsx/tdf138204.xlsx
new file mode 100644
index ..04c2e50d799c
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf138204.xlsx differ
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index b502efd83fe5..132903ba4d30 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -542,6 +542,7 @@ uno::Reference< drawing::XShape > 
VSeriesPlotter::createDataLabel( const uno::Re
 break;
 }
 case DataPointCustomLabelFieldType_CELLREF:
+case DataPointCustomLabelFieldType_CELLRANGE:
 {
 // TODO: for now doesn't show placeholder
 aTextList[i] = OUString();
diff --git a/offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl 
b/offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl
index 05c26a738684..f5ea79ca68d5 100644
--- a/offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl
+++ b/offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl
@@ -24,7 +24,8 @@ enum DataPointCustomLabelFieldType
 CATEGORYNAME,
 CELLREF,
 NEWLINE,
-PERCENTAGE
+PERCENTAGE,
+CELLRANGE
 };
 
 }; }; }; };
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx 
b/oox/source/drawingml/chart/seriesconverter.cxx
index 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-11-12 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx|   16 
 chart2/qa/extras/data/xlsx/piechart_legend.xlsx  |binary
 chart2/source/view/charttypes/VSeriesPlotter.cxx |4 +++-
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit d23aed9a1fbb6549ca3b8a3e2ab5d779c84e3fb5
Author: Tünde Tóth 
AuthorDate: Mon Nov 2 10:28:51 2020 +0100
Commit: László Németh 
CommitDate: Thu Nov 12 13:58:17 2020 +0100

tdf#137874 Chart OOXML import: fix pie chart legend entries

Pie chart legend changed when VaryColorsByPoint was false.

Change-Id: I8022e5290f2269a902b4417f91d2e454f088c553
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105172
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 62f9b85c1d76..883d50ca88d9 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -171,6 +171,7 @@ public:
 void testTdf136752();
 void testTdf137505();
 void testTdf137734();
+void testTdf137874();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -288,6 +289,7 @@ public:
 CPPUNIT_TEST(testTdf136752);
 CPPUNIT_TEST(testTdf137505);
 CPPUNIT_TEST(testTdf137734);
+CPPUNIT_TEST(testTdf137874);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2753,6 +2755,20 @@ void Chart2ImportTest::testTdf137734()
 CPPUNIT_ASSERT_EQUAL(0.0, nRotation);
 }
 
+void Chart2ImportTest::testTdf137874()
+{
+load("/chart2/qa/extras/data/xlsx/", "piechart_legend.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+   UNO_QUERY_THROW);
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xLegendEntry;
+xLegendEntry
+= getShapeByName(xShapes, 
"CID/MultiClick/D=0:CS=0:CT=0:Series=0:Point=0:LegendEntry=0");
+CPPUNIT_ASSERT(xLegendEntry.is());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/piechart_legend.xlsx 
b/chart2/qa/extras/data/xlsx/piechart_legend.xlsx
new file mode 100644
index ..baea1de9b0b9
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/piechart_legend.xlsx 
differ
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index d40d52e7bc7a..b502efd83fe5 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -2668,7 +2668,9 @@ std::vector< ViewLegendEntry > 
VSeriesPlotter::createLegendEntriesForSeries(
 ViewLegendEntry aEntry;
 OUString aLabelText;
 bool bVaryColorsByPoint = rSeries.isVaryColorsByPoint();
-if( bVaryColorsByPoint )
+if (bVaryColorsByPoint
+|| m_xChartTypeModel->getChartType().equalsIgnoreAsciiCase(
+CHART2_SERVICE_NAME_CHARTTYPE_PIE))
 {
 Sequence< OUString > aCategoryNames;
 if( m_pExplicitCategoriesProvider )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-10-26 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx |   24 ++
 chart2/qa/extras/data/xlsx/tdf137505.xlsx |binary
 chart2/qa/extras/xshape/data/reference/tdf90839-1.xml |   18 ++---
 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml |   18 ++---
 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml |   18 ++---
 chart2/qa/extras/xshape/data/reference/tdf90839-4.xml |   18 ++---
 chart2/source/view/main/DrawModelWrapper.cxx  |1 
 7 files changed, 61 insertions(+), 36 deletions(-)

New commits:
commit 0f0a5b63b19196f9463149a0a1991704c940efe2
Author: Balazs Varga 
AuthorDate: Fri Oct 16 13:45:20 2020 +0200
Commit: László Németh 
CommitDate: Mon Oct 26 09:15:00 2020 +0100

tdf#137505 OOXML Import: Custom shape in chart: fix font size

The default font size of text in shapes is 12pt in LibreOffice,
nevertheless, we used 24 pt for font size in custom shapes inside
chart objects during ooxml import.

Change-Id: I69d02374bc4b4781e2ca617913c642999b3d5fa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104429
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: Bartosz Kosiorek 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index ca454d2ae11f..705c4a69a25f 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -31,6 +31,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -167,6 +169,7 @@ public:
 void testTdf91250();
 void testTdf134111();
 void testTdf136752();
+void testTdf137505();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -282,6 +285,7 @@ public:
 CPPUNIT_TEST(testTdf91250);
 CPPUNIT_TEST(testTdf134111);
 CPPUNIT_TEST(testTdf136752);
+CPPUNIT_TEST(testTdf137505);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2700,6 +2704,26 @@ void Chart2ImportTest::testTdf136752()
 CPPUNIT_ASSERT_DOUBLES_EQUAL(1458, aLabelPosition.Y, 500);
 }
 
+void Chart2ImportTest::testTdf137505()
+{
+load("/chart2/qa/extras/data/xlsx/", "tdf137505.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+UNO_QUERY_THROW);
+
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xCustomShape(xDrawPage->getByIndex(1), 
UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xCustomShape.is());
+
+float nFontSize;
+Reference< text::XText > xRange(xCustomShape, uno::UNO_QUERY_THROW);
+Reference < text::XTextCursor > xAt = xRange->createTextCursor();
+Reference< beans::XPropertySet > xProps(xAt, UNO_QUERY);
+// check the text size of custom shape, inside the chart.
+CPPUNIT_ASSERT(xProps->getPropertyValue("CharHeight") >>= nFontSize);
+CPPUNIT_ASSERT_EQUAL(float(12), nFontSize);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/tdf137505.xlsx 
b/chart2/qa/extras/data/xlsx/tdf137505.xlsx
new file mode 100644
index ..08fa6778bb04
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf137505.xlsx differ
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
index 2e255433da3b..2af62c344940 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
@@ -1,6 +1,6 @@
 
 
- 
+ 
   
   
   
@@ -16,7 +16,7 @@
  
  
   
-   
+   
 
 
 
@@ -30,7 +30,7 @@
  
 

-   
+   
 
 
 
@@ -50,7 +50,7 @@
   

 
- 
+ 
   
   
   
@@ -77,7 +77,7 @@
   

 
- 
+ 
   
   
   
@@ -91,7 +91,7 @@

   
  
- 
+ 
   
   
   
@@ -105,7 +105,7 @@

   
  
- 
+ 
   
   
   
@@ -119,7 +119,7 @@

   
  
- 
+ 
   
   
   
@@ -133,7 +133,7 @@

   
  
- 
+ 
   
   
   
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
index 84eb759612ff..c8afb487a4ae 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
@@ -1,6 +1,6 @@
 
 
- 
+ 
   
   
   
@@ -16,7 +16,7 @@
  
  
   
-   
+   
 
 
 
@@ -30,7 +30,7 @@
  
 

-   
+   
 
 
 
@@ -50,7 

[Libreoffice-commits] core.git: chart2/qa chart2/source sw/qa

2020-10-19 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx |4 +--
 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml |   16 +++---
 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml |   16 +++---
 chart2/qa/extras/xshape/data/reference/tdf90839-4.xml |   16 +++---
 chart2/source/view/main/PolarLabelPositionHelper.cxx  |   20 +++---
 sw/qa/extras/layout/data/tdf137154.docx   |binary
 sw/qa/extras/layout/layout2.cxx   |   20 ++
 7 files changed, 54 insertions(+), 38 deletions(-)

New commits:
commit db49cdcf2f367e27ed8fb5f1619f0b41f2c63fd2
Author: Tünde Tóth 
AuthorDate: Wed Sep 30 13:11:26 2020 +0200
Commit: László Németh 
CommitDate: Mon Oct 19 08:58:51 2020 +0200

tdf#137154 pie chart: improve Outside position of data labels

Some pie chart data labels were too close to the pie
with Outside placement.

Change-Id: I0eecdfc32601bdfa8bb3115183f9ca723a9f945b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103683
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index d901f879ea18..1318a1ddebfa 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -2573,8 +2573,8 @@ void Chart2ImportTest::testTdf133376()
 CPPUNIT_ASSERT(xDataPointLabel.is());
 // Check the position of the 3rd data point label, which is out from the 
pie slice
 awt::Point aLabelPosition = xDataPointLabel->getPosition();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(349, aLabelPosition.X, 30);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(5480, aLabelPosition.Y, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(458, aLabelPosition.X, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(5114, aLabelPosition.Y, 30);
 }
 
 void Chart2ImportTest::testTdf134225()
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
index d23c93e558a2..84eb759612ff 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
@@ -181,9 +181,9 @@
 
  
   
-   
+   
 
- 
+ 
   
   
   
@@ -193,14 +193,14 @@
   
   

-   
+   

   
  
 
 
  
- 
+ 
  
 

@@ -273,9 +273,9 @@
  
 

-   
+   
 
- 
+ 
   
   
   
@@ -284,14 +284,14 @@
   
   
   
-   
+   


   
  
 
 
- 
+ 
  
  
 
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
index e4e1bd07273b..11dd8ecfe15b 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
@@ -181,9 +181,9 @@
 
  
   
-   
+   
 
- 
+ 
   
   
   
@@ -193,14 +193,14 @@
   
   

-   
+   

   
  
 
 
  
- 
+ 
  
 

@@ -273,9 +273,9 @@
  
 

-   
+   
 
- 
+ 
   
   
   
@@ -284,14 +284,14 @@
   
   
   
-   
+   


   
  
 
 
- 
+ 
  
  
 
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
index 9c1ce02d4583..4774a7e3e0b4 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml
@@ -181,9 +181,9 @@
 
  
   
-   
+   
 
- 
+ 
   
   
   
@@ -193,14 +193,14 @@
   
   

-   
+   

   
  
 
 
  
- 
+ 
  
 

@@ -273,9 +273,9 @@
 

[Libreoffice-commits] core.git: chart2/qa chart2/source oox/source

2020-10-09 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   23 ++-
 chart2/qa/extras/data/xlsx/tdf134978.xlsx  |binary
 chart2/source/tools/ChartTypeHelper.cxx|3 ++-
 chart2/source/view/charttypes/PieChart.cxx |7 +--
 oox/source/drawingml/chart/seriesconverter.cxx |6 +-
 oox/source/export/chartexport.cxx  |1 +
 6 files changed, 35 insertions(+), 5 deletions(-)

New commits:
commit 20da1a5dd37c7edac620566c992d5a53b23a5f12
Author: Tünde Tóth 
AuthorDate: Thu Sep 17 16:49:02 2020 +0200
Commit: László Németh 
CommitDate: Fri Oct 9 09:24:18 2020 +0200

tdf#134978 Chart OOXML Import: fix pie chart label custom position

Follow-up of commit dff7a46fb46d1fa2a3ad674ee493ae2d59150fe3
(tdf#130032 Chart OOXML Import: fix data label custom position).

Change-Id: Iaaf4ae654ac0c1b4896a53be6034e6c027412df0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102981
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index dadc782c0af6..d901f879ea18 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -158,6 +158,7 @@ public:
 void testTdf125444PercentageCustomLabel();
 void testDataPointLabelCustomPos();
 void testTdf130032();
+void testTdf134978();
 void testTdf119138MissingAutoTitleDeleted();
 void testStockChartShiftedCategoryPosition();
 void testTdf133376();
@@ -272,6 +273,7 @@ public:
 CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
 CPPUNIT_TEST(testDataPointLabelCustomPos);
 CPPUNIT_TEST(testTdf130032);
+CPPUNIT_TEST(testTdf134978);
 CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted);
 CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
 CPPUNIT_TEST(testTdf133376);
@@ -1783,7 +1785,7 @@ void Chart2ImportTest::testTdf109858()
 CPPUNIT_ASSERT( aAny.hasValue() );
 sal_Int32 nLabelPlacement = 0;
 CPPUNIT_ASSERT( aAny >>= nLabelPlacement );
-CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data point label should be placed bestFit", 
chart::DataLabelPlacement::AVOID_OVERLAP, nLabelPlacement );
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data point label should be placed bestfit", 
chart::DataLabelPlacement::CUSTOM, nLabelPlacement );
 
 // test data series label position
 Reference 
xSeriesPropSet(xChart1Doc->getDiagram()->getDataRowProperties(0), 
uno::UNO_SET_THROW);
@@ -2511,6 +2513,25 @@ void Chart2ImportTest::testTdf130032()
 CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::RIGHT, aPlacement);
 }
 
+void Chart2ImportTest::testTdf134978()
+{
+// test CustomLabelPosition on Pie chart
+load("/chart2/qa/extras/data/xlsx/", "tdf134978.xlsx");
+uno::Reference xChartDoc = getChartDocFromSheet(0, 
mxComponent);
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+CPPUNIT_ASSERT(xDataSeries.is());
+
+uno::Reference 
xPropertySet(xDataSeries->getDataPointByIndex(2),
+ uno::UNO_SET_THROW);
+CPPUNIT_ASSERT(xPropertySet.is());
+
+chart2::RelativePosition aCustomLabelPosition;
+xPropertySet->getPropertyValue("CustomLabelPosition") >>= 
aCustomLabelPosition;
+CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.040273622047244093, 
aCustomLabelPosition.Primary, 1e-7);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.25635352872557599, 
aCustomLabelPosition.Secondary, 1e-7);
+}
+
 void Chart2ImportTest::testTdf119138MissingAutoTitleDeleted()
 {
 load("/chart2/qa/extras/data/xlsx/", 
"tdf119138-missing-autotitledeleted.xlsx");
diff --git a/chart2/qa/extras/data/xlsx/tdf134978.xlsx 
b/chart2/qa/extras/data/xlsx/tdf134978.xlsx
new file mode 100644
index ..ad5522a9144d
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf134978.xlsx differ
diff --git a/chart2/source/tools/ChartTypeHelper.cxx 
b/chart2/source/tools/ChartTypeHelper.cxx
index 236d066f77d3..a4b8059ffb19 100644
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -252,12 +252,13 @@ uno::Sequence < sal_Int32 > 
ChartTypeHelper::getSupportedLabelPlacements( const
 
 if(!bDonut)
 {
-aRet.realloc(4);
+aRet.realloc(5);
 sal_Int32* pSeq = aRet.getArray();
 *pSeq++ = css::chart::DataLabelPlacement::AVOID_OVERLAP;
 *pSeq++ = css::chart::DataLabelPlacement::OUTSIDE;
 *pSeq++ = css::chart::DataLabelPlacement::INSIDE;
 *pSeq++ = css::chart::DataLabelPlacement::CENTER;
+*pSeq++ = css::chart::DataLabelPlacement::CUSTOM;
 }
 else
 {
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 6042b0d0dbe4..55eb67037b9a 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ 

[Libreoffice-commits] core.git: chart2/qa chart2/source sw/qa

2020-10-02 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx  |4 -
 chart2/source/view/charttypes/PieChart.cxx |  115 +++--
 chart2/source/view/charttypes/PieChart.hxx |2 
 sw/qa/extras/layout/data/tdf137116.docx|binary
 sw/qa/extras/layout/layout.cxx |   20 +
 5 files changed, 66 insertions(+), 75 deletions(-)

New commits:
commit a91ac466e2a996a07248ec4a2518d5ba9bdf3d61
Author: Tünde Tóth 
AuthorDate: Tue Sep 29 13:32:40 2020 +0200
Commit: László Németh 
CommitDate: Fri Oct 2 17:01:02 2020 +0200

tdf#137116 pie chart: improve BestFit position of data labels

Regression from commit: 2e1a1054a4a98415057e72269ace9db075d3b191
(tdf#136752 pie chart: improve data label position)

Change-Id: I66943684957a220c81db7f928fbb47700b78d012
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103610
Tested-by: Jenkins
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 6097a8a0388f..dadc782c0af6 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -2579,8 +2579,8 @@ void Chart2ImportTest::testTdf134225()
 awt::Point aLabelPosition2 = xDataPointLabel2->getPosition();
 
 // Check the distance between the position of the 1st data point label and 
the second one
-CPPUNIT_ASSERT_DOUBLES_EQUAL(1800, sal_Int32(aLabelPosition2.X - 
aLabelPosition1.X), 30);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(2123, sal_Int32(aLabelPosition2.Y - 
aLabelPosition1.Y), 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1669, sal_Int32(aLabelPosition2.X - 
aLabelPosition1.X), 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(2166, sal_Int32(aLabelPosition2.Y - 
aLabelPosition1.Y), 30);
 #endif
 }
 
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index e2dd04f6c645..6042b0d0dbe4 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -389,26 +389,51 @@ void PieChart::createTextLabelShape(
  *  First off the routine try to place the label inside the related 
pie slice,
  *  if this is not possible the label is placed outside.
  */
-if (!performLabelBestFitInnerPlacement(rParam, aPieLabelInfo)
-&& m_aAvailableOuterRect.getWidth())
+if (!performLabelBestFitInnerPlacement(rParam, aPieLabelInfo))
 {
-double fAngleDegree
-= rParam.mfUnitCircleStartAngleDegree + 
rParam.mfUnitCircleWidthAngleDegree / 2.0;
-while (fAngleDegree > 360.0)
-fAngleDegree -= 360.0;
-while (fAngleDegree < 0.0)
-fAngleDegree += 360.0;
-
-if (fAngleDegree < 67.5 || fAngleDegree >= 292.5)
-fTextMaximumFrameWidth
-= 0.8 * (m_aAvailableOuterRect.getMaxX() - 
aPieLabelInfo.aFirstPosition.getX());
-else if (fAngleDegree < 112.5 || fAngleDegree >= 247.5)
-fTextMaximumFrameWidth = 0.8 * 
m_aAvailableOuterRect.getWidth();
-else
-fTextMaximumFrameWidth
-= 0.8 * (aPieLabelInfo.aFirstPosition.getX() - 
m_aAvailableOuterRect.getMinX());
-
-nTextMaximumFrameWidth = ceil(fTextMaximumFrameWidth);
+if (m_aAvailableOuterRect.getWidth())
+{
+double fAngleDegree = rParam.mfUnitCircleStartAngleDegree
+  + rParam.mfUnitCircleWidthAngleDegree / 
2.0;
+while (fAngleDegree > 360.0)
+fAngleDegree -= 360.0;
+while (fAngleDegree < 0.0)
+fAngleDegree += 360.0;
+
+if (fAngleDegree < 67.5 || fAngleDegree >= 292.5)
+fTextMaximumFrameWidth
+= 0.8
+  * (m_aAvailableOuterRect.getMaxX() - 
aPieLabelInfo.aFirstPosition.getX());
+else if (fAngleDegree < 112.5 || fAngleDegree >= 247.5)
+fTextMaximumFrameWidth = 0.8 * 
m_aAvailableOuterRect.getWidth();
+else
+fTextMaximumFrameWidth
+= 0.8
+  * (aPieLabelInfo.aFirstPosition.getX() - 
m_aAvailableOuterRect.getMinX());
+
+nTextMaximumFrameWidth = ceil(fTextMaximumFrameWidth);
+}
+
+nScreenValueOffsetInRadiusDirection = (m_nDimension != 3) ? 150 : 
0;
+aScreenPosition2D
+= 
aPolarPosHelper.getLabelScreenPositionAndAlignmentForUnitCircleValues(
+eAlignment, css::chart::DataLabelPlacement::OUTSIDE,
+rParam.mfUnitCircleStartAngleDegree,
+rParam.mfUnitCircleWidthAngleDegree, 
rParam.mfUnitCircleInnerRadius,
+rParam.mfUnitCircleOuterRadius, rParam.mfLogicZ + 0.5, 0);
+aPieLabelInfo.aFirstPosition
+   

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-09-23 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   25 +-
 chart2/qa/extras/data/xlsx/tdf136752.xlsx  |binary
 chart2/source/view/charttypes/PieChart.cxx |   68 -
 chart2/source/view/charttypes/PieChart.hxx |6 +-
 4 files changed, 75 insertions(+), 24 deletions(-)

New commits:
commit 2e1a1054a4a98415057e72269ace9db075d3b191
Author: Tünde Tóth 
AuthorDate: Tue Sep 15 14:27:57 2020 +0200
Commit: László Németh 
CommitDate: Wed Sep 23 10:29:50 2020 +0200

tdf#136752 pie chart: improve data label position

to avoid chart distortion.

Set the maximum text width of data point label shape based
to the 80% of the remaining space, when text wrapping is enabled
and the label placement is AVOID_OVERLAP.

Change-Id: I174089ec62df3aa21b5d1f26f74d475945d83684
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102744
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index fe0a2c48231e..6097a8a0388f 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -165,6 +165,7 @@ public:
 void testTdf136105();
 void testTdf91250();
 void testTdf134111();
+void testTdf136752();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -278,6 +279,7 @@ public:
 CPPUNIT_TEST(testTdf136105);
 CPPUNIT_TEST(testTdf91250);
 CPPUNIT_TEST(testTdf134111);
+CPPUNIT_TEST(testTdf136752);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2550,8 +2552,8 @@ void Chart2ImportTest::testTdf133376()
 CPPUNIT_ASSERT(xDataPointLabel.is());
 // Check the position of the 3rd data point label, which is out from the 
pie slice
 awt::Point aLabelPosition = xDataPointLabel->getPosition();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(482, aLabelPosition.X, 30);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(5427, aLabelPosition.Y, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(349, aLabelPosition.X, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(5480, aLabelPosition.Y, 30);
 }
 
 void Chart2ImportTest::testTdf134225()
@@ -2658,6 +2660,25 @@ void Chart2ImportTest::testTdf134111()
 CPPUNIT_ASSERT(bTextBreak);
 }
 
+void Chart2ImportTest::testTdf136752()
+{
+load("/chart2/qa/extras/data/xlsx/", "tdf136752.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+   UNO_QUERY_THROW);
+
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xDataPointLabel(getShapeByName(xShapes,
+"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), 
UNO_SET_THROW);
+
+CPPUNIT_ASSERT(xDataPointLabel.is());
+// Check the position of the 1st data point label, which is out from the 
pie slice
+awt::Point aLabelPosition = xDataPointLabel->getPosition();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(8675, aLabelPosition.X, 500);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1458, aLabelPosition.Y, 500);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/tdf136752.xlsx 
b/chart2/qa/extras/data/xlsx/tdf136752.xlsx
new file mode 100644
index ..05fad58cfff5
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf136752.xlsx differ
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 000a3f4a8a90..e2dd04f6c645 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -32,6 +32,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -382,16 +383,52 @@ void PieChart::createTextLabelShape(
 
 aPieLabelInfo.xLabelGroupShape.set( xChild->getParent(), uno::UNO_QUERY );
 
+if (bMovementAllowed && !m_bUseRings)
+{
+/** Handle the placement of the label in the best fit case.
+ *  First off the routine try to place the label inside the related 
pie slice,
+ *  if this is not possible the label is placed outside.
+ */
+if (!performLabelBestFitInnerPlacement(rParam, aPieLabelInfo)
+&& m_aAvailableOuterRect.getWidth())
+{
+double fAngleDegree
+= rParam.mfUnitCircleStartAngleDegree + 
rParam.mfUnitCircleWidthAngleDegree / 2.0;
+while (fAngleDegree > 360.0)
+fAngleDegree -= 360.0;
+while (fAngleDegree < 0.0)
+fAngleDegree += 360.0;
+
+if (fAngleDegree < 67.5 || fAngleDegree >= 292.5)
+fTextMaximumFrameWidth
+= 0.8 * (m_aAvailableOuterRect.getMaxX() - 
aPieLabelInfo.aFirstPosition.getX());
+else if (fAngleDegree < 112.5 || fAngleDegree >= 247.5)
+fTextMaximumFrameWidth = 0.8 * 

[Libreoffice-commits] core.git: chart2/qa chart2/source oox/inc oox/source

2020-09-18 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx  |   11 +++
 chart2/qa/extras/data/xlsx/tdf136267.xlsx  |binary
 chart2/source/tools/ExplicitCategoriesProvider.cxx |1 +
 oox/inc/drawingml/chart/typegroupmodel.hxx |1 -
 oox/source/drawingml/chart/axisconverter.cxx   |5 -
 oox/source/drawingml/chart/plotareaconverter.cxx   |2 --
 oox/source/drawingml/chart/typegroupconverter.cxx  |4 ++--
 oox/source/drawingml/chart/typegroupmodel.cxx  |3 +--
 8 files changed, 19 insertions(+), 8 deletions(-)

New commits:
commit 2d51b9fd4e7b22a21c77cff473de56ebebc5c9f2
Author: Balazs Varga 
AuthorDate: Fri Sep 11 14:14:13 2020 +0200
Commit: László Németh 
CommitDate: Fri Sep 18 13:24:46 2020 +0200

tdf#136267 OOXML Chart Import: create main category axis labels once

because InternalDataProvider can not handle different category names
on the primary and secondary category axis.

Revert e0b0502516a10181bbd1737b93b38b2bba4c98e8 commit, except
the relevant unit test.

Regression from commit: e0b0502516a10181bbd1737b93b38b2bba4c98e8
(tdf#128016 Chart OOXML Import: fix duplicated category labels)

Also fix tdf#129994 (FILEOPEN - hang at import time), which is a
a regression from commit fa0a981af41a2606541eec1cb20a379a739691e0
(tdf#114166 DOCX chart import: fix missing complex categories)

Change-Id: I5d049e760eb1a647ea774be264349a2f16f15f5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102463
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 3e1f5d86e897..8916208f8bde 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -178,6 +178,7 @@ public:
 void testTdf134255();
 void testTdf134977();
 void testTdf123647();
+void testTdf136267();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest);
 CPPUNIT_TEST(testErrorBarXLSX);
@@ -318,6 +319,7 @@ public:
 CPPUNIT_TEST(testTdf134255);
 CPPUNIT_TEST(testTdf134977);
 CPPUNIT_TEST(testTdf123647);
+CPPUNIT_TEST(testTdf136267);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2921,6 +2923,15 @@ void Chart2ExportTest::testTdf123647()
 assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart", 1);
 }
 
+void Chart2ExportTest::testTdf136267()
+{
+load("/chart2/qa/extras/data/xlsx/", "tdf136267.xlsx");
+xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
+CPPUNIT_ASSERT(pXmlDoc);
+
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:cat/c:strRef/c:strCache/c:pt/c:v",
 "John");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/tdf136267.xlsx 
b/chart2/qa/extras/data/xlsx/tdf136267.xlsx
new file mode 100644
index ..741a33c429b9
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf136267.xlsx differ
diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx 
b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index c0b232240710..bf65f58ec850 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -55,6 +55,7 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( const 
Reference< chart2:
 {
 if( xCooSysModel.is() )
 {
+// TODO: handle different category names on the primary and 
secondary category axis.
 uno::Reference< XAxis > xAxis( 
xCooSysModel->getAxisByDimension(0,0) );
 if( xAxis.is() )
 {
diff --git a/oox/inc/drawingml/chart/typegroupmodel.hxx 
b/oox/inc/drawingml/chart/typegroupmodel.hxx
index 79d55dfd2846..5a37797e1b25 100644
--- a/oox/inc/drawingml/chart/typegroupmodel.hxx
+++ b/oox/inc/drawingml/chart/typegroupmodel.hxx
@@ -74,7 +74,6 @@ struct TypeGroupModel
 boolmbSmooth;   /// True = smooth lines in line 
charts.
 boolmbVaryColors;   /// True = different automatic 
colors for each point.
 boolmbWireframe;/// True = wireframe surface 
chart, false = filled surface chart.
-boolmbCatAxisVisible;   /// True = Category axis is 
visible.
 
 explicitTypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc );
 ~TypeGroupModel();
diff --git a/oox/source/drawingml/chart/axisconverter.cxx 
b/oox/source/drawingml/chart/axisconverter.cxx
index d73632476550..8599c68e6732 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -208,7 +208,10 @@ void AxisConverter::convertFromModel(
 // tdf#132076: set axis type to date, if it is a date axis!
 aScaleData.AxisType = bDateAxis ? cssc2::AxisType::DATE : 
cssc2::AxisType::CATEGORY;
 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-09-14 Thread Mike Kaganski (via logerrit)
 chart2/qa/extras/charttest.hxx  |6 ++
 chart2/source/model/main/ChartModel_Persistence.cxx |7 +++
 2 files changed, 13 insertions(+)

New commits:
commit 574eec9036c5f185b3572ba1e0ca9d111eb361dc
Author: Mike Kaganski 
AuthorDate: Sat Sep 12 17:22:23 2020 +0300
Commit: Mike Kaganski 
CommitDate: Tue Sep 15 06:09:04 2020 +0200

tdf#77007: chart must honor its parent's IsEnableSetModified

Regression from commit bb97ecdbcc8d8dafd39e728b21bc68efee4eccbc,
which had dropped storing chart doc (calling its storeOwn) while
loading back in 2012, to avoid performance problems when loading
XLS.

Funnily, in 2013, commit a666862deffa33013d3df3bb62e87c67f9a89948
was merged, that was expected to solve exactly the same problem as
this change, by calling storeOwn for charts being loaded; while
obviously not fixing the problem properly, it seems to had undone
the effect of the Markus's commit.

The latter commit had a side effect of updating views of modified
charts while exporting them inside storeOwn, which made respective
draw pages to be up-to-date right after loading, including those on
inactive sheets. Now, after this change, this is not so, thus unit
tests' getChartDocFromSheet was made to update the view explicitly.

Unfortunately, it's not yet possible to revert the change from
commit a666862deffa33013d3df3bb62e87c67f9a89948, because obviously
some dependency grew, which makes e.g. testTdf122594 fail if that
commit is reverted. Given that testTdf122594 has no charts, storing
the modified objects while loading has much wider side effects than
was expected by author of a666862deffa33013d3df3bb62e87c67f9a89948.

Change-Id: Iee1b9ef6f4d8c2dfa0a49680c5e2b465f1817a59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102534
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index 156893cd2cb5..bcd1f101189d 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -29,6 +29,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -204,6 +205,11 @@ Reference< lang::XComponent > getChartCompFromSheet( 
sal_Int32 nSheet, uno::Refe
 Reference< chart2::XChartDocument > getChartDocFromSheet( sal_Int32 nSheet, 
uno::Reference< lang::XComponent > const & xComponent )
 {
 uno::Reference< chart2::XChartDocument > xChartDoc ( 
getChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW );
+
+// Update the chart view, so that its draw page is updated and ready for 
the test
+css::uno::Reference xModel(xChartDoc, 
css::uno::UNO_QUERY_THROW);
+ChartHelper::updateChart(xModel);
+
 return xChartDoc;
 }
 
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx 
b/chart2/source/model/main/ChartModel_Persistence.cxx
index 313b472be0d7..c505da695e73 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -57,6 +57,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -668,6 +669,12 @@ sal_Bool SAL_CALL ChartModel::isModified()
 
 void SAL_CALL ChartModel::setModified( sal_Bool bModified )
 {
+// tdf#77007: honor parent's IsEnableSetModified
+// Check it before LifeTimeGuard, to avoid deadlocking solar mutex and 
this guard
+if (auto pParentShell = SfxObjectShell::GetShellFromComponent(getParent());
+pParentShell && !pParentShell->IsEnableSetModified())
+return;
+
 apphelper::LifeTimeGuard aGuard(m_aLifeTimeManager);
 if(!aGuard.startApiCall())//@todo ? is this a long lasting call??
 return; //behave passive if already disposed or closed or throw 
exception @todo?
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source include/xmloff schema/libreoffice xmloff/source

2020-08-31 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx   |   18 
+++---
 chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx  |binary
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx |7 +++
 include/xmloff/xmltoken.hxx |1 
 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng |9 
+
 xmloff/source/chart/PropertyMap.hxx |1 
 xmloff/source/core/xmltoken.cxx |3 +
 xmloff/source/token/tokens.txt  |1 
 8 files changed, 35 insertions(+), 5 deletions(-)

New commits:
commit e2f4e65a7b8024c00b049eebf0d87637efda7f24
Author: Balazs Varga 
AuthorDate: Thu Aug 27 11:21:48 2020 +0200
Commit: László Németh 
CommitDate: Mon Aug 31 09:30:23 2020 +0200

tdf#134571 chart2, xmloff: add loext:custom-leader-lines

new ODF chart series style attribute for saving not default
(switched off) state of data labels in custom positions.

Note: import of the embedded chart of the DOCX unit test
document uses also ODF format in the background, testing
also this loext attribute, i.e. the chart of the unit test
document doesn't contain custom leader lines.

Change-Id: Ia6b76e8d7fe5b6b6204761f3bbc2309f1b631008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101442
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 4be864c69ce4..6384ac17f0bc 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -2374,10 +2374,19 @@ void 
Chart2ExportTest::testCustomDataLabelMultipleSeries()
 void Chart2ExportTest::testLeaderLines()
 {
 load("/chart2/qa/extras/data/xlsx/", "testTdf90749.xlsx");
-xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
-CPPUNIT_ASSERT(pXmlDoc);
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "1");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "0");
+{
+xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office 
Open XML");
+CPPUNIT_ASSERT(pXmlDoc);
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "1");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "0");
+}
+load("/chart2/qa/extras/data/docx/", "MSO_Custom_Leader_Line.docx");
+{
+xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart1", "Office 
Open XML Text");
+CPPUNIT_ASSERT(pXmlDoc);
+// tdf#134571: Check the leader line is switch off.
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "0");
+}
 }
 
 void Chart2ExportTest::testNumberFormatExportPPTX()
@@ -2882,6 +2891,7 @@ void Chart2ExportTest::testTdf123647()
 
 assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart", 1);
 }
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx 
b/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx
new file mode 100644
index ..c158a0d76513
Binary files /dev/null and 
b/chart2/qa/extras/data/docx/MSO_Custom_Leader_Line.docx differ
diff --git 
a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index a6d45dddaa47..6701c1061b01 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -79,6 +79,7 @@ enum
 PROP_SERIES_DATAPOINT_LABEL_PLACEMENT,
 //other series properties
 PROP_SERIES_ATTACHED_AXIS,
+PROP_SERIES_SHOW_CUSTOM_LEADERLINES,
 PROP_SERIES_DATAPOINT_TEXT_ROTATION,
 PROP_SERIES_DATAPOINT_LABEL_BORDER_STYLE,
 PROP_SERIES_DATAPOINT_LABEL_BORDER_WIDTH,
@@ -211,6 +212,12 @@ void lcl_AddPropertiesToVector_SeriesOnly(
   cppu::UnoType::get(),
   beans::PropertyAttribute::BOUND
   | beans::PropertyAttribute::MAYBEDEFAULT );
+
+rOutProperties.emplace_back( "ShowCustomLeaderLines",
+  PROP_SERIES_SHOW_CUSTOM_LEADERLINES,
+  cppu::UnoType::get(),
+  beans::PropertyAttribute::BOUND
+  | beans::PropertyAttribute::MAYBEDEFAULT );
 }
 
 uno::Sequence< Property > lcl_GetPropertySequence( 
DataSeriesPointWrapper::eType _eType )
diff --git a/include/xmloff/xmltoken.hxx 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-08-27 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx |   45 
 chart2/qa/extras/data/xlsx/tdf136105.xlsx |binary
 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml |   84 +++
 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml |   36 +++---
 chart2/qa/extras/xshape/data/reference/tdf90839-4.xml |   96 +-
 chart2/source/view/charttypes/PieChart.cxx|   15 ++
 chart2/source/view/charttypes/VSeriesPlotter.cxx  |1 
 chart2/source/view/diagram/VDiagram.cxx   |4 
 chart2/source/view/inc/VSeriesPlotter.hxx |3 
 chart2/source/view/main/ChartView.cxx |5 
 10 files changed, 177 insertions(+), 112 deletions(-)

New commits:
commit 75a8b367f2a06e0d485fc2b9f4472e8bb29d71e3
Author: Balazs Varga 
AuthorDate: Tue Aug 25 12:32:02 2020 +0200
Commit: László Németh 
CommitDate: Thu Aug 27 12:10:03 2020 +0200

tdf#136105 tdf#134883 pie chart: improve data label position

Set the maximum text width of data point label shape based
on the remaining space, when text wrapping is enabled and
the label placement is OUTSIDE.

Change-Id: I9132658e44886000c692efadaee4841c4d3ffc7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101317
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index d502d163fc64..651d2b829e06 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -162,6 +162,7 @@ public:
 void testStockChartShiftedCategoryPosition();
 void testTdf133376();
 void testTdf134225();
+void testTdf136105();
 void testTdf91250();
 void testTdf134111();
 
@@ -274,6 +275,7 @@ public:
 CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
 CPPUNIT_TEST(testTdf133376);
 CPPUNIT_TEST(testTdf134225);
+CPPUNIT_TEST(testTdf136105);
 CPPUNIT_TEST(testTdf91250);
 CPPUNIT_TEST(testTdf134111);
 
@@ -2525,8 +2527,8 @@ void Chart2ImportTest::testTdf133376()
 CPPUNIT_ASSERT(xDataPointLabel.is());
 // Check the position of the 3rd data point label, which is out from the 
pie slice
 awt::Point aLabelPosition = xDataPointLabel->getPosition();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(1071, aLabelPosition.X, 30);
-CPPUNIT_ASSERT_DOUBLES_EQUAL(5269, aLabelPosition.Y, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(482, aLabelPosition.X, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(5427, aLabelPosition.Y, 30);
 }
 
 void Chart2ImportTest::testTdf134225()
@@ -2557,6 +2559,45 @@ void Chart2ImportTest::testTdf134225()
 #endif
 }
 
+void Chart2ImportTest::testTdf136105()
+{
+load("/chart2/qa/extras/data/xlsx/", "tdf136105.xlsx");
+// 1st chart with fix inner position and size
+{
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+UNO_QUERY_THROW);
+
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference 
xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xDataPointLabel(getShapeByName(xShapes,
+
"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), 
UNO_SET_THROW);
+
+CPPUNIT_ASSERT(xDataPointLabel.is());
+// Check the position of the 1st data point label, which is out from 
the pie slice
+awt::Point aLabelPosition = xDataPointLabel->getPosition();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(8797, aLabelPosition.X, 500);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1374, aLabelPosition.Y, 500);
+}
+// 2nd chart with auto inner position and size
+{
+Reference xChartDoc(getChartDocFromSheet(1, 
mxComponent),
+UNO_QUERY_THROW);
+
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference 
xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xDataPointLabel(getShapeByName(xShapes,
+
"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), 
UNO_SET_THROW);
+
+CPPUNIT_ASSERT(xDataPointLabel.is());
+// Check the position of the 1st data point label, which is out from 
the pie slice
+awt::Point aLabelPosition = xDataPointLabel->getPosition();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(8610, aLabelPosition.X, 500);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1684, aLabelPosition.Y, 500);
+}
+}
+
 void Chart2ImportTest::testTdf91250()
 {
 load("/chart2/qa/extras/data/docx/", "tdf91250.docx");
diff --git a/chart2/qa/extras/data/xlsx/tdf136105.xlsx 
b/chart2/qa/extras/data/xlsx/tdf136105.xlsx
new file mode 100644
index ..bc3a9092244f
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf136105.xlsx differ
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml 

[Libreoffice-commits] core.git: chart2/qa chart2/source offapi/com oox/source

2020-08-18 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx |2 +-
 chart2/source/model/main/DataSeriesProperties.cxx |7 +++
 chart2/source/model/main/DataSeriesProperties.hxx |3 ++-
 chart2/source/view/charttypes/VSeriesPlotter.cxx  |3 ++-
 offapi/com/sun/star/chart2/DataSeries.idl |7 +++
 oox/source/drawingml/chart/seriescontext.cxx  |6 +-
 oox/source/drawingml/chart/seriesconverter.cxx|2 +-
 oox/source/export/chartexport.cxx |6 --
 oox/source/token/properties.txt   |2 +-
 9 files changed, 30 insertions(+), 8 deletions(-)

New commits:
commit 5d67d70b26706ce8a08612c12a68821f984210a2
Author: Balazs Varga 
AuthorDate: Wed Jul 8 11:06:38 2020 +0200
Commit: László Németh 
CommitDate: Tue Aug 18 19:01:21 2020 +0200

tdf#134563 Add UNO API for custom leader lines

If its ShowCustomLeaderLines=true, data series uses leader
lines for labels with custom alignment.

Add also OOXML import/export of custom data series setting.

Change-Id: I8e6f7cb457c38b84aa40c917e69704862262a96e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98323
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index f9b2651a922c..754768880054 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -2373,7 +2373,7 @@ void Chart2ExportTest::testLeaderLines()
 xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open 
XML");
 CPPUNIT_ASSERT(pXmlDoc);
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "1");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "1");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "0");
 }
 
 void Chart2ExportTest::testNumberFormatExportPPTX()
diff --git a/chart2/source/model/main/DataSeriesProperties.cxx 
b/chart2/source/model/main/DataSeriesProperties.cxx
index 5d0cb777e151..d85d264753c1 100644
--- a/chart2/source/model/main/DataSeriesProperties.cxx
+++ b/chart2/source/model/main/DataSeriesProperties.cxx
@@ -69,6 +69,12 @@ void DataSeriesProperties::AddPropertiesToVector(
   beans::PropertyAttribute::BOUND
   | beans::PropertyAttribute::MAYBEVOID );
 
+rOutProperties.emplace_back( "ShowCustomLeaderLines",
+  PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES,
+  cppu::UnoType::get(),
+  beans::PropertyAttribute::BOUND
+  | beans::PropertyAttribute::MAYBEDEFAULT );
+
 // add properties of service DataPointProperties
 DataPointProperties::AddPropertiesToVector( rOutProperties );
 }
@@ -80,6 +86,7 @@ void DataSeriesProperties::AddDefaultsToMap(
 PropertyHelper::setPropertyValueDefault( rOutMap, 
PROP_DATASERIES_VARY_COLORS_BY_POINT, false );
 PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, 
PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 );
 PropertyHelper::setPropertyValueDefault( rOutMap, 
PROP_DATASERIES_SHOW_LEGEND_ENTRY, true );
+PropertyHelper::setPropertyValueDefault( rOutMap, 
PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES, true );
 
 // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
 
diff --git a/chart2/source/model/main/DataSeriesProperties.hxx 
b/chart2/source/model/main/DataSeriesProperties.hxx
index e20602baf45f..6bc058201466 100644
--- a/chart2/source/model/main/DataSeriesProperties.hxx
+++ b/chart2/source/model/main/DataSeriesProperties.hxx
@@ -35,7 +35,8 @@ namespace chart::DataSeriesProperties
 PROP_DATASERIES_VARY_COLORS_BY_POINT,
 PROP_DATASERIES_ATTACHED_AXIS_INDEX,
 PROP_DATASERIES_SHOW_LEGEND_ENTRY,
-PROP_DATASERIES_DELETED_LEGEND_ENTRIES
+PROP_DATASERIES_DELETED_LEGEND_ENTRIES,
+PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES
 };
 
 void AddPropertiesToVector(
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 14b322e8f587..8f7dcbb59a1d 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -702,7 +702,8 @@ uno::Reference< drawing::XShape > 
VSeriesPlotter::createDataLabel( const uno::Re
 if( aRelPos.X != -1 )
 {
 xTextShape->setPosition(aRelPos);
-if( 
!m_xChartTypeModel->getChartType().equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE)
 )
+if( 
!m_xChartTypeModel->getChartType().equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE)
 &&
+rDataSeries.getPropertiesOfSeries()->getPropertyValue( 
"ShowCustomLeaderLines" ).get())
 {
  

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-07-09 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   26 ++
 chart2/qa/extras/data/xlsx/tdf134225.xlsx  |binary
 chart2/source/view/charttypes/PieChart.cxx |   14 +-
 3 files changed, 27 insertions(+), 13 deletions(-)

New commits:
commit 57fedb272cfcad3436142dbe9eac2870e3c3e3d2
Author: Balazs Varga 
AuthorDate: Tue Jun 23 15:02:59 2020 +0200
Commit: László Németh 
CommitDate: Thu Jul 9 10:48:55 2020 +0200

tdf#134225 Chart view: fix moved date label

outside from pie chart. Do not need to check the
sector size of a pie slice, before best fit algorithm,
so we can use the CENTER position as a start position
of BEST_FIT.

Completion of c66cb6d6e4a843dc7c7d06e1c2c0723a6ff85fc5
(tdf#134029 Chart view: enable to move data label)

Change-Id: Ie1a53784e7df2887282155113bf8bb607cdb09e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96945
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 6e78a08d67d1..9d7b43274a6f 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -161,6 +161,7 @@ public:
 void testTdf119138MissingAutoTitleDeleted();
 void testStockChartShiftedCategoryPosition();
 void testTdf133376();
+void testTdf134225();
 void testTdf91250();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
@@ -271,6 +272,7 @@ public:
 CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted);
 CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
 CPPUNIT_TEST(testTdf133376);
+CPPUNIT_TEST(testTdf134225);
 CPPUNIT_TEST(testTdf91250);
 
 CPPUNIT_TEST_SUITE_END();
@@ -2525,6 +2527,30 @@ void Chart2ImportTest::testTdf133376()
 CPPUNIT_ASSERT_DOUBLES_EQUAL(5269, aLabelPosition.Y, 30);
 }
 
+void Chart2ImportTest::testTdf134225()
+{
+load("/chart2/qa/extras/data/xlsx/", "tdf134225.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+UNO_QUERY_THROW);
+
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xDataPointLabel1(getShapeByName(xShapes,
+"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0"), 
UNO_SET_THROW);
+CPPUNIT_ASSERT(xDataPointLabel1.is());
+awt::Point aLabelPosition1 = xDataPointLabel1->getPosition();
+
+Reference xDataPointLabel2(getShapeByName(xShapes,
+"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=1"), 
UNO_SET_THROW);
+CPPUNIT_ASSERT(xDataPointLabel2.is());
+awt::Point aLabelPosition2 = xDataPointLabel2->getPosition();
+
+// Check the distance between the position of the 1st data point label and 
the second one
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1800, sal_Int32(aLabelPosition2.X - 
aLabelPosition1.X), 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(2123, sal_Int32(aLabelPosition2.Y - 
aLabelPosition1.Y), 30);
+}
+
 void Chart2ImportTest::testTdf91250()
 {
 load("/chart2/qa/extras/data/docx/", "tdf91250.docx");
diff --git a/chart2/qa/extras/data/xlsx/tdf134225.xlsx 
b/chart2/qa/extras/data/xlsx/tdf134225.xlsx
new file mode 100644
index ..ae7bdc66e302
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf134225.xlsx differ
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 9032b40977f1..5ab60729cf93 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -294,19 +294,7 @@ void PieChart::createTextLabelShape(
 //AVOID_OVERLAP is in fact "Best fit" in the UI.
 bool bMovementAllowed = ( nLabelPlacement == 
css::chart::DataLabelPlacement::AVOID_OVERLAP );
 if( bMovementAllowed )
-{
-// Use center for "Best fit" for now. In the future we
-// may want to implement a real best fit algorithm.
-// But center is good enough, and close to what Excel
-// does.
-
-// Place the label outside if the sector is too small
-// The threshold is set to 2%, but can be improved by making it a 
function of
-// label width and radius too ?
-double fFrac = fabs( nVal / rParam.mfLogicYSum );
-nLabelPlacement = ( fFrac <= 0.02 ) ? 
css::chart::DataLabelPlacement::OUTSIDE :
-css::chart::DataLabelPlacement::CENTER;
-}
+nLabelPlacement = css::chart::DataLabelPlacement::CENTER;
 
 ///for `OUTSIDE` (`INSIDE`) label placements an offset of 150 (-150), in 
the
 ///radius direction, is added to the final screen position of the label
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-06-19 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx  |2 -
 chart2/source/view/charttypes/PieChart.cxx |   45 ++---
 2 files changed, 23 insertions(+), 24 deletions(-)

New commits:
commit c66cb6d6e4a843dc7c7d06e1c2c0723a6ff85fc5
Author: Balazs Varga 
AuthorDate: Tue Jun 16 12:07:45 2020 +0200
Commit: László Németh 
CommitDate: Fri Jun 19 14:43:20 2020 +0200

tdf#134029 Chart view: enable to move data label

if the position is 'Best Fit' and the data label is
outside from the pie chart.

To check the functionality of the patch: open the attached file
http://bugs.documentfoundation.org/attachment.cgi?id=162039 and
move the data label.

Change-Id: I88546c64dd62ab40b35400b0330f7899ba09123f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96452
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 804f154333e8..6e78a08d67d1 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -2521,7 +2521,7 @@ void Chart2ImportTest::testTdf133376()
 CPPUNIT_ASSERT(xDataPointLabel.is());
 // Check the position of the 3rd data point label, which is out from the 
pie slice
 awt::Point aLabelPosition = xDataPointLabel->getPosition();
-CPPUNIT_ASSERT_DOUBLES_EQUAL(1466, aLabelPosition.X, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1071, aLabelPosition.X, 30);
 CPPUNIT_ASSERT_DOUBLES_EQUAL(5269, aLabelPosition.Y, 30);
 }
 
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 03e928a85c23..9032b40977f1 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -1581,16 +1581,10 @@ void PieChart::performLabelBestFit(ShapeParam& 
rShapeParam, PieLabelInfo const &
 return;
 
 // If it does not fit inside, let's put it outside
-PolarLabelPositionHelper 
aPolarPosHelper(m_pPosHelper.get(),m_nDimension,m_xLogicTarget,m_pShapeFactory);
-auto eAlignment = LABEL_ALIGN_CENTER;
-awt::Point aScreenPosition2D(
-
aPolarPosHelper.getLabelScreenPositionAndAlignmentForUnitCircleValues(eAlignment,
 css::chart::DataLabelPlacement::OUTSIDE
-, rShapeParam.mfUnitCircleStartAngleDegree, 
rShapeParam.mfUnitCircleWidthAngleDegree
-, rShapeParam.mfUnitCircleInnerRadius, 
rShapeParam.mfUnitCircleOuterRadius, rShapeParam.mfLogicZ+0.5, 0 ));
+awt::Point aOldPos(rPieLabelInfo.xLabelGroupShape->getPosition());
 basegfx::B2IVector aTranslationVector = rPieLabelInfo.aFirstPosition - 
rPieLabelInfo.aOrigin;
-aTranslationVector.setLength(150);
-aScreenPosition2D.X += aTranslationVector.getX();
-aScreenPosition2D.Y += aTranslationVector.getY();
+awt::Point aScreenPosition2D(aOldPos.X + aTranslationVector.getX(),
+aOldPos.Y + aTranslationVector.getY());
 
 double fAngleDegree = rShapeParam.mfUnitCircleStartAngleDegree + 
rShapeParam.mfUnitCircleWidthAngleDegree / 2.0;
 ::basegfx::B2IRectangle aBb(lcl_getRect(rPieLabelInfo.xLabelGroupShape));
@@ -1602,29 +1596,34 @@ void PieChart::performLabelBestFit(ShapeParam& 
rShapeParam, PieLabelInfo const &
 while (fAngleDegree < 0.0)
 fAngleDegree += 360.0;
 
-if( fAngleDegree <= 22.5 || fAngleDegree >= 337.5 )
-aScreenPosition2D.Y -= fLabelHeight / 2;
-else if( fAngleDegree < 67.5 )
-aScreenPosition2D.Y -= fLabelHeight;
-else if( fAngleDegree < 112.5 )
+if (fAngleDegree <= 22.5 || fAngleDegree >= 337.5)
+aScreenPosition2D.X += fLabelWidth / 2;
+else if (fAngleDegree < 67.5)
 {
-aScreenPosition2D.X -= fLabelWidth / 2;
-aScreenPosition2D.Y -= fLabelHeight;
+aScreenPosition2D.X += fLabelWidth / 2;
+aScreenPosition2D.Y -= fLabelHeight / 2;
 }
+else if (fAngleDegree < 112.5)
+aScreenPosition2D.Y -= fLabelHeight / 2;
 else if (fAngleDegree <= 157.5)
 {
-aScreenPosition2D.X -= fLabelWidth;
-aScreenPosition2D.Y -= fLabelHeight;
+aScreenPosition2D.X -= fLabelWidth / 2;
+aScreenPosition2D.Y -= fLabelHeight / 2;
 }
 else if (fAngleDegree <= 202.5)
+aScreenPosition2D.X -= fLabelWidth / 2;
+else if (fAngleDegree < 247.5)
 {
-aScreenPosition2D.X -= fLabelWidth;
-aScreenPosition2D.Y -= fLabelHeight / 2;
+aScreenPosition2D.X -= fLabelWidth / 2;
+aScreenPosition2D.Y += fLabelHeight / 2;
 }
-else if (fAngleDegree < 247.5)
-aScreenPosition2D.X -= fLabelWidth;
 else if (fAngleDegree < 292.5)
-aScreenPosition2D.X -= fLabelWidth / 2;
+aScreenPosition2D.Y += fLabelHeight / 2;
+else
+{
+aScreenPosition2D.X += fLabelWidth / 2;
+aScreenPosition2D.Y += fLabelHeight / 2;
+}
 
 rPieLabelInfo.xLabelGroupShape->setPosition(aScreenPosition2D);
 }
___

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-06-02 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   21 +
 chart2/qa/extras/data/xlsx/tdf133376.xlsx  |binary
 chart2/source/view/charttypes/PieChart.cxx |   35 +
 3 files changed, 56 insertions(+)

New commits:
commit 73477348e30c6931a537cba5557c250183fbeb9b
Author: Balazs Varga 
AuthorDate: Tue May 26 14:13:00 2020 +0200
Commit: László Németh 
CommitDate: Tue Jun 2 14:07:08 2020 +0200

tdf#133376 Chart view: improve BestFit position of data labels

Put exceeding data label outside the pie slice
without overlapping the other pie slices.

Change-Id: I220fd43f0d52c940cf3ef30764074776d19da184
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94859
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index df324ee5e7a3..e47f1234ef60 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -159,6 +159,7 @@ public:
 void testTdf130032();
 void testTdf119138MissingAutoTitleDeleted();
 void testStockChartShiftedCategoryPosition();
+void testTdf133376();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -266,6 +267,7 @@ public:
 CPPUNIT_TEST(testTdf130032);
 CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted);
 CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
+CPPUNIT_TEST(testTdf133376);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2482,6 +2484,25 @@ void 
Chart2ImportTest::testStockChartShiftedCategoryPosition()
 CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
 }
 
+void Chart2ImportTest::testTdf133376()
+{
+load("/chart2/qa/extras/data/xlsx/", "tdf133376.xlsx");
+Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
+UNO_QUERY_THROW);
+
+Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
+Reference xDrawPage(xDrawPageSupplier->getDrawPage(), 
UNO_SET_THROW);
+Reference xShapes(xDrawPage->getByIndex(0), 
UNO_QUERY_THROW);
+Reference xDataPointLabel(getShapeByName(xShapes,
+"CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=2"), 
UNO_SET_THROW);
+
+CPPUNIT_ASSERT(xDataPointLabel.is());
+// Check the position of the 3rd data point label, which is out from the 
pie slice
+awt::Point aLabelPosition = xDataPointLabel->getPosition();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1466, aLabelPosition.X, 30);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(5269, aLabelPosition.Y, 30);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/tdf133376.xlsx 
b/chart2/qa/extras/data/xlsx/tdf133376.xlsx
new file mode 100644
index ..2000733ec8ba
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf133376.xlsx differ
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 009552c1800f..03e928a85c23 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -1591,6 +1591,41 @@ void PieChart::performLabelBestFit(ShapeParam& 
rShapeParam, PieLabelInfo const &
 aTranslationVector.setLength(150);
 aScreenPosition2D.X += aTranslationVector.getX();
 aScreenPosition2D.Y += aTranslationVector.getY();
+
+double fAngleDegree = rShapeParam.mfUnitCircleStartAngleDegree + 
rShapeParam.mfUnitCircleWidthAngleDegree / 2.0;
+::basegfx::B2IRectangle aBb(lcl_getRect(rPieLabelInfo.xLabelGroupShape));
+double fLabelWidth = aBb.getWidth();
+double fLabelHeight = aBb.getHeight();
+
+while (fAngleDegree > 360.0)
+fAngleDegree -= 360.0;
+while (fAngleDegree < 0.0)
+fAngleDegree += 360.0;
+
+if( fAngleDegree <= 22.5 || fAngleDegree >= 337.5 )
+aScreenPosition2D.Y -= fLabelHeight / 2;
+else if( fAngleDegree < 67.5 )
+aScreenPosition2D.Y -= fLabelHeight;
+else if( fAngleDegree < 112.5 )
+{
+aScreenPosition2D.X -= fLabelWidth / 2;
+aScreenPosition2D.Y -= fLabelHeight;
+}
+else if (fAngleDegree <= 157.5)
+{
+aScreenPosition2D.X -= fLabelWidth;
+aScreenPosition2D.Y -= fLabelHeight;
+}
+else if (fAngleDegree <= 202.5)
+{
+aScreenPosition2D.X -= fLabelWidth;
+aScreenPosition2D.Y -= fLabelHeight / 2;
+}
+else if (fAngleDegree < 247.5)
+aScreenPosition2D.X -= fLabelWidth;
+else if (fAngleDegree < 292.5)
+aScreenPosition2D.X -= fLabelWidth / 2;
+
 rPieLabelInfo.xLabelGroupShape->setPosition(aScreenPosition2D);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source chart2/workbench

2020-05-18 Thread Noel Grandin (via logerrit)
 chart2/qa/extras/chart2export.cxx  |   12 -
 chart2/qa/extras/charttest.hxx |   50 
++--
 chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx |   20 -
 chart2/source/controller/chartapiwrapper/TitleWrapper.cxx  |   12 -
 chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx  |   24 
--
 chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx   |6 
 chart2/source/controller/dialogs/DataBrowserModel.cxx  |   56 
++--
 chart2/source/controller/dialogs/DialogModel.cxx   |   35 
+-
 chart2/source/controller/dialogs/tp_AxisPositions.cxx  |4 
 chart2/source/controller/dialogs/tp_DataSource.cxx |   10 
 chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx|   11 
 chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx |4 
 chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx |4 
 chart2/source/controller/main/ChartController_Insert.cxx   |   12 -
 chart2/source/controller/main/ChartModelClone.cxx  |8 
 chart2/source/controller/main/ObjectHierarchy.cxx  |   11 
 chart2/source/model/filter/XMLFilter.cxx   |   12 -
 chart2/source/model/main/ChartModel_Persistence.cxx|6 
 chart2/source/model/template/BubbleDataInterpreter.cxx |   13 -
 chart2/source/model/template/ChartType.cxx |   10 
 chart2/source/model/template/ChartTypeTemplate.cxx |   65 
++---
 chart2/source/model/template/ColumnLineChartTypeTemplate.cxx   |   20 -
 chart2/source/model/template/DataInterpreter.cxx   |   32 
+-
 chart2/source/model/template/PieChartTypeTemplate.cxx  |   22 -
 chart2/source/model/template/StockChartTypeTemplate.cxx|   20 -
 chart2/source/model/template/StockDataInterpreter.cxx  |6 
 chart2/source/model/template/XYDataInterpreter.cxx |   27 
+-
 chart2/source/tools/AxisHelper.cxx |   56 
++--
 chart2/source/tools/ChartModelHelper.cxx   |8 
 chart2/source/tools/ConfigColorScheme.cxx  |6 
 chart2/source/tools/DataSeriesHelper.cxx   |   44 
+--
 chart2/source/tools/DataSourceHelper.cxx   |   16 -
 chart2/source/tools/DiagramHelper.cxx  |  120 
--
 chart2/source/tools/ErrorBar.cxx   |6 
 chart2/source/tools/MediaDescriptorHelper.cxx  |4 
 chart2/source/tools/ObjectIdentifier.cxx   |   11 
 chart2/source/tools/RangeHighlighter.cxx   |8 
 chart2/source/tools/ReferenceSizeProvider.cxx  |   30 
+-
 chart2/source/tools/RegressionCurveHelper.cxx  |   60 
++---
 chart2/source/tools/TitleHelper.cxx|6 
 chart2/source/tools/WrappedPropertySet.cxx |   10 
 chart2/source/view/axes/VCartesianGrid.cxx |6 
 chart2/source/view/axes/VCoordinateSystem.cxx  |9 
 chart2/source/view/charttypes/VSeriesPlotter.cxx   |   19 -
 chart2/source/view/main/ShapeFactory.cxx   |   13 -
 chart2/source/view/main/VDataSeries.cxx|8 
 chart2/workbench/addin/sampleaddin.cxx |2 
 47 files changed, 450 insertions(+), 504 deletions(-)

New commits:
commit 337a9a454c1bc95214111578d3f9c0622c55c509
Author: Noel Grandin 
AuthorDate: Mon May 18 09:17:04 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon May 18 11:28:50 2020 +0200

use for-range on Sequence in chart2

Change-Id: Ief02e5d5284b0cbad26b04c0a282dccfee577b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94398
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index f960edf8b1a0..84a38b258733 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -775,15 +775,15 @@ void Chart2ExportTest::testEmbeddingsGrabBag()
const char* const testEmbeddedFileNames[] 
{"word/embeddings/Microsoft_Excel_Worksheet3.xlsx",
 
"word/embeddings/Microsoft_Excel_Worksheet2.xlsx",
 
"word/embeddings/Microsoft_Excel_Worksheet1.xlsx"};
-   for(int i = 0; i < aGrabBag.getLength(); ++i)
+   for(beans::PropertyValue const & prop : std::as_const(aGrabBag))
{
-   

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-04-27 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   17 +
 chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt   |binary
 chart2/source/inc/ChartTypeHelper.hxx  |1 -
 chart2/source/model/template/ChartTypeTemplate.cxx |5 +
 chart2/source/tools/ChartTypeHelper.cxx|   13 -
 5 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 06a8f5d17061a8fd59fa37c0cdd1a89c72223337
Author: Tünde Tóth 
AuthorDate: Wed Apr 22 16:00:49 2020 +0200
Commit: László Németh 
CommitDate: Mon Apr 27 12:53:34 2020 +0200

tdf#132355 fix X axis position of stock charts

Set the ShiftedCategoryPosition for true in case of stock chart.

Regression from commit: 111c260ab2883b7906f1a66e222dbf4dc3c58c4f
(tdf#12 OOXML chart export: fix "CrossBetween" for not imported charts)

Change-Id: I7ced1b03158908e838f7bb44c89dea23c5b347b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92759
Reviewed-by: Balazs Varga 
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 844d7208bac0..df324ee5e7a3 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -158,6 +158,7 @@ public:
 void testDataPointLabelCustomPos();
 void testTdf130032();
 void testTdf119138MissingAutoTitleDeleted();
+void testStockChartShiftedCategoryPosition();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -264,6 +265,7 @@ public:
 CPPUNIT_TEST(testDataPointLabelCustomPos);
 CPPUNIT_TEST(testTdf130032);
 CPPUNIT_TEST(testTdf119138MissingAutoTitleDeleted);
+CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2465,6 +2467,21 @@ void 
Chart2ImportTest::testTdf119138MissingAutoTitleDeleted()
 CPPUNIT_ASSERT_MESSAGE("Missing autoTitleDeleted is implied to be True if 
title text is present", xTitle.is());
 }
 
+void Chart2ImportTest::testStockChartShiftedCategoryPosition()
+{
+load("/chart2/qa/extras/data/odt/", "stock_chart_LO_6_2.odt");
+
+uno::Reference xChartDoc(getChartDocFromWriter(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
+CPPUNIT_ASSERT(xAxis.is());
+
+chart2::ScaleData aScaleData = xAxis->getScaleData();
+CPPUNIT_ASSERT(aScaleData.Categories.is());
+CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt 
b/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt
new file mode 100644
index ..06e15a6b0ddc
Binary files /dev/null and b/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt 
differ
diff --git a/chart2/source/inc/ChartTypeHelper.hxx 
b/chart2/source/inc/ChartTypeHelper.hxx
index b4af58240460..f9ba155b397e 100644
--- a/chart2/source/inc/ChartTypeHelper.hxx
+++ b/chart2/source/inc/ChartTypeHelper.hxx
@@ -46,7 +46,6 @@ public:
 static bool isSupportingStartingAngle(   const css::uno::Reference< 
css::chart2::XChartType >& xChartType );
 //starting value for bars or baseline for areas for example
 static bool isSupportingBaseValue(   const css::uno::Reference< 
css::chart2::XChartType >& xChartType );
-static bool shiftCategoryPosAtXAxisPerDefault( const 
css::uno::Reference< css::chart2::XChartType >& xChartType );
 static bool isSupportingAxisPositioning( const css::uno::Reference< 
css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 
nDimensionIndex );
 static bool isSupportingDateAxis( const css::uno::Reference< 
css::chart2::XChartType >& xChartType, sal_Int32 nDimensionIndex );
 static bool isSupportingComplexCategory( const css::uno::Reference< 
css::chart2::XChartType >& xChartType );
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx 
b/chart2/source/model/template/ChartTypeTemplate.cxx
index 646560d04adb..023becdd0698 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -626,10 +626,7 @@ void ChartTypeTemplate::adaptScales(
 Reference< XChartType > 
xChartType(getChartTypeForNewSeries(Sequence< Reference< XChartType > >()));
 if( aData.AxisType == AxisType::CATEGORY )
 {
-if( !m_aServiceName.endsWith("ColumnWithLine") 
)
-aData.ShiftedCategoryPosition = 
::chart::ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault(xChartType);
-else
-aData.ShiftedCategoryPosition = true;
+aData.ShiftedCategoryPosition = 
m_aServiceName.indexOf("Column") != -1 || 

[Libreoffice-commits] core.git: chart2/qa chart2/source include/xmloff xmloff/inc xmloff/source

2020-04-17 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx   |   33 
++
 chart2/qa/extras/data/ods/tdf131115.ods |binary
 chart2/qa/extras/data/ods/tdf131979.ods |binary
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx |   12 +--
 include/xmloff/prstylei.hxx |2 
 xmloff/inc/XMLChartStyleContext.hxx |2 
 xmloff/source/chart/SchXMLSeries2Context.cxx|   22 
++
 7 files changed, 65 insertions(+), 6 deletions(-)

New commits:
commit 434d92a51409b0847ee7d313b50fc547b7615bff
Author: Balazs Varga 
AuthorDate: Thu Apr 9 13:45:10 2020 +0200
Commit: László Németh 
CommitDate: Fri Apr 17 12:16:17 2020 +0200

tdf#131979 Chart ODF import-export of Link to source format

setting also into data point styles, fixing lost numbering
style of custom data points. (Only export into the data
series style was supported previously.)

Also fix tdf#131115 - FILEOPEN: Incorrect format of single data label
Regression from commit: e57d90cd4e51a1353eafc87bb29cfe6076704a7c
(tdf#129173 tdf#129175 Fix number format of data labels)

Data point styles in older ODF files do not contain the
'link-data-style-to-source' property, so they used the
data series style property during the import previously.
Now we set the default false value, if the data point
style contains a 'data-style-name' (number format).

Change-Id: I4786e62ca75770ed632463bcf1275ece7ea793f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91967
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 10b284adb344..378e2361d034 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -164,6 +164,7 @@ public:
 void testTdf126076();
 void testTdf75330();
 void testTdf127792();
+void testTdf131979();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest);
 CPPUNIT_TEST(testErrorBarXLSX);
@@ -291,6 +292,7 @@ public:
 CPPUNIT_TEST(testTdf126076);
 CPPUNIT_TEST(testTdf75330);
 CPPUNIT_TEST(testTdf127792);
+CPPUNIT_TEST(testTdf131979);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2678,6 +2680,37 @@ void Chart2ExportTest::testTdf127792()
 }
 }
 
+void Chart2ExportTest::testTdf131979()
+{
+load("/chart2/qa/extras/data/ods/", "tdf131115.ods");
+{
+reload("calc8");
+Reference xChartDoc = getChartDocFromSheet(0, 
mxComponent);
+CPPUNIT_ASSERT(xChartDoc.is());
+Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+CPPUNIT_ASSERT(xDataSeries.is());
+Reference xPropertySet;
+xPropertySet.set(xDataSeries->getDataPointByIndex(2), 
uno::UNO_SET_THROW);
+bool blinknumberformattosource = true;
+
CPPUNIT_ASSERT(xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) 
>>= blinknumberformattosource);
+CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to 
false.", !blinknumberformattosource);
+}
+
+load("/chart2/qa/extras/data/ods/", "tdf131979.ods");
+{
+reload("calc8");
+Reference xChartDoc = getChartDocFromSheet(0, 
mxComponent);
+CPPUNIT_ASSERT(xChartDoc.is());
+Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+CPPUNIT_ASSERT(xDataSeries.is());
+Reference xPropertySet;
+xPropertySet.set(xDataSeries->getDataPointByIndex(2), 
uno::UNO_SET_THROW);
+bool blinknumberformattosource = true;
+
CPPUNIT_ASSERT(xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) 
>>= blinknumberformattosource);
+CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to 
true.", blinknumberformattosource);
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/ods/tdf131115.ods 
b/chart2/qa/extras/data/ods/tdf131115.ods
new file mode 100644
index ..76a87c2c226c
Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf131115.ods differ
diff --git a/chart2/qa/extras/data/ods/tdf131979.ods 
b/chart2/qa/extras/data/ods/tdf131979.ods
new file mode 100644
index ..3dfcf6b699f9
Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf131979.ods differ
diff --git 
a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index db8fd95abea7..a695076a4c13 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -118,6 +118,12 @@ void lcl_AddPropertiesToVector_PointProperties(
   beans::PropertyAttribute::BOUND
   | beans::PropertyAttribute::MAYBEVOID );

[Libreoffice-commits] core.git: chart2/qa chart2/source include/xmloff offapi/com schema/libreoffice xmloff/source

2020-04-09 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2export.cxx   |   23 +-
 chart2/qa/extras/data/docx/MSO_axis_position.docx   |binary
 chart2/source/controller/chartapiwrapper/AxisWrapper.cxx|   10 ++
 chart2/source/model/main/Axis.cxx   |   11 ++-
 include/xmloff/xmltoken.hxx |1 
 offapi/com/sun/star/chart2/Axis.idl |6 +
 schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng |9 ++
 xmloff/source/chart/PropertyMap.hxx |1 
 xmloff/source/chart/SchXMLAxisContext.cxx   |   43 ++--
 xmloff/source/chart/SchXMLExport.cxx|   29 ++--
 xmloff/source/core/xmltoken.cxx |1 
 xmloff/source/token/tokens.txt  |1 
 12 files changed, 104 insertions(+), 31 deletions(-)

New commits:
commit 40d83914d43f60a196dfabddea0b52e2046b333a
Author: Tünde Tóth 
AuthorDate: Fri Mar 6 10:29:03 2020 +0100
Commit: László Németh 
CommitDate: Thu Apr 9 11:12:22 2020 +0200

tdf#127792 implement UNO chart attribute MajorOrigin

based on the specification in OFFICE-3936 for ODF 1.4:

https://issues.oasis-open.org/browse/OFFICE-3936

Note: import of the embedded chart of the DOCX unit test
document uses also ODF format in the background, testing
also the extension of the native file format.

Follow-up of commit 830e539547c463b932ce643517f880789185032d
(tdf#127393 OOXML chart import: fix X axis position setting
"CrossBetween"). See also commits with "ShiftedCategoryPosition"
in their descriptions.

Change-Id: I9cd278ac0172c0fab7c51d585a65c34a0ad60b82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90081
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 589225e8cd2e..8e2e1a84bcf9 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -133,7 +133,7 @@ public:
 void testCrossBetweenODS();
 void testAxisTitleRotationXLSX();
 void testAxisTitlePositionDOCX();
-void testAxisCrossBetweenXSLX();
+void testAxisCrossBetweenDOCX();
 void testPieChartDataPointExplosionXLSX();
 void testCustomDataLabel();
 void testCustomPositionofDataLabel();
@@ -161,6 +161,7 @@ public:
 void testTdf130225();
 void testTdf126076();
 void testTdf75330();
+void testTdf127792();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest);
 CPPUNIT_TEST(testErrorBarXLSX);
@@ -257,7 +258,7 @@ public:
 CPPUNIT_TEST(testCrossBetweenODS);
 CPPUNIT_TEST(testAxisTitleRotationXLSX);
 CPPUNIT_TEST(testAxisTitlePositionDOCX);
-CPPUNIT_TEST(testAxisCrossBetweenXSLX);
+CPPUNIT_TEST(testAxisCrossBetweenDOCX);
 CPPUNIT_TEST(testPieChartDataPointExplosionXLSX);
 CPPUNIT_TEST(testCustomDataLabel);
 CPPUNIT_TEST(testCustomPositionofDataLabel);
@@ -285,6 +286,7 @@ public:
 CPPUNIT_TEST(testTdf130225);
 CPPUNIT_TEST(testTdf126076);
 CPPUNIT_TEST(testTdf75330);
+CPPUNIT_TEST(testTdf127792);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2105,7 +2107,7 @@ void Chart2ExportTest::testAxisTitlePositionDOCX()
 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.384070199122511, nY, 1e-2);
 }
 
-void Chart2ExportTest::testAxisCrossBetweenXSLX()
+void Chart2ExportTest::testAxisCrossBetweenDOCX()
 {
 load("/chart2/qa/extras/data/odt/", "axis-position.odt");
 xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML 
Text");
@@ -2634,6 +2636,21 @@ void Chart2ExportTest::testTdf75330()
 }
 }
 
+void Chart2ExportTest::testTdf127792()
+{
+load("/chart2/qa/extras/data/docx/", "MSO_axis_position.docx");
+{
+xmlDocPtr pXmlDoc = parseExport("word/charts/chart1", "Office Open XML 
Text");
+CPPUNIT_ASSERT(pXmlDoc);
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between");
+}
+{
+xmlDocPtr pXmlDoc = parseExport("word/charts/chart2", "Office Open XML 
Text");
+CPPUNIT_ASSERT(pXmlDoc);
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "midCat");
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/MSO_axis_position.docx 
b/chart2/qa/extras/data/docx/MSO_axis_position.docx
new file mode 100644
index ..a9955b7b1ad7
Binary files /dev/null and b/chart2/qa/extras/data/docx/MSO_axis_position.docx 
differ
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 3516d7a29ba2..b0a1d5f85746 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -96,7 +96,8 @@ enum
 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-04-07 Thread Noel Grandin (via logerrit)
 chart2/qa/extras/charttest.hxx  |1 -
 chart2/source/tools/ObjectIdentifier.cxx|6 ++
 chart2/source/view/axes/VPolarAngleAxis.cxx |3 ---
 3 files changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 5366cadd6cda9b3c7b4b549a0c9b8c895ea47843
Author: Noel Grandin 
AuthorDate: Mon Apr 6 21:45:37 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 7 08:31:20 2020 +0200

loplugin:unusedvariableplus in chart2

Change-Id: I8bb958718f71b52819755f3af6d5fcff4af1f596
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91782
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index db9a4ed63465..60a526be0b8a 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -379,7 +379,6 @@ uno::Sequence < OUString > 
getWriterChartColumnDescriptions( Reference< lang::XC
 xChartDoc.set( xPropertySet->getPropertyValue( "Model" ), uno::UNO_QUERY );
 CPPUNIT_ASSERT( xChartDoc.is() );
 CPPUNIT_ASSERT( xChartDoc->getDataProvider().is() );
-uno::Reference xProp(xChartDoc->getDataProvider(), 
uno::UNO_QUERY );
 uno::Reference< chart2::XAnyDescriptionAccess > xAnyDescriptionAccess ( 
xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
 uno::Sequence< OUString > seriesList = 
xAnyDescriptionAccess->getColumnDescriptions();
 return seriesList;
diff --git a/chart2/source/tools/ObjectIdentifier.cxx 
b/chart2/source/tools/ObjectIdentifier.cxx
index 3c2c45a19e74..c0fc94ec1326 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -621,11 +621,10 @@ OUString ObjectIdentifier::createParticleForSeries(
 return aRet.makeStringAndClear();
 }
 
-OUString ObjectIdentifier::createParticleForLegend( ChartModel& rModel )
+OUString ObjectIdentifier::createParticleForLegend( ChartModel&  )
 {
 OUStringBuffer aRet;
 
-Reference< XDiagram > xDiagram( rModel.getFirstDiagram() );
 //todo: if more than one diagram is implemented, find the correct diagram 
which is owner of the given legend
 
 aRet.append( ObjectIdentifier::createParticleForDiagram() );
@@ -637,11 +636,10 @@ OUString ObjectIdentifier::createParticleForLegend( 
ChartModel& rModel )
 }
 
 OUString ObjectIdentifier::createParticleForLegend(
-const Reference< frame::XModel >& xChartModel )
+const Reference< frame::XModel >& )
 {
 OUStringBuffer aRet;
 
-Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel 
) );
 //todo: if more than one diagram is implemented, find the correct diagram 
which is owner of the given legend
 
 aRet.append( ObjectIdentifier::createParticleForDiagram() );
diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx 
b/chart2/source/view/axes/VPolarAngleAxis.cxx
index 2c171d8bb11d..cc2427a87581 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.cxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.cxx
@@ -162,9 +162,6 @@ void VPolarAngleAxis::createLabels()
 
 if( m_aAxisProperties.m_bDisplayLabels )
 {
-//get the transformed screen values for all tickmarks in aAllTickInfos
-std::unique_ptr< TickFactory > apTickFactory( createTickFactory() );
-
 //create tick mark text shapes
 //@todo: iterate through all tick depth which should be labeled
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/source connectivity/source filter/source oox/source sal/qa sal/rtl scaddins/source sc/qa sc/source svx/source sw/source test/source v

2020-03-14 Thread Yukio Siraichi (via logerrit)
 chart2/qa/extras/chart2import.cxx |   24 +++---
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx |4 -
 chart2/source/controller/dialogs/DataBrowser.cxx  |6 -
 chart2/source/inc/CommonFunctors.hxx  |2 
 chart2/source/inc/RegressionCalculationHelper.hxx |   24 +++---
 chart2/source/tools/AxisHelper.cxx|2 
 chart2/source/tools/ExplicitCategoriesProvider.cxx|4 -
 chart2/source/tools/ExponentialRegressionCurveCalculator.cxx  |4 -
 chart2/source/tools/InternalDataProvider.cxx  |2 
 chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx  |4 -
 chart2/source/tools/MeanValueRegressionCurveCalculator.cxx|4 -
 chart2/source/tools/PotentialRegressionCurveCalculator.cxx|4 -
 chart2/source/tools/Scaling.cxx   |8 +-
 chart2/source/tools/StatisticsHelper.cxx  |6 -
 chart2/source/view/axes/DateHelper.cxx|2 
 chart2/source/view/axes/DateScaling.cxx   |4 -
 chart2/source/view/axes/ScaleAutomatism.cxx   |8 +-
 chart2/source/view/axes/VCartesianAxis.cxx|2 
 chart2/source/view/charttypes/AreaChart.cxx   |   10 +-
 chart2/source/view/charttypes/BarChart.cxx|   14 +--
 chart2/source/view/charttypes/BubbleChart.cxx |   12 +--
 chart2/source/view/charttypes/NetChart.cxx|   10 +-
 chart2/source/view/charttypes/PieChart.cxx|8 +-
 chart2/source/view/charttypes/VSeriesPlotter.cxx  |   38 +-
 chart2/source/view/main/PlotterBase.cxx   |6 -
 chart2/source/view/main/VDataSeries.cxx   |   10 +-
 comphelper/source/container/enumerablemap.cxx |2 
 connectivity/source/drivers/file/FNumericFunctions.cxx|8 +-
 filter/source/graphicfilter/itiff/itiff.cxx   |4 -
 oox/source/export/chartexport.cxx |2 
 sal/qa/rtl/math/test-rtl-math.cxx |   26 +++---
 sal/rtl/math.cxx  |2 
 sc/qa/unit/ucalc.cxx  |8 +-
 sc/qa/unit/ucalc_formula.cxx  |   26 +++---
 sc/source/core/data/dptabsrc.cxx  |2 
 sc/source/core/tool/interpr2.cxx  |2 
 sc/source/core/tool/interpr4.cxx  |2 
 scaddins/source/analysis/financial.cxx|4 -
 svx/source/items/e3ditem.cxx  |4 -
 sw/source/core/attr/cellatr.cxx   |4 -
 test/source/diff/diff.cxx |2 
 vcl/source/control/fmtfield.cxx   |2 
 xmloff/source/chart/SchXMLExport.cxx  |6 -
 xmloff/source/draw/ximp3dscene.cxx|2 
 44 files changed, 165 insertions(+), 165 deletions(-)

New commits:
commit 3bf3face224a7e12ba9521a0ac21525af22c
Author: Yukio Siraichi 
AuthorDate: Fri Mar 13 15:41:40 2020 +0900
Commit: Mike Kaganski 
CommitDate: Sat Mar 14 09:19:00 2020 +0100

tdf#130975 replace `rtl::math::isNan` with `std::isnan`.

Change-Id: I5d53e6369d35093445b2efd8936bbf8c6775ff47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90451
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 4850f33ee76c..68a142090805 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -531,8 +531,8 @@ void Chart2ImportTest::testDOCXChartEmptySeries()
 CPPUNIT_ASSERT_EQUAL(2.4, aValues[1][0]);
 CPPUNIT_ASSERT_EQUAL(4.4, aValues[1][1]);
 //test the third series (empty) values
-CPPUNIT_ASSERT(rtl::math::isNan(aValues[2][0]));
-CPPUNIT_ASSERT(rtl::math::isNan(aValues[2][1]));
+CPPUNIT_ASSERT(std::isnan(aValues[2][0]));
+CPPUNIT_ASSERT(std::isnan(aValues[2][1]));
 }
 
 void Chart2ImportTest::testDOCXChartValuesSize()
@@ -596,13 +596,13 @@ void Chart2ImportTest::testPPTXSparseChartSeries()
 
 std::vector > aValues = 
getDataSeriesYValuesFromChartType(xCT);
 CPPUNIT_ASSERT_EQUAL(size_t(2), aValues.size());
-CPPUNIT_ASSERT( rtl::math::isNan( aValues[0][0] ) );
+CPPUNIT_ASSERT( std::isnan( aValues[0][0] ) );
 CPPUNIT_ASSERT_EQUAL(2.5,  aValues[0][1]);
 CPPUNIT_ASSERT_EQUAL(3.5,  aValues[0][2]);
-CPPUNIT_ASSERT( rtl::math::isNan( aValues[0][3] ) );
+CPPUNIT_ASSERT( std::isnan( aValues[0][3] ) );
 CPPUNIT_ASSERT_EQUAL(-2.4, aValues[1][0]);
-CPPUNIT_ASSERT( rtl::math::isNan( aValues[1][1] ) );
-

[Libreoffice-commits] core.git: chart2/qa chart2/source oox/source

2020-02-20 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx|   14 
 chart2/qa/extras/data/xlsx/testTdf90749.xlsx |binary
 chart2/source/view/charttypes/VSeriesPlotter.cxx |   36 +++
 oox/source/core/xmlfilterbase.cxx|2 +
 oox/source/drawingml/chart/seriesconverter.cxx   |3 +
 oox/source/export/chartexport.cxx|9 +
 oox/source/token/namespaces-strict.txt   |1 
 oox/source/token/namespaces.hxx.tail |1 
 oox/source/token/namespaces.txt  |1 
 oox/source/token/properties.txt  |1 
 oox/source/token/tokens.txt  |1 
 11 files changed, 68 insertions(+), 1 deletion(-)

New commits:
commit 769433ad93040bc81f06672c8a2c01e2b76fece3
Author: Balazs Varga 
AuthorDate: Wed Feb 12 13:47:50 2020 +0100
Commit: László Németh 
CommitDate: Thu Feb 20 11:18:40 2020 +0100

tdf#90749 chart: add leader lines to custom data label positions

also export them as CustomXML extension for MSO interoperability.

Note: pie chart is not yet supported.

See commit 4223ff2be69f03e571464b0b09ad0d278918631b
( tdf#48436 Chart: add CustomLabelPosition UNO API property)

Change-Id: Ia8142408414d4ad8f689d789386db50038ed13f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88531
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index b9d5873052ba..88c7d154d170 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -136,6 +136,7 @@ public:
 void testCustomDataLabel();
 void testCustomPositionofDataLabel();
 void testCustomDataLabelMultipleSeries();
+void testLeaderLines();
 void testNumberFormatExportPPTX();
 void testLabelSeparatorExportDOCX();
 void testChartTitlePropertiesColorFillPPTX();
@@ -254,6 +255,7 @@ public:
 CPPUNIT_TEST(testCustomDataLabel);
 CPPUNIT_TEST(testCustomPositionofDataLabel);
 CPPUNIT_TEST(testCustomDataLabelMultipleSeries);
+CPPUNIT_TEST(testLeaderLines);
 CPPUNIT_TEST(testNumberFormatExportPPTX);
 CPPUNIT_TEST(testLabelSeparatorExportDOCX);
 CPPUNIT_TEST(testChartTitlePropertiesColorFillPPTX);
@@ -349,7 +351,8 @@ void 
Chart2ExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
 { "office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0" },
 { "table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0" },
 { "text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0" },
-{ "xlink", "http://www.w3c.org/1999/xlink; }
+{ "xlink", "http://www.w3c.org/1999/xlink; },
+{ "c15", "http://schemas.microsoft.com/office/drawing/2012/chart; }
 };
 for(size_t i = 0; i < SAL_N_ELEMENTS(aNamespaces); ++i)
 {
@@ -2246,6 +2249,15 @@ void 
Chart2ExportTest::testCustomDataLabelMultipleSeries()
 
 }
 
+void Chart2ExportTest::testLeaderLines()
+{
+load("/chart2/qa/extras/data/xlsx/", "testTdf90749.xlsx");
+xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+CPPUNIT_ASSERT(pXmlDoc);
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[1]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "1");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser[2]/c:dLbls/c:extLst/c:ext/c15:showLeaderLines",
 "val", "1");
+}
+
 void Chart2ExportTest::testNumberFormatExportPPTX()
 {
 load("/chart2/qa/extras/data/pptx/", "tdf115859.pptx");
diff --git a/chart2/qa/extras/data/xlsx/testTdf90749.xlsx 
b/chart2/qa/extras/data/xlsx/testTdf90749.xlsx
new file mode 100644
index ..ca3bc806c03c
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testTdf90749.xlsx differ
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index b6382943b418..2c46743696f6 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -86,6 +87,7 @@
 namespace chart {
 
 using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart;
 using namespace ::com::sun::star::chart2;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::Sequence;
@@ -721,7 +723,41 @@ uno::Reference< drawing::XShape > 
VSeriesPlotter::createDataLabel( const uno::Re
 {
 awt::Point aRelPos = rDataSeries.getLabelPosition(aTextShapePos, 
nPointIndex);
 if( aRelPos.X != -1 )
+{
 xTextShape->setPosition(aRelPos);
+if( 
!m_xChartTypeModel->getChartType().equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE)
 )
+{
+sal_Int32 nX1 = rScreenPosition2D.X;
+sal_Int32 nY1 = rScreenPosition2D.Y;
+   

[Libreoffice-commits] core.git: chart2/qa chart2/source solenv/clang-format

2020-02-16 Thread Muhammet Kara (via logerrit)
 chart2/qa/unit/chart2-dialogs-test.cxx|4 +---
 chart2/source/controller/dialogs/TextDirectionListBox.cxx |1 -
 chart2/source/controller/inc/dlg_InsertDataLabel.hxx  |3 ++-
 chart2/source/controller/inc/dlg_InsertTitle.hxx  |4 ++--
 chart2/source/controller/inc/dlg_ShapeFont.hxx|4 ++--
 chart2/source/controller/inc/dlg_ShapeParagraph.hxx   |2 +-
 chart2/source/inc/AxisIndexDefines.hxx|1 -
 chart2/source/inc/MutexContainer.hxx  |1 -
 chart2/source/inc/StackMode.hxx   |1 -
 chart2/source/inc/TrueGuard.hxx   |3 +--
 chart2/source/inc/servicenames.hxx|1 -
 solenv/clang-format/blacklist |   11 ---
 12 files changed, 9 insertions(+), 27 deletions(-)

New commits:
commit 1ec5204eb5f0afd29f487205f8e3f1ea9d626059
Author: Muhammet Kara 
AuthorDate: Sun Feb 16 10:40:22 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sun Feb 16 11:05:14 2020 +0100

clang-format chart2 with under 5-percent lines of change

Change-Id: Ia60d23c7a75086c2a68e0e295b99a3df3dfd164f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88771
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/chart2/qa/unit/chart2-dialogs-test.cxx 
b/chart2/qa/unit/chart2-dialogs-test.cxx
index ef99582eb517..c37fb1e1bbe2 100644
--- a/chart2/qa/unit/chart2-dialogs-test.cxx
+++ b/chart2/qa/unit/chart2-dialogs-test.cxx
@@ -36,9 +36,7 @@ public:
 CPPUNIT_TEST_SUITE_END();
 };
 
-Chart2DialogsTest::Chart2DialogsTest()
-{
-}
+Chart2DialogsTest::Chart2DialogsTest() {}
 
 void Chart2DialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
 {
diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx 
b/chart2/source/controller/dialogs/TextDirectionListBox.cxx
index 611251df8451..68181fdfc726 100644
--- a/chart2/source/controller/dialogs/TextDirectionListBox.cxx
+++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx
@@ -23,7 +23,6 @@
 
 namespace chart
 {
-
 TextDirectionListBox::TextDirectionListBox(std::unique_ptr 
pControl)
 : svx::FrameDirectionListBox(std::move(pControl))
 {
diff --git a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx 
b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx
index a16815b7a379..c39d608d1e8a 100644
--- a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx
+++ b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx
@@ -35,7 +35,8 @@ private:
 std::unique_ptr m_apDataLabelResources;
 
 public:
-DataLabelsDialog(weld::Window* pParent, const SfxItemSet& rInAttrs, 
SvNumberFormatter* pFormatter);
+DataLabelsDialog(weld::Window* pParent, const SfxItemSet& rInAttrs,
+ SvNumberFormatter* pFormatter);
 virtual ~DataLabelsDialog() override;
 
 void FillItemSet(SfxItemSet& rOutAttrs);
diff --git a/chart2/source/controller/inc/dlg_InsertTitle.hxx 
b/chart2/source/controller/inc/dlg_InsertTitle.hxx
index c09c1becf709..7eea6f2bbc86 100644
--- a/chart2/source/controller/inc/dlg_InsertTitle.hxx
+++ b/chart2/source/controller/inc/dlg_InsertTitle.hxx
@@ -28,12 +28,12 @@ namespace chart
 class SchTitleDlg : public weld::GenericDialogController
 {
 private:
-std::unique_ptr  m_xTitleResources;
+std::unique_ptr m_xTitleResources;
 
 public:
 SchTitleDlg(weld::Window* pParent, const TitleDialogData& rInput);
 
-void getResult( TitleDialogData& rOutput );
+void getResult(TitleDialogData& rOutput);
 };
 
 } //namespace chart
diff --git a/chart2/source/controller/inc/dlg_ShapeFont.hxx 
b/chart2/source/controller/inc/dlg_ShapeFont.hxx
index 21abdcd17dea..5429b8449dd7 100644
--- a/chart2/source/controller/inc/dlg_ShapeFont.hxx
+++ b/chart2/source/controller/inc/dlg_ShapeFont.hxx
@@ -23,7 +23,6 @@
 
 namespace chart
 {
-
 class ViewElementListProvider;
 
 /** dialog for font properties of shapes
@@ -32,7 +31,8 @@ class ShapeFontDialog : public SfxTabDialogController
 {
 public:
 ShapeFontDialog(weld::Window* pParent, const SfxItemSet* pAttr,
-const ViewElementListProvider* pViewElementListProvider);
+const ViewElementListProvider* pViewElementListProvider);
+
 private:
 virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
 
diff --git a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx 
b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
index 14fbf5f0cc8c..6e214dfbc91a 100644
--- a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
+++ b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
@@ -23,13 +23,13 @@
 
 namespace chart
 {
-
 /** dialog for paragraph properties of shapes
  */
 class ShapeParagraphDialog : public SfxTabDialogController
 {
 public:
 ShapeParagraphDialog(weld::Window* pParent, const SfxItemSet* pAttr);
+
 private:
 virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
 };
diff 

[Libreoffice-commits] core.git: chart2/qa chart2/source offapi/com oox/source

2020-01-31 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   25 +
 chart2/qa/extras/data/xlsx/testTdf130032.xlsx  |binary
 chart2/source/view/main/VDataSeries.cxx|   12 +++-
 offapi/com/sun/star/chart/DataLabelPlacement.idl   |2 
 offapi/com/sun/star/chart2/DataPointProperties.idl |2 
 oox/source/drawingml/chart/seriesconverter.cxx |   53 +
 oox/source/drawingml/chart/typegroupconverter.cxx  |4 -
 7 files changed, 40 insertions(+), 58 deletions(-)

New commits:
commit dff7a46fb46d1fa2a3ad674ee493ae2d59150fe3
Author: Balazs Varga 
AuthorDate: Thu Jan 30 23:58:57 2020 +0100
Commit: László Németh 
CommitDate: Fri Jan 31 10:43:22 2020 +0100

tdf#130032 Chart OOXML Import: fix data label custom position

in case of all chart types except pie chart.

Clean up commit 4223ff2be69f03e571464b0b09ad0d278918631b
(tdf#48436 Chart: add CustomLabelPosition UNO API property).

Note: use the correct default OOXML label placement in case of
radar charts.

Change-Id: I9a8f509304b3c70d879c8c6a95bc91d15ac28521
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87759
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 47b2e0354d51..054b04209db2 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -153,6 +153,7 @@ public:
 void testTdf123206CustomLabelField();
 void testTdf125444PercentageCustomLabel();
 void testDataPointLabelCustomPos();
+void testTdf130032();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -254,6 +255,7 @@ public:
 CPPUNIT_TEST(testTdf123206CustomLabelField);
 CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
 CPPUNIT_TEST(testDataPointLabelCustomPos);
+CPPUNIT_TEST(testTdf130032);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2353,6 +2355,7 @@ void 
Chart2ImportTest::testTdf125444PercentageCustomLabel()
 
 void Chart2ImportTest::testDataPointLabelCustomPos()
 {
+// test CustomLabelPosition on Bar chart
 load("/chart2/qa/extras/data/xlsx/", "testDataPointLabelCustomPos.xlsx");
 uno::Reference< chart2::XChartDocument > xChartDoc = 
getChartDocFromSheet(0, mxComponent);
 CPPUNIT_ASSERT(xChartDoc.is());
@@ -2372,6 +2375,28 @@ void Chart2ImportTest::testDataPointLabelCustomPos()
 CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::OUTSIDE, aPlacement);
 }
 
+void Chart2ImportTest::testTdf130032()
+{
+// test CustomLabelPosition on Line chart
+load("/chart2/qa/extras/data/xlsx/", "testTdf130032.xlsx");
+uno::Reference< chart2::XChartDocument > xChartDoc = 
getChartDocFromSheet(0, mxComponent);
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+CPPUNIT_ASSERT(xDataSeries.is());
+
+uno::Reference 
xPropertySet(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW);
+CPPUNIT_ASSERT(xPropertySet.is());
+
+chart2::RelativePosition aCustomLabelPosition;
+xPropertySet->getPropertyValue("CustomLabelPosition") >>= 
aCustomLabelPosition;
+CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Primary, 
-0.04383334, 1e-7);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Secondary, 
0.086794050743657, 1e-7);
+
+sal_Int32 aPlacement;
+xPropertySet->getPropertyValue("LabelPlacement") >>= aPlacement;
+CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::RIGHT, aPlacement);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/testTdf130032.xlsx 
b/chart2/qa/extras/data/xlsx/testTdf130032.xlsx
new file mode 100644
index ..03a3dbf403c3
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/testTdf130032.xlsx 
differ
diff --git a/chart2/source/view/main/VDataSeries.cxx 
b/chart2/source/view/main/VDataSeries.cxx
index 33bf9bee481d..f64cb151a2d8 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -641,8 +641,10 @@ awt::Point VDataSeries::getLabelPosition( awt::Point 
aTextShapePos, sal_Int32 nP
 aPos.Y = static_cast(aCustomLabelPosition.Secondary * 
m_aReferenceSize.Height) + aTextShapePos.Y;
 }
 }
-catch (const uno::Exception&) {}
-
+catch (const uno::Exception&)
+{
+TOOLS_WARN_EXCEPTION("chart2", "");
+}
 return aPos;
 }
 
@@ -659,8 +661,10 @@ bool VDataSeries::isLabelCustomPos(sal_Int32 nPointIndex) 
const
 bCustom = true;
 }
 }
-catch (const uno::Exception&) {}
-
+catch (const uno::Exception&)
+{
+TOOLS_WARN_EXCEPTION("chart2", "");
+}
 return bCustom;
 }
 
diff --git a/offapi/com/sun/star/chart/DataLabelPlacement.idl 
b/offapi/com/sun/star/chart/DataLabelPlacement.idl
index fbdc19fcce8f..f8e50effeaea 100644
--- a/offapi/com/sun/star/chart/DataLabelPlacement.idl

[Libreoffice-commits] core.git: chart2/qa chart2/source compilerplugins/clang offapi/com oox/source sd/qa

2020-01-30 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   24 
++
 chart2/qa/extras/data/xlsx/testDataPointLabelCustomPos.xlsx|binary
 chart2/source/controller/chartapiwrapper/LegendWrapper.cxx |2 
 chart2/source/controller/inc/PositionAndSizeHelper.hxx |2 
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |   13 ++-
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx |   11 ++
 chart2/source/controller/main/ChartController_Position.cxx |2 
 chart2/source/controller/main/ChartController_Window.cxx   |2 
 chart2/source/controller/main/PositionAndSizeHelper.cxx|   30 
+++
 chart2/source/model/main/DataPointProperties.cxx   |7 +
 chart2/source/model/main/DataPointProperties.hxx   |3 
 chart2/source/tools/DataSeriesHelper.cxx   |2 
 chart2/source/tools/ObjectIdentifier.cxx   |1 
 chart2/source/view/charttypes/VSeriesPlotter.cxx   |   10 ++
 chart2/source/view/inc/VDataSeries.hxx |4 +
 chart2/source/view/main/VDataSeries.cxx|   40 
+-
 compilerplugins/clang/unusedenumconstants.writeonly.results|2 
 offapi/com/sun/star/chart/DataLabelPlacement.idl   |1 
 offapi/com/sun/star/chart2/DataPointProperties.idl |7 +
 oox/source/drawingml/chart/seriesconverter.cxx |   31 
+--
 oox/source/token/properties.txt|1 
 sd/qa/unit/import-tests.cxx|7 +
 22 files changed, 177 insertions(+), 25 deletions(-)

New commits:
commit 4223ff2be69f03e571464b0b09ad0d278918631b
Author: Balazs Varga 
AuthorDate: Wed Jan 15 16:31:35 2020 +0100
Commit: László Németh 
CommitDate: Thu Jan 30 10:43:02 2020 +0100

tdf#48436 Chart: add CustomLabelPosition UNO API property

and CUSTOM DataLabelPlacement to support custom data label positions,
and its initial implementation: only UI support with OOXML import
(tdf#130030), yet.

Change-Id: I01d986071d78ae3e2a5f43d5711e9f60b8410c21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86859
Tested-by: Jenkins
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 223ca95b2b32..47b2e0354d51 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -151,6 +152,7 @@ public:
 void testTdf122765();
 void testTdf123206CustomLabelField();
 void testTdf125444PercentageCustomLabel();
+void testDataPointLabelCustomPos();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -251,6 +253,7 @@ public:
 CPPUNIT_TEST(testTdf122765);
 CPPUNIT_TEST(testTdf123206CustomLabelField);
 CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
+CPPUNIT_TEST(testDataPointLabelCustomPos);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2348,6 +2351,27 @@ void 
Chart2ImportTest::testTdf125444PercentageCustomLabel()
 CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType_PERCENTAGE, 
aLabelFields[2]->getFieldType());
 }
 
+void Chart2ImportTest::testDataPointLabelCustomPos()
+{
+load("/chart2/qa/extras/data/xlsx/", "testDataPointLabelCustomPos.xlsx");
+uno::Reference< chart2::XChartDocument > xChartDoc = 
getChartDocFromSheet(0, mxComponent);
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+CPPUNIT_ASSERT(xDataSeries.is());
+
+uno::Reference 
xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
+CPPUNIT_ASSERT(xPropertySet.is());
+
+chart2::RelativePosition aCustomLabelPosition;
+xPropertySet->getPropertyValue("CustomLabelPosition") >>= 
aCustomLabelPosition;
+CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Primary, 
-0.14621409921671025, 1e-7);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(aCustomLabelPosition.Secondary, 
-5.2887961029923464E-2, 1e-7);
+
+sal_Int32 aPlacement;
+xPropertySet->getPropertyValue("LabelPlacement") >>= aPlacement;
+CPPUNIT_ASSERT_EQUAL(chart::DataLabelPlacement::OUTSIDE, aPlacement);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/testDataPointLabelCustomPos.xlsx 
b/chart2/qa/extras/data/xlsx/testDataPointLabelCustomPos.xlsx
new file mode 100644
index ..69f89ec0e4c2
Binary files /dev/null and 
b/chart2/qa/extras/data/xlsx/testDataPointLabelCustomPos.xlsx differ
diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
index e4059c6d4b74..4dce225ba570 100644

[Libreoffice-commits] core.git: chart2/qa chart2/source

2020-01-14 Thread Noel Grandin (via logerrit)
 chart2/qa/extras/PivotChartTest.cxx
|4 ++--
 chart2/source/controller/chartapiwrapper/AreaWrapper.cxx   
|5 +
 chart2/source/controller/chartapiwrapper/AxisWrapper.cxx   
|5 +
 chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
|5 +
 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx  
|5 +
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx  
|5 +
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
|5 +
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
|5 +
 chart2/source/controller/chartapiwrapper/GridWrapper.cxx   
|5 +
 chart2/source/controller/chartapiwrapper/LegendWrapper.cxx 
|5 +
 chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx 
|5 +
 chart2/source/controller/chartapiwrapper/TitleWrapper.cxx  
|5 +
 chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx  
|5 +
 chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx  
|5 +
 chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx  
|6 +-
 
chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx 
   |5 +
 
chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx
 |5 +
 chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx
|5 +
 chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx  
|5 +
 chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx   
|5 +
 chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx   
|5 +
 chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx  
|5 +
 chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx
|5 +
 chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx  
|5 +
 chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx   
|5 +
 chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx   
|5 +
 chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
|7 ++-
 chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
|5 +
 chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx   
|5 +
 chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx   
|2 +-
 chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx 
|2 +-
 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx  
|4 ++--
 chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx  
|4 ++--
 chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx 
|4 ++--
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx 
|4 ++--
 chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx  
|5 +
 chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx   
|3 +--
 chart2/source/controller/itemsetwrapper/ItemConverter.cxx  
|4 ++--
 chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx
|5 +
 chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
|4 ++--
 chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx  
|4 ++--
 chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx   
|5 +
 chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx
|4 ++--
 chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx 
|5 +
 chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
|5 +
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx 
|4 ++--
 chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx 
|3 +--
 chart2/source/controller/main/ToolbarController.cxx
|2 +-
 chart2/source/controller/main/UndoActions.cxx  
|5 +
 chart2/source/controller/sidebar/Chart2PanelFactory.cxx
|4 ++--
 chart2/source/controller/sidebar/ChartAreaPanel.cxx
|4 ++--
 

[Libreoffice-commits] core.git: chart2/qa chart2/source offapi/com oox/source

2020-01-10 Thread Tünde Tóth (via logerrit)
 chart2/qa/extras/chart2import.cxx |   24 +++
 chart2/qa/extras/data/xlsx/deleted_legend_entry2.xlsx |binary
 chart2/source/model/main/DataSeriesProperties.cxx |6 +
 chart2/source/model/main/DataSeriesProperties.hxx |3 
 chart2/source/view/charttypes/VSeriesPlotter.cxx  |   21 +-
 offapi/com/sun/star/chart2/DataSeries.idl |7 ++
 oox/source/drawingml/chart/titleconverter.cxx |   61 +++---
 oox/source/token/properties.txt   |1 
 8 files changed, 114 insertions(+), 9 deletions(-)

New commits:
commit 6e847aa817999ab18acd534f9e6a86685bb268fc
Author: Tünde Tóth 
AuthorDate: Wed Dec 18 09:49:26 2019 +0100
Commit: László Németh 
CommitDate: Fri Jan 10 14:21:35 2020 +0100

tdf#129859 XLSX import: don't show deleted legend entries

by adding a new feature to disable selected data points
in pie charts.

Fixing also tdf#129858 by deleting the correct legend entry
in bar charts.

Change-Id: Iaaf3a864e9404b8b6d3e2affbb366e18d0f4b43e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86160
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index e44efe636eed..5fcf205df813 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -151,6 +151,7 @@ public:
 void testTdf121991();
 void testTdf123206CustomLabelField();
 void testTdf125444PercentageCustomLabel();
+void testDeletedLegendEntries();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -251,6 +252,8 @@ public:
 CPPUNIT_TEST(testTdf121991);
 CPPUNIT_TEST(testTdf123206CustomLabelField);
 CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
+CPPUNIT_TEST(testDeletedLegendEntries);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -2334,7 +2337,28 @@ void 
Chart2ImportTest::testTdf125444PercentageCustomLabel()
 // to assert the latter.
 CPPUNIT_ASSERT_EQUAL(static_cast(3), aLabelFields.getLength());
 CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType_PERCENTAGE, 
aLabelFields[2]->getFieldType());
+}
+
+void Chart2ImportTest::testDeletedLegendEntries()
+{
+load("/chart2/qa/extras/data/xlsx/", "deleted_legend_entry2.xlsx");
+Reference xChartDoc = getChartDocFromSheet(0, 
mxComponent);
+CPPUNIT_ASSERT(xChartDoc.is());
+Reference xDataSeries(getDataSeriesFromDoc(xChartDoc, 
0));
+CPPUNIT_ASSERT(xDataSeries.is());
+Reference xPropertySet(xDataSeries, 
uno::UNO_QUERY_THROW);
+bool bShowLegendEntry = true;
+CPPUNIT_ASSERT(xPropertySet->getPropertyValue("ShowLegendEntry") >>= 
bShowLegendEntry);
+CPPUNIT_ASSERT(!bShowLegendEntry);
 
+Reference xChartDoc2 = getChartDocFromSheet(1, 
mxComponent);
+CPPUNIT_ASSERT(xChartDoc.is());
+Reference 
xDataSeries2(getDataSeriesFromDoc(xChartDoc2, 0));
+CPPUNIT_ASSERT(xDataSeries2.is());
+Reference xPropertySet2(xDataSeries2, 
uno::UNO_QUERY_THROW);
+Sequence deletedLegendEntriesSeq;
+CPPUNIT_ASSERT(xPropertySet2->getPropertyValue("DeletedLegendEntries") >>= 
deletedLegendEntriesSeq);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), deletedLegendEntriesSeq[0]);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
diff --git a/chart2/qa/extras/data/xlsx/deleted_legend_entry2.xlsx 
b/chart2/qa/extras/data/xlsx/deleted_legend_entry2.xlsx
new file mode 100644
index ..ea02464b1c46
Binary files /dev/null and 
b/chart2/qa/extras/data/xlsx/deleted_legend_entry2.xlsx differ
diff --git a/chart2/source/model/main/DataSeriesProperties.cxx 
b/chart2/source/model/main/DataSeriesProperties.cxx
index c43ced71f40c..5d0cb777e151 100644
--- a/chart2/source/model/main/DataSeriesProperties.cxx
+++ b/chart2/source/model/main/DataSeriesProperties.cxx
@@ -63,6 +63,12 @@ void DataSeriesProperties::AddPropertiesToVector(
   beans::PropertyAttribute::BOUND
   | beans::PropertyAttribute::MAYBEDEFAULT );
 
+rOutProperties.emplace_back( "DeletedLegendEntries",
+  PROP_DATASERIES_DELETED_LEGEND_ENTRIES,
+  cppu::UnoType>::get(),
+  beans::PropertyAttribute::BOUND
+  | beans::PropertyAttribute::MAYBEVOID );
+
 // add properties of service DataPointProperties
 DataPointProperties::AddPropertiesToVector( rOutProperties );
 }
diff --git a/chart2/source/model/main/DataSeriesProperties.hxx 
b/chart2/source/model/main/DataSeriesProperties.hxx
index 6791078d5678..b0f6283db54c 100644
--- a/chart2/source/model/main/DataSeriesProperties.hxx
+++ b/chart2/source/model/main/DataSeriesProperties.hxx
@@ -37,7 +37,8 @@ namespace DataSeriesProperties
 PROP_DATASERIES_STACKING_DIRECTION,
 PROP_DATASERIES_VARY_COLORS_BY_POINT,
 PROP_DATASERIES_ATTACHED_AXIS_INDEX,
-PROP_DATASERIES_SHOW_LEGEND_ENTRY
+

[Libreoffice-commits] core.git: chart2/qa chart2/source vcl/source

2019-12-23 Thread Andrea Gelmini (via logerrit)
 chart2/qa/extras/chart2dump/chart2dump.cxx   |   22 +++---
 chart2/source/view/diagram/VDiagram.cxx  |   10 +-
 vcl/source/filter/GraphicNativeTransform.cxx |6 +++---
 3 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit d020273875e6e1f840d8c7e2b0d27402456925e8
Author: Andrea Gelmini 
AuthorDate: Mon Dec 23 10:01:40 2019 +0100
Commit: Julien Nabet 
CommitDate: Mon Dec 23 13:46:34 2019 +0100

Fix typo in code

Here it passed "make check" on Linux

Change-Id: I334509d22495e4cf8c49ed5d885bd85e938ff9aa
Reviewed-on: https://gerrit.libreoffice.org/85741
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx 
b/chart2/qa/extras/chart2dump/chart2dump.cxx
index faf8ead6256a..50f4610e84af 100644
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -195,22 +195,22 @@ protected:
 writeActual(transformationToOneLineString(rTransform), sCheck);
 }
 
-bool readAndCheckTransformation(const drawing::HomogenMatrix3& rTransform, 
const OUString& sCheck, const double fEPS, OUString& rExpectedTranform)
+bool readAndCheckTransformation(const drawing::HomogenMatrix3& rTransform, 
const OUString& sCheck, const double fEPS, OUString& rExpectedTransform)
 {
-rExpectedTranform = readExpected(sCheck); // Reference transformation 
string
+rExpectedTransform = readExpected(sCheck); // Reference transformation 
string
 
 // Convert string back to a transformation;
 drawing::HomogenMatrix3 aExpectedTransform;
 sal_Int32 nIdx {0};
-aExpectedTransform.Line1.Column1 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
-aExpectedTransform.Line1.Column2 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
-aExpectedTransform.Line1.Column3 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
-aExpectedTransform.Line2.Column1 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
-aExpectedTransform.Line2.Column2 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
-aExpectedTransform.Line2.Column3 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
-aExpectedTransform.Line3.Column1 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
-aExpectedTransform.Line3.Column2 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
-aExpectedTransform.Line3.Column3 = rExpectedTranform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line1.Column1 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line1.Column2 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line1.Column3 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line2.Column1 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line2.Column2 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line2.Column3 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line3.Column1 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line3.Column2 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
+aExpectedTransform.Line3.Column3 = rExpectedTransform.getToken(0, ';', 
nIdx).toDouble();
 
 // Check the equality of the two transformation
 return (std::abs(aExpectedTransform.Line1.Column1 - 
rTransform.Line1.Column1) < fEPS &&
diff --git a/chart2/source/view/diagram/VDiagram.cxx 
b/chart2/source/view/diagram/VDiagram.cxx
index a3999441b081..a1fc30442898 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -578,19 +578,19 @@ void VDiagram::createShapes_3d()
 //don't set a camera at all!
 //the camera's rotation is incorporated into this matrix
 
-::basegfx::B3DHomMatrix aEffectiveTranformation;
-
aEffectiveTranformation.translate(-FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0, 
-FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0, -FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0);
+::basegfx::B3DHomMatrix aEffectiveTransformation;
+
aEffectiveTransformation.translate(-FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0, 
-FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0, -FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0);
 
 if(!m_bRightAngledAxes)
-
aEffectiveTranformation.rotate(m_fXAnglePi,m_fYAnglePi,m_fZAnglePi);
+
aEffectiveTransformation.rotate(m_fXAnglePi,m_fYAnglePi,m_fZAnglePi);
 else
-aEffectiveTranformation.shearXY(m_fYAnglePi,-m_fXAnglePi);
+aEffectiveTransformation.shearXY(m_fYAnglePi,-m_fXAnglePi);
 
 //#i98497# 3D charts are rendered with wrong size
 E3DModifySceneSnapRectUpdater 
aUpdater(lcl_getE3dScene(m_xOuterGroupShape));
 
   

[Libreoffice-commits] core.git: chart2/qa chart2/source oox/source

2019-11-21 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx  |   14 
++
 chart2/qa/extras/data/ods/tdf123774.ods|binary
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |1 
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx |1 
 oox/source/export/chartexport.cxx  |   14 
--
 5 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit a59eb39c6ec01ae2a9d8ddbb61a9c27f527c9caa
Author: Balazs Varga 
AuthorDate: Thu Nov 14 15:02:35 2019 +0100
Commit: László Németh 
CommitDate: Thu Nov 21 17:31:17 2019 +0100

tdf#123774 OOXML chart export: keep digits of percentages of data points

by exporting PercentageNumberFormat, checking the "Label" format
directly and taking the respective number format based on that.

Note: also fix the "LinkNumberFormatToSource" property. If we create a
pie chart with data labels and set the "Show value as number" or
"Show value as percentage" and check on/off "Source format", this move
is not set the property in the XPropertySet.

Because of this, it fixes also the export of correct value of
"link-data-style-to-source" property into ODS files.
But this patch doesn't fix the export of old ODS files to OOXML,
because they contain wrong (always true) "link-data-style-to-source"
value.

Change-Id: I4098a245dec5bf35cde20c9ccb79aca726230118
Reviewed-on: https://gerrit.libreoffice.org/82703
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 694e814250bd..8d42c8ac93ac 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -99,6 +99,7 @@ public:
 void testMarkerColorXLSX();
 void testRoundedCornersXLSX();
 void testAxisNumberFormatXLSX();
+void testDataPointLabelNumberFormatXLSX();
 void testDataLabelDefaultValuesXLSX();
 void testTitleOverlayXLSX();
 void testInvertIfNegativeXLSX();
@@ -210,6 +211,7 @@ public:
 CPPUNIT_TEST(testMarkerColorXLSX);
 CPPUNIT_TEST(testRoundedCornersXLSX);
 CPPUNIT_TEST(testAxisNumberFormatXLSX);
+CPPUNIT_TEST(testDataPointLabelNumberFormatXLSX);
 CPPUNIT_TEST(testDataLabelDefaultValuesXLSX);
 CPPUNIT_TEST(testTitleOverlayXLSX);
 CPPUNIT_TEST(testInvertIfNegativeXLSX);
@@ -1584,6 +1586,18 @@ void Chart2ExportTest::testAxisNumberFormatXLSX()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:valAx[2]/c:numFmt", "sourceLinked", "1");
 }
 
+void Chart2ExportTest::testDataPointLabelNumberFormatXLSX()
+{
+load("/chart2/qa/extras/data/ods/", "tdf123774.ods");
+xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+CPPUNIT_ASSERT(pXmlDoc);
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", 
"formatCode", "[$-40E]0.00%");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:numFmt", 
"sourceLinked", "0");
+
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt", 
"formatCode", "[$-40E]0.00%");
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[1]/c:numFmt", 
"sourceLinked", "0");
+}
+
 void Chart2ExportTest::testDataLabelDefaultValuesXLSX()
 {
 load("/chart2/qa/extras/data/xlsx/", "data_label.xlsx");
diff --git a/chart2/qa/extras/data/ods/tdf123774.ods 
b/chart2/qa/extras/data/ods/tdf123774.ods
new file mode 100644
index ..5c422b58c357
Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf123774.ods differ
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx 
b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 39babb82a09c..0d592f4733a8 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -153,6 +153,7 @@ bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 
nWhichId, const SfxIte
 uno::Any aNewValue;
 bool bUseSourceFormat = static_cast< const SfxBoolItem & >(
 rItemSet.Get( nWhichId )).GetValue();
+xPropertySet->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, 
uno::Any(bUseSourceFormat));
 if( !bUseSourceFormat )
 {
 SfxItemState aState = rItemSet.GetItemState( nFormatWhich );
diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx 
b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
index 86f5891bbad9..81c7c8fcd9a0 100644
--- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
@@ -150,6 +150,7 @@ bool useSourceFormatFromItemToPropertySet(
 uno::Any aNewValue;
 bool bUseSourceFormat = 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2019-11-13 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx   |   17 +
 chart2/qa/extras/data/odt/tdf128733.odt |binary
 chart2/source/tools/AxisHelper.cxx  |1 +
 3 files changed, 18 insertions(+)

New commits:
commit 71f9961488232697bcdb37db349569a20f15bb2d
Author: Balazs Varga 
AuthorDate: Tue Nov 12 14:05:19 2019 +0100
Commit: László Németh 
CommitDate: Wed Nov 13 10:59:57 2019 +0100

tdf#128733 Chart import: fix secondary X axis

shiftedcategoryposition value. When inserting secondary axes it applies
the ShiftedCategoryPosition of the main axis.

Regression from the commit 111c260ab2883b7906f1a66e222dbf4dc3c58c4f
(tdf#12 OOXML chart export: fix "CrossBetween" for not imported
charts)

Change-Id: Ia043fe2873f633cbd5f7db206cf9d1b0d2f8c34c
Reviewed-on: https://gerrit.libreoffice.org/82511
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 665b9f96e62d..f4bfb53fbf34 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -135,6 +135,7 @@ public:
 void testTdf114179();
 void testTdf124243();
 void testTdf127393();
+void testTdf128733();
 void testTdf128432();
 void testTdf128627();
 void testTdf128634();
@@ -231,6 +232,7 @@ public:
 CPPUNIT_TEST(testTdf114179);
 CPPUNIT_TEST(testTdf124243);
 CPPUNIT_TEST(testTdf127393);
+CPPUNIT_TEST(testTdf128733);
 CPPUNIT_TEST(testTdf128432);
 CPPUNIT_TEST(testTdf128627);
 CPPUNIT_TEST(testTdf128634);
@@ -2028,6 +2030,21 @@ void Chart2ImportTest::testTdf127393()
 CPPUNIT_ASSERT(!aScaleData2.ShiftedCategoryPosition);
 }
 
+void Chart2ImportTest::testTdf128733()
+{
+load("/chart2/qa/extras/data/odt/", "tdf128733.odt");
+
+Reference xChartDoc(getChartDocFromWriter(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+// test secondary X axis ShiftedCategoryPosition value
+Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 1);
+CPPUNIT_ASSERT(xAxis.is());
+
+chart2::ScaleData aScaleData = xAxis->getScaleData();
+CPPUNIT_ASSERT(aScaleData.Categories.is());
+CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
+}
+
 void Chart2ImportTest::testTdf128432()
 {
 load("/chart2/qa/extras/data/ods/", "tdf128432.ods");
diff --git a/chart2/qa/extras/data/odt/tdf128733.odt 
b/chart2/qa/extras/data/odt/tdf128733.odt
new file mode 100644
index ..18aace26c02d
Binary files /dev/null and b/chart2/qa/extras/data/odt/tdf128733.odt differ
diff --git a/chart2/source/tools/AxisHelper.cxx 
b/chart2/source/tools/AxisHelper.cxx
index 6ec3d44f48d4..75d51c610e11 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -364,6 +364,7 @@ Reference< XAxis > AxisHelper::createAxis(
 aScale.AutoDateAxis = aMainScale.AutoDateAxis;
 aScale.Categories = aMainScale.Categories;
 aScale.Orientation = aMainScale.Orientation;
+aScale.ShiftedCategoryPosition = 
aMainScale.ShiftedCategoryPosition;
 
 xAxis->setScaleData( aScale );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: chart2/qa chart2/source oox/source

2019-10-07 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx  |   11 +++
 chart2/qa/extras/data/ods/test_CrossBetween.ods|binary
 chart2/source/model/template/ChartTypeTemplate.cxx |7 +--
 chart2/source/tools/AxisHelper.cxx |2 +-
 chart2/source/view/main/ChartView.cxx  |   17 +
 oox/source/drawingml/chart/axisconverter.cxx   |2 --
 oox/source/export/chartexport.cxx  |2 +-
 7 files changed, 23 insertions(+), 18 deletions(-)

New commits:
commit 111c260ab2883b7906f1a66e222dbf4dc3c58c4f
Author: Balazs Varga 
AuthorDate: Thu Oct 3 20:31:44 2019 +0200
Commit: László Németh 
CommitDate: Mon Oct 7 12:36:28 2019 +0200

tdf#12 OOXML chart export: fix "CrossBetween" for not imported charts

Newly created or ODF charts were still exported incorrectly, because
ShiftedCategoryPosition was stored in the view code. Now it is removed
to the model using ChartTypeTemplate::adaptScales.

See also commit 6027ec08fd5df2e09e34ff61b3777ad2cc8304b3 'tdf#12
OOXML chart export: fix X axis position setting "CrossBetween"'

Change-Id: I7cd69e311833bf9f24f3a600ee7c6312285a7738
Reviewed-on: https://gerrit.libreoffice.org/80160
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 2589428831bc..8a0705f7d140 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -121,6 +121,7 @@ public:
 void testCombinedChartSecondaryAxisXLSX();
 void testCombinedChartSecondaryAxisODS();
 void testCrossBetweenXLSX();
+void testCrossBetweenODS();
 void testAxisTitleRotationXLSX();
 void testAxisCrossBetweenXSLX();
 void testPieChartDataPointExplosionXLSX();
@@ -225,6 +226,7 @@ public:
 CPPUNIT_TEST(testCombinedChartSecondaryAxisXLSX);
 CPPUNIT_TEST(testCombinedChartSecondaryAxisODS);
 CPPUNIT_TEST(testCrossBetweenXLSX);
+CPPUNIT_TEST(testCrossBetweenODS);
 CPPUNIT_TEST(testAxisTitleRotationXLSX);
 CPPUNIT_TEST(testAxisCrossBetweenXSLX);
 CPPUNIT_TEST(testPieChartDataPointExplosionXLSX);
@@ -1912,6 +1914,15 @@ void Chart2ExportTest::testCrossBetweenXLSX()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between");
 }
 
+void Chart2ExportTest::testCrossBetweenODS()
+{
+// Original file was created with LibreOffice
+load("/chart2/qa/extras/data/ods/", "test_CrossBetween.ods");
+xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+CPPUNIT_ASSERT(pXmlDoc);
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:valAx/c:crossBetween", "val", "between");
+}
+
 void Chart2ExportTest::testAxisTitleRotationXLSX()
 {
 load("/chart2/qa/extras/data/xlsx/", "axis_title_rotation.xlsx");
diff --git a/chart2/qa/extras/data/ods/test_CrossBetween.ods 
b/chart2/qa/extras/data/ods/test_CrossBetween.ods
new file mode 100644
index ..e59546b3d0cd
Binary files /dev/null and b/chart2/qa/extras/data/ods/test_CrossBetween.ods 
differ
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx 
b/chart2/source/model/template/ChartTypeTemplate.cxx
index c3710e45d7d4..c18851796ada 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -623,8 +623,11 @@ void ChartTypeTemplate::adaptScales(
 aData.Categories = xCategories;
 if(bSupportsCategories)
 {
-
-Reference< XChartType > xChartType( 
getChartTypeForNewSeries(Sequence< Reference< XChartType > >() ));
+Reference< XChartType > 
xChartType(getChartTypeForNewSeries(Sequence< Reference< XChartType > >()));
+if( aData.AxisType == AxisType::CATEGORY )
+{
+aData.ShiftedCategoryPosition = 
::chart::ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault(xChartType);
+}
 bool bSupportsDates = 
::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, nDimensionX );
 if( aData.AxisType != AxisType::CATEGORY && ( 
aData.AxisType != AxisType::DATE || !bSupportsDates) )
 {
diff --git a/chart2/source/tools/AxisHelper.cxx 
b/chart2/source/tools/AxisHelper.cxx
index 25d481bff352..6ec3d44f48d4 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -73,7 +73,7 @@ ScaleData AxisHelper::createDefaultScale()
 ScaleData aScaleData;
 aScaleData.AxisType = chart2::AxisType::REALNUMBER;
 aScaleData.AutoDateAxis = true;
-aScaleData.ShiftedCategoryPosition = false;//this is adapted in the view 
code currently
+aScaleData.ShiftedCategoryPosition = false;
 Sequence< 

[Libreoffice-commits] core.git: chart2/qa chart2/source oox/source

2019-09-23 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx|   29 +++
 chart2/qa/extras/data/pptx/tdf127393.pptx|binary
 chart2/source/view/main/ChartView.cxx|   12 ++-
 oox/source/drawingml/chart/axiscontext.cxx   |2 -
 oox/source/drawingml/chart/axisconverter.cxx |1 
 oox/source/drawingml/chart/axismodel.cxx |2 -
 6 files changed, 39 insertions(+), 7 deletions(-)

New commits:
commit 830e539547c463b932ce643517f880789185032d
Author: Balazs Varga 
AuthorDate: Thu Sep 19 15:15:58 2019 +0200
Commit: László Németh 
CommitDate: Mon Sep 23 15:53:14 2019 +0200

tdf#127393 OOXML chart import: fix X axis position setting "CrossBetween"

Set ShiftedCategoryPosition according to OOXML value CrossBetween.

Change-Id: I6445c94507de83f84b08fd3380cbbf03886b5aa3
Reviewed-on: https://gerrit.libreoffice.org/79142
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 53f4a2d30e19..c0850820acc3 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -129,6 +129,7 @@ public:
 
 void testTdf114179();
 void testTdf124243();
+void testTdf127393();
 void testDeletedDataLabel();
 void testDataPointInheritedColorDOCX();
 void testExternalStrRefsXLSX();
@@ -218,6 +219,7 @@ public:
 
 CPPUNIT_TEST(testTdf114179);
 CPPUNIT_TEST(testTdf124243);
+CPPUNIT_TEST(testTdf127393);
 CPPUNIT_TEST(testDeletedDataLabel);
 CPPUNIT_TEST(testDataPointInheritedColorDOCX);
 CPPUNIT_TEST(testExternalStrRefsXLSX);
@@ -1929,6 +1931,33 @@ void Chart2ImportTest::testTdf124243()
 CPPUNIT_ASSERT(!bShow);
 }
 
+void Chart2ImportTest::testTdf127393()
+{
+load("/chart2/qa/extras/data/pptx/", "tdf127393.pptx");
+
+// 1st chart
+Reference xChartDoc(getChartDocFromDrawImpress(0, 
0), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
+CPPUNIT_ASSERT(xAxis.is());
+
+chart2::ScaleData aScaleData1 = xAxis->getScaleData();
+CPPUNIT_ASSERT(aScaleData1.Categories.is());
+CPPUNIT_ASSERT(aScaleData1.ShiftedCategoryPosition);
+
+// 2nd chart
+xChartDoc.set(getChartDocFromDrawImpress(1, 0), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+xAxis.set(getAxisFromDoc(xChartDoc, 0, 0, 0));
+CPPUNIT_ASSERT(xAxis.is());
+
+chart2::ScaleData aScaleData2 = xAxis->getScaleData();
+CPPUNIT_ASSERT(aScaleData2.Categories.is());
+CPPUNIT_ASSERT(!aScaleData2.ShiftedCategoryPosition);
+}
+
 namespace {
 
 void checkDataLabelProperties(const Reference& 
xDataSeries, sal_Int32 nDataPointIndex, bool bValueVisible)
diff --git a/chart2/qa/extras/data/pptx/tdf127393.pptx 
b/chart2/qa/extras/data/pptx/tdf127393.pptx
new file mode 100644
index ..7c4047817a2f
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf127393.pptx differ
diff --git a/chart2/source/view/main/ChartView.cxx 
b/chart2/source/view/main/ChartView.cxx
index 200b4b4e9823..238069cdf2e1 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -325,7 +325,7 @@ public:
 void AdaptScaleOfYAxisWithoutAttachedSeries( ChartModel& rModel );
 
 bool isCategoryPositionShifted(
-const chart2::ScaleData& rSourceScale, bool bHasComplexCategories ) 
const;
+const chart2::ScaleData& rSourceScale, bool bHasComplexCategories, 
bool bShiftedCategoryPosition) const;
 
 private:
 /** A vector of series plotters.
@@ -631,12 +631,12 @@ void 
SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
 }
 
 bool SeriesPlotterContainer::isCategoryPositionShifted(
-const chart2::ScaleData& rSourceScale, bool bHasComplexCategories ) const
+const chart2::ScaleData& rSourceScale, bool bHasComplexCategories, bool 
bShiftedCategoryPosition) const
 {
-if (rSourceScale.AxisType == AxisType::CATEGORY && 
m_bChartTypeUsesShiftedCategoryPositionPerDefault)
+if (rSourceScale.AxisType == AxisType::CATEGORY && 
(m_bChartTypeUsesShiftedCategoryPositionPerDefault || bShiftedCategoryPosition))
 return true;
 
-if (rSourceScale.AxisType==AxisType::CATEGORY && bHasComplexCategories)
+if (rSourceScale.AxisType == AxisType::CATEGORY && bHasComplexCategories)
 return true;
 
 if (rSourceScale.AxisType == AxisType::DATE)
@@ -683,7 +683,9 @@ void SeriesPlotterContainer::initAxisUsageList(const Date& 
rNullDate)
 AxisHelper::checkDateAxis( aSourceScale, pCatProvider, 
bDateAxisAllowed );
 
 bool bHasComplexCat = pCatProvider && 
pCatProvider->hasComplexCategories();
-aSourceScale.ShiftedCategoryPosition = 
isCategoryPositionShifted(aSourceScale, bHasComplexCat);
+// Come from CrossBetween OOXML tag
+bool bShiftedCategoryPosition = 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2019-08-30 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx|   18 ++
 chart2/qa/extras/data/docx/tdf124083.docx|binary
 chart2/source/tools/InternalDataProvider.cxx |   11 +--
 3 files changed, 27 insertions(+), 2 deletions(-)

New commits:
commit 4afd65776457be3391f3e1340da614dffc8f227b
Author: Balazs Varga 
AuthorDate: Tue Aug 27 10:55:30 2019 +0200
Commit: László Németh 
CommitDate: Fri Aug 30 13:18:14 2019 +0200

tdf#124083 OOXML import: fix broken charts with missing value X

Importing NaN value X, ie. where only "ptCount" was defined without
explicit data, messed up the charts replacing all X values with sequence
1, 2, 3..., showing data points in wrong X positions, also showing the
invalid "NaN" data points. Now internal data table contains the original
X values, including NaNs, fixing broken charts.

Change-Id: Ic3c69e15095d9b29643f5daef8f58c58b4a442db
Reviewed-on: https://gerrit.libreoffice.org/78177
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 116a0a93519f..53f4a2d30e19 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -134,6 +134,7 @@ public:
 void testExternalStrRefsXLSX();
 void testSourceNumberFormatComplexCategoriesXLS();
 void testMultilevelCategoryAxis();
+void testXaxisValues();
 void testTdf123504();
 void testTdf122765();
 
@@ -222,6 +223,7 @@ public:
 CPPUNIT_TEST(testExternalStrRefsXLSX);
 CPPUNIT_TEST(testSourceNumberFormatComplexCategoriesXLS);
 CPPUNIT_TEST(testMultilevelCategoryAxis);
+CPPUNIT_TEST(testXaxisValues);
 CPPUNIT_TEST(testTdf123504);
 CPPUNIT_TEST(testTdf122765);
 
@@ -2023,6 +2025,22 @@ void Chart2ImportTest::testMultilevelCategoryAxis()
 CPPUNIT_ASSERT_EQUAL(OUString("Categoria 4"), aCategories[3][1]);
 }
 
+void Chart2ImportTest::testXaxisValues()
+{
+load("/chart2/qa/extras/data/docx/", "tdf124083.docx");
+uno::Reference< chart2::XChartDocument > 
xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+const uno::Reference< chart2::data::XDataSequence > xDataSeq = 
getDataSequenceFromDocByRole(xChartDoc, "values-x");
+Sequence xSequence = xDataSeq->getData();
+// test X values
+CPPUNIT_ASSERT_EQUAL(uno::Any(0.04), xSequence[0]);
+CPPUNIT_ASSERT(rtl::math::isNan(*static_cast(xSequence[1].getValue(;
+CPPUNIT_ASSERT_EQUAL(uno::Any(0.16), xSequence[2]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(0.11), xSequence[3]);
+CPPUNIT_ASSERT(rtl::math::isNan(*static_cast(xSequence[4].getValue(;
+}
+
 void Chart2ImportTest::testTdf123504()
 {
 load("/chart2/qa/extras/data/ods/", "pie_chart_100_and_0.ods");
diff --git a/chart2/qa/extras/data/docx/tdf124083.docx 
b/chart2/qa/extras/data/docx/tdf124083.docx
new file mode 100644
index ..b8030ca9a807
Binary files /dev/null and b/chart2/qa/extras/data/docx/tdf124083.docx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index 0fa8a4bff815..eec8280425b4 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -526,7 +526,6 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 if (bInQuote)
 {
 // Opening quote.
-bAllNumeric = false;
 pElem = nullptr;
 }
 else
@@ -534,6 +533,9 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 // Closing quote.
 if (pElem)
 aElem = OUString(pElem, p-pElem);
+// Non empty string
+if (!aElem.isEmpty())
+bAllNumeric = false;
 aRawElems.push_back(aElem);
 pElem = nullptr;
 aElem.clear();
@@ -591,7 +593,12 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 if (bAllNumeric)
 {
 for (const OUString & aRawElem : aRawElems)
-aValues.push_back(aRawElem.toDouble());
+{
+if (!aRawElem.isEmpty())
+aValues.push_back(aRawElem.toDouble());
+else
+aValues.push_back(NAN);
+}
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: chart2/qa chart2/source include/oox oox/source

2019-07-24 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   38 +++--
 chart2/qa/extras/data/docx/testMultilevelCategoryAxis.docx |binary
 chart2/source/tools/InternalData.cxx   |   11 +++
 include/oox/drawingml/chart/datasourcemodel.hxx|1 
 oox/source/drawingml/chart/chartconverter.cxx  |   29 +
 oox/source/drawingml/chart/datasourcecontext.cxx   |   25 
 oox/source/drawingml/chart/datasourcemodel.cxx |3 -
 oox/source/export/chartexport.cxx  |8 ++
 8 files changed, 94 insertions(+), 21 deletions(-)

New commits:
commit fa0a981af41a2606541eec1cb20a379a739691e0
Author: Balazs Varga 
AuthorDate: Wed Jul 17 12:57:47 2019 +0200
Commit: László Németh 
CommitDate: Wed Jul 24 14:04:06 2019 +0200

tdf#114166 DOCX chart import: fix missing complex categories

Now complex category labels are visible, and the inner data
table contains the correct texts of the category columns.

Note: repeating call of createDataSequenceByValueArray() API function
can create all columns of the complex categories. See also
commit 6c4e21a234f12e1310ba06f9859e08b424acf8bf
"bnc#812796: Correctly handle static value array for OOXML charts."

Change-Id: I333b79be35a24a912bb9e662116d0c85809a8fb2
Reviewed-on: https://gerrit.libreoffice.org/75776
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 107daed69fea..710d15ebd60e 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -131,6 +131,7 @@ public:
 void testDataPointInheritedColorDOCX();
 void testExternalStrRefsXLSX();
 void testSourceNumberFormatComplexCategoriesXLS();
+void testMultilevelCategoryAxis();
 void testTdf123504();
 void testTdf122765();
 
@@ -216,6 +217,7 @@ public:
 CPPUNIT_TEST(testDataPointInheritedColorDOCX);
 CPPUNIT_TEST(testExternalStrRefsXLSX);
 CPPUNIT_TEST(testSourceNumberFormatComplexCategoriesXLS);
+CPPUNIT_TEST(testMultilevelCategoryAxis);
 CPPUNIT_TEST(testTdf123504);
 CPPUNIT_TEST(testTdf122765);
 
@@ -1534,10 +1536,10 @@ void Chart2ImportTest::testInternalDataProvider() {
 // Parse mixed types, mixed role
 xDataSeq = rxDataProvider->createDataSequenceByValueArray("categories", 
"{42;\"hello\";0;\"world\"}");
 xSequence = xDataSeq->getData();
-CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("42")),xSequence[0]);
-CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("hello")), xSequence[1]);
-CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("0")), xSequence[2]);
-CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("world")), xSequence[3]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Row 1 42")), xSequence[0]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Row 2 hello")), xSequence[1]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Row 3 0")), xSequence[2]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("Row 4 world")), xSequence[3]);
 }
 
 void Chart2ImportTest::testTdf90510()
@@ -1946,6 +1948,34 @@ void 
Chart2ImportTest::testSourceNumberFormatComplexCategoriesXLS()
 CPPUNIT_ASSERT(nNumberFormat != 0);
 }
 
+void Chart2ImportTest::testMultilevelCategoryAxis()
+{
+load("/chart2/qa/extras/data/docx/", "testMultilevelCategoryAxis.docx");
+uno::Reference< chart2::XChartDocument > 
xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+// Test the internal data.
+CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider());
+
+Reference 
xInternalProvider(xChartDoc->getDataProvider(), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xInternalProvider.is());
+
+Reference xDescAccess(xInternalProvider, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDescAccess.is());
+
+// Get the complex category labels.
+Sequence > aCategories = 
xDescAccess->getComplexRowDescriptions();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(4), aCategories.getLength());
+CPPUNIT_ASSERT_EQUAL(OUString("2011"), aCategories[0][0]);
+CPPUNIT_ASSERT_EQUAL(OUString(""), aCategories[1][0]);
+CPPUNIT_ASSERT_EQUAL(OUString("2012"), aCategories[2][0]);
+CPPUNIT_ASSERT_EQUAL(OUString(""), aCategories[3][0]);
+CPPUNIT_ASSERT_EQUAL(OUString("Categoria 1"), aCategories[0][1]);
+CPPUNIT_ASSERT_EQUAL(OUString("Categoria 2"), aCategories[1][1]);
+CPPUNIT_ASSERT_EQUAL(OUString("Categoria 3"), aCategories[2][1]);
+CPPUNIT_ASSERT_EQUAL(OUString("Categoria 4"), aCategories[3][1]);
+}
+
 void Chart2ImportTest::testTdf123504()
 {
 load("/chart2/qa/extras/data/ods/", "pie_chart_100_and_0.ods");
diff --git a/chart2/qa/extras/data/docx/testMultilevelCategoryAxis.docx 
b/chart2/qa/extras/data/docx/testMultilevelCategoryAxis.docx
new file mode 100644
index ..75605de72fc5
Binary files /dev/null and 
b/chart2/qa/extras/data/docx/testMultilevelCategoryAxis.docx differ
diff --git 

[Libreoffice-commits] core.git: chart2/qa chart2/source include/oox oox/source

2019-07-15 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2export.cxx|   38 +++
 chart2/qa/extras/data/ods/multilevelcat.ods  |binary
 chart2/qa/extras/data/odt/multilevelcat.odt  |binary
 chart2/source/tools/InternalDataProvider.cxx |1 
 include/oox/export/chartexport.hxx   |3 
 oox/source/export/chartexport.cxx|  268 ++-
 6 files changed, 269 insertions(+), 41 deletions(-)

New commits:
commit 8906275d40a1828db684e7d9c9bc4934a937bc6c
Author: Balazs Varga 
AuthorDate: Tue Jul 9 13:30:16 2019 +0200
Commit: László Németh 
CommitDate: Mon Jul 15 11:38:13 2019 +0200

tdf#126193 Chart OOXML: Export Multi-level category labels

Fix export of Multi-level category axis labels with the correct
OOXML tags (as the OOXML Standard requested) in the correct
order.

Also fix tdf#126195: but only the export part of the whole fault,
which combined (united) the text of the category axis labels at
different levels.

Change-Id: Iefcef00818a3bb2ee1671bf693335904be471722
Reviewed-on: https://gerrit.libreoffice.org/75299
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index f00959bdbfeb..ab932ac2bc68 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -128,6 +128,8 @@ public:
 void testChartTitlePropertiesGradientFillPPTX();
 void testChartTitlePropertiesBitmapFillPPTX();
 void testxAxisLabelsRotation();
+void testMultipleCategoryAxisLablesXLSX();
+void testMultipleCategoryAxisLablesDOCX();
 void testTdf116163();
 void testTdf111824();
 void testTdf119029();
@@ -226,6 +228,8 @@ public:
 CPPUNIT_TEST(testChartTitlePropertiesGradientFillPPTX);
 CPPUNIT_TEST(testChartTitlePropertiesBitmapFillPPTX);
 CPPUNIT_TEST(testxAxisLabelsRotation);
+CPPUNIT_TEST(testMultipleCategoryAxisLablesXLSX);
+CPPUNIT_TEST(testMultipleCategoryAxisLablesDOCX);
 CPPUNIT_TEST(testTdf116163);
 CPPUNIT_TEST(testTdf111824);
 CPPUNIT_TEST(testTdf119029);
@@ -2092,6 +2096,40 @@ void Chart2ExportTest::testxAxisLabelsRotation()
 assertXPath(pXmlDoc1, 
"/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot", "270");
 }
 
+void Chart2ExportTest::testMultipleCategoryAxisLablesXLSX()
+{
+load("/chart2/qa/extras/data/ods/", "multilevelcat.ods");
+xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+CPPUNIT_ASSERT(pXmlDoc);
+// check category axis labels number of first level
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:ptCount",
 "val", "6");
+// check category axis labels text of first level
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[1]/c:pt[1]/c:v",
 "Categoria 1");
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[1]/c:pt[6]/c:v",
 "Categoria 6");
+// check category axis labels text of second level
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[2]/c:pt[1]/c:v",
 "2011");
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[2]/c:pt[3]/c:v",
 "2013");
+// check the 'noMultiLvlLbl' tag - ChartExport.cxx:2950 FIXME: seems not 
support, so check the default noMultiLvlLbl value.
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:catAx/c:noMultiLvlLbl", "val", "0");
+}
+
+void Chart2ExportTest::testMultipleCategoryAxisLablesDOCX()
+{
+load("/chart2/qa/extras/data/odt/", "multilevelcat.odt");
+xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML 
Text");
+CPPUNIT_ASSERT(pXmlDoc);
+// check category axis labels number of first level
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:ptCount",
 "val", "4");
+// check category axis labels text of first level
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[1]/c:pt[1]/c:v",
 "Categoria 1");
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[1]/c:pt[4]/c:v",
 "Categoria 4");
+// check category axis labels text of second level
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[2]/c:pt[1]/c:v",
 "2011");
+assertXPathContent(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser[1]/c:cat/c:multiLvlStrRef/c:multiLvlStrCache/c:lvl[2]/c:pt[2]/c:v",
 "2012");
+// check 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2019-06-26 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx |   19 +++
 chart2/qa/extras/data/xlsx/tdf126033.xlsx |binary
 chart2/source/view/main/VDataSeries.cxx   |2 +-
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 2783a34899379dae84889c924e49481631280ab1
Author: Balazs Varga 
AuthorDate: Tue Jun 25 13:26:41 2019 +0200
Commit: László Németh 
CommitDate: Wed Jun 26 11:00:22 2019 +0200

tdf#126033 chart: hide removed marker of a single data point

instead of showing a black square.

Note: the patch fixes also the OOXML import (see the unit test).

Change-Id: Ie578db3dd9ba310b0ce972832269acd5ae501778
Reviewed-on: https://gerrit.libreoffice.org/74690
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 803e99e773da..569ba8388d26 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -74,6 +74,7 @@ public:
 void testTdf108021();
 void testTdf100084();
 void testTdf124817();
+void testTdf126033();
 void testAutoBackgroundXLSX();
 void testAutoChartAreaBorderPropXLSX();
 void testChartAreaStyleBackgroundXLSX();
@@ -167,6 +168,7 @@ public:
 CPPUNIT_TEST(testTdf108021);
 CPPUNIT_TEST(testTdf100084);
 CPPUNIT_TEST(testTdf124817);
+CPPUNIT_TEST(testTdf126033);
 CPPUNIT_TEST(testAutoBackgroundXLSX);
 CPPUNIT_TEST(testAutoChartAreaBorderPropXLSX);
 CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX);
@@ -933,6 +935,23 @@ void Chart2ImportTest::testTdf124817()
 CPPUNIT_ASSERT((xPropSet_2->getPropertyValue("Symbol") >>= aSymblProp) && 
(aSymblProp.BorderColor == static_cast(0xFF)));
 }
 
+void Chart2ImportTest::testTdf126033()
+{
+load("/chart2/qa/extras/data/xlsx/", "tdf126033.xlsx");
+Reference xChartDoc = getChartDocFromSheet(0, 
mxComponent);
+CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+// Check symbol style and size of data points
+chart2::Symbol aSymblProp;
+uno::Reference 
xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+CPPUNIT_ASSERT(xDataSeries.is());
+uno::Reference 
xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
+CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Symbol") >>= aSymblProp);
+CPPUNIT_ASSERT_EQUAL(chart2::SymbolStyle_NONE, aSymblProp.Style);
+CPPUNIT_ASSERT_EQUAL(static_cast(176), aSymblProp.Size.Width);
+CPPUNIT_ASSERT_EQUAL(static_cast(176), aSymblProp.Size.Height);
+}
+
 void Chart2ImportTest::testTransparentBackground(OUString const & filename)
 {
 load("/chart2/qa/extras/data/xlsx/", filename);
diff --git a/chart2/qa/extras/data/xlsx/tdf126033.xlsx 
b/chart2/qa/extras/data/xlsx/tdf126033.xlsx
new file mode 100644
index ..ee60103c98e4
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf126033.xlsx differ
diff --git a/chart2/source/view/main/VDataSeries.cxx 
b/chart2/source/view/main/VDataSeries.cxx
index 6781f2044e7c..a446cd79d538 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -803,7 +803,7 @@ Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) 
const
 m_apSymbolProperties_InvisibleSymbolForSelection.reset(new 
Symbol);
 m_apSymbolProperties_InvisibleSymbolForSelection->Style = 
SymbolStyle_STANDARD;
 
m_apSymbolProperties_InvisibleSymbolForSelection->StandardSymbol = 0;//square
-m_apSymbolProperties_InvisibleSymbolForSelection->Size = 
m_apSymbolProperties_Series->Size;
+m_apSymbolProperties_InvisibleSymbolForSelection->Size = 
com::sun::star::awt::Size(0, 0);//tdf#126033
 
m_apSymbolProperties_InvisibleSymbolForSelection->BorderColor = 
0xff00;//invisible
 
m_apSymbolProperties_InvisibleSymbolForSelection->FillColor = 
0xff00;//invisible
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/source configmgr/source connectivity/source

2019-06-10 Thread Arkadiy Illarionov (via logerrit)
 chart2/qa/extras/chart2export.cxx  |4 -
 chart2/source/controller/accessibility/AccessibleChartView.cxx |2 
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx  |2 
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx|4 -
 chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx |   10 
++--
 chart2/source/controller/chartapiwrapper/TitleWrapper.cxx  |2 
 chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx  |6 
+-
 chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx  |   16 
+++
 chart2/source/controller/dialogs/DataBrowserModel.cxx  |2 
 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx  |6 
+-
 chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx  |8 
+--
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |4 -
 chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx |4 -
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx |4 -
 chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx |2 
 chart2/source/controller/main/ChartController.cxx  |2 
 chart2/source/controller/main/ChartDropTargetHelper.cxx|2 
 chart2/source/controller/sidebar/ChartElementsPanel.cxx|4 -
 chart2/source/controller/sidebar/ChartSeriesPanel.cxx  |2 
 chart2/source/model/filter/XMLFilter.cxx   |2 
 chart2/source/model/main/Axis.cxx  |2 
 chart2/source/model/main/ChartModel.cxx|2 
 chart2/source/model/main/ChartModel_Persistence.cxx|2 
 chart2/source/model/main/Diagram.cxx   |2 
 chart2/source/model/template/ChartTypeTemplate.cxx |   22 
+-
 chart2/source/model/template/ColumnLineChartTypeTemplate.cxx   |2 
 chart2/source/model/template/DataInterpreter.cxx   |4 -
 chart2/source/model/template/PieChartTypeTemplate.cxx  |4 -
 chart2/source/model/template/StockChartTypeTemplate.cxx|8 
+--
 chart2/source/model/template/StockDataInterpreter.cxx  |2 
 chart2/source/tools/AxisHelper.cxx |2 
 chart2/source/tools/CachedDataSequence.cxx |6 
+-
 chart2/source/tools/ChartModelHelper.cxx   |4 -
 chart2/source/tools/ConfigColorScheme.cxx  |2 
 chart2/source/tools/DataSeriesHelper.cxx   |8 
+--
 chart2/source/tools/DataSourceHelper.cxx   |2 
 chart2/source/tools/DiagramHelper.cxx  |   16 
+++
 chart2/source/tools/ExplicitCategoriesProvider.cxx |4 -
 chart2/source/tools/InternalDataProvider.cxx   |2 
 chart2/source/tools/RegressionCurveHelper.cxx  |4 -
 chart2/source/tools/TitleHelper.cxx|2 
 chart2/source/tools/WrappedPropertySet.cxx |6 
+-
 chart2/source/view/axes/VCartesianGrid.cxx |4 -
 chart2/source/view/axes/VPolarGrid.cxx |2 
 chart2/source/view/charttypes/AreaChart.cxx|2 
 chart2/source/view/charttypes/CandleStickChart.cxx |2 
 chart2/source/view/charttypes/NetChart.cxx |2 
 chart2/source/view/charttypes/VSeriesPlotter.cxx   |2 
 chart2/source/view/main/ChartView.cxx  |6 
+-
 chart2/source/view/main/Clipping.cxx   |2 
 chart2/source/view/main/ShapeFactory.cxx   |   16 
+++
 chart2/source/view/main/VDataSeries.cxx|6 
+-
 chart2/source/view/main/VTitle.cxx |2 
 comphelper/source/compare/AnyCompareFactory.cxx|2 
 comphelper/source/container/enumerablemap.cxx  |2 
 comphelper/source/misc/docpasswordhelper.cxx   |   10 
++--
 comphelper/source/misc/mimeconfighelper.cxx|6 
+-
 comphelper/source/property/ChainablePropertySetInfo.cxx|2 
 comphelper/source/property/MasterPropertySetInfo.cxx   |2 
 comphelper/source/xml/ofopxmlhelper.cxx|6 
+-
 configmgr/source/access.cxx|2 
 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2019-06-03 Thread Balazs Varga (via logerrit)
 chart2/qa/extras/chart2import.cxx  |   55 +
 chart2/qa/extras/data/pptx/tdf48041.pptx   |binary
 chart2/source/view/axes/VCartesianAxis.cxx |   32 
 3 files changed, 87 insertions(+)

New commits:
commit 7f373a4c88961348f35e4f990182628488878efe
Author: Balazs Varga 
AuthorDate: Thu May 30 13:30:26 2019 +0200
Commit: László Németh 
CommitDate: Mon Jun 3 16:11:06 2019 +0200

tdf#48041 Chart: do not duplicate major value

axis labels and vertical axis lines. If the same
value labels follow each other, because of
the number format, only display them once.

Change-Id: I3c5577a0e86c475cb2fafb62d63f991cef7229d8
Reviewed-on: https://gerrit.libreoffice.org/73200
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 5c7255a0e632..a55107b36318 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -118,6 +118,8 @@ public:
 
 void testTdf116163();
 
+void testTdf48041();
+
 void testTdf121205();
 
 void testTdf114179();
@@ -199,6 +201,8 @@ public:
 
 CPPUNIT_TEST(testTdf116163);
 
+CPPUNIT_TEST(testTdf48041);
+
 CPPUNIT_TEST(testTdf121205);
 
 CPPUNIT_TEST(testTdf114179);
@@ -1746,6 +1750,57 @@ void Chart2ImportTest::testTdf116163()
 CPPUNIT_ASSERT_EQUAL(OUString("Dddd..."), xLabel3->getString());
 }
 
+void Chart2ImportTest::testTdf48041()
+{
+load("/chart2/qa/extras/data/pptx/", "tdf48041.pptx");
+
+Reference xChartDoc(getChartDocFromDrawImpress(0, 
0), uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDoc.is());
+
+Reference xYAxis = getAxisFromDoc(xChartDoc, 0, 1, 0);
+CPPUNIT_ASSERT(xYAxis.is());
+
+chart2::ScaleData aScaleData = xYAxis->getScaleData();
+CPPUNIT_ASSERT(aScaleData.Scaling.is());
+
+// Check visible text
+uno::Reference xDrawPageSupplier(xChartDoc, 
uno::UNO_QUERY);
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+const OUString sYAxisName = "CID/D=0:CS=0:Axis=1,0"; // Y Axis
+uno::Reference xYAxisShape = getShapeByName(xShapes, 
sYAxisName,
+// Axis occurs twice in chart xshape representation so need to get the 
one related to labels
+[](const uno::Reference& rXShape) -> bool
+{
+uno::Reference xAxisShapes(rXShape, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xAxisShapes.is());
+uno::Reference 
xChildShape(xAxisShapes->getByIndex(0), uno::UNO_QUERY);
+uno::Reference< drawing::XShapeDescriptor > 
xShapeDescriptor(xChildShape, uno::UNO_QUERY_THROW);
+return (xShapeDescriptor->getShapeType() == 
"com.sun.star.drawing.TextShape");
+});
+CPPUNIT_ASSERT(xYAxisShape.is());
+
+// Check label count
+uno::Reference xIndexAccess(xYAxisShape, 
UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(static_cast(6), xIndexAccess->getCount());
+
+// Check text
+uno::Reference xLabel0(xIndexAccess->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("0"), xLabel0->getString());
+uno::Reference xLabel1(xIndexAccess->getByIndex(1), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("1"), xLabel1->getString());
+uno::Reference xLabel2(xIndexAccess->getByIndex(2), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("2"), xLabel2->getString());
+uno::Reference xLabel3(xIndexAccess->getByIndex(3), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("3"), xLabel3->getString());
+uno::Reference xLabel4(xIndexAccess->getByIndex(4), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("4"), xLabel4->getString());
+uno::Reference xLabel5(xIndexAccess->getByIndex(5), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(OUString("5"), xLabel5->getString());
+}
+
 void Chart2ImportTest::testTdf121205()
 {
 load("/chart2/qa/extras/data/pptx/", "tdf121205.pptx");
diff --git a/chart2/qa/extras/data/pptx/tdf48041.pptx 
b/chart2/qa/extras/data/pptx/tdf48041.pptx
new file mode 100644
index ..b0872f84f2f6
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf48041.pptx differ
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index 4fac1f83b72e..99eb1b085185 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -28,6 +28,7 @@
 #include 
 #include "Tickmarks_Equidistant.hxx"
 #include 
+#include 
 
 #include 
 #include 
@@ -1551,11 +1552,35 @@ sal_Int32 
VCartesianAxis::estimateMaximumAutoMainIncrementCount()
 
 sal_Int32 nTotalAvailable = nMaxHeight;
 sal_Int32 nSingleNeeded = m_nMaximumTextHeightSoFar;
+sal_Int32 nMaxSameLabel = 0;
 
 //for horizontal axis:
 if( (m_nDimensionIndex == 0 && !m_aAxisProperties.m_bSwapXAndY)
 || (m_nDimensionIndex == 1 && m_aAxisProperties.m_bSwapXAndY) 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2019-04-12 Thread Noel Grandin (via logerrit)
 chart2/qa/extras/PivotChartTest.cxx |   30 +---
 chart2/qa/extras/chart2export.cxx   |4 --
 chart2/source/controller/main/ChartController_Tools.cxx |3 -
 chart2/source/view/charttypes/BubbleChart.cxx   |3 -
 chart2/source/view/diagram/VDiagram.cxx |3 -
 chart2/source/view/main/VDataSeries.cxx |8 +---
 chart2/source/view/main/VLegend.cxx |3 -
 7 files changed, 17 insertions(+), 37 deletions(-)

New commits:
commit f7d8e3318044bb70647424a1eea354bc59e4ced5
Author: Noel Grandin 
AuthorDate: Fri Apr 12 13:54:38 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 12 20:30:46 2019 +0200

loplugin:sequentialassign in chart2

Change-Id: I24140afc3f5b32b8b034e63e8d52f78be36a
Reviewed-on: https://gerrit.libreoffice.org/70659
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/PivotChartTest.cxx 
b/chart2/qa/extras/PivotChartTest.cxx
index 086c4e91bcdb..d5d348c89df5 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -544,11 +544,9 @@ void PivotChartTest::testPivotChartWithOneColumnField()
 
 table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
 
-uno::Reference xDataPilotTables;
-xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+uno::Reference xDataPilotTables = 
lclGetDataPilotTables(0, xSheetDoc);
 
-uno::Reference xDataPilotDescriptor;
-xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+uno::Reference xDataPilotDescriptor = 
xDataPilotTables->createDataPilotDescriptor();
 xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
 
 lclModifyOrientation(xDataPilotDescriptor, "Country", 
sheet::DataPilotFieldOrientation_COLUMN);
@@ -631,11 +629,9 @@ void PivotChartTest::testPivotChartWithOneRowField()
 
 table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
 
-uno::Reference xDataPilotTables;
-xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+uno::Reference xDataPilotTables = 
lclGetDataPilotTables(0, xSheetDoc);
 
-uno::Reference xDataPilotDescriptor;
-xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+uno::Reference xDataPilotDescriptor = 
xDataPilotTables->createDataPilotDescriptor();
 xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
 
 lclModifyOrientation(xDataPilotDescriptor, "Country", 
sheet::DataPilotFieldOrientation_ROW);
@@ -694,11 +690,9 @@ void 
PivotChartTest::testPivotTableDataProvider_PivotTableFields()
 
 table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
 
-uno::Reference xDataPilotTables;
-xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+uno::Reference xDataPilotTables = 
lclGetDataPilotTables(0, xSheetDoc);
 
-uno::Reference xDataPilotDescriptor;
-xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+uno::Reference xDataPilotDescriptor = 
xDataPilotTables->createDataPilotDescriptor();
 xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
 
 lclModifyOrientation(xDataPilotDescriptor, "City", 
sheet::DataPilotFieldOrientation_ROW);
@@ -804,11 +798,9 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
 
 table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
 
-uno::Reference xDataPilotTables;
-xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+uno::Reference xDataPilotTables = 
lclGetDataPilotTables(0, xSheetDoc);
 
-uno::Reference xDataPilotDescriptor;
-xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+uno::Reference xDataPilotDescriptor = 
xDataPilotTables->createDataPilotDescriptor();
 xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
 
 lclModifyOrientation(xDataPilotDescriptor, "Country", 
sheet::DataPilotFieldOrientation_ROW);
@@ -940,11 +932,9 @@ void PivotChartTest::testPivotChartWithDateRowField()
 
 table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
 
-uno::Reference xDataPilotTables;
-xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+uno::Reference xDataPilotTables = 
lclGetDataPilotTables(0, xSheetDoc);
 
-uno::Reference xDataPilotDescriptor;
-xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+uno::Reference xDataPilotDescriptor = 
xDataPilotTables->createDataPilotDescriptor();
 xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
 
 lclModifyOrientation(xDataPilotDescriptor, "Date", 
sheet::DataPilotFieldOrientation_ROW);
diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index b0cca5802f22..6dd8d7d9e9c1 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -1205,9 +1205,7 @@ void Chart2ExportTest::testShapeFollowedByChart()
 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2019-03-19 Thread Libreoffice Gerrit user
 chart2/qa/extras/chart2dump/chart2dump.cxx |   
 3 +
 chart2/qa/extras/chart2dump/data/pie_chart_100_and_0.ods   
|binary
 chart2/qa/extras/chart2dump/reference/piecharttest/pie_chart_100_and_0.txt |   
20 ++
 chart2/source/view/main/PlottingPositionHelper.cxx |   
17 +---
 chart2/source/view/main/PolarLabelPositionHelper.cxx   |   
 8 ++--
 chart2/source/view/main/ShapeFactory.cxx   |   
11 -
 6 files changed, 46 insertions(+), 13 deletions(-)

New commits:
commit 166a4989a0d1e5a6271c66bceb73a27970afc882
Author: Mike Kaganski 
AuthorDate: Tue Mar 19 21:27:20 2019 +0300
Commit: Mike Kaganski 
CommitDate: Tue Mar 19 22:28:59 2019 +0100

tdf#123504: 0 and 360 are different angles in charts

This partly reverts commit 81302f33073e7629d724ed269f1fa21dad29e141.

Change-Id: I40cbe739eb4497b8217aca56a2c3661ed1e491f4
Reviewed-on: https://gerrit.libreoffice.org/69440
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx 
b/chart2/qa/extras/chart2dump/chart2dump.cxx
index 030fb92e9918..4e91eeb9aa96 100644
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -855,7 +855,8 @@ DECLARE_DUMP_TEST(PieChartTest, Chart2DumpTest, false)
 "rotated_pie_chart.ods",
 "exploded_pie_chart.ods",
 "donut_chart.ods",
-"pie_chart_many_slices.ods"
+"pie_chart_many_slices.ods",
+"pie_chart_100_and_0.ods",
 };
 
 for (const OUString& sTestFile : aTestFiles)
diff --git a/chart2/qa/extras/chart2dump/data/pie_chart_100_and_0.ods 
b/chart2/qa/extras/chart2dump/data/pie_chart_100_and_0.ods
new file mode 100644
index ..a6ff5d6aa0e1
Binary files /dev/null and 
b/chart2/qa/extras/chart2dump/data/pie_chart_100_and_0.ods differ
diff --git 
a/chart2/qa/extras/chart2dump/reference/piecharttest/pie_chart_100_and_0.txt 
b/chart2/qa/extras/chart2dump/reference/piecharttest/pie_chart_100_and_0.txt
new file mode 100644
index ..40db143f4881
--- /dev/null
+++ b/chart2/qa/extras/chart2dump/reference/piecharttest/pie_chart_100_and_0.txt
@@ -0,0 +1,20 @@
+// nSeriesCount
+1
+/// Series 0 slices
+// nSlicesCountInSeries
+1
+/// /D=0:CS=0:CT=0:Series=0:Point=0
+// aSlicePosition.X
+3210
+// aSlicePosition.Y
+180
+// aSliceSize.Height
+8639
+// aSliceSize.Width
+8639
+// aSliceTransformation
+8639;0;3210;0;8639;180;0;0;1
+// static_cast(aSliceFillStyle)
+1
+// static_cast(aSliceFillColor)
+17798
\ No newline at end of file
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx 
b/chart2/source/view/main/PlottingPositionHelper.cxx
index 2382894e383a..c2c2d25b4c9c 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -32,7 +32,6 @@
 #include 
 
 #include 
-#include 
 
 namespace chart
 {
@@ -417,10 +416,11 @@ double PolarPlottingPositionHelper::getWidthAngleDegree( 
double& fStartLogicValu
 && !::rtl::math::approxEqual( fStartLogicValueOnAngleAxis, 
fEndLogicValueOnAngleAxis ) )
 fWidthAngleDegree = 360.0;
 
-while(fWidthAngleDegree<0.0)
-fWidthAngleDegree+=360.0;
-while(fWidthAngleDegree>360.0)
-fWidthAngleDegree-=360.0;
+// tdf#123504: both 0 and 360 are valid and different values here!
+while (fWidthAngleDegree < 0.0)
+fWidthAngleDegree += 360.0;
+while (fWidthAngleDegree > 360.0)
+fWidthAngleDegree -= 360.0;
 
 return fWidthAngleDegree;
 }
@@ -473,7 +473,12 @@ double 
PolarPlottingPositionHelper::transformToAngleDegree( double fLogicValueOn
 fRet = m_fAngleDegreeOffset
   + 
fAxisAngleScaleDirection*(fScaledLogicAngleValue-MinAngleValue)*360.0
 /fabs(MaxAngleValue-MinAngleValue);
-return NormAngle360(fRet);
+// tdf#123504: both 0 and 360 are valid and different values here!
+while (fRet > 360.0)
+fRet -= 360.0;
+while (fRet < 0)
+fRet += 360.0;
+return fRet;
 }
 
 /**
diff --git a/chart2/source/view/main/PolarLabelPositionHelper.cxx 
b/chart2/source/view/main/PolarLabelPositionHelper.cxx
index 6cea12f672cc..a3e9a7cd9778 100644
--- a/chart2/source/view/main/PolarLabelPositionHelper.cxx
+++ b/chart2/source/view/main/PolarLabelPositionHelper.cxx
@@ -24,8 +24,6 @@
 
 #include 
 
-#include 
-
 namespace chart
 {
 using namespace ::com::sun::star;
@@ -123,7 +121,11 @@ awt::Point 
PolarLabelPositionHelper::getLabelScreenPositionAndAlignmentForUnitCi
 //set LabelAlignment
 if( !bCenter )
 {
-fAngleDegree = NormAngle360(fAngleDegree);
+// tdf#123504: both 0 and 360 are valid and different values here!
+while (fAngleDegree > 360.0)
+fAngleDegree -= 360.0;
+while (fAngleDegree < 0.0)
+fAngleDegree += 360.0;
 
 bool 

[Libreoffice-commits] core.git: chart2/qa chart2/source sw/qa

2018-12-18 Thread Libreoffice Gerrit user
 chart2/qa/extras/chart2import.cxx  |   20 
 chart2/qa/extras/data/ods/tdf108021.ods|binary
 chart2/source/view/axes/VCartesianAxis.cxx |4 +++-
 sw/qa/extras/layout/data/tdf108021.odt |binary
 sw/qa/extras/layout/layout.cxx |   20 
 5 files changed, 43 insertions(+), 1 deletion(-)

New commits:
commit f8d6de19181d749d7c2b345ce7084c0c07fa3eab
Author: Balazs Varga 
AuthorDate: Fri Dec 14 14:38:49 2018 +0100
Commit: Bartosz Kosiorek 
CommitDate: Tue Dec 18 11:04:40 2018 +0100

tdf#108021 Chart: Fix text break of column chart X axis

With this patch the text break is allowed for column chart
X axis if the text is rotated with 0, 90 or 270 degree.
(The MS Office only allowed the text break of X axis
text when the rotation is 0, 90, or 270 degree.)

Change-Id: I0914f6208d5a5c0c864dc0227032ef858b05
Reviewed-on: https://gerrit.libreoffice.org/65165
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 64e343c6d639..b8b9a871142a 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -69,6 +69,7 @@ public:
 void testTdf86624(); // manually placed legends
 void testTdf105517();
 void testTdf106217();
+void testTdf108021();
 void testAutoBackgroundXLSX();
 void testChartAreaStyleBackgroundXLSX();
 void testChartHatchFillXLSX();
@@ -151,6 +152,7 @@ public:
 CPPUNIT_TEST(testTdf86624);
 CPPUNIT_TEST(testTdf105517);
 CPPUNIT_TEST(testTdf106217);
+CPPUNIT_TEST(testTdf108021);
 CPPUNIT_TEST(testAutoBackgroundXLSX);
 CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX);
 CPPUNIT_TEST(testChartHatchFillXLSX);
@@ -853,6 +855,24 @@ void Chart2ImportTest::testTdf106217()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(2700), aSize.Height);
 }
 
+void Chart2ImportTest::testTdf108021()
+{
+// Tdf108021 : To check TextBreak value is true.
+load("/chart2/qa/extras/data/ods/", "tdf108021.ods");
+uno::Reference< chart::XDiagram > mxDiagram;
+uno::Reference< beans::XPropertySet > xAxisProp;
+bool bTextBreak = false;
+uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 
0, mxComponent ), UNO_QUERY_THROW);
+mxDiagram.set(xChartDoc->getDiagram());
+CPPUNIT_ASSERT(mxDiagram.is());
+uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, 
uno::UNO_QUERY );
+CPPUNIT_ASSERT(xAxisXSupp.is());
+xAxisProp = xAxisXSupp->getXAxis();
+xAxisProp->getPropertyValue("TextBreak") >>= bTextBreak;
+// Expected value of 'TextBreak' is true
+CPPUNIT_ASSERT(bTextBreak);
+}
+
 void Chart2ImportTest::testTransparentBackground(OUString const & filename)
 {
 load("/chart2/qa/extras/data/xlsx/", filename);
diff --git a/chart2/qa/extras/data/ods/tdf108021.ods 
b/chart2/qa/extras/data/ods/tdf108021.ods
new file mode 100755
index ..ebbc5e56f24f
Binary files /dev/null and b/chart2/qa/extras/data/ods/tdf108021.ods differ
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index 7a025878733b..feaf09027c01 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -521,7 +521,9 @@ bool VCartesianAxis::isBreakOfLabelsAllowed(
 //no break for value axis
 if( !m_bUseTextLabels )
 return false;
-if( rAxisLabelProperties.fRotationAngleDegree != 0.0 )
+if( !( rAxisLabelProperties.fRotationAngleDegree == 0.0 ||
+   rAxisLabelProperties.fRotationAngleDegree == 90.0 ||
+   rAxisLabelProperties.fRotationAngleDegree == 270.0 ) )
 return false;
 //break only for horizontal axis
 return bIsHorizontalAxis;
diff --git a/sw/qa/extras/layout/data/tdf108021.odt 
b/sw/qa/extras/layout/data/tdf108021.odt
new file mode 100755
index ..39ef6df80d2f
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf108021.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 633a31f3b30b..f1c167f2b2e2 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -41,6 +41,7 @@ public:
 void testRedlineCharAttributes();
 void testTdf116830();
 void testTdf114163();
+void testTdf108021();
 void testTdf116925();
 void testTdf117028();
 void testTdf106390();
@@ -77,6 +78,7 @@ public:
 CPPUNIT_TEST(testRedlineCharAttributes);
 CPPUNIT_TEST(testTdf116830);
 CPPUNIT_TEST(testTdf114163);
+CPPUNIT_TEST(testTdf108021);
 CPPUNIT_TEST(testTdf116925);
 CPPUNIT_TEST(testTdf117028);
 CPPUNIT_TEST(testTdf106390);
@@ -2323,6 +2325,24 @@ void SwLayoutWriter::testTdf114163()
 // This failed, if the legend first label is not "Data3".
 }
 
+void SwLayoutWriter::testTdf108021()
+{
+SwDoc* pDoc = createDoc("tdf108021.odt");
+SwDocShell* pShell = 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2018-10-16 Thread Libreoffice Gerrit user
 chart2/qa/extras/xshape/data/reference/tdf90839-1.xml |   68 +-
 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml |   10 +-
 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml |   10 +-
 chart2/qa/extras/xshape/data/reference/tdf90839-4.xml |   10 +-
 chart2/source/tools/DiagramHelper.cxx |6 +
 5 files changed, 54 insertions(+), 50 deletions(-)

New commits:
commit 9672d034b9e760f24ac9a6652ab45dee15ee260a
Author: Eike Rathke 
AuthorDate: Tue Oct 16 12:03:24 2018 +0200
Commit: Eike Rathke 
CommitDate: Tue Oct 16 22:16:19 2018 +0200

Resolves: tdf#115182 default Chart percentage format is integer

Regression from

commit 0f4b3cb7d3d68906de316a64dcec281da2a641bd
CommitDate: Mon Aug 10 17:12:45 2015 +0200

The chart2/qa/extras/xshape/data/reference/tdf90839-?.xml
reference files were created with the then wrong default of two
decimals so need to be adapted.

For chart2/qa/extras/xshape/data/reference/tdf90839-1.xml this
meant to regenerate because of the changed positions and sizes of
labels.

Change-Id: Ib0c2c862af9399ab2af5178d01510aa5e4fff97c
Reviewed-on: https://gerrit.libreoffice.org/61826
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
index 7dcbab785af3..3a5070283565 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
@@ -175,15 +175,15 @@

   
  
- 
+ 
   
-   
+   
 
- 
+ 
   
-   
+   
 
- 
+ 
   
   
   
@@ -192,21 +192,21 @@
   
   
   
-   
-   
+   
+   

   
  
 
 
- 
- 
+ 
+ 
  
 

-   
+   
 
- 
+ 
   
   
   
@@ -215,21 +215,21 @@
   
   
   
-   
-   
+   
+   

   
  
 
 
- 
- 
+ 
+ 
  
 


 
- 
+ 
   
   
   
@@ -250,9 +250,9 @@
  
 

-   
+   
 
- 
+ 
   
   
   
@@ -261,21 +261,21 @@
   
   
   
-   
-   
+   
+   

   
  
 
 
- 
- 
+ 
+ 
  
 

-   
+   
 
- 
+ 
   
   
   
@@ -284,36 +284,36 @@
   
   
   
-   
-   
+   
+   

   
  
 
 
- 
- 
+ 
+ 
  
 

   
   
-   
-   
+   
+   

   
  
 
 
- 
- 
+ 
+ 
  
 

   
   
-   
-   
+   
+   

   
  
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
index 489b346d4170..b90bf060b694 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml
@@ -183,7 +183,7 @@
   

 
- 
+ 
   
   
   
@@ -206,7 +206,7 @@


 
- 
+ 
   
   
   
@@ -229,7 +229,7 @@


 
- 
+ 
   
   
   
@@ -252,7 +252,7 @@


 
- 
+ 
   
   
   
@@ -275,7 +275,7 @@


 
- 
+ 
   
   
   
diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml
index 

[Libreoffice-commits] core.git: chart2/qa chart2/source compilerplugins/clang connectivity/source dbaccess/qa dbaccess/source filter/source forms/source i18nlangtag/source sc/source sd/source sfx2/sou

2018-08-29 Thread Libreoffice Gerrit user
 chart2/qa/extras/chart2dump/chart2dump.cxx   |4 
 chart2/source/tools/ExponentialRegressionCurveCalculator.cxx |   12 -
 chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx |8 -
 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx  |2 
 chart2/source/tools/PotentialRegressionCurveCalculator.cxx   |6 
 chart2/source/view/charttypes/VSeriesPlotter.cxx |2 
 compilerplugins/clang/stringbuffer.cxx   |   67 +++
 compilerplugins/clang/test/stringbuffer.cxx  |   22 +++
 connectivity/source/drivers/postgresql/pq_xkeys.cxx  |2 
 connectivity/source/drivers/postgresql/pq_xtables.cxx|2 
 connectivity/source/drivers/postgresql/pq_xuser.cxx  |6 
 connectivity/source/drivers/postgresql/pq_xviews.cxx |6 
 dbaccess/qa/unit/embeddeddb_performancetest.cxx  |   17 +-
 dbaccess/source/core/api/CacheSet.cxx|6 
 dbaccess/source/core/api/KeySet.cxx  |   10 -
 dbaccess/source/core/api/OptimisticSet.cxx   |4 
 dbaccess/source/core/api/SingleSelectQueryComposer.cxx   |   20 +--
 dbaccess/source/core/dataaccess/ContentHelper.cxx|2 
 dbaccess/source/ext/macromigration/migrationlog.cxx  |8 -
 dbaccess/source/filter/xml/xmlServerDatabase.cxx |   22 +--
 dbaccess/source/ui/misc/WCopyTable.cxx   |2 
 dbaccess/source/ui/querydesign/QueryDesignView.cxx   |2 
 dbaccess/source/ui/uno/copytablewizard.cxx   |2 
 filter/source/config/cache/filtercache.cxx   |   24 +--
 forms/source/xforms/model_ui.cxx |2 
 i18nlangtag/source/languagetag/languagetag.cxx   |6 
 sc/source/core/tool/chgtrack.cxx |4 
 sc/source/core/tool/compiler.cxx |4 
 sd/source/filter/html/htmlex.cxx |   12 -
 sfx2/source/control/unoctitm.cxx |6 
 solenv/CompilerTest_compilerplugins_clang.mk |1 
 sw/source/uibase/uiview/pview.cxx|4 
 vcl/source/uitest/logger.cxx |   12 -
 xmloff/source/draw/animationexport.cxx   |2 
 xmloff/source/draw/shapeexport.cxx   |2 
 xmloff/source/style/xmlbahdl.cxx |4 
 xmloff/source/style/xmlexppr.cxx |2 
 xmloff/source/style/xmlnumfi.cxx |6 
 xmloff/source/xforms/xformsexport.cxx|6 
 xmlsecurity/source/dialogs/resourcemanager.cxx   |2 
 40 files changed, 212 insertions(+), 121 deletions(-)

New commits:
commit 4c91b89d8ce9c34179f31854dc88bd0a9fa84cba
Author: Noel Grandin 
AuthorDate: Tue Aug 28 15:09:33 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 29 09:05:18 2018 +0200

new loplugin:oustringbuffer

look for places where we are appending the temporary result of adding
strings together, to an OUStringBuffer, where we could rather call
append repeatedly and avoid the temporary creation

Change-Id: I481435124291ac7fb54b91a78344a9fe5b379a82
Reviewed-on: https://gerrit.libreoffice.org/59708
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx 
b/chart2/qa/extras/chart2dump/chart2dump.cxx
index ceb818c70e0f..e06ce2f76415 100644
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -230,7 +230,7 @@ protected:
 OUStringBuffer aBufer;
 for (const OUString& seqItem : rSeq)
 {
-aBufer.append(seqItem + ";");
+aBufer.append(seqItem).append(";");
 }
 return aBufer.makeStringAndClear();
 }
@@ -240,7 +240,7 @@ protected:
 OUStringBuffer aBufer;
 for (const double& vectorItem : rVector)
 {
-aBufer.append(OUString::number(vectorItem) + ";");
+aBufer.append(OUString::number(vectorItem)).append(";");
 }
 return aBufer.makeStringAndClear();
 }
diff --git a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx 
b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
index db59250b76b0..42d0480d6b73 100644
--- a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
@@ -179,13 +179,13 @@ OUString 
ExponentialRegressionCurveCalculator::ImplGetRepresentation(
 // if nValueLength not calculated then nullptr
 sal_Int32* pValueLength = nValueLength ?  : nullptr;
 if ( m_fSign < 0.0 )
-aTmpBuf.append( OUStringLiteral1(aMinusSign) + " " );
+aTmpBuf.append( OUStringLiteral1(aMinusSign) 

[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/source connectivity/source dbaccess/qa dbaccess/source embeddedobj/source extensions/source filter/source forms/source framework/sour

2018-06-07 Thread Noel Grandin
 chart2/qa/extras/chart2_trendcalculators.cxx  |1 
 chart2/qa/extras/chart2dump/chart2dump.cxx|   19 -
 chart2/qa/extras/chart2export.cxx |3 
 chart2/qa/extras/chart2import.cxx |   12 
 chart2/qa/extras/charttest.hxx|   28 -
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |   42 --
 chart2/source/model/main/ChartModel_Persistence.cxx   |1 
 chart2/source/model/template/StockDataInterpreter.cxx |1 
 chart2/source/tools/AxisHelper.cxx|   75 +--
 chart2/source/tools/ChartTypeHelper.cxx   |3 
 chart2/source/tools/DiagramHelper.cxx |2 
 chart2/source/view/main/ChartView.cxx |3 
 comphelper/source/misc/documentinfo.cxx   |1 
 connectivity/source/commontools/dbtools.cxx   |   15 
 connectivity/source/drivers/component/CDatabaseMetaData.cxx   |1 
 connectivity/source/drivers/hsqldb/HConnection.cxx|3 
 dbaccess/qa/extras/dialog-save.cxx|9 
 dbaccess/qa/extras/empty-stdlib-save.cxx  |9 
 dbaccess/qa/extras/nolib-save.cxx |9 
 dbaccess/source/ui/misc/databaseobjectview.cxx|   13 
 dbaccess/source/ui/tabledesign/TableController.cxx|1 
 embeddedobj/source/msole/olepersist.cxx   |3 
 extensions/source/abpilot/datasourcehandling.cxx  |   15 
 filter/source/svg/svgwriter.cxx   |  189 
--
 forms/source/runtime/formoperations.cxx   |1 
 framework/source/dispatch/closedispatcher.cxx |   11 
 oox/source/export/chartexport.cxx |3 
 oox/source/export/drawingml.cxx   |2 
 oox/source/ppt/slidepersist.cxx   |2 
 package/source/xstor/xstorage.cxx |3 
 pyuno/source/module/pyuno_module.cxx  |1 
 reportdesign/source/core/api/FormattedField.cxx   |   15 
 reportdesign/source/filter/xml/xmlExport.cxx  |3 
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx   |2 
 reportdesign/source/filter/xml/xmlfilter.cxx  |   13 
 reportdesign/source/ui/dlg/Navigator.cxx  |1 
 sc/qa/extras/check_data_pilot_field.cxx   |1 
 sc/qa/extras/check_data_pilot_table.cxx   |1 
 sc/qa/extras/check_xcell_ranges_query.cxx |1 
 sc/qa/extras/new_cond_format.cxx  |1 
 sc/qa/extras/regression-test.cxx  |8 
 sc/qa/extras/scannotationobj.cxx  |2 
 sc/qa/extras/scannotationshapeobj.cxx |1 
 sc/qa/extras/scannotationsobj.cxx |3 
 sc/qa/extras/scarealinkobj.cxx|1 
 sc/qa/extras/scarealinksobj.cxx   |1 
 sc/qa/extras/scautoformatobj.cxx  |1 
 sc/qa/extras/sccellcursorobj.cxx  |2 
 sc/qa/extras/sccellobj.cxx|1 
 sc/qa/extras/sccellrangeobj.cxx   |9 
 sc/qa/extras/sccellrangesobj.cxx  |1 
 sc/qa/extras/scconsolidationdescriptorobj.cxx |1 
 sc/qa/extras/scdatabaserangeobj.cxx   |1 
 sc/qa/extras/scdatabaserangesobj.cxx  |1 
 sc/qa/extras/scdatapilotfieldobj.cxx  |4 
 sc/qa/extras/scdatapilotitemobj.cxx   |1 
 sc/qa/extras/scdatapilottableobj.cxx  |5 
 sc/qa/extras/scdatapilottablesobj.cxx |2 
 sc/qa/extras/scddelinkobj.cxx |1 
 sc/qa/extras/scdocumentconfigurationobj.cxx   |2 
 sc/qa/extras/scfilterdescriptorbaseobj.cxx|1 
 sc/qa/extras/scfunctiondescriptionobj.cxx |1 
 sc/qa/extras/scfunctionlistobj.cxx|2 
 sc/qa/extras/scheaderfootercontentobj.cxx |1 
 sc/qa/extras/scimportdescriptorbaseobj.cxx|2 
 sc/qa/extras/sclabelrangeobj.cxx  |1 
 

[Libreoffice-commits] core.git: chart2/qa chart2/source include/oox oox/source

2018-03-04 Thread Szymon Kłos
 chart2/qa/extras/chart2export.cxx  |   11 +++
 chart2/qa/extras/data/pptx/tdf116163.pptx  |binary
 chart2/source/view/axes/VAxisProperties.hxx|2 
 chart2/source/view/axes/VCartesianAxis.cxx |   50 +
 chart2/source/view/axes/VCartesianCoordinateSystem.cxx |2 
 chart2/source/view/axes/VCartesianCoordinateSystem.hxx |3 -
 chart2/source/view/axes/VCoordinateSystem.cxx  |1 
 chart2/source/view/axes/VPolarCoordinateSystem.cxx |1 
 chart2/source/view/axes/VPolarCoordinateSystem.hxx |3 -
 chart2/source/view/inc/VCoordinateSystem.hxx   |3 -
 chart2/source/view/main/ChartView.cxx  |2 
 include/oox/export/chartexport.hxx |2 
 oox/source/export/chartexport.cxx  |   20 +-
 13 files changed, 92 insertions(+), 8 deletions(-)

New commits:
commit 35d062f7879d5414334643cb90bff411726b2168
Author: Szymon Kłos 
Date:   Fri Mar 2 10:39:33 2018 +0100

tdf#116163: Limit label height in chart if needed

Change-Id: Ia84fd0c3b76886bc6124dc3b59035465aa31b020
Reviewed-on: https://gerrit.libreoffice.org/50700
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 9f5efb140036..d0ab36eb743f 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -107,6 +107,7 @@ public:
 void testCustomDataLabel();
 void testCustomDataLabelMultipleSeries();
 void testNumberFormatExportPPTX();
+void testTdf116163();
 
 CPPUNIT_TEST_SUITE(Chart2ExportTest);
 CPPUNIT_TEST(testErrorBarXLSX);
@@ -176,6 +177,7 @@ public:
 CPPUNIT_TEST(testCustomDataLabel);
 CPPUNIT_TEST(testCustomDataLabelMultipleSeries);
 CPPUNIT_TEST(testNumberFormatExportPPTX);
+CPPUNIT_TEST(testTdf116163);
 CPPUNIT_TEST_SUITE_END();
 
 protected:
@@ -1743,6 +1745,15 @@ void Chart2ExportTest::testNumberFormatExportPPTX()
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:numFmt", 
"sourceLinked", "0");
 }
 
+void Chart2ExportTest::testTdf116163()
+{
+load("/chart2/qa/extras/data/pptx/", "tdf116163.pptx");
+xmlDocPtr pXmlDoc = parseExport("ppt/charts/chart", "Impress MS PowerPoint 
2007 XML");
+CPPUNIT_ASSERT(pXmlDoc);
+
+assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:catAx/c:txPr/a:bodyPr", "rot", "-540");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/pptx/tdf116163.pptx 
b/chart2/qa/extras/data/pptx/tdf116163.pptx
new file mode 100644
index ..5fbee8304a52
Binary files /dev/null and b/chart2/qa/extras/data/pptx/tdf116163.pptx differ
diff --git a/chart2/source/view/axes/VAxisProperties.hxx 
b/chart2/source/view/axes/VAxisProperties.hxx
index 20f648d4fe8d..9a10c94f4719 100644
--- a/chart2/source/view/axes/VAxisProperties.hxx
+++ b/chart2/source/view/axes/VAxisProperties.hxx
@@ -137,6 +137,8 @@ struct AxisProperties final
 css::uno::Reference 
m_xAxisTextProvider; //for categories or series names
 //<- category axes
 
+boolm_bLimitSpaceForLabels;
+
 //methods:
 
 AxisProperties( const css::uno::Reference< css::chart2::XAxis >& xAxisModel
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index 9dab35cc16ed..dd5593c66476 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -74,6 +74,53 @@ VCartesianAxis::~VCartesianAxis()
 m_pPosHelper = nullptr;
 }
 
+void lcl_ResizeTextShapeToFitAvailableSpace( Reference< drawing::XShape >& 
xShape2DText,
+ const AxisLabelProperties& 
rAxisLabelProperties,
+ const OUString& rLabel,
+ const tNameSequence& rPropNames,
+ const tAnySequence& rPropValues )
+{
+uno::Reference< text::XTextRange > xTextRange( xShape2DText, 
uno::UNO_QUERY );
+
+if( !xTextRange.is() )
+return;
+
+const sal_Int32 nFullHeight = 
rAxisLabelProperties.m_aFontReferenceSize.Height;
+
+if( !nFullHeight || !rLabel.getLength() )
+return;
+
+sal_Int32 nMaxLabelsHeight = nFullHeight - 
rAxisLabelProperties.m_aMaximumSpaceForLabels.Height - 
rAxisLabelProperties.m_aMaximumSpaceForLabels.Y;
+const sal_Int32 nAvgCharWidth = xShape2DText->getSize().Width / 
rLabel.getLength();
+const sal_Int32 nTextSize = AbstractShapeFactory::getSizeAfterRotation( 
xShape2DText,
+
rAxisLabelProperties.fRotationAngleDegree ).Height;
+
+if( !nAvgCharWidth )
+return;
+
+const 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2017-07-23 Thread Dennis Francis
 chart2/qa/extras/chart2import.cxx|   23 +++
 chart2/qa/extras/data/docx/bubblechart.docx  |binary
 chart2/source/tools/InternalDataProvider.cxx |2 +-
 3 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 0bdbd099bb52ae687196e06561e03c5c4d9c90eb
Author: Dennis Francis 
Date:   Thu Jul 20 13:15:57 2017 +0530

tdf#103984 : For bubble charts append data column...

for "values-size" role too, after parsing in
InternalDataProvider::createDataSequenceFromArray().
Without this, embedded bubble charts in documents(MSO) other
than spreadsheets will be empty when imported.

Also adds docx import chart2-unit-test in chart2import.cxx

Change-Id: I63168074b30090a8b7cf977eb5af443f6b9ac240
Reviewed-on: https://gerrit.libreoffice.org/40258
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 871b41bc5376..e38612724ed0 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -39,6 +39,7 @@ public:
 void testODTChartSeries();
 void testDOCChartSeries();
 void testDOCXChartSeries();
+void testDOCXChartValuesSize();
 void testPPTXChartSeries();
 void testPPTXSparseChartSeries();
 /**
@@ -105,6 +106,7 @@ public:
 CPPUNIT_TEST(testODTChartSeries);
 CPPUNIT_TEST(testDOCChartSeries);
 CPPUNIT_TEST(testDOCXChartSeries);
+CPPUNIT_TEST(testDOCXChartValuesSize);
 CPPUNIT_TEST(testPPTChartSeries);
 CPPUNIT_TEST(testPPTXChartSeries);
 CPPUNIT_TEST(testPPTXSparseChartSeries);
@@ -375,6 +377,27 @@ void Chart2ImportTest::testDOCXChartSeries()
 CPPUNIT_ASSERT_EQUAL(OUString("Series 3"), aLabels[2][0].get());
 }
 
+void Chart2ImportTest::testDOCXChartValuesSize()
+{
+load( "/chart2/qa/extras/data/docx/", "bubblechart.docx" );
+Reference xChartDoc( getChartDocFromWriter(0), 
uno::UNO_QUERY );
+CPPUNIT_ASSERT( xChartDoc.is() );
+
+uno::Reference< chart::XChartDataArray > xDataArray( 
xChartDoc->getDataProvider(), UNO_QUERY_THROW );
+Sequence aColumnDesc = xDataArray->getColumnDescriptions();
+// Number of columns = 3 (Y-values, X-values and bubble sizes).
+// Without the fix there would only be 2 columns (no bubble sizes).
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "There must be 3 columns and descriptions", 
static_cast(3), aColumnDesc.getLength() );
+Sequence aData = xDataArray->getData();
+CPPUNIT_ASSERT_EQUAL_MESSAGE( "There must be exactly 3 data points", 
static_cast(3), aData.getLength() );
+
+std::vector aExpected = { { 2.7, 0.7, 10.0 }, { 3.2, 
1.8, 4.0 }, { 0.8, 2.6, 8.0 } };
+
+for ( sal_Int32 nRowIdx = 0; nRowIdx < 3; ++nRowIdx )
+for( sal_Int32 nColIdx = 0; nColIdx < 3; ++nColIdx )
+CPPUNIT_ASSERT_DOUBLES_EQUAL( aExpected[nRowIdx][nColIdx], 
aData[nRowIdx][nColIdx], 1e-1 );
+}
+
 void Chart2ImportTest::testPPTChartSeries()
 {
 //test chart series names for ppt
diff --git a/chart2/qa/extras/data/docx/bubblechart.docx 
b/chart2/qa/extras/data/docx/bubblechart.docx
new file mode 100644
index ..c2040730cfcc
Binary files /dev/null and b/chart2/qa/extras/data/docx/bubblechart.docx differ
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index c407c3ac9cdd..f936cd664a92 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -566,7 +566,7 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 }
 
 if (rRole == "values-y" || rRole == "values-first" || rRole == 
"values-last" ||
-rRole == "values-min" || rRole == "values-max")
+rRole == "values-min" || rRole == "values-max" || rRole == 
"values-size")
 {
 // Column values.  Append a new data column and populate it.
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source

2017-07-10 Thread Dennis Francis
 chart2/qa/extras/chart2dump/chart2dump.cxx 
   |   44 ++
 chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods
   |binary
 
chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt
 |2 
 chart2/source/view/main/ChartView.cxx  
   |7 +
 chart2/source/view/main/VButton.cxx
   |3 
 chart2/source/view/main/VButton.hxx
   |5 +
 chart2/source/view/main/VLegend.cxx
   |3 
 7 files changed, 62 insertions(+), 2 deletions(-)

New commits:
commit c86be45d343635f2e137b8ea710d87e1a612101d
Author: Dennis Francis 
Date:   Fri Jul 7 16:07:28 2017 +0530

tdf#108986 : no arrow for "Data" button on pivot chart

Also changed the fill color of "Data" button to a lighter shade
to distiguish it from other buttons, for both row and column fields.

Added matching testcase in chart2dump.cxx

Change-Id: I2ae5da6c3552372f606da41055f1e0663b6f0802
Reviewed-on: https://gerrit.libreoffice.org/39687
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/chart2/qa/extras/chart2dump/chart2dump.cxx 
b/chart2/qa/extras/chart2dump/chart2dump.cxx
index 989d50819d04..56bf59ecca31 100755
--- a/chart2/qa/extras/chart2dump/chart2dump.cxx
+++ b/chart2/qa/extras/chart2dump/chart2dump.cxx
@@ -1119,6 +1119,50 @@ DECLARE_DUMP_TEST(PointLineChartTest, Chart2DumpTest, 
false)
 }
 }
 
+DECLARE_DUMP_TEST( PivotChartDataButtonTest, Chart2DumpTest, false )
+{
+const OUString aTestFile = "pivotchart_data_button.ods";
+
+setTestFileName( aTestFile );
+load( getTestFileDirName(), getTestFileName() );
+
+// Check that we have pivot chart in the document
+uno::Reference xTablePivotCharts = 
getTablePivotChartsFromSheet( 1, mxComponent );
+uno::Reference xIndexAccess( xTablePivotCharts, 
UNO_QUERY_THROW );
+CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xIndexAccess->getCount() );
+
+// Get the pivot chart document so we ca access its data
+uno::Reference xChartDoc;
+xChartDoc.set( getPivotChartDocFromSheet( xTablePivotCharts, 0 ) );
+CPPUNIT_ASSERT( xChartDoc.is() );
+
+uno::Reference xDrawPageSupplier( xChartDoc, 
uno::UNO_QUERY );
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes( xDrawPage->getByIndex(0), 
uno::UNO_QUERY );
+CPPUNIT_ASSERT( xShapes.is() );
+
+// Get the shape that represents the "Data" button.
+uno::Reference xButton = getShapeByName( xShapes, 
"FieldButton.Row.8",
+  []( const 
uno::Reference& xShapeNode )
+  {
+  return 
xShapeNode->getShapeType() == "com.sun.star.drawing.TextShape";
+  } );
+CPPUNIT_ASSERT_MESSAGE( OString( "Cannot find Data button shape" 
).getStr(), xButton.is() );
+
+// Make sure that there is no arrow shape with the Data button
+uno::Reference xArrow = getShapeByName( xShapes, 
"FieldButton.Row.8",
+ []( const 
uno::Reference& xShapeNode )
+ {
+ return 
xShapeNode->getShapeType() == "com.sun.star.drawing.PolyPolygonShape";
+ } );
+CPPUNIT_ASSERT_MESSAGE( OString( "Arrow shape should not be present for 
the Data button" ).getStr(), !xArrow.is() );
+
+// Assert the background color of the Data button
+util::Color aButtonFillColor = 0;
+uno::Reference xPropSet( xButton, UNO_QUERY_THROW );
+xPropSet->getPropertyValue( UNO_NAME_FILLCOLOR ) >>= aButtonFillColor;
+CPPUNIT_DUMP_ASSERT_NUMBERS_EQUAL( static_cast( 
aButtonFillColor ) );
+}
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods 
b/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods
new file mode 100644
index ..d57edf66d29b
Binary files /dev/null and 
b/chart2/qa/extras/chart2dump/data/pivotchart_data_button.ods differ
diff --git 
a/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt
 
b/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt
new file mode 100644
index ..3d7d8a55c6cc
--- /dev/null
+++ 
b/chart2/qa/extras/chart2dump/reference/pivotchartdatabuttontest/pivotchart_data_button.txt
@@ -0,0 +1,2 @@
+// static_cast( aButtonFillColor 

[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/source connectivity/source dbaccess/source extensions/source sw/source

2017-07-07 Thread Jochen Nitschke
 chart2/qa/extras/chart2export.cxx |1 -
 chart2/source/controller/main/DrawCommandDispatch.cxx |2 +-
 comphelper/source/property/property.cxx   |4 ++--
 connectivity/source/commontools/dbtools.cxx   |4 ++--
 connectivity/source/commontools/dbtools2.cxx  |2 +-
 dbaccess/source/ui/misc/UITools.cxx   |4 ++--
 extensions/source/propctrlr/cellbindinghelper.cxx |2 +-
 sw/source/core/unocore/unochart.cxx   |   17 ++---
 8 files changed, 15 insertions(+), 21 deletions(-)

New commits:
commit c5e4534808c03ce30c7b3e4bbed38ed5fca2d77f
Author: Jochen Nitschke 
Date:   Thu Jul 6 19:36:34 2017 +0200

remove nullptr checks on STL search result iterators

results are in the range of first_iterator to last_iterator.
If one of those is nullptr the algorithm would fail anyway.

This removes some impossible checks in
sw/source/core/unocore/unochart.cxx:
SwChartDataProvider::detectArguments.
A sorted range still holds the same values and has
the same length as the original range.
Replacing raw pointers eases reading this code.

Change-Id: If96bd11e9167488346a57e9e08507ac42338d3cd
Reviewed-on: https://gerrit.libreoffice.org/39683
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 89ae67d570d6..11f37235835b 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -205,7 +205,6 @@ OUString findChartFile(const OUString& rDir, 
uno::Reference< container::XNameAcc
 uno::Sequence aNames = xNames->getElementNames();
 OUString* pElement = std::find_if(aNames.begin(), aNames.end(), 
CheckForChartName(rDir));
 
-CPPUNIT_ASSERT(pElement);
 CPPUNIT_ASSERT(pElement != aNames.end());
 return *pElement;
 }
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx 
b/chart2/source/controller/main/DrawCommandDispatch.cxx
index cded08bb68c8..d990e351bbd1 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -363,7 +363,7 @@ void DrawCommandDispatch::execute( const OUString& 
rCommand, const Sequence< bea
 
[](const beans::PropertyValue& lhs)
 {return 
lhs.Name == sKeyModifier;} );
 sal_Int16 nKeyModifier = 0;
-if ( pKeyModifier != pEnd && pKeyModifier && ( 
pKeyModifier->Value >>= nKeyModifier ) && nKeyModifier == KEY_MOD1 )
+if ( pKeyModifier != pEnd && ( pKeyModifier->Value >>= 
nKeyModifier ) && nKeyModifier == KEY_MOD1 )
 {
 if ( eDrawMode == CHARTDRAW_INSERT )
 {
diff --git a/comphelper/source/property/property.cxx 
b/comphelper/source/property/property.cxx
index d5ddc9a9ab7b..a0083908246f 100644
--- a/comphelper/source/property/property.cxx
+++ b/comphelper/source/property/property.cxx
@@ -149,7 +149,7 @@ void RemoveProperty(Sequence& _rProps, const 
OUString& _rPropName)
 Property aNameProp(_rPropName, 0, Type(), 0);
 const Property* pResult = std::lower_bound(pProperties, pProperties + 
nLen, aNameProp, PropertyCompareByName());
 
-if ( pResult && (pResult != pProperties + nLen) && (pResult->Name == 
_rPropName) )
+if ( pResult != _rProps.end() && pResult->Name == _rPropName )
 {
 OSL_ENSURE(pResult->Name.equals(_rPropName), "::RemoveProperty 
Properties not sorted");
 removeElementAt(_rProps, pResult - pProperties);
@@ -166,7 +166,7 @@ void ModifyPropertyAttributes(Sequence& seqProps, 
const OUString& sPro
 Property aNameProp(sPropName, 0, Type(), 0);
 Property* pResult = std::lower_bound(pProperties, pProperties + nLen, 
aNameProp, PropertyCompareByName());
 
-if ( pResult && (pResult != pProperties + nLen) && (pResult->Name == 
sPropName) )
+if ( (pResult != seqProps.end()) && (pResult->Name == sPropName) )
 {
 pResult->Attributes |= nAddAttrib;
 pResult->Attributes &= ~nRemoveAttrib;
diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 109217552183..23905d80f14a 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -962,8 +962,8 @@ try
 Property* pResult = std::lower_bound(
 pNewProps, pNewProps + nNewLen, pOldProps[i], 
::comphelper::PropertyCompareByName());
 
-if (pResult
-&& ( pResult != pNewProps + nNewLen && pResult->Name == 
pOldProps[i].Name )
+if (   ( pResult != aNewProperties.end() )
+&& ( pResult->Name == pOldProps[i].Name )
 

[Libreoffice-commits] core.git: chart2/qa chart2/source i18npool/source linguistic/source oox/source reportdesign/source sc/qa sc/source sdext/source sfx2/source svl/source svtools/source svx/source s

2017-06-09 Thread Noel Grandin
 chart2/qa/extras/PivotChartTest.cxx|6 -
 chart2/source/model/main/ChartModel.cxx|   26 +-
 i18npool/source/localedata/localedata.cxx  |3 
 linguistic/source/gciterator.cxx   |   13 +--
 oox/source/export/shapes.cxx   |   10 +-
 oox/source/vml/vmlformatting.cxx   |   16 +--
 reportdesign/source/ui/dlg/PageNumber.cxx  |   16 +--
 reportdesign/source/ui/report/ReportController.cxx |   10 +-
 reportdesign/source/ui/report/dlgedfunc.cxx|7 -
 sc/qa/extras/sccellrangeobj.cxx|7 -
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   86 +
 sc/source/filter/xml/XMLStylesExportHelper.cxx |   15 +--
 sc/source/filter/xml/xmlwrap.cxx   |8 -
 sc/source/ui/docshell/docsh8.cxx   |   10 +-
 sc/source/ui/unoobj/PivotTableDataProvider.cxx |   28 ++
 sc/source/ui/unoobj/TablePivotCharts.cxx   |   10 +-
 sc/source/ui/unoobj/dapiuno.cxx|   19 +---
 sc/source/ui/unoobj/docuno.cxx |8 -
 sc/source/ui/unoobj/eventuno.cxx   |   12 +-
 sc/source/ui/unoobj/filtuno.cxx|   11 --
 sc/source/ui/unoobj/styleuno.cxx   |   20 +---
 sdext/source/pdfimport/wrapper/wrapper.cxx |   19 +---
 sfx2/source/control/emojicontrol.cxx   |   14 +--
 sfx2/source/doc/doctemplates.cxx   |   10 +-
 sfx2/source/doc/sfxbasemodel.cxx   |6 -
 svl/source/numbers/numfmuno.cxx|   45 +++---
 svtools/source/misc/embedtransfer.cxx  |   10 +-
 svx/source/svdraw/svdobj.cxx   |6 -
 svx/source/unodraw/unoshap4.cxx|7 -
 sw/qa/core/macros-test.cxx |   13 +--
 sw/qa/extras/globalfilter/globalfilter.cxx |9 --
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |   17 +---
 sw/qa/extras/uiwriter/uiwriter.cxx |   48 +--
 sw/source/core/access/accnotextframe.cxx   |3 
 sw/source/core/attr/format.cxx |5 -
 sw/source/core/doc/number.cxx  |5 -
 sw/source/filter/docx/swdocxreader.cxx |   10 +-
 sw/source/filter/rtf/swparrtf.cxx  |   21 ++---
 sw/source/filter/ww8/ww8par.cxx|   23 ++---
 sw/source/filter/xml/xmltexti.cxx  |7 -
 sw/source/uibase/uno/SwXFilterOptions.cxx  |   11 --
 sw/source/uibase/utlui/unotools.cxx|   14 +--
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |7 -
 vcl/unx/gtk/salprn-gtk.cxx |   18 +---
 writerfilter/source/dmapper/CellMarginHandler.cxx  |   18 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx  |   36 +++-
 xmlsecurity/qa/unit/signing/signing.cxx|   31 +++
 47 files changed, 318 insertions(+), 436 deletions(-)

New commits:
commit 027b25ecd54ac97ea2471ca73e3ba89ce052fe76
Author: Noel Grandin 
Date:   Fri Jun 9 13:43:00 2017 +0200

use comphelper::InitPropertySequence in more places

Change-Id: I72d7b13a23ce306b752b39187a0e9fbb7028643a
Reviewed-on: https://gerrit.libreoffice.org/38606
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/chart2/qa/extras/PivotChartTest.cxx 
b/chart2/qa/extras/PivotChartTest.cxx
index f1a345fa964c..d03afda37b2e 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -188,10 +188,8 @@ uno::Reference 
lclGetPivotTableByName(sal_Int32 nIndex,
 uno::Sequence
 lclGetCategories(Reference const & xChartDoc)
 {
-uno::Sequence aArguments(1);
-aArguments[0] = beans::PropertyValue("CellRangeRepresentation", -1,
- 
uno::makeAny("PT@categories"),
- beans::PropertyState_DIRECT_VALUE);
+uno::Sequence aArguments( 
comphelper::InitPropertySequence(
+{{"CellRangeRepresentation", uno::Any(OUString("PT@categories"))}} 
));
 
 uno::Reference 
xDataProvider(xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW);
 return xDataProvider->createDataSource(aArguments)->getDataSequences();
diff --git a/chart2/source/model/main/ChartModel.cxx 
b/chart2/source/model/main/ChartModel.cxx
index b83e04408b82..bef84f2006b3 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -41,6 +41,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -744,25 +745,12 @@ Reference< chart2::data::XDataSource > 
ChartModel::impl_createDefaultData()
 xIni->initialize(aArgs);
 }
 //create data
-uno::Sequence aArgs(4);
-aArgs[0] = 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2017-03-31 Thread Noel Grandin
 chart2/qa/extras/chart2export.cxx|   15 
+++
 chart2/qa/extras/chart2import.cxx|   20 
++
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx  |2 -
 chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx |2 -
 chart2/source/controller/dialogs/res_LegendPosition.cxx  |6 +--
 chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx|6 +--
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx   |2 -
 chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx  |2 -
 chart2/source/model/main/DataPointProperties.cxx |2 -
 chart2/source/tools/RelativePositionHelper.cxx   |8 
++--
 chart2/source/view/main/ChartItemPool.cxx|2 -
 chart2/source/view/main/OpenGLRender.cxx |   12 
+++---
 chart2/source/view/main/OpenGLRender.hxx |3 +
 chart2/source/view/main/VLegend.cxx  |2 -
 14 files changed, 60 insertions(+), 24 deletions(-)

New commits:
commit 8cd5002959c27e2e271d3897886a2ef504e41ff6
Author: Noel Grandin 
Date:   Thu Mar 30 16:27:50 2017 +0200

use actual UNO enums in chart2

Change-Id: I05d4eed55f5deba4b1802389d1ba94582d30550f
Reviewed-on: https://gerrit.libreoffice.org/35917
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 5975c7a3cfa2..eae08be7cf96 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -177,6 +177,21 @@ protected:
 
 };
 
+namespace com { namespace sun { namespace star { namespace drawing {
+
+std::ostream& operator<<(std::ostream& rStrm, FillStyle n)
+{
+rStrm << (int) n;
+return rStrm;
+}
+std::ostream& operator<<(std::ostream& rStrm, LineStyle n)
+{
+rStrm << (int) n;
+return rStrm;
+}
+
+} } } }
+
 namespace {
 
 struct CheckForChartName
diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 871b41bc5376..ec82f813de56 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -154,6 +154,26 @@ private:
 
 };
 
+namespace com { namespace sun { namespace star { namespace drawing {
+
+std::ostream& operator<<(std::ostream& rStrm, FillStyle n)
+{
+rStrm << (int) n;
+return rStrm;
+}
+
+} } } }
+
+namespace com { namespace sun { namespace star { namespace chart2 {
+
+std::ostream& operator<<(std::ostream& rStrm, CurveStyle n)
+{
+rStrm << (int) n;
+return rStrm;
+}
+
+} } } }
+
 // error bar import
 // split method up into smaller chunks for more detailed tests
 void Chart2ImportTest::Fdo60083()
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 96f4f01360fa..b62f1705acd4 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -1183,7 +1183,7 @@ void WrappedDataRowSourceProperty::setPropertyValue( 
const Any& rOuterValue, con
 css::chart::ChartDataRowSource eChartDataRowSource = 
css::chart::ChartDataRowSource_ROWS;
 if( ! (rOuterValue >>= eChartDataRowSource) )
 {
-sal_Int32 nNew = css::chart::ChartDataRowSource_ROWS;
+sal_Int32 nNew = (sal_Int32)css::chart::ChartDataRowSource_ROWS;
 if( !(rOuterValue >>= nNew) )
 throw lang::IllegalArgumentException( "Property DataRowSource 
requires css::chart::ChartDataRowSource value", nullptr, 0 );
 else
diff --git 
a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx 
b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
index f7ef66fbd572..1336709da311 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
@@ -279,7 +279,7 @@ Any WrappedSplineTypeProperty::convertOuterToInnerValue( 
const Any& rOuterValue
 aInnerValue = chart2::CurveStyle_STEP_CENTER_Y;
 break;
 default:
-SAL_WARN_IF(chart2::CurveStyle_LINES != 0, "chart2", "Unknown line 
style");
+SAL_WARN_IF(nOuterValue != 0, "chart2", "Unknown line style");
 aInnerValue = chart2::CurveStyle_LINES;
 }
 
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx 
b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index 23b89af61ef9..0589039c5eb3 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -182,7 +182,7 @@ void LegendPositionResources::initFromItemSet( const 
SfxItemSet& rInAttrs )
 

[Libreoffice-commits] core.git: chart2/qa chart2/source qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests

2017-01-24 Thread Stephan Bergmann
 chart2/qa/unoapi/sch.sce|1 
 chart2/source/controller/accessibility/AccStatisticsObject.cxx  |   52 
-
 chart2/source/controller/accessibility/AccStatisticsObject.hxx  |   47 
 qadevOOo/Jar_OOoRunner.mk   |1 
 qadevOOo/objdsc/sch/com.sun.star.comp.chart.AccStatisticsObject.csv |   25 --
 qadevOOo/tests/java/mod/_sch/AccStatisticsObject.java   |  103 
--
 6 files changed, 229 deletions(-)

New commits:
commit 80cec5faa5c69d4cf01dd7fc8a7e0dc1ed6f73ae
Author: Stephan Bergmann 
Date:   Tue Jan 24 13:37:59 2017 +0100

AccStatisticsObject is apparently dead code

Change-Id: I4e04b13538d1242ea38d1400df0ced813171bc5e

diff --git a/chart2/qa/unoapi/sch.sce b/chart2/qa/unoapi/sch.sce
index 54419b5..54842bf 100644
--- a/chart2/qa/unoapi/sch.sce
+++ b/chart2/qa/unoapi/sch.sce
@@ -25,7 +25,6 @@
 #i79073 -o sch.AccGrid
 #i79073 -o sch.AccLegend
 #i79073 -o sch.AccLegendEntry
-#i79073 -o sch.AccStatisticsObject
 #i79073 -o sch.AccTitle
 #i79073 -o sch.AccWall
 #i79073 -o sch.AccessibleDocumentView
diff --git a/chart2/source/controller/accessibility/AccStatisticsObject.cxx 
b/chart2/source/controller/accessibility/AccStatisticsObject.cxx
deleted file mode 100644
index fbdc160..000
--- a/chart2/source/controller/accessibility/AccStatisticsObject.cxx
+++ /dev/null
@@ -1,52 +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 "AccStatisticsObject.hxx"
-#include 
-#include 
-
-namespace chart
-{
-
-AccStatisticsObject::AccStatisticsObject( const AccessibleElementInfo& 
rAccInfo )
-: AccessibleChartElement( rAccInfo, false/*NoChildren*/, 
true/*AlwaysTransparent*/ )
-
-{
-SolarMutexGuard aSolarGuard;
-}
-
-AccStatisticsObject::~AccStatisticsObject()
-{
-}
-
-OUString SAL_CALL AccStatisticsObject::getAccessibleName()
-throw (css::uno::RuntimeException)
-{
-return getToolTipText();
-}
-
-OUString SAL_CALL AccStatisticsObject::getImplementationName()
-throw (css::uno::RuntimeException)
-{
-return OUString( "StatisticsObject" );
-}
-
-}  // namespace chart
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/accessibility/AccStatisticsObject.hxx 
b/chart2/source/controller/accessibility/AccStatisticsObject.hxx
deleted file mode 100644
index 4688ae4..000
--- a/chart2/source/controller/accessibility/AccStatisticsObject.hxx
+++ /dev/null
@@ -1,47 +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_CHART2_SOURCE_CONTROLLER_ACCESSIBILITY_ACCSTATISTICSOBJECT_HXX
-#define INCLUDED_CHART2_SOURCE_CONTROLLER_ACCESSIBILITY_ACCSTATISTICSOBJECT_HXX
-
-#include "AccessibleChartElement.hxx"
-
-#include "ObjectIdentifier.hxx"
-
-namespace chart
-{
-
-class AccStatisticsObject : public AccessibleChartElement
-{
-public:
-explicit AccStatisticsObject( const AccessibleElementInfo& rAccInfo );
-
-virtual ~AccStatisticsObject();
-
-//  XAccessibleContext 
-virtual OUString SAL_CALL getAccessibleName() throw 
(css::uno::RuntimeException);
-
-//  XServiceInfo 
-virtual OUString SAL_CALL getImplementationName() throw 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2016-12-01 Thread Jean-Tiare Le Bigot
 chart2/qa/extras/chart2import.cxx|   17 -
 chart2/source/tools/InternalDataProvider.cxx |7 ++-
 2 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 18b3138a7ac4da823e41640bed8a4707029b8fb0
Author: Jean-Tiare Le Bigot 
Date:   Mon Nov 28 09:09:55 2016 +0100

tdf#102621: import empty chart cells as NaN instead of 0

Change-Id: I574c3f719e52bc2244597532783130564621a891
Reviewed-on: https://gerrit.libreoffice.org/31303
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index b508f3e..be36047 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -25,7 +25,6 @@
 
 #include 
 
-
 class Chart2ImportTest : public ChartTest
 {
 public:
@@ -413,13 +412,13 @@ void Chart2ImportTest::testPPTXSparseChartSeries()
 
 std::vector aValues = 
getDataSeriesYValuesFromChartType(xCT);
 CPPUNIT_ASSERT_EQUAL(size_t(2), aValues.size());
-CPPUNIT_ASSERT_EQUAL(0.0,  aValues[0][0]);
+CPPUNIT_ASSERT( rtl::math::isNan( aValues[0][0] ) );
 CPPUNIT_ASSERT_EQUAL(2.5,  aValues[0][1]);
 CPPUNIT_ASSERT_EQUAL(3.5,  aValues[0][2]);
-CPPUNIT_ASSERT_EQUAL(0.0,  aValues[0][3]);
+CPPUNIT_ASSERT( rtl::math::isNan( aValues[0][3] ) );
 CPPUNIT_ASSERT_EQUAL(-2.4, aValues[1][0]);
-CPPUNIT_ASSERT_EQUAL(0.0,  aValues[1][1]);
-CPPUNIT_ASSERT_EQUAL(0.0,  aValues[1][2]);
+CPPUNIT_ASSERT( rtl::math::isNan( aValues[1][1] ) );
+CPPUNIT_ASSERT( rtl::math::isNan( aValues[1][2] ) );
 CPPUNIT_ASSERT_EQUAL(-2.8, aValues[1][3]);
 }
 
@@ -1169,17 +1168,17 @@ void Chart2ImportTest::testInternalDataProvider() {
 // Parse empty first and last
 xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", 
"{\"\";42;42;\"\"}");
 xSequence = xDataSeq->getData();
-CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)),  xSequence[0]);
+CPPUNIT_ASSERT( rtl::math::isNan( *static_cast(xSequence[0].getValue(;
 CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[1]);
 CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[2]);
-CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)),  xSequence[3]);
+CPPUNIT_ASSERT( rtl::math::isNan( *static_cast(xSequence[3].getValue(;
 
 // Parse empty middle
 xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", 
"{42;\"\";\"\";42}");
 xSequence = xDataSeq->getData();
 CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[0]);
-CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)),  xSequence[1]);
-CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(0)),  xSequence[2]);
+CPPUNIT_ASSERT( rtl::math::isNan( *static_cast(xSequence[1].getValue())) );
+CPPUNIT_ASSERT( rtl::math::isNan( *static_cast(xSequence[2].getValue())) );
 CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(42)), xSequence[3]);
 
 // Parse mixed types, numeric only role
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index ef6facd..9f5f318 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -573,7 +573,12 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 std::vector aValues;
 aValues.reserve(aRawElems.size());
 for (OUString & aRawElem : aRawElems)
-aValues.push_back(aRawElem.toDouble());
+{
+if (aRawElem.isEmpty())
+aValues.push_back(NAN);
+else
+aValues.push_back(aRawElem.toDouble());
+}
 sal_Int32 n = m_aInternalData.appendColumn();
 
 m_aInternalData.setColumnValues(n, aValues);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source

2016-10-22 Thread Jean-Tiare Le Bigot
 chart2/qa/extras/chart2import.cxx|   50 +++
 chart2/source/tools/InternalDataProvider.cxx |   11 +
 2 files changed, 52 insertions(+), 9 deletions(-)

New commits:
commit 27a4fb657fad157d26d07934ecd0cce578a99f38
Author: Jean-Tiare Le Bigot 
Date:   Tue Oct 18 23:36:51 2016 +0200

chart2: fix unserialization of empty cells

Change-Id: Ib7e5c8c4db6cac7ef1255246eea13325cf7cca69
Reviewed-on: https://gerrit.libreoffice.org/30030
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 7d0f8f2..bff7e81 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -90,6 +90,8 @@ public:
 void testSecondaryAxisTitleDefaultRotationXLSX();
 void testAxisTitleRotationXLSX();
 
+void testInternalDataProvider();
+
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
 CPPUNIT_TEST(testSteppedLines);
@@ -139,6 +141,9 @@ public:
 CPPUNIT_TEST(testAxisTitleDefaultRotationXLSX);
 CPPUNIT_TEST(testSecondaryAxisTitleDefaultRotationXLSX);
 CPPUNIT_TEST(testAxisTitleRotationXLSX);
+
+CPPUNIT_TEST(testInternalDataProvider);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -1125,6 +1130,51 @@ void Chart2ImportTest::testAxisTitleRotationXLSX()
 
 }
 
+void Chart2ImportTest::testInternalDataProvider() {
+uno::Reference< chart2::XChartDocument > 
xChartDoc(getChartDocFromImpress("/chart2/qa/extras/data/odp/", "chart.odp"), 
uno::UNO_QUERY_THROW);
+const uno::Reference< chart2::data::XDataProvider >& rxDataProvider = 
xChartDoc->getDataProvider();
+
+// Parse 42 array
+Reference xDataSeq = 
rxDataProvider->createDataSequenceByValueArray("values-y", "{42;42;42;42}");
+Sequence xSequence = xDataSeq->getData();
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[0]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[1]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[2]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[3]);
+
+// Parse empty first and last
+xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", 
"{\"\";42;42;\"\"}");
+xSequence = xDataSeq->getData();
+CPPUNIT_ASSERT_EQUAL(uno::Any(0),  xSequence[0]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[1]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[2]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(0),  xSequence[3]);
+
+// Parse empty middle
+xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", 
"{42;\"\";\"\";42}");
+xSequence = xDataSeq->getData();
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[0]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(0),  xSequence[1]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(0),  xSequence[2]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[3]);
+
+// Parse mixed types, numeric only role
+xDataSeq = rxDataProvider->createDataSequenceByValueArray("values-y", 
"{42;\"hello\";0;\"world\"}");
+xSequence = xDataSeq->getData();
+CPPUNIT_ASSERT_EQUAL(uno::Any(42), xSequence[0]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(0),  xSequence[1]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(0),  xSequence[2]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(0),  xSequence[3]);
+
+// Parse mixed types, mixed role
+xDataSeq = rxDataProvider->createDataSequenceByValueArray("categories", 
"{42;\"hello\";0;\"world\"}");
+xSequence = xDataSeq->getData();
+CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("42")),xSequence[0]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("hello")), xSequence[1]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("0")), xSequence[2]);
+CPPUNIT_ASSERT_EQUAL(uno::Any(OUString("world")), xSequence[3]);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/source/tools/InternalDataProvider.cxx 
b/chart2/source/tools/InternalDataProvider.cxx
index 32dd3c7..7bcb65f0 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -533,10 +533,7 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 {
 // Opening quote.
 bAllNumeric = false;
-++p;
-if (p == pEnd)
-break;
-pElem = p;
+pElem = nullptr;
 }
 else
 {
@@ -552,11 +549,7 @@ InternalDataProvider::createDataSequenceFromArray( const 
OUString& rArrayStr, co
 break;
 }
 }
-else if (bInQuote)
-{
-// Do nothing.
-}
-else if (*p == ';')
+else if (*p == ';' and !bInQuote)
 {
 // element separator.
 if (pElem)
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: chart2/qa chart2/source

2016-08-31 Thread Laurent Balland-Poirier
 chart2/qa/extras/chart2_trendcalculators.cxx|4 ++--
 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx |6 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 488c8053dc824d4736b02020bb440d43c4933eb2
Author: Laurent Balland-Poirier 
Date:   Sun Jul 17 15:10:51 2016 +0200

Improve polynomial trendline equation representation

Insert a blank between x variable and its coefficient
Aplly also to linear trendline

Change-Id: I7d1e61f12aa1cf98b4181df6a4849df1e5293793
Reviewed-on: https://gerrit.libreoffice.org/27265
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx 
b/chart2/qa/extras/chart2_trendcalculators.cxx
index aa3717d..f3500fe 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -152,7 +152,7 @@ void Chart2TrendCalculators::testLinearRegression1()
 xValues[i] = d;
 yValues[i] = - 2.0 * d - 5.0 ;
 }
-checkCalculator( xValues, yValues, "f(x) = "+ OUStringLiteral1(aMinusSign) 
+" 2x "+ OUStringLiteral1(aMinusSign) +" 5");
+checkCalculator( xValues, yValues, "f(x) = "+ OUStringLiteral1(aMinusSign) 
+" 2 x "+ OUStringLiteral1(aMinusSign) +" 5");
 }
 
 // test y = A x ^ B
@@ -168,7 +168,7 @@ void Chart2TrendCalculators::testPolynomialRegression1()
 xValues[i] = d;
 yValues[i] =  - 2.0 * d * d + 4 * d - 5;
 }
-OUString sExpectedFormula( "f(x) = "+ OUStringLiteral1(aMinusSign) +" 2x" 
+ OUStringLiteral1( aSuperscriptFigures[2] ) + " + 4x "+ 
OUStringLiteral1(aMinusSign) +" 5" );
+OUString sExpectedFormula( "f(x) = "+ OUStringLiteral1(aMinusSign) +" 2 x" 
+ OUStringLiteral1( aSuperscriptFigures[2] ) + " + 4 x "+ 
OUStringLiteral1(aMinusSign) +" 5" );
 checkCalculator( xValues, yValues, sExpectedFormula );
 }
 
diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx 
b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index 9b88599..ef3ba7e 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -252,7 +252,7 @@ OUString 
PolynomialRegressionCurveCalculator::ImplGetRepresentation(
 nCharMin += 3; // " + "
 if ( i > 0 )
 {
- nCharMin += mXName.getLength(); // "x"
+nCharMin += mXName.getLength() + 1; // " x"
 if ( i > 1 )
 nCharMin +=1; // "^i"
 if ( i >= 10 )
@@ -292,7 +292,11 @@ OUString 
PolynomialRegressionCurveCalculator::ImplGetRepresentation(
 sal_Int32* pValueLength = nValueLength ?  : nullptr;
 OUString aValueString = getFormattedString( xNumFormatter, 
nNumberFormatKey, aValue, pValueLength );
 if ( i == 0 || aValueString != "1" )  // aValueString may be rounded 
to 1 if nValueLength is small
+{
 aTmpBuf.append( aValueString );
+if ( i > 0 ) // insert blank between coefficient and x
+aTmpBuf.append( " " );
+}
 
 if(i > 0)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/qa connectivity/source cui/source editeng/source filter/source idl/source include/rtl sal/qa sc/qa sc/source sd/source sfx2/source st

2016-08-29 Thread Stephan Bergmann
 chart2/qa/extras/chart2_trendcalculators.cxx |8 +-
 chart2/source/tools/ExponentialRegressionCurveCalculator.cxx |4 -
 chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx |4 -
 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx  |2 
 chart2/source/tools/PotentialRegressionCurveCalculator.cxx   |2 
 comphelper/qa/string/test_string.cxx |2 
 connectivity/source/drivers/evoab2/NStatement.cxx|6 +-
 cui/source/dialogs/hlinettp.cxx  |2 
 cui/source/options/optjava.cxx   |2 
 cui/source/options/optpath.cxx   |   14 ++---
 cui/source/tabpages/grfpage.cxx  |4 -
 editeng/source/editeng/editeng.cxx   |2 
 editeng/source/editeng/impedit.cxx   |2 
 editeng/source/editeng/impedit3.cxx  |2 
 filter/source/graphicfilter/idxf/dxfreprd.cxx|6 +-
 idl/source/prj/command.cxx   |4 -
 include/rtl/stringconcat.hxx |6 +-
 include/rtl/stringutils.hxx  |   29 +-
 sal/qa/rtl/strings/test_oustring_stringliterals.cxx  |   23 
 sc/qa/extras/macros-test.cxx |2 
 sc/qa/unit/subsequent_export-test.cxx|8 +-
 sc/source/core/data/global2.cxx  |2 
 sc/source/core/tool/compiler.cxx |6 +-
 sc/source/filter/excel/xelink.cxx|2 
 sc/source/filter/excel/xihelper.cxx  |2 
 sc/source/filter/excel/xiname.cxx|2 
 sc/source/ui/optdlg/tpusrlst.cxx |4 -
 sc/source/ui/view/prevwsh.cxx|2 
 sc/source/ui/view/viewdata.cxx   |2 
 sd/source/filter/eppt/pptx-text.cxx  |2 
 sd/source/ui/dlg/tpaction.cxx|2 
 sd/source/ui/dlg/tpoption.cxx|2 
 sfx2/source/appl/fileobj.cxx |8 +-
 sfx2/source/appl/linkmgr2.cxx|6 +-
 starmath/source/ooxmlimport.cxx  |   20 +++
 svl/qa/unit/svl.cxx  |8 +-
 svl/source/misc/lngmisc.cxx  |4 -
 svtools/source/misc/langtab.cxx  |2 
 svtools/source/urlobj/inetimg.cxx|   10 +--
 svx/source/tbxctrls/layctrl.cxx  |2 
 sw/qa/core/uwriter.cxx   |   14 ++---
 sw/qa/extras/uiwriter/uiwriter.cxx   |   14 ++---
 sw/source/core/bastyp/calc.cxx   |2 
 sw/source/core/crsr/crstrvl.cxx  |2 
 sw/source/core/doc/DocumentFieldsManager.cxx |4 -
 sw/source/core/doc/acmplwrd.cxx  |4 -
 sw/source/core/doc/docfld.cxx|   10 +--
 sw/source/core/doc/doctxm.cxx|2 
 sw/source/core/docnode/ndsect.cxx|2 
 sw/source/core/docnode/section.cxx   |4 -
 sw/source/core/edit/autofmt.cxx  |4 -
 sw/source/core/edit/editsh.cxx   |2 
 sw/source/core/edit/edlingu.cxx  |4 -
 sw/source/core/fields/cellfml.cxx|8 +-
 sw/source/core/fields/dbfld.cxx  |   12 ++--
 sw/source/core/fields/ddefld.cxx |2 
 sw/source/core/fields/docufld.cxx|2 
 sw/source/core/fields/reffld.cxx |2 
 sw/source/core/frmedt/fetab.cxx  |4 -
 sw/source/core/graphic/ndgrf.cxx |4 -
 sw/source/core/tox/tox.cxx   |6 +-
 sw/source/core/tox/txmsrt.cxx|6 +-
 sw/source/core/txtnode/thints.cxx|4 -
 sw/source/core/unocore/unofield.cxx  |6 +-
 sw/source/core/unocore/unoidx.cxx|2 
 sw/source/core/unocore/unosect.cxx   |   14 ++---
 sw/source/filter/ascii/ascatr.cxx|2 
 sw/source/filter/html/htmlsect.cxx   |4 -
 sw/source/filter/html/wrthtml.cxx|2 
 sw/source/filter/ww8/docxattributeoutput.cxx |2 
 

[Libreoffice-commits] core.git: chart2/qa chart2/source comphelper/source compilerplugins/clang connectivity/source cui/source include/vcl l10ntools/source reportdesign/source sal/qa sc/source sd/sour

2016-08-16 Thread Noel Grandin
 chart2/qa/extras/chart2_trendcalculators.cxx   |8 
 chart2/source/tools/PotentialRegressionCurveCalculator.cxx |2 
 comphelper/source/container/embeddedobjectcontainer.cxx|2 
 compilerplugins/clang/stringstatic.cxx |  140 +
 connectivity/source/drivers/calc/CTable.cxx|5 
 connectivity/source/drivers/firebird/Connection.cxx|6 
 connectivity/source/drivers/firebird/Connection.hxx|6 
 connectivity/source/drivers/firebird/Driver.cxx|   22 +-
 connectivity/source/drivers/firebird/Driver.hxx|4 
 connectivity/source/drivers/jdbc/DatabaseMetaData.cxx  |   16 -
 connectivity/source/drivers/mork/MDatabaseMetaData.cxx |8 
 cui/source/customize/cfg.cxx   |   39 ---
 include/vcl/IconThemeInfo.hxx  |2 
 include/vcl/IconThemeSelector.hxx  |3 
 l10ntools/source/xmlparse.cxx  |6 
 reportdesign/source/core/api/ReportDefinition.cxx  |   42 +--
 reportdesign/source/ui/inspection/DataProviderHandler.cxx  |   12 -
 reportdesign/source/ui/inspection/metadata.cxx |  108 +-
 reportdesign/source/ui/report/ReportController.cxx |   22 --
 sal/qa/osl/process/osl_process.cxx |4 
 sc/source/ui/vba/vbadialog.cxx |   52 ++--
 sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx |3 
 sd/source/ui/accessibility/AccessibleSlideSorterView.cxx   |3 
 sd/source/ui/table/TableDesignPane.cxx |   26 --
 shell/source/unix/sysshell/recently_used_file.cxx  |6 
 svtools/source/config/menuoptions.cxx  |9 
 svx/source/fmcomp/fmgridif.cxx |   21 -
 svx/source/form/fmdmod.cxx |   40 +--
 svx/source/form/fmundo.cxx |   12 -
 sw/qa/extras/uiwriter/uiwriter.cxx |   16 -
 vcl/qa/cppunit/app/test_IconThemeSelector.cxx  |2 
 vcl/source/app/IconThemeInfo.cxx   |8 
 vcl/source/app/IconThemeSelector.cxx   |3 
 33 files changed, 373 insertions(+), 285 deletions(-)

New commits:
commit 127f70d66ac32b7a4ec818adaf1bdccb71865ee5
Author: Noel Grandin 
Date:   Thu Jul 21 14:23:23 2016 +0200

new loplugin to check for static OUStrings

that are better declared as OUStringLiteral

Change-Id: Ifb5d9a12bb31a68641940bec16971a8181a46567
Reviewed-on: https://gerrit.libreoffice.org/27377
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx 
b/chart2/qa/extras/chart2_trendcalculators.cxx
index ca327f1..738a6d6 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -136,7 +136,7 @@ void Chart2TrendCalculators::testPotentialRegression2()
 xValues[i] = d;
 yValues[i] = -2.0 * pow ( d, 3 );
 }
-checkCalculator( xValues, yValues, "f(x) = "+ aMinusSign +" 2 x^3");
+checkCalculator( xValues, yValues, "f(x) = "+ OUString(aMinusSign) +" 2 
x^3");
 }
 
 // test y = - 2 X - 5
@@ -152,7 +152,7 @@ void Chart2TrendCalculators::testLinearRegression1()
 xValues[i] = d;
 yValues[i] = - 2.0 * d - 5.0 ;
 }
-checkCalculator( xValues, yValues, "f(x) = "+ aMinusSign +" 2x "+ 
aMinusSign +" 5");
+checkCalculator( xValues, yValues, "f(x) = "+ OUString(aMinusSign) +" 2x 
"+ OUString(aMinusSign) +" 5");
 }
 
 // test y = A x ^ B
@@ -168,7 +168,7 @@ void Chart2TrendCalculators::testPolynomialRegression1()
 xValues[i] = d;
 yValues[i] =  - 2.0 * d * d + 4 * d - 5;
 }
-OUString sExpectedFormula( "f(x) = "+ aMinusSign +" 2x" + OUString( 
aSuperscriptFigures[2] ) + " + 4x "+ aMinusSign +" 5" );
+OUString sExpectedFormula( "f(x) = "+ OUString(aMinusSign) +" 2x" + 
OUString( aSuperscriptFigures[2] ) + " + 4x "+ OUString(aMinusSign) +" 5" );
 checkCalculator( xValues, yValues, sExpectedFormula );
 }
 
@@ -199,7 +199,7 @@ void Chart2TrendCalculators::testExponentialRegression2()
 xValues[i] = d;
 yValues[i] = -2.0 * exp ( 0.3 * d );
 }
-checkCalculator( xValues, yValues, "f(x) = "+ aMinusSign + " 2 exp( 0.3 x 
)");
+checkCalculator( xValues, yValues, "f(x) = "+ OUString(aMinusSign) + " 2 
exp( 0.3 x )");
 }
 
 
diff --git a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx 
b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
index 3c19a3e..3282f2d 100644
--- a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
@@ -176,7 +176,7 @@ OUString 
PotentialRegressionCurveCalculator::ImplGetRepresentation(
   

[Libreoffice-commits] core.git: chart2/qa chart2/source

2016-06-09 Thread Laurent Balland-Poirier
 chart2/qa/extras/chart2_trendcalculators.cxx   |2 
 chart2/source/tools/PotentialRegressionCurveCalculator.cxx |   49 +
 2 files changed, 37 insertions(+), 14 deletions(-)

New commits:
commit e420a335f783bb4d2ee9d74d56f91e16d189566f
Author: Laurent Balland-Poirier 
Date:   Tue May 24 21:40:57 2016 +0200

tdf#94004 Wrap Power trendline equation

Wrap equation trendline if it is longer than chart width
Continue https://gerrit.libreoffice.org/18397/

Change-Id: If805f712a29c412a01209533842f9a6c797cbaf1
Reviewed-on: https://gerrit.libreoffice.org/25418
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx 
b/chart2/qa/extras/chart2_trendcalculators.cxx
index 04af848..ca327f1 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -136,7 +136,7 @@ void Chart2TrendCalculators::testPotentialRegression2()
 xValues[i] = d;
 yValues[i] = -2.0 * pow ( d, 3 );
 }
-checkCalculator( xValues, yValues, "f(x) = -2 x^3");
+checkCalculator( xValues, yValues, "f(x) = "+ aMinusSign +" 2 x^3");
 }
 
 // test y = - 2 X - 5
diff --git a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx 
b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
index 8ea92c1..3c19a3e 100644
--- a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx
@@ -20,6 +20,7 @@
 #include "PotentialRegressionCurveCalculator.hxx"
 #include "macros.hxx"
 #include "RegressionCalculationHelper.hxx"
+#include 
 
 #include 
 #include 
@@ -142,32 +143,54 @@ uno::Sequence< geometry::RealPoint2D > SAL_CALL 
PotentialRegressionCurveCalculat
 
 OUString PotentialRegressionCurveCalculator::ImplGetRepresentation(
 const uno::Reference< util::XNumberFormatter >& xNumFormatter,
-sal_Int32 nNumberFormatKey, sal_Int32* /* pFormulaLength = nullptr */ ) 
const
+sal_Int32 nNumberFormatKey, sal_Int32* pFormulaMaxWidth /* = nullptr */ ) 
const
 {
+bool bHasIntercept = !rtl::math::approxEqual( fabs(m_fIntercept), 1.0 );
 OUStringBuffer aBuf( "f(x) = ");
+sal_Int32 nLineLength = aBuf.getLength();
+sal_Int32 nValueLength=0;
+if ( pFormulaMaxWidth && *pFormulaMaxWidth > 0 ) // count nValueLength
+{
+sal_Int32 nCharMin = nLineLength + 4;  // 4 = "x^" + 2 extra characters
+if ( m_fIntercept != 0.0 && m_fSlope != 0.0 )
+{
+if ( m_fIntercept < 0.0 )
+nCharMin += 2;  // "- "
+if ( bHasIntercept )
+nValueLength = (*pFormulaMaxWidth - nCharMin) / 2;
+}
+if ( nValueLength == 0 ) // not yet calculated
+nValueLength = *pFormulaMaxWidth - nCharMin;
+if ( nValueLength <= 0 )
+nValueLength = 1;
+}
 
 if( m_fIntercept == 0.0 )
 {
 aBuf.append( '0' );
 }
-else if( m_fSlope == 0.0 )
-{
-aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, 
m_fIntercept ));
-}
 else
 {
-if( ! rtl::math::approxEqual( fabs(m_fIntercept), 1.0 ) )
+// temporary buffer
+OUStringBuffer aTmpBuf("");
+// if nValueLength not calculated then nullptr
+sal_Int32* pValueLength = nValueLength ?  : nullptr;
+if ( m_fIntercept < 0.0 )// add intercept value
+aTmpBuf.append( aMinusSign+" " );
+if( bHasIntercept )
 {
-aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, 
m_fIntercept ));
-aBuf.append( ' ');
+OUString aValueString = getFormattedString( xNumFormatter, 
nNumberFormatKey, fabs(m_fIntercept), pValueLength );
+if ( aValueString != "1" )  // aValueString may be rounded to 1 if 
nValueLength is small
+{
+aTmpBuf.append( aValueString + " " );
+}
 }
-else // skip intercept if its value is 1 (or near 1)
+if( m_fSlope != 0.0 )  // add slope value
 {
-if ( m_fIntercept < 0.0 )
-aBuf.append( "- " );
+aTmpBuf.append( "x^" );
+aTmpBuf.append( getFormattedString( xNumFormatter, 
nNumberFormatKey, m_fSlope, pValueLength ));
 }
-aBuf.append( "x^" );
-aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, 
m_fSlope ));
+addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth );
 }
 
 return aBuf.makeStringAndClear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: chart2/qa chart2/source

2016-06-09 Thread Laurent Balland-Poirier
 chart2/qa/extras/chart2_trendcalculators.cxx |2 
 chart2/source/tools/ExponentialRegressionCurveCalculator.cxx |   69 ---
 2 files changed, 52 insertions(+), 19 deletions(-)

New commits:
commit 9a9c778d81e8ae54dcc42290241a5fc72be29bf2
Author: Laurent Balland-Poirier 
Date:   Mon May 23 21:17:29 2016 +0200

tdf#94004 Wrap Exponential trendline equation

Wrap equation trendline if it is longer than chart width
Continue https://gerrit.libreoffice.org/18397/

Change-Id: I3938aaeec6c56582ecfe50dbfc54ec711f1b963d
Reviewed-on: https://gerrit.libreoffice.org/25393
Tested-by: Jenkins 
Reviewed-by: jan iversen 

diff --git a/chart2/qa/extras/chart2_trendcalculators.cxx 
b/chart2/qa/extras/chart2_trendcalculators.cxx
index 0c3b972..04af848 100644
--- a/chart2/qa/extras/chart2_trendcalculators.cxx
+++ b/chart2/qa/extras/chart2_trendcalculators.cxx
@@ -199,7 +199,7 @@ void Chart2TrendCalculators::testExponentialRegression2()
 xValues[i] = d;
 yValues[i] = -2.0 * exp ( 0.3 * d );
 }
-checkCalculator( xValues, yValues, "f(x) = -2 exp( 0.3 x )");
+checkCalculator( xValues, yValues, "f(x) = "+ aMinusSign + " 2 exp( 0.3 x 
)");
 }
 
 
diff --git a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx 
b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
index 75e92aa..f6a7571 100644
--- a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx
@@ -20,6 +20,7 @@
 #include "ExponentialRegressionCurveCalculator.hxx"
 #include "macros.hxx"
 #include "RegressionCalculationHelper.hxx"
+#include 
 
 #include 
 #include 
@@ -154,40 +155,72 @@ uno::Sequence< geometry::RealPoint2D > SAL_CALL 
ExponentialRegressionCurveCalcul
 
 OUString ExponentialRegressionCurveCalculator::ImplGetRepresentation(
 const uno::Reference< util::XNumberFormatter >& xNumFormatter,
-sal_Int32 nNumberFormatKey, sal_Int32* /*pFormulaLength = nullptr */ ) 
const
+sal_Int32 nNumberFormatKey, sal_Int32* pFormulaMaxWidth /* = nullptr */ ) 
const
 {
-double fIntercept = m_fSign * exp(m_fLogIntercept);
+double fIntercept = exp(m_fLogIntercept);
 bool bHasSlope = !rtl::math::approxEqual( exp(m_fLogSlope), 1.0 );
 bool bHasLogSlope = !rtl::math::approxEqual( fabs(m_fLogSlope), 1.0 );
-bool bHasIntercept = !rtl::math::approxEqual( m_fSign*fIntercept, 1.0 ) && 
fIntercept != 0.0;
+bool bHasIntercept = !rtl::math::approxEqual( fIntercept, 1.0 ) && 
fIntercept != 0.0;
 
 OUStringBuffer aBuf( "f(x) = " );
-
+sal_Int32 nLineLength = aBuf.getLength();
+sal_Int32 nValueLength=0;
+if ( pFormulaMaxWidth && *pFormulaMaxWidth > 0 )
+{  // count characters different from coefficients
+sal_Int32 nCharMin = nLineLength + 11;  // 11 = "exp( ", " x )" + 2 
extra characters
+if ( m_fSign < 0.0 )
+nCharMin += 2;
+if ( fIntercept == 0.0 || ( !bHasSlope && m_fLogIntercept != 0.0 ) )
+nCharMin += 3; // " + " special case where equation is writen exp( 
a + b x )
+if ( ( bHasIntercept || fIntercept == 0.0 || ( !bHasSlope && 
m_fLogIntercept != 0.0 ) ) &&
+   bHasLogSlope )
+nValueLength = ( *pFormulaMaxWidth - nCharMin ) / 2;
+else
+nValueLength = *pFormulaMaxWidth - nCharMin;
+if ( nValueLength <= 0 )
+nValueLength = 1;
+}
+// temporary buffer
+OUStringBuffer aTmpBuf("");
+// if nValueLength not calculated then nullptr
+sal_Int32* pValueLength = nValueLength ?  : nullptr;
+if ( m_fSign < 0.0 )
+aTmpBuf.append( aMinusSign + " " );
 if ( bHasIntercept )
 {
-aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, 
fIntercept) );
-aBuf.append( " exp( " );
+OUString aValueString = getFormattedString( xNumFormatter, 
nNumberFormatKey, fIntercept, pValueLength );
+if ( aValueString != "1" )  // aValueString may be rounded to 1 if 
nValueLength is small
+{
+aTmpBuf.append( aValueString + " " );
+addStringToEquation( aBuf, nLineLength, aTmpBuf, pFormulaMaxWidth 
);
+aTmpBuf.truncate();
+}
 }
-else
+aTmpBuf.append( "exp( " );
+if ( !bHasIntercept )
 {
-   if ( m_fSign < 0.0 )
-aBuf.append( "- " );
-   aBuf.append( "exp( " );
-   if ( fIntercept == 0.0 ||  // underflow, a true zero is impossible
-  ( !bHasSlope && m_fLogIntercept != 0.0 ) )// show logarithmic 
output, if intercept and slope both are near one
+if ( fIntercept == 0.0 ||  // underflow, a true zero is impossible
+   ( !bHasSlope && m_fLogIntercept != 0.0 ) )   // show logarithmic 
output, if intercept and slope both are near one
 {  

[Libreoffice-commits] core.git: chart2/qa chart2/source

2016-01-06 Thread Andrea Gelmini
 chart2/qa/extras/chart2import.cxx  |2 +-
 chart2/source/controller/main/ChartController.cxx  |6 +++---
 chart2/source/controller/main/UndoGuard.hxx|2 +-
 chart2/source/model/filter/XMLFilter.cxx   |2 +-
 chart2/source/model/template/ChartTypeTemplate.hxx |2 +-
 chart2/source/tools/DiagramHelper.cxx  |4 ++--
 chart2/source/tools/RelativePositionHelper.cxx |2 +-
 chart2/source/tools/ThreeDHelper.cxx   |2 +-
 chart2/source/view/charttypes/PieChart.cxx |2 +-
 chart2/source/view/inc/Stripe.hxx  |2 +-
 chart2/source/view/inc/VSeriesPlotter.hxx  |2 +-
 chart2/source/view/inc/ViewDefines.hxx |2 +-
 chart2/source/view/main/Clipping.cxx   |2 +-
 chart2/source/view/main/VDataSeries.cxx|2 +-
 14 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 5e65c273c61cfc78304d1d62a21a18953b643c50
Author: Andrea Gelmini 
Date:   Mon Jan 4 12:41:46 2016 +0100

Fix typos

Change-Id: Ie0578dcca6cbf4edb62544109d616a081888f369
Reviewed-on: https://gerrit.libreoffice.org/21140
Tested-by: Jenkins 
Reviewed-by: Ashod Nakashian 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 6847aeb..75b0f9c 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -766,7 +766,7 @@ void Chart2ImportTest::testAxisTextRotationXLSX()
 /* TODO : temporarily disabled.
 void Chart2ImportTest::testTextCanOverlapXLSX()
 {
-// fdo#84647 : To check textoverlap value is imported correclty.
+// fdo#84647 : To check textoverlap value is imported correctly.
 load("/chart2/qa/extras/data/xlsx/", "chart-text-can-overlap.xlsx");
 uno::Reference< chart::XDiagram > mxDiagram;
 uno::Reference< beans::XPropertySet > xAxisProp;
diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 020541d..211fccd 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -869,7 +869,7 @@ void SAL_CALL ChartController::dispose()
 
 //the accessible view is disposed within window destructor of 
m_pChartWindow
 m_pChartWindow->clear();
-m_pChartWindow = nullptr;//m_pChartWindow is deleted via UNO due 
to dispose of m_xViewWindow (trigerred by Framework (Controller pretends to be 
XWindow also))
+m_pChartWindow = nullptr;//m_pChartWindow is deleted via UNO due 
to dispose of m_xViewWindow (triggered by Framework (Controller pretends to be 
XWindow also))
 m_xViewWindow->dispose();
 m_xChartView.clear();
 }
@@ -964,7 +964,7 @@ void SAL_CALL ChartController::queryClosing(
 return;
 }
 
-if( !m_bCanClose )//@todo tryaqcuire mutex
+if( !m_bCanClose )//@todo try acquire mutex
 {
 if( bGetsOwnership )
 {
@@ -1416,7 +1416,7 @@ void ChartController::executeDispatch_MoveSeries( bool 
bForward )
 
 //get selected series
 OUString aObjectCID(m_aSelection.getSelectedCID());
-uno::Reference< XDataSeries > xGivenDataSeries( 
ObjectIdentifier::getDataSeriesForCID( //yyy todo also legendentries and labels?
+uno::Reference< XDataSeries > xGivenDataSeries( 
ObjectIdentifier::getDataSeriesForCID( //yyy todo also legend entries and 
labels?
 aObjectCID, getModel() ) );
 
 UndoGuardWithSelection aUndoGuard(
diff --git a/chart2/source/controller/main/UndoGuard.hxx 
b/chart2/source/controller/main/UndoGuard.hxx
index 0b41f98..167b8c6 100644
--- a/chart2/source/controller/main/UndoGuard.hxx
+++ b/chart2/source/controller/main/UndoGuard.hxx
@@ -63,7 +63,7 @@ private:
 };
 
 /** A guard which, in its destructor, restores the model state it found in the 
constructor. If
-commitAction is called inbetween, the restouration is not 
performed.
+commitAction is called inbetween, the restoration is not 
performed.
  */
 class UndoLiveUpdateGuard : public UndoGuard
 {
diff --git a/chart2/source/model/filter/XMLFilter.cxx 
b/chart2/source/model/filter/XMLFilter.cxx
index dc49724..c18ac15 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -364,7 +364,7 @@ sal_Int32 XMLFilter::impl_Import(
 
 // Set base URI and Hierarchical Name
 OUString aHierarchName, aBaseUri;
-// why retrieve this from the model when it's availabe as 
rMediaDescriptor?
+// why retrieve this from the model when it's available as 
rMediaDescriptor?
 uno::Reference const xModel(m_xTargetDoc, 
uno::UNO_QUERY);
 if( xModel.is() )
 {
diff --git a/chart2/source/model/template/ChartTypeTemplate.hxx 
b/chart2/source/model/template/ChartTypeTemplate.hxx
index 629f32e..8b03824 100644
--- 

[Libreoffice-commits] core.git: chart2/qa chart2/source include/xmloff offapi/com oox/inc oox/source xmloff/source

2015-10-07 Thread Marco Cecchetti
 chart2/qa/extras/chart2import.cxx|   31 +++
 chart2/qa/extras/data/pptx/bnc889755.pptx|binary
 chart2/source/controller/chartapiwrapper/AxisWrapper.cxx |   13 ++-
 chart2/source/model/main/Axis.cxx|   15 +++
 chart2/source/view/axes/VAxisProperties.cxx  |7 +
 chart2/source/view/axes/VAxisProperties.hxx  |5 +
 chart2/source/view/axes/VCartesianAxis.cxx   |   23 +++--
 include/xmloff/xmltoken.hxx  |1 
 offapi/com/sun/star/chart2/Axis.idl  |7 +
 oox/inc/drawingml/chart/datasourcecontext.hxx|5 +
 oox/source/drawingml/chart/datasourcecontext.cxx |   62 ++-
 xmloff/source/chart/PropertyMap.hxx  |1 
 xmloff/source/chart/SchXMLAxisContext.cxx|7 +
 xmloff/source/core/xmltoken.cxx  |1 
 14 files changed, 165 insertions(+), 13 deletions(-)

New commits:
commit d52d448e7b34cb8c2457948489e6691049f4a571
Author: Marco Cecchetti 
Date:   Fri Jul 31 22:14:41 2015 +0200

tdf#88154 workaround and unit test

Fixed 45-degree layout for axis labels, too.

Change-Id: I9764e281aeee0a439fa9eec1e3b0df840221b72f
Reviewed-on: https://gerrit.libreoffice.org/18889
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 3ab0600..593f3c8 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -52,6 +52,7 @@ public:
 void testODPChartSeries();
 void testBnc864396();
 void testBnc882383();
+void testBnc889755();
 void testSimpleStrictXLSX();
 void testDelayedCellImport(); // chart range referencing content on later 
sheets
 void testFlatODSStackedColumnChart();
@@ -108,6 +109,7 @@ public:
 CPPUNIT_TEST(testODPChartSeries);
 CPPUNIT_TEST(testBnc864396);
 CPPUNIT_TEST(testBnc882383);
+CPPUNIT_TEST(testBnc889755);
 CPPUNIT_TEST(testSimpleStrictXLSX);
 CPPUNIT_TEST(testDelayedCellImport);
 CPPUNIT_TEST(testFlatODSStackedColumnChart);
@@ -580,6 +582,35 @@ void Chart2ImportTest::testBnc864396()
 }
 }
 
+void Chart2ImportTest::testBnc889755()
+{
+load("/chart2/qa/extras/data/pptx/", "bnc889755.pptx");
+uno::Reference 
xChartDoc(getChartDocFromDrawImpress(0, 6), uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xChartDoc.is());
+CPPUNIT_ASSERT(xChartDoc->hasInternalDataProvider());
+
+uno::Reference< chart2::XInternalDataProvider > xDataProvider( 
xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW );
+uno::Reference< chart::XChartDataArray > xChartDataArray(xDataProvider, 
uno::UNO_QUERY_THROW);
+uno::Sequence< OUString > aRowLabels = 
xChartDataArray->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL( aRowLabels.getLength(), sal_Int32(16) );
+CPPUNIT_ASSERT_EQUAL(OUString("Oct-12"), aRowLabels[0]);
+CPPUNIT_ASSERT_EQUAL(OUString("Nov-12"), aRowLabels[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("Dec-12"), aRowLabels[2]);
+CPPUNIT_ASSERT_EQUAL(OUString("Jan-13"), aRowLabels[3]);
+CPPUNIT_ASSERT_EQUAL(OUString("Feb-13"), aRowLabels[4]);
+CPPUNIT_ASSERT_EQUAL(OUString("Mar-13"), aRowLabels[5]);
+CPPUNIT_ASSERT_EQUAL(OUString("Apr-13"), aRowLabels[6]);
+CPPUNIT_ASSERT_EQUAL(OUString("May-13"), aRowLabels[7]);
+CPPUNIT_ASSERT_EQUAL(OUString("Jun-13"), aRowLabels[8]);
+CPPUNIT_ASSERT_EQUAL(OUString("Jul-13"), aRowLabels[9]);
+CPPUNIT_ASSERT_EQUAL(OUString("Aug-13"), aRowLabels[10]);
+CPPUNIT_ASSERT_EQUAL(OUString("Sep-13"), aRowLabels[11]);
+CPPUNIT_ASSERT_EQUAL(OUString("Oct-13"), aRowLabels[12]);
+CPPUNIT_ASSERT_EQUAL(OUString("Nov-13"), aRowLabels[13]);
+CPPUNIT_ASSERT_EQUAL(OUString("Dec-13"), aRowLabels[14]);
+CPPUNIT_ASSERT_EQUAL(OUString("Jan-14"), aRowLabels[15]);
+}
+
 void Chart2ImportTest::testBnc882383()
 {
 load("/chart2/qa/extras/data/pptx/", "bnc882383.pptx");
diff --git a/chart2/qa/extras/data/pptx/bnc889755.pptx 
b/chart2/qa/extras/data/pptx/bnc889755.pptx
new file mode 100644
index 000..f3af677
Binary files /dev/null and b/chart2/qa/extras/data/pptx/bnc889755.pptx differ
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 6abfbf4..2cc97ce 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -102,7 +102,8 @@ enum
 PROP_AXIS_OVERLAP,
 PROP_AXIS_GAP_WIDTH,
 PROP_AXIS_DISPLAY_UNITS,
-PROP_AXIS_BUILTINUNIT
+PROP_AXIS_BUILTINUNIT,
+PROP_AXIS_TRY_STAGGERING_FIRST
 };
 
 void lcl_AddPropertiesToVector(
@@ -356,6 +357,15 @@ void lcl_AddPropertiesToVector(
   cppu::UnoType::get(),
   

[Libreoffice-commits] core.git: chart2/qa chart2/source chart2/uiconfig include/xmloff offapi/com offapi/type_reference oox/inc oox/source xmloff/source

2015-09-09 Thread Marco Cecchetti
 chart2/qa/extras/xshape/chart2xshape.cxx|   28 
 chart2/qa/extras/xshape/data/ods/tdf90839-4.ods |binary
 chart2/qa/extras/xshape/data/reference/tdf90839-1.xml   |   10 
 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml   |  336 
++
 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml   |  336 
++
 chart2/qa/extras/xshape/data/reference/tdf90839-4.xml   |  336 
++
 chart2/qa/extras/xshape/data/xlsx/tdf90839-2.xlsx   |binary
 chart2/qa/extras/xshape/data/xlsx/tdf90839-3.xlsx   |binary
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx |8 
 chart2/source/controller/dialogs/res_DataLabel.cxx  |8 
 chart2/source/controller/dialogs/res_DataLabel.hxx  |1 
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx  |   46 +
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx  |   44 +
 chart2/source/inc/chartview/ChartSfxItemIds.hxx |   13 
 chart2/source/model/main/DataPointProperties.cxx|8 
 chart2/source/model/main/DataPointProperties.hxx|1 
 chart2/source/view/charttypes/PieChart.cxx  |   29 
 chart2/source/view/charttypes/VSeriesPlotter.cxx|  139 +++-
 chart2/source/view/inc/AbstractShapeFactory.hxx |9 
 chart2/source/view/inc/OpenglShapeFactory.hxx   |9 
 chart2/source/view/inc/ShapeFactory.hxx |   36 +
 chart2/source/view/inc/VSeriesPlotter.hxx   |5 
 chart2/source/view/main/ChartItemPool.cxx   |1 
 chart2/source/view/main/OpenglShapeFactory.cxx  |   15 
 chart2/source/view/main/ShapeFactory.cxx|  103 +++
 chart2/uiconfig/ui/dlg_DataLabel.ui |   19 
 chart2/uiconfig/ui/tp_DataLabel.ui  |   21 
 include/xmloff/xmltoken.hxx |1 
 offapi/com/sun/star/chart/ChartDataPointProperties.idl  |5 
 offapi/com/sun/star/chart2/DataPointProperties.idl  |4 
 offapi/type_reference/offapi.idl|1 
 oox/inc/drawingml/chart/objectformatter.hxx |5 
 oox/source/drawingml/chart/objectformatter.cxx  |   18 
 oox/source/drawingml/chart/seriesconverter.cxx  |2 
 xmloff/source/chart/PropertyMap.hxx |1 
 xmloff/source/chart/PropertyMaps.cxx|1 
 xmloff/source/core/xmltoken.cxx |1 
 37 files changed, 1551 insertions(+), 49 deletions(-)

New commits:
commit 9ed1dd01be8afa0961e388a79e9ff4c1235820c2
Author: Marco Cecchetti 
Date:   Sun Jul 19 18:18:00 2015 +0200

tdf#90839: support for wrapped text in data labels and for centered data 
value

Now in a pie chart the text of a label can be wrapped, the wrapping is
automatic and the maximum text width is fixed to almost half the pie
radius. This feature is used to import correctly the relative text
wrapping property provided by MSO.

Moreover the data value and percent value of a label are now centered
horizontally, respect with the label text.

Conflicts:
chart2/qa/extras/xshape/chart2xshape.cxx

Change-Id: Ie10d6184365436f763cd9693a5bbefcfa9b3862b
Reviewed-on: https://gerrit.libreoffice.org/17193
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx 
b/chart2/qa/extras/xshape/chart2xshape.cxx
index f57fdfc..dd74e18 100644
--- a/chart2/qa/extras/xshape/chart2xshape.cxx
+++ b/chart2/qa/extras/xshape/chart2xshape.cxx
@@ -31,13 +31,20 @@ public:
 void testFdo75075();
 void testPropertyMappingBarChart();
 void testPieChartLabels1();
+void testPieChartLabels2();
+void testPieChartLabels3();
+void testPieChartLabels4();
 void testTdf76649TrendLineBug();
 
 CPPUNIT_TEST_SUITE(Chart2XShapeTest);
 CPPUNIT_TEST(testFdo75075);
 CPPUNIT_TEST(testPropertyMappingBarChart);
 CPPUNIT_TEST(testPieChartLabels1);
+CPPUNIT_TEST(testPieChartLabels2);
+CPPUNIT_TEST(testPieChartLabels3);
+CPPUNIT_TEST(testPieChartLabels4);
 CPPUNIT_TEST(testTdf76649TrendLineBug);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -113,6 +120,27 @@ void Chart2XShapeTest::testPieChartLabels1()
 compareAgainstReference("tdf90839-1.xml");
 }
 
+void Chart2XShapeTest::testPieChartLabels2()
+{
+// text wrap: wrap all text labels except one
+load("chart2/qa/extras/xshape/data/xlsx/", 

[Libreoffice-commits] core.git: chart2/qa chart2/source

2014-02-26 Thread Alexander Wilms
 chart2/qa/TestCaseOldAPI.java |   46 
+-
 chart2/source/controller/accessibility/AccessibleChartElement.cxx |2 
 chart2/source/controller/dialogs/Bitmaps.hrc  |   24 ++---
 chart2/source/controller/dialogs/Bitmaps.src  |   38 

 chart2/source/controller/dialogs/ResourceIds.hrc  |   10 +-
 chart2/source/controller/dialogs/Strings.src  |   18 +--
 chart2/source/controller/dialogs/Strings_AdditionalControls.src   |2 
 chart2/source/controller/dialogs/Strings_ChartTypes.src   |   14 +--
 chart2/source/controller/dialogs/Strings_Statistic.src|4 
 chart2/source/controller/dialogs/TabPages.hrc |2 
 chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx  |4 
 chart2/source/controller/inc/HelpIds.hrc  |2 
 chart2/source/controller/inc/ItemConverter.hxx|4 
 chart2/source/controller/inc/MenuResIds.hrc   |2 
 chart2/source/controller/inc/ShapeController.hrc  |2 
 chart2/source/controller/main/ChartController_Window.cxx  |2 
 chart2/source/controller/main/DrawCommandDispatch.hrc |2 
 chart2/source/inc/LifeTime.hxx|2 
 chart2/source/inc/ServiceMacros.hxx   |   12 +-
 chart2/source/inc/Strings.hrc |   22 ++--
 chart2/source/inc/chartview/DrawModelWrapper.hxx  |4 
 chart2/source/model/main/ChartModel_Persistence.cxx   |2 
 chart2/source/model/template/ChartTypeTemplate.cxx|2 
 chart2/source/tools/CharacterProperties.cxx   |4 
 chart2/source/view/charttypes/AreaChart.cxx   |4 
 chart2/source/view/charttypes/BarChart.cxx|6 -
 chart2/source/view/charttypes/BubbleChart.cxx |2 
 chart2/source/view/charttypes/NetChart.cxx|4 
 chart2/source/view/charttypes/PieChart.cxx|2 
 chart2/source/view/charttypes/VSeriesPlotter.cxx  |2 
 chart2/source/view/inc/AbstractShapeFactory.hxx   |4 
 chart2/source/view/inc/PlottingPositionHelper.hxx |2 
 chart2/source/view/inc/ShapeFactory.hxx   |2 
 chart2/source/view/inc/VCoordinateSystem.hxx  |4 
 chart2/source/view/inc/VSeriesPlotter.hxx |2 
 chart2/source/view/inc/ViewDefines.hxx|2 
 chart2/source/view/main/ChartView.cxx |2 
 chart2/source/view/main/Clipping.cxx  |2 
 chart2/source/view/main/ShapeFactory.cxx  |2 
 39 files changed, 134 insertions(+), 134 deletions(-)

New commits:
commit f2cdf8848cb27d6385ad6c817e6c8c61e36e8ff7
Author: Alexander Wilms f.alexander.wi...@gmail.com
Date:   Tue Feb 25 17:47:16 2014 +0100

Remove visual noise from chart2

Change-Id: Ic8dc71c2815df265e1935e629e0220396a50aaac
Reviewed-on: https://gerrit.libreoffice.org/8239
Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com
Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/chart2/qa/TestCaseOldAPI.java b/chart2/qa/TestCaseOldAPI.java
index be1f911..083f635 100644
--- a/chart2/qa/TestCaseOldAPI.java
+++ b/chart2/qa/TestCaseOldAPI.java
@@ -101,7 +101,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 };
 }
 
-// 
+
 
 public void before()
 {
@@ -117,7 +117,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 XChartDocument.class, mxChartModel );
 }
 
-// 
+
 
 public void after()
 {
@@ -140,7 +140,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 }
 }
 
-// 
+
 
 public void testTitle()
 {
@@ -190,7 +190,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 }
 }
 
-// 
+
 
 public void testSubTitle()
 {
@@ -235,7 +235,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 }
 }
 
-// 
+
 
 public void testDiagram()
 {
@@ -348,7 +348,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 }
 }
 
-// 
+
 
 public void testAxis()
 {
@@ -445,7 +445,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 }
 }
 
-// 
+
 
 public void testLegend()
 {
@@ -492,7 +492,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 }
 }
 
-// 
+
 
 public void testArea()
 {
@@ -528,7 +528,7 @@ public class TestCaseOldAPI extends ComplexTestCase {
 }
 }