chart2/source/view/main/DataTableView.cxx | 60 +++++++++++++++++++++++++++++- oox/source/export/chartexport.cxx | 3 + 2 files changed, 62 insertions(+), 1 deletion(-)
New commits: commit 264f0e8e793b09d86a02de4709a91dbb069f587a Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Mon May 23 15:50:59 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Fri Aug 19 10:54:23 2022 +0200 oox export: export line/fill and text props. of a data table Change-Id: I02a4c35693b599578e073d52a2d22ad59bc31786 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137409 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 89c7f5c5a8898ee2dcb0c738e8ce026e5b238ea5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138491 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index d7c768b09303..11c4557c75c4 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2067,6 +2067,9 @@ void ChartExport::exportDataTable( ) if (bShowKeys) pFS->singleElement(FSNS(XML_c, XML_showKeys), XML_val, "1"); + exportShapeProps(aPropSet); + exportTextProps(aPropSet); + pFS->endElement(FSNS(XML_c, XML_dTable)); } commit 8e6f139d03468baac27d647c6f5813536c998c6e Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat May 21 10:52:51 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Fri Aug 19 10:54:11 2022 +0200 chart2: set the char props. to the cells of a data table from model This copies the char. properties from the model to the cells of a data table, so the correct char width, font is used for text when the table is rendered. Also add margin to the text, so it looks better. Change-Id: Ib74a8136459a31d64a86dec36a6ba14d2c313cf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137408 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 6c2ae836aa6125e995f86985557c006c837a19bd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138490 Tested-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 729f034038d8..f7a1fe4a0bb8 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -5,7 +5,6 @@ * 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/. - * */ #include <DataTableView.hxx> @@ -60,11 +59,70 @@ void setTopCell(uno::Reference<beans::XPropertySet>& xPropertySet) xPropertySet->setPropertyValue("TopBorder", uno::makeAny(aBorderLine)); xPropertySet->setPropertyValue("LeftBorder", uno::makeAny(aBorderLine)); } + +void copyProperty(uno::Reference<beans::XPropertySet>& xOut, + uno::Reference<beans::XPropertySet>& xIn, OUString const& sPropertyName) +{ + xOut->setPropertyValue(sPropertyName, xIn->getPropertyValue(sPropertyName)); +} } void DataTableView::setCellDefaults(uno::Reference<beans::XPropertySet>& xPropertySet, bool bLeft, bool bTop, bool bRight, bool bBottom) { + uno::Reference<beans::XPropertySet> xDataTableProperties(m_xDataTableModel); + + copyProperty(xPropertySet, xDataTableProperties, "CharColor"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontFamily"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontFamilyAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontFamilyComplex"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontCharSet"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontCharSetAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontCharSetComplex"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontName"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontNameAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontNameComplex"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontPitch"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontPitchAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontPitchComplex"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontStyleName"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontStyleNameAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharFontStyleNameComplex"); + + copyProperty(xPropertySet, xDataTableProperties, "CharHeight"); + copyProperty(xPropertySet, xDataTableProperties, "CharHeightAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharHeightComplex"); + copyProperty(xPropertySet, xDataTableProperties, "CharKerning"); + copyProperty(xPropertySet, xDataTableProperties, "CharLocale"); + copyProperty(xPropertySet, xDataTableProperties, "CharLocaleAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharLocaleComplex"); + copyProperty(xPropertySet, xDataTableProperties, "CharPosture"); + copyProperty(xPropertySet, xDataTableProperties, "CharPostureAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharPostureComplex"); + copyProperty(xPropertySet, xDataTableProperties, "CharRelief"); + copyProperty(xPropertySet, xDataTableProperties, "CharShadowed"); + copyProperty(xPropertySet, xDataTableProperties, "CharStrikeout"); + copyProperty(xPropertySet, xDataTableProperties, "CharUnderline"); + copyProperty(xPropertySet, xDataTableProperties, "CharUnderlineColor"); + copyProperty(xPropertySet, xDataTableProperties, "CharUnderlineHasColor"); + copyProperty(xPropertySet, xDataTableProperties, "CharOverline"); + copyProperty(xPropertySet, xDataTableProperties, "CharOverlineColor"); + copyProperty(xPropertySet, xDataTableProperties, "CharOverlineHasColor"); + copyProperty(xPropertySet, xDataTableProperties, "CharWeight"); + copyProperty(xPropertySet, xDataTableProperties, "CharWeightAsian"); + copyProperty(xPropertySet, xDataTableProperties, "CharWeightComplex"); + copyProperty(xPropertySet, xDataTableProperties, "CharWordMode"); + + float fFontHeight = 0.0; + xDataTableProperties->getPropertyValue("CharHeight") >>= fFontHeight; + fFontHeight = o3tl::convert(fFontHeight, o3tl::Length::pt, o3tl::Length::mm100); + uno::Any aXDistanceAny(sal_Int32(std::round(fFontHeight * 0.18f))); + uno::Any aYDistanceAny(sal_Int32(std::round(fFontHeight * 0.30f))); + xPropertySet->setPropertyValue("TextLeftDistance", aXDistanceAny); + xPropertySet->setPropertyValue("TextRightDistance", aXDistanceAny); + xPropertySet->setPropertyValue("TextUpperDistance", aYDistanceAny); + xPropertySet->setPropertyValue("TextLowerDistance", aYDistanceAny); + xPropertySet->setPropertyValue("FillColor", uno::makeAny(Color(0xFFFFFF))); xPropertySet->setPropertyValue("TextVerticalAdjust", uno::makeAny(drawing::TextVerticalAdjust_TOP));