chart2/inc/unonames.hxx | 2 chart2/qa/extras/chart2export2.cxx | 19 ++ chart2/qa/extras/chart2export3.cxx | 21 ++- chart2/qa/extras/chart2import.cxx | 148 ---------------------- chart2/source/inc/CharacterProperties.hxx | 3 chart2/source/inc/FillProperties.hxx | 1 chart2/source/inc/LinePropertiesHelper.hxx | 1 chart2/source/model/main/DataPointProperties.cxx | 29 ++++ chart2/source/model/main/DataPointProperties.hxx | 4 chart2/source/tools/CharacterProperties.cxx | 13 + chart2/source/tools/FillProperties.cxx | 17 +- chart2/source/tools/LinePropertiesHelper.cxx | 12 + chart2/source/view/main/PropertyMapper.cxx | 10 + include/oox/export/drawingml.hxx | 19 ++ oox/source/drawingml/chart/seriesconverter.cxx | 67 ++++++--- oox/source/drawingml/chart/typegroupconverter.cxx | 24 ++- oox/source/drawingml/textcharacterproperties.cxx | 22 +-- oox/source/export/chartexport.cxx | 38 +++-- oox/source/export/drawingml.cxx | 140 +++++++++++++------- oox/source/token/properties.txt | 4 20 files changed, 323 insertions(+), 271 deletions(-)
New commits: commit 41ea9f0be095bb52c0a9cc4717dad215c80f0163 Author: Tomaž Vajngerl <[email protected]> AuthorDate: Wed Dec 3 23:49:57 2025 +0900 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Dec 5 17:03:28 2025 +0100 chart2: Add ComplexColor to many properties of chart elements This adds ComplexColor to many of the color properties that are available in charts. It also handles some import code in oox, so the complex colors are set correctly to the chart elements if an OOXML document is loaded. This doesn't yet handle export and if a theme is changed, as well if a color is changed manually in the chart. Change the tests so they now assert the scheme color like it is defined in the source document and not the calculated derived color. In addition change the WriteRunProperties to have a struct as an input instead a number of parameters, which in most cases don't need to be filled out and are using the default value. This was needed for the new parameter bUseTextSchemeColors, which is used for charts, so the text colors use tx1 and tx2 elements instead dk1 and dk2, which are usually used in Impress. Change-Id: Iaebbaea983c5232c51233c1a02bd8fe1da24d551 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194939 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194941 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx index abe190844962..92cc62f2d527 100644 --- a/chart2/inc/unonames.hxx +++ b/chart2/inc/unonames.hxx @@ -26,6 +26,7 @@ inline constexpr OUString CHART_UNONAME_LABEL_SEP = u"LabelSeparator"_ustr; inline constexpr OUString CHART_UNONAME_LABEL_BORDER_STYLE = u"LabelBorderStyle"_ustr; inline constexpr OUString CHART_UNONAME_LABEL_BORDER_WIDTH = u"LabelBorderWidth"_ustr; inline constexpr OUString CHART_UNONAME_LABEL_BORDER_COLOR = u"LabelBorderColor"_ustr; +inline constexpr OUString CHART_UNONAME_LABEL_BORDER_COMPLEX_COLOR = u"LabelBorderComplexColor"_ustr; inline constexpr OUString CHART_UNONAME_LABEL_BORDER_DASH = u"LabelBorderDash"_ustr; inline constexpr OUString CHART_UNONAME_LABEL_BORDER_DASHNAME = u"LabelBorderDashName"_ustr; inline constexpr OUString CHART_UNONAME_LABEL_BORDER_TRANS = u"LabelBorderTransparency"_ustr; @@ -33,6 +34,7 @@ inline constexpr OUString CHART_UNONAME_LABEL_FILL_STYLE = u"LabelFillStyle"_ust inline constexpr OUString CHART_UNONAME_LABEL_FILL_BACKGROUND = u"LabelFillBackground"_ustr; inline constexpr OUString CHART_UNONAME_LABEL_FILL_HATCH_NAME = u"LabelFillHatchName"_ustr; inline constexpr OUString CHART_UNONAME_LABEL_FILL_COLOR = u"LabelFillColor"_ustr; +inline constexpr OUString CHART_UNONAME_LABEL_FILL_COMPLEX_COLOR = u"LabelFillComplexColor"_ustr; inline constexpr OUString CHART_UNONAME_CUSTOM_LABEL_FIELDS = u"CustomLabelFields"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index 34a10808d790..d4881a353a59 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -251,7 +251,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testPieChartDataPointExplosionXLSX) CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabel) { - loadFromFile(u"pptx/tdf115107.pptx"); + loadFromFile(u"pptx/CustomDataLabel_tdf115107.pptx"); Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); CPPUNIT_ASSERT(xChartDoc.is()); @@ -363,12 +363,25 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest2, testCustomDataLabel) save(u"Impress MS PowerPoint 2007 XML"_ustr); xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/charts/chart1.xml"_ustr); CPPUNIT_ASSERT(pXmlDoc); + // Check the data labels font color for the complete data series assertXPathInsensitive( pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/" - "a:defRPr/a:solidFill/a:srgbClr", - "val", u"404040"); + "a:defRPr/a:solidFill/a:schemeClr", + "val", u"tx1"); + + assertXPathInsensitive( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/" + "a:defRPr/a:solidFill/a:schemeClr/a:lumMod", + "val", u"75000"); + + assertXPathInsensitive( + pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/" + "a:defRPr/a:solidFill/a:schemeClr/a:lumOff", + "val", u"25000"); } /// Test for tdf#94235 diff --git a/chart2/qa/extras/chart2export3.cxx b/chart2/qa/extras/chart2export3.cxx index ebd1d914c93a..206506f4b769 100644 --- a/chart2/qa/extras/chart2export3.cxx +++ b/chart2/qa/extras/chart2export3.cxx @@ -526,9 +526,28 @@ CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testBarChartDataPointPropXLSX) assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[1]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", u"000000"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:idx", "val", u"2"); + + // TODO: Gradient should be using a scheme colors - accent 1 + /* + <a:gs pos="0"> + <a:schemeClr val="accent1"> + <a:lumMod val="5000" /> + <a:lumOff val="95000" /> + </a:schemeClr> + </a:gs> + + <a:gs pos="100000"> + <a:schemeClr val="accent1"> + <a:lumMod val="30000" /> + <a:lumOff val="70000" /> + </a:schemeClr> + </a:gs> + */ assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:gradFill/a:gsLst/a:gs[1]/a:srgbClr", "val", u"f6f8fc"); assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:gradFill/a:gsLst/a:gs[2]/a:srgbClr", "val", u"c7d5ed"); - assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:srgbClr", "val", u"70ad47"); + + // Should be a scheme color - accent6 as in input document + assertXPathInsensitive(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:dPt[2]/c:spPr/a:ln/a:solidFill/a:schemeClr", "val", u"accent6"); } CPPUNIT_TEST_FIXTURE(Chart2ExportTest3, testAxisCharacterPropertiesXLSX) diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 0eb9b9375b6f..9f0abcd4c146 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -1775,154 +1775,6 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf122226) CPPUNIT_ASSERT_EQUAL_MESSAGE( "Data labels should be separated into new lines", u" "_ustr, nLabelSeparator ); } -CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf115107) -{ - // import complex data point labels - loadFromFile(u"pptx/tdf115107.pptx"); - - Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); - CPPUNIT_ASSERT(xChartDoc.is()); - - uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); - CPPUNIT_ASSERT(xDataSeries.is()); - float nFontSize; - sal_Int64 nFontColor; - sal_Int32 nCharUnderline; - uno::Reference<beans::XPropertySet> xPropertySet; - uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aFields; - - // 1 - xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); - xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields; - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), aFields.getLength()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[0]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"90.0 = "_ustr, aFields[0]->getString()); - aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize; - aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor; - CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xed7d31), nFontColor); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, aFields[1]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"90"_ustr, aFields[1]->getString()); - - // 2 - xPropertySet.set(xDataSeries->getDataPointByIndex(1), uno::UNO_SET_THROW); - xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields; - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8), aFields.getLength()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[0]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"Text"_ustr, aFields[0]->getString()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u" : "_ustr, aFields[1]->getString()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CATEGORYNAME, aFields[2]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"B"_ustr, aFields[2]->getString()); - aFields[2]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize; - aFields[2]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor; - CPPUNIT_ASSERT_EQUAL(static_cast<float>(16), nFontSize); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xed7d31), nFontColor); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE, aFields[3]->getFieldType()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[4]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"Multi"_ustr, aFields[4]->getString()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[5]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"line"_ustr, aFields[5]->getString()); - aFields[5]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize; - aFields[5]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor; - CPPUNIT_ASSERT_EQUAL(static_cast<float>(11.97), nFontSize); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xbf9000), nFontColor); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE, aFields[6]->getFieldType()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[7]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"Abc"_ustr, aFields[7]->getString()); - aFields[7]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize; - aFields[7]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor; - aFields[7]->getPropertyValue(u"CharUnderline"_ustr) >>= nCharUnderline; - CPPUNIT_ASSERT_EQUAL(static_cast<float>(12), nFontSize); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xa9d18e), nFontColor); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), nCharUnderline); - - // 3 - xPropertySet.set(xDataSeries->getDataPointByIndex(2), uno::UNO_SET_THROW); - xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields; - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aFields.getLength()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[0]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"DATA"_ustr, aFields[0]->getString()); - - // 4 - xPropertySet.set(xDataSeries->getDataPointByIndex(3), uno::UNO_SET_THROW); - xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields; - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), aFields.getLength()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLREF, aFields[0]->getFieldType()); - //CPPUNIT_ASSERT_EQUAL(OUString("70"), aFields[0]->getString()); TODO: Not implemented yet - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u" <CELLREF"_ustr, aFields[1]->getString()); -} - -CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf115107_2) -{ - // import complex data point labels in cobo charts with multiple data series - loadFromFile(u"pptx/tdf115107-2.pptx"); - - Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); - CPPUNIT_ASSERT(xChartDoc.is()); - - uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0)); - CPPUNIT_ASSERT(xDataSeries.is()); - float nFontSize; - sal_Int64 nFontColor; - uno::Reference<beans::XPropertySet> xPropertySet; - uno::Sequence<uno::Reference<chart2::XDataPointCustomLabelField>> aFields; - - // First series - xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); - xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields; - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), aFields.getLength()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, aFields[0]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"4.3"_ustr, aFields[0]->getString()); - aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize; - aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor; - CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xc00000), nFontColor); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u" "_ustr, aFields[1]->getString()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[2]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"Bars"_ustr, aFields[2]->getString()); - - // Second series - xDataSeries = getDataSeriesFromDoc(xChartDoc, 0, 1); - CPPUNIT_ASSERT(xDataSeries.is()); - - xPropertySet.set(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW); - xPropertySet->getPropertyValue(u"CustomLabelFields"_ustr) >>= aFields; - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), aFields.getLength()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE, aFields[0]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"2"_ustr, aFields[0]->getString()); - aFields[0]->getPropertyValue(u"CharHeight"_ustr) >>= nFontSize; - aFields[0]->getPropertyValue(u"CharColor"_ustr) >>= nFontColor; - CPPUNIT_ASSERT_EQUAL(static_cast<float>(18), nFontSize); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int64>(0xffd966), nFontColor); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT, aFields[1]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u" "_ustr, aFields[1]->getString()); - - CPPUNIT_ASSERT_EQUAL(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME, aFields[2]->getFieldType()); - CPPUNIT_ASSERT_EQUAL(u"Line"_ustr, aFields[2]->getString()); - -} - CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTdf116163) { loadFromFile(u"pptx/tdf116163.pptx"); diff --git a/chart2/qa/extras/data/pptx/tdf115107.pptx b/chart2/qa/extras/data/pptx/CustomDataLabel_tdf115107.pptx similarity index 100% rename from chart2/qa/extras/data/pptx/tdf115107.pptx rename to chart2/qa/extras/data/pptx/CustomDataLabel_tdf115107.pptx diff --git a/chart2/source/inc/CharacterProperties.hxx b/chart2/source/inc/CharacterProperties.hxx index 40367f9b943d..0b0b5a93a2a2 100644 --- a/chart2/source/inc/CharacterProperties.hxx +++ b/chart2/source/inc/CharacterProperties.hxx @@ -47,15 +47,18 @@ namespace CharacterProperties PROP_CHAR_FONT_CHAR_SET, PROP_CHAR_FONT_PITCH, PROP_CHAR_COLOR, + PROP_CHAR_COMPLEX_COLOR, // PROP_CHAR_BACKGROUND_COLOR, // PROP_CHAR_BACKGROUND_TRANSPARENCY, alpha channel in COLOR PROP_CHAR_ESCAPEMENT, PROP_CHAR_CHAR_HEIGHT, PROP_CHAR_UNDERLINE, PROP_CHAR_UNDERLINE_COLOR, + PROP_CHAR_UNDERLINE_COMPLEX_COLOR, PROP_CHAR_UNDERLINE_HAS_COLOR, PROP_CHAR_OVERLINE, PROP_CHAR_OVERLINE_COLOR, + PROP_CHAR_OVERLINE_COMPLEX_COLOR, PROP_CHAR_OVERLINE_HAS_COLOR, PROP_CHAR_WEIGHT, PROP_CHAR_POSTURE, diff --git a/chart2/source/inc/FillProperties.hxx b/chart2/source/inc/FillProperties.hxx index ce1c6d83629c..bd57420a4738 100644 --- a/chart2/source/inc/FillProperties.hxx +++ b/chart2/source/inc/FillProperties.hxx @@ -38,6 +38,7 @@ namespace FillProperties // com.sun.star.drawing.FillProperties PROP_FILL_STYLE = FAST_PROPERTY_ID_START_FILL_PROP , PROP_FILL_COLOR + , PROP_FILL_COMPLEX_COLOR , PROP_FILL_TRANSPARENCE , PROP_FILL_TRANSPARENCE_GRADIENT_NAME // , PROP_FILL_TRANSPARENCE_GRADIENT //optional diff --git a/chart2/source/inc/LinePropertiesHelper.hxx b/chart2/source/inc/LinePropertiesHelper.hxx index efa5a6e6b847..2c6e1c1b5838 100644 --- a/chart2/source/inc/LinePropertiesHelper.hxx +++ b/chart2/source/inc/LinePropertiesHelper.hxx @@ -42,6 +42,7 @@ namespace LinePropertiesHelper PROP_LINE_DASH, PROP_LINE_DASH_NAME, //not in service description PROP_LINE_COLOR, + PROP_LINE_COMPLEX_COLOR, PROP_LINE_TRANSPARENCE, PROP_LINE_WIDTH, PROP_LINE_JOINT, diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx index 53f88600214f..0d9ffa3b7213 100644 --- a/chart2/source/model/main/DataPointProperties.cxx +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/chart2/DataPointGeometry3D.hpp> #include <com/sun/star/chart2/DataPointLabel.hpp> #include <com/sun/star/chart2/Symbol.hpp> +#include <com/sun/star/util/XComplexColor.hpp> #include <tools/color.hxx> @@ -59,6 +60,11 @@ void DataPointProperties::AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID // "maybe auto" | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back("ComplexColor", + PROP_DATAPOINT_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( "FillColor", PROP_DATAPOINT_COLOR, cppu::UnoType<sal_Int32>::get(), @@ -66,6 +72,11 @@ void DataPointProperties::AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID // "maybe auto" | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back("FillComplexColor", + PROP_DATAPOINT_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( "Transparency", PROP_DATAPOINT_TRANSPARENCY, cppu::UnoType<sal_Int16>::get(), @@ -161,6 +172,11 @@ void DataPointProperties::AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID // "maybe auto" | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back("BorderComplexColor", + PROP_DATAPOINT_BORDER_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT); + rOutProperties.emplace_back( "BorderStyle", PROP_DATAPOINT_BORDER_STYLE, cppu::UnoType<drawing::LineStyle>::get(), @@ -194,6 +210,11 @@ void DataPointProperties::AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back("LineComplexColor", + PROP_DATAPOINT_BORDER_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( "LineStyle", LinePropertiesHelper::PROP_LINE_STYLE, cppu::UnoType<drawing::LineStyle>::get(), @@ -401,6 +422,10 @@ void DataPointProperties::AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID // "maybe auto" | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( CHART_UNONAME_LABEL_BORDER_COMPLEX_COLOR, + PROP_DATAPOINT_LABEL_BORDER_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT); rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_STYLE, PROP_DATAPOINT_LABEL_FILL_STYLE, cppu::UnoType<drawing::FillStyle>::get(), @@ -412,6 +437,10 @@ void DataPointProperties::AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back(CHART_UNONAME_LABEL_FILL_COMPLEX_COLOR, + PROP_DATAPOINT_LABEL_FILL_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT); rOutProperties.emplace_back( CHART_UNONAME_LABEL_FILL_BACKGROUND, PROP_DATAPOINT_LABEL_FILL_BACKGROUND, cppu::UnoType<sal_Bool>::get(), diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx index fe1969bc5f15..b3bf4cbcc147 100644 --- a/chart2/source/model/main/DataPointProperties.hxx +++ b/chart2/source/model/main/DataPointProperties.hxx @@ -36,11 +36,13 @@ namespace DataPointProperties { PROP_DATAPOINT_LABEL_FILL_STYLE, PROP_DATAPOINT_LABEL_FILL_COLOR, + PROP_DATAPOINT_LABEL_FILL_COMPLEX_COLOR, PROP_DATAPOINT_LABEL_FILL_BACKGROUND, PROP_DATAPOINT_LABEL_FILL_HATCH_NAME, // common PROP_DATAPOINT_COLOR = FAST_PROPERTY_ID_START_DATA_POINT, + PROP_DATAPOINT_COMPLEX_COLOR, PROP_DATAPOINT_TRANSPARENCY, // fill @@ -54,6 +56,7 @@ namespace DataPointProperties // border (of filled objects) PROP_DATAPOINT_BORDER_COLOR, + PROP_DATAPOINT_BORDER_COMPLEX_COLOR, PROP_DATAPOINT_BORDER_STYLE, PROP_DATAPOINT_BORDER_WIDTH, PROP_DATAPOINT_BORDER_DASH_NAME, @@ -83,6 +86,7 @@ namespace DataPointProperties PROP_DATAPOINT_TEXT_WORD_WRAP, PROP_DATAPOINT_LABEL_BORDER_STYLE, PROP_DATAPOINT_LABEL_BORDER_COLOR, + PROP_DATAPOINT_LABEL_BORDER_COMPLEX_COLOR, PROP_DATAPOINT_LABEL_BORDER_WIDTH, PROP_DATAPOINT_LABEL_BORDER_DASH, PROP_DATAPOINT_LABEL_BORDER_DASH_NAME, diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index e407b7efeecb..66da3f7649b7 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/awt/FontSlant.hpp> #include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/util/XComplexColor.hpp> #include <com/sun/star/awt/FontUnderline.hpp> #include <com/sun/star/awt/FontWeight.hpp> @@ -85,6 +86,10 @@ void CharacterProperties::AddPropertiesToVector( cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back("CharComplexColor", + PROP_CHAR_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT | beans::PropertyAttribute::MAYBEVOID ); // CharEscapement rOutProperties.emplace_back( "CharEscapement", PROP_CHAR_ESCAPEMENT, @@ -110,6 +115,10 @@ void CharacterProperties::AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT | beans::PropertyAttribute::MAYBEVOID ); + rOutProperties.emplace_back("CharUnderlineComplexColor", + PROP_CHAR_UNDERLINE_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT | beans::PropertyAttribute::MAYBEVOID ); // CharUnderlineHasColor rOutProperties.emplace_back( "CharUnderlineHasColor", PROP_CHAR_UNDERLINE_HAS_COLOR, @@ -129,6 +138,10 @@ void CharacterProperties::AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT | beans::PropertyAttribute::MAYBEVOID ); + rOutProperties.emplace_back("CharOverlineComplexColor", + PROP_CHAR_OVERLINE_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT | beans::PropertyAttribute::MAYBEVOID ); // CharOverlineHasColor rOutProperties.emplace_back( "CharOverlineHasColor", PROP_CHAR_OVERLINE_HAS_COLOR, diff --git a/chart2/source/tools/FillProperties.cxx b/chart2/source/tools/FillProperties.cxx index ba3b63c83db1..eee993b2d9df 100644 --- a/chart2/source/tools/FillProperties.cxx +++ b/chart2/source/tools/FillProperties.cxx @@ -22,20 +22,18 @@ #include <com/sun/star/drawing/BitmapMode.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/RectanglePoint.hpp> +#include <com/sun/star/util/XComplexColor.hpp> #include <tools/color.hxx> -using namespace ::com::sun::star; - -using ::com::sun::star::beans::Property; - +using namespace css; namespace chart { namespace { -void lcl_AddPropertiesToVector_without_BitmapProperties( std::vector< css::beans::Property > & rOutProperties ) +void lcl_AddPropertiesToVector_without_BitmapProperties( std::vector<beans::Property> & rOutProperties ) { rOutProperties.emplace_back( "FillStyle", FillProperties::PROP_FILL_STYLE, @@ -50,6 +48,11 @@ void lcl_AddPropertiesToVector_without_BitmapProperties( std::vector< css::beans | beans::PropertyAttribute::MAYBEVOID // "maybe auto" | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back("FillComplexColor", + FillProperties::PROP_FILL_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( "FillTransparence", FillProperties::PROP_FILL_TRANSPARENCE, cppu::UnoType<sal_Int16>::get(), @@ -92,7 +95,7 @@ void lcl_AddPropertiesToVector_without_BitmapProperties( std::vector< css::beans | beans::PropertyAttribute::MAYBEDEFAULT ); } -void lcl_AddPropertiesToVector_only_BitmapProperties( std::vector< css::beans::Property > & rOutProperties ) +void lcl_AddPropertiesToVector_only_BitmapProperties(std::vector<beans::Property> & rOutProperties) { rOutProperties.emplace_back( "FillBitmapName", FillProperties::PROP_FILL_BITMAP_NAME, @@ -183,7 +186,7 @@ void lcl_AddDefaultsToMap_only_BitmapProperties( }//end anonymous namespace void FillProperties::AddPropertiesToVector( - std::vector< Property > & rOutProperties ) + std::vector<beans::Property> & rOutProperties ) { // Fill Properties see service drawing::FillProperties lcl_AddPropertiesToVector_without_BitmapProperties( rOutProperties ); diff --git a/chart2/source/tools/LinePropertiesHelper.cxx b/chart2/source/tools/LinePropertiesHelper.cxx index 8b9598c7461c..a86fd63b8023 100644 --- a/chart2/source/tools/LinePropertiesHelper.cxx +++ b/chart2/source/tools/LinePropertiesHelper.cxx @@ -24,18 +24,17 @@ #include <com/sun/star/drawing/LineDash.hpp> #include <com/sun/star/drawing/LineCap.hpp> #include <com/sun/star/drawing/LineJoint.hpp> +#include <com/sun/star/util/XComplexColor.hpp> #include <comphelper/diagnose_ex.hxx> #include <tools/color.hxx> -using namespace ::com::sun::star; - -using ::com::sun::star::beans::Property; +using namespace css; namespace chart { void LinePropertiesHelper::AddPropertiesToVector( - std::vector< Property > & rOutProperties ) + std::vector<beans::Property> & rOutProperties ) { // Line Properties see service drawing::LineProperties rOutProperties.emplace_back( "LineStyle", @@ -64,6 +63,11 @@ void LinePropertiesHelper::AddPropertiesToVector( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back("LineComplexColor", + PROP_LINE_COMPLEX_COLOR, + cppu::UnoType<util::XComplexColor>::get(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT | beans::PropertyAttribute::MAYBEVOID); + rOutProperties.emplace_back( "LineTransparence", PROP_LINE_TRANSPARENCE, cppu::UnoType<sal_Int16>::get(), diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx index e042144747ba..4bbf72755608 100644 --- a/chart2/source/view/main/PropertyMapper.cxx +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -266,6 +266,7 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties //shape property -- chart model object property static tPropertyNameMap s_aShapePropertyMapForCharacterProperties{ {"CharColor", "CharColor"}, + {"CharComplexColor", "CharComplexColor"}, {"CharContoured", "CharContoured"}, {"CharEmphasis", "CharEmphasis"},//the service style::CharacterProperties describes a property called 'CharEmphasize' which is nowhere implemented {"CharEscapement", "CharEscapement"}, @@ -301,9 +302,11 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties {"CharStrikeout", "CharStrikeout"}, {"CharUnderline", "CharUnderline"}, {"CharUnderlineColor", "CharUnderlineColor"}, + {"CharUnderlineComplexColor", "CharUnderlineComplexColor"}, {"CharUnderlineHasColor", "CharUnderlineHasColor"}, {"CharOverline", "CharOverline"}, {"CharOverlineColor", "CharOverlineColor"}, + {"CharOverlineComplexColor", "CharOverlineComplexColor"}, {"CharOverlineHasColor", "CharOverlineHasColor"}, {"CharWeight", "CharWeight"}, {"CharWeightAsian", "CharWeightAsian"}, @@ -338,6 +341,7 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForFillProperties() {"FillBackground", "FillBackground"}, {"FillBitmapName", "FillBitmapName"}, {"FillColor", "FillColor"}, + {"FillComplexColor", "FillComplexColor"}, {"FillGradientName", "FillGradientName"}, {"FillGradientStepCount", "FillGradientStepCount"}, {"FillHatchName", "FillHatchName"}, @@ -362,6 +366,7 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForLineProperties() //shape property -- chart model object property static tPropertyNameMap s_aShapePropertyMapForLineProperties{ {"LineColor", "LineColor"}, + {"LineComplexColor", "LineComplexColor"}, {"LineDashName", "LineDashName"}, {"LineJoint", "LineJoint"}, {"LineStyle", "LineStyle"}, @@ -411,6 +416,7 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForLineSeriesPropertie //shape property -- chart model object property static tPropertyNameMap s_aShapePropertyMapForLineSeriesProperties{ {"LineColor", "Color"}, + {"LineComplexColor", "ComplexColor"}, {"LineDashName", "LineDashName"}, {"LineStyle", "LineStyle"}, {"LineTransparence", "Transparency"}, @@ -426,9 +432,11 @@ namespace { {"LineStyle", CHART_UNONAME_LABEL_BORDER_STYLE}, {"LineWidth", CHART_UNONAME_LABEL_BORDER_WIDTH}, {"LineColor", CHART_UNONAME_LABEL_BORDER_COLOR}, + {"LineComplexColor", CHART_UNONAME_LABEL_BORDER_COMPLEX_COLOR}, {"LineTransparence", CHART_UNONAME_LABEL_BORDER_TRANS}, {"FillStyle", CHART_UNONAME_LABEL_FILL_STYLE}, {"FillColor", CHART_UNONAME_LABEL_FILL_COLOR}, + {"FillComplexColor", CHART_UNONAME_LABEL_FILL_COMPLEX_COLOR}, {"FillBackground", CHART_UNONAME_LABEL_FILL_BACKGROUND}, {"FillHatchName", CHART_UNONAME_LABEL_FILL_HATCH_NAME} }); @@ -450,6 +458,7 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesPropert {"FillBackground", "FillBackground"}, {"FillBitmapName", "FillBitmapName"}, {"FillColor", "Color"}, + {"FillComplexColor", "ComplexColor"}, {"FillGradientName", "GradientName"}, {"FillGradientStepCount", "GradientStepCount"}, {"FillHatchName", "HatchName"}, @@ -468,6 +477,7 @@ const tPropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesPropert {"FillBitmapPositionOffsetY", "FillBitmapPositionOffsetY"}, //line properties {"LineColor", "BorderColor"}, + {"LineComplexColor", "BorderComplexColor"}, {"LineDashName", "BorderDashName"}, {"LineStyle", "BorderStyle"}, {"LineTransparence", "BorderTransparency"}, diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 37da95673d3a..d398f836b95f 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -280,6 +280,17 @@ public: void writeSvgExtension(OUString const& rSvgRelId); }; +struct WriteRunInput +{ + bool bIsField = false; + bool bCheckDirect = false; + bool bOverridingCharHeight = false; + sal_Int32 nCharHeight = -1; + sal_Int16 nScriptType = css::i18n::ScriptType::LATIN; + bool bUseTextSchemeColors = false; + css::uno::Reference<css::beans::XPropertySet> xShapePropSet; +}; + class DrawingML { @@ -378,7 +389,7 @@ public: void WriteConnectorConnections( sal_Int32 nStartGlueId, sal_Int32 nEndGlueId, sal_Int32 nStartID, sal_Int32 nEndID ); bool WriteCharColor(const css::uno::Reference<css::beans::XPropertySet>& xPropertySet); - bool WriteSchemeColor(OUString const& rPropertyName, const css::uno::Reference<css::beans::XPropertySet>& xPropertySet); + bool WriteSchemeColor(OUString const& rPropertyName, const css::uno::Reference<css::beans::XPropertySet>& xPropertySet, bool bUseTextSchemeColors = false); void WriteSolidFill( ::Color nColor, sal_Int32 nAlpha = MAX_PERCENT ); void WriteSolidFill( const OUString& sSchemeName, const css::uno::Sequence< css::beans::PropertyValue >& aTransformations, sal_Int32 nAlpha = MAX_PERCENT ); @@ -476,10 +487,8 @@ public: void WriteRun( const css::uno::Reference< css::text::XTextRange >& rRun, bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, const css::uno::Reference< css::beans::XPropertySet >& rXShapePropSet); - void WriteRunProperties( const css::uno::Reference< css::beans::XPropertySet >& rRun, bool bIsField, sal_Int32 nElement, bool bCheckDirect, - bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, - sal_Int16 nScriptType = css::i18n::ScriptType::LATIN, - const css::uno::Reference< css::beans::XPropertySet >& rXShapePropSet = {}); + + void WriteRunProperties(const css::uno::Reference< css::beans::XPropertySet >& rRun, sal_Int32 nElement, WriteRunInput& rRunInput); void WritePresetShape( const OString& pShape , std::vector< std::pair<sal_Int32,sal_Int32>> & rAvList ); OOX_DLLPUBLIC void WritePresetShape( const OString& pShape ); diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index c0a15a85d922..4b8674ece646 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -55,6 +55,9 @@ #include <drawingml/textfield.hxx> #include <drawingml/textbody.hxx> #include <drawingml/hatchmap.hxx> +#include <oox/helper/graphichelper.hxx> +#include <docmodel/color/ComplexColor.hxx> +#include <docmodel/uno/UnoComplexColor.hxx> namespace oox::drawingml::chart { @@ -196,72 +199,86 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt void importBorderProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper ) { - LineProperties& rLP = rShape.getLineProperties(); + LineProperties& rLineProperties = rShape.getLineProperties(); // no fill has the same effect as no border so skip it - if (rLP.maLineFill.moFillType.has_value() && rLP.maLineFill.moFillType.value() == XML_noFill) + if (rLineProperties.maLineFill.moFillType.has_value() && rLineProperties.maLineFill.moFillType.value() == XML_noFill) return; - if (rLP.moLineWidth.has_value()) + if (rLineProperties.moLineWidth.has_value()) { - sal_Int32 nWidth = convertEmuToHmm(rLP.moLineWidth.value()); + sal_Int32 nWidth = convertEmuToHmm(rLineProperties.moLineWidth.value()); rPropSet.setProperty(PROP_LabelBorderWidth, uno::Any(nWidth)); rPropSet.setProperty(PROP_LabelBorderStyle, uno::Any(drawing::LineStyle_SOLID)); } - const Color& aColor = rLP.maLineFill.maFillColor; - ::Color nColor = aColor.getColor(rGraphicHelper); + const Color& aOOXColor = rLineProperties.maLineFill.maFillColor; + ::Color nColor = aOOXColor.getColor(rGraphicHelper); rPropSet.setProperty(PROP_LabelBorderColor, uno::Any(nColor)); + + model::ComplexColor aComplexColor = aOOXColor.getComplexColor(); + auto xComplexColor = model::color::createXComplexColor(aComplexColor); + rPropSet.setProperty(PROP_LabelBorderComplexColor, uno::Any(xComplexColor)); } -void lcl_ImportLeaderLineProperties(PropertySet& rPropSet, Shape& rShape, - const GraphicHelper& rGraphicHelper) +void lcl_ImportLeaderLineProperties(PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper) { - LineProperties& rLP = rShape.getLineProperties(); + LineProperties& rLineProperties = rShape.getLineProperties(); // no fill has the same effect as no line so skip it - if (rLP.maLineFill.moFillType.has_value() && rLP.maLineFill.moFillType.value() == XML_noFill) + if (rLineProperties.maLineFill.moFillType.has_value() && rLineProperties.maLineFill.moFillType.value() == XML_noFill) return; - if (rLP.moLineWidth.has_value()) + if (rLineProperties.moLineWidth.has_value()) { - sal_Int32 nWidth = convertEmuToHmm(rLP.moLineWidth.value()); + sal_Int32 nWidth = convertEmuToHmm(rLineProperties.moLineWidth.value()); rPropSet.setProperty(PROP_LineWidth, uno::Any(nWidth)); } - if (rLP.maLineFill.moFillType.has_value() && rLP.maLineFill.moFillType.value() == XML_solidFill) + if (rLineProperties.maLineFill.moFillType.has_value() && rLineProperties.maLineFill.moFillType.value() == XML_solidFill) { - const Color& aColor = rLP.maLineFill.maFillColor; - ::Color nColor = aColor.getColor(rGraphicHelper); + const Color& aOOXColor = rLineProperties.maLineFill.maFillColor; + ::Color nColor = aOOXColor.getColor(rGraphicHelper); rPropSet.setProperty(PROP_LineColor, uno::Any(nColor)); + + model::ComplexColor aComplexColor = aOOXColor.getComplexColor(); + auto xComplexColor = model::color::createXComplexColor(aComplexColor); + rPropSet.setProperty(PROP_LineComplexColor, uno::Any(xComplexColor)); } } void importFillProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper, ModelObjectHelper& rModelObjHelper ) { - FillProperties& rFP = rShape.getFillProperties(); + FillProperties& rFillProperties = rShape.getFillProperties(); - if (rFP.moFillType.has_value() && rFP.moFillType.value() == XML_solidFill) + if (rFillProperties.moFillType.has_value() && rFillProperties.moFillType.value() == XML_solidFill) { rPropSet.setProperty(PROP_LabelFillStyle, drawing::FillStyle_SOLID); - const Color& aColor = rFP.maFillColor; - ::Color nColor = aColor.getColor(rGraphicHelper); + const Color& aOOXColor = rFillProperties.maFillColor; + ::Color nColor = aOOXColor.getColor(rGraphicHelper); rPropSet.setProperty(PROP_LabelFillColor, uno::Any(nColor)); + + model::ComplexColor aComplexColor = aOOXColor.getComplexColor(); + auto xComplexColor = model::color::createXComplexColor(aComplexColor); + rPropSet.setProperty(PROP_LabelFillComplexColor, uno::Any(xComplexColor)); } - else if(rFP.moFillType.has_value() && rFP.moFillType.value() == XML_pattFill) + else if(rFillProperties.moFillType.has_value() && rFillProperties.moFillType.value() == XML_pattFill) { rPropSet.setProperty(PROP_LabelFillStyle, drawing::FillStyle_HATCH); rPropSet.setProperty(PROP_LabelFillBackground, true); - Color aHatchColor( rFP.maPatternProps.maPattFgColor ); - drawing::Hatch aHatch = createHatch(rFP.maPatternProps.moPattPreset.value(), aHatchColor.getColor(rGraphicHelper, 0)); + Color aHatchColor( rFillProperties.maPatternProps.maPattFgColor ); + drawing::Hatch aHatch = createHatch(rFillProperties.maPatternProps.moPattPreset.value(), aHatchColor.getColor(rGraphicHelper, 0)); OUString sHatchName = rModelObjHelper.insertFillHatch(aHatch); rPropSet.setProperty(PROP_LabelFillHatchName, sHatchName); - const Color& aColor = rFP.maPatternProps.maPattBgColor; - ::Color nColor = aColor.getColor(rGraphicHelper); + const Color& aOOXColor = rFillProperties.maPatternProps.maPattBgColor; + ::Color nColor = aOOXColor.getColor(rGraphicHelper); rPropSet.setProperty(PROP_LabelFillColor, uno::Any(nColor)); - } + model::ComplexColor aComplexColor = aOOXColor.getComplexColor(); + auto xComplexColor = model::color::createXComplexColor(aComplexColor); + rPropSet.setProperty(PROP_LabelFillComplexColor, uno::Any(xComplexColor)); + } } DataPointCustomLabelFieldType lcl_ConvertFieldNameToFieldEnum( std::u16string_view rField ) diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index 938c09646a04..c2313cd502ec 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -47,8 +47,13 @@ #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> #include <tools/UnitConversion.hxx> +#include <docmodel/color/ComplexColor.hxx> +#include <docmodel/uno/UnoComplexColor.hxx> -namespace oox::drawingml::chart { +namespace oox::drawingml::chart +{ + +using namespace css; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::chart2; @@ -525,17 +530,26 @@ void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSym if(xShapeProps.is()) { - Color aFillColor = xShapeProps->getFillProperties().maFillColor; - aSymbol.FillColor = sal_Int32(aFillColor.getColor(getFilter().getGraphicHelper())); + Color aFillOOXColor = xShapeProps->getFillProperties().maFillColor; + aSymbol.FillColor = sal_Int32(aFillOOXColor.getColor(getFilter().getGraphicHelper())); // tdf#124817: if there is no fill color, use line color of the symbol if( aSymbol.FillColor < 0 ) { - Color aLineColor = xShapeProps->getLineProperties().maLineFill.maFillColor; - aSymbol.BorderColor = sal_Int32(aLineColor.getColor(getFilter().getGraphicHelper())); + Color aLineOOXColor = xShapeProps->getLineProperties().maLineFill.maFillColor; + aSymbol.BorderColor = sal_Int32(aLineOOXColor.getColor(getFilter().getGraphicHelper())); rPropSet.setProperty(PROP_Color, aSymbol.BorderColor); + + model::ComplexColor aComplexColor = aLineOOXColor.getComplexColor(); + auto xComplexColor = model::color::createXComplexColor(aComplexColor); + rPropSet.setProperty(PROP_ComplexColor, uno::Any(xComplexColor)); } else + { rPropSet.setProperty(PROP_Color, aSymbol.FillColor); + model::ComplexColor aComplexColor = aFillOOXColor.getComplexColor(); + auto xComplexColor = model::color::createXComplexColor(aComplexColor); + rPropSet.setProperty(PROP_ComplexColor, uno::Any(xComplexColor)); + } } // set the property diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index a32512743085..689d588f5d33 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -113,12 +113,12 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil if ( maFillProperties.moFillType.has_value() ) { - Color aColor = maFillProperties.getBestSolidColor(); + Color aOOXColor = maFillProperties.getBestSolidColor(); bool bContoured = false; // noFill doesn't exist for characters. Map noFill to 99% transparency if (maFillProperties.moFillType.value() == XML_noFill) - aColor.addTransformation(XML_alpha, 1000); + aOOXColor.addTransformation(XML_alpha, 1000); // tdf#137438 Emulate text outline color/transparency. // If the outline color dominates, then use it as the text color. @@ -131,15 +131,15 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil // tdf#127696 If the text color is white (and the outline color doesn't dominate), // then this is contoured text in LO. - if (nLineTransparency < aColor.getTransparency() - || (bContoured = aColor.getColor(rFilter.getGraphicHelper()) == COL_WHITE)) - aColor = std::move(aLineColor); + if (nLineTransparency < aOOXColor.getTransparency() + || (bContoured = aOOXColor.getColor(rFilter.getGraphicHelper()) == COL_WHITE)) + aOOXColor = std::move(aLineColor); } - rPropMap.setProperty(PROP_CharColor, aColor.getColor(rFilter.getGraphicHelper())); + rPropMap.setProperty(PROP_CharColor, aOOXColor.getColor(rFilter.getGraphicHelper())); // set theme color - model::ComplexColor aComplexColor = aColor.getComplexColor(); - sal_Int32 nToken = Color::getColorMapToken(aColor.getSchemeColorName()); + model::ComplexColor aComplexColor = aOOXColor.getComplexColor(); + sal_Int32 nToken = Color::getColorMapToken(aOOXColor.getSchemeColorName()); if (nToken != -1) { rFilter.getGraphicHelper().getSchemeColorToken(nToken); @@ -149,14 +149,14 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil rPropMap.setProperty(PROP_CharComplexColor, model::color::createXComplexColor(aComplexColor)); rPropMap.setProperty(PROP_CharContoured, bContoured); - if (aColor.hasTransparency()) + if (aOOXColor.hasTransparency()) { - const auto nTransparency = aColor.getTransparency(); + const auto nTransparency = aOOXColor.getTransparency(); rPropMap.setProperty(PROP_CharTransparence, nTransparency); // WORKAROUND: Fully transparent white has the same value as COL_AUTO, avoid collision if (nTransparency == 100 - && aColor.getColor(rFilter.getGraphicHelper()).GetRGBColor() == COL_AUTO.GetRGBColor()) + && aOOXColor.getColor(rFilter.getGraphicHelper()).GetRGBColor() == COL_AUTO.GetRGBColor()) rPropMap.setProperty(PROP_CharColor, ::Color(ColorTransparency, 0xFFFFFFFE)); } } diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 0837aa7b08ad..7111b6d3f0fd 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2191,18 +2191,25 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape, bool bIsCharte pFS->startElement(FSNS(XML_a, XML_pPr)); - bool bDummy = false; - sal_Int32 nDummy; - WriteRunProperties(xPropSet, false, XML_defRPr, true, bDummy, nDummy ); + { + WriteRunInput aInput; + aInput.bCheckDirect = true; + aInput.bUseTextSchemeColors = true; + WriteRunProperties(xPropSet, XML_defRPr, aInput); + } pFS->endElement( FSNS( XML_a, XML_pPr ) ); for (const uno::Reference<chart2::XFormattedString>& rxFS : xFormattedTitle) { pFS->startElement(FSNS(XML_a, XML_r)); - bDummy = false; Reference< beans::XPropertySet > xRunPropSet(rxFS, uno::UNO_QUERY); - WriteRunProperties(xRunPropSet, false, XML_rPr, true, bDummy, nDummy); + { + WriteRunInput aInput; + aInput.bCheckDirect = true; + aInput.bUseTextSchemeColors = true; + WriteRunProperties(xRunPropSet, XML_rPr, aInput); + } pFS->startElement(FSNS(XML_a, XML_t)); // the linebreak should always be at the end of the XFormattedString text @@ -2223,8 +2230,12 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape, bool bIsCharte pFS->startElement(FSNS(XML_a, XML_p)); pFS->startElement(FSNS(XML_a, XML_pPr)); - bDummy = false; - WriteRunProperties(xPropSet, false, XML_defRPr, true, bDummy, nDummy); + + WriteRunInput aInput; + aInput.bCheckDirect = true; + aInput.bUseTextSchemeColors = true; + WriteRunProperties(xPropSet, XML_defRPr, aInput); + pFS->endElement(FSNS(XML_a, XML_pPr)); } } @@ -3960,8 +3971,10 @@ void ChartExport::exportTextProps(const Reference<XPropertySet>& xPropSet, pFS->startElement(FSNS(XML_a, XML_p)); pFS->startElement(FSNS(XML_a, XML_pPr)); - WriteRunProperties(xPropSet, false, XML_defRPr, true, o3tl::temporary(false), - o3tl::temporary(sal_Int32())); + WriteRunInput aInput; + aInput.bCheckDirect = true; + aInput.bUseTextSchemeColors = true; + WriteRunProperties(xPropSet, XML_defRPr, aInput); pFS->endElement(FSNS(XML_a, XML_pPr)); pFS->endElement(FSNS(XML_a, XML_p)); @@ -4774,9 +4787,10 @@ OUString getFieldTypeString( const chart2::DataPointCustomLabelFieldType aType ) void writeRunProperties( ChartExport* pChartExport, Reference<XPropertySet> const & xPropertySet ) { - bool bDummy = false; - sal_Int32 nDummy; - pChartExport->WriteRunProperties(xPropertySet, false, XML_rPr, true, bDummy, nDummy); + WriteRunInput aInput; + aInput.bCheckDirect = true; + aInput.bUseTextSchemeColors = true; + pChartExport->WriteRunProperties(xPropertySet, XML_rPr, aInput); } void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport, diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index e8f9bff158ea..b9ebd693c15f 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -155,20 +155,20 @@ using ::sax_fastparser::FastSerializerHelper; namespace { -const char* const g_aPredefinedClrNames[] = { - "dk1", - "lt1", - "dk2", - "lt2", - "accent1", - "accent2", - "accent3", - "accent4", - "accent5", - "accent6", - "hlink", - "folHlink", -}; + +constexpr auto g_aSchemeColorNames = std::to_array<std::string_view>({ + "dk1", "lt1", "dk2", "lt2", + "accent1", "accent2", "accent3", + "accent4", "accent5", "accent6", + "hlink", "folHlink", +}); + +constexpr auto g_aSchemeColorNamesText = std::to_array<std::string_view>({ + "tx1", "bg1", "tx2", "bg2", + "accent1", "accent2", "accent3", + "accent4", "accent5", "accent6", + "hlink", "folHlink", +}); /** converts 1/100mm to the ST_TextSpacingPoint (1/100pt) */ sal_Int64 toTextSpacingPoint(sal_Int64 mm100) @@ -557,7 +557,7 @@ void DrawingML::WriteSolidFill( const Reference< XPropertySet >& rXPropSet ) } } -bool DrawingML::WriteSchemeColor(OUString const& rPropertyName, const uno::Reference<beans::XPropertySet>& xPropertySet) +bool DrawingML::WriteSchemeColor(OUString const& rPropertyName, const uno::Reference<beans::XPropertySet>& xPropertySet, bool bUseTextSchemeColors) { if (!xPropertySet->getPropertySetInfo()->hasPropertyByName(rPropertyName)) return false; @@ -570,28 +570,40 @@ bool DrawingML::WriteSchemeColor(OUString const& rPropertyName, const uno::Refer auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); if (aComplexColor.getThemeColorType() == model::ThemeColorType::Unknown) return false; - const char* pColorName = g_aPredefinedClrNames[sal_Int16(aComplexColor.getThemeColorType())]; + + auto nThemeColorIndex = sal_Int16(aComplexColor.getThemeColorType()); + OString aColorName; + if (bUseTextSchemeColors) + aColorName = OString(g_aSchemeColorNamesText[nThemeColorIndex]); + else + aColorName = OString(g_aSchemeColorNames[nThemeColorIndex]); + mpFS->startElementNS(XML_a, XML_solidFill); - mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, pColorName); + mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, aColorName); + for (auto const& rTransform : aComplexColor.getTransformations()) { + sal_Int32 nElement = XML_none; switch (rTransform.meType) { case model::TransformationType::LumMod: - mpFS->singleElementNS(XML_a, XML_lumMod, XML_val, OString::number(rTransform.mnValue * 10)); + nElement = XML_lumMod; break; case model::TransformationType::LumOff: - mpFS->singleElementNS(XML_a, XML_lumOff, XML_val, OString::number(rTransform.mnValue * 10)); + nElement = XML_lumOff; break; case model::TransformationType::Tint: - mpFS->singleElementNS(XML_a, XML_tint, XML_val, OString::number(rTransform.mnValue * 10)); + nElement = XML_tint; break; case model::TransformationType::Shade: - mpFS->singleElementNS(XML_a, XML_shade, XML_val, OString::number(rTransform.mnValue * 10)); + nElement = XML_shade; break; default: break; } + + if (nElement != XML_none) + mpFS->singleElementNS(XML_a, nElement, XML_val, OString::number(rTransform.mnValue * 10)); } // Alpha is actually not contained in maTransformations although possible (as of Mar 2023). sal_Int16 nAPITransparency(0); @@ -2481,14 +2493,12 @@ static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& xMo return sTarget; } -void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool bIsField, sal_Int32 nElement, - bool /*bCheckDirect*/,bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, - sal_Int16 nScriptType, const Reference< XPropertySet >& rXShapePropSet) +void DrawingML::WriteRunProperties(const Reference<XPropertySet>& rRun, sal_Int32 nElement, WriteRunInput& rRunInput) { Reference< XPropertySet > rXPropSet = rRun; Reference< XPropertyState > rXPropState( rRun, UNO_QUERY ); OUString usLanguage; - bool bComplex = ( nScriptType == css::i18n::ScriptType::COMPLEX ); + bool bComplex = (rRunInput.nScriptType == css::i18n::ScriptType::COMPLEX); const char* bold = "0"; const char* italic = nullptr; const char* underline = nullptr; @@ -2499,17 +2509,17 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool sal_Int32 nCharKerning = 0; sal_Int32 nCharEscapementHeight = 0; - if ( nElement == XML_endParaRPr && rbOverridingCharHeight ) + if (nElement == XML_endParaRPr && rRunInput.bOverridingCharHeight) { - nSize = rnCharHeight; + nSize = rRunInput.nCharHeight; } else if (GetProperty(rXPropSet, u"CharHeight"_ustr)) { nSize = static_cast<sal_Int32>(100*(*o3tl::doAccess<float>(mAny))); if ( nElement == XML_rPr || nElement == XML_defRPr ) { - rbOverridingCharHeight = true; - rnCharHeight = nSize; + rRunInput.bOverridingCharHeight = true; + rRunInput.nCharHeight = nSize; } } @@ -2627,7 +2637,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool } bool bLang = false; - switch(nScriptType) + switch (rRunInput.nScriptType) { case css::i18n::ScriptType::ASIAN: bLang = GetProperty(rXPropSet, u"CharLocaleAsian"_ustr); break; @@ -2703,11 +2713,11 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool // Fontwork-shapes in LO have text outline and fill from shape stroke and shape fill // PowerPoint has this as run properties - if (IsFontworkShape(rXShapePropSet)) + if (IsFontworkShape(rRunInput.xShapePropSet)) { - WriteOutline(rXShapePropSet); - WriteBlipOrNormalFill(rXShapePropSet, u"Graphic"_ustr); - WriteShapeEffects(rXShapePropSet); + WriteOutline(rRunInput.xShapePropSet); + WriteBlipOrNormalFill(rRunInput.xShapePropSet, u"Graphic"_ustr); + WriteShapeEffects(rRunInput.xShapePropSet); } else { @@ -2742,7 +2752,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool else { color.SetAlpha(255); - if (!WriteSchemeColor(u"CharComplexColor"_ustr, rXPropSet)) + if (!WriteSchemeColor(u"CharComplexColor"_ustr, rXPropSet, rRunInput.bUseTextSchemeColors)) WriteSolidFill(color, nTransparency); } mpFS->endElementNS(XML_a, XML_ln); @@ -2755,7 +2765,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool { color.SetAlpha(255); // TODO: special handle embossed/engraved - if (!WriteSchemeColor(u"CharComplexColor"_ustr, rXPropSet)) + if (!WriteSchemeColor(u"CharComplexColor"_ustr, rXPropSet, rRunInput.bUseTextSchemeColors)) { WriteSolidFill(color, nTransparency); } @@ -2764,9 +2774,9 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool { // Resolve COL_AUTO for PPTX since MS Powerpoint doesn't have automatic colors. bool bIsTextBackgroundDark = mbIsBackgroundDark; - if (rXShapePropSet.is() && GetProperty(rXShapePropSet, u"FillStyle"_ustr) + if (rRunInput.xShapePropSet.is() && GetProperty(rRunInput.xShapePropSet, u"FillStyle"_ustr) && mAny.get<FillStyle>() != FillStyle_NONE - && GetProperty(rXShapePropSet, u"FillColor"_ustr)) + && GetProperty(rRunInput.xShapePropSet, u"FillColor"_ustr)) { ::Color aShapeFillColor(ColorTransparency, mAny.get<sal_uInt32>()); bIsTextBackgroundDark = aShapeFillColor.IsDark(); @@ -2778,10 +2788,10 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool WriteSolidFill(COL_BLACK); } - if (rXShapePropSet.is() && GetDocumentType() != DOCUMENT_DOCX) + if (rRunInput.xShapePropSet.is() && GetDocumentType() != DOCUMENT_DOCX) { mpFS->startElementNS(XML_a, XML_effectLst); - WriteTextGlowEffect(rXShapePropSet); + WriteTextGlowEffect(rRunInput.xShapePropSet); mpFS->endElementNS(XML_a, XML_effectLst); } } @@ -2861,7 +2871,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool XML_charset, charset ); } - if( bIsField ) + if (rRunInput.bIsField) { Reference< XTextField > rXTextField; if (GetProperty(rXPropSet, u"TextField"_ustr)) @@ -3141,7 +3151,17 @@ void DrawingML::WriteRun( const Reference< XTextRange >& rRun, Reference< XPropertySet > xPropSet( rRun, uno::UNO_QUERY ); - WriteRunProperties( xPropSet, bIsURLField, XML_rPr, true, rbOverridingCharHeight, rnCharHeight, GetScriptType(sText), rXShapePropSet); + WriteRunInput aInput; + aInput.bIsField = bIsURLField; + aInput.bCheckDirect = true; + aInput.nScriptType = GetScriptType(sText); + aInput.xShapePropSet = rXShapePropSet; + aInput.bOverridingCharHeight = rbOverridingCharHeight; + aInput.nCharHeight = rnCharHeight; + WriteRunProperties(xPropSet, XML_rPr, aInput); + rbOverridingCharHeight = aInput.bOverridingCharHeight; + rnCharHeight = aInput.nCharHeight; + mpFS->startElementNS(XML_a, XML_t); mpFS->writeEscaped( sText ); mpFS->endElementNS( XML_a, XML_t ); @@ -3717,8 +3737,17 @@ void DrawingML::WriteLstStyle(const css::uno::Reference<css::text::XTextContent> if( !WriteParagraphProperties(rParagraph, fFirstCharHeight, nElement) ) mpFS->startElementNS(XML_a, nElement); - WriteRunProperties(xFirstRunPropSet, false, XML_defRPr, true, rbOverridingCharHeight, - rnCharHeight, GetScriptType(rRun->getString()), rXShapePropSet); + + WriteRunInput aInput; + aInput.bCheckDirect = true; + aInput.nScriptType = GetScriptType(rRun->getString()); + aInput.xShapePropSet = rXShapePropSet; + aInput.bOverridingCharHeight = rbOverridingCharHeight; + aInput.nCharHeight = rnCharHeight; + WriteRunProperties(xFirstRunPropSet, XML_defRPr, aInput); + rbOverridingCharHeight = aInput.bOverridingCharHeight; + rnCharHeight = aInput.nCharHeight; + mpFS->endElementNS(XML_a, nElement); } } @@ -3861,9 +3890,14 @@ void DrawingML::WriteParagraph( const Reference< XTextContent >& rParagraph, } } Reference< XPropertySet > rXPropSet( rParagraph, UNO_QUERY ); - sal_Int16 nDummy = -1; - WriteRunProperties(rXPropSet, false, XML_endParaRPr, false, rbOverridingCharHeight, - rnCharHeight, nDummy, rXShapePropSet); + + WriteRunInput aInput; + aInput.xShapePropSet = rXShapePropSet; + aInput.bOverridingCharHeight = rbOverridingCharHeight; + aInput.nCharHeight = rnCharHeight; + WriteRunProperties(rXPropSet, XML_endParaRPr, aInput); + rbOverridingCharHeight = aInput.bOverridingCharHeight; + rnCharHeight = aInput.nCharHeight; mpFS->endElementNS( XML_a, XML_p ); } @@ -4564,9 +4598,15 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo { mpFS->startElementNS(XML_a, XML_p); WriteParagraphProperties(xParagraph, nCharHeight, XML_pPr); - sal_Int16 nDummy = -1; - WriteRunProperties(rXPropSet, false, XML_endParaRPr, false, - bOverridingCharHeight, nCharHeight, nDummy, rXPropSet); + + WriteRunInput aInput; + aInput.xShapePropSet = rXPropSet; + aInput.bOverridingCharHeight = bOverridingCharHeight; + aInput.nCharHeight = nCharHeight; + WriteRunProperties(rXPropSet, XML_endParaRPr, aInput); + bOverridingCharHeight = aInput.bOverridingCharHeight; + nCharHeight = aInput.nCharHeight; + mpFS->endElementNS(XML_a, XML_p); } return; diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 4da8fc442536..2336a620889d 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -30,6 +30,7 @@ BlackDay BlockIncrement Border BorderColor +BorderComplexColor BorderDashName BorderStyle BorderTransparency @@ -108,6 +109,7 @@ Color ColumnGrand ColumnLabelRanges CompileEnglish +ComplexColor ConditionalFormat ConnectBars ContainsHeader @@ -317,6 +319,7 @@ Japanese Keys Label LabelBorderColor +LabelBorderComplexColor LabelBorderStyle LabelBorderWidth LabelPlacement @@ -326,6 +329,7 @@ LabelFillBackground LabelFillHatchName LabelFillStyle LabelFillColor +LabelFillComplexColor CustomLabelFields LayoutInfo LeftBorder
