[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source oox/source
chart2/source/view/main/DataTableView.cxx | 11 +-- oox/source/drawingml/chart/objectformatter.cxx |2 +- 2 files changed, 10 insertions(+), 3 deletions(-) New commits: commit 666d45bf909c0f021f490c8edec7a74280e5be77 Author: Tomaž Vajngerl AuthorDate: Wed Aug 17 23:22:41 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 25 13:09:43 2022 +0200 chart2: convert the fill color only when style is "solid" The CharBackColor should only be set when the fill style has the value "FillStyle_SOLID", otherwise don't set it as we can't handle any other fill style. Change-Id: Icaec8996d47966bb32bd8cf88b8c5aad70ab07a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138462 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit e425ee936ee762825a20cd10e6027163eab747a2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138794 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index ab4c224ddf18..080b04cf919f 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -143,8 +144,14 @@ void DataTableView::setCellCharAndParagraphProperties( copyProperty(xPropertySet, xDataTableProperties, "CharWeightComplex"); copyProperty(xPropertySet, xDataTableProperties, "CharWordMode"); -xPropertySet->setPropertyValue("CharBackColor", - xDataTableProperties->getPropertyValue("FillColor")); +drawing::FillStyle eFillStyle = drawing::FillStyle_NONE; +xDataTableProperties->getPropertyValue("FillStyle") >>= eFillStyle; +if (eFillStyle == drawing::FillStyle_SOLID) +{ +sal_Int32 aColor = 0; +if (xDataTableProperties->getPropertyValue("FillColor") >>= aColor) +xPropertySet->setPropertyValue("CharBackColor", uno::Any(aColor)); +} xPropertySet->setPropertyValue("ParaAdjust", uno::makeAny(style::ParagraphAdjust_CENTER)); } commit e79e0195b824e05052bbdf27b42b110d01644529 Author: Tomaž Vajngerl AuthorDate: Wed Aug 17 23:20:58 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 25 13:09:31 2022 +0200 oox: set fill properties correctly for the data table at import Change-Id: Ia108c5b67e85ba770bd84d90ad1d3dd27046b245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138461 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 3115a9f3a903f14a71003f51dc30eed824ea92fb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138793 Tested-by: Jenkins CollaboraOffice diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index d02a8d8644e2..40fe87b49447 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -554,7 +554,7 @@ const ObjectTypeFormatEntry spObjTypeFormatEntries[] = TYPEFORMAT_LINE( OBJECTTYPE_HILOLINE, saLinearPropInfo, nullptr, spOtherLines ), TYPEFORMAT_FRAME( OBJECTTYPE_UPBAR, saCommonPropInfo, nullptr, spUpDownBarLines,spUpBarFills ), TYPEFORMAT_FRAME( OBJECTTYPE_DOWNBAR,saCommonPropInfo, nullptr, spUpDownBarLines,spDownBarFills ), -TYPEFORMAT_LINE( OBJECTTYPE_DATATABLE, saCommonPropInfo, spOtherTexts, spDataTableLines ) +TYPEFORMAT_FRAME( OBJECTTYPE_DATATABLE, saCommonPropInfo, spOtherTexts, spDataTableLines, nullptr ) }; #undef TYPEFORMAT_FRAME
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source oox/source
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 AuthorDate: Mon May 23 15:50:59 2022 +0900 Commit: Tomaž Vajngerl 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 (cherry picked from commit 89c7f5c5a8898ee2dcb0c738e8ce026e5b238ea5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138491 Tested-by: Jenkins CollaboraOffice 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 AuthorDate: Sat May 21 10:52:51 2022 +0900 Commit: Tomaž Vajngerl 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 (cherry picked from commit 6c2ae836aa6125e995f86985557c006c837a19bd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138490 Tested-by: Tomaž Vajngerl 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 @@ -60,11 +59,70 @@ void setTopCell(uno::Reference& xPropertySet) xPropertySet->setPropertyValue("TopBorder", uno::makeAny(aBorderLine)); xPropertySet->setPropertyValue("LeftBorder", uno::makeAny(aBorderLine)); } + +void copyProperty(uno::Reference& xOut, + uno::Reference& xIn, OUString const& sPropertyName) +{ +xOut->setPropertyValue(sPropertyName, xIn->getPropertyValue(sPropertyName)); +} } void DataTableView::setCellDefaults(uno::Reference& xPropertySet, bool bLeft, bool bTop, bool bRight, bool bBottom) { +uno::Reference 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");
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source oox/source
chart2/source/model/main/DataTable.cxx |4 +++- oox/source/export/chartexport.cxx | 29 ++--- 2 files changed, 21 insertions(+), 12 deletions(-) New commits: commit f8754bbe9bd1ee3f77980a99206958990e87853f Author: Tomaž Vajngerl AuthorDate: Sat May 21 10:51:55 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 10:53:49 2022 +0200 chart2: add char properties to the DataTable model Change-Id: Ie4b49f36def7d20f89695157c3b95e6ee5d16d83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137407 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 50c480bc1f68bc681fe369e0cb002a8f5b51843a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138489 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/model/main/DataTable.cxx b/chart2/source/model/main/DataTable.cxx index aa2d27a6a619..18c61d305eb3 100644 --- a/chart2/source/model/main/DataTable.cxx +++ b/chart2/source/model/main/DataTable.cxx @@ -94,6 +94,7 @@ private: lcl_AddPropertiesToVector(aProperties); ::chart::LinePropertiesHelper::AddPropertiesToVector(aProperties); ::chart::FillProperties::AddPropertiesToVector(aProperties); +::chart::CharacterProperties::AddPropertiesToVector(aProperties); std::sort(aProperties.begin(), aProperties.end(), ::chart::PropertyNameLess()); return comphelper::containerToSequence(aProperties); @@ -229,7 +230,8 @@ sal_Bool SAL_CALL DataTable::supportsService(const OUString& rServiceName) uno::Sequence SAL_CALL DataTable::getSupportedServiceNames() { return { "com.sun.star.chart2.DataTable", "com.sun.star.beans.PropertySet", - "com.sun.star.drawing.FillProperties", "com.sun.star.drawing.LineProperties" }; + "com.sun.star.drawing.FillProperties", "com.sun.star.drawing.LineProperties", + "com.sun.star.style.CharacterProperties" }; } IMPLEMENT_FORWARD_XINTERFACE2(DataTable, DataTable_Base, ::property::OPropertySet) commit 619a42af1d3c004072a7e34df781ac386b955c2a Author: Tomaž Vajngerl AuthorDate: Sat May 21 00:00:30 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 10:53:41 2022 +0200 oox export: add export of basic properties of a data table Change-Id: I2c8b76125fc788a9e4df164171d6cbd351bc1c4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137406 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 5b1a8f39ee58fe5372eea18ce1ee99c95b11ba05) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138488 Tested-by: Jenkins CollaboraOffice diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 491211bd1999..d7c768b09303 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1733,6 +1733,7 @@ void ChartExport::exportPlotArea(const Reference< css::chart::XChartDocument >& } //Axis Data exportAxes( ); + // Data Table exportDataTable(); @@ -2034,35 +2035,41 @@ void ChartExport::exportGradientFill( const Reference< XPropertySet >& xPropSet void ChartExport::exportDataTable( ) { +auto xDataTable = mxNewDiagram->getDataTable(); +if (!xDataTable.is()) +return; + FSHelperPtr pFS = GetFS(); -Reference< beans::XPropertySet > aPropSet( mxDiagram, uno::UNO_QUERY ); +uno::Reference aPropSet(xDataTable, uno::UNO_QUERY); bool bShowVBorder = false; bool bShowHBorder = false; bool bShowOutline = false; +bool bShowKeys = false; -if (GetProperty( aPropSet, "DataTableHBorder")) +if (GetProperty(aPropSet, "HBorder")) mAny >>= bShowHBorder; -if (GetProperty( aPropSet, "DataTableVBorder")) +if (GetProperty(aPropSet, "VBorder")) mAny >>= bShowVBorder; -if (GetProperty( aPropSet, "DataTableOutline")) +if (GetProperty(aPropSet, "Outline")) +mAny >>= bShowOutline; +if (GetProperty(aPropSet, "Keys")) mAny >>= bShowOutline; - -if (!(bShowVBorder || bShowHBorder || bShowOutline)) -return; pFS->startElement(FSNS(XML_c, XML_dTable)); + if (bShowHBorder) -pFS->singleElement( FSNS( XML_c, XML_showHorzBorder ), -XML_val, "1" ); +pFS->singleElement(FSNS(XML_c, XML_showHorzBorder), XML_val, "1" ); if (bShowVBorder) pFS->singleElement(FSNS(XML_c, XML_showVertBorder), XML_val, "1"); if (bShowOutline) pFS->singleElement(FSNS(XML_c, XML_showOutline), XML_val, "1"); +if (bShowKeys) +pFS->singleElement(FSNS(XML_c, XML_showKeys), XML_val, "1"); -pFS->endElement( FSNS( XML_c, XML_dTable)); - +pFS->endElement(FSNS(XML_c, XML_dTable)); } + void ChartExport::exportAreaChart( const Reference< chart2::XChartType >& xChartType ) { FSHelperPtr pFS = GetFS();
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source oox/source
chart2/source/model/inc/Diagram.hxx|2 + chart2/source/view/axes/VAxisProperties.cxx|8 +++- chart2/source/view/axes/VAxisProperties.hxx|7 ++- chart2/source/view/axes/VCartesianCoordinateSystem.cxx |7 +++ chart2/source/view/axes/VPolarCoordinateSystem.cxx |9 - oox/source/drawingml/chart/datatableconverter.cxx | 30 + oox/source/drawingml/chart/plotareaconverter.cxx |7 ++- oox/source/token/properties.txt|7 ++- 8 files changed, 59 insertions(+), 18 deletions(-) New commits: commit d1e1ee1fafc179ccb45ba8be5b54359ed112b16f Author: Tomaž Vajngerl AuthorDate: Mon May 16 16:10:02 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Wed Aug 17 14:00:01 2022 +0200 chart2: add DataTable to AxisProperties, take account at rendering The Diagram model has the DataTable class, but now we need to take this into account at rendering. First add the DataTable to AxisProperties, to decide if the data table should be rendered or not. Change-Id: Ia18fcffccc632e4d36011544066072ae3cdfbfc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137152 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit 6b481f8bb44a14ebbfe010476cf2ca3728e7d539) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138404 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/model/inc/Diagram.hxx b/chart2/source/model/inc/Diagram.hxx index 2f207d3fad70..b59e0e38f78a 100644 --- a/chart2/source/model/inc/Diagram.hxx +++ b/chart2/source/model/inc/Diagram.hxx @@ -144,6 +144,7 @@ private: virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override; +public: void setDataTable(const rtl::Reference<::chart::DataTable>& xNewDataTable); rtl::Reference<::chart::DataTable> const& getDataTableRef() const @@ -151,6 +152,7 @@ private: return m_xDataTable; }; +private: // XModifyListener virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override; diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index 44a41422eee1..48cc3569f46d 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -153,7 +153,8 @@ TickmarkProperties AxisProperties::getBiggestTickmarkProperties() } AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel - , ExplicitCategoriesProvider* pExplicitCategoriesProvider ) + , ExplicitCategoriesProvider* pExplicitCategoriesProvider + , rtl::Reference<::chart::DataTable> const& xDataTableModel) : m_xAxisModel(xAxisModel) , m_nDimensionIndex(0) , m_bIsMainAxis(true) @@ -173,6 +174,7 @@ AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel , m_bComplexCategories(false) , m_pExplicitCategoriesProvider(pExplicitCategoriesProvider) , m_bLimitSpaceForLabels(false) +, m_xDataTableModel(xDataTableModel) { } @@ -257,7 +259,9 @@ void AxisProperties::init( bool bCartesian ) if( bCartesian ) { if (m_nDimensionIndex == 0) -m_bDisplayDataTable = false; +{ +m_bDisplayDataTable = m_xDataTableModel.is(); +} if( m_nDimensionIndex == 0 && m_nAxisType == AxisType::CATEGORY && m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() ) diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx index bf159053c3c5..425792da689b 100644 --- a/chart2/source/view/axes/VAxisProperties.hxx +++ b/chart2/source/view/axes/VAxisProperties.hxx @@ -20,6 +20,7 @@ #include "TickmarkProperties.hxx" #include +#include #include #include @@ -137,10 +138,12 @@ struct AxisProperties final boolm_bLimitSpaceForLabels; -//methods: +rtl::Reference<::chart::DataTable> m_xDataTableModel; +//methods: AxisProperties( const css::uno::Reference< css::chart2::XAxis >& xAxisModel - , ExplicitCategoriesProvider* pExplicitCategoriesProvider ); + , ExplicitCategoriesProvider* pExplicitCategoriesProvider + , rtl::Reference<::chart::DataTable> const& xDataTableModel); void init(bool bCartesian=false);//init from model data (m_xAxisModel) diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx index 19f3ddb93bf3..d3c71361f27c 100644 --- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx +++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx @@ -21,9 +21,11 @@ #include