[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' - chart2/inc chart2/source
chart2/inc/strings.hrc|3 +-- chart2/source/controller/dialogs/ObjectNameProvider.cxx |2 +- chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |2 +- chart2/source/controller/main/ChartController_Insert.cxx |6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) New commits: commit 4b4eec2245d8c7dd0052abc80def0fbbc780d59d Author: Tomaž Vajngerl AuthorDate: Tue Aug 16 16:44:55 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 25 13:06:03 2022 +0200 chart2: use only one "Data Table" string to simplify translation Change-Id: Idff337523a66195277b364be474baffcebca26aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138369 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 66faff4d3c9756e4a83933a07e2f9329ede9e043) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138792 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc index 9a9943df1f3c..a60da15e0004 100644 --- a/chart2/inc/strings.hrc +++ b/chart2/inc/strings.hrc @@ -48,7 +48,6 @@ #define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance") #define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination") #define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography") -#define STR_PAGE_DATA_TABLE NC_("STR_PAGE_DATA_TABLE", "Data Table") #define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION") #define STR_OBJECT_AXIS NC_("STR_OBJECT_AXIS", "Axis") #define STR_OBJECT_AXIS_X NC_("STR_OBJECT_AXIS_X", "X Axis") @@ -98,7 +97,6 @@ #define STR_OBJECT_DIAGRAM_WALL NC_("STR_OBJECT_DIAGRAM_WALL", "Chart Wall") #define STR_OBJECT_DIAGRAM_FLOOR NC_("STR_OBJECT_DIAGRAM_FLOOR", "Chart Floor") #define STR_OBJECT_SHAPENC_("STR_OBJECT_SHAPE", "Drawing Object") -#define STR_OBJECT_DATA_TABLE NC_("STR_OBJECT_DATA_TABLE", "Data Table") #define STR_TIP_DATASERIES NC_("STR_TIP_DATASERIES", "Data Series '%SERIESNAME'") #define STR_TIP_DATAPOINT_INDEX NC_("STR_TIP_DATAPOINT_INDEX", "Data Point %POINTNUMBER") #define STR_TIP_DATAPOINT_VALUES NC_("STR_TIP_DATAPOINT_VALUES", "Values: %POINTVALUES") @@ -147,6 +145,7 @@ #define STR_TEXT_DIRECTION_SUPER NC_("STR_TEXT_DIRECTION_SUPER", "Use superordinate object settings") #define STR_PROPERTY_ROLE_FILLCOLOR NC_("STR_PROPERTY_ROLE_FILLCOLOR", "Fill Color") #define STR_PROPERTY_ROLE_BORDERCOLOR NC_("STR_PROPERTY_ROLE_BORDERCOLOR", "Border Color") +#define STR_DATA_TABLE NC_("STR_DATA_TABLE", "Data Table") #define STR_CONTROLTEXT_ERROR_BARS_FROM_DATA NC_("STR_CONTROLTEXT_ERROR_BARS_FROM_DATA", "From Data Table") #define STR_REGRESSION_LINEAR NC_("STR_REGRESSION_LINEAR", "Linear") diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 20bdfa518a15..70e4a69d2e50 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -311,7 +311,7 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural ) aRet=SchResId(STR_OBJECT_CURVE_EQUATION); break; case OBJECTTYPE_DATA_TABLE: -aRet=SchResId(STR_OBJECT_DATA_TABLE); +aRet=SchResId(STR_DATA_TABLE); break; default: //OBJECTTYPE_UNKNOWN ; diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index ce31b540b437..e86f7ac90596 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -455,7 +455,7 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent, // nothing break; case OBJECTTYPE_DATA_TABLE: -AddTabPage("datatable", SchResId(STR_PAGE_DATA_TABLE), DataTableTabPage::Create); +AddTabPage("datatable", SchResId(STR_DATA_TABLE), DataTableTabPage::Create); AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE); AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA); AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME); diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/view/main/SeriesPlotterContainer.cxx |6 ++ chart2/source/view/main/SeriesPlotterContainer.hxx |1 + 2 files changed, 7 insertions(+) New commits: commit 073df6cd47f14f8401c158336b8440187008a9e6 Author: Tomaž Vajngerl AuthorDate: Sat Aug 13 23:29:01 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 25 07:28:50 2022 +0200 chart2: for a data table we need to force shift category position To be able to show the data table correctly we need to always show the categories "between tick marks" as otherwise the table columns wouldn't align correctly. This forces that the shift position is always enabled. Change-Id: Ia6a627931fcaba64f0f974faf1d8763405ad410d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138337 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit d50bfb406900ddea3a4b2e0c59e0b983798780d4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138784 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx index b72d2f1bba42..ca1044d11046 100644 --- a/chart2/source/view/main/SeriesPlotterContainer.cxx +++ b/chart2/source/view/main/SeriesPlotterContainer.cxx @@ -167,6 +167,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart DBG_UNHANDLED_EXCEPTION("chart2"); } +if (xDiagram->getDataTable().is()) +m_bForceShiftPosition = true; + //prepare for autoscaling and shape creation // - create plotter for charttypes (for each first scale group at each plotter, as they are independent) // - add series to plotter (thus each charttype can provide minimum and maximum values for autoscaling) @@ -354,6 +357,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart bool SeriesPlotterContainer::isCategoryPositionShifted(const chart2::ScaleData& rSourceScale, bool bHasComplexCategories) { +if (m_bForceShiftPosition) +return true; + if (rSourceScale.AxisType == AxisType::CATEGORY) return bHasComplexCategories || rSourceScale.ShiftedCategoryPosition || m_bChartTypeUsesShiftedCategoryPositionPerDefault; diff --git a/chart2/source/view/main/SeriesPlotterContainer.hxx b/chart2/source/view/main/SeriesPlotterContainer.hxx index ccecac059027..64ab89583aee 100644 --- a/chart2/source/view/main/SeriesPlotterContainer.hxx +++ b/chart2/source/view/main/SeriesPlotterContainer.hxx @@ -156,6 +156,7 @@ private: sal_Int32 m_nMaxAxisIndex; bool m_bChartTypeUsesShiftedCategoryPositionPerDefault; +bool m_bForceShiftPosition = false; sal_Int32 m_nDefaultDateNumberFormat; };
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source
chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx |1 chart2/source/view/axes/VAxisProperties.cxx | 13 ++ chart2/source/view/axes/VAxisProperties.hxx |3 chart2/source/view/axes/VCartesianAxis.cxx| 72 -- chart2/source/view/axes/VCartesianAxis.hxx|2 chart2/source/view/inc/DataTableView.hxx |9 + chart2/source/view/main/DataTableView.cxx | 70 + 7 files changed, 119 insertions(+), 51 deletions(-) New commits: commit 387e01bb088c958a4dbc3eec5bb98bf655b48ccb Author: Tomaž Vajngerl AuthorDate: Sat Aug 13 14:14:00 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 25 07:28:35 2022 +0200 chart2: support data table rendering when the X axis is swapped In case when the X axis is swapped, so the Y axis is rendered in the place of X axis, we need to render the data table below the Y-axis labels. This is best done to put the data table into the Y-axis instead, so we get the correct size and position of the data table, and then just allow rendering of the axis labels and (re)position the table below Y-axis. Change-Id: I74aa79402a5638133b0d1ed83bbd8aad6f6c9d1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138336 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit addcd016bf1bed16299697fd18b8f9b1faf2cf3f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138783 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index 48cc3569f46d..0cbf487453f5 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -258,7 +258,7 @@ void AxisProperties::init( bool bCartesian ) if( bCartesian ) { -if (m_nDimensionIndex == 0) +if ((!m_bSwapXAndY && m_nDimensionIndex == 0) || (m_bSwapXAndY && m_nDimensionIndex == 1)) { m_bDisplayDataTable = m_xDataTableModel.is(); } @@ -333,6 +333,17 @@ void AxisProperties::init( bool bCartesian ) { TOOLS_WARN_EXCEPTION("chart2", "" ); } + +if (m_bDisplayDataTable) +{ +m_bDataTableAlignAxisValuesWithColumns = (m_nDimensionIndex == 0); + +if (m_nDimensionIndex == 0) +{ +m_bDisplayLabels = false; +} + +} } AxisLabelProperties::AxisLabelProperties() diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx index 425792da689b..15f9da910e5d 100644 --- a/chart2/source/view/axes/VAxisProperties.hxx +++ b/chart2/source/view/axes/VAxisProperties.hxx @@ -109,7 +109,10 @@ struct AxisProperties final AxisLabelAlignment maLabelAlignment; +// Data table bool m_bDisplayDataTable; +bool m_bDataTableAlignAxisValuesWithColumns; + bool m_bDisplayLabels; // Compatibility option: starting from LibreOffice 5.1 the rotated diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 76884e8fc255..d5da1d3bf966 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1675,35 +1675,43 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel } } -void VCartesianAxis::createLabels() +void VCartesianAxis::createDataTableShape(std::unique_ptr const& rpTickFactory2D) { -if( !prepareShapeCreation() ) +// Check if we can create the data table shape +// Data table view and m_bDisplayDataTable must be true +if (!m_pDataTableView || !m_aAxisProperties.m_bDisplayDataTable) return; -std::unique_ptr apTickFactory2D(createTickFactory2D()); // throws on failure +m_pDataTableView->initializeShapes(m_xDataTableTarget); +basegfx::B2DVector aStart = rpTickFactory2D->getXaxisStartPos(); +basegfx::B2DVector aEnd = rpTickFactory2D->getXaxisEndPos(); -if (m_pDataTableView && m_aAxisProperties.m_bDisplayDataTable) -{ -m_pDataTableView->initializeShapes(m_xDataTableTarget); -basegfx::B2DVector aStart = apTickFactory2D->getXaxisStartPos(); -basegfx::B2DVector aEnd = apTickFactory2D->getXaxisEndPos(); +rpTickFactory2D->updateScreenValues(m_aAllTickInfos); -apTickFactory2D->updateScreenValues(m_aAllTickInfos); +sal_Int32 nDistance = -1; -sal_Int32 nDistance = -1; +std::unique_ptr apTickIter(createLabelTickIterator(0)); +if (apTickIter) +{ +nDistance = TickFactory2D::getTickScreenDistance(*apTickIter); +if (getTextLevelCount() > 1) +nDistance *= 2; +} -std::unique_ptr apTickIter(createLabelTickIterator(0)); -if (apTickIter) -{ -nDistance = TickFactory2D::getTickScreenDistance(*apTickIter); -if
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/controller/inc/DataTableItemConverter.hxx|3 +-- chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx |6 ++ chart2/source/controller/main/ChartController_Properties.cxx |6 +- 3 files changed, 4 insertions(+), 11 deletions(-) New commits: commit 4d406ce5f7ca5fe5c40324d83cc4898fa4646437 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 23:21:34 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 25 07:27:49 2022 +0200 chart2: don't use ref-size property when converting data table Change-Id: I4dd93d84879274721ded01be1a47b62487066b4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138334 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit fc909263a1bb9326f838326f3299b16b80318f42) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138781 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/controller/inc/DataTableItemConverter.hxx b/chart2/source/controller/inc/DataTableItemConverter.hxx index 5a8f86bc39ec..d5e0eb0df0cf 100644 --- a/chart2/source/controller/inc/DataTableItemConverter.hxx +++ b/chart2/source/controller/inc/DataTableItemConverter.hxx @@ -37,8 +37,7 @@ public: DataTableItemConverter( const css::uno::Reference& rPropertySet, SfxItemPool& rItemPool, SdrModel& rDrawModel, -css::uno::Reference const& xNamedPropertyContainerFactory, -const css::awt::Size* pRefSize); +css::uno::Reference const& xNamedPropertyContainerFactory); virtual ~DataTableItemConverter() override; diff --git a/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx index 693f67b593c9..d02517e55857 100644 --- a/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx @@ -50,14 +50,12 @@ ItemPropertyMapType& lclDataTablePropertyMap() DataTableItemConverter::DataTableItemConverter( const uno::Reference& rPropertySet, SfxItemPool& rItemPool, -SdrModel& rDrawModel, uno::Reference const& xFactory, -const awt::Size* pRefSize) +SdrModel& rDrawModel, uno::Reference const& xFactory) : ItemConverter(rPropertySet, rItemPool) { m_aConverters.emplace_back(new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xFactory, GraphicObjectType::LineProperties)); -m_aConverters.emplace_back( -new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize")); +m_aConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool)); } DataTableItemConverter::~DataTableItemConverter() = default; diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index 69e1a2dd7d62..0967cc47af68 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -290,13 +290,9 @@ wrapper::ItemConverter* createItemConverter( break; case OBJECTTYPE_DATA_TABLE: { -std::unique_ptr pRefSize; -if (pRefSizeProvider) -pRefSize.reset(new awt::Size(pRefSizeProvider->getPageSize())); - pItemConverter = new wrapper::DataTableItemConverter( xObjectProperties, rDrawModel.GetItemPool(), -rDrawModel, uno::Reference(xChartModel, uno::UNO_QUERY), pRefSize.get()); +rDrawModel, uno::Reference(xChartModel, uno::UNO_QUERY)); } break; default: //OBJECTTYPE_UNKNOWN
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/view/main/DataTableView.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 4f548157e44ccbf91a5662ba3cfd0870759384df Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 17:36:23 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 25 07:27:32 2022 +0200 chart2: use the FillColor property as CharBackColor For chart data table, the fill is always setting the char background (highlight). As we don't support other fill types in LibreOffice for the char background, we can't set anything else when rendering. We need to extend editeng and UNO API with the support for this. Change-Id: I47d342e02ad2347bac0515a62cc0de4391f98150 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138331 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 65021c6acc655b61cbba74d01829beb1c4181c97) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138780 Tested-by: Tomaž Vajngerl diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index e7f577f04af3..e8de2ff0846c 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -140,6 +140,9 @@ void DataTableView::setCellCharAndParagraphProperties( copyProperty(xPropertySet, xDataTableProperties, "CharWeightComplex"); copyProperty(xPropertySet, xDataTableProperties, "CharWordMode"); +xPropertySet->setPropertyValue("CharBackColor", + xDataTableProperties->getPropertyValue("FillColor")); + xPropertySet->setPropertyValue("ParaAdjust", uno::makeAny(style::ParagraphAdjust_CENTER)); }
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source
chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |1 chart2/source/view/main/DataTableView.cxx | 58 ++ 2 files changed, 44 insertions(+), 15 deletions(-) New commits: commit 25cf1afd485d6ff7a7278aa2260082596ca4d0f7 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 17:29:36 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 24 22:49:09 2022 +0200 chart2: always set text props. of the first paragraph and not cell When setting the properties of the data table it is important to differentiate when we set the properties of the text of the (first and only) paragraph or set the properties for the current cell. In this chage we refactor the code so that we always set the text via UNO text::XText call for the current cell, and in the next step get the XPropertySet of the first paragraph and set the properties relevant for the text from the DataTable model. Change-Id: Ibe82b21c3416083cfe8e86b95443d77984da05f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138330 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 81a5f33101c18fb22a952b865c0c90418fd6a490) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138605 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index aa1e7adb9e77..e7f577f04af3 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -58,6 +58,29 @@ void copyProperty(uno::Reference& xOut, { xOut->setPropertyValue(sPropertyName, xIn->getPropertyValue(sPropertyName)); } + +uno::Reference getFirstParagraph(uno::Reference const& xText) +{ +uno::Reference xParagraph; +uno::Reference xEnumAccess(xText, uno::UNO_QUERY); +if (!xEnumAccess.is()) +return xParagraph; +uno::Reference xEnumeration(xEnumAccess->createEnumeration()); +xParagraph.set(xEnumeration->nextElement(), uno::UNO_QUERY); +return xParagraph; +} + +uno::Reference +getFirstParagraphProperties(uno::Reference const& xText) +{ +uno::Reference xPropertySet; +auto xParagraph = getFirstParagraph(xText); +if (!xParagraph.is()) +return xPropertySet; +xPropertySet.set(xParagraph, uno::UNO_QUERY); +return xPropertySet; +} + } // end anonymous namespace DataTableView::DataTableView(uno::Reference const& xChartDoc, @@ -67,8 +90,8 @@ DataTableView::DataTableView(uno::Reference const& xChar , m_xDataTableModel(rDataTableModel) , m_xComponentContext(rComponentContext) { -uno::Reference xProp(m_xDataTableModel); -m_aLineProperties.initFromPropertySet(xProp); +uno::Reference xPropertySet(m_xDataTableModel); +m_aLineProperties.initFromPropertySet(xPropertySet); } void DataTableView::setCellCharAndParagraphProperties( @@ -275,14 +298,18 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV uno::Reference xCellTextRange(xCell, uno::UNO_QUERY); if (xCellTextRange.is()) { -xCellTextRange->setString(rString); +auto xText = xCellTextRange->getText(); +xText->insertString(xText->getStart(), rString, false); +auto xTextPropertySet = getFirstParagraphProperties(xText); +if (!xTextPropertySet.is()) +continue; bool bLeft = (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); bool bRight = (bOutline && nColumn == nColumnCount) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +setCellCharAndParagraphProperties(xTextPropertySet); setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline); -setCellCharAndParagraphProperties(xPropertySet); } nColumn++; } @@ -321,17 +348,14 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV bool bTop = (bOutline && nRow == 1) || (bHBorder && nRow > 1 && nRow < nRowCount); bool bBottom = (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount); -setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom); auto xText = xCellTextRange->getText(); xText->insertString(xText->getStart(), rSeriesName, false); -uno::Reference xEnumAccess(xText, uno::UNO_QUERY); -uno::Reference xEnumeration(xEnumAccess->createEnumeration()); -uno::Reference xParagraph(xEnumeration->nextElement(), -uno::UNO_QUERY); -uno::Reference xTextPropertySet(xParagraph, uno::UNO_QUERY); - +auto xTextPropertySet = getFirstParagraphProperties(xText); +if (!xTextPropertySet.is()) +
[Libreoffice-commits] core.git: 2 commits - chart2/inc chart2/source sw/source
chart2/inc/strings.hrc|3 - chart2/source/controller/dialogs/ObjectNameProvider.cxx |2 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |2 chart2/source/controller/main/ChartController_Insert.cxx |6 +- sw/source/core/crsr/crstrvl.cxx |2 sw/source/core/crsr/pam.cxx |4 - sw/source/core/doc/DocumentContentOperationsManager.cxx | 16 ++--- sw/source/core/doc/docbm.cxx |4 - sw/source/core/doc/docedt.cxx |2 sw/source/core/doc/docglbl.cxx|4 - sw/source/core/doc/docsort.cxx|2 sw/source/core/doc/tblcpy.cxx |2 sw/source/core/docnode/nodes.cxx |2 sw/source/core/edit/edfmt.cxx |2 sw/source/core/frmedt/fecopy.cxx |2 sw/source/core/layout/sortedobjs.cxx |2 sw/source/core/table/swtable.cxx |2 sw/source/core/txtnode/modeltoviewhelper.cxx |6 +- sw/source/core/undo/undobj.cxx| 38 +++--- sw/source/core/unocore/unoobj2.cxx|4 - sw/source/core/unocore/unotext.cxx|2 sw/source/filter/html/htmltab.cxx |2 sw/source/filter/ww8/wrtww8.cxx |2 sw/source/filter/ww8/ww8par2.cxx |4 - 24 files changed, 58 insertions(+), 59 deletions(-) New commits: commit 66faff4d3c9756e4a83933a07e2f9329ede9e043 Author: Tomaž Vajngerl AuthorDate: Tue Aug 16 16:44:55 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 18 08:47:53 2022 +0200 chart2: use only one "Data Table" string to simplify translation Change-Id: Idff337523a66195277b364be474baffcebca26aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138369 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc index 9a9943df1f3c..a60da15e0004 100644 --- a/chart2/inc/strings.hrc +++ b/chart2/inc/strings.hrc @@ -48,7 +48,6 @@ #define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance") #define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination") #define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography") -#define STR_PAGE_DATA_TABLE NC_("STR_PAGE_DATA_TABLE", "Data Table") #define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION") #define STR_OBJECT_AXIS NC_("STR_OBJECT_AXIS", "Axis") #define STR_OBJECT_AXIS_X NC_("STR_OBJECT_AXIS_X", "X Axis") @@ -98,7 +97,6 @@ #define STR_OBJECT_DIAGRAM_WALL NC_("STR_OBJECT_DIAGRAM_WALL", "Chart Wall") #define STR_OBJECT_DIAGRAM_FLOOR NC_("STR_OBJECT_DIAGRAM_FLOOR", "Chart Floor") #define STR_OBJECT_SHAPENC_("STR_OBJECT_SHAPE", "Drawing Object") -#define STR_OBJECT_DATA_TABLE NC_("STR_OBJECT_DATA_TABLE", "Data Table") #define STR_TIP_DATASERIES NC_("STR_TIP_DATASERIES", "Data Series '%SERIESNAME'") #define STR_TIP_DATAPOINT_INDEX NC_("STR_TIP_DATAPOINT_INDEX", "Data Point %POINTNUMBER") #define STR_TIP_DATAPOINT_VALUES NC_("STR_TIP_DATAPOINT_VALUES", "Values: %POINTVALUES") @@ -147,6 +145,7 @@ #define STR_TEXT_DIRECTION_SUPER NC_("STR_TEXT_DIRECTION_SUPER", "Use superordinate object settings") #define STR_PROPERTY_ROLE_FILLCOLOR NC_("STR_PROPERTY_ROLE_FILLCOLOR", "Fill Color") #define STR_PROPERTY_ROLE_BORDERCOLOR NC_("STR_PROPERTY_ROLE_BORDERCOLOR", "Border Color") +#define STR_DATA_TABLE NC_("STR_DATA_TABLE", "Data Table") #define STR_CONTROLTEXT_ERROR_BARS_FROM_DATA NC_("STR_CONTROLTEXT_ERROR_BARS_FROM_DATA", "From Data Table") #define STR_REGRESSION_LINEAR NC_("STR_REGRESSION_LINEAR", "Linear") diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index b105ecc61211..84230ff14da7 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -315,7 +315,7 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural ) aRet=SchResId(STR_OBJECT_CURVE_EQUATION); break; case OBJECTTYPE_DATA_TABLE: -
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/view/main/DataTableView.cxx | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) New commits: commit 79b066055797b1f48aac3feccd86f1c8d21ca76d Author: Tomaž Vajngerl AuthorDate: Thu Aug 11 22:44:56 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 24 20:15:07 2022 +0200 chart2: render line legend symbols better in a data table Change-Id: I556b4f249688a3836bbeeb3f554cb9ecf1d31f65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138301 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit e4e5d77bcc30beb1d976fadf5da0247f00f5b9cc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138603 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 77d9943ab9ec..aa1e7adb9e77 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -288,17 +288,23 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV } // ROW HEADER -// Prepare keys +// Prepare keys (symbols) +sal_Int32 nMaxSymbolWidth = 0; if (bKeys) { -awt::Size aMaxSymbolExtent(300, 300); +uno::Reference xFactory(m_xChartModel, uno::UNO_QUERY); for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList) { if (pSeriesPlotter) { -uno::Reference xFactory(m_xChartModel, uno::UNO_QUERY); +sal_Int32 nSymbolWidth = 300; +if (pSeriesPlotter->getLegendSymbolStyle() == LegendSymbolStyle::Line) +nSymbolWidth = 600; + +nMaxSymbolWidth = std::max(nSymbolWidth, nMaxSymbolWidth); + std::vector aNewEntries = pSeriesPlotter->createSymbols( -aMaxSymbolExtent, m_xTarget, xFactory, m_xComponentContext); +{ nSymbolWidth, 300 }, m_xTarget, xFactory, m_xComponentContext); aSymbols.insert(aSymbols.end(), aNewEntries.begin(), aNewEntries.end()); } } @@ -330,7 +336,10 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV xCellPropertySet->setPropertyValue("ParaAdjust", uno::makeAny(style::ParagraphAdjust_LEFT)); if (bKeys) -xCellPropertySet->setPropertyValue("ParaLeftMargin", uno::makeAny(sal_Int32(500))); +{ +xCellPropertySet->setPropertyValue("ParaLeftMargin", + uno::makeAny(nMaxSymbolWidth + sal_Int32(200))); +} } nRow++; } @@ -379,6 +388,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV pTableObject->DistributeColumns(0, nColumnCount - 1, true, true); pTableObject->DistributeRows(0, nRowCount - 1, true, true); +xBroadcaster->lockBroadcasts(); uno::Reference xPropertySet(xTableColumns->getByIndex(0), uno::UNO_QUERY); sal_Int32 nWidth = 0; xPropertySet->getPropertyValue("Width") >>= nWidth; @@ -412,6 +422,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV nTotalHeight += nHeight; } } +xBroadcaster->unlockBroadcasts(); } void DataTableView::initializeShapes(const css::uno::Reference& xTarget)
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/view/main/DataTableView.cxx | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) New commits: commit 0ce3d7dd14e45bf239d55b63671aa416a0a91fc1 Author: Tomaž Vajngerl AuthorDate: Thu Aug 11 22:40:27 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 24 20:14:50 2022 +0200 chart2: fix rendering of table borders of row/column headers The row/column headers didn't enable/disable the table borders correctly when outline was enabled and horizontal and vertical borders properties were disabled. Change-Id: Ifcb059dd7d39890bbcaf55d3a68dce41eef586cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138300 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit 5dcfa8f3750d549d895246c50285bb38690f9734) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138602 diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 1fe3b191b878..77d9943ab9ec 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -265,6 +265,8 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV sal_Int32 nColumn; sal_Int32 nRow; +// COLUMN HEADER + nColumn = 1; for (auto const& rString : m_aXValues) { @@ -274,13 +276,19 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV if (xCellTextRange.is()) { xCellTextRange->setString(rString); -bool bLeft = bOutline || (bVBorder && nColumn > 1); -setCellProperties(xPropertySet, bLeft, bOutline, bOutline, bOutline); + +bool bLeft += (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +bool bRight = (bOutline && nColumn == nColumnCount) + || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline); setCellCharAndParagraphProperties(xPropertySet); } nColumn++; } +// ROW HEADER +// Prepare keys if (bKeys) { awt::Size aMaxSymbolExtent(300, 300); @@ -304,8 +312,10 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV uno::Reference xCellTextRange(xCell, uno::UNO_QUERY); if (xCellTextRange.is()) { -bool bTop = bOutline || (bHBorder && nRow > 1); -setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bOutline); +bool bTop = (bOutline && nRow == 1) || (bHBorder && nRow > 1 && nRow < nRowCount); +bool bBottom += (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount); +setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom); auto xText = xCellTextRange->getText(); xText->insertString(xText->getStart(), rSeriesName, false); @@ -325,6 +335,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV nRow++; } +// TABLE nRow = 1; for (auto const& rSeries : m_pDataSeriesValues) {
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/inc chart2/source include/svx svx/source
chart2/inc/ChartView.hxx |5 chart2/source/view/axes/VAxisBase.cxx |3 chart2/source/view/axes/VAxisBase.hxx |5 chart2/source/view/axes/VCartesianAxis.cxx |5 chart2/source/view/axes/VCartesianAxis.hxx |4 chart2/source/view/axes/VCartesianCoordinateSystem.cxx |5 chart2/source/view/axes/VCartesianCoordinateSystem.hxx |3 chart2/source/view/axes/VCoordinateSystem.cxx |3 chart2/source/view/axes/VPolarCoordinateSystem.cxx |3 chart2/source/view/axes/VPolarCoordinateSystem.hxx |3 chart2/source/view/charttypes/VSeriesPlotter.cxx | 142 + chart2/source/view/inc/DataTableView.hxx | 17 +- chart2/source/view/inc/LegendEntryProvider.hxx |9 + chart2/source/view/inc/VCoordinateSystem.hxx |4 chart2/source/view/inc/VSeriesPlotter.hxx | 15 + chart2/source/view/main/ChartView.cxx | 13 - chart2/source/view/main/DataTableView.cxx | 127 +++ include/svx/svdotable.hxx |2 svx/source/table/svdotable.cxx | 12 + 19 files changed, 328 insertions(+), 52 deletions(-) New commits: commit 45556e32ef38188e555a3dc565b4fb2ca74aa05c Author: Tomaž Vajngerl AuthorDate: Mon Jul 18 08:12:19 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 24 20:14:29 2022 +0200 chart2: Data table rendering of keys (legend symbols) Change-Id: Iff13b188df18fe8f9919274869774f53f2ea323b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138299 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit 9d6ffcc0572cc7917651489c69ca4b3452e89a89) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138585 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index 2830e89309f8..e489a2d7d68e 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -181,6 +181,8 @@ public: void setViewDirty(); +css::uno::Reference const& getComponentContext() { return m_xCC;} + /// See sfx2::XmlDump::dumpAsXml(). void dumpAsXml(xmlTextWriterPtr pWriter) const override; @@ -206,8 +208,7 @@ private: //methods private: //member ::osl::Mutex m_aMutex; -css::uno::Reference< css::uno::XComponentContext> -m_xCC; +css::uno::Reference< css::uno::XComponentContext> m_xCC; chart::ChartModel& mrChartModel; diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 209fc508f624..86f530a34a1f 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -247,7 +247,8 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter ) void VAxisBase::createDataTableView(std::vector>& /*rSeriesPlotterList*/, uno::Reference const& /*xNumberFormatsSupplier*/, -uno::Reference const& /*xChartDoc*/) +uno::Reference const& /*xChartDoc*/, +uno::Reference const& /*rComponentContext*/) { } diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx index 6992ff05fd89..e64df679d458 100644 --- a/chart2/source/view/axes/VAxisBase.hxx +++ b/chart2/source/view/axes/VAxisBase.hxx @@ -24,6 +24,7 @@ #include "Tickmarks.hxx" namespace com::sun::star::util { class XNumberFormatsSupplier; } +namespace com::sun::star::uno { class XComponentContext; } namespace chart { @@ -31,6 +32,7 @@ namespace chart class VSeriesPlotter; class DataTableView; class ChartModel; +class LegendEntryProvider; class VAxisBase : public VAxisOrGridBase { @@ -66,7 +68,8 @@ public: virtual void createDataTableView(std::vector>& rSeriesPlotterList, css::uno::Reference const& xNumberFormatsSupplier, - css::uno::Reference const& xChartDoc); + css::uno::Reference const& xChartDoc, + css::uno::Reference const& rComponentContext); std::shared_ptr getDataTableView() { return m_pDataTableView; } diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 0a731bf086d2..76884e8fc255 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -2009,11 +2009,12 @@ void VCartesianAxis::createShapes() void VCartesianAxis::createDataTableView(std::vector>& rSeriesPlotterList, uno::Reference const& xNumberFormatsSupplier, - uno::Reference const& xChartDoc) +
[Libreoffice-commits] core.git: chart2/source
chart2/source/controller/inc/DataTableItemConverter.hxx|3 +-- chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx |6 ++ chart2/source/controller/main/ChartController_Properties.cxx |6 +- 3 files changed, 4 insertions(+), 11 deletions(-) New commits: commit fc909263a1bb9326f838326f3299b16b80318f42 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 23:21:34 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 16:14:44 2022 +0200 chart2: don't use ref-size property when converting data table Change-Id: I4dd93d84879274721ded01be1a47b62487066b4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138334 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/controller/inc/DataTableItemConverter.hxx b/chart2/source/controller/inc/DataTableItemConverter.hxx index 65483f0f16f1..5dbfaf60bba9 100644 --- a/chart2/source/controller/inc/DataTableItemConverter.hxx +++ b/chart2/source/controller/inc/DataTableItemConverter.hxx @@ -35,8 +35,7 @@ class DataTableItemConverter final : public ItemConverter public: DataTableItemConverter(const css::uno::Reference& rPropertySet, SfxItemPool& rItemPool, SdrModel& rDrawModel, - const rtl::Reference<::chart::ChartModel>& xChartDoc, - const css::awt::Size* pRefSize); + const rtl::Reference<::chart::ChartModel>& xChartDoc); virtual ~DataTableItemConverter() override; diff --git a/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx index 462cd2517e54..2f05efaaa447 100644 --- a/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx @@ -53,15 +53,13 @@ ItemPropertyMapType& lclDataTablePropertyMap() DataTableItemConverter::DataTableItemConverter( const uno::Reference& rPropertySet, SfxItemPool& rItemPool, -SdrModel& rDrawModel, const rtl::Reference<::chart::ChartModel>& xChartDoc, -const awt::Size* pRefSize) +SdrModel& rDrawModel, const rtl::Reference<::chart::ChartModel>& xChartDoc) : ItemConverter(rPropertySet, rItemPool) , m_xChartDoc(xChartDoc) { m_aConverters.emplace_back(new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xChartDoc, GraphicObjectType::LineProperties)); -m_aConverters.emplace_back( -new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize")); +m_aConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool)); } DataTableItemConverter::~DataTableItemConverter() = default; diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index feb8cc6c8a59..8352d4e01ff1 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -290,13 +290,9 @@ wrapper::ItemConverter* createItemConverter( break; case OBJECTTYPE_DATA_TABLE: { -std::unique_ptr pRefSize; -if (pRefSizeProvider) -pRefSize.reset(new awt::Size(pRefSizeProvider->getPageSize())); - pItemConverter = new wrapper::DataTableItemConverter( xObjectProperties, rDrawModel.GetItemPool(), -rDrawModel, xChartModel, pRefSize.get()); +rDrawModel, xChartModel); } break; default: //OBJECTTYPE_UNKNOWN
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/Library_chartcore.mk chart2/qa chart2/source offapi/com offapi/UnoApi_offapi.mk
chart2/Library_chartcore.mk|2 chart2/qa/extras/chart2export.cxx |3 chart2/source/chartcore.component |7 chart2/source/inc/DataTable.hxx| 90 ++ chart2/source/model/inc/Diagram.hxx| 15 + chart2/source/model/main/DataTable.cxx | 248 + chart2/source/model/main/Diagram.cxx | 55 ++- chart2/source/view/axes/VAxisBase.cxx |8 chart2/source/view/axes/VAxisBase.hxx | 11 chart2/source/view/axes/VAxisProperties.cxx|4 chart2/source/view/axes/VAxisProperties.hxx|3 chart2/source/view/axes/VCartesianAxis.cxx | 40 ++ chart2/source/view/axes/VCartesianAxis.hxx |2 chart2/source/view/axes/VCartesianCoordinateSystem.cxx |3 chart2/source/view/axes/VCartesianCoordinateSystem.hxx |3 chart2/source/view/axes/VCoordinateSystem.cxx |2 chart2/source/view/axes/VPolarCoordinateSystem.cxx |2 chart2/source/view/axes/VPolarCoordinateSystem.hxx |3 chart2/source/view/charttypes/VSeriesPlotter.cxx | 62 +++- chart2/source/view/inc/DataTableView.hxx | 39 ++ chart2/source/view/inc/VCoordinateSystem.hxx |5 chart2/source/view/inc/VSeriesPlotter.hxx | 18 - chart2/source/view/main/ChartView.cxx |2 chart2/source/view/main/DataTableView.cxx | 217 ++ offapi/UnoApi_offapi.mk|2 offapi/com/sun/star/chart2/DataTable.idl | 48 +++ offapi/com/sun/star/chart2/Diagram.idl |6 offapi/com/sun/star/chart2/XDataTable.idl | 28 + offapi/com/sun/star/chart2/XDiagram.idl|9 29 files changed, 882 insertions(+), 55 deletions(-) New commits: commit 87c0b77d3262daf30ab3c3d7e4b4735f25c4e63e Author: Tomaž Vajngerl AuthorDate: Mon May 16 15:27:46 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 16:13:28 2022 +0200 [API-CHANGE] chart data table implementation Adds new service DataTable, which is reposible for the properties of a data table for a chart. Also removes the existing properties related to the data table from Diagram service, which were added prematurely in the past, without a data table actually being supported by the chart module. Also adds an implementation of the DataTable service in chart2 module. Change-Id: I0c6b32163745704c623d04baaf0ce0e208c107f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136789 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 212f03a3cd33a1c276e93ee693dc1173a5c1b051) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138308 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk index 5afb3e5b862a..72539f1a5bdf 100644 --- a/chart2/Library_chartcore.mk +++ b/chart2/Library_chartcore.mk @@ -136,6 +136,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\ chart2/source/model/main/DataPointProperties \ chart2/source/model/main/DataSeries \ chart2/source/model/main/DataSeriesProperties \ +chart2/source/model/main/DataTable \ chart2/source/model/main/Diagram \ chart2/source/model/main/FormattedString \ chart2/source/model/main/GridProperties \ diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 78529b9423c9..1e64ab5fb261 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -623,6 +623,8 @@ void Chart2ExportTest::testScatterXAxisCategories() void Chart2ExportTest::testChartDataTable() { +/* Disable test temporarily until OOXML filter is updated + load(u"/chart2/qa/extras/data/docx/", "testChartDataTable.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); @@ -630,6 +632,7 @@ void Chart2ExportTest::testChartDataTable() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showHorzBorder", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showVertBorder", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showOutline", "val", "1"); +*/ } void Chart2ExportTest::testChartExternalData() diff --git a/chart2/source/chartcore.component b/chart2/source/chartcore.component index f58ba98ba3ac..d15c808919df 100644 --- a/chart2/source/chartcore.component +++ b/chart2/source/chartcore.component @@ -219,6 +219,13 @@ + + + + + + diff --git a/chart2/source/inc/DataTable.hxx b/chart2/source/inc/DataTable.hxx new file mode 100644 index ..52fe42c34ee6 --- /dev/null +++
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/main/DataTableView.cxx | 58 ++ 1 file changed, 43 insertions(+), 15 deletions(-) New commits: commit 81a5f33101c18fb22a952b865c0c90418fd6a490 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 17:29:36 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 08:16:27 2022 +0200 chart2: always set text props. of the first paragraph and not cell When setting the properties of the data table it is important to differentiate when we set the properties of the text of the (first and only) paragraph or set the properties for the current cell. In this chage we refactor the code so that we always set the text via UNO text::XText call for the current cell, and in the next step get the XPropertySet of the first paragraph and set the properties relevant for the text from the DataTable model. Change-Id: Ibe82b21c3416083cfe8e86b95443d77984da05f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138330 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index ae90b475e75a..d413372e87c6 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -57,6 +57,29 @@ void copyProperty(uno::Reference& xOut, { xOut->setPropertyValue(sPropertyName, xIn->getPropertyValue(sPropertyName)); } + +uno::Reference getFirstParagraph(uno::Reference const& xText) +{ +uno::Reference xParagraph; +uno::Reference xEnumAccess(xText, uno::UNO_QUERY); +if (!xEnumAccess.is()) +return xParagraph; +uno::Reference xEnumeration(xEnumAccess->createEnumeration()); +xParagraph.set(xEnumeration->nextElement(), uno::UNO_QUERY); +return xParagraph; +} + +uno::Reference +getFirstParagraphProperties(uno::Reference const& xText) +{ +uno::Reference xPropertySet; +auto xParagraph = getFirstParagraph(xText); +if (!xParagraph.is()) +return xPropertySet; +xPropertySet.set(xParagraph, uno::UNO_QUERY); +return xPropertySet; +} + } // end anonymous namespace DataTableView::DataTableView( @@ -67,8 +90,8 @@ DataTableView::DataTableView( , m_xDataTableModel(rDataTableModel) , m_xComponentContext(rComponentContext) { -uno::Reference xProp(m_xDataTableModel); -m_aLineProperties.initFromPropertySet(xProp); +uno::Reference xPropertySet(m_xDataTableModel); +m_aLineProperties.initFromPropertySet(xPropertySet); } void DataTableView::setCellCharAndParagraphProperties( @@ -274,14 +297,18 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV uno::Reference xCellTextRange(xCell, uno::UNO_QUERY); if (xCellTextRange.is()) { -xCellTextRange->setString(rString); +auto xText = xCellTextRange->getText(); +xText->insertString(xText->getStart(), rString, false); +auto xTextPropertySet = getFirstParagraphProperties(xText); +if (!xTextPropertySet.is()) +continue; bool bLeft = (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); bool bRight = (bOutline && nColumn == nColumnCount) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +setCellCharAndParagraphProperties(xTextPropertySet); setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline); -setCellCharAndParagraphProperties(xPropertySet); } nColumn++; } @@ -319,17 +346,14 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV bool bTop = (bOutline && nRow == 1) || (bHBorder && nRow > 1 && nRow < nRowCount); bool bBottom = (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount); -setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom); auto xText = xCellTextRange->getText(); xText->insertString(xText->getStart(), rSeriesName, false); -uno::Reference xEnumAccess(xText, uno::UNO_QUERY); -uno::Reference xEnumeration(xEnumAccess->createEnumeration()); -uno::Reference xParagraph(xEnumeration->nextElement(), -uno::UNO_QUERY); -uno::Reference xTextPropertySet(xParagraph, uno::UNO_QUERY); - +auto xTextPropertySet = getFirstParagraphProperties(xText); +if (!xTextPropertySet.is()) +continue; setCellCharAndParagraphProperties(xTextPropertySet); +setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom); xCellPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_LEFT)); if (bKeys) @@ -349,11 +373,15
[Libreoffice-commits] core.git: chart2/inc chart2/source include/svx svx/source
chart2/inc/ChartView.hxx |8 chart2/source/view/axes/VAxisBase.cxx |3 chart2/source/view/axes/VAxisBase.hxx |5 chart2/source/view/axes/VCartesianAxis.cxx |5 chart2/source/view/axes/VCartesianAxis.hxx |4 chart2/source/view/axes/VCartesianCoordinateSystem.cxx |5 chart2/source/view/axes/VCartesianCoordinateSystem.hxx |3 chart2/source/view/axes/VCoordinateSystem.cxx |3 chart2/source/view/axes/VPolarCoordinateSystem.cxx |3 chart2/source/view/axes/VPolarCoordinateSystem.hxx |3 chart2/source/view/charttypes/VSeriesPlotter.cxx | 139 + chart2/source/view/inc/DataTableView.hxx | 16 + chart2/source/view/inc/LegendEntryProvider.hxx |9 + chart2/source/view/inc/VCoordinateSystem.hxx |4 chart2/source/view/inc/VSeriesPlotter.hxx | 11 + chart2/source/view/main/ChartView.cxx | 13 - chart2/source/view/main/DataTableView.cxx | 121 +++--- include/svx/svdotable.hxx |2 svx/source/table/svdotable.cxx | 12 + 19 files changed, 317 insertions(+), 52 deletions(-) New commits: commit 9d6ffcc0572cc7917651489c69ca4b3452e89a89 Author: Tomaž Vajngerl AuthorDate: Mon Jul 18 08:12:19 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 08:15:00 2022 +0200 chart2: Data table rendering of keys (legend symbols) Change-Id: Iff13b188df18fe8f9919274869774f53f2ea323b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138299 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index 3fe2fedcf7e8..5c7e70e97900 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -104,8 +104,7 @@ private: public: ChartView() = delete; -ChartView(css::uno::Reference< css::uno::XComponentContext > xContext, - ChartModel& rModel); +ChartView(css::uno::Reference xContext, ChartModel& rModel); virtual ~ChartView() override; @@ -185,6 +184,8 @@ public: void setViewDirty(); +css::uno::Reference const& getComponentContext() { return m_xCC;} + /// See sfx2::XmlDump::dumpAsXml(). void dumpAsXml(xmlTextWriterPtr pWriter) const override; @@ -210,8 +211,7 @@ private: //methods private: //member ::osl::Mutex m_aMutex; -css::uno::Reference< css::uno::XComponentContext> -m_xCC; +css::uno::Reference< css::uno::XComponentContext> m_xCC; chart::ChartModel& mrChartModel; diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 814d3afd7858..30aead187dcb 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -244,7 +244,8 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter ) void VAxisBase::createDataTableView(std::vector>& /*rSeriesPlotterList*/, uno::Reference const& /*xNumberFormatsSupplier*/, -rtl::Reference<::chart::ChartModel> const& /*xChartDoc*/) +rtl::Reference<::chart::ChartModel> const& /*xChartDoc*/, + css::uno::Reference const& /*rComponentContext*/) { } diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx index 2c4123ba951d..4ee4f5e288ae 100644 --- a/chart2/source/view/axes/VAxisBase.hxx +++ b/chart2/source/view/axes/VAxisBase.hxx @@ -23,6 +23,7 @@ #include "Tickmarks.hxx" namespace com::sun::star::util { class XNumberFormatsSupplier; } +namespace com::sun::star::uno { class XComponentContext; } namespace chart { @@ -30,6 +31,7 @@ namespace chart class VSeriesPlotter; class DataTableView; class ChartModel; +class LegendEntryProvider; class VAxisBase : public VAxisOrGridBase { @@ -65,7 +67,8 @@ public: virtual void createDataTableView(std::vector>& rSeriesPlotterList, css::uno::Reference const& xNumberFormatsSupplier, - rtl::Reference<::chart::ChartModel> const& xChartDoc); + rtl::Reference<::chart::ChartModel> const& xChartDoc, + css::uno::Reference const& rComponentContext); std::shared_ptr getDataTableView() { return m_pDataTableView; } diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index d7e78d5d2e85..293d1f0479a8 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1995,11 +1995,12 @@ void VCartesianAxis::createShapes() void VCartesianAxis::createDataTableView(std::vector>& rSeriesPlotterList,
[Libreoffice-commits] core.git: chart2/source
chart2/source/model/main/DataTable.cxx | 11 +++ 1 file changed, 11 insertions(+) New commits: commit cc54063b915a58db9133c919c151ec7e6209f4cd Author: Tomaž Vajngerl AuthorDate: Thu Jun 30 23:43:52 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Aug 14 20:43:40 2022 +0200 chart2: add some data table default properties Change-Id: I4fac46ac2a119275bcdaa6ebc8b7382ad6fb5684 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138249 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/model/main/DataTable.cxx b/chart2/source/model/main/DataTable.cxx index 5f3a5eb18403..c8ae688dfc4d 100644 --- a/chart2/source/model/main/DataTable.cxx +++ b/chart2/source/model/main/DataTable.cxx @@ -70,6 +70,17 @@ private: true); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Outilne, true); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Keys, false); + +::chart::PropertyHelper::setPropertyValue( +aMap, ::chart::LinePropertiesHelper::PROP_LINE_WIDTH, uno::Any(sal_Int32(1))); + +float fDefaultCharHeight = 10.0; +::chart::PropertyHelper::setPropertyValue( +aMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight); +::chart::PropertyHelper::setPropertyValue( +aMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight); +::chart::PropertyHelper::setPropertyValue( +aMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight); } };
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/controller/main/ChartController_Insert.cxx | 19 ++- chart2/source/model/main/Diagram.cxx |5 +++ 2 files changed, 23 insertions(+), 1 deletion(-) New commits: commit 0d2c6df11e876d1afdf0f9bdfb5e9e0ce7583f68 Author: Tomaž Vajngerl AuthorDate: Wed Aug 10 12:06:42 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 24 15:40:41 2022 +0200 chart2: Add undo/redo for the data table Change-Id: I6b25a7a82957705481952bc3cd181a6d0c1fce0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138298 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit fcf839cd4b76254d03426a849e17927b2a845352) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138584 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 40f0675d76af..02c0e681579a 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -162,6 +162,9 @@ void ChartController::executeDispatch_InsertGrid() void ChartController::executeDispatch_OpenInsertDataTableDialog() { SolarMutexGuard aGuard; +auto aUndoDescription = ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Insert, SchResId(STR_OBJECT_DATA_TABLE)); +UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager); + uno::Reference xDiagram = ChartModelHelper::findDiagram(getModel()); InsertDataTableDialog aDialog(GetChartFrame()); @@ -196,12 +199,14 @@ void ChartController::executeDispatch_OpenInsertDataTableDialog() // show the dialog if (aDialog.run() == RET_OK) { -auto& rDialogData = aDialog.getDataTableDialogData(); +bool bChanged = false; +auto& rDialogData = aDialog.getDataTableDialogData(); auto xDataTable = xDiagram->getDataTable(); if (!rDialogData.mbShow && xDataTable.is()) { xDiagram->setDataTable(uno::Reference()); +bChanged = true; } else if (rDialogData.mbShow && !xDataTable.is()) { @@ -209,6 +214,7 @@ void ChartController::executeDispatch_OpenInsertDataTableDialog() if (xNewDataTable.is()) { xDiagram->setDataTable(xNewDataTable); +bChanged = true; } } @@ -221,13 +227,20 @@ void ChartController::executeDispatch_OpenInsertDataTableDialog() xProperties->setPropertyValue("VBorder" , uno::Any(rDialogData.mbVerticalBorders)); xProperties->setPropertyValue("Outline" , uno::Any(rDialogData.mbOutline)); xProperties->setPropertyValue("Keys" , uno::Any(rDialogData.mbKeys)); +bChanged = true; } + +if (bChanged) +aUndoGuard.commit(); } } void ChartController::executeDispatch_InsertDataTable() { SolarMutexGuard aGuard; +auto aUndoDescription = ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Insert, SchResId(STR_OBJECT_DATA_TABLE)); +UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager); + uno::Reference xDiagram = ChartModelHelper::findDiagram(getModel()); auto xDataTable = xDiagram->getDataTable(); if (!xDataTable.is()) @@ -236,6 +249,7 @@ void ChartController::executeDispatch_InsertDataTable() if (xNewDataTable.is()) { xDiagram->setDataTable(xNewDataTable); +aUndoGuard.commit(); } } } @@ -243,11 +257,14 @@ void ChartController::executeDispatch_InsertDataTable() void ChartController::executeDispatch_DeleteDataTable() { SolarMutexGuard aGuard; +auto aUndoDescription = ActionDescriptionProvider::createDescription(ActionDescriptionProvider::ActionType::Delete, SchResId(STR_OBJECT_DATA_TABLE)); +UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager); uno::Reference xDiagram = ChartModelHelper::findDiagram(getModel()); auto xDataTable = xDiagram->getDataTable(); if (xDataTable.is()) { xDiagram->setDataTable(uno::Reference()); +aUndoGuard.commit(); } } diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 2a310863aca6..518a765820c7 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -264,10 +264,14 @@ Diagram::Diagram( const Diagram & rOther ) : m_xTitle.set( CloneHelper::CreateRefClone< chart2::XTitle >()( rOther.m_xTitle )); m_xLegend.set( CloneHelper::CreateRefClone< chart2::XLegend >()( rOther.m_xLegend )); +if (rOther.m_xDataTable.is()) +m_xDataTable.set(new DataTable(*rOther.m_xDataTable)); + ModifyListenerHelper::addListener( m_xWall, m_xModifyEventForwarder ); ModifyListenerHelper::addListener( m_xFloor, m_xModifyEventForwarder );
[Libreoffice-commits] core.git: chart2/qa chart2/source
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: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/controller/main/ChartController_Window.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 4c789414bf53c4df2b3c798c379adcb493a9e84a Author: Tomaž Vajngerl AuthorDate: Mon Aug 22 12:12:01 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Aug 22 19:50:09 2022 +0200 chart2: remove duplicate eObjectType Change-Id: Ia5b7b5a6f7f7f42cfbf784c37e6f5a825c0967f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138670 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index cc8125057a09..435f4b1474f3 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1035,7 +1035,6 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) xPopupMenu->insertSeparator( -1 ); } -ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() ); Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( getModel() ); OUString aFormatCommand( lcl_getFormatCommandForObjectCID( m_aSelection.getSelectedCID() ) );
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 5 commits - basegfx/CppunitTest_basegfx.mk basegfx/test download.lst drawinglayer/source external/frozen external/Module_external.m
Rebased ref, commits from common ancestor: commit 3905a86e8f0db4bdb85ec5b5c41c4ad766b18cbb Author: Tomaž Vajngerl AuthorDate: Thu Nov 12 10:01:20 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Sun Aug 21 08:32:08 2022 +0200 basegfx: added Length class as the base unit for length Change-Id: I1d4790b60dd784e8b2e2e438274f3ebd6db4b60c diff --git a/basegfx/CppunitTest_basegfx.mk b/basegfx/CppunitTest_basegfx.mk index 88f4966262f2..98d3a5d41926 100644 --- a/basegfx/CppunitTest_basegfx.mk +++ b/basegfx/CppunitTest_basegfx.mk @@ -45,6 +45,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,basegfx,\ basegfx/test/clipstate \ basegfx/test/genericclipper \ basegfx/test/VectorTest \ +basegfx/test/LengthUnitTest \ )) # vim: set noet sw=4 ts=4: diff --git a/basegfx/test/LengthUnitTest.cxx b/basegfx/test/LengthUnitTest.cxx new file mode 100644 index ..421e98934c90 --- /dev/null +++ b/basegfx/test/LengthUnitTest.cxx @@ -0,0 +1,135 @@ +/* -*- 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/. + */ + +#include + +#include +#include + +class LengthTest : public CppUnit::TestFixture +{ +public: +void testBasic() +{ +gfx::Length cm = 1_cm + 5_cm - 2_cm; +CPPUNIT_ASSERT_DOUBLES_EQUAL(4.0, cm.as_cm(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.04, cm.as_m(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(40.0, cm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(144), cm.raw()); + +gfx::Length cm2 = 5_cm * 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), cm2.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, cm2.as_cm(), 1e-4); + +// 1 km - 50 m = 950 m = 95000 cm +gfx::Length cm3 = 10_cm - 5000_cm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(342), cm3.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(95000.0, cm3.as_cm(), 1e-4); + +gfx::Length cm4(1_cm); +cm4 /= 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(18), cm4.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, cm4.as_cm(), 1e-4); + +// (635 * 20) + 3 * (635 * 15) = 41275EMU +gfx::Length pt = 1_pt + 3_px; +CPPUNIT_ASSERT_DOUBLES_EQUAL(3.25, pt.as_pt(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(65.0, pt.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0451, pt.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(41275), pt.raw()); + +gfx::Length inch = 1_in; // 1440 * 635 +CPPUNIT_ASSERT_DOUBLES_EQUAL(1440.0, inch.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(96.0, inch.as_px(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, inch.as_in(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(914400.0, inch.as_emu(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(914400), inch.raw()); + +// Conversion +sal_Int64 asNumber(17_pt); +asNumber += sal_Int64(1_pt); +gfx::Length asLength = gfx::Length::emu(asNumber); +CPPUNIT_ASSERT_EQUAL(sal_Int64(18 * 635 * 20), asLength.raw()); + +gfx::Length maximum = gfx::Length::emu(SAL_MAX_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(256204778801.5, maximum.as_m(), 1e-1); +// 256204778 km +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MAX_INT64), maximum.raw()); + +gfx::Length minimum = gfx::Length::emu(SAL_MIN_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(-256204778801.5, minimum.as_m(), 1e-1); +CPPUNIT_ASSERT_DOUBLES_EQUAL(double(SAL_MIN_INT64), minimum.as_emu(), 1e-1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MIN_INT64), minimum.raw()); + +// 27 emu + 33 emu + 360 emu = 420 +gfx::Length emus = 27_emu + 33_emu + 1_hmm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(420), emus.raw()); + +// Creation from number +int number = 10; +auto asCm = gfx::Length::cm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asCm.as_cm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), asCm.raw()); + +auto asMm = gfx::Length::mm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asMm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(36), asMm.raw()); + +auto asInch = gfx::Length::in(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asInch.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(9144000), asInch.raw()); + +auto aa = gfx::Length::hmm(10.1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(3600), aa.raw()); + +auto bb = gfx::Length::hmm(10.1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(3636), bb.raw()); +} + +void testInRange() +{ +gfx::Range2DL aRange(1_cm, 2_cm, 2_cm, 30_mm); +CPPUNIT_ASSERT_EQUAL(1_cm, aRange.getMinX()); +CPPUNIT_ASSERT_EQUAL(2_cm, aRange.getMaxX()); +
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 7 commits - basegfx/CppunitTest_basegfx.mk basegfx/test download.lst drawinglayer/source external/frozen external/Module_external.m
Rebased ref, commits from common ancestor: commit 7546541de74a916649a194967fcbe7b42365ad94 Author: Tomaž Vajngerl AuthorDate: Thu Nov 12 10:01:20 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 20:10:34 2022 +0200 basegfx: added Length class as the base unit for length Change-Id: I1d4790b60dd784e8b2e2e438274f3ebd6db4b60c diff --git a/basegfx/CppunitTest_basegfx.mk b/basegfx/CppunitTest_basegfx.mk index 88f4966262f2..98d3a5d41926 100644 --- a/basegfx/CppunitTest_basegfx.mk +++ b/basegfx/CppunitTest_basegfx.mk @@ -45,6 +45,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,basegfx,\ basegfx/test/clipstate \ basegfx/test/genericclipper \ basegfx/test/VectorTest \ +basegfx/test/LengthUnitTest \ )) # vim: set noet sw=4 ts=4: diff --git a/basegfx/test/LengthUnitTest.cxx b/basegfx/test/LengthUnitTest.cxx new file mode 100644 index ..421e98934c90 --- /dev/null +++ b/basegfx/test/LengthUnitTest.cxx @@ -0,0 +1,135 @@ +/* -*- 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/. + */ + +#include + +#include +#include + +class LengthTest : public CppUnit::TestFixture +{ +public: +void testBasic() +{ +gfx::Length cm = 1_cm + 5_cm - 2_cm; +CPPUNIT_ASSERT_DOUBLES_EQUAL(4.0, cm.as_cm(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.04, cm.as_m(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(40.0, cm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(144), cm.raw()); + +gfx::Length cm2 = 5_cm * 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), cm2.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, cm2.as_cm(), 1e-4); + +// 1 km - 50 m = 950 m = 95000 cm +gfx::Length cm3 = 10_cm - 5000_cm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(342), cm3.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(95000.0, cm3.as_cm(), 1e-4); + +gfx::Length cm4(1_cm); +cm4 /= 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(18), cm4.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, cm4.as_cm(), 1e-4); + +// (635 * 20) + 3 * (635 * 15) = 41275EMU +gfx::Length pt = 1_pt + 3_px; +CPPUNIT_ASSERT_DOUBLES_EQUAL(3.25, pt.as_pt(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(65.0, pt.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0451, pt.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(41275), pt.raw()); + +gfx::Length inch = 1_in; // 1440 * 635 +CPPUNIT_ASSERT_DOUBLES_EQUAL(1440.0, inch.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(96.0, inch.as_px(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, inch.as_in(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(914400.0, inch.as_emu(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(914400), inch.raw()); + +// Conversion +sal_Int64 asNumber(17_pt); +asNumber += sal_Int64(1_pt); +gfx::Length asLength = gfx::Length::emu(asNumber); +CPPUNIT_ASSERT_EQUAL(sal_Int64(18 * 635 * 20), asLength.raw()); + +gfx::Length maximum = gfx::Length::emu(SAL_MAX_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(256204778801.5, maximum.as_m(), 1e-1); +// 256204778 km +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MAX_INT64), maximum.raw()); + +gfx::Length minimum = gfx::Length::emu(SAL_MIN_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(-256204778801.5, minimum.as_m(), 1e-1); +CPPUNIT_ASSERT_DOUBLES_EQUAL(double(SAL_MIN_INT64), minimum.as_emu(), 1e-1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MIN_INT64), minimum.raw()); + +// 27 emu + 33 emu + 360 emu = 420 +gfx::Length emus = 27_emu + 33_emu + 1_hmm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(420), emus.raw()); + +// Creation from number +int number = 10; +auto asCm = gfx::Length::cm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asCm.as_cm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), asCm.raw()); + +auto asMm = gfx::Length::mm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asMm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(36), asMm.raw()); + +auto asInch = gfx::Length::in(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asInch.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(9144000), asInch.raw()); + +auto aa = gfx::Length::hmm(10.1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(3600), aa.raw()); + +auto bb = gfx::Length::hmm(10.1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(3636), bb.raw()); +} + +void testInRange() +{ +gfx::Range2DL aRange(1_cm, 2_cm, 2_cm, 30_mm); +CPPUNIT_ASSERT_EQUAL(1_cm, aRange.getMinX()); +CPPUNIT_ASSERT_EQUAL(2_cm, aRange.getMaxX()); +
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/qa include/xmloff schema/libreoffice xmloff/Library_xo.mk xmloff/source
chart2/qa/extras/chart2export2.cxx | 52 + chart2/qa/extras/data/xlsx/ChartDataTable.xlsx |binary include/xmloff/xmltoken.hxx |7 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng | 113 +--- xmloff/Library_xo.mk|1 xmloff/source/chart/PropertyMaps.cxx|6 xmloff/source/chart/SchXMLChartContext.cxx |4 xmloff/source/chart/SchXMLDataTableContext.cxx | 87 + xmloff/source/chart/SchXMLDataTableContext.hxx | 40 xmloff/source/chart/SchXMLExport.cxx| 38 +++- xmloff/source/core/xmltoken.cxx | 11 - xmloff/source/token/tokens.txt |5 12 files changed, 330 insertions(+), 34 deletions(-) New commits: commit 5d542b733aac7901589161425bc8eb809220a79b Author: Tomaž Vajngerl AuthorDate: Fri Jul 29 15:57:42 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Aug 20 23:24:21 2022 +0200 xmloff: import and export for the chart data table This change adds import and export code for the the chart's data table properties to the ODF format for chart documents. The data table properties are exported to a new element "data-table", which then references a auto style with all the properties of a data table + new data table specific properties: HBorder, VBorder, Outline, Keys which are mapped to "show-horizontal-border", "show-vertical-border", "show-outline" and "show-keys" chart attributes. Also adds a test for the import and export: imports xlsx -> exports to ods -> imports ods Change-Id: Id45d9369fd619959e4d6eba7ca51c8ddce9c8f56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138260 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 203eaefb4ac012c36a1ecdd3753e1cb2c5876efc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138529 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index 588cbe1d84f2..1ea349af82fe 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -103,6 +103,7 @@ public: void testNameRangeXLSX(); void testTdf143942(); void testDateCategoriesPPTX(); +void testDataTableImportExport(); CPPUNIT_TEST_SUITE(Chart2ExportTest2); CPPUNIT_TEST(testSetSeriesToSecondaryAxisXLSX); @@ -168,6 +169,7 @@ public: CPPUNIT_TEST(testNameRangeXLSX); CPPUNIT_TEST(testTdf143942); CPPUNIT_TEST(testDateCategoriesPPTX); +CPPUNIT_TEST(testDataTableImportExport); CPPUNIT_TEST_SUITE_END(); }; @@ -1640,6 +1642,56 @@ void Chart2ExportTest2::testDateCategoriesPPTX() } } +void Chart2ExportTest2::testDataTableImportExport() +{ +load(u"/chart2/qa/extras/data/xlsx/", u"ChartDataTable.xlsx"); +{ +uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); +CPPUNIT_ASSERT(xChartDoc.is()); +auto xDiagram = xChartDoc->getFirstDiagram(); +CPPUNIT_ASSERT(xDiagram.is()); +auto xDataTable = xDiagram->getDataTable(); +CPPUNIT_ASSERT(xDataTable.is()); +uno::Reference xPropertySet(xDataTable, uno::UNO_QUERY); +CPPUNIT_ASSERT(xPropertySet.is()); +bool bHBorder; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("HBorder") >>= bHBorder); +CPPUNIT_ASSERT_EQUAL(true, bHBorder); +bool bVBorder; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("VBorder") >>= bVBorder); +CPPUNIT_ASSERT_EQUAL(true, bVBorder); +bool bOutline; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Outline") >>= bOutline); +CPPUNIT_ASSERT_EQUAL(false, bOutline); +bool bKeys; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Keys") >>= bKeys); +CPPUNIT_ASSERT_EQUAL(false, bKeys); +} +reload("calc8"); +{ +uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); +CPPUNIT_ASSERT(xChartDoc.is()); +auto xDiagram = xChartDoc->getFirstDiagram(); +CPPUNIT_ASSERT(xDiagram.is()); +auto xDataTable = xDiagram->getDataTable(); +CPPUNIT_ASSERT(xDataTable.is()); +uno::Reference xPropertySet(xDataTable, uno::UNO_QUERY); +CPPUNIT_ASSERT(xPropertySet.is()); +bool bHBorder; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("HBorder") >>= bHBorder); +CPPUNIT_ASSERT_EQUAL(true, bHBorder); +bool bVBorder; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("VBorder") >>= bVBorder); +CPPUNIT_ASSERT_EQUAL(true, bVBorder); +bool bOutline; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Outline") >>= bOutline); +CPPUNIT_ASSERT_EQUAL(false, bOutline); +bool bKeys; +
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source officecfg/registry
chart2/source/controller/inc/ChartController.hxx |3 + chart2/source/controller/main/ChartController.cxx |5 + chart2/source/controller/main/ChartController_Insert.cxx | 26 ++ chart2/source/controller/main/ChartController_Window.cxx | 19 +-- chart2/source/controller/main/ControllerCommandDispatch.cxx|8 +++ chart2/source/model/main/DataTable.cxx |6 +- officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu | 11 7 files changed, 71 insertions(+), 7 deletions(-) New commits: commit cdec7c46c8e231efe1022149cf2eb73cbb3bbede Author: Tomaž Vajngerl AuthorDate: Fri Jul 29 15:49:31 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Aug 20 23:24:02 2022 +0200 chart2: DataTable set properties to default to false Change-Id: If8caf59629327b623b2630776b1e650cbe4fbed1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138259 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 5861af0da5179689870d5b4f5ff56a5ea0a79901) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138528 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/model/main/DataTable.cxx b/chart2/source/model/main/DataTable.cxx index f9c8f36fac10..b592bb147f32 100644 --- a/chart2/source/model/main/DataTable.cxx +++ b/chart2/source/model/main/DataTable.cxx @@ -66,10 +66,10 @@ private: ::chart::CharacterProperties::AddDefaultsToMap(aMap); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_HorizontalBorder, - true); + false); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_VerticalBorder, - true); -::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Outilne, true); + false); +::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Outilne, false); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Keys, false); ::chart::PropertyHelper::setPropertyValue( commit aed3b2e7ae5d055700d0d18ed3b9bc613a2fb74f Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 23:03:53 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Aug 20 23:23:54 2022 +0200 chart2: InsertDataTable and DeleteDataTable for context menu Change-Id: I8ef0698252209af01b0741a59dec70f845f0c965 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138258 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit 0c984c4dbe36a58859b09924e98fcf8ba8ed2d75) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138527 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 5e74cec917ce..d9691aa2e577 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -438,6 +438,9 @@ private: void executeDispatch_OpenLegendDialog(); void executeDispatch_InsertAxes(); void executeDispatch_InsertGrid(); + +void executeDispatch_InsertDataTable(); +void executeDispatch_DeleteDataTable(); void executeDispatch_OpenInsertDataTableDialog(); void executeDispatch_InsertMenu_DataLabels(); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index a61d84af0e9f..2e7185fdbd68 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1228,6 +1228,10 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_DeleteMajorGrid(); else if( aCommand == "DeleteMinorGrid" ) this->executeDispatch_DeleteMinorGrid(); +else if( aCommand == "InsertDataTable" ) + this->executeDispatch_InsertDataTable(); +else if( aCommand == "DeleteDataTable" ) + this->executeDispatch_DeleteDataTable(); //format objects else if( aCommand == "FormatSelection" ) this->executeDispatch_ObjectProperties(); @@ -1628,6 +1632,7 @@ const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommand "DeleteXErrorBars", "DeleteYErrorBars", "DeleteDataLabels", "DeleteDataLabel", "InsertMenuDataTable", +"InsertDataTable", "DeleteDataTable", //format objects "FormatSelection", "TransformDialog", "DiagramType","View3D", diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 6f3b4df600ea..40f0675d76af 100644 ---
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk
chart2/Library_chartcontroller.mk|2 chart2/UIConfig_chart2.mk|3 chart2/source/controller/dialogs/dlg_InsertDataTable.cxx | 61 +++ chart2/source/controller/dialogs/res_DataTableProperties.cxx | 111 + chart2/source/controller/dialogs/tp_DataTable.cxx| 78 --- chart2/source/controller/dialogs/tp_DataTable.hxx| 11 chart2/source/controller/inc/dlg_InsertDataTable.hxx | 47 ++ chart2/source/controller/inc/res_DataTableProperties.hxx | 47 ++ chart2/source/controller/main/ChartController_Insert.cxx | 64 ++- chart2/source/model/main/DataTable.cxx | 11 chart2/uiconfig/ui/dlg_InsertDataTable.ui| 215 +++ 11 files changed, 559 insertions(+), 91 deletions(-) New commits: commit cce4c8d73a3fc1904a20e007e26ff2ab832349de Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 22:00:38 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Aug 20 23:23:47 2022 +0200 chart2: InsertDataTableDialog for inserting/removing the data table Change-Id: Ie3c033c587b150723e7aa39cd5ddf5774104db9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138257 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 6c00d75738bb182b5c02848b1720e6623baed4b9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138526 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index c8689302b2ac..ad25440c1ced 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -104,6 +104,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/dlg_DataSource \ chart2/source/controller/dialogs/dlg_InsertAxis_Grid \ chart2/source/controller/dialogs/dlg_InsertDataLabel \ +chart2/source/controller/dialogs/dlg_InsertDataTable \ chart2/source/controller/dialogs/dlg_InsertErrorBars \ chart2/source/controller/dialogs/dlg_InsertLegend \ chart2/source/controller/dialogs/dlg_InsertTitle \ @@ -117,6 +118,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/RangeSelectionListener \ chart2/source/controller/dialogs/res_BarGeometry \ chart2/source/controller/dialogs/res_DataLabel \ +chart2/source/controller/dialogs/res_DataTableProperties \ chart2/source/controller/dialogs/res_ErrorBar \ chart2/source/controller/dialogs/res_LegendPosition \ chart2/source/controller/dialogs/res_Titles \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 59af510c5845..274efd02638f 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -44,7 +44,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/combobox \ chart2/uiconfig/ui/datarangedialog \ chart2/uiconfig/ui/dlg_DataLabel \ + chart2/uiconfig/ui/dlg_InsertDataTable \ chart2/uiconfig/ui/dlg_InsertErrorBars \ + chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/imagefragment \ chart2/uiconfig/ui/insertaxisdlg \ chart2/uiconfig/ui/insertgriddlg \ @@ -58,7 +60,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/smoothlinesdlg \ chart2/uiconfig/ui/steppedlinesdlg \ chart2/uiconfig/ui/titlerotationtabpage \ - chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/tp_3D_SceneAppearance \ chart2/uiconfig/ui/tp_3D_SceneGeometry \ chart2/uiconfig/ui/tp_3D_SceneIllumination \ diff --git a/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx new file mode 100644 index ..4b5e928db057 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx @@ -0,0 +1,61 @@ +/* -*- 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/. + */ + +#include + +namespace chart +{ +InsertDataTableDialog::InsertDataTableDialog(weld::Window* pWindow) +: GenericDialogController(pWindow, "modules/schart/ui/dlg_InsertDataTable.ui", + "InsertDataTableDialog") +, m_aDataTablePropertiesResources(*m_xBuilder) +, m_xCbShowDataTable(m_xBuilder->weld_check_button("showDataTable")) +{ +m_xCbShowDataTable->connect_toggled(LINK(this, InsertDataTableDialog, ShowDataTableToggle)); +init(m_aData); +} + +IMPL_LINK_NOARG(InsertDataTableDialog, ShowDataTableToggle, weld::Toggleable&, void) +{ +changeEnabled(); +} + +void
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source chart2/uiconfig officecfg/registry
chart2/source/controller/inc/ChartController.hxx |1 chart2/source/controller/main/ChartController.cxx |3 + chart2/source/controller/main/ChartController_Insert.cxx | 19 ++ chart2/source/controller/main/ControllerCommandDispatch.cxx|3 + chart2/source/inc/OPropertySet.hxx |3 + chart2/uiconfig/menubar/menubar.xml|1 officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu |5 ++ 7 files changed, 33 insertions(+), 2 deletions(-) New commits: commit 3e6f7d8c412946ddd54d114aa1e763b25eb31a04 Author: Tomaž Vajngerl AuthorDate: Thu Jun 30 23:34:19 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Aug 20 14:35:15 2022 +0200 chart2: add "InsertMenuDataTable" action to menu Change-Id: Ib60a2b061966eb61834480b63dc0653410a43a14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138248 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 16fac85be1fdddb1695a29a9b8026cd4f8cfad64) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138524 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 09fda2b6fb00..5e74cec917ce 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -438,6 +438,7 @@ private: void executeDispatch_OpenLegendDialog(); void executeDispatch_InsertAxes(); void executeDispatch_InsertGrid(); +void executeDispatch_OpenInsertDataTableDialog(); void executeDispatch_InsertMenu_DataLabels(); void executeDispatch_InsertMenu_Trendlines(); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index f9fcc71f1793..a61d84af0e9f 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1172,6 +1172,8 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_InsertErrorBars(false); else if( aCommand == "InsertMenuYErrorBars" ) this->executeDispatch_InsertErrorBars(true); +else if( aCommand == "InsertMenuDataTable" ) +this->executeDispatch_OpenInsertDataTableDialog(); else if( aCommand == "InsertSymbol" ) this->executeDispatch_InsertSpecialCharacter(); else if( aCommand == "InsertTrendline" ) @@ -1625,6 +1627,7 @@ const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommand "DeleteTrendline","DeleteMeanValue", "DeleteTrendlineEquation", "DeleteXErrorBars", "DeleteYErrorBars", "DeleteDataLabels", "DeleteDataLabel", +"InsertMenuDataTable", //format objects "FormatSelection", "TransformDialog", "DiagramType","View3D", diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 04c27782c375..e45cb15d3215 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -156,6 +157,24 @@ void ChartController::executeDispatch_InsertGrid() } } +void ChartController::executeDispatch_OpenInsertDataTableDialog() +{ +uno::Reference xDiagram = ChartModelHelper::findDiagram(getModel()); +SolarMutexGuard aGuard; +if (xDiagram->getDataTable().is()) +{ +xDiagram->setDataTable(uno::Reference()); +} +else +{ +uno::Reference xDataTable(new DataTable); +if (xDataTable.is()) +{ +xDiagram->setDataTable(xDataTable); +} +} +} + void ChartController::executeDispatch_InsertTitles() { UndoGuard aUndoGuard( diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index 2f0e13f56155..263f4551c82d 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -594,7 +594,8 @@ void ControllerCommandDispatch::updateCommandAvailability() m_aCommandAvailability[ ".uno:InsertMenuMeanValues" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertMenuXErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertMenuYErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; -m_aCommandAvailability[ ".uno:InsertSymbol" ] = bIsWritable && m_apControllerState->bIsTextObject; +m_aCommandAvailability[ ".uno:InsertSymbol" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsTextObject; +m_aCommandAvailability[
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/view/inc/ShapeFactory.hxx |2 +- chart2/source/view/main/DataTableView.cxx |5 - chart2/source/view/main/ShapeFactory.cxx |5 - 3 files changed, 9 insertions(+), 3 deletions(-) New commits: commit fc307b3da2332ef4995154c0554e8560a0196ddd Author: Tomaž Vajngerl AuthorDate: Wed Jun 29 19:25:47 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 19:10:42 2022 +0200 chart2: allow to select the data table, fix object CID Change-Id: I0a8d3643fcaefe8105e935b929947174bd9bdc96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138247 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit d4450b9a9fe26e03fabb07162e88f742ba2c1f77) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138523 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index 5b03509a3695..481fde50dbb2 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -213,7 +213,7 @@ public: const css::uno::Reference< css::beans::XPropertySet > & xTextProperties, double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth ); -static rtl::Reference createTable(css::uno::Reference< css::drawing::XShapes >& xTarget); +static rtl::Reference createTable(css::uno::Reference& xTarget, OUString const& rName = OUString()); css::uno::Reference< css::drawing::XShape > createInvisibleRectangle( diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index f7a1fe4a0bb8..4b83428abe04 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -193,7 +194,9 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV return; ShapeFactory::removeSubShapes(m_xTarget); -m_xTableShape = ShapeFactory::createTable(m_xTarget); +auto sParticle = ObjectIdentifier::createParticleForDataTable(m_xChartModel); +auto sCID = ObjectIdentifier::createClassifiedIdentifierForParticle(sParticle); +m_xTableShape = ShapeFactory::createTable(m_xTarget, sCID); uno::Reference xTable; try diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 7c2574c5f407..dc3b3332391a 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2656,7 +2656,8 @@ void ShapeFactory::removeSubShapes( const uno::Reference< drawing::XShapes >& xS } } -rtl::Reference ShapeFactory::createTable(uno::Reference& xTarget) +rtl::Reference +ShapeFactory::createTable(uno::Reference& xTarget, OUString const& rName) { if (!xTarget.is()) return nullptr; @@ -2666,6 +2667,8 @@ rtl::Reference ShapeFactory::createTable(uno::ReferencesetShapeKind(OBJ_TABLE); uno::Reference xShapeUno(xShape); xTarget->add(xShapeUno); +if (!rName.isEmpty()) +setShapeName(xShapeUno, rName); return xShape; }
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 771 commits - accessibility/source android/source avmedia/source basctl/inc basctl/source basegfx/CppunitTest_basegfx.mk basegfx/te
Rebased ref, commits from common ancestor: commit 37c3fbe51d9635b9b2d0ce97addd7b6af2d977cb Author: Tomaž Vajngerl AuthorDate: Thu Nov 12 10:01:20 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 16:16:58 2022 +0200 basegfx: added Length class as the base unit for length Change-Id: I1d4790b60dd784e8b2e2e438274f3ebd6db4b60c diff --git a/basegfx/CppunitTest_basegfx.mk b/basegfx/CppunitTest_basegfx.mk index 88f4966262f2..98d3a5d41926 100644 --- a/basegfx/CppunitTest_basegfx.mk +++ b/basegfx/CppunitTest_basegfx.mk @@ -45,6 +45,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,basegfx,\ basegfx/test/clipstate \ basegfx/test/genericclipper \ basegfx/test/VectorTest \ +basegfx/test/LengthUnitTest \ )) # vim: set noet sw=4 ts=4: diff --git a/basegfx/test/LengthUnitTest.cxx b/basegfx/test/LengthUnitTest.cxx new file mode 100644 index ..421e98934c90 --- /dev/null +++ b/basegfx/test/LengthUnitTest.cxx @@ -0,0 +1,135 @@ +/* -*- 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/. + */ + +#include + +#include +#include + +class LengthTest : public CppUnit::TestFixture +{ +public: +void testBasic() +{ +gfx::Length cm = 1_cm + 5_cm - 2_cm; +CPPUNIT_ASSERT_DOUBLES_EQUAL(4.0, cm.as_cm(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.04, cm.as_m(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(40.0, cm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(144), cm.raw()); + +gfx::Length cm2 = 5_cm * 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), cm2.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, cm2.as_cm(), 1e-4); + +// 1 km - 50 m = 950 m = 95000 cm +gfx::Length cm3 = 10_cm - 5000_cm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(342), cm3.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(95000.0, cm3.as_cm(), 1e-4); + +gfx::Length cm4(1_cm); +cm4 /= 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(18), cm4.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, cm4.as_cm(), 1e-4); + +// (635 * 20) + 3 * (635 * 15) = 41275EMU +gfx::Length pt = 1_pt + 3_px; +CPPUNIT_ASSERT_DOUBLES_EQUAL(3.25, pt.as_pt(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(65.0, pt.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0451, pt.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(41275), pt.raw()); + +gfx::Length inch = 1_in; // 1440 * 635 +CPPUNIT_ASSERT_DOUBLES_EQUAL(1440.0, inch.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(96.0, inch.as_px(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, inch.as_in(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(914400.0, inch.as_emu(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(914400), inch.raw()); + +// Conversion +sal_Int64 asNumber(17_pt); +asNumber += sal_Int64(1_pt); +gfx::Length asLength = gfx::Length::emu(asNumber); +CPPUNIT_ASSERT_EQUAL(sal_Int64(18 * 635 * 20), asLength.raw()); + +gfx::Length maximum = gfx::Length::emu(SAL_MAX_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(256204778801.5, maximum.as_m(), 1e-1); +// 256204778 km +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MAX_INT64), maximum.raw()); + +gfx::Length minimum = gfx::Length::emu(SAL_MIN_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(-256204778801.5, minimum.as_m(), 1e-1); +CPPUNIT_ASSERT_DOUBLES_EQUAL(double(SAL_MIN_INT64), minimum.as_emu(), 1e-1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MIN_INT64), minimum.raw()); + +// 27 emu + 33 emu + 360 emu = 420 +gfx::Length emus = 27_emu + 33_emu + 1_hmm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(420), emus.raw()); + +// Creation from number +int number = 10; +auto asCm = gfx::Length::cm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asCm.as_cm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), asCm.raw()); + +auto asMm = gfx::Length::mm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asMm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(36), asMm.raw()); + +auto asInch = gfx::Length::in(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asInch.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(9144000), asInch.raw()); + +auto aa = gfx::Length::hmm(10.1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(3600), aa.raw()); + +auto bb = gfx::Length::hmm(10.1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(3636), bb.raw()); +} + +void testInRange() +{ +gfx::Range2DL aRange(1_cm, 2_cm, 2_cm, 30_mm); +CPPUNIT_ASSERT_EQUAL(1_cm, aRange.getMinX()); +CPPUNIT_ASSERT_EQUAL(2_cm, aRange.getMaxX()); +
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - basegfx/CppunitTest_basegfx.mk basegfx/test include/basegfx
Rebased ref, commits from common ancestor: commit 064d276bbc2ad50ae73a3ddc24c48a4d4936f25d Author: Tomaž Vajngerl AuthorDate: Thu Nov 12 10:01:20 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 16:11:54 2022 +0200 basegfx: added Length class as the base unit for length Change-Id: I1d4790b60dd784e8b2e2e438274f3ebd6db4b60c diff --git a/basegfx/CppunitTest_basegfx.mk b/basegfx/CppunitTest_basegfx.mk index 88f4966262f2..98d3a5d41926 100644 --- a/basegfx/CppunitTest_basegfx.mk +++ b/basegfx/CppunitTest_basegfx.mk @@ -45,6 +45,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,basegfx,\ basegfx/test/clipstate \ basegfx/test/genericclipper \ basegfx/test/VectorTest \ +basegfx/test/LengthUnitTest \ )) # vim: set noet sw=4 ts=4: diff --git a/basegfx/test/LengthUnitTest.cxx b/basegfx/test/LengthUnitTest.cxx new file mode 100644 index ..421e98934c90 --- /dev/null +++ b/basegfx/test/LengthUnitTest.cxx @@ -0,0 +1,135 @@ +/* -*- 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/. + */ + +#include + +#include +#include + +class LengthTest : public CppUnit::TestFixture +{ +public: +void testBasic() +{ +gfx::Length cm = 1_cm + 5_cm - 2_cm; +CPPUNIT_ASSERT_DOUBLES_EQUAL(4.0, cm.as_cm(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.04, cm.as_m(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(40.0, cm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(144), cm.raw()); + +gfx::Length cm2 = 5_cm * 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), cm2.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, cm2.as_cm(), 1e-4); + +// 1 km - 50 m = 950 m = 95000 cm +gfx::Length cm3 = 10_cm - 5000_cm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(342), cm3.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(95000.0, cm3.as_cm(), 1e-4); + +gfx::Length cm4(1_cm); +cm4 /= 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(18), cm4.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, cm4.as_cm(), 1e-4); + +// (635 * 20) + 3 * (635 * 15) = 41275EMU +gfx::Length pt = 1_pt + 3_px; +CPPUNIT_ASSERT_DOUBLES_EQUAL(3.25, pt.as_pt(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(65.0, pt.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0451, pt.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(41275), pt.raw()); + +gfx::Length inch = 1_in; // 1440 * 635 +CPPUNIT_ASSERT_DOUBLES_EQUAL(1440.0, inch.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(96.0, inch.as_px(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, inch.as_in(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(914400.0, inch.as_emu(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(914400), inch.raw()); + +// Conversion +sal_Int64 asNumber(17_pt); +asNumber += sal_Int64(1_pt); +gfx::Length asLength = gfx::Length::emu(asNumber); +CPPUNIT_ASSERT_EQUAL(sal_Int64(18 * 635 * 20), asLength.raw()); + +gfx::Length maximum = gfx::Length::emu(SAL_MAX_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(256204778801.5, maximum.as_m(), 1e-1); +// 256204778 km +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MAX_INT64), maximum.raw()); + +gfx::Length minimum = gfx::Length::emu(SAL_MIN_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(-256204778801.5, minimum.as_m(), 1e-1); +CPPUNIT_ASSERT_DOUBLES_EQUAL(double(SAL_MIN_INT64), minimum.as_emu(), 1e-1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MIN_INT64), minimum.raw()); + +// 27 emu + 33 emu + 360 emu = 420 +gfx::Length emus = 27_emu + 33_emu + 1_hmm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(420), emus.raw()); + +// Creation from number +int number = 10; +auto asCm = gfx::Length::cm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asCm.as_cm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), asCm.raw()); + +auto asMm = gfx::Length::mm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asMm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(36), asMm.raw()); + +auto asInch = gfx::Length::in(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asInch.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(9144000), asInch.raw()); + +auto aa = gfx::Length::hmm(10.1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(3600), aa.raw()); + +auto bb = gfx::Length::hmm(10.1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(3636), bb.raw()); +} + +void testInRange() +{ +gfx::Range2DL aRange(1_cm, 2_cm, 2_cm, 30_mm); +CPPUNIT_ASSERT_EQUAL(1_cm, aRange.getMinX()); +CPPUNIT_ASSERT_EQUAL(2_cm, aRange.getMaxX()); +
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 3 commits - basegfx/CppunitTest_basegfx.mk basegfx/test download.lst external/frozen external/Module_external.mk include/basegfx Ma
Rebased ref, commits from common ancestor: commit 49434467a49c00e2928f6d3669bdfc5f45811af3 Author: Tomaž Vajngerl AuthorDate: Thu Nov 12 10:01:20 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 16:08:03 2022 +0200 basegfx: added Length class as the base unit for length Change-Id: I1d4790b60dd784e8b2e2e438274f3ebd6db4b60c diff --git a/basegfx/CppunitTest_basegfx.mk b/basegfx/CppunitTest_basegfx.mk index 88f4966262f2..98d3a5d41926 100644 --- a/basegfx/CppunitTest_basegfx.mk +++ b/basegfx/CppunitTest_basegfx.mk @@ -45,6 +45,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,basegfx,\ basegfx/test/clipstate \ basegfx/test/genericclipper \ basegfx/test/VectorTest \ +basegfx/test/LengthUnitTest \ )) # vim: set noet sw=4 ts=4: diff --git a/basegfx/test/LengthUnitTest.cxx b/basegfx/test/LengthUnitTest.cxx new file mode 100644 index ..40c21aa7bc90 --- /dev/null +++ b/basegfx/test/LengthUnitTest.cxx @@ -0,0 +1,120 @@ +/* -*- 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/. + */ + +#include +#include + +#include +#include + +struct LengthTraits +{ +static constexpr gfx::Length minVal() { return gfx::Length::min(); }; +static constexpr gfx::Length maxVal() { return gfx::Length::max(); }; +static constexpr gfx::Length neutral() { return gfx::Length(); }; + +typedef gfx::Length DifferenceType; +}; + +class LengthTest : public CppUnit::TestFixture +{ +public: +void test() +{ +gfx::Length cm = 1_cm + 5_cm - 2_cm; +CPPUNIT_ASSERT_DOUBLES_EQUAL(4.0, cm.as_cm(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.04, cm.as_m(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(40.0, cm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(144), cm.raw()); + +gfx::Length cm2 = 5_cm * 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), cm2.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, cm2.as_cm(), 1e-4); + +// 1 km - 50 m = 950 m = 95000 cm +gfx::Length cm3 = 10_cm - 5000_cm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(342), cm3.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(95000.0, cm3.as_cm(), 1e-4); + +gfx::Length cm4(1_cm); +cm4 /= 2; +CPPUNIT_ASSERT_EQUAL(sal_Int64(18), cm4.raw()); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, cm4.as_cm(), 1e-4); + +// (635 * 20) + 3 * (635 * 15) = 41275EMU +gfx::Length pt = 1_pt + 3_px; +CPPUNIT_ASSERT_DOUBLES_EQUAL(3.25, pt.as_pt(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(65.0, pt.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0451, pt.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(41275), pt.raw()); + +gfx::Length inch = 1_in; // 1440 * 635 +CPPUNIT_ASSERT_DOUBLES_EQUAL(1440.0, inch.as_twip(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(96.0, inch.as_px(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, inch.as_in(), 1e-4); +CPPUNIT_ASSERT_DOUBLES_EQUAL(914400.0, inch.as_emu(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(914400), inch.raw()); + +// Conversion +sal_Int64 asNumber(17_pt); +asNumber += sal_Int64(1_pt); +gfx::Length asLength = gfx::Length::emu(asNumber); +CPPUNIT_ASSERT_EQUAL(sal_Int64(18 * 635 * 20), asLength.raw()); + +gfx::Length maximum = gfx::Length::emu(SAL_MAX_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(256204778801.5, maximum.as_m(), 1e-1); +// 256204778 km +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MAX_INT64), maximum.raw()); + +gfx::Length minimum = gfx::Length::emu(SAL_MIN_INT64); +CPPUNIT_ASSERT_DOUBLES_EQUAL(-256204778801.5, minimum.as_m(), 1e-1); +CPPUNIT_ASSERT_DOUBLES_EQUAL(double(SAL_MIN_INT64), minimum.as_emu(), 1e-1); +CPPUNIT_ASSERT_EQUAL(sal_Int64(SAL_MIN_INT64), minimum.raw()); + +// 27 emu + 33 emu + 360 emu = 420 +gfx::Length emus = 27_emu + 33_emu + 1_hmm; +CPPUNIT_ASSERT_EQUAL(sal_Int64(420), emus.raw()); + +// Creation from number +int number = 10; +auto asCm = gfx::Length::cm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asCm.as_cm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(360), asCm.raw()); + +auto asMm = gfx::Length::mm(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asMm.as_mm(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(36), asMm.raw()); + +auto asInch = gfx::Length::in(number); +CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, asInch.as_in(), 1e-4); +CPPUNIT_ASSERT_EQUAL(sal_Int64(9144000), asInch.raw()); + +typedef basegfx::Range2D Range2DL; +typedef basegfx::Tuple2D Tuple2DL; + +Range2DL
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/inc chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk
chart2/Library_chartcontroller.mk |2 chart2/UIConfig_chart2.mk |1 chart2/inc/strings.hrc |2 chart2/source/controller/dialogs/ObjectNameProvider.cxx|3 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |7 chart2/source/controller/dialogs/tp_DataTable.cxx | 113 + chart2/source/controller/dialogs/tp_DataTable.hxx | 43 +++ chart2/source/controller/inc/DataTableItemConverter.hxx| 58 + chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx | 108 + chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx |8 chart2/source/controller/main/ChartController_Properties.cxx | 12 + chart2/source/controller/main/ObjectHierarchy.cxx |8 chart2/source/inc/ObjectIdentifier.hxx |4 chart2/source/inc/chartview/ChartSfxItemIds.hxx|9 chart2/source/tools/ObjectIdentifier.cxx | 23 ++ chart2/source/view/main/ChartItemPool.cxx |5 chart2/uiconfig/ui/tp_DataTable.ui | 115 ++ 17 files changed, 520 insertions(+), 1 deletion(-) New commits: commit b866cd30b473d9668652f35b7023a96760c81e6b Author: Tomaž Vajngerl AuthorDate: Tue Jun 28 07:48:45 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 10:58:23 2022 +0200 chart2: add UI to the data table This adds a new object type "Data Table", with all the object identifiers and converters of properties. The data table is now shown in the drop-down of chart elements. A properties dialog was added, which allows to change properties of a data table. This contains the area, line and font tab pages and a new tab page specific for data tables, to change if the horiz. or vert. borders, key or the outline should be show. Change-Id: I9b4cd58cffbcc952daaa2c0c8f8a5a17e38ac293 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138246 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 300ea910badeef2c8038d9bb20683ea26f4b1973) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138495 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index 05f031415213..c8689302b2ac 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -133,6 +133,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/tp_DataLabel \ chart2/source/controller/dialogs/tp_DataPointOption \ chart2/source/controller/dialogs/tp_DataSource \ +chart2/source/controller/dialogs/tp_DataTable \ chart2/source/controller/dialogs/tp_ErrorBars \ chart2/source/controller/dialogs/tp_LegendPosition \ chart2/source/controller/dialogs/tp_PointGeometry \ @@ -148,6 +149,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/itemsetwrapper/AxisItemConverter \ chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter \ chart2/source/controller/itemsetwrapper/DataPointItemConverter \ +chart2/source/controller/itemsetwrapper/DataTableItemConverter \ chart2/source/controller/itemsetwrapper/ErrorBarItemConverter \ chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter \ chart2/source/controller/itemsetwrapper/ItemConverter \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 67d64b18b597..59af510c5845 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -68,6 +68,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/tp_DataLabel \ chart2/uiconfig/ui/tp_DataPointOption \ chart2/uiconfig/ui/tp_DataSource \ + chart2/uiconfig/ui/tp_DataTable \ chart2/uiconfig/ui/tp_ErrorBars \ chart2/uiconfig/ui/tp_LegendPosition \ chart2/uiconfig/ui/tp_PolarOptions \ diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc index ab6ca48c8376..9a9943df1f3c 100644 --- a/chart2/inc/strings.hrc +++ b/chart2/inc/strings.hrc @@ -48,6 +48,7 @@ #define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance") #define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination") #define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography") +#define STR_PAGE_DATA_TABLE NC_("STR_PAGE_DATA_TABLE", "Data Table") #define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION")
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/controller/main/ObjectHierarchy.cxx | 32 +++--- 1 file changed, 16 insertions(+), 16 deletions(-) New commits: commit b9ad0b67e2fc4825eff4a68c1dc250fd3be82a5b Author: Tomaž Vajngerl AuthorDate: Fri Jun 17 16:38:54 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 10:57:28 2022 +0200 chart2: remove unneeded class prefix in ObjectHierarchy.cxx Change-Id: Iee007f7ff4d9665ee089712e7ba98090a8090609 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138245 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 7601cf11ea31d4b74d82fde28aba65a2e2051258) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138494 Tested-by: Tomaž Vajngerl diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx index 064508bbdef6..9c132d46a10a 100644 --- a/chart2/source/controller/main/ObjectHierarchy.cxx +++ b/chart2/source/controller/main/ObjectHierarchy.cxx @@ -134,7 +134,7 @@ void ObjectHierarchy::createTree( const Reference< XChartDocument >& xChartDocum ObjectIdentifier aDiaOID; if( xDiagram.is() ) aDiaOID = ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xModel ) ); -ObjectHierarchy::tChildContainer aTopLevelContainer; +tChildContainer aTopLevelContainer; // First Level @@ -185,7 +185,7 @@ void ObjectHierarchy::createTree( const Reference< XChartDocument >& xChartDocum createDiagramTree( aTopLevelContainer, xChartDocument, xDiagram ); else { -ObjectHierarchy::tChildContainer aSubContainer; +tChildContainer aSubContainer; createDiagramTree( aSubContainer, xChartDocument, xDiagram ); if( !aSubContainer.empty() ) m_aChildMap[ aDiaOID ] = aSubContainer; @@ -206,11 +206,11 @@ void ObjectHierarchy::createTree( const Reference< XChartDocument >& xChartDocum aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) ); if( ! aTopLevelContainer.empty()) -m_aChildMap[ ObjectHierarchy::getRootNodeOID() ] = aTopLevelContainer; +m_aChildMap[ObjectHierarchy::getRootNodeOID()] = aTopLevelContainer; } void ObjectHierarchy::createLegendTree( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const Reference< XChartDocument > & xChartDoc, const Reference< XDiagram > & xDiagram ) { @@ -225,7 +225,7 @@ void ObjectHierarchy::createLegendTree( { Reference< container::XIndexAccess > xLegendShapeContainer( m_pExplicitValueProvider->getShapeForCID( aLegendOID.getObjectCID() ), uno::UNO_QUERY ); -ObjectHierarchy::tChildContainer aLegendEntryOIDs; +tChildContainer aLegendEntryOIDs; lcl_getChildOIDs( aLegendEntryOIDs, xLegendShapeContainer ); m_aChildMap[ aLegendOID ] = aLegendEntryOIDs; @@ -233,7 +233,7 @@ void ObjectHierarchy::createLegendTree( } void ObjectHierarchy::createAxesTree( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const Reference< XChartDocument > & xChartDoc, const Reference< XDiagram > & xDiagram ) { @@ -298,7 +298,7 @@ void ObjectHierarchy::createAxesTree( } void ObjectHierarchy::createWallAndFloor( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const Reference< XDiagram > & xDiagram ) { sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); @@ -316,7 +316,7 @@ void ObjectHierarchy::createWallAndFloor( } void ObjectHierarchy::createDiagramTree( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const Reference< XChartDocument > & xChartDoc, const Reference< XDiagram > & xDiagram ) { @@ -334,7 +334,7 @@ void ObjectHierarchy::createDiagramTree( } void ObjectHierarchy::createDataSeriesTree( -ObjectHierarchy::tChildContainer & rOutDiagramSubContainer, +tChildContainer & rOutDiagramSubContainer, const Reference< XDiagram > & xDiagram ) { Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); @@ -365,7 +365,7 @@ void ObjectHierarchy::createDataSeriesTree( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForParticle( aSeriesParticle ) ) ); rOutDiagramSubContainer.push_back( aSeriesOID ); -ObjectHierarchy::tChildContainer aSeriesSubContainer; +tChildContainer aSeriesSubContainer; Reference< chart2::XDataSeries > const & xSeries = aSeriesSeq[nSeriesIdx]; @@ -443,7 +443,7 @@ void ObjectHierarchy::createDataSeriesTree( } } -void ObjectHierarchy::createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer ) +void
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/controller/main/ObjectHierarchy.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 288273f8078aca77c5b43ffd59089d6c32ae3e2f Author: Tomaž Vajngerl AuthorDate: Fri Jun 17 16:29:23 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 10:55:56 2022 +0200 chart2: call clear instead of creating a new empty map Change-Id: I8b21909e92b558240e84cffd9432e0d9e270284e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138244 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit b3f71d852566059b98457edbc0685ef2191342ea) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138493 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx index 7934f58fc4d0..064508bbdef6 100644 --- a/chart2/source/controller/main/ObjectHierarchy.cxx +++ b/chart2/source/controller/main/ObjectHierarchy.cxx @@ -123,7 +123,7 @@ namespace chart void ObjectHierarchy::createTree( const Reference< XChartDocument >& xChartDocument ) { -m_aChildMap = tChildMap();//clear tree +m_aChildMap.clear(); if( !xChartDocument.is() ) return;
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/controller/inc/ObjectHierarchy.hxx | 24 ++- 1 file changed, 11 insertions(+), 13 deletions(-) New commits: commit 6219beab24a06c4f69fb6df7e5a068e8af60d245 Author: Tomaž Vajngerl AuthorDate: Fri Jun 17 16:28:38 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 19 10:55:19 2022 +0200 chart2: remove unneeded class prefix in ObjectHierarchy.hxx Change-Id: I1c851933e9b25dcd9a0dc29758baad8f3be7cb2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138243 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 4aa706e345db84b60706b5e17102a48e5db6563e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138492 Tested-by: Tomaž Vajngerl diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx b/chart2/source/controller/inc/ObjectHierarchy.hxx index bac8deec2204..9391a110fd68 100644 --- a/chart2/source/controller/inc/ObjectHierarchy.hxx +++ b/chart2/source/controller/inc/ObjectHierarchy.hxx @@ -51,11 +51,10 @@ public: static bool isRootNode( const ObjectIdentifier& rOID ); /// equal to getChildren( getRootNodeOID()) -const tChildContainer & getTopLevelChildren() const; -bool hasChildren( const ObjectIdentifier& rParent ) const; -const tChildContainer & getChildren( const ObjectIdentifier& rParent ) const; - -const tChildContainer & getSiblings( const ObjectIdentifier& rNode ) const; +const tChildContainer& getTopLevelChildren() const; +bool hasChildren(const ObjectIdentifier& rParent) const; +const tChildContainer& getChildren(const ObjectIdentifier& rParent) const; +const tChildContainer& getSiblings(const ObjectIdentifier& rNode) const; /// The result is empty, if the node cannot be found in the tree ObjectIdentifier getParent( const ObjectIdentifier& rNode ) const; @@ -65,30 +64,29 @@ public: private: void createTree( const css::uno::Reference< css::chart2::XChartDocument > & xChartDocument ); void createAxesTree( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc, const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); void createDiagramTree( -ObjectHierarchy::tChildContainer& rContainer, +tChildContainer& rContainer, const css::uno::Reference< css::chart2::XChartDocument >& xChartDoc, const css::uno::Reference< css::chart2::XDiagram >& xDiagram ); void createDataSeriesTree( -ObjectHierarchy::tChildContainer & rOutDiagramSubContainer, +tChildContainer & rOutDiagramSubContainer, const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); static void createWallAndFloor( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); void createLegendTree( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const css::uno::Reference< css::chart2::XChartDocument > & xChartDoc, const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); -void createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer ); +void createAdditionalShapesTree( tChildContainer& rContainer ); ObjectIdentifier getParentImpl( const ObjectIdentifier& rParentOID, const ObjectIdentifier& rOID ) const; -typedef std::map< ObjectIdentifier, ObjectHierarchy::tChildContainer > -tChildMap; +typedef std::map tChildMap; tChildMap m_aChildMap; ExplicitValueProvider* m_pExplicitValueProvider; bool m_bFlattenDiagram;
[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
chart2/source/model/main/DataTable.cxx | 27 ++-- chart2/source/view/axes/VAxisBase.cxx |3 chart2/source/view/axes/VAxisBase.hxx |5 chart2/source/view/axes/VCartesianAxis.cxx |6 - chart2/source/view/axes/VCartesianAxis.hxx |3 chart2/source/view/axes/VCartesianCoordinateSystem.cxx |2 chart2/source/view/inc/DataTableView.hxx | 11 + chart2/source/view/main/DataTableView.cxx | 94 + 8 files changed, 110 insertions(+), 41 deletions(-) New commits: commit f22122c8d5ca38fb0aaa682083a455040ccf3f92 Author: Tomaž Vajngerl AuthorDate: Fri May 20 23:55:45 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Thu Aug 18 08:51:28 2022 +0200 chart2: apply line props. to borders when rendering a data table This sets the color, line width, line style to the borders of the table when rendering the data table. We also need the ChartModel inside DataTableView, so we can access the needed line dashes. Change-Id: Id3bef23b75e88517d6569ad87a716f178ed64343 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137158 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 6c24f112ad86df77f2de27a31742bca01ed56bdf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138440 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 880c10568e6f..209fc508f624 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -246,7 +246,8 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter ) } void VAxisBase::createDataTableView(std::vector>& /*rSeriesPlotterList*/, - uno::Reference const& /*xNumberFormatsSupplier*/) + uno::Reference const& /*xNumberFormatsSupplier*/, +uno::Reference const& /*xChartDoc*/) { } diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx index b65de0d4c954..6992ff05fd89 100644 --- a/chart2/source/view/axes/VAxisBase.hxx +++ b/chart2/source/view/axes/VAxisBase.hxx @@ -18,6 +18,7 @@ */ #pragma once +#include #include "VAxisOrGridBase.hxx" #include "VAxisProperties.hxx" #include "Tickmarks.hxx" @@ -29,6 +30,7 @@ namespace chart class VSeriesPlotter; class DataTableView; +class ChartModel; class VAxisBase : public VAxisOrGridBase { @@ -63,7 +65,8 @@ public: void setExtraLinePositionAtOtherAxis( double fCrossingAt ); virtual void createDataTableView(std::vector>& rSeriesPlotterList, - css::uno::Reference const& xNumberFormatsSupplier); + css::uno::Reference const& xNumberFormatsSupplier, + css::uno::Reference const& xChartDoc); std::shared_ptr getDataTableView() { return m_pDataTableView; } diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 641269b6b367..0a731bf086d2 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -2007,11 +2008,12 @@ void VCartesianAxis::createShapes() } void VCartesianAxis::createDataTableView(std::vector>& rSeriesPlotterList, - Reference const& xNumberFormatsSupplier) + uno::Reference const& xNumberFormatsSupplier, + uno::Reference const& xChartDoc) { if (m_aAxisProperties.m_bDisplayDataTable) { -m_pDataTableView.reset(new DataTableView(m_aAxisProperties.m_xDataTableModel)); +m_pDataTableView.reset(new DataTableView(xChartDoc, m_aAxisProperties.m_xDataTableModel)); m_pDataTableView->initializeValues(rSeriesPlotterList); m_xNumberFormatsSupplier = xNumberFormatsSupplier; } diff --git a/chart2/source/view/axes/VCartesianAxis.hxx b/chart2/source/view/axes/VCartesianAxis.hxx index eb70e5d3c3a5..1027e4fc2188 100644 --- a/chart2/source/view/axes/VCartesianAxis.hxx +++ b/chart2/source/view/axes/VCartesianAxis.hxx @@ -100,7 +100,8 @@ public: }; void createDataTableView(std::vector>& rSeriesPlotterList, - css::uno::Reference const& xNumberFormatsSupplier) override; + css::uno::Reference const& xNumberFormatsSupplier, + css::uno::Reference const& xChartDoc) override; private: //methods /** * Go through all tick label positions and decide which labels to display diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/source
chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 19 1 file changed, 1 insertion(+), 18 deletions(-) New commits: commit ca423466c1c080a39b277a6e989e0adb5c38a85e Author: Tomaž Vajngerl AuthorDate: Fri May 20 18:20:51 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Thu Aug 18 08:50:57 2022 +0200 chart2: remove setting DataTable* props. from old chart::XDialog No API change needed as the properties were not officialy part of the API in the first place. Change-Id: I8682087d13ab2e9eb1c619646b87cde59c3a8e45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137156 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit d518ac1e9ec866785a13367491c52d2ac72d85ec) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138438 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index f46abaae3027..fc158a6d0a43 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -132,9 +132,6 @@ enum PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE, PROP_DIAGRAM_AUTOMATIC_SIZE, -PROP_DIAGRAM_DATATABLEHBORDER, -PROP_DIAGRAM_DATATABLEVBORDER, -PROP_DIAGRAM_DATATABLEOUTLINE, PROP_DIAGRAM_EXTERNALDATA }; @@ -376,21 +373,7 @@ void lcl_AddPropertiesToVector( cppu::UnoType::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT ); -rOutProperties.emplace_back( "DataTableHBorder", -PROP_DIAGRAM_DATATABLEHBORDER, - cppu::UnoType::get(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT ); -rOutProperties.emplace_back( "DataTableVBorder", -PROP_DIAGRAM_DATATABLEVBORDER, - cppu::UnoType::get(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT ); -rOutProperties.emplace_back( "DataTableOutline", -PROP_DIAGRAM_DATATABLEOUTLINE, - cppu::UnoType::get(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( "ExternalData", PROP_DIAGRAM_EXTERNALDATA, cppu::UnoType::get(),
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source oox/inc oox/source
chart2/source/view/axes/VCartesianAxis.cxx|2 chart2/source/view/inc/DataTableView.hxx |6 + chart2/source/view/main/DataTableView.cxx | 74 -- oox/inc/drawingml/chart/datatablemodel.hxx|3 oox/source/drawingml/chart/datatablecontext.cxx |7 +- oox/source/drawingml/chart/datatableconverter.cxx |3 6 files changed, 74 insertions(+), 21 deletions(-) New commits: commit ce9d9d1bf429cf2601be2f7288fa5d3d93612f79 Author: Tomaž Vajngerl AuthorDate: Thu May 19 21:52:15 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Thu Aug 18 08:50:49 2022 +0200 chart2: use {V,H}Border, Outline Data Table props. at rendering insert DataTable class into DataTableView, so it is possible to take the properties into account when rendering. Change rendering: VBorder - draw vert. border of data table HBorder - draw horiz. border of data table Outline - draw the outline borders of a data table Change-Id: I8348d0672d9c188014d664d667abddde8ebbc7c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137155 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 7cb504bd5e2c49a73af3270d1ecefe1bd838b66f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138437 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index d105ec8631c0..641269b6b367 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -2011,7 +2011,7 @@ void VCartesianAxis::createDataTableView(std::vectorinitializeValues(rSeriesPlotterList); m_xNumberFormatsSupplier = xNumberFormatsSupplier; } diff --git a/chart2/source/view/inc/DataTableView.hxx b/chart2/source/view/inc/DataTableView.hxx index 2d368212309a..fb7fe83929f9 100644 --- a/chart2/source/view/inc/DataTableView.hxx +++ b/chart2/source/view/inc/DataTableView.hxx @@ -12,6 +12,7 @@ #include #include #include +#include namespace chart { @@ -21,17 +22,18 @@ class DataTableView final { css::uno::Reference m_xTarget; rtl::Reference m_xTableShape; +rtl::Reference m_xDataTableModel; std::vector m_aDataSeriesNames; std::vector m_aXValues; std::vector> m_pDataSeriesValues; public: -DataTableView(); +DataTableView(rtl::Reference const& rDataTableModel); void initializeShapes(const css::uno::Reference& xTarget); void initializeValues(std::vector>& rSeriesPlotterList); void createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd, - sal_Int32 nDistance); + sal_Int32 nColumnWidth); }; } //namespace chart diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 7614fa0ea1b3..2928458397c0 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -30,11 +30,15 @@ using namespace css; namespace chart { -DataTableView::DataTableView() = default; +DataTableView::DataTableView(rtl::Reference const& rDataTableModel) +: m_xDataTableModel(rDataTableModel) +{ +} namespace { -void setCellDefaults(uno::Reference& xPropertySet) +void setCellDefaults(uno::Reference& xPropertySet, bool bLeft, bool bTop, + bool bRight, bool bBottom) { xPropertySet->setPropertyValue("FillColor", uno::makeAny(Color(0xFF))); xPropertySet->setPropertyValue("TextVerticalAdjust", @@ -45,10 +49,14 @@ void setCellDefaults(uno::Reference& xPropertySet) aBorderLine.LineWidth = o3tl::convert(0.5, o3tl::Length::pt, o3tl::Length::mm100); aBorderLine.Color = 0x00; -xPropertySet->setPropertyValue("TopBorder", uno::makeAny(aBorderLine)); -xPropertySet->setPropertyValue("BottomBorder", uno::makeAny(aBorderLine)); -xPropertySet->setPropertyValue("LeftBorder", uno::makeAny(aBorderLine)); -xPropertySet->setPropertyValue("RightBorder", uno::makeAny(aBorderLine)); +if (bLeft) +xPropertySet->setPropertyValue("LeftBorder", uno::makeAny(aBorderLine)); +if (bTop) +xPropertySet->setPropertyValue("TopBorder", uno::makeAny(aBorderLine)); +if (bRight) +xPropertySet->setPropertyValue("RightBorder", uno::makeAny(aBorderLine)); +if (bBottom) +xPropertySet->setPropertyValue("BottomBorder", uno::makeAny(aBorderLine)); } void setTopCell(uno::Reference& xPropertySet) @@ -67,7 +75,7 @@ void setTopCell(uno::Reference& xPropertySet) } } void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd, - sal_Int32 nColumnSize) + sal_Int32 nColumnWidth) { if (!m_xTarget.is()) return; @@ -76,7 +84,6 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/main/DataTableView.cxx | 49 ++ 1 file changed, 36 insertions(+), 13 deletions(-) New commits: commit 9923f2416b63abc09bf8cd83796d1d681e9de225 Author: Tomaž Vajngerl AuthorDate: Thu Aug 18 00:09:25 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 18 08:48:34 2022 +0200 chart2: improve keys (symbols) rendering in a data table - better symbol positioning taking symbol height and cell height into account. - symbol height depends on font size (as with the legend) - take symbol aspect ratio into account - remove hardcoded values Change-Id: I3537d82538035cd31b928d4bb6fc5572914fcd13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138463 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 5e1a7157cc3e..5504e08a4950 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -339,21 +339,40 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV // ROW HEADER // Prepare keys (symbols) sal_Int32 nMaxSymbolWidth = 0; +constexpr const sal_Int32 constSymbolMargin = 100; // 1mm if (bKeys) { +uno::Reference xDataTableProperties(m_xDataTableModel); +float fFontHeight = 0.0; +xDataTableProperties->getPropertyValue("CharHeight") >>= fFontHeight; +fFontHeight = o3tl::convert(fFontHeight, o3tl::Length::pt, o3tl::Length::mm100); + +sal_Int32 nSymbolHeight = sal_Int32(fFontHeight * 0.6); +sal_Int32 nSymbolWidth = nSymbolHeight; + for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList) { if (pSeriesPlotter) { -sal_Int32 nSymbolWidth = 300; -if (pSeriesPlotter->getLegendSymbolStyle() == LegendSymbolStyle::Line) -nSymbolWidth = 600; +awt::Size aCurrentRatio = pSeriesPlotter->getPreferredLegendKeyAspectRatio(); +sal_Int32 nCurrentWidth = aCurrentRatio.Width; +if (aCurrentRatio.Height > 0) +nCurrentWidth = nSymbolHeight * aCurrentRatio.Width / aCurrentRatio.Height; +nSymbolWidth = std::max(nSymbolWidth, nCurrentWidth); +} +} +nMaxSymbolWidth = nSymbolWidth; -nMaxSymbolWidth = std::max(nSymbolWidth, nMaxSymbolWidth); +for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList) +{ +if (pSeriesPlotter) +{ +awt::Size aSize(nSymbolWidth, nSymbolHeight); +std::vector aNewEntries += pSeriesPlotter->createSymbols(aSize, m_xTarget, m_xComponentContext); -std::vector aNewEntries = pSeriesPlotter->createSymbols( -{ nSymbolWidth, 300 }, m_xTarget, m_xComponentContext); -aSymbols.insert(aSymbols.end(), aNewEntries.begin(), aNewEntries.end()); +for (auto const& rSymbol : aNewEntries) +aSymbols.push_back(rSymbol); } } } @@ -381,8 +400,8 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV xCellPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_LEFT)); if (bKeys) { -xCellPropertySet->setPropertyValue("ParaLeftMargin", - uno::Any(nMaxSymbolWidth + sal_Int32(200))); +xCellPropertySet->setPropertyValue( +"ParaLeftMargin", uno::Any(nMaxSymbolWidth + sal_Int32(2 * constSymbolMargin))); } } nRow++; @@ -433,8 +452,8 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV xBroadcaster->unlockBroadcasts(); -pTableObject->DistributeColumns(0, nColumnCount - 1, true, true); -pTableObject->DistributeRows(0, nRowCount - 1, true, true); +pTableObject->DistributeColumns(0, nColumnCount, true, true); +pTableObject->DistributeRows(0, nRowCount, true, true); xBroadcaster->lockBroadcasts(); @@ -461,8 +480,12 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV xPropertySet->getPropertyValue("Height") >>= nHeight; if (i > 0) { -aSymbols[i - 1].xSymbol->setPosition( -{ nTableX + 100, nTableY + nTotalHeight + 100 }); +auto& rSymbol = aSymbols[i - 1].xSymbol; +sal_Int32 nSymbolHeight = rSymbol->getSize().Height; +sal_Int32 nSymbolY += basegfx::fround(double(nHeight) / 2.0 - double(nSymbolHeight) / 2.0); +rSymbol->setPosition( +{ nTableX + constSymbolMargin,
[Libreoffice-commits] core.git: 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 e425ee936ee762825a20cd10e6027163eab747a2 Author: Tomaž Vajngerl AuthorDate: Wed Aug 17 23:22:41 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 18 08:48:17 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 diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index e5f3933aa8cb..5e1a7157cc3e 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::Any(style::ParagraphAdjust_CENTER)); } commit 3115a9f3a903f14a71003f51dc30eed824ea92fb Author: Tomaž Vajngerl AuthorDate: Wed Aug 17 23:20:58 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 18 08:48:05 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 diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index e552dea82fb9..ff52053c97c9 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -559,7 +559,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/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
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/main/SeriesPlotterContainer.cxx |6 ++ chart2/source/view/main/SeriesPlotterContainer.hxx |1 + 2 files changed, 7 insertions(+) New commits: commit d50bfb406900ddea3a4b2e0c59e0b983798780d4 Author: Tomaž Vajngerl AuthorDate: Sat Aug 13 23:29:01 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 17 08:23:23 2022 +0200 chart2: for a data table we need to force shift category position To be able to show the data table correctly we need to always show the categories "between tick marks" as otherwise the table columns wouldn't align correctly. This forces that the shift position is always enabled. Change-Id: Ia6a627931fcaba64f0f974faf1d8763405ad410d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138337 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx index 1eb6a64a42c5..9f2e4fbaacfa 100644 --- a/chart2/source/view/main/SeriesPlotterContainer.cxx +++ b/chart2/source/view/main/SeriesPlotterContainer.cxx @@ -170,6 +170,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart DBG_UNHANDLED_EXCEPTION("chart2"); } +if (xDiagram->getDataTable().is()) +m_bForceShiftPosition = true; + //prepare for autoscaling and shape creation // - create plotter for charttypes (for each first scale group at each plotter, as they are independent) // - add series to plotter (thus each charttype can provide minimum and maximum values for autoscaling) @@ -335,6 +338,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart bool SeriesPlotterContainer::isCategoryPositionShifted(const chart2::ScaleData& rSourceScale, bool bHasComplexCategories) { +if (m_bForceShiftPosition) +return true; + if (rSourceScale.AxisType == AxisType::CATEGORY) return bHasComplexCategories || rSourceScale.ShiftedCategoryPosition || m_bChartTypeUsesShiftedCategoryPositionPerDefault; diff --git a/chart2/source/view/main/SeriesPlotterContainer.hxx b/chart2/source/view/main/SeriesPlotterContainer.hxx index e34d07a962ff..578f2ba2760c 100644 --- a/chart2/source/view/main/SeriesPlotterContainer.hxx +++ b/chart2/source/view/main/SeriesPlotterContainer.hxx @@ -151,6 +151,7 @@ private: sal_Int32 m_nMaxAxisIndex; bool m_bChartTypeUsesShiftedCategoryPositionPerDefault; +bool m_bForceShiftPosition = false; sal_Int32 m_nDefaultDateNumberFormat; };
[Libreoffice-commits] core.git: 2 commits - chart2/source
chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx |1 chart2/source/view/axes/VAxisProperties.cxx | 13 ++ chart2/source/view/axes/VAxisProperties.hxx |3 chart2/source/view/axes/VCartesianAxis.cxx| 68 - chart2/source/view/axes/VCartesianAxis.hxx|2 chart2/source/view/inc/DataTableView.hxx | 11 +- chart2/source/view/main/DataTableView.cxx | 69 +- 7 files changed, 114 insertions(+), 53 deletions(-) New commits: commit addcd016bf1bed16299697fd18b8f9b1faf2cf3f Author: Tomaž Vajngerl AuthorDate: Sat Aug 13 14:14:00 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 16:40:39 2022 +0200 chart2: support data table rendering when the X axis is swapped In case when the X axis is swapped, so the Y axis is rendered in the place of X axis, we need to render the data table below the Y-axis labels. This is best done to put the data table into the Y-axis instead, so we get the correct size and position of the data table, and then just allow rendering of the axis labels and (re)position the table below Y-axis. Change-Id: I74aa79402a5638133b0d1ed83bbd8aad6f6c9d1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138336 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index f39420c9ce02..da038d27471c 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -257,7 +257,7 @@ void AxisProperties::init( bool bCartesian ) if( bCartesian ) { -if (m_nDimensionIndex == 0) +if ((!m_bSwapXAndY && m_nDimensionIndex == 0) || (m_bSwapXAndY && m_nDimensionIndex == 1)) { m_bDisplayDataTable = m_xDataTableModel.is(); } @@ -332,6 +332,17 @@ void AxisProperties::init( bool bCartesian ) { TOOLS_WARN_EXCEPTION("chart2", "" ); } + +if (m_bDisplayDataTable) +{ +m_bDataTableAlignAxisValuesWithColumns = (m_nDimensionIndex == 0); + +if (m_nDimensionIndex == 0) +{ +m_bDisplayLabels = false; +} + +} } AxisLabelProperties::AxisLabelProperties() diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx index 6b6b7c361ea2..0cc23602b541 100644 --- a/chart2/source/view/axes/VAxisProperties.hxx +++ b/chart2/source/view/axes/VAxisProperties.hxx @@ -111,7 +111,10 @@ struct AxisProperties final AxisLabelAlignment maLabelAlignment; +// Data table bool m_bDisplayDataTable; +bool m_bDataTableAlignAxisValuesWithColumns; + bool m_bDisplayLabels; // Compatibility option: starting from LibreOffice 5.1 the rotated diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 293d1f0479a8..82e24403d678 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1664,35 +1664,43 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel } } -void VCartesianAxis::createLabels() +void VCartesianAxis::createDataTableShape(std::unique_ptr const& rpTickFactory2D) { -if( !prepareShapeCreation() ) +// Check if we can create the data table shape +// Data table view and m_bDisplayDataTable must be true +if (!m_pDataTableView || !m_aAxisProperties.m_bDisplayDataTable) return; -std::unique_ptr apTickFactory2D(createTickFactory2D()); // throws on failure +m_pDataTableView->initializeShapes(m_xDataTableTarget); +basegfx::B2DVector aStart = rpTickFactory2D->getXaxisStartPos(); +basegfx::B2DVector aEnd = rpTickFactory2D->getXaxisEndPos(); -if (m_pDataTableView && m_aAxisProperties.m_bDisplayDataTable) -{ -m_pDataTableView->initializeShapes(m_xDataTableTarget); -basegfx::B2DVector aStart = apTickFactory2D->getXaxisStartPos(); -basegfx::B2DVector aEnd = apTickFactory2D->getXaxisEndPos(); +rpTickFactory2D->updateScreenValues(m_aAllTickInfos); -apTickFactory2D->updateScreenValues(m_aAllTickInfos); +sal_Int32 nDistance = -1; -sal_Int32 nDistance = -1; +std::unique_ptr apTickIter(createLabelTickIterator(0)); +if (apTickIter) +{ +nDistance = TickFactory2D::getTickScreenDistance(*apTickIter); +if (getTextLevelCount() > 1) +nDistance *= 2; +} -std::unique_ptr apTickIter(createLabelTickIterator(0)); -if (apTickIter) -{ -nDistance = TickFactory2D::getTickScreenDistance(*apTickIter); -if (getTextLevelCount() > 1) -nDistance *= 2; -} +if (nDistance > 0) +{ +m_pDataTableView->createShapes(aStart, aEnd, nDistance); +} +} -if
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - chart2/source include/svx svx/source
chart2/source/view/inc/ShapeFactory.hxx |3 ++ chart2/source/view/main/ShapeFactory.cxx | 14 + include/svx/unodraw/SvxTableShape.hxx| 44 +++ svx/source/unodraw/shapeimpl.hxx | 17 --- svx/source/unodraw/tableshape.cxx|1 svx/source/unodraw/unopage.cxx |1 6 files changed, 63 insertions(+), 17 deletions(-) New commits: commit 0eb7d3c8dfbfd7d8ba8bd959743b68758049 Author: Tomaž Vajngerl AuthorDate: Thu May 5 21:10:25 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 16:12:44 2022 +0200 chart2: add function to create a table shape to ShapeFactory Change-Id: I18f76c3372504c1d660aa168ee0387f61817f30a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133921 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit ed883b92efa9ca8e3006290eb2c28485e9052575) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138306 Tested-by: Jenkins CollaboraOffice diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index f2699e5372f1..5b03509a3695 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -25,6 +25,7 @@ #include #include +#include namespace chart { struct VLineProperties; } namespace com::sun::star::beans { class XPropertySet; } @@ -212,6 +213,8 @@ public: const css::uno::Reference< css::beans::XPropertySet > & xTextProperties, double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth ); +static rtl::Reference createTable(css::uno::Reference< css::drawing::XShapes >& xTarget); + css::uno::Reference< css::drawing::XShape > createInvisibleRectangle( const css::uno::Reference< css::drawing::XShapes >& xTarget diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index a7011527dfc6..7c2574c5f407 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2656,6 +2656,20 @@ void ShapeFactory::removeSubShapes( const uno::Reference< drawing::XShapes >& xS } } +rtl::Reference ShapeFactory::createTable(uno::Reference& xTarget) +{ +if (!xTarget.is()) +return nullptr; + +//create table shape +rtl::Reference xShape = new SvxTableShape(nullptr); +xShape->setShapeKind(OBJ_TABLE); +uno::Reference xShapeUno(xShape); +xTarget->add(xShapeUno); + +return xShape; +} + } //namespace chart /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit f67f444d966210ecc876acaa77f0fd75a2be9e38 Author: Tomaž Vajngerl AuthorDate: Fri Apr 22 16:53:32 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 16:12:35 2022 +0200 svx: move SvxTableShape into own file and externalize Change-Id: I0c4b37ebafa56ed50286bdcec1f2a8d5e1362f8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133918 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl (cherry picked from commit cc1be7312d9f6bd4a4ea742c6d1e3cb9293631cc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138305 Tested-by: Jenkins CollaboraOffice diff --git a/include/svx/unodraw/SvxTableShape.hxx b/include/svx/unodraw/SvxTableShape.hxx new file mode 100644 index ..518d3ac2c06a --- /dev/null +++ b/include/svx/unodraw/SvxTableShape.hxx @@ -0,0 +1,44 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include + +class SVXCORE_DLLPUBLIC SvxTableShape : public SvxShape +{ +protected: +// override these for special property handling in subcasses. Return true if property is handled +virtual bool setPropertyValueImpl(const OUString& rName, + const SfxItemPropertyMapEntry* pProperty, + const css::uno::Any& rValue) override; +virtual bool getPropertyValueImpl(const OUString& rName, + const SfxItemPropertyMapEntry* pProperty, +
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/main/DataTableView.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 65021c6acc655b61cbba74d01829beb1c4181c97 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 17:36:23 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 15:51:11 2022 +0200 chart2: use the FillColor property as CharBackColor For chart data table, the fill is always setting the char background (highlight). As we don't support other fill types in LibreOffice for the char background, we can't set anything else when rendering. We need to extend editeng and UNO API with the support for this. Change-Id: I47d342e02ad2347bac0515a62cc0de4391f98150 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138331 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index d413372e87c6..a78c05c14822 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -140,6 +140,9 @@ void DataTableView::setCellCharAndParagraphProperties( copyProperty(xPropertySet, xDataTableProperties, "CharWeightComplex"); copyProperty(xPropertySet, xDataTableProperties, "CharWordMode"); +xPropertySet->setPropertyValue("CharBackColor", + xDataTableProperties->getPropertyValue("FillColor")); + xPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_CENTER)); }
[Libreoffice-commits] core.git: 2 commits - chart2/source
chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |1 chart2/source/view/main/DataTableView.cxx | 19 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) New commits: commit e0599e403b9b8714794f4f80afe78feac0a77b32 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 17:25:04 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 08:16:13 2022 +0200 chart2: add "font effects" tab page to the data table dialog Change-Id: I5530477dc86ba2174ba6e553dfe77f8fa355a863 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138329 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index 0ba0b76518cb..230862e2cedb 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -464,6 +464,7 @@ SchAttribTabDlg::SchAttribTabDlg(weld::Window* pParent, AddTabPage("border", SchResId(STR_PAGE_LINE), RID_SVXPAGE_LINE); AddTabPage("area", SchResId(STR_PAGE_AREA), RID_SVXPAGE_AREA); AddTabPage("fontname", SchResId(STR_PAGE_FONT), RID_SVXPAGE_CHAR_NAME); +AddTabPage("effects", SchResId(STR_PAGE_FONT_EFFECTS), RID_SVXPAGE_CHAR_EFFECTS); break; case OBJECTTYPE_DATA_CURVE_EQUATION: AddTabPage("border", SchResId(STR_PAGE_BORDER), RID_SVXPAGE_LINE); commit e4e5d77bcc30beb1d976fadf5da0247f00f5b9cc Author: Tomaž Vajngerl AuthorDate: Thu Aug 11 22:44:56 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 08:15:56 2022 +0200 chart2: render line legend symbols better in a data table Change-Id: I556b4f249688a3836bbeeb3f554cb9ecf1d31f65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138301 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index d80e753d9e65..ae90b475e75a 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -287,16 +287,22 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV } // ROW HEADER -// Prepare keys +// Prepare keys (symbols) +sal_Int32 nMaxSymbolWidth = 0; if (bKeys) { -awt::Size aMaxSymbolExtent(300, 300); for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList) { if (pSeriesPlotter) { +sal_Int32 nSymbolWidth = 300; +if (pSeriesPlotter->getLegendSymbolStyle() == LegendSymbolStyle::Line) +nSymbolWidth = 600; + +nMaxSymbolWidth = std::max(nSymbolWidth, nMaxSymbolWidth); + std::vector aNewEntries = pSeriesPlotter->createSymbols( -aMaxSymbolExtent, m_xTarget, m_xComponentContext); +{ nSymbolWidth, 300 }, m_xTarget, m_xComponentContext); aSymbols.insert(aSymbols.end(), aNewEntries.begin(), aNewEntries.end()); } } @@ -327,7 +333,10 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV xCellPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_LEFT)); if (bKeys) -xCellPropertySet->setPropertyValue("ParaLeftMargin", uno::Any(sal_Int32(500))); +{ +xCellPropertySet->setPropertyValue("ParaLeftMargin", + uno::Any(nMaxSymbolWidth + sal_Int32(200))); +} } nRow++; } @@ -376,6 +385,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV pTableObject->DistributeColumns(0, nColumnCount - 1, true, true); pTableObject->DistributeRows(0, nRowCount - 1, true, true); +xBroadcaster->lockBroadcasts(); uno::Reference xPropertySet(xTableColumns->getByIndex(0), uno::UNO_QUERY); sal_Int32 nWidth = 0; xPropertySet->getPropertyValue("Width") >>= nWidth; @@ -406,6 +416,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV nTotalHeight += nHeight; } } +xBroadcaster->unlockBroadcasts(); } void DataTableView::initializeShapes(const rtl::Reference& xTarget)
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/main/DataTableView.cxx | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) New commits: commit 5dcfa8f3750d549d895246c50285bb38690f9734 Author: Tomaž Vajngerl AuthorDate: Thu Aug 11 22:40:27 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 16 08:15:33 2022 +0200 chart2: fix rendering of table borders of row/column headers The row/column headers didn't enable/disable the table borders correctly when outline was enabled and horizontal and vertical borders properties were disabled. Change-Id: Ifcb059dd7d39890bbcaf55d3a68dce41eef586cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138300 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 6f099bccf04c..d80e753d9e65 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -264,6 +264,8 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV sal_Int32 nColumn; sal_Int32 nRow; +// COLUMN HEADER + nColumn = 1; for (auto const& rString : m_aXValues) { @@ -273,13 +275,19 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV if (xCellTextRange.is()) { xCellTextRange->setString(rString); -bool bLeft = bOutline || (bVBorder && nColumn > 1); -setCellProperties(xPropertySet, bLeft, bOutline, bOutline, bOutline); + +bool bLeft += (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +bool bRight = (bOutline && nColumn == nColumnCount) + || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline); setCellCharAndParagraphProperties(xPropertySet); } nColumn++; } +// ROW HEADER +// Prepare keys if (bKeys) { awt::Size aMaxSymbolExtent(300, 300); @@ -302,8 +310,10 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV uno::Reference xCellTextRange(xCell, uno::UNO_QUERY); if (xCellTextRange.is()) { -bool bTop = bOutline || (bHBorder && nRow > 1); -setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bOutline); +bool bTop = (bOutline && nRow == 1) || (bHBorder && nRow > 1 && nRow < nRowCount); +bool bBottom += (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount); +setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom); auto xText = xCellTextRange->getText(); xText->insertString(xText->getStart(), rSeriesName, false); @@ -317,11 +327,12 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV xCellPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_LEFT)); if (bKeys) -xCellPropertySet->setPropertyValue("ParaLeftMargin", uno::Any(500)); +xCellPropertySet->setPropertyValue("ParaLeftMargin", uno::Any(sal_Int32(500))); } nRow++; } +// TABLE nRow = 1; for (auto const& rSeries : m_pDataSeriesValues) {
[Libreoffice-commits] core.git: offapi/com
offapi/com/sun/star/text/NumberingRules.idl |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f448de22e05a59307c8d968982140b182e736edc Author: Tomaž Vajngerl AuthorDate: Wed Aug 10 11:58:34 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Aug 15 22:43:48 2022 +0200 correct the description of NumberingRules duplicated text - "@see NumberingLevel" Change-Id: I210c392dba738e65ed22b8c66e16a6bafb1c4265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138261 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/offapi/com/sun/star/text/NumberingRules.idl b/offapi/com/sun/star/text/NumberingRules.idl index 97286cd26523..9b12477f8f95 100644 --- a/offapi/com/sun/star/text/NumberingRules.idl +++ b/offapi/com/sun/star/text/NumberingRules.idl @@ -31,7 +31,7 @@ published service NumberingRules The numbering rules are levels of property values. Each level contains equal properties. -@see NumberingLevel;@see NumberingLevel; +@see NumberingLevel */ interface com::sun::star::container::XIndexReplace;
[Libreoffice-commits] core.git: chart2/qa include/xmloff schema/libreoffice xmloff/Library_xo.mk xmloff/source
chart2/qa/extras/chart2export2.cxx | 52 + chart2/qa/extras/data/xlsx/ChartDataTable.xlsx |binary include/xmloff/xmltoken.hxx |7 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng | 113 +--- xmloff/Library_xo.mk|1 xmloff/source/chart/PropertyMaps.cxx|6 xmloff/source/chart/SchXMLChartContext.cxx |4 xmloff/source/chart/SchXMLDataTableContext.cxx | 87 + xmloff/source/chart/SchXMLDataTableContext.hxx | 40 xmloff/source/chart/SchXMLExport.cxx| 38 +++- xmloff/source/core/xmltoken.cxx | 11 - xmloff/source/token/tokens.txt |5 12 files changed, 330 insertions(+), 34 deletions(-) New commits: commit 203eaefb4ac012c36a1ecdd3753e1cb2c5876efc Author: Tomaž Vajngerl AuthorDate: Fri Jul 29 15:57:42 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Aug 15 13:08:17 2022 +0200 xmloff: import and export for the chart data table This change adds import and export code for the the chart's data table properties to the ODF format for chart documents. The data table properties are exported to a new element "data-table", which then references a auto style with all the properties of a data table + new data table specific properties: HBorder, VBorder, Outline, Keys which are mapped to "show-horizontal-border", "show-vertical-border", "show-outline" and "show-keys" chart attributes. Also adds a test for the import and export: imports xlsx -> exports to ods -> imports ods Change-Id: Id45d9369fd619959e4d6eba7ca51c8ddce9c8f56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138260 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/qa/extras/chart2export2.cxx b/chart2/qa/extras/chart2export2.cxx index be2902cbb15c..b9b77c0bd112 100644 --- a/chart2/qa/extras/chart2export2.cxx +++ b/chart2/qa/extras/chart2export2.cxx @@ -93,6 +93,7 @@ public: void testNameRangeXLSX(); void testTdf143942(); void testDateCategoriesPPTX(); +void testDataTableImportExport(); CPPUNIT_TEST_SUITE(Chart2ExportTest2); CPPUNIT_TEST(testSetSeriesToSecondaryAxisXLSX); @@ -158,6 +159,7 @@ public: CPPUNIT_TEST(testNameRangeXLSX); CPPUNIT_TEST(testTdf143942); CPPUNIT_TEST(testDateCategoriesPPTX); +CPPUNIT_TEST(testDataTableImportExport); CPPUNIT_TEST_SUITE_END(); }; @@ -1630,6 +1632,56 @@ void Chart2ExportTest2::testDateCategoriesPPTX() } } +void Chart2ExportTest2::testDataTableImportExport() +{ +load(u"/chart2/qa/extras/data/xlsx/", u"ChartDataTable.xlsx"); +{ +uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); +CPPUNIT_ASSERT(xChartDoc.is()); +auto xDiagram = xChartDoc->getFirstDiagram(); +CPPUNIT_ASSERT(xDiagram.is()); +auto xDataTable = xDiagram->getDataTable(); +CPPUNIT_ASSERT(xDataTable.is()); +uno::Reference xPropertySet(xDataTable, uno::UNO_QUERY); +CPPUNIT_ASSERT(xPropertySet.is()); +bool bHBorder; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("HBorder") >>= bHBorder); +CPPUNIT_ASSERT_EQUAL(true, bHBorder); +bool bVBorder; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("VBorder") >>= bVBorder); +CPPUNIT_ASSERT_EQUAL(true, bVBorder); +bool bOutline; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Outline") >>= bOutline); +CPPUNIT_ASSERT_EQUAL(false, bOutline); +bool bKeys; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Keys") >>= bKeys); +CPPUNIT_ASSERT_EQUAL(false, bKeys); +} +reload("calc8"); +{ +uno::Reference xChartDoc = getChartDocFromSheet(0, mxComponent); +CPPUNIT_ASSERT(xChartDoc.is()); +auto xDiagram = xChartDoc->getFirstDiagram(); +CPPUNIT_ASSERT(xDiagram.is()); +auto xDataTable = xDiagram->getDataTable(); +CPPUNIT_ASSERT(xDataTable.is()); +uno::Reference xPropertySet(xDataTable, uno::UNO_QUERY); +CPPUNIT_ASSERT(xPropertySet.is()); +bool bHBorder; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("HBorder") >>= bHBorder); +CPPUNIT_ASSERT_EQUAL(true, bHBorder); +bool bVBorder; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("VBorder") >>= bVBorder); +CPPUNIT_ASSERT_EQUAL(true, bVBorder); +bool bOutline; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Outline") >>= bOutline); +CPPUNIT_ASSERT_EQUAL(false, bOutline); +bool bKeys; +CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Keys") >>= bKeys); +CPPUNIT_ASSERT_EQUAL(false, bKeys); +} +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest2);
[Libreoffice-commits] core.git: 2 commits - chart2/source officecfg/registry
chart2/source/controller/inc/ChartController.hxx |3 + chart2/source/controller/main/ChartController.cxx |5 + chart2/source/controller/main/ChartController_Insert.cxx | 26 ++ chart2/source/controller/main/ChartController_Window.cxx | 20 +-- chart2/source/controller/main/ControllerCommandDispatch.cxx|8 +++ chart2/source/model/main/DataTable.cxx |6 +- officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu | 11 7 files changed, 71 insertions(+), 8 deletions(-) New commits: commit 5861af0da5179689870d5b4f5ff56a5ea0a79901 Author: Tomaž Vajngerl AuthorDate: Fri Jul 29 15:49:31 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Aug 15 13:08:04 2022 +0200 chart2: DataTable set properties to default to false Change-Id: If8caf59629327b623b2630776b1e650cbe4fbed1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138259 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/model/main/DataTable.cxx b/chart2/source/model/main/DataTable.cxx index c8ae688dfc4d..a81cc6dedf7a 100644 --- a/chart2/source/model/main/DataTable.cxx +++ b/chart2/source/model/main/DataTable.cxx @@ -65,10 +65,10 @@ private: ::chart::CharacterProperties::AddDefaultsToMap(aMap); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_HorizontalBorder, - true); + false); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_VerticalBorder, - true); -::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Outilne, true); + false); +::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Outilne, false); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Keys, false); ::chart::PropertyHelper::setPropertyValue( commit 0c984c4dbe36a58859b09924e98fcf8ba8ed2d75 Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 23:03:53 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Aug 15 13:07:53 2022 +0200 chart2: InsertDataTable and DeleteDataTable for context menu Change-Id: I8ef0698252209af01b0741a59dec70f845f0c965 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138258 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index f0f53c8b8990..81f3070403bc 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -440,6 +440,9 @@ private: void executeDispatch_OpenLegendDialog(); void executeDispatch_InsertAxes(); void executeDispatch_InsertGrid(); + +void executeDispatch_InsertDataTable(); +void executeDispatch_DeleteDataTable(); void executeDispatch_OpenInsertDataTableDialog(); void executeDispatch_InsertMenu_DataLabels(); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 70b15cf0fd04..5b5751dd5040 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1225,6 +1225,10 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_DeleteMajorGrid(); else if( aCommand == "DeleteMinorGrid" ) this->executeDispatch_DeleteMinorGrid(); +else if( aCommand == "InsertDataTable" ) + this->executeDispatch_InsertDataTable(); +else if( aCommand == "DeleteDataTable" ) + this->executeDispatch_DeleteDataTable(); //format objects else if( aCommand == "FormatSelection" ) this->executeDispatch_ObjectProperties(); @@ -1634,6 +1638,7 @@ const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommand "DeleteXErrorBars", "DeleteYErrorBars", "DeleteDataLabels", "DeleteDataLabel", "InsertMenuDataTable", +"InsertDataTable", "DeleteDataTable", //format objects "FormatSelection", "TransformDialog", "DiagramType","View3D", diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index b1b0598d5070..99b3e74fffac 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -224,6 +224,32 @@ void ChartController::executeDispatch_OpenInsertDataTableDialog() } } +void ChartController::executeDispatch_InsertDataTable() +{ +SolarMutexGuard aGuard; +rtl::Reference xDiagram = getFirstDiagram(); +auto
[Libreoffice-commits] core.git: chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk
chart2/Library_chartcontroller.mk|2 chart2/UIConfig_chart2.mk|3 chart2/source/controller/dialogs/dlg_InsertDataTable.cxx | 61 +++ chart2/source/controller/dialogs/res_DataTableProperties.cxx | 111 + chart2/source/controller/dialogs/tp_DataTable.cxx| 78 --- chart2/source/controller/dialogs/tp_DataTable.hxx| 11 chart2/source/controller/inc/dlg_InsertDataTable.hxx | 47 ++ chart2/source/controller/inc/res_DataTableProperties.hxx | 47 ++ chart2/source/controller/main/ChartController_Insert.cxx | 64 ++- chart2/uiconfig/ui/dlg_InsertDataTable.ui| 215 +++ 10 files changed, 548 insertions(+), 91 deletions(-) New commits: commit 6c00d75738bb182b5c02848b1720e6623baed4b9 Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 22:00:38 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Aug 15 07:42:32 2022 +0200 chart2: InsertDataTableDialog for inserting/removing the data table Change-Id: Ie3c033c587b150723e7aa39cd5ddf5774104db9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138257 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index 4bc8c7497915..cc25cdd907ae 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -109,6 +109,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/dlg_DataSource \ chart2/source/controller/dialogs/dlg_InsertAxis_Grid \ chart2/source/controller/dialogs/dlg_InsertDataLabel \ +chart2/source/controller/dialogs/dlg_InsertDataTable \ chart2/source/controller/dialogs/dlg_InsertErrorBars \ chart2/source/controller/dialogs/dlg_InsertLegend \ chart2/source/controller/dialogs/dlg_InsertTitle \ @@ -122,6 +123,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/RangeSelectionListener \ chart2/source/controller/dialogs/res_BarGeometry \ chart2/source/controller/dialogs/res_DataLabel \ +chart2/source/controller/dialogs/res_DataTableProperties \ chart2/source/controller/dialogs/res_ErrorBar \ chart2/source/controller/dialogs/res_LegendPosition \ chart2/source/controller/dialogs/res_Titles \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 59af510c5845..274efd02638f 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -44,7 +44,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/combobox \ chart2/uiconfig/ui/datarangedialog \ chart2/uiconfig/ui/dlg_DataLabel \ + chart2/uiconfig/ui/dlg_InsertDataTable \ chart2/uiconfig/ui/dlg_InsertErrorBars \ + chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/imagefragment \ chart2/uiconfig/ui/insertaxisdlg \ chart2/uiconfig/ui/insertgriddlg \ @@ -58,7 +60,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/smoothlinesdlg \ chart2/uiconfig/ui/steppedlinesdlg \ chart2/uiconfig/ui/titlerotationtabpage \ - chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/tp_3D_SceneAppearance \ chart2/uiconfig/ui/tp_3D_SceneGeometry \ chart2/uiconfig/ui/tp_3D_SceneIllumination \ diff --git a/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx new file mode 100644 index ..4b5e928db057 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx @@ -0,0 +1,61 @@ +/* -*- 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/. + */ + +#include + +namespace chart +{ +InsertDataTableDialog::InsertDataTableDialog(weld::Window* pWindow) +: GenericDialogController(pWindow, "modules/schart/ui/dlg_InsertDataTable.ui", + "InsertDataTableDialog") +, m_aDataTablePropertiesResources(*m_xBuilder) +, m_xCbShowDataTable(m_xBuilder->weld_check_button("showDataTable")) +{ +m_xCbShowDataTable->connect_toggled(LINK(this, InsertDataTableDialog, ShowDataTableToggle)); +init(m_aData); +} + +IMPL_LINK_NOARG(InsertDataTableDialog, ShowDataTableToggle, weld::Toggleable&, void) +{ +changeEnabled(); +} + +void InsertDataTableDialog::changeEnabled() +{ +bool bEnable = m_xCbShowDataTable->get_active(); +m_aDataTablePropertiesResources.setChecksSensitive(bEnable); +m_aData.mbShow = bEnable; +} + +void InsertDataTableDialog::init(DataTableDialogData const& rData) +{ +
[Libreoffice-commits] core.git: chart2/source chart2/uiconfig officecfg/registry
chart2/source/controller/inc/ChartController.hxx |1 chart2/source/controller/main/ChartController.cxx |3 + chart2/source/controller/main/ChartController_Insert.cxx | 19 ++ chart2/source/controller/main/ControllerCommandDispatch.cxx|1 chart2/uiconfig/menubar/menubar.xml|1 officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu |5 ++ 6 files changed, 30 insertions(+) New commits: commit 16fac85be1fdddb1695a29a9b8026cd4f8cfad64 Author: Tomaž Vajngerl AuthorDate: Thu Jun 30 23:34:19 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Aug 14 19:37:42 2022 +0200 chart2: add "InsertMenuDataTable" action to menu Change-Id: Ib60a2b061966eb61834480b63dc0653410a43a14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138248 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 505b109fdcc7..f0f53c8b8990 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -440,6 +440,7 @@ private: void executeDispatch_OpenLegendDialog(); void executeDispatch_InsertAxes(); void executeDispatch_InsertGrid(); +void executeDispatch_OpenInsertDataTableDialog(); void executeDispatch_InsertMenu_DataLabels(); void executeDispatch_InsertMenu_Trendlines(); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 54c91a6147dd..70b15cf0fd04 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1169,6 +1169,8 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_InsertErrorBars(false); else if( aCommand == "InsertMenuYErrorBars" ) this->executeDispatch_InsertErrorBars(true); +else if( aCommand == "InsertMenuDataTable" ) +this->executeDispatch_OpenInsertDataTableDialog(); else if( aCommand == "InsertSymbol" ) this->executeDispatch_InsertSpecialCharacter(); else if( aCommand == "InsertTrendline" ) @@ -1631,6 +1633,7 @@ const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommand "DeleteTrendline","DeleteMeanValue", "DeleteTrendlineEquation", "DeleteXErrorBars", "DeleteYErrorBars", "DeleteDataLabels", "DeleteDataLabel", +"InsertMenuDataTable", //format objects "FormatSelection", "TransformDialog", "DiagramType","View3D", diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 4f39f1068cdb..46d00eedb89c 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -155,6 +156,24 @@ void ChartController::executeDispatch_InsertGrid() } } +void ChartController::executeDispatch_OpenInsertDataTableDialog() +{ +rtl::Reference xDiagram = getFirstDiagram(); +SolarMutexGuard aGuard; +if (xDiagram->getDataTable().is()) +{ +xDiagram->setDataTable(uno::Reference()); +} +else +{ +uno::Reference xDataTable(new DataTable); +if (xDataTable.is()) +{ +xDiagram->setDataTable(xDataTable); +} +} +} + void ChartController::executeDispatch_InsertTitles() { UndoGuard aUndoGuard( diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index e5035b4f053c..828d862f4306 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -584,6 +584,7 @@ void ControllerCommandDispatch::updateCommandAvailability() m_aCommandAvailability[ ".uno:InsertMenuXErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertMenuYErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertSymbol" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsTextObject; +m_aCommandAvailability[ ".uno:InsertMenuDataTable" ] = bIsWritable; // format objects bool bFormatObjectAvailable = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsFormateableObjectSelected; diff --git a/chart2/uiconfig/menubar/menubar.xml b/chart2/uiconfig/menubar/menubar.xml index 354ebbc1903a..a48cd77d47de 100644 --- a/chart2/uiconfig/menubar/menubar.xml +++ b/chart2/uiconfig/menubar/menubar.xml @@ -56,6 +56,7 @@ + diff --git
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/axes/VAxisBase.cxx |2 +- chart2/source/view/inc/ShapeFactory.hxx |2 +- chart2/source/view/main/DataTableView.cxx |5 - chart2/source/view/main/ShapeFactory.cxx |7 --- 4 files changed, 10 insertions(+), 6 deletions(-) New commits: commit d4450b9a9fe26e03fabb07162e88f742ba2c1f77 Author: Tomaž Vajngerl AuthorDate: Wed Jun 29 19:25:47 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Aug 14 18:16:05 2022 +0200 chart2: allow to select the data table, fix object CID Change-Id: I0a8d3643fcaefe8105e935b929947174bd9bdc96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138247 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 7d985051a4a7..814d3afd7858 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -187,7 +187,7 @@ bool VAxisBase::prepareShapeCreation() if (m_aAxisProperties.m_bDisplayLabels) m_xTextTarget = ShapeFactory::createGroup2D( m_xFinalTarget, m_aCID ); if (m_aAxisProperties.m_bDisplayDataTable) -m_xDataTableTarget = ShapeFactory::createGroup2D(m_xFinalTarget, m_aCID); +m_xDataTableTarget = ShapeFactory::createGroup2D(m_xFinalTarget); return true; } diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index d6c05af04d18..b44612e74a4f 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -217,7 +217,7 @@ public: const css::uno::Reference< css::beans::XPropertySet > & xTextProperties, double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth ); -static rtl::Reference createTable(rtl::Reference const& xTarget); +static rtl::Reference createTable(rtl::Reference const& xTarget, OUString const& rName = OUString()); static rtl::Reference createInvisibleRectangle( diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 72b669838435..64c76e5da885 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -191,7 +192,9 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV return; ShapeFactory::removeSubShapes(m_xTarget); -m_xTableShape = ShapeFactory::createTable(m_xTarget); +auto sParticle = ObjectIdentifier::createParticleForDataTable(m_xChartModel); +auto sCID = ObjectIdentifier::createClassifiedIdentifierForParticle(sParticle); +m_xTableShape = ShapeFactory::createTable(m_xTarget, sCID); uno::Reference xTable; try diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 7fddc5d018d5..8f9f29ced232 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2533,16 +2533,17 @@ void ShapeFactory::removeSubShapes( const rtl::Reference& xSh } rtl::Reference -ShapeFactory::createTable(rtl::Reference const& xTarget) +ShapeFactory::createTable(rtl::Reference const& xTarget, OUString const& rName) { -if( !xTarget.is() ) +if (!xTarget.is()) return nullptr; //create table shape rtl::Reference xShape = new SvxTableShape(nullptr); xShape->setShapeKind(SdrObjKind::Table); xTarget->addShape(*xShape); - +if (!rName.isEmpty()) +setShapeName(xShape, rName); return xShape; }
[Libreoffice-commits] core.git: 2 commits - chart2/inc chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk
chart2/Library_chartcontroller.mk |2 chart2/UIConfig_chart2.mk |1 chart2/inc/strings.hrc |2 chart2/source/controller/dialogs/ObjectNameProvider.cxx|3 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |7 chart2/source/controller/dialogs/tp_DataTable.cxx | 113 + chart2/source/controller/dialogs/tp_DataTable.hxx | 43 +++ chart2/source/controller/inc/DataTableItemConverter.hxx| 57 chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx | 112 + chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx |8 chart2/source/controller/main/ChartController_Properties.cxx | 12 + chart2/source/controller/main/ObjectHierarchy.cxx | 40 ++- chart2/source/inc/ObjectIdentifier.hxx |4 chart2/source/inc/chartview/ChartSfxItemIds.hxx|9 chart2/source/tools/ObjectIdentifier.cxx | 23 ++ chart2/source/view/main/ChartItemPool.cxx |5 chart2/uiconfig/ui/tp_DataTable.ui | 115 ++ 17 files changed, 539 insertions(+), 17 deletions(-) New commits: commit 300ea910badeef2c8038d9bb20683ea26f4b1973 Author: Tomaž Vajngerl AuthorDate: Tue Jun 28 07:48:45 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Aug 14 18:15:53 2022 +0200 chart2: add UI to the data table This adds a new object type "Data Table", with all the object identifiers and converters of properties. The data table is now shown in the drop-down of chart elements. A properties dialog was added, which allows to change properties of a data table. This contains the area, line and font tab pages and a new tab page specific for data tables, to change if the horiz. or vert. borders, key or the outline should be show. Change-Id: I9b4cd58cffbcc952daaa2c0c8f8a5a17e38ac293 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138246 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index b7c449cef582..4bc8c7497915 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -138,6 +138,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/tp_DataLabel \ chart2/source/controller/dialogs/tp_DataPointOption \ chart2/source/controller/dialogs/tp_DataSource \ +chart2/source/controller/dialogs/tp_DataTable \ chart2/source/controller/dialogs/tp_ErrorBars \ chart2/source/controller/dialogs/tp_LegendPosition \ chart2/source/controller/dialogs/tp_PointGeometry \ @@ -153,6 +154,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/itemsetwrapper/AxisItemConverter \ chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter \ chart2/source/controller/itemsetwrapper/DataPointItemConverter \ +chart2/source/controller/itemsetwrapper/DataTableItemConverter \ chart2/source/controller/itemsetwrapper/ErrorBarItemConverter \ chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter \ chart2/source/controller/itemsetwrapper/ItemConverter \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 67d64b18b597..59af510c5845 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -68,6 +68,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/tp_DataLabel \ chart2/uiconfig/ui/tp_DataPointOption \ chart2/uiconfig/ui/tp_DataSource \ + chart2/uiconfig/ui/tp_DataTable \ chart2/uiconfig/ui/tp_ErrorBars \ chart2/uiconfig/ui/tp_LegendPosition \ chart2/uiconfig/ui/tp_PolarOptions \ diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc index ab6ca48c8376..9a9943df1f3c 100644 --- a/chart2/inc/strings.hrc +++ b/chart2/inc/strings.hrc @@ -48,6 +48,7 @@ #define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance") #define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination") #define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography") +#define STR_PAGE_DATA_TABLE NC_("STR_PAGE_DATA_TABLE", "Data Table") #define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION") #define STR_OBJECT_AXIS NC_("STR_OBJECT_AXIS", "Axis") #define STR_OBJECT_AXIS_X NC_("STR_OBJECT_AXIS_X", "X Axis") @@
[Libreoffice-commits] core.git: 2 commits - chart2/source
chart2/source/controller/inc/ObjectHierarchy.hxx | 24 ++ chart2/source/controller/main/ObjectHierarchy.cxx |2 - 2 files changed, 12 insertions(+), 14 deletions(-) New commits: commit b3f71d852566059b98457edbc0685ef2191342ea Author: Tomaž Vajngerl AuthorDate: Fri Jun 17 16:29:23 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Aug 14 12:21:27 2022 +0200 chart2: call clear instead of creating a new empty map Change-Id: I8b21909e92b558240e84cffd9432e0d9e270284e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138244 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx index e1f3697e6250..ab1fa891377e 100644 --- a/chart2/source/controller/main/ObjectHierarchy.cxx +++ b/chart2/source/controller/main/ObjectHierarchy.cxx @@ -105,7 +105,7 @@ namespace chart void ObjectHierarchy::createTree( const rtl::Reference<::chart::ChartModel>& xChartDocument ) { -m_aChildMap = tChildMap();//clear tree +m_aChildMap.clear(); if( !xChartDocument.is() ) return; commit 4aa706e345db84b60706b5e17102a48e5db6563e Author: Tomaž Vajngerl AuthorDate: Fri Jun 17 16:28:38 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Aug 14 12:21:17 2022 +0200 chart2: remove unneeded class prefix in ObjectHierarchy.hxx Change-Id: I1c851933e9b25dcd9a0dc29758baad8f3be7cb2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138243 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx b/chart2/source/controller/inc/ObjectHierarchy.hxx index 1255b7ac9910..1531866aaf2b 100644 --- a/chart2/source/controller/inc/ObjectHierarchy.hxx +++ b/chart2/source/controller/inc/ObjectHierarchy.hxx @@ -52,11 +52,10 @@ public: static bool isRootNode( const ObjectIdentifier& rOID ); /// equal to getChildren( getRootNodeOID()) -const tChildContainer & getTopLevelChildren() const; -bool hasChildren( const ObjectIdentifier& rParent ) const; -const tChildContainer & getChildren( const ObjectIdentifier& rParent ) const; - -const tChildContainer & getSiblings( const ObjectIdentifier& rNode ) const; +const tChildContainer& getTopLevelChildren() const; +bool hasChildren(const ObjectIdentifier& rParent) const; +const tChildContainer& getChildren(const ObjectIdentifier& rParent) const; +const tChildContainer& getSiblings(const ObjectIdentifier& rNode) const; /// The result is empty, if the node cannot be found in the tree ObjectIdentifier getParent( const ObjectIdentifier& rNode ) const; @@ -66,30 +65,29 @@ public: private: void createTree( const rtl::Reference<::chart::ChartModel> & xChartDocument ); void createAxesTree( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const rtl::Reference<::chart::ChartModel> & xChartDoc, const rtl::Reference< ::chart::Diagram > & xDiagram ); void createDiagramTree( -ObjectHierarchy::tChildContainer& rContainer, +tChildContainer& rContainer, const rtl::Reference<::chart::ChartModel>& xChartDoc, const rtl::Reference< ::chart::Diagram >& xDiagram ); void createDataSeriesTree( -ObjectHierarchy::tChildContainer & rOutDiagramSubContainer, +tChildContainer & rOutDiagramSubContainer, const rtl::Reference< ::chart::Diagram > & xDiagram ); static void createWallAndFloor( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const rtl::Reference< ::chart::Diagram > & xDiagram ); void createLegendTree( -ObjectHierarchy::tChildContainer & rContainer, +tChildContainer & rContainer, const rtl::Reference<::chart::ChartModel> & xChartDoc, const rtl::Reference< ::chart::Diagram > & xDiagram ); -void createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer ); +void createAdditionalShapesTree(tChildContainer& rContainer); ObjectIdentifier getParentImpl( const ObjectIdentifier& rParentOID, const ObjectIdentifier& rOID ) const; -typedef std::map< ObjectIdentifier, ObjectHierarchy::tChildContainer > -tChildMap; +typedef std::map tChildMap; tChildMap m_aChildMap; ExplicitValueProvider* m_pExplicitValueProvider; bool m_bFlattenDiagram;
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - chart2/source
chart2/source/view/main/SeriesPlotterContainer.cxx |6 ++ chart2/source/view/main/SeriesPlotterContainer.hxx |1 + 2 files changed, 7 insertions(+) New commits: commit 931b08e1de16fce0f01cc1177f6dd549cf230c5e Author: Tomaž Vajngerl AuthorDate: Sat Aug 13 23:29:01 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Aug 13 23:29:01 2022 +0200 chart2: for a data table we need to force shift category position To be able to show the data table correctly we need to always show the categories "between tick marks" as otherwise the table columns wouldn't align correctly. This forces that the shift position is always enabled. Change-Id: Ia6a627931fcaba64f0f974faf1d8763405ad410d diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx index 1eb6a64a42c5..9f2e4fbaacfa 100644 --- a/chart2/source/view/main/SeriesPlotterContainer.cxx +++ b/chart2/source/view/main/SeriesPlotterContainer.cxx @@ -170,6 +170,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart DBG_UNHANDLED_EXCEPTION("chart2"); } +if (xDiagram->getDataTable().is()) +m_bForceShiftPosition = true; + //prepare for autoscaling and shape creation // - create plotter for charttypes (for each first scale group at each plotter, as they are independent) // - add series to plotter (thus each charttype can provide minimum and maximum values for autoscaling) @@ -335,6 +338,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart bool SeriesPlotterContainer::isCategoryPositionShifted(const chart2::ScaleData& rSourceScale, bool bHasComplexCategories) { +if (m_bForceShiftPosition) +return true; + if (rSourceScale.AxisType == AxisType::CATEGORY) return bHasComplexCategories || rSourceScale.ShiftedCategoryPosition || m_bChartTypeUsesShiftedCategoryPositionPerDefault; diff --git a/chart2/source/view/main/SeriesPlotterContainer.hxx b/chart2/source/view/main/SeriesPlotterContainer.hxx index e34d07a962ff..578f2ba2760c 100644 --- a/chart2/source/view/main/SeriesPlotterContainer.hxx +++ b/chart2/source/view/main/SeriesPlotterContainer.hxx @@ -151,6 +151,7 @@ private: sal_Int32 m_nMaxAxisIndex; bool m_bChartTypeUsesShiftedCategoryPositionPerDefault; +bool m_bForceShiftPosition = false; sal_Int32 m_nDefaultDateNumberFormat; };
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - chart2/source
Rebased ref, commits from common ancestor: commit a7f001a09062b603012949ec6a191380f6ede726 Author: Tomaž Vajngerl AuthorDate: Sat Aug 13 14:14:00 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Aug 13 14:31:07 2022 +0200 chart2: support data table rendering when the X axis is swapped In case when the X axis is swapped, so the Y axis is rendered in the place of X axis, we need to render the data table below the Y-axis labels. This is best done to put the data table into the Y-axis instead, so we get the correct size and position of the data table, and then just allow rendering of the axis labels and (re)position the table below Y-axis. Change-Id: I74aa79402a5638133b0d1ed83bbd8aad6f6c9d1d diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index f39420c9ce02..da038d27471c 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -257,7 +257,7 @@ void AxisProperties::init( bool bCartesian ) if( bCartesian ) { -if (m_nDimensionIndex == 0) +if ((!m_bSwapXAndY && m_nDimensionIndex == 0) || (m_bSwapXAndY && m_nDimensionIndex == 1)) { m_bDisplayDataTable = m_xDataTableModel.is(); } @@ -332,6 +332,17 @@ void AxisProperties::init( bool bCartesian ) { TOOLS_WARN_EXCEPTION("chart2", "" ); } + +if (m_bDisplayDataTable) +{ +m_bDataTableAlignAxisValuesWithColumns = (m_nDimensionIndex == 0); + +if (m_nDimensionIndex == 0) +{ +m_bDisplayLabels = false; +} + +} } AxisLabelProperties::AxisLabelProperties() diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx index 6b6b7c361ea2..0cc23602b541 100644 --- a/chart2/source/view/axes/VAxisProperties.hxx +++ b/chart2/source/view/axes/VAxisProperties.hxx @@ -111,7 +111,10 @@ struct AxisProperties final AxisLabelAlignment maLabelAlignment; +// Data table bool m_bDisplayDataTable; +bool m_bDataTableAlignAxisValuesWithColumns; + bool m_bDisplayLabels; // Compatibility option: starting from LibreOffice 5.1 the rotated diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 293d1f0479a8..82e24403d678 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1664,35 +1664,43 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel } } -void VCartesianAxis::createLabels() +void VCartesianAxis::createDataTableShape(std::unique_ptr const& rpTickFactory2D) { -if( !prepareShapeCreation() ) +// Check if we can create the data table shape +// Data table view and m_bDisplayDataTable must be true +if (!m_pDataTableView || !m_aAxisProperties.m_bDisplayDataTable) return; -std::unique_ptr apTickFactory2D(createTickFactory2D()); // throws on failure +m_pDataTableView->initializeShapes(m_xDataTableTarget); +basegfx::B2DVector aStart = rpTickFactory2D->getXaxisStartPos(); +basegfx::B2DVector aEnd = rpTickFactory2D->getXaxisEndPos(); -if (m_pDataTableView && m_aAxisProperties.m_bDisplayDataTable) -{ -m_pDataTableView->initializeShapes(m_xDataTableTarget); -basegfx::B2DVector aStart = apTickFactory2D->getXaxisStartPos(); -basegfx::B2DVector aEnd = apTickFactory2D->getXaxisEndPos(); +rpTickFactory2D->updateScreenValues(m_aAllTickInfos); -apTickFactory2D->updateScreenValues(m_aAllTickInfos); +sal_Int32 nDistance = -1; -sal_Int32 nDistance = -1; +std::unique_ptr apTickIter(createLabelTickIterator(0)); +if (apTickIter) +{ +nDistance = TickFactory2D::getTickScreenDistance(*apTickIter); +if (getTextLevelCount() > 1) +nDistance *= 2; +} -std::unique_ptr apTickIter(createLabelTickIterator(0)); -if (apTickIter) -{ -nDistance = TickFactory2D::getTickScreenDistance(*apTickIter); -if (getTextLevelCount() > 1) -nDistance *= 2; -} +if (nDistance > 0) +{ +m_pDataTableView->createShapes(aStart, aEnd, nDistance); +} +} -if (nDistance > 0) -m_pDataTableView->createShapes(aStart, aEnd, nDistance); +void VCartesianAxis::createLabels() +{ +if( !prepareShapeCreation() ) return; -} + +std::unique_ptr apTickFactory2D(createTickFactory2D()); // throws on failure + +createDataTableShape(apTickFactory2D); //create labels if (!m_aAxisProperties.m_bDisplayLabels) @@ -1744,6 +1752,14 @@ void VCartesianAxis::createLabels() } } doStaggeringOfLabels( m_aAxisLabelProperties, pTickFactory2D ); + +if (m_pDataTableView) +{ +sal_Int32 x = m_xTextTarget->getPosition().X; +sal_Int32 y =
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - chart2/source
chart2/source/view/axes/VAxisProperties.cxx | 13 - chart2/source/view/axes/VAxisProperties.hxx |3 + chart2/source/view/axes/VCartesianAxis.cxx | 68 +-- chart2/source/view/axes/VCartesianAxis.hxx |2 chart2/source/view/inc/DataTableView.hxx| 11 ++-- chart2/source/view/main/DataTableView.cxx | 69 +++- 6 files changed, 114 insertions(+), 52 deletions(-) New commits: commit 3323e9b64de186e7e0610c130121779e19b4b54b Author: Tomaž Vajngerl AuthorDate: Sat Aug 13 14:14:00 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Aug 13 14:14:00 2022 +0200 chart2: support data table rendering when the X axis is swapped In case when the X axis is swapped, so the Y axis is rendered in the place of X axis, we need to render the data table below the Y-axis labels. This is best done to put the data table into the Y-axis instead, so we get the correct size and position of the data table, and then just allow rendering of the axis labels and (re)position the table below Y-axis. Change-Id: I74aa79402a5638133b0d1ed83bbd8aad6f6c9d1d diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index f39420c9ce02..da038d27471c 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -257,7 +257,7 @@ void AxisProperties::init( bool bCartesian ) if( bCartesian ) { -if (m_nDimensionIndex == 0) +if ((!m_bSwapXAndY && m_nDimensionIndex == 0) || (m_bSwapXAndY && m_nDimensionIndex == 1)) { m_bDisplayDataTable = m_xDataTableModel.is(); } @@ -332,6 +332,17 @@ void AxisProperties::init( bool bCartesian ) { TOOLS_WARN_EXCEPTION("chart2", "" ); } + +if (m_bDisplayDataTable) +{ +m_bDataTableAlignAxisValuesWithColumns = (m_nDimensionIndex == 0); + +if (m_nDimensionIndex == 0) +{ +m_bDisplayLabels = false; +} + +} } AxisLabelProperties::AxisLabelProperties() diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx index 6b6b7c361ea2..0cc23602b541 100644 --- a/chart2/source/view/axes/VAxisProperties.hxx +++ b/chart2/source/view/axes/VAxisProperties.hxx @@ -111,7 +111,10 @@ struct AxisProperties final AxisLabelAlignment maLabelAlignment; +// Data table bool m_bDisplayDataTable; +bool m_bDataTableAlignAxisValuesWithColumns; + bool m_bDisplayLabels; // Compatibility option: starting from LibreOffice 5.1 the rotated diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 293d1f0479a8..82e24403d678 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1664,35 +1664,43 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel } } -void VCartesianAxis::createLabels() +void VCartesianAxis::createDataTableShape(std::unique_ptr const& rpTickFactory2D) { -if( !prepareShapeCreation() ) +// Check if we can create the data table shape +// Data table view and m_bDisplayDataTable must be true +if (!m_pDataTableView || !m_aAxisProperties.m_bDisplayDataTable) return; -std::unique_ptr apTickFactory2D(createTickFactory2D()); // throws on failure +m_pDataTableView->initializeShapes(m_xDataTableTarget); +basegfx::B2DVector aStart = rpTickFactory2D->getXaxisStartPos(); +basegfx::B2DVector aEnd = rpTickFactory2D->getXaxisEndPos(); -if (m_pDataTableView && m_aAxisProperties.m_bDisplayDataTable) -{ -m_pDataTableView->initializeShapes(m_xDataTableTarget); -basegfx::B2DVector aStart = apTickFactory2D->getXaxisStartPos(); -basegfx::B2DVector aEnd = apTickFactory2D->getXaxisEndPos(); +rpTickFactory2D->updateScreenValues(m_aAllTickInfos); -apTickFactory2D->updateScreenValues(m_aAllTickInfos); +sal_Int32 nDistance = -1; -sal_Int32 nDistance = -1; +std::unique_ptr apTickIter(createLabelTickIterator(0)); +if (apTickIter) +{ +nDistance = TickFactory2D::getTickScreenDistance(*apTickIter); +if (getTextLevelCount() > 1) +nDistance *= 2; +} -std::unique_ptr apTickIter(createLabelTickIterator(0)); -if (apTickIter) -{ -nDistance = TickFactory2D::getTickScreenDistance(*apTickIter); -if (getTextLevelCount() > 1) -nDistance *= 2; -} +if (nDistance > 0) +{ +m_pDataTableView->createShapes(aStart, aEnd, nDistance); +} +} -if (nDistance > 0) -m_pDataTableView->createShapes(aStart, aEnd, nDistance); +void VCartesianAxis::createLabels() +{ +if( !prepareShapeCreation() ) return; -} + +std::unique_ptr
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 2 commits - chart2/source
chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx |3 +-- chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx |1 - 2 files changed, 1 insertion(+), 3 deletions(-) New commits: commit e7a5cb826a9eea2f9a6ae122e7f6be0f64799b44 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 23:22:54 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 12 23:22:54 2022 +0200 chart2: we don't need SCHATTR_TEXT_* text ranges for data table Change-Id: I1c857ebe1ce4851f15da05291daecc09e7e74209 diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx index 3b33a1b57b29..676527f3fef3 100644 --- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx +++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx @@ -172,7 +172,6 @@ const WhichRangesContainer nRegEquationWhichPairs(svl::Items< >); const WhichRangesContainer nDataTableWhichPairs(svl::Items< -SCHATTR_TEXT_START, SCHATTR_TEXT_END, SCHATTR_DATA_TABLE_START, SCHATTR_DATA_TABLE_END, XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx commit 6399a50fb6785911e2741dbbf2f07da8c5fbb026 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 23:21:34 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 12 23:21:34 2022 +0200 chart2: don't use ref-size property when converting data table Change-Id: I4dd93d84879274721ded01be1a47b62487066b4e diff --git a/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx index 103724816d42..a66852a3f583 100644 --- a/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataTableItemConverter.cxx @@ -60,8 +60,7 @@ DataTableItemConverter::DataTableItemConverter( { m_aConverters.emplace_back(new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, xChartDoc, GraphicObjectType::LineProperties)); -m_aConverters.emplace_back( -new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize")); +m_aConverters.emplace_back(new CharacterPropertyItemConverter(rPropertySet, rItemPool)); } DataTableItemConverter::~DataTableItemConverter() = default;
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 3 commits - chart2/source
chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |1 chart2/source/view/main/DataTableView.cxx | 61 ++ 2 files changed, 47 insertions(+), 15 deletions(-) New commits: commit 922318c338605fb5b2cbe7d520480f37cfa1b37c Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 17:36:23 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 12 17:36:23 2022 +0200 chart2: use the FillColor property as CharBackColor For chart data table, the fill is always setting the char background (highlight). As we don't support other fill types in LibreOffice for the char background, we can't set anything else when rendering. We need to extend editeng and UNO API with the support for this. Change-Id: I47d342e02ad2347bac0515a62cc0de4391f98150 diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index eed1b00d67ee..59cc133763a2 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -140,6 +140,9 @@ void DataTableView::setCellCharAndParagraphProperties( copyProperty(xPropertySet, xDataTableProperties, "CharWeightComplex"); copyProperty(xPropertySet, xDataTableProperties, "CharWordMode"); +xPropertySet->setPropertyValue("CharBackColor", + xDataTableProperties->getPropertyValue("FillColor")); + xPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_CENTER)); } commit a6d213defaca2ad5a59c461383d342a968f7cfe5 Author: Tomaž Vajngerl AuthorDate: Fri Aug 12 17:29:36 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 12 17:29:36 2022 +0200 chart2: always set text props. of the first paragraph and not cell When setting the properties of the data table it is important to differentiate when we set the properties of the text of the (first and only) paragraph or set the properties for the current cell. In this chage we refactor the code so that we always set the text via UNO text::XText call for the current cell, and in the next step get the XPropertySet of the first paragraph and set the properties relevant for the text from the DataTable model. Change-Id: Ibe82b21c3416083cfe8e86b95443d77984da05f5 diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 7202f332b143..eed1b00d67ee 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -57,6 +57,29 @@ void copyProperty(uno::Reference& xOut, { xOut->setPropertyValue(sPropertyName, xIn->getPropertyValue(sPropertyName)); } + +uno::Reference getFirstParagraph(uno::Reference const& xText) +{ +uno::Reference xParagraph; +uno::Reference xEnumAccess(xText, uno::UNO_QUERY); +if (!xEnumAccess.is()) +return xParagraph; +uno::Reference xEnumeration(xEnumAccess->createEnumeration()); +xParagraph.set(xEnumeration->nextElement(), uno::UNO_QUERY); +return xParagraph; +} + +uno::Reference +getFirstParagraphProperties(uno::Reference const& xText) +{ +uno::Reference xPropertySet; +auto xParagraph = getFirstParagraph(xText); +if (!xParagraph.is()) +return xPropertySet; +xPropertySet.set(xParagraph, uno::UNO_QUERY); +return xPropertySet; +} + } // end anonymous namespace DataTableView::DataTableView( @@ -67,8 +90,8 @@ DataTableView::DataTableView( , m_xDataTableModel(rDataTableModel) , m_xComponentContext(rComponentContext) { -uno::Reference xProp(m_xDataTableModel); -m_aLineProperties.initFromPropertySet(xProp); +uno::Reference xPropertySet(m_xDataTableModel); +m_aLineProperties.initFromPropertySet(xPropertySet); } void DataTableView::setCellCharAndParagraphProperties( @@ -274,14 +297,18 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV uno::Reference xCellTextRange(xCell, uno::UNO_QUERY); if (xCellTextRange.is()) { -xCellTextRange->setString(rString); +auto xText = xCellTextRange->getText(); +xText->insertString(xText->getStart(), rString, false); +auto xTextPropertySet = getFirstParagraphProperties(xText); +if (!xTextPropertySet.is()) +continue; bool bLeft = (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); bool bRight = (bOutline && nColumn == nColumnCount) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +setCellCharAndParagraphProperties(xTextPropertySet); setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline); -setCellCharAndParagraphProperties(xPropertySet); } nColumn++; } @@ -319,17 +346,14 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart,
[Libreoffice-commits] core.git: sw/source
sw/source/ui/vba/vbalistformat.cxx | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) New commits: commit 23dcd3fe7ae9d8128eb06e380eef023ef16d2702 Author: Tomaž Vajngerl AuthorDate: Sat Aug 6 12:24:00 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Aug 12 09:22:32 2022 +0200 vba: extract the local variable instead of accessing iterator Change-Id: I2f6dca6fa6f1f23602cbab28ef933725dfc9c3b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138166 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/source/ui/vba/vbalistformat.cxx b/sw/source/ui/vba/vbalistformat.cxx index 5778776d2c30..efcbf2dbe874 100644 --- a/sw/source/ui/vba/vbalistformat.cxx +++ b/sw/source/ui/vba/vbalistformat.cxx @@ -146,13 +146,14 @@ void SAL_CALL SwVbaListFormat::ConvertNumbersToText( ) addParagraphsToList(mxTextRange, aParagraphs); // in reverse order, to get proper label strings -for (auto it = aParagraphs.rbegin(); it != aParagraphs.rend(); ++it) +for (auto iter = aParagraphs.rbegin(); iter != aParagraphs.rend(); ++iter) { -if (bool bNumber; ((*it)->getPropertyValue("NumberingIsNumber") >>= bNumber) && bNumber) +auto& rPropertySet = *iter; +if (bool bNumber; (rPropertySet->getPropertyValue("NumberingIsNumber") >>= bNumber) && bNumber) { -css::uno::Reference xRange(*it, css::uno::UNO_QUERY_THROW); +css::uno::Reference xRange(rPropertySet, css::uno::UNO_QUERY_THROW); OUString sLabelString; -(*it)->getPropertyValue("ListLabelString") >>= sLabelString; +rPropertySet->getPropertyValue("ListLabelString") >>= sLabelString; // sal_Int16 nAdjust = SAL_MAX_INT16; // TODO? sal_Int16 nNumberingType = SAL_MAX_INT16; // css::style::NumberingType sal_Int16 nPositionAndSpaceMode = SAL_MAX_INT16; @@ -171,9 +172,9 @@ void SAL_CALL SwVbaListFormat::ConvertNumbersToText( ) { sal_uInt16 nLevel = SAL_MAX_UINT16; -(*it)->getPropertyValue("NumberingLevel") >>= nLevel; +rPropertySet->getPropertyValue("NumberingLevel") >>= nLevel; css::uno::Reference xNumberingRules; -(*it)->getPropertyValue("NumberingRules") >>= xNumberingRules; +rPropertySet->getPropertyValue("NumberingRules") >>= xNumberingRules; comphelper::SequenceAsHashMap aLevelRule(xNumberingRules->getByIndex(nLevel)); // See offapi/com/sun/star/text/NumberingLevel.idl @@ -279,19 +280,18 @@ void SAL_CALL SwVbaListFormat::ConvertNumbersToText( ) // TODO: css::style::NumberingType::BITMAP } -(*it)->setPropertyValue("ParaLeftMargin", css::uno::Any(nIndentAt)); -(*it)->setPropertyValue("ParaFirstLineIndent", css::uno::Any(nFirstLineIndent)); +rPropertySet->setPropertyValue("ParaLeftMargin", css::uno::Any(nIndentAt)); +rPropertySet->setPropertyValue("ParaFirstLineIndent", css::uno::Any(nFirstLineIndent)); if (nLabelFollowedBy == SvxNumberFormat::LabelFollowedBy::LISTTAB) { css::uno::Sequence stops; -(*it)->getPropertyValue("ParaTabStops") >>= stops; +rPropertySet->getPropertyValue("ParaTabStops") >>= stops; css::style::TabStop tabStop{}; tabStop.Position = nListtabStopPosition; tabStop.Alignment = com::sun::star::style::TabAlign::TabAlign_LEFT; tabStop.FillChar = ' '; -(*it)->setPropertyValue( -"ParaTabStops", -css::uno::Any(comphelper::combineSequences({ tabStop }, stops))); +rPropertySet->setPropertyValue("ParaTabStops", + css::uno::Any(comphelper::combineSequences({ tabStop }, stops))); // FIXME: What if added tap stop is greater than already defined ones? } } @@ -299,9 +299,12 @@ void SAL_CALL SwVbaListFormat::ConvertNumbersToText( ) { continue; // for now, keep such lists as is } + // In case of higher outline levels, each assignment of empty value just sets level 1 -while ((*it)->getPropertyValue("NumberingRules") != css::uno::Any()) -(*it)->setPropertyValue("NumberingRules", css::uno::Any()); +while (rPropertySet->getPropertyValue("NumberingRules") != css::uno::Any()) +{ +rPropertySet->setPropertyValue("NumberingRules", css::uno::Any()); +} } } }
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 2 commits - chart2/source
chart2/source/view/main/DataTableView.cxx | 34 +++--- 1 file changed, 27 insertions(+), 7 deletions(-) New commits: commit 3fe3f3a985ae85e3cd3010f875ca4acc62219bb6 Author: Tomaž Vajngerl AuthorDate: Thu Aug 11 22:44:56 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 11 22:44:56 2022 +0200 chart2: render line legend symbols better in a data table Change-Id: I556b4f249688a3836bbeeb3f554cb9ecf1d31f65 diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index eafb64c69f60..7202f332b143 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -276,8 +276,10 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV { xCellTextRange->setString(rString); -bool bLeft = (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); -bool bRight = (bOutline && nColumn == nColumnCount) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +bool bLeft += (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); +bool bRight = (bOutline && nColumn == nColumnCount) + || (bVBorder && nColumn > 1 && nColumn < nColumnCount); setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline); setCellCharAndParagraphProperties(xPropertySet); } @@ -285,16 +287,22 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV } // ROW HEADER -// Prepare keys +// Prepare keys (symbols) +sal_Int32 nMaxSymbolWidth = 0; if (bKeys) { -awt::Size aMaxSymbolExtent(300, 300); for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList) { if (pSeriesPlotter) { +sal_Int32 nSymbolWidth = 300; +if (pSeriesPlotter->getLegendSymbolStyle() == LegendSymbolStyle::Line) +nSymbolWidth = 600; + +nMaxSymbolWidth = std::max(nSymbolWidth, nMaxSymbolWidth); + std::vector aNewEntries = pSeriesPlotter->createSymbols( -aMaxSymbolExtent, m_xTarget, m_xComponentContext); +{ nSymbolWidth, 300 }, m_xTarget, m_xComponentContext); aSymbols.insert(aSymbols.end(), aNewEntries.begin(), aNewEntries.end()); } } @@ -309,7 +317,8 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV if (xCellTextRange.is()) { bool bTop = (bOutline && nRow == 1) || (bHBorder && nRow > 1 && nRow < nRowCount); -bool bBottom = (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount); +bool bBottom += (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount); setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom); auto xText = xCellTextRange->getText(); @@ -324,7 +333,8 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV xCellPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_LEFT)); if (bKeys) -xCellPropertySet->setPropertyValue("ParaLeftMargin", uno::Any(500)); +xCellPropertySet->setPropertyValue("ParaLeftMargin", + uno::Any(nMaxSymbolWidth + 200)); } nRow++; } @@ -373,6 +383,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV pTableObject->DistributeColumns(0, nColumnCount - 1, true, true); pTableObject->DistributeRows(0, nRowCount - 1, true, true); +xBroadcaster->lockBroadcasts(); uno::Reference xPropertySet(xTableColumns->getByIndex(0), uno::UNO_QUERY); sal_Int32 nWidth = 0; xPropertySet->getPropertyValue("Width") >>= nWidth; @@ -403,6 +414,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV nTotalHeight += nHeight; } } +xBroadcaster->unlockBroadcasts(); } void DataTableView::initializeShapes(const rtl::Reference& xTarget) commit 7c630f846cb6d1e897a6eba1e2f3640236a74956 Author: Tomaž Vajngerl AuthorDate: Thu Aug 11 22:40:27 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 11 22:40:27 2022 +0200 chart2: fix rendering of table borders of row/column headers The row/column headers didn't enable/disable the table borders correctly when outline was enabled and horizontal and vertical borders properties were disabled. diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 981eb873669d..eafb64c69f60 100644 ---
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 978 commits - accessibility/inc accessibility/source android/source animations/source avmedia/source basctl/inc basctl/source basctl/u
Rebased ref, commits from common ancestor: commit 4208b0fac6111c9e5d438e2fe346e5987fcc8f4d Author: Tomaž Vajngerl AuthorDate: Mon Jul 18 08:12:19 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 10 15:16:22 2022 +0200 chart2: Data table rendering of keys (legend symbols) Change-Id: Iff13b188df18fe8f9919274869774f53f2ea323b diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index 3fe2fedcf7e8..5c7e70e97900 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -104,8 +104,7 @@ private: public: ChartView() = delete; -ChartView(css::uno::Reference< css::uno::XComponentContext > xContext, - ChartModel& rModel); +ChartView(css::uno::Reference xContext, ChartModel& rModel); virtual ~ChartView() override; @@ -185,6 +184,8 @@ public: void setViewDirty(); +css::uno::Reference const& getComponentContext() { return m_xCC;} + /// See sfx2::XmlDump::dumpAsXml(). void dumpAsXml(xmlTextWriterPtr pWriter) const override; @@ -210,8 +211,7 @@ private: //methods private: //member ::osl::Mutex m_aMutex; -css::uno::Reference< css::uno::XComponentContext> -m_xCC; +css::uno::Reference< css::uno::XComponentContext> m_xCC; chart::ChartModel& mrChartModel; diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 814d3afd7858..30aead187dcb 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -244,7 +244,8 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter ) void VAxisBase::createDataTableView(std::vector>& /*rSeriesPlotterList*/, uno::Reference const& /*xNumberFormatsSupplier*/, -rtl::Reference<::chart::ChartModel> const& /*xChartDoc*/) +rtl::Reference<::chart::ChartModel> const& /*xChartDoc*/, + css::uno::Reference const& /*rComponentContext*/) { } diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx index 2c4123ba951d..4ee4f5e288ae 100644 --- a/chart2/source/view/axes/VAxisBase.hxx +++ b/chart2/source/view/axes/VAxisBase.hxx @@ -23,6 +23,7 @@ #include "Tickmarks.hxx" namespace com::sun::star::util { class XNumberFormatsSupplier; } +namespace com::sun::star::uno { class XComponentContext; } namespace chart { @@ -30,6 +31,7 @@ namespace chart class VSeriesPlotter; class DataTableView; class ChartModel; +class LegendEntryProvider; class VAxisBase : public VAxisOrGridBase { @@ -65,7 +67,8 @@ public: virtual void createDataTableView(std::vector>& rSeriesPlotterList, css::uno::Reference const& xNumberFormatsSupplier, - rtl::Reference<::chart::ChartModel> const& xChartDoc); + rtl::Reference<::chart::ChartModel> const& xChartDoc, + css::uno::Reference const& rComponentContext); std::shared_ptr getDataTableView() { return m_pDataTableView; } diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index d7e78d5d2e85..293d1f0479a8 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1995,11 +1995,12 @@ void VCartesianAxis::createShapes() void VCartesianAxis::createDataTableView(std::vector>& rSeriesPlotterList, Reference const& xNumberFormatsSupplier, - rtl::Reference<::chart::ChartModel> const& xChartDoc) + rtl::Reference<::chart::ChartModel> const& xChartDoc, + css::uno::Reference const& rComponentContext) { if (m_aAxisProperties.m_bDisplayDataTable) { -m_pDataTableView.reset(new DataTableView(xChartDoc, m_aAxisProperties.m_xDataTableModel)); +m_pDataTableView.reset(new DataTableView(xChartDoc, m_aAxisProperties.m_xDataTableModel, rComponentContext)); m_pDataTableView->initializeValues(rSeriesPlotterList); m_xNumberFormatsSupplier = xNumberFormatsSupplier; } diff --git a/chart2/source/view/axes/VCartesianAxis.hxx b/chart2/source/view/axes/VCartesianAxis.hxx index a9baca907bdd..132887510eff 100644 --- a/chart2/source/view/axes/VCartesianAxis.hxx +++ b/chart2/source/view/axes/VCartesianAxis.hxx @@ -23,7 +23,6 @@ namespace chart { - class VCartesianAxis : public VAxisBase { // public methods @@ -101,7 +100,8 @@ public: void createDataTableView(std::vector>& rSeriesPlotterList, css::uno::Reference const& xNumberFormatsSupplier, - rtl::Reference<::chart::ChartModel> const& xChartDoc) override; +
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 5 commits - chart2/inc chart2/qa chart2/source include/svx include/xmloff offapi/com schema/libreoffice svx/source xmloff/Library_xo.m
chart2/inc/ChartView.hxx|8 chart2/qa/extras/chart2export2.cxx | 52 chart2/qa/extras/data/xlsx/ChartDataTable.xlsx |binary chart2/source/controller/main/ChartController_Insert.cxx| 25 +- chart2/source/model/main/DataTable.cxx |6 chart2/source/model/main/Diagram.cxx|2 chart2/source/view/axes/VAxisBase.cxx |3 chart2/source/view/axes/VAxisBase.hxx |5 chart2/source/view/axes/VCartesianAxis.cxx |5 chart2/source/view/axes/VCartesianAxis.hxx |4 chart2/source/view/axes/VCartesianCoordinateSystem.cxx |5 chart2/source/view/axes/VCartesianCoordinateSystem.hxx |3 chart2/source/view/axes/VCoordinateSystem.cxx |3 chart2/source/view/axes/VPolarCoordinateSystem.cxx |3 chart2/source/view/axes/VPolarCoordinateSystem.hxx |3 chart2/source/view/charttypes/VSeriesPlotter.cxx| 140 chart2/source/view/inc/DataTableView.hxx| 16 + chart2/source/view/inc/LegendEntryProvider.hxx |9 chart2/source/view/inc/VCoordinateSystem.hxx|4 chart2/source/view/inc/VSeriesPlotter.hxx | 12 + chart2/source/view/main/ChartView.cxx | 13 - chart2/source/view/main/DataTableView.cxx | 121 -- include/svx/svdotable.hxx |2 include/xmloff/xmltoken.hxx |7 offapi/com/sun/star/text/NumberingRules.idl |2 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng | 113 +++-- svx/source/table/svdotable.cxx | 12 + xmloff/Library_xo.mk|1 xmloff/source/chart/PropertyMaps.cxx|6 xmloff/source/chart/SchXMLChartContext.cxx |4 xmloff/source/chart/SchXMLDataTableContext.cxx | 87 +++ xmloff/source/chart/SchXMLDataTableContext.hxx | 40 +++ xmloff/source/chart/SchXMLExport.cxx| 38 ++- xmloff/source/core/xmltoken.cxx | 11 xmloff/source/token/tokens.txt |5 35 files changed, 677 insertions(+), 93 deletions(-) New commits: commit 7d203b23ff94f59d29b2e283dd5866b77a2d137d Author: Tomaž Vajngerl AuthorDate: Mon Jul 18 08:12:19 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Aug 10 12:12:51 2022 +0200 chart2: data table rendering of keys (legend symbols) Change-Id: Iff13b188df18fe8f9919274869774f53f2ea323b diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index 3fe2fedcf7e8..5c7e70e97900 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -104,8 +104,7 @@ private: public: ChartView() = delete; -ChartView(css::uno::Reference< css::uno::XComponentContext > xContext, - ChartModel& rModel); +ChartView(css::uno::Reference xContext, ChartModel& rModel); virtual ~ChartView() override; @@ -185,6 +184,8 @@ public: void setViewDirty(); +css::uno::Reference const& getComponentContext() { return m_xCC;} + /// See sfx2::XmlDump::dumpAsXml(). void dumpAsXml(xmlTextWriterPtr pWriter) const override; @@ -210,8 +211,7 @@ private: //methods private: //member ::osl::Mutex m_aMutex; -css::uno::Reference< css::uno::XComponentContext> -m_xCC; +css::uno::Reference< css::uno::XComponentContext> m_xCC; chart::ChartModel& mrChartModel; diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 814d3afd7858..30aead187dcb 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -244,7 +244,8 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter ) void VAxisBase::createDataTableView(std::vector>& /*rSeriesPlotterList*/, uno::Reference const& /*xNumberFormatsSupplier*/, -rtl::Reference<::chart::ChartModel> const& /*xChartDoc*/) +rtl::Reference<::chart::ChartModel> const& /*xChartDoc*/, + css::uno::Reference const& /*rComponentContext*/) { } diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx index 2c4123ba951d..4ee4f5e288ae 100644 --- a/chart2/source/view/axes/VAxisBase.hxx +++ b/chart2/source/view/axes/VAxisBase.hxx @@ -23,6 +23,7 @@ #include "Tickmarks.hxx" namespace com::sun::star::util { class XNumberFormatsSupplier; } +namespace com::sun::star::uno { class XComponentContext; } namespace chart { @@ -30,6 +31,7 @@
[Libreoffice-commits] core.git: 2 commits - include/svx svx/source sw/source
include/svx/svdobj.hxx |8 svx/source/svdraw/svdmodel.cxx | 25 +-- svx/source/svdraw/svdoashp.cxx | 198 +++- svx/source/svdraw/svdobj.cxx| 160 +-- svx/source/svdraw/svdocirc.cxx |8 svx/source/svdraw/svdoedge.cxx | 19 +- svx/source/svdraw/svdograf.cxx | 14 - svx/source/svdraw/svdogrp.cxx | 24 +- svx/source/svdraw/svdopage.cxx |2 svx/source/svdraw/svdotextpathdecomposition.cxx | 24 +- svx/source/svdraw/svdotxtr.cxx |8 svx/source/svdraw/svdovirt.cxx | 15 + sw/source/core/draw/dcontact.cxx|8 sw/source/core/draw/dflyobj.cxx | 41 +++- 14 files changed, 311 insertions(+), 243 deletions(-) New commits: commit ce2003a672c410e9cd47bb6580688eee57165d7c Author: Tomaž Vajngerl AuthorDate: Thu Jul 28 15:18:15 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Jul 29 20:48:49 2022 +0200 svx: manipulate SdrObject::m_aOutRect indirectly Change-Id: I0d8a8e4df06595250c07a61181fbd76fe1da5662 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137571 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 2e350c49b0f4..daf6cde70319 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -885,7 +885,13 @@ public: void ForceMetricToItemPoolMetric(basegfx::B2DPolyPolygon& rPolyPolygon) const noexcept; protected: -mutable tools::Rectanglem_aOutRect; // surrounding rectangle for Paint (incl. LineWidth, ...) +tools::Rectangle getOutRectangle() const; +void setOutRectangleConst(tools::Rectangle const& rRectangle) const; // need to do something about this +void setOutRectangle(tools::Rectangle const& rRectangle); +void resetOutRectangle(); +void moveOutRectangle(sal_Int32 nXDelta, sal_Int32 nYDelta); + +mutable tools::Rectangle m_aOutRect; // surrounding rectangle for Paint (incl. LineWidth, ...) Point m_aAnchor; // anchor position (Writer) SdrObjUserCall* m_pUserCall; std::unique_ptr diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 640b8abf547c..7cd102252b60 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2034,7 +2034,7 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point& rDestination, sal_Int32 nYDiff = aPt.Y - aInteractionHandle.aPosition.Y; maRect.Move( nXDiff, nYDiff ); -m_aOutRect.Move( nXDiff, nYDiff ); +moveOutRectangle(nXDiff, nYDiff); maSnapRect.Move( nXDiff, nYDiff ); SetBoundAndSnapRectsDirty(/*bNotMyself*/true); InvalidateRenderGeometry(); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index d503d68009ef..585988077edc 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1382,23 +1382,26 @@ bool SdrObject::BegCreate(SdrDragStat& rStat) tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow()); aRect1.Justify(); rStat.SetActionRect(aRect1); -m_aOutRect = aRect1; +setOutRectangle(aRect1); return true; } bool SdrObject::MovCreate(SdrDragStat& rStat) { -rStat.TakeCreateRect(m_aOutRect); -rStat.SetActionRect(m_aOutRect); -m_aOutRect.Justify(); - +tools::Rectangle aRectangle; +rStat.TakeCreateRect(aRectangle); +rStat.SetActionRect(aRectangle); +aRectangle.Justify(); +setOutRectangle(aRectangle); return true; } bool SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { -rStat.TakeCreateRect(m_aOutRect); -m_aOutRect.Justify(); +tools::Rectangle aRectangle; +rStat.TakeCreateRect(aRectangle); +aRectangle.Justify(); +setOutRectangle(aRectangle); return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2); } @@ -1429,9 +1432,9 @@ PointerStyle SdrObject::GetCreatePointer() const } // transformations -void SdrObject::NbcMove(const Size& rSiz) +void SdrObject::NbcMove(const Size& rSize) { -m_aOutRect.Move(rSiz); +moveOutRectangle(rSize.Width(), rSize.Height()); SetBoundAndSnapRectsDirty(); } @@ -1452,7 +1455,10 @@ void SdrObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti NbcMirrorGluePoints(aRef1,aRef2); } } -ResizeRect(m_aOutRect,rRef,xFact,yFact); +auto aRectangle = getOutRectangle(); +ResizeRect(aRectangle, rRef, xFact, yFact); +setOutRectangle(aRectangle); + SetBoundAndSnapRectsDirty(); } @@ -1465,60 +1471,85 @@ void SdrObject::NbcRotate(const Point& rRef, Degree100 nAngle) } } -void SdrObject::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double
[Libreoffice-commits] core.git: oox/source
oox/source/export/chartexport.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 89c7f5c5a8898ee2dcb0c738e8ce026e5b238ea5 Author: Tomaž Vajngerl AuthorDate: Mon May 23 15:50:59 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Thu Jul 28 18:16:07 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 diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 988fe4413529..458f72112907 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2066,6 +2066,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)); }
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/main/DataTableView.cxx | 60 +- 1 file changed, 59 insertions(+), 1 deletion(-) New commits: commit 6c2ae836aa6125e995f86985557c006c837a19bd Author: Tomaž Vajngerl AuthorDate: Sat May 21 10:52:51 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Thu Jul 28 16:22:31 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 diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 55a3b8628c50..72b669838435 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 @@ -59,11 +58,70 @@ void setTopCell(uno::Reference& xPropertySet) xPropertySet->setPropertyValue("TopBorder", uno::Any(aBorderLine)); xPropertySet->setPropertyValue("LeftBorder", uno::Any(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"); +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 =
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - svx/CppunitTest_svx_core.mk svx/Module_svx.mk svx/qa svx/source
svx/CppunitTest_svx_core.mk| 49 svx/Module_svx.mk |1 svx/qa/unit/core.cxx | 97 + svx/qa/unit/data/GraphicObjectResolverTest.zip |binary svx/source/xml/xmlgrhlp.cxx|7 + 5 files changed, 152 insertions(+), 2 deletions(-) New commits: commit 2bfad80805c248b47d099c1707ce4f1926867b82 Author: Tomaž Vajngerl AuthorDate: Wed Jul 20 22:01:31 2022 +0200 Commit: Xisco Fauli CommitDate: Wed Jul 27 16:48:14 2022 +0200 tdf#123983 fix loading graphic that is in root folder + test We need to detect that the storage name is empty, so in that case the root storage needs to be set as the current storage. Change-Id: Ibe3287ccf1f1513a3531dcf4d540a456cca8dfb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137276 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit d449da36086409e3cc440036193c4fc8a10a37a1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137424 Reviewed-by: Xisco Fauli Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137469 diff --git a/svx/CppunitTest_svx_core.mk b/svx/CppunitTest_svx_core.mk new file mode 100644 index ..67445767cc1d --- /dev/null +++ b/svx/CppunitTest_svx_core.mk @@ -0,0 +1,49 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#* +# +# 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/. +# +#* + +$(eval $(call gb_CppunitTest_CppunitTest,svx_core)) + +$(eval $(call gb_CppunitTest_use_externals,svx_core,\ + boost_headers \ +)) + +$(eval $(call gb_CppunitTest_add_exception_objects,svx_core, \ +svx/qa/unit/core \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,svx_core, \ +comphelper \ +cppu \ +cppuhelper \ +sal \ +svx \ +svxcore \ +test \ +tl \ +unotest \ +utl \ +vcl \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,svx_core)) + +$(eval $(call gb_CppunitTest_use_ure,svx_core)) +$(eval $(call gb_CppunitTest_use_vcl,svx_core)) + +$(eval $(call gb_CppunitTest_use_rdb,svx_core,services)) + +$(eval $(call gb_CppunitTest_use_custom_headers,svx_core,\ + officecfg/registry \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,svx_core)) + +# vim: set noet sw=4 ts=4: diff --git a/svx/Module_svx.mk b/svx/Module_svx.mk index 3891829c8108..27a709b23d1b 100644 --- a/svx/Module_svx.mk +++ b/svx/Module_svx.mk @@ -39,6 +39,7 @@ $(eval $(call gb_Module_add_check_targets,svx,\ CppunitTest_svx_unit \ CppunitTest_svx_gallery_test \ CppunitTest_svx_removewhichrange \ + CppunitTest_svx_core \ )) # screenshots diff --git a/svx/qa/unit/core.cxx b/svx/qa/unit/core.cxx new file mode 100644 index ..26cb13ee1faf --- /dev/null +++ b/svx/qa/unit/core.cxx @@ -0,0 +1,97 @@ +/* -*- 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/. + */ + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +using namespace ::com::sun::star; + +namespace +{ +/// Tests for svx/source/core/ code. +class Test : public test::BootstrapFixture, public unotest::MacrosTest +{ +private: +uno::Reference mxComponent; + +public: +void setUp() override; +void tearDown() override; +}; + +void Test::setUp() +{ +test::BootstrapFixture::setUp(); + +mxDesktop.set(frame::Desktop::create(mxComponentContext)); +} + +void Test::tearDown() +{ +if (mxComponent.is()) +mxComponent->dispose(); + +test::BootstrapFixture::tearDown(); +} + +constexpr OUStringLiteral DATA_DIRECTORY = u"/svx/qa/unit/data/"; + +CPPUNIT_TEST_FIXTURE(Test, testGraphicObjectResolver) +{ +OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "GraphicObjectResolverTest.zip"; +uno::Reference xStorage += comphelper::OStorageHelper::GetStorageOfFormatFromURL(ZIP_STORAGE_FORMAT_STRING, aURL, + embed::ElementModes::READWRITE); +CPPUNIT_ASSERT(xStorage.is()); + +rtl::Reference xGraphicHelper += SvXMLGraphicHelper::Create(xStorage, SvXMLGraphicHelperMode::Read); +CPPUNIT_ASSERT(xGraphicHelper.is()); + +// Test name in root folder +{ +
[Libreoffice-commits] core.git: chart2/source
chart2/source/model/main/DataTable.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 50c480bc1f68bc681fe369e0cb002a8f5b51843a Author: Tomaž Vajngerl AuthorDate: Sat May 21 10:51:55 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Wed Jul 27 16:39:34 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 diff --git a/chart2/source/model/main/DataTable.cxx b/chart2/source/model/main/DataTable.cxx index cc07cc1b55f5..5f3a5eb18403 100644 --- a/chart2/source/model/main/DataTable.cxx +++ b/chart2/source/model/main/DataTable.cxx @@ -93,6 +93,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); @@ -211,7 +212,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)
[Libreoffice-commits] core.git: include/o3tl
include/o3tl/enumarray.hxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit b9d360405a26ec976e443d501757ad806ffdcd6b Author: Tomaž Vajngerl AuthorDate: Mon Jul 25 15:32:52 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Jul 27 09:34:07 2022 +0200 o3tl: use std::array as the container for enumarray Change-Id: I482140a14a4f18014d89ed5b8ce7c3ca9447b8d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137465 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/o3tl/enumarray.hxx b/include/o3tl/enumarray.hxx index 558ab158bffe..4fd5cab3155f 100644 --- a/include/o3tl/enumarray.hxx +++ b/include/o3tl/enumarray.hxx @@ -23,6 +23,7 @@ #include #include #include +#include #include namespace o3tl { @@ -92,10 +93,10 @@ public: const_iterator begin() const { return const_iterator(*this, 0); } const_iterator end() const { return const_iterator(*this, size()); } -V* data() { return detail_values; } +V* data() { return detail_values.data(); } private: -V detail_values[max_index + 1]; +std::array detail_values; };
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - svx/CppunitTest_svx_core.mk svx/qa svx/source
svx/CppunitTest_svx_core.mk|1 svx/qa/unit/core.cxx | 44 - svx/qa/unit/data/GraphicObjectResolverTest.zip |binary svx/source/xml/xmlgrhlp.cxx|7 ++- 4 files changed, 49 insertions(+), 3 deletions(-) New commits: commit 5cea89cb8c805ded5b571fca295158c462e30303 Author: Tomaž Vajngerl AuthorDate: Wed Jul 20 22:01:31 2022 +0200 Commit: Xisco Fauli CommitDate: Tue Jul 26 14:55:57 2022 +0200 tdf#123983 fix loading graphic that is in root folder + test We need to detect that the storage name is empty, so in that case the root storage needs to be set as the current storage. Change-Id: Ibe3287ccf1f1513a3531dcf4d540a456cca8dfb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137276 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit d449da36086409e3cc440036193c4fc8a10a37a1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137424 Reviewed-by: Xisco Fauli diff --git a/svx/CppunitTest_svx_core.mk b/svx/CppunitTest_svx_core.mk index aac47ba1db0c..67445767cc1d 100644 --- a/svx/CppunitTest_svx_core.mk +++ b/svx/CppunitTest_svx_core.mk @@ -22,6 +22,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_core, \ $(eval $(call gb_CppunitTest_use_libraries,svx_core, \ comphelper \ cppu \ +cppuhelper \ sal \ svx \ svxcore \ diff --git a/svx/qa/unit/core.cxx b/svx/qa/unit/core.cxx index 7ec74da33859..27e5783e20db 100644 --- a/svx/qa/unit/core.cxx +++ b/svx/qa/unit/core.cxx @@ -9,11 +9,14 @@ #include #include - +#include #include #include +#include + #include +#include #include #include @@ -77,6 +80,45 @@ CPPUNIT_TEST_FIXTURE(Test, testChartExportToPdf) int nPageCount = pPdfDocument->getPageCount(); CPPUNIT_ASSERT_GREATER(0, nPageCount); } + +CPPUNIT_TEST_FIXTURE(Test, testGraphicObjectResolver) +{ +OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "GraphicObjectResolverTest.zip"; +uno::Reference xStorage += comphelper::OStorageHelper::GetStorageOfFormatFromURL(ZIP_STORAGE_FORMAT_STRING, aURL, + embed::ElementModes::READWRITE); +CPPUNIT_ASSERT(xStorage.is()); + +rtl::Reference xGraphicHelper += SvXMLGraphicHelper::Create(xStorage, SvXMLGraphicHelperMode::Read); +CPPUNIT_ASSERT(xGraphicHelper.is()); + +// Test name in root folder +{ +uno::Reference xGraphic = xGraphicHelper->loadGraphic("SomeImage.png"); +CPPUNIT_ASSERT_EQUAL(true, xGraphic.is()); +} + +// Test name in sub-folder +{ +uno::Reference xGraphic += xGraphicHelper->loadGraphic("Pictures/SomeOtherImage.png"); +CPPUNIT_ASSERT_EQUAL(true, xGraphic.is()); +} + +// Test non-existent name +{ +uno::Reference xGraphic; +try +{ +xGraphic = xGraphicHelper->loadGraphic("NoneExistent.png"); +} +catch (const uno::Exception&) +{ +} +CPPUNIT_ASSERT_EQUAL(false, xGraphic.is()); +} +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/svx/qa/unit/data/GraphicObjectResolverTest.zip b/svx/qa/unit/data/GraphicObjectResolverTest.zip new file mode 100644 index ..4c19bf2b01b7 Binary files /dev/null and b/svx/qa/unit/data/GraphicObjectResolverTest.zip differ diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 03e85db36922..4815c9e8a35d 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -390,7 +390,7 @@ bool SvXMLGraphicHelper::ImplGetStreamNames( const OUString& rURLStr, if( !aURLStr.isEmpty() && aURLStr.indexOf('/')<0 ) // just one token? { -rPictureStorageName = XML_GRAPHICSTORAGE_NAME; +rPictureStorageName = OUString(); rPictureStreamName = aURLStr; } else @@ -439,7 +439,10 @@ SvxGraphicHelperStream_Impl SvXMLGraphicHelper::ImplGetGraphicStream( const OUSt const OUString& rPictureStreamName ) { SvxGraphicHelperStream_Impl aRet; -aRet.xStorage = ImplGetGraphicStorage( rPictureStorageName ); +if (!rPictureStorageName.isEmpty()) +aRet.xStorage = ImplGetGraphicStorage(rPictureStorageName); +else +aRet.xStorage = mxRootStorage; sal_Int32 nMode = embed::ElementModes::READ; if (SvXMLGraphicHelperMode::Write == meCreateMode)
[Libreoffice-commits] core.git: oox/source
oox/source/export/chartexport.cxx | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) New commits: commit 5b1a8f39ee58fe5372eea18ce1ee99c95b11ba05 Author: Tomaž Vajngerl AuthorDate: Sat May 21 00:00:30 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Tue Jul 26 14:14:12 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 diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 8a6d5fa7d298..988fe4413529 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1732,6 +1732,7 @@ void ChartExport::exportPlotArea(const Reference< css::chart::XChartDocument >& } //Axis Data exportAxes( ); + // Data Table exportDataTable(); @@ -2033,35 +2034,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' - sc/inc sc/qa sc/source
sc/inc/SparklineCell.hxx |1 + sc/inc/SparklineData.hxx |2 ++ sc/qa/unit/SparklineImportExportTest.cxx |1 + sc/qa/unit/SparklineTest.cxx |1 + sc/source/filter/inc/SparklineFragment.hxx|3 +++ sc/source/filter/inc/export/SparklineExt.hxx |2 ++ sc/source/filter/xml/SparklineGroupsExport.hxx|1 + sc/source/filter/xml/SparklineGroupsImportContext.hxx |2 ++ sc/source/ui/inc/SparklineDataRangeDialog.hxx |1 + sc/source/ui/inc/SparklineDialog.hxx |1 + sc/source/ui/inc/SparklineShell.hxx |1 + sc/source/ui/inc/reffact.hxx |3 ++- sc/source/ui/inc/undo/UndoGroupSparklines.hxx |3 ++- sc/source/ui/inc/undo/UndoUngroupSparklines.hxx |1 + sc/source/ui/sparklines/SparklineAttributes.cxx |1 + 15 files changed, 22 insertions(+), 2 deletions(-) New commits: commit ee4946764d434d381b97b77078a2736e2c73e83b Author: Tomaž Vajngerl AuthorDate: Fri May 20 14:56:45 2022 +0900 Commit: Miklos Vajna CommitDate: Tue Jul 26 08:17:19 2022 +0200 Document sparkline related classes, functions and structs No functional change. Change-Id: I822c6a9d270dc582aaae2900f833843a0d6f8ddc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134651 Tested-by: Jenkins Reviewed-by: Miklos Vajna (cherry picked from commit 0874486b348f1477d59e161a4d73c5cb56e238f9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137434 Tested-by: Jenkins CollaboraOffice diff --git a/sc/inc/SparklineCell.hxx b/sc/inc/SparklineCell.hxx index 0588646866c4..f048148ce4a0 100644 --- a/sc/inc/SparklineCell.hxx +++ b/sc/inc/SparklineCell.hxx @@ -16,6 +16,7 @@ namespace sc { +/** Hodler of a sparkline, that is connected to a cell specific */ class SC_DLLPUBLIC SparklineCell { private: diff --git a/sc/inc/SparklineData.hxx b/sc/inc/SparklineData.hxx index 80cc8a0329c2..c004abbd73dc 100644 --- a/sc/inc/SparklineData.hxx +++ b/sc/inc/SparklineData.hxx @@ -15,6 +15,7 @@ namespace sc { +/** Data defining a sparkline - input data and output position */ struct SC_DLLPUBLIC SparklineData { ScAddress maPosition; @@ -34,6 +35,7 @@ enum class RangeOrientation Col }; +/** Determine the sparkline group orientation for the input data the output size */ SC_DLLPUBLIC RangeOrientation calculateOrientation(sal_Int32 nOutputSize, ScRange const& rInputRange); diff --git a/sc/qa/unit/SparklineImportExportTest.cxx b/sc/qa/unit/SparklineImportExportTest.cxx index 19765bd67016..572b8ed8b83f 100644 --- a/sc/qa/unit/SparklineImportExportTest.cxx +++ b/sc/qa/unit/SparklineImportExportTest.cxx @@ -17,6 +17,7 @@ using namespace css; +/** Test import, export or roundtrip of sparklines for ODF and OOXML */ class SparklineImportExportTest : public ScBootstrapFixture, public XmlTestTools { private: diff --git a/sc/qa/unit/SparklineTest.cxx b/sc/qa/unit/SparklineTest.cxx index 9c52ab1d1c65..ee104ef56356 100644 --- a/sc/qa/unit/SparklineTest.cxx +++ b/sc/qa/unit/SparklineTest.cxx @@ -19,6 +19,7 @@ using namespace css; +/** Test operation for sparklines, sparkline groups and attributes */ class SparklineTest : public ScBootstrapFixture { private: diff --git a/sc/source/filter/inc/SparklineFragment.hxx b/sc/source/filter/inc/SparklineFragment.hxx index de1f9ae7ebda..94ce5d9a91b3 100644 --- a/sc/source/filter/inc/SparklineFragment.hxx +++ b/sc/source/filter/inc/SparklineFragment.hxx @@ -23,6 +23,7 @@ class AttributeList; namespace oox::xls { +/** Transitional sparkline data */ class Sparkline { public: @@ -31,6 +32,7 @@ public: Sparkline() {} }; +/** Transitional sparkline group data */ class SparklineGroup { private: @@ -49,6 +51,7 @@ public: std::vector& getSparklines() { return m_aSparklines; } }; +/** Handle import of the sparkline, sparkline group and attributes */ class SparklineGroupsContext : public WorksheetContextBase { private: diff --git a/sc/source/filter/inc/export/SparklineExt.hxx b/sc/source/filter/inc/export/SparklineExt.hxx index 554fe9c7ec34..f2bff1c7d377 100644 --- a/sc/source/filter/inc/export/SparklineExt.hxx +++ b/sc/source/filter/inc/export/SparklineExt.hxx @@ -24,6 +24,7 @@ namespace xcl::exp { +/** Export for sparkline type of element - top sparkline element. */ class SparklineExt : public XclExpExt { public: @@ -42,6 +43,7 @@ public: XclExpExtType GetType() override { return XclExpExtSparklineType; } }; +/** Determines if sparklines needs to be exported and initiates the export. */ class SparklineBuffer : public XclExpRecordBase, protected XclExpRoot { public: diff --git a/sc/source/filter/xml/SparklineGroupsExport.hxx b/sc/source/filter/xml/SparklineGroupsExport.hxx index b20fd8529574..9359413735dc
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 384 commits - accessibility/inc accessibility/source animations/source avmedia/source basctl/inc basctl/source basctl/uiconfig base
Rebased ref, commits from common ancestor: commit e86d9f54947085e6fa2ff549b2c61dce2e9e9567 Author: Tomaž Vajngerl AuthorDate: Mon Jul 25 15:38:24 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Jul 25 16:10:44 2022 +0200 svgio: use "frozen" for mapping between token strings and enums Change-Id: I2061606146cfcb34169dccf69b6f720727839d04 diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk index c5a35405323f..c4aa4f80e97b 100644 --- a/svgio/Library_svgio.mk +++ b/svgio/Library_svgio.mk @@ -25,7 +25,10 @@ $(eval $(call gb_Library_set_include,svgio,\ -I$(SRCDIR)/svgio/inc \ )) -$(eval $(call gb_Library_use_external,svgio,boost_headers)) +$(eval $(call gb_Library_use_externals,svgio,\ +boost_headers \ +frozen \ +)) $(eval $(call gb_Library_set_precompiled_header,svgio,svgio/inc/pch/precompiled_svgio)) diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx index 0b03e2c3f0cd..955043a9738f 100644 --- a/svgio/source/svgreader/svgtoken.cxx +++ b/svgio/source/svgreader/svgtoken.cxx @@ -18,327 +18,384 @@ */ #include -#include +#include + namespace svgio::svgreader { -const char aSVGStrWidth[] = "width"; -const char aSVGStrHeight[] = "height"; -const char aSVGStrViewBox[] = "viewBox"; -const char aSVGStrTransform[] = "transform"; -const char aSVGStrStyle[] = "style"; -const char aSVGStrDisplay[] = "display"; // #i121656# -const char aSVGStrD[] = "d"; -const char aSVGStrX[] = "x"; -const char aSVGStrY[] = "y"; -const char aSVGStrXmlns[] = "xmlns"; -const char aSVGStrVersion[] = "version"; -const char aSVGStrId[] = "id"; -const char aSVGStrRx[] = "rx"; -const char aSVGStrRy[] = "ry"; -const char aSVGStrPoints[] = "points"; -const char aSVGStrDx[] = "dx"; -const char aSVGStrDy[] = "dy"; -const char aSVGStrRotate[] = "rotate"; -const char aSVGStrTextLength[] = "textLength"; -const char aSVGStrLengthAdjust[] = "lengthAdjust"; -const char aSVGStrFont[] = "font"; -const char aSVGStrFontFamily[] = "font-family"; -const char aSVGStrFontSize[] = "font-size"; -const char aSVGStrFontSizeAdjust[] = "font-size-adjust"; -const char aSVGStrFontStretch[] = "font-stretch"; -const char aSVGStrFontStyle[] = "font-style"; -const char aSVGStrFontVariant[] = "font-variant"; -const char aSVGStrFontWeight[] = "font-weight"; -const char aSVGStrDirection[] = "direction"; -const char aSVGStrLetterSpacing[] = "letter-spacing"; -const char aSVGStrTextDecoration[] = "text-decoration"; -const char aSVGStrUnicodeBidi[] = "unicode-bidi"; -const char aSVGStrWordSpacing[] = "word-spacing"; -const char aSVGStrTspan[] = "tspan"; -const char aSVGStrTref[] = "tref"; -const char aSVGStrTextPath[] = "textPath"; -const char aSVGStrStartOffset[] = "startOffset"; -const char aSVGStrMethod[] = "method"; -const char aSVGStrSpacing[] = "spacing"; -const char aSVGStrTextAlign[] = "text-align"; -const char aSVGStrPathLength[] = "pathLength"; -const char aSVGStrType[] = "type"; -const char aSVGStrClass[] = "class"; -const char aSVGStrTextAnchor[] = "text-anchor"; -const char aSVGStrXmlSpace[] = "xml:space"; -const char aSVGStrColor[] = "color"; -const char aSVGStrClipPathNode[] = "clipPath"; -const char aSVGStrClipPathProperty[] = "clip-path"; -const char aSVGStrMask[] = "mask"; -const char aSVGStrClipPathUnits[] = "clipPathUnits"; -const char aSVGStrMaskUnits[] = "maskUnits"; -const char aSVGStrMaskContentUnits[] = "maskContentUnits"; -const char aSVGStrClipRule[] = "clip-rule"; -const char aSVGStrMarker[] = "marker"; -const char aSVGStrMarkerStart[] = "marker-start"; -const char aSVGStrMarkerMid[] = "marker-mid"; -const char aSVGStrMarkerEnd[] = "marker-end"; -const char aSVGStrRefX[] = "refX"; -const char aSVGStrRefY[] = "refY"; -const char aSVGStrMarkerUnits[] = "markerUnits"; -const char aSVGStrMarkerWidth[] = "markerWidth"; -const char aSVGStrMarkerHeight[] = "markerHeight"; -const char aSVGStrOrient[] = "orient"; -const char aSVGStrPattern[] = "pattern"; -const char aSVGStrPatternUnits[] = "patternUnits"; -const char aSVGStrPatternContentUnits[] = "patternContentUnits"; -const char aSVGStrPatternTransform[] = "patternTransform"; -const char aSVGStrOpacity[] = "opacity"; -const char aSVGStrVisibility[] = "visibility"; -constexpr OUStringLiteral aSVGStrTitle = u"title"; -constexpr OUStringLiteral aSVGStrDesc = u"desc"; +constexpr const std::u16string_view constToken_Width = u"width"; +
[Libreoffice-commits] core.git: vcl/quartz
vcl/quartz/salbmp.cxx |5 - 1 file changed, 5 deletions(-) New commits: commit a02d4f656add39658c30669f2652bf6536207098 Author: Tomaž Vajngerl AuthorDate: Wed Jul 20 23:43:47 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Jul 21 18:16:25 2022 +0200 remove 4-bit bitmap bits that were still present in QuartzSalBitmap Change-Id: I3a363f9b382e298422e3a4bd6b58504cbaba077e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137286 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index f0f5fb9a5b8f..cdc405ad362c 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -224,7 +224,6 @@ bool QuartzSalBitmap::AllocateUserData() switch( mnBits ) { case 1: mnBytesPerRow = (mnWidth + 7) >> 3; break; -case 4: mnBytesPerRow = (mnWidth + 1) >> 1; break; case 8: mnBytesPerRow = mnWidth; break; case 24:mnBytesPerRow = (mnWidth << 1) + mnWidth; break; case 32:mnBytesPerRow = mnWidth << 2; break; @@ -370,20 +369,17 @@ static const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome ) // since all other platforms do so, too. static bool bDefPalInit = false; static BitmapPalette aDefPalette256; -static BitmapPalette aDefPalette16; static BitmapPalette aDefPalette2; if( ! bDefPalInit ) { bDefPalInit = true; aDefPalette256.SetEntryCount( 256 ); -aDefPalette16.SetEntryCount( 16 ); aDefPalette2.SetEntryCount( 2 ); // Standard colors unsigned int i; for( i = 0; i < 16; i++ ) { -aDefPalette16[i] = aDefPalette256[i] = BitmapColor( aImplSalSysPalEntryAry[i].mnRed, aImplSalSysPalEntryAry[i].mnGreen, aImplSalSysPalEntryAry[i].mnBlue ); @@ -414,7 +410,6 @@ static const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome ) switch( mnBits ) { case 1: return aDefPalette2; -case 4: return aDefPalette16; case 8: return aDefPalette256; default: break; }
[Libreoffice-commits] core.git: 2 commits - chart2/source svx/CppunitTest_svx_core.mk svx/qa svx/source
chart2/source/view/axes/VAxisBase.cxx |3 chart2/source/view/axes/VAxisBase.hxx |4 chart2/source/view/axes/VCartesianAxis.cxx |6 - chart2/source/view/axes/VCartesianAxis.hxx |3 chart2/source/view/axes/VCartesianCoordinateSystem.cxx |2 chart2/source/view/inc/DataTableView.hxx | 11 + chart2/source/view/main/DataTableView.cxx | 94 + svx/CppunitTest_svx_core.mk|1 svx/qa/unit/core.cxx | 44 +++ svx/qa/unit/data/GraphicObjectResolverTest.zip |binary svx/source/xml/xmlgrhlp.cxx|7 - 11 files changed, 145 insertions(+), 30 deletions(-) New commits: commit d449da36086409e3cc440036193c4fc8a10a37a1 Author: Tomaž Vajngerl AuthorDate: Wed Jul 20 22:01:31 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Jul 21 09:01:51 2022 +0200 tdf#123983 fix loading graphic that is in root folder + test We need to detect that the storage name is empty, so in that case the root storage needs to be set as the current storage. Change-Id: Ibe3287ccf1f1513a3531dcf4d540a456cca8dfb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137276 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/svx/CppunitTest_svx_core.mk b/svx/CppunitTest_svx_core.mk index aac47ba1db0c..67445767cc1d 100644 --- a/svx/CppunitTest_svx_core.mk +++ b/svx/CppunitTest_svx_core.mk @@ -22,6 +22,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_core, \ $(eval $(call gb_CppunitTest_use_libraries,svx_core, \ comphelper \ cppu \ +cppuhelper \ sal \ svx \ svxcore \ diff --git a/svx/qa/unit/core.cxx b/svx/qa/unit/core.cxx index 7ec74da33859..27e5783e20db 100644 --- a/svx/qa/unit/core.cxx +++ b/svx/qa/unit/core.cxx @@ -9,11 +9,14 @@ #include #include - +#include #include #include +#include + #include +#include #include #include @@ -77,6 +80,45 @@ CPPUNIT_TEST_FIXTURE(Test, testChartExportToPdf) int nPageCount = pPdfDocument->getPageCount(); CPPUNIT_ASSERT_GREATER(0, nPageCount); } + +CPPUNIT_TEST_FIXTURE(Test, testGraphicObjectResolver) +{ +OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "GraphicObjectResolverTest.zip"; +uno::Reference xStorage += comphelper::OStorageHelper::GetStorageOfFormatFromURL(ZIP_STORAGE_FORMAT_STRING, aURL, + embed::ElementModes::READWRITE); +CPPUNIT_ASSERT(xStorage.is()); + +rtl::Reference xGraphicHelper += SvXMLGraphicHelper::Create(xStorage, SvXMLGraphicHelperMode::Read); +CPPUNIT_ASSERT(xGraphicHelper.is()); + +// Test name in root folder +{ +uno::Reference xGraphic = xGraphicHelper->loadGraphic("SomeImage.png"); +CPPUNIT_ASSERT_EQUAL(true, xGraphic.is()); +} + +// Test name in sub-folder +{ +uno::Reference xGraphic += xGraphicHelper->loadGraphic("Pictures/SomeOtherImage.png"); +CPPUNIT_ASSERT_EQUAL(true, xGraphic.is()); +} + +// Test non-existent name +{ +uno::Reference xGraphic; +try +{ +xGraphic = xGraphicHelper->loadGraphic("NoneExistent.png"); +} +catch (const uno::Exception&) +{ +} +CPPUNIT_ASSERT_EQUAL(false, xGraphic.is()); +} +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/svx/qa/unit/data/GraphicObjectResolverTest.zip b/svx/qa/unit/data/GraphicObjectResolverTest.zip new file mode 100644 index ..4c19bf2b01b7 Binary files /dev/null and b/svx/qa/unit/data/GraphicObjectResolverTest.zip differ diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 6c5c76bfce73..6c12aa4bee2b 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -390,7 +390,7 @@ bool SvXMLGraphicHelper::ImplGetStreamNames( const OUString& rURLStr, if( !aURLStr.isEmpty() && aURLStr.indexOf('/')<0 ) // just one token? { -rPictureStorageName = XML_GRAPHICSTORAGE_NAME; +rPictureStorageName = OUString(); rPictureStreamName = aURLStr; } else @@ -439,7 +439,10 @@ SvxGraphicHelperStream_Impl SvXMLGraphicHelper::ImplGetGraphicStream( const OUSt const OUString& rPictureStreamName ) { SvxGraphicHelperStream_Impl aRet; -aRet.xStorage = ImplGetGraphicStorage( rPictureStorageName ); +if (!rPictureStorageName.isEmpty()) +aRet.xStorage = ImplGetGraphicStorage(rPictureStorageName); +else +aRet.xStorage = mxRootStorage; sal_Int32 nMode = embed::ElementModes::READ; if (SvXMLGraphicHelperMode::Write == meCreateMode) commit 6c24f112ad86df77f2de27a31742bca01ed56bdf Author: Tomaž Vajngerl AuthorDate: Fri May 20 23:55:45 2022
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/qa sw/source
sw/qa/extras/uiwriter/data/HiddenSection.odt |binary sw/qa/extras/uiwriter/uiwriter2.cxx | 50 +++ sw/source/core/doc/docfld.cxx| 28 ++- sw/source/core/docnode/ndsect.cxx|1 4 files changed, 77 insertions(+), 2 deletions(-) New commits: commit 7e10b37030eb2a5afe783f078d36556d86da762e Author: Tomaž Vajngerl AuthorDate: Thu Jul 14 11:07:45 2022 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Tue Jul 19 06:55:30 2022 +0200 tdf#54703 fix unhiding at PDF export of cond. hidden sections The conditionally hidden sections became visible when PDF export is performed. This is due to field update where we temporary made the conditionally hidden section visible (as the frame is needed), but never put them back to hidden. Probably the expectation was that the condition will be recalculated later on, but wasn't. This change fixes this so that the changed sections will be recalculated at the end. Change-Id: Ic6d8a4a38f22ed961b2b37e05aaf3e720fc50ed4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137052 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 868b45039d2d168e1c51d971b0d1e0589d4d11eb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137073 Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/qa/extras/uiwriter/data/HiddenSection.odt b/sw/qa/extras/uiwriter/data/HiddenSection.odt new file mode 100644 index ..8358cbc9951a Binary files /dev/null and b/sw/qa/extras/uiwriter/data/HiddenSection.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 8e78a70f97c1..59f8047ca82f 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -14,9 +14,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -3161,6 +3163,54 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140757) CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testConditionalHiddenSectionIssue) +{ +// tdf#54703 +// When exporting the bug document as PDF, the conditional hidden +// sections became visible in the PDF and in the document. + +std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get(); +if (!pPDFium) +return; + +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "HiddenSection.odt"); + +// Check section conditional hidden status - all should be hidden (IsCondHidden == true) +for (SwNodeOffset i(0); i < pDoc->GetNodes().Count(); ++i) +{ +if (SwSectionNode const* const pNode = pDoc->GetNodes()[i]->GetSectionNode()) +{ +CPPUNIT_ASSERT_EQUAL(true, pNode->GetSection().IsCondHidden()); +} +} + +// PDF export +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +utl::MediaDescriptor aMediaDescriptor; +aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); +xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + +SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ); +SvMemoryStream aMemory; +aMemory.WriteStream(aFile); +auto pPdfDocument = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize()); +CPPUNIT_ASSERT(pPdfDocument); +auto pPdfPage = pPdfDocument->openPage(0); +CPPUNIT_ASSERT(pPdfPage); + +// No PDF object should be present in the page - sections remained hidden +CPPUNIT_ASSERT_EQUAL(0, pPdfPage->getObjectCount()); + +// Check section conditional hidden status - all should remained hidden (IsCondHidden == true) +for (SwNodeOffset i(0); i < pDoc->GetNodes().Count(); ++i) +{ +if (SwSectionNode const* const pNode = pDoc->GetNodes()[i]->GetSectionNode()) +{ +CPPUNIT_ASSERT_EQUAL(true, pNode->GetSection().IsCondHidden()); +} +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index a1a7434a25b6..d0e489b7b027 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -840,6 +840,9 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) // new version: walk all fields of the attribute pool m_pFieldSortList.reset(new SetGetExpFields); +// remembeer sections that were unhidden and need to be hidden again +std::vector> aUnhiddenSections; + // consider and unhide sections // with hide condition, only in mode GETFLD_ALL () // notes by OD: @@ -886,13 +889,27 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) { pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); OSL_ENSURE( pSectNd, "Where is my SectionNode" ); -
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/source
sw/qa/extras/uiwriter/data/HiddenSection.odt |binary sw/qa/extras/uiwriter/uiwriter2.cxx | 50 +++ sw/source/core/doc/docfld.cxx| 28 ++- sw/source/core/docnode/ndsect.cxx|1 4 files changed, 77 insertions(+), 2 deletions(-) New commits: commit 70d201c857fe86834f618f8c66df6f19b76c2556 Author: Tomaž Vajngerl AuthorDate: Thu Jul 14 11:07:45 2022 +0200 Commit: Andras Timar CommitDate: Mon Jul 18 15:38:24 2022 +0200 tdf#54703 fix unhiding at PDF export of cond. hidden sections The conditionally hidden sections became visible when PDF export is performed. This is due to field update where we temporary made the conditionally hidden section visible (as the frame is needed), but never put them back to hidden. Probably the expectation was that the condition will be recalculated later on, but wasn't. This change fixes this so that the changed sections will be recalculated at the end. Change-Id: Ic6d8a4a38f22ed961b2b37e05aaf3e720fc50ed4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137052 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137162 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/sw/qa/extras/uiwriter/data/HiddenSection.odt b/sw/qa/extras/uiwriter/data/HiddenSection.odt new file mode 100644 index ..8358cbc9951a Binary files /dev/null and b/sw/qa/extras/uiwriter/data/HiddenSection.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index f895b59ba402..6db1b70051fc 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -30,10 +30,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -6069,6 +6071,54 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126735) CPPUNIT_ASSERT_EQUAL(OUString("or "), xTextRange->getString()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testConditionalHiddenSectionIssue) +{ +// tdf#54703 +// When exporting the bug document as PDF, the conditional hidden +// sections became visible in the PDF and in the document. + +std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get(); +if (!pPDFium) +return; + +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "HiddenSection.odt"); + +// Check section conditional hidden status - all should be hidden (IsCondHidden == true) +for (SwNodeOffset i(0); i < pDoc->GetNodes().Count(); ++i) +{ +if (SwSectionNode const* const pNode = pDoc->GetNodes()[i]->GetSectionNode()) +{ +CPPUNIT_ASSERT_EQUAL(true, pNode->GetSection().IsCondHidden()); +} +} + +// PDF export +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +utl::MediaDescriptor aMediaDescriptor; +aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); +xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + +SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ); +SvMemoryStream aMemory; +aMemory.WriteStream(aFile); +auto pPdfDocument = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize()); +CPPUNIT_ASSERT(pPdfDocument); +auto pPdfPage = pPdfDocument->openPage(0); +CPPUNIT_ASSERT(pPdfPage); + +// No PDF object should be present in the page - sections remained hidden +CPPUNIT_ASSERT_EQUAL(0, pPdfPage->getObjectCount()); + +// Check section conditional hidden status - all should remained hidden (IsCondHidden == true) +for (SwNodeOffset i(0); i < pDoc->GetNodes().Count(); ++i) +{ +if (SwSectionNode const* const pNode = pDoc->GetNodes()[i]->GetSectionNode()) +{ +CPPUNIT_ASSERT_EQUAL(true, pNode->GetSection().IsCondHidden()); +} +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 652af8a188b9..fb1e71f3b190 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -839,6 +839,9 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) // new version: walk all fields of the attribute pool m_pFieldSortList.reset(new SetGetExpFields); +// remembeer sections that were unhidden and need to be hidden again +std::vector> aUnhiddenSections; + // consider and unhide sections // with hide condition, only in mode GETFLD_ALL () // notes by OD: @@ -885,13 +888,27 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) { pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); OSL_ENSURE( pSectNd, "Where is my SectionNode" ); -pSectNd->GetSection().SetCondHidden( false ); + +
[Libreoffice-commits] core.git: 2 commits - chart2/source
chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 19 chart2/source/model/main/DataTable.cxx | 27 +--- 2 files changed, 14 insertions(+), 32 deletions(-) New commits: commit 14553d280ad76c3436d394e92c63de7b6e51 Author: Tomaž Vajngerl AuthorDate: Fri May 20 18:39:34 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Mon Jul 18 07:16:57 2022 +0200 chart2: better readable DataTable properties definition Change-Id: Ib9cadee39f58b73782e6a3268d86b688183de1fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137157 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/model/main/DataTable.cxx b/chart2/source/model/main/DataTable.cxx index cfadc5fee0ae..cc07cc1b55f5 100644 --- a/chart2/source/model/main/DataTable.cxx +++ b/chart2/source/model/main/DataTable.cxx @@ -33,20 +33,19 @@ enum DataTableProperty_Keys, }; -void lcl_AddPropertiesToVector(std::vector& rOutProperties) -{ -rOutProperties.emplace_back( -"HBorder", DataTableProperty_HorizontalBorder, cppu::UnoType::get(), -beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT); -rOutProperties.emplace_back( -"VBorder", DataTableProperty_VerticalBorder, cppu::UnoType::get(), -beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT); -rOutProperties.emplace_back("Outline", DataTableProperty_Outilne, cppu::UnoType::get(), -beans::PropertyAttribute::BOUND -| beans::PropertyAttribute::MAYBEDEFAULT); -rOutProperties.emplace_back("Keys", DataTableProperty_Keys, cppu::UnoType::get(), -beans::PropertyAttribute::BOUND -| beans::PropertyAttribute::MAYBEDEFAULT); +void lcl_AddPropertiesToVector(std::vector& rProps) +{ +auto const nBound = beans::PropertyAttribute::BOUND; +auto const nMaybeDefault = beans::PropertyAttribute::MAYBEDEFAULT; + +rProps.emplace_back("HBorder", DataTableProperty_HorizontalBorder, cppu::UnoType::get(), +nBound | nMaybeDefault); +rProps.emplace_back("VBorder", DataTableProperty_VerticalBorder, cppu::UnoType::get(), +nBound | nMaybeDefault); +rProps.emplace_back("Outline", DataTableProperty_Outilne, cppu::UnoType::get(), +nBound | nMaybeDefault); +rProps.emplace_back("Keys", DataTableProperty_Keys, cppu::UnoType::get(), +nBound | nMaybeDefault); } struct StaticDataTableDefaults_Initializer commit d518ac1e9ec866785a13367491c52d2ac72d85ec Author: Tomaž Vajngerl AuthorDate: Fri May 20 18:20:51 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Mon Jul 18 07:16:44 2022 +0200 chart2: remove setting DataTable* props. from old chart::XDialog No API change needed as the properties were not officialy part of the API in the first place. Change-Id: I8682087d13ab2e9eb1c619646b87cde59c3a8e45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137156 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index db1abe739787..0fea6c4da7f9 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -137,9 +137,6 @@ enum PROP_DIAGRAM_HAS_SECOND_Y_AXIS_TITLE, PROP_DIAGRAM_AUTOMATIC_SIZE, -PROP_DIAGRAM_DATATABLEHBORDER, -PROP_DIAGRAM_DATATABLEVBORDER, -PROP_DIAGRAM_DATATABLEOUTLINE, PROP_DIAGRAM_EXTERNALDATA }; @@ -381,21 +378,7 @@ void lcl_AddPropertiesToVector( cppu::UnoType::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT ); -rOutProperties.emplace_back( "DataTableHBorder", -PROP_DIAGRAM_DATATABLEHBORDER, - cppu::UnoType::get(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT ); -rOutProperties.emplace_back( "DataTableVBorder", -PROP_DIAGRAM_DATATABLEVBORDER, - cppu::UnoType::get(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT ); -rOutProperties.emplace_back( "DataTableOutline", -PROP_DIAGRAM_DATATABLEOUTLINE, - cppu::UnoType::get(), - beans::PropertyAttribute::BOUND - | beans::PropertyAttribute::MAYBEDEFAULT ); + rOutProperties.emplace_back( "ExternalData", PROP_DIAGRAM_EXTERNALDATA, cppu::UnoType::get(),
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/axes/VCartesianAxis.cxx |2 chart2/source/view/inc/DataTableView.hxx |6 +- chart2/source/view/main/DataTableView.cxx | 74 ++--- 3 files changed, 62 insertions(+), 20 deletions(-) New commits: commit 7cb504bd5e2c49a73af3270d1ecefe1bd838b66f Author: Tomaž Vajngerl AuthorDate: Thu May 19 21:52:15 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Mon Jul 18 07:16:19 2022 +0200 chart2: use {V,H}Border, Outline Data Table props. at rendering insert DataTable class into DataTableView, so it is possible to take the properties into account when rendering. Change rendering: VBorder - draw vert. border of data table HBorder - draw horiz. border of data table Outline - draw the outline borders of a data table Change-Id: I8348d0672d9c188014d664d667abddde8ebbc7c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137155 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 2266dd143d2e..096586279454 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1997,7 +1997,7 @@ void VCartesianAxis::createDataTableView(std::vectorinitializeValues(rSeriesPlotterList); m_xNumberFormatsSupplier = xNumberFormatsSupplier; } diff --git a/chart2/source/view/inc/DataTableView.hxx b/chart2/source/view/inc/DataTableView.hxx index 517de9699d9e..3f4d97629035 100644 --- a/chart2/source/view/inc/DataTableView.hxx +++ b/chart2/source/view/inc/DataTableView.hxx @@ -12,6 +12,7 @@ #include #include #include +#include namespace chart { @@ -21,17 +22,18 @@ class DataTableView final { rtl::Reference m_xTarget; rtl::Reference m_xTableShape; +rtl::Reference m_xDataTableModel; std::vector m_aDataSeriesNames; std::vector m_aXValues; std::vector> m_pDataSeriesValues; public: -DataTableView(); +DataTableView(rtl::Reference const& rDataTableModel); void initializeShapes(const rtl::Reference& xTarget); void initializeValues(std::vector>& rSeriesPlotterList); void createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd, - sal_Int32 nDistance); + sal_Int32 nColumnWidth); }; } //namespace chart diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index cbb52ba02ccf..7b7fb60132ef 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -30,11 +30,15 @@ using namespace css; namespace chart { -DataTableView::DataTableView() = default; +DataTableView::DataTableView(rtl::Reference const& rDataTableModel) +: m_xDataTableModel(rDataTableModel) +{ +} namespace { -void setCellDefaults(uno::Reference& xPropertySet) +void setCellDefaults(uno::Reference& xPropertySet, bool bLeft, bool bTop, + bool bRight, bool bBottom) { xPropertySet->setPropertyValue("FillColor", uno::Any(Color(0xFF))); xPropertySet->setPropertyValue("TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_TOP)); @@ -44,10 +48,14 @@ void setCellDefaults(uno::Reference& xPropertySet) aBorderLine.LineWidth = o3tl::convert(0.5, o3tl::Length::pt, o3tl::Length::mm100); aBorderLine.Color = 0x00; -xPropertySet->setPropertyValue("TopBorder", uno::Any(aBorderLine)); -xPropertySet->setPropertyValue("BottomBorder", uno::Any(aBorderLine)); -xPropertySet->setPropertyValue("LeftBorder", uno::Any(aBorderLine)); -xPropertySet->setPropertyValue("RightBorder", uno::Any(aBorderLine)); +if (bLeft) +xPropertySet->setPropertyValue("LeftBorder", uno::Any(aBorderLine)); +if (bTop) +xPropertySet->setPropertyValue("TopBorder", uno::Any(aBorderLine)); +if (bRight) +xPropertySet->setPropertyValue("RightBorder", uno::Any(aBorderLine)); +if (bBottom) +xPropertySet->setPropertyValue("BottomBorder", uno::Any(aBorderLine)); } void setTopCell(uno::Reference& xPropertySet) @@ -65,7 +73,7 @@ void setTopCell(uno::Reference& xPropertySet) } } void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd, - sal_Int32 nColumnSize) + sal_Int32 nColumnWidth) { if (!m_xTarget.is()) return; @@ -74,7 +82,6 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV m_xTableShape = ShapeFactory::createTable(m_xTarget); uno::Reference xTable; -uno::Reference xBroadcaster; try { auto rDelta = rEnd - rStart; @@ -86,18 +93,31 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV return; } -if (xTable.is()) -xBroadcaster.set(xTable, uno::UNO_QUERY); +if
[Libreoffice-commits] core.git: 2 commits - chart2/source oox/inc oox/source
chart2/source/view/axes/VAxisProperties.cxx| 10 +++--- chart2/source/view/axes/VAxisProperties.hxx|8 ++-- chart2/source/view/axes/VCartesianCoordinateSystem.cxx |5 - chart2/source/view/axes/VPolarCoordinateSystem.cxx |6 +- oox/inc/drawingml/chart/datatablemodel.hxx |3 +++ oox/source/drawingml/chart/datatablecontext.cxx|7 ++- oox/source/drawingml/chart/datatableconverter.cxx |3 +++ 7 files changed, 34 insertions(+), 8 deletions(-) New commits: commit 7077e688408210b32596cbac2f2202610094ddf3 Author: Tomaž Vajngerl AuthorDate: Mon May 16 16:19:39 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Jul 17 21:49:43 2022 +0200 oox: support reading text and shape properties for a data table Change-Id: I740d3bd6af11457ecb54878be648ad1e22b9d4b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137153 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/oox/inc/drawingml/chart/datatablemodel.hxx b/oox/inc/drawingml/chart/datatablemodel.hxx index 5c7fe7901200..937dbb3c60a6 100644 --- a/oox/inc/drawingml/chart/datatablemodel.hxx +++ b/oox/inc/drawingml/chart/datatablemodel.hxx @@ -28,6 +28,9 @@ struct DataTableModel bool mbShowOutline : 1; /// Show outline bool mbShowKeys : 1; +ModelRef mxShapeProp; /// frame formatting. +ModelRef mxTextProp; /// text formatting. + DataTableModel() : mbShowHBorder(false) , mbShowVBorder(false) diff --git a/oox/source/drawingml/chart/datatablecontext.cxx b/oox/source/drawingml/chart/datatablecontext.cxx index 0813a6424312..c277dae5f4d6 100644 --- a/oox/source/drawingml/chart/datatablecontext.cxx +++ b/oox/source/drawingml/chart/datatablecontext.cxx @@ -18,7 +18,8 @@ */ #include - +#include +#include #include #include #include @@ -57,6 +58,10 @@ ContextHandlerRef DataTableContext::onCreateContext(sal_Int32 nElement, case C_TOKEN(showKeys): mrModel.mbShowKeys = rAttribs.getBool(XML_val, false); break; +case C_TOKEN(spPr): +return new ShapePropertiesContext(*this, mrModel.mxShapeProp.create()); +case C_TOKEN(txPr): +return new TextBodyContext(*this, mrModel.mxTextProp.create()); } break; } diff --git a/oox/source/drawingml/chart/datatableconverter.cxx b/oox/source/drawingml/chart/datatableconverter.cxx index 3c477c5d7507..4e42b7468ebc 100644 --- a/oox/source/drawingml/chart/datatableconverter.cxx +++ b/oox/source/drawingml/chart/datatableconverter.cxx @@ -55,6 +55,9 @@ void DataTableConverter::convertFromModel(uno::Reference const aPropSet.setProperty(PROP_Outline, mrModel.mbShowOutline); if (mrModel.mbShowKeys) aPropSet.setProperty(PROP_Keys, mrModel.mbShowKeys); + +getFormatter().convertFormatting(aPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, + OBJECTTYPE_DATATABLE); } catch (uno::Exception&) { commit 6b481f8bb44a14ebbfe010476cf2ca3728e7d539 Author: Tomaž Vajngerl AuthorDate: Mon May 16 16:10:02 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Jul 17 21:49:32 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 diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index d07cc33d8b9a..f39420c9ce02 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -153,8 +153,9 @@ TickmarkProperties AxisProperties::getBiggestTickmarkProperties() return aTickmarkProperties; } -AxisProperties::AxisProperties( rtl::Reference< Axis > xAxisModel - , ExplicitCategoriesProvider* pExplicitCategoriesProvider ) +AxisProperties::AxisProperties(rtl::Reference<::chart::Axis> xAxisModel, + ExplicitCategoriesProvider* pExplicitCategoriesProvider, + rtl::Reference<::chart::DataTable> const& xDataTableModel) : m_xAxisModel(std::move(xAxisModel)) , m_nDimensionIndex(0) , m_bIsMainAxis(true) @@ -174,6 +175,7 @@ AxisProperties::AxisProperties( rtl::Reference< Axis > xAxisModel , m_bComplexCategories(false) , m_pExplicitCategoriesProvider(pExplicitCategoriesProvider) , m_bLimitSpaceForLabels(false) +, m_xDataTableModel(xDataTableModel) { } @@ -256,7 +258,9 @@ void
[Libreoffice-commits] core.git: oox/source
oox/source/drawingml/chart/datatableconverter.cxx | 30 -- oox/source/drawingml/chart/plotareaconverter.cxx |7 +++-- oox/source/token/properties.txt |7 ++--- 3 files changed, 32 insertions(+), 12 deletions(-) New commits: commit 71bcaa477e9379f4c584b3309d7a6149c801702c Author: Tomaž Vajngerl AuthorDate: Mon May 16 15:53:59 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Jul 17 21:48:46 2022 +0200 oox: add data table and props. with the new UNO DataTable service Refactor filling of the old data table UNO properties to use the new service DataTable and its properties. Change-Id: Iee611c88bec6f58a50b5ae09d3acffd16e0b6dd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136790 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/oox/source/drawingml/chart/datatableconverter.cxx b/oox/source/drawingml/chart/datatableconverter.cxx index 802edc9464ac..3c477c5d7507 100644 --- a/oox/source/drawingml/chart/datatableconverter.cxx +++ b/oox/source/drawingml/chart/datatableconverter.cxx @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -36,13 +37,28 @@ DataTableConverter::~DataTableConverter() = default; void DataTableConverter::convertFromModel(uno::Reference const& rxDiagram) { -PropertySet aPropSet(rxDiagram); -if (mrModel.mbShowHBorder) -aPropSet.setProperty(PROP_DataTableHBorder, mrModel.mbShowHBorder); -if (mrModel.mbShowVBorder) -aPropSet.setProperty(PROP_DataTableVBorder, mrModel.mbShowVBorder); -if (mrModel.mbShowOutline) -aPropSet.setProperty(PROP_DataTableOutline, mrModel.mbShowOutline); +if (!rxDiagram.is()) +return; + +try +{ +uno::Reference xDataTable( +createInstance("com.sun.star.chart2.DataTable"), uno::UNO_QUERY_THROW); +rxDiagram->setDataTable(xDataTable); + +PropertySet aPropSet(xDataTable); +if (mrModel.mbShowHBorder) +aPropSet.setProperty(PROP_HBorder, mrModel.mbShowHBorder); +if (mrModel.mbShowVBorder) +aPropSet.setProperty(PROP_VBorder, mrModel.mbShowVBorder); +if (mrModel.mbShowOutline) +aPropSet.setProperty(PROP_Outline, mrModel.mbShowOutline); +if (mrModel.mbShowKeys) +aPropSet.setProperty(PROP_Keys, mrModel.mbShowKeys); +} +catch (uno::Exception&) +{ +} } } // namespace oox diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx index a30b3bdc6249..96e51c577d43 100644 --- a/oox/source/drawingml/chart/plotareaconverter.cxx +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -433,8 +433,11 @@ void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel ) nAxesSetIdx = 1 - nAxesSetIdx; } -DataTableConverter dataTableConverter (*this, mrModel.mxDataTable.getOrCreate()); -dataTableConverter.convertFromModel(xDiagram); +if (mrModel.mxDataTable) +{ +DataTableConverter dataTableConverter(*this, *mrModel.mxDataTable); +dataTableConverter.convertFromModel(xDiagram); +} // plot area formatting if( xDiagram.is() && !mb3dChart ) diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 8f17d34dbe49..5df793846a50 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -127,9 +127,6 @@ D3DSceneLightOn2 D3DScenePerspective D3DSceneShadeMode DDELinks -DataTableHBorder -DataTableOutline -DataTableVBorder DatabaseRanges Decoration DefaultScrollValue @@ -247,6 +244,7 @@ HasVerticalScrollBar HasXAxisTitle HasYAxisTitle HasZAxisTitle +HBorder HeaderBodyDistance HeaderHeight HeaderIsDynamicHeight @@ -294,6 +292,7 @@ IsVisible IterationCount IterationEpsilon Japanese +Keys Label LabelBorderColor LabelBorderStyle @@ -365,6 +364,7 @@ OpCodeMap Opaque Orientation OutputPosition +Outline OverlapSequence Overlay PageScale @@ -586,6 +586,7 @@ UseSelectedPage VScroll Validation Value +VBorder VaryColorsByPoint VertJustify VertJustifyMethod
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/uiwriter/data/HiddenSection.odt |binary sw/qa/extras/uiwriter/uiwriter2.cxx | 50 +++ sw/source/core/doc/docfld.cxx| 28 ++- sw/source/core/docnode/ndsect.cxx|1 4 files changed, 77 insertions(+), 2 deletions(-) New commits: commit 868b45039d2d168e1c51d971b0d1e0589d4d11eb Author: Tomaž Vajngerl AuthorDate: Thu Jul 14 11:07:45 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Sun Jul 17 18:41:00 2022 +0200 tdf#54703 fix unhiding at PDF export of cond. hidden sections The conditionally hidden sections became visible when PDF export is performed. This is due to field update where we temporary made the conditionally hidden section visible (as the frame is needed), but never put them back to hidden. Probably the expectation was that the condition will be recalculated later on, but wasn't. This change fixes this so that the changed sections will be recalculated at the end. Change-Id: Ic6d8a4a38f22ed961b2b37e05aaf3e720fc50ed4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137052 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sw/qa/extras/uiwriter/data/HiddenSection.odt b/sw/qa/extras/uiwriter/data/HiddenSection.odt new file mode 100644 index ..8358cbc9951a Binary files /dev/null and b/sw/qa/extras/uiwriter/data/HiddenSection.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 8e78a70f97c1..59f8047ca82f 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -14,9 +14,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -3161,6 +3163,54 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf140757) CPPUNIT_ASSERT(!pWrtShell->GetViewOptions()->IsShowChangesInMargin()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testConditionalHiddenSectionIssue) +{ +// tdf#54703 +// When exporting the bug document as PDF, the conditional hidden +// sections became visible in the PDF and in the document. + +std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get(); +if (!pPDFium) +return; + +SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "HiddenSection.odt"); + +// Check section conditional hidden status - all should be hidden (IsCondHidden == true) +for (SwNodeOffset i(0); i < pDoc->GetNodes().Count(); ++i) +{ +if (SwSectionNode const* const pNode = pDoc->GetNodes()[i]->GetSectionNode()) +{ +CPPUNIT_ASSERT_EQUAL(true, pNode->GetSection().IsCondHidden()); +} +} + +// PDF export +uno::Reference xStorable(mxComponent, uno::UNO_QUERY); +utl::MediaDescriptor aMediaDescriptor; +aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); +xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + +SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ); +SvMemoryStream aMemory; +aMemory.WriteStream(aFile); +auto pPdfDocument = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize()); +CPPUNIT_ASSERT(pPdfDocument); +auto pPdfPage = pPdfDocument->openPage(0); +CPPUNIT_ASSERT(pPdfPage); + +// No PDF object should be present in the page - sections remained hidden +CPPUNIT_ASSERT_EQUAL(0, pPdfPage->getObjectCount()); + +// Check section conditional hidden status - all should remained hidden (IsCondHidden == true) +for (SwNodeOffset i(0); i < pDoc->GetNodes().Count(); ++i) +{ +if (SwSectionNode const* const pNode = pDoc->GetNodes()[i]->GetSectionNode()) +{ +CPPUNIT_ASSERT_EQUAL(true, pNode->GetSection().IsCondHidden()); +} +} +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index a1a7434a25b6..d0e489b7b027 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -840,6 +840,9 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) // new version: walk all fields of the attribute pool m_pFieldSortList.reset(new SetGetExpFields); +// remembeer sections that were unhidden and need to be hidden again +std::vector> aUnhiddenSections; + // consider and unhide sections // with hide condition, only in mode GETFLD_ALL () // notes by OD: @@ -886,13 +889,27 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) { pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); OSL_ENSURE( pSectNd, "Where is my SectionNode" ); -pSectNd->GetSection().SetCondHidden( false ); + +auto& rSection = pSectNd->GetSection(); +// unhide and remember the conditionally hidden sections +if
[Libreoffice-commits] core.git: chart2/Library_chartcore.mk chart2/qa chart2/source offapi/com offapi/UnoApi_offapi.mk
chart2/Library_chartcore.mk |1 chart2/qa/extras/chart2export.cxx |3 chart2/source/chartcore.component |7 chart2/source/inc/DataTable.hxx | 89 +++ chart2/source/inc/Diagram.hxx | 15 + chart2/source/model/main/DataTable.cxx| 230 ++ chart2/source/model/main/Diagram.cxx | 49 -- offapi/UnoApi_offapi.mk |2 offapi/com/sun/star/chart2/DataTable.idl | 48 ++ offapi/com/sun/star/chart2/Diagram.idl|6 offapi/com/sun/star/chart2/XDataTable.idl | 28 +++ offapi/com/sun/star/chart2/XDiagram.idl |9 + 12 files changed, 461 insertions(+), 26 deletions(-) New commits: commit 212f03a3cd33a1c276e93ee693dc1173a5c1b051 Author: Tomaž Vajngerl AuthorDate: Mon May 16 15:27:46 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Jul 17 18:09:06 2022 +0200 [API-CHANGE] chart data table implementation Adds new service DataTable, which is reposible for the properties of a data table for a chart. Also removes the existing properties related to the data table from Diagram service, which were added prematurely in the past, without a data table actually being supported by the chart module. Also adds an implementation of the DataTable service in chart2 module. Change-Id: I0c6b32163745704c623d04baaf0ce0e208c107f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136789 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk index 3d3806e14c27..4c93c6d2c3ec 100644 --- a/chart2/Library_chartcore.mk +++ b/chart2/Library_chartcore.mk @@ -130,6 +130,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\ chart2/source/model/main/DataPointProperties \ chart2/source/model/main/DataSeries \ chart2/source/model/main/DataSeriesProperties \ +chart2/source/model/main/DataTable \ chart2/source/model/main/Diagram \ chart2/source/model/main/FormattedString \ chart2/source/model/main/GridProperties \ diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index fc6ffc4d4dbf..a1ea57b47eb7 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -618,6 +618,8 @@ void Chart2ExportTest::testScatterXAxisCategories() void Chart2ExportTest::testChartDataTable() { +/* Disable test temporarily until OOXML filter is updated + load(u"/chart2/qa/extras/data/docx/", u"testChartDataTable.docx"); xmlDocUniquePtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); @@ -625,6 +627,7 @@ void Chart2ExportTest::testChartDataTable() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showHorzBorder", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showVertBorder", "val", "1"); assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:dTable/c:showOutline", "val", "1"); +*/ } void Chart2ExportTest::testChartExternalData() diff --git a/chart2/source/chartcore.component b/chart2/source/chartcore.component index f58ba98ba3ac..d15c808919df 100644 --- a/chart2/source/chartcore.component +++ b/chart2/source/chartcore.component @@ -219,6 +219,13 @@ + + + + + + diff --git a/chart2/source/inc/DataTable.hxx b/chart2/source/inc/DataTable.hxx new file mode 100644 index ..4a41a40a1cbf --- /dev/null +++ b/chart2/source/inc/DataTable.hxx @@ -0,0 +1,89 @@ +/* -*- 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/. + */ + +#pragma once + +#include "OPropertySet.hxx" +#include +#include +#include + +#include "charttoolsdllapi.hxx" +#include +#include +#include +#include "ModifyListenerHelper.hxx" + +namespace chart +{ +typedef cppu::WeakImplHelper +DataTable_Base; + +/** Data table implementation */ +class OOO_DLLPUBLIC_CHARTTOOLS DataTable final : public cppu::BaseMutex, + public DataTable_Base, + public ::property::OPropertySet +{ +public: +explicit DataTable(); +virtual ~DataTable() override; + +/// XServiceInfo declarations +virtual OUString SAL_CALL getImplementationName() override; +virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; +virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; + +/// merge XInterface implementations +DECLARE_XINTERFACE() + +/// merge XTypeProvider implementations +DECLARE_XTYPEPROVIDER() + +explicit
[Libreoffice-commits] core.git: chart2/Library_chartcore.mk chart2/source
chart2/Library_chartcore.mk|1 chart2/source/view/axes/VAxisBase.cxx | 10 chart2/source/view/axes/VAxisBase.hxx | 11 chart2/source/view/axes/VAxisProperties.cxx|4 chart2/source/view/axes/VAxisProperties.hxx|3 chart2/source/view/axes/VCartesianAxis.cxx | 40 +++ chart2/source/view/axes/VCartesianAxis.hxx |2 chart2/source/view/axes/VCartesianCoordinateSystem.cxx | 11 chart2/source/view/axes/VCartesianCoordinateSystem.hxx |9 chart2/source/view/axes/VCoordinateSystem.cxx | 10 chart2/source/view/axes/VPolarCoordinateSystem.cxx | 10 chart2/source/view/axes/VPolarCoordinateSystem.hxx |9 chart2/source/view/charttypes/VSeriesPlotter.cxx | 20 + chart2/source/view/inc/DataTableView.hxx | 39 +++ chart2/source/view/inc/VCoordinateSystem.hxx | 17 - chart2/source/view/inc/VSeriesPlotter.hxx | 15 - chart2/source/view/main/ChartView.cxx |2 chart2/source/view/main/DataTableView.cxx | 215 + 18 files changed, 386 insertions(+), 42 deletions(-) New commits: commit 53c71a0fa29b98d997ced6c9684c627442cfff94 Author: Tomaž Vajngerl AuthorDate: Fri May 6 16:04:47 2022 +0900 Commit: Tomaž Vajngerl CommitDate: Sun Jul 17 09:19:11 2022 +0200 chart2: add initial code for rendering the Data Table Create a (svx) table with the data from the chart and place it below the x-axis line. Data table rendering is disabled in the code until the data table properties are available. Change-Id: I07d282c0b5e8df6b843516c8bdad538862d6575e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136788 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk index 2f1a1a9587f8..3d3806e14c27 100644 --- a/chart2/Library_chartcore.mk +++ b/chart2/Library_chartcore.mk @@ -97,6 +97,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\ chart2/source/view/main/ChartView \ chart2/source/view/main/Clipping \ chart2/source/view/main/DataPointSymbolSupplier \ +chart2/source/view/main/DataTableView \ chart2/source/view/main/DrawModelWrapper \ chart2/source/view/main/ExplicitValueProvider \ chart2/source/view/main/LabelPositionHelper \ diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index ace362a9b964..95125beed1cf 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -22,6 +22,7 @@ #include #include "Tickmarks.hxx" #include +#include #include #include @@ -183,8 +184,10 @@ bool VAxisBase::prepareShapeCreation() //create named group shape m_xGroupShape_Shapes = createGroupShape( m_xLogicTarget, m_nDimension==2 ? m_aCID : ""); -if( m_aAxisProperties.m_bDisplayLabels ) +if (m_aAxisProperties.m_bDisplayLabels) m_xTextTarget = ShapeFactory::createGroup2D( m_xFinalTarget, m_aCID ); +if (m_aAxisProperties.m_bDisplayDataTable) +m_xDataTableTarget = ShapeFactory::createGroup2D(m_xFinalTarget, m_aCID); return true; } @@ -239,6 +242,11 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter ) } } +void VAxisBase::createDataTableView(std::vector>& /*rSeriesPlotterList*/, + uno::Reference const& /*xNumberFormatsSupplier*/) +{ +} + } //namespace chart /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VAxisBase.hxx b/chart2/source/view/axes/VAxisBase.hxx index 31badb749c9d..4da1936a452b 100644 --- a/chart2/source/view/axes/VAxisBase.hxx +++ b/chart2/source/view/axes/VAxisBase.hxx @@ -27,6 +27,9 @@ namespace com::sun::star::util { class XNumberFormatsSupplier; } namespace chart { +class VSeriesPlotter; +class DataTableView; + class VAxisBase : public VAxisOrGridBase { public: @@ -59,6 +62,11 @@ public: void setExtraLinePositionAtOtherAxis( double fCrossingAt ); +virtual void createDataTableView(std::vector>& rSeriesPlotterList, + css::uno::Reference const& xNumberFormatsSupplier); + +std::shared_ptr getDataTableView() { return m_pDataTableView; } + protected: //methods static size_t getIndexOfLongestLabel( const css::uno::Sequence& rLabels ); void removeTextShapesFromTicks(); @@ -79,6 +87,9 @@ protected: //member rtl::Reference< SvxShapeGroupAnyD > m_xGroupShape_Shapes; rtl::Reference< SvxShapeGroupAnyD > m_xTextTarget; +rtl::Reference< SvxShapeGroupAnyD > m_xDataTableTarget; + +std::shared_ptr m_pDataTableView; /** * This typically consists of 2 TickInfo vectors (i.e. the outer vector diff --git a/chart2/source/view/axes/VAxisProperties.cxx
[Libreoffice-commits] core.git: sc/source
sc/source/ui/inc/printfun.hxx | 75 +++- sc/source/ui/view/printfun.cxx | 96 ++--- 2 files changed, 89 insertions(+), 82 deletions(-) New commits: commit b4c79383501225f53d1ef0fa430dd84cd97f2979 Author: Tomaž Vajngerl AuthorDate: Sun Jun 12 11:31:56 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Jul 8 08:52:42 2022 +0200 sc: refactor and simplify PrintPageRanges::calculate push more responisbility to PrintPageRangesInput with operator overloads and use ScRange instead of individual startRow, endRow, startCol, endCol and tab. Change-Id: Ia94c578c6dea48d65c59ceead2dc326faffc81ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135676 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx index b58acd9f4c52..f9780bd0e53c 100644 --- a/sc/source/ui/inc/printfun.hxx +++ b/sc/source/ui/inc/printfun.hxx @@ -100,22 +100,64 @@ struct PrintPageRangesInput { bool m_bSkipEmpty; bool m_bPrintArea; -SCROW m_nStartRow; -SCROW m_nEndRow; -SCCOL m_nStartCol; -SCCOL m_nEndCol; -SCTAB m_nPrintTab; +ScRange m_aRange; Size m_aDocSize; PrintPageRangesInput() : m_bSkipEmpty(false) , m_bPrintArea(false) -, m_nStartRow(0) -, m_nEndRow(0) -, m_nStartCol(0) -, m_nEndCol(0) -, m_nPrintTab(0) {} + +PrintPageRangesInput(bool bSkipEmpty, bool bPrintArea, ScRange const& rRange, Size const& rDocSize) +: m_bSkipEmpty(bSkipEmpty) +, m_bPrintArea(bPrintArea) +, m_aRange(rRange) +, m_aDocSize(rDocSize) +{} + +bool operator==(PrintPageRangesInput const& rInput) const +{ +return +m_bSkipEmpty == rInput.m_bSkipEmpty && +m_bPrintArea == rInput.m_bPrintArea && +m_aRange == rInput.m_aRange && +m_aDocSize == rInput.m_aDocSize; +} + +PrintPageRangesInput& operator=(PrintPageRangesInput const& rInput) +{ +m_bSkipEmpty = rInput.m_bSkipEmpty; +m_bPrintArea = rInput.m_bPrintArea; +m_aRange = rInput.m_aRange; +m_aDocSize = rInput.m_aDocSize; + +return *this; +} + +SCROW getStartRow() const +{ +return m_aRange.aStart.Row(); +} + +SCROW getEndRow() const +{ +return m_aRange.aEnd.Row(); +} + +SCCOL getStartColumn() const +{ +return m_aRange.aStart.Col(); +} + +SCCOL getEndColumn() const +{ +return m_aRange.aEnd.Col(); +} + +SCTAB getPrintTab() const +{ +return m_aRange.aStart.Tab(); +} }; class PrintPageRanges @@ -134,19 +176,12 @@ public: PrintPageRangesInput m_aInput; -bool checkIfAlreadyCalculatedAndSet(bool bSkipEmpty, bool bPrintArea, -SCROW nStartRow, SCROW nEndRow, -SCCOL nStartCol, SCCOL nEndCol, -SCTAB nPrintTab, Size const & aDocSize); - -void calculate(ScDocument& rDoc, bool bSkipEmpty, bool bPrintArea, - SCROW nStartRow, SCROW nEndRow, SCCOL nStartCol, SCCOL nEndCol, - SCTAB nPrintTab, Size const & aDocSize); +void calculate(ScDocument& rDoc, PrintPageRangesInput const& rInput); }; -} +} // end sc namespace -struct ScPrintState // Save Variables from ScPrintFunc +struct ScPrintState // Save Variables from ScPrintFunc { SCTAB nPrintTab; SCCOL nStartCol; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 3cb543a8fbaf..c07abc7100ac 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -3036,7 +3036,11 @@ static void lcl_SetHidden( const ScDocument& rDoc, SCTAB nPrintTab, ScPageRowEnt void ScPrintFunc::CalcPages() // calculates aPageRect and pages from nZoom { assert( bPrintAreaValid ); -m_aRanges.calculate(rDoc, aTableParam.bSkipEmpty, aAreaParam.bPrintArea, nStartRow, nEndRow, nStartCol, nEndCol, nPrintTab, GetDocPageSize()); + +sc::PrintPageRangesInput aInput(aTableParam.bSkipEmpty, aAreaParam.bPrintArea, +ScRange(nStartCol, nStartRow, nPrintTab, nEndCol, nEndRow, nPrintTab), +GetDocPageSize()); +m_aRanges.calculate(rDoc, aInput); } namespace sc @@ -3048,47 +3052,15 @@ PrintPageRanges::PrintPageRanges() , m_nTotalY(0) {} -bool PrintPageRanges::checkIfAlreadyCalculatedAndSet( -bool bSkipEmpty, bool bPrintArea, -SCROW nStartRow, SCROW nEndRow, -SCCOL nStartCol, SCCOL nEndCol, -SCTAB nPrintTab, Size const & rDocSize) -{ -if (bSkipEmpty
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 144 commits - basegfx/CppunitTest_basegfx.mk basegfx/source basegfx/test chart2/Module_chart2.mk chart2/qa chart2/source comphelper
Rebased ref, commits from common ancestor: commit 9f430c6147effeeddd373176155e2769db66ff26 Author: Tomaž Vajngerl AuthorDate: Tue Jun 28 22:27:37 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jul 5 12:38:01 2022 +0200 svx: move SdrDropMarkerOverlay into it's own file Change-Id: Ia09dcba2b7b469912f4f3b72a3cc60ded05a03ca diff --git a/include/svx/sdr/view/DropMarkerOverlay.hxx b/include/svx/sdr/view/DropMarkerOverlay.hxx new file mode 100644 index ..03f1419c7413 --- /dev/null +++ b/include/svx/sdr/view/DropMarkerOverlay.hxx @@ -0,0 +1,42 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include +#include +#include + +// helper class for all D overlays +class SVXCORE_DLLPUBLIC SdrDropMarkerOverlay +{ +// The OverlayObjects +sdr::overlay::OverlayObjectList maObjects; + +void ImplCreateOverlays(const SdrView& rView, const basegfx::B2DPolyPolygon& rLinePolyPolygon); + +public: +SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject); +SdrDropMarkerOverlay(const SdrView& rView, const tools::Rectangle& rRectangle); +SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd); +~SdrDropMarkerOverlay(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx index 03afde95b00e..1e2627dc8807 100644 --- a/include/svx/svdview.hxx +++ b/include/svx/svdview.hxx @@ -52,24 +52,6 @@ namespace sdr::contact { class ObjectContact; } -// helper class for all D overlays -class SVXCORE_DLLPUBLIC SdrDropMarkerOverlay -{ -// The OverlayObjects -sdr::overlay::OverlayObjectList maObjects; - -void ImplCreateOverlays( -const SdrView& rView, -const basegfx::B2DPolyPolygon& rLinePolyPolygon); - -public: -SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject); -SdrDropMarkerOverlay(const SdrView& rView, const tools::Rectangle& rRectangle); -SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd); -~SdrDropMarkerOverlay(); -}; - - class SVXCORE_DLLPUBLIC SdrView : public SdrCreateView, public tools::WeakBase { friend class SdrPageView; diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index 816a3428aacf..669f12969ba6 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -22,6 +22,7 @@ #include #include +#include namespace com::sun::star::datatransfer { class XTransferable; } diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 4e530e3f9227..d26c5b261c38 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -26,6 +26,7 @@ #include #include #include +#include #include "smarttag.hxx" #include "fusearch.hxx" diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 5cacdf82ebcc..440ef4dc69aa 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -463,6 +463,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/unodraw/unoshtxt \ svx/source/unodraw/unottabl \ svx/source/unodraw/XPropertyTable \ +svx/source/view/DropMarkerOverlay \ svx/source/xml/xmleohlp \ svx/source/xml/xmlexport \ svx/source/xml/xmlgrhlp \ diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 7dc8ae174fc5..48850c6974c2 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -38,8 +38,6 @@ #include #include #include -#include -#include #include #include #include @@ -51,70 +49,7 @@ #include #include #include - -// helper class for all D overlays - -void SdrDropMarkerOverlay::ImplCreateOverlays( -const SdrView& rView, -const basegfx::B2DPolyPolygon& rLinePolyPolygon) -{ -for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++) -{ -SdrPaintWindow* pCandidate = rView.GetPaintWindow(a); -const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager(); - -if (xTargetOverlay.is()) -{ -
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - chart2/source officecfg/registry
chart2/source/controller/inc/ChartController.hxx |3 + chart2/source/controller/main/ChartController.cxx |5 + chart2/source/controller/main/ChartController_Insert.cxx | 26 ++ chart2/source/controller/main/ChartController_Window.cxx | 20 +-- chart2/source/controller/main/ControllerCommandDispatch.cxx|8 +++ officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu | 11 6 files changed, 68 insertions(+), 5 deletions(-) New commits: commit 8ae4366c3e2a7fbdde276b5e4229d5a9424ef841 Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 23:03:53 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Jul 1 23:03:53 2022 +0200 chart2: InsertDataTable and DeleteDataTable for context menu Change-Id: I8ef0698252209af01b0741a59dec70f845f0c965 diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index f0f53c8b8990..81f3070403bc 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -440,6 +440,9 @@ private: void executeDispatch_OpenLegendDialog(); void executeDispatch_InsertAxes(); void executeDispatch_InsertGrid(); + +void executeDispatch_InsertDataTable(); +void executeDispatch_DeleteDataTable(); void executeDispatch_OpenInsertDataTableDialog(); void executeDispatch_InsertMenu_DataLabels(); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 79b29bb63c52..080b6bb44928 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1225,6 +1225,10 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_DeleteMajorGrid(); else if( aCommand == "DeleteMinorGrid" ) this->executeDispatch_DeleteMinorGrid(); +else if( aCommand == "InsertDataTable" ) + this->executeDispatch_InsertDataTable(); +else if( aCommand == "DeleteDataTable" ) + this->executeDispatch_DeleteDataTable(); //format objects else if( aCommand == "FormatSelection" ) this->executeDispatch_ObjectProperties(); @@ -1634,6 +1638,7 @@ const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommand "DeleteXErrorBars", "DeleteYErrorBars", "DeleteDataLabels", "DeleteDataLabel", "InsertMenuDataTable", +"InsertDataTable", "DeleteDataTable", //format objects "FormatSelection", "TransformDialog", "DiagramType","View3D", diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index b1b0598d5070..99b3e74fffac 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -224,6 +224,32 @@ void ChartController::executeDispatch_OpenInsertDataTableDialog() } } +void ChartController::executeDispatch_InsertDataTable() +{ +SolarMutexGuard aGuard; +rtl::Reference xDiagram = getFirstDiagram(); +auto xDataTable = xDiagram->getDataTable(); +if (!xDataTable.is()) +{ +uno::Reference xNewDataTable(new DataTable); +if (xNewDataTable.is()) +{ +xDiagram->setDataTable(xNewDataTable); +} +} +} + +void ChartController::executeDispatch_DeleteDataTable() +{ +SolarMutexGuard aGuard; +rtl::Reference xDiagram = getFirstDiagram(); +auto xDataTable = xDiagram->getDataTable(); +if (xDataTable.is()) +{ +xDiagram->setDataTable(uno::Reference()); +} +} + void ChartController::executeDispatch_InsertTitles() { UndoGuard aUndoGuard( diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index c50749c42a87..c300b7f2e23d 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1020,14 +1020,18 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) aMenuName = m_pDrawViewWrapper->IsTextEdit() ? std::u16string_view( u"drawtext" ) : std::u16string_view( u"draw" ); else { +ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelection.getSelectedCID() ); + // todo: the context menu should be specified by an xml file in uiconfig sal_Int16 nUniqueId = 1; -lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Cut" ); -lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Copy" ); -lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:Paste" ); -xPopupMenu->insertSeparator( -1 ); +if (eObjectType != OBJECTTYPE_DATA_TABLE) +{ +lcl_insertMenuCommand(
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 2 commits - chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk
Rebased ref, commits from common ancestor: commit 2e95a0c6bdb6848fa8736753c5206c7b2553da4c Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 22:00:38 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Jul 1 22:37:48 2022 +0200 chart2: InsertDataTableDialog for inserting/removing the data table Change-Id: Ie3c033c587b150723e7aa39cd5ddf5774104db9a diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index 4bc8c7497915..cc25cdd907ae 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -109,6 +109,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/dlg_DataSource \ chart2/source/controller/dialogs/dlg_InsertAxis_Grid \ chart2/source/controller/dialogs/dlg_InsertDataLabel \ +chart2/source/controller/dialogs/dlg_InsertDataTable \ chart2/source/controller/dialogs/dlg_InsertErrorBars \ chart2/source/controller/dialogs/dlg_InsertLegend \ chart2/source/controller/dialogs/dlg_InsertTitle \ @@ -122,6 +123,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/RangeSelectionListener \ chart2/source/controller/dialogs/res_BarGeometry \ chart2/source/controller/dialogs/res_DataLabel \ +chart2/source/controller/dialogs/res_DataTableProperties \ chart2/source/controller/dialogs/res_ErrorBar \ chart2/source/controller/dialogs/res_LegendPosition \ chart2/source/controller/dialogs/res_Titles \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 59af510c5845..274efd02638f 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -44,7 +44,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/combobox \ chart2/uiconfig/ui/datarangedialog \ chart2/uiconfig/ui/dlg_DataLabel \ + chart2/uiconfig/ui/dlg_InsertDataTable \ chart2/uiconfig/ui/dlg_InsertErrorBars \ + chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/imagefragment \ chart2/uiconfig/ui/insertaxisdlg \ chart2/uiconfig/ui/insertgriddlg \ @@ -58,7 +60,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/smoothlinesdlg \ chart2/uiconfig/ui/steppedlinesdlg \ chart2/uiconfig/ui/titlerotationtabpage \ - chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/tp_3D_SceneAppearance \ chart2/uiconfig/ui/tp_3D_SceneGeometry \ chart2/uiconfig/ui/tp_3D_SceneIllumination \ diff --git a/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx new file mode 100644 index ..4b5e928db057 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx @@ -0,0 +1,61 @@ +/* -*- 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/. + */ + +#include + +namespace chart +{ +InsertDataTableDialog::InsertDataTableDialog(weld::Window* pWindow) +: GenericDialogController(pWindow, "modules/schart/ui/dlg_InsertDataTable.ui", + "InsertDataTableDialog") +, m_aDataTablePropertiesResources(*m_xBuilder) +, m_xCbShowDataTable(m_xBuilder->weld_check_button("showDataTable")) +{ +m_xCbShowDataTable->connect_toggled(LINK(this, InsertDataTableDialog, ShowDataTableToggle)); +init(m_aData); +} + +IMPL_LINK_NOARG(InsertDataTableDialog, ShowDataTableToggle, weld::Toggleable&, void) +{ +changeEnabled(); +} + +void InsertDataTableDialog::changeEnabled() +{ +bool bEnable = m_xCbShowDataTable->get_active(); +m_aDataTablePropertiesResources.setChecksSensitive(bEnable); +m_aData.mbShow = bEnable; +} + +void InsertDataTableDialog::init(DataTableDialogData const& rData) +{ +m_aData = rData; + m_aDataTablePropertiesResources.setHorizontalBorder(m_aData.mbHorizontalBorders); + m_aDataTablePropertiesResources.setVerticalBorder(m_aData.mbVerticalBorders); +m_aDataTablePropertiesResources.setOutline(m_aData.mbOutline); +m_aDataTablePropertiesResources.setKeys(m_aData.mbKeys); +m_xCbShowDataTable->set_active(m_aData.mbShow); +changeEnabled(); +} + +DataTableDialogData& InsertDataTableDialog::getDataTableDialogData() +{ +m_aData.mbShow = m_xCbShowDataTable->get_active(); + +m_aData.mbHorizontalBorders = m_aDataTablePropertiesResources.getHorizontalBorder(); +m_aData.mbVerticalBorders = m_aDataTablePropertiesResources.getVerticalBorder(); +m_aData.mbOutline = m_aDataTablePropertiesResources.getOutline(); +m_aData.mbKeys = m_aDataTablePropertiesResources.getKeys(); + +return m_aData; +} +
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 3 commits - chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk officecfg/registry
Rebased ref, commits from common ancestor: commit 4e005b051c361ab27064a3905710d944810cdc44 Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 22:00:38 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Jul 1 22:26:38 2022 +0200 chart2: InsertDataTableDialog for inserting/removing the data table Change-Id: Ie3c033c587b150723e7aa39cd5ddf5774104db9a diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index 4bc8c7497915..cc25cdd907ae 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -109,6 +109,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/dlg_DataSource \ chart2/source/controller/dialogs/dlg_InsertAxis_Grid \ chart2/source/controller/dialogs/dlg_InsertDataLabel \ +chart2/source/controller/dialogs/dlg_InsertDataTable \ chart2/source/controller/dialogs/dlg_InsertErrorBars \ chart2/source/controller/dialogs/dlg_InsertLegend \ chart2/source/controller/dialogs/dlg_InsertTitle \ @@ -122,6 +123,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/RangeSelectionListener \ chart2/source/controller/dialogs/res_BarGeometry \ chart2/source/controller/dialogs/res_DataLabel \ +chart2/source/controller/dialogs/res_DataTableProperties \ chart2/source/controller/dialogs/res_ErrorBar \ chart2/source/controller/dialogs/res_LegendPosition \ chart2/source/controller/dialogs/res_Titles \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 59af510c5845..274efd02638f 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -44,7 +44,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/combobox \ chart2/uiconfig/ui/datarangedialog \ chart2/uiconfig/ui/dlg_DataLabel \ + chart2/uiconfig/ui/dlg_InsertDataTable \ chart2/uiconfig/ui/dlg_InsertErrorBars \ + chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/imagefragment \ chart2/uiconfig/ui/insertaxisdlg \ chart2/uiconfig/ui/insertgriddlg \ @@ -58,7 +60,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/smoothlinesdlg \ chart2/uiconfig/ui/steppedlinesdlg \ chart2/uiconfig/ui/titlerotationtabpage \ - chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/tp_3D_SceneAppearance \ chart2/uiconfig/ui/tp_3D_SceneGeometry \ chart2/uiconfig/ui/tp_3D_SceneIllumination \ diff --git a/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx new file mode 100644 index ..4b5e928db057 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx @@ -0,0 +1,61 @@ +/* -*- 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/. + */ + +#include + +namespace chart +{ +InsertDataTableDialog::InsertDataTableDialog(weld::Window* pWindow) +: GenericDialogController(pWindow, "modules/schart/ui/dlg_InsertDataTable.ui", + "InsertDataTableDialog") +, m_aDataTablePropertiesResources(*m_xBuilder) +, m_xCbShowDataTable(m_xBuilder->weld_check_button("showDataTable")) +{ +m_xCbShowDataTable->connect_toggled(LINK(this, InsertDataTableDialog, ShowDataTableToggle)); +init(m_aData); +} + +IMPL_LINK_NOARG(InsertDataTableDialog, ShowDataTableToggle, weld::Toggleable&, void) +{ +changeEnabled(); +} + +void InsertDataTableDialog::changeEnabled() +{ +bool bEnable = m_xCbShowDataTable->get_active(); +m_aDataTablePropertiesResources.setChecksSensitive(bEnable); +m_aData.mbShow = bEnable; +} + +void InsertDataTableDialog::init(DataTableDialogData const& rData) +{ +m_aData = rData; + m_aDataTablePropertiesResources.setHorizontalBorder(m_aData.mbHorizontalBorders); + m_aDataTablePropertiesResources.setVerticalBorder(m_aData.mbVerticalBorders); +m_aDataTablePropertiesResources.setOutline(m_aData.mbOutline); +m_aDataTablePropertiesResources.setKeys(m_aData.mbKeys); +m_xCbShowDataTable->set_active(m_aData.mbShow); +changeEnabled(); +} + +DataTableDialogData& InsertDataTableDialog::getDataTableDialogData() +{ +m_aData.mbShow = m_xCbShowDataTable->get_active(); + +m_aData.mbHorizontalBorders = m_aDataTablePropertiesResources.getHorizontalBorder(); +m_aData.mbVerticalBorders = m_aDataTablePropertiesResources.getVerticalBorder(); +m_aData.mbOutline = m_aDataTablePropertiesResources.getOutline(); +m_aData.mbKeys = m_aDataTablePropertiesResources.getKeys(); + +return m_aData; +} +
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk officecfg/registry
Rebased ref, commits from common ancestor: commit 55c559349bb43304841b2610d22d3407739df226 Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 22:00:38 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Jul 1 22:04:32 2022 +0200 chart2: InsertDataTableDialog for inserting/removing the data table Change-Id: Ie3c033c587b150723e7aa39cd5ddf5774104db9a diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index 4bc8c7497915..cc25cdd907ae 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -109,6 +109,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/dlg_DataSource \ chart2/source/controller/dialogs/dlg_InsertAxis_Grid \ chart2/source/controller/dialogs/dlg_InsertDataLabel \ +chart2/source/controller/dialogs/dlg_InsertDataTable \ chart2/source/controller/dialogs/dlg_InsertErrorBars \ chart2/source/controller/dialogs/dlg_InsertLegend \ chart2/source/controller/dialogs/dlg_InsertTitle \ @@ -122,6 +123,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/RangeSelectionListener \ chart2/source/controller/dialogs/res_BarGeometry \ chart2/source/controller/dialogs/res_DataLabel \ +chart2/source/controller/dialogs/res_DataTableProperties \ chart2/source/controller/dialogs/res_ErrorBar \ chart2/source/controller/dialogs/res_LegendPosition \ chart2/source/controller/dialogs/res_Titles \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 59af510c5845..274efd02638f 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -44,7 +44,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/combobox \ chart2/uiconfig/ui/datarangedialog \ chart2/uiconfig/ui/dlg_DataLabel \ + chart2/uiconfig/ui/dlg_InsertDataTable \ chart2/uiconfig/ui/dlg_InsertErrorBars \ + chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/imagefragment \ chart2/uiconfig/ui/insertaxisdlg \ chart2/uiconfig/ui/insertgriddlg \ @@ -58,7 +60,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/smoothlinesdlg \ chart2/uiconfig/ui/steppedlinesdlg \ chart2/uiconfig/ui/titlerotationtabpage \ - chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/tp_3D_SceneAppearance \ chart2/uiconfig/ui/tp_3D_SceneGeometry \ chart2/uiconfig/ui/tp_3D_SceneIllumination \ diff --git a/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx new file mode 100644 index ..4b5e928db057 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx @@ -0,0 +1,61 @@ +/* -*- 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/. + */ + +#include + +namespace chart +{ +InsertDataTableDialog::InsertDataTableDialog(weld::Window* pWindow) +: GenericDialogController(pWindow, "modules/schart/ui/dlg_InsertDataTable.ui", + "InsertDataTableDialog") +, m_aDataTablePropertiesResources(*m_xBuilder) +, m_xCbShowDataTable(m_xBuilder->weld_check_button("showDataTable")) +{ +m_xCbShowDataTable->connect_toggled(LINK(this, InsertDataTableDialog, ShowDataTableToggle)); +init(m_aData); +} + +IMPL_LINK_NOARG(InsertDataTableDialog, ShowDataTableToggle, weld::Toggleable&, void) +{ +changeEnabled(); +} + +void InsertDataTableDialog::changeEnabled() +{ +bool bEnable = m_xCbShowDataTable->get_active(); +m_aDataTablePropertiesResources.setChecksSensitive(bEnable); +m_aData.mbShow = bEnable; +} + +void InsertDataTableDialog::init(DataTableDialogData const& rData) +{ +m_aData = rData; + m_aDataTablePropertiesResources.setHorizontalBorder(m_aData.mbHorizontalBorders); + m_aDataTablePropertiesResources.setVerticalBorder(m_aData.mbVerticalBorders); +m_aDataTablePropertiesResources.setOutline(m_aData.mbOutline); +m_aDataTablePropertiesResources.setKeys(m_aData.mbKeys); +m_xCbShowDataTable->set_active(m_aData.mbShow); +changeEnabled(); +} + +DataTableDialogData& InsertDataTableDialog::getDataTableDialogData() +{ +m_aData.mbShow = m_xCbShowDataTable->get_active(); + +m_aData.mbHorizontalBorders = m_aDataTablePropertiesResources.getHorizontalBorder(); +m_aData.mbVerticalBorders = m_aDataTablePropertiesResources.getVerticalBorder(); +m_aData.mbOutline = m_aDataTablePropertiesResources.getOutline(); +m_aData.mbKeys = m_aDataTablePropertiesResources.getKeys(); + +return m_aData; +} +
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 21 commits - chart2/inc chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/source chart2/uiconfig chart2/UIConfig_ch
Rebased ref, commits from common ancestor: commit dbb95218b62bc2f48c2ecd8cc5fa5b93237e7547 Author: Tomaž Vajngerl AuthorDate: Fri Jul 1 22:00:38 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Jul 1 22:00:38 2022 +0200 chart2: add InsertDataTableDialog for adding the data table Change-Id: Ie3c033c587b150723e7aa39cd5ddf5774104db9a diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index 4bc8c7497915..cc25cdd907ae 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -109,6 +109,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/dlg_DataSource \ chart2/source/controller/dialogs/dlg_InsertAxis_Grid \ chart2/source/controller/dialogs/dlg_InsertDataLabel \ +chart2/source/controller/dialogs/dlg_InsertDataTable \ chart2/source/controller/dialogs/dlg_InsertErrorBars \ chart2/source/controller/dialogs/dlg_InsertLegend \ chart2/source/controller/dialogs/dlg_InsertTitle \ @@ -122,6 +123,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/RangeSelectionListener \ chart2/source/controller/dialogs/res_BarGeometry \ chart2/source/controller/dialogs/res_DataLabel \ +chart2/source/controller/dialogs/res_DataTableProperties \ chart2/source/controller/dialogs/res_ErrorBar \ chart2/source/controller/dialogs/res_LegendPosition \ chart2/source/controller/dialogs/res_Titles \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 59af510c5845..274efd02638f 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -44,7 +44,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/combobox \ chart2/uiconfig/ui/datarangedialog \ chart2/uiconfig/ui/dlg_DataLabel \ + chart2/uiconfig/ui/dlg_InsertDataTable \ chart2/uiconfig/ui/dlg_InsertErrorBars \ + chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/imagefragment \ chart2/uiconfig/ui/insertaxisdlg \ chart2/uiconfig/ui/insertgriddlg \ @@ -58,7 +60,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/smoothlinesdlg \ chart2/uiconfig/ui/steppedlinesdlg \ chart2/uiconfig/ui/titlerotationtabpage \ - chart2/uiconfig/ui/dlg_InsertLegend \ chart2/uiconfig/ui/tp_3D_SceneAppearance \ chart2/uiconfig/ui/tp_3D_SceneGeometry \ chart2/uiconfig/ui/tp_3D_SceneIllumination \ diff --git a/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx new file mode 100644 index ..4b5e928db057 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataTable.cxx @@ -0,0 +1,61 @@ +/* -*- 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/. + */ + +#include + +namespace chart +{ +InsertDataTableDialog::InsertDataTableDialog(weld::Window* pWindow) +: GenericDialogController(pWindow, "modules/schart/ui/dlg_InsertDataTable.ui", + "InsertDataTableDialog") +, m_aDataTablePropertiesResources(*m_xBuilder) +, m_xCbShowDataTable(m_xBuilder->weld_check_button("showDataTable")) +{ +m_xCbShowDataTable->connect_toggled(LINK(this, InsertDataTableDialog, ShowDataTableToggle)); +init(m_aData); +} + +IMPL_LINK_NOARG(InsertDataTableDialog, ShowDataTableToggle, weld::Toggleable&, void) +{ +changeEnabled(); +} + +void InsertDataTableDialog::changeEnabled() +{ +bool bEnable = m_xCbShowDataTable->get_active(); +m_aDataTablePropertiesResources.setChecksSensitive(bEnable); +m_aData.mbShow = bEnable; +} + +void InsertDataTableDialog::init(DataTableDialogData const& rData) +{ +m_aData = rData; + m_aDataTablePropertiesResources.setHorizontalBorder(m_aData.mbHorizontalBorders); + m_aDataTablePropertiesResources.setVerticalBorder(m_aData.mbVerticalBorders); +m_aDataTablePropertiesResources.setOutline(m_aData.mbOutline); +m_aDataTablePropertiesResources.setKeys(m_aData.mbKeys); +m_xCbShowDataTable->set_active(m_aData.mbShow); +changeEnabled(); +} + +DataTableDialogData& InsertDataTableDialog::getDataTableDialogData() +{ +m_aData.mbShow = m_xCbShowDataTable->get_active(); + +m_aData.mbHorizontalBorders = m_aDataTablePropertiesResources.getHorizontalBorder(); +m_aData.mbVerticalBorders = m_aDataTablePropertiesResources.getVerticalBorder(); +m_aData.mbOutline = m_aDataTablePropertiesResources.getOutline(); +m_aData.mbKeys = m_aDataTablePropertiesResources.getKeys(); + +return m_aData; +} + +}
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 19 commits - chart2/inc chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/source chart2/uiconfig chart2/UIConfig_ch
Rebased ref, commits from common ancestor: commit f39ac2b1acadd07e14b1cb3e10be3c8ebc100a2b Author: Tomaž Vajngerl AuthorDate: Thu Jun 30 23:43:52 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Jun 30 23:43:52 2022 +0200 chart2: add some data table default properties Change-Id: I4fac46ac2a119275bcdaa6ebc8b7382ad6fb5684 diff --git a/chart2/source/model/main/DataTable.cxx b/chart2/source/model/main/DataTable.cxx index 0620ce5ccaba..c67fab5c1740 100644 --- a/chart2/source/model/main/DataTable.cxx +++ b/chart2/source/model/main/DataTable.cxx @@ -70,6 +70,14 @@ private: true); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Outilne, true); ::chart::PropertyHelper::setPropertyValueDefault(aMap, DataTableProperty_Keys, false); + +float fDefaultCharHeight = 10.0; +::chart::PropertyHelper::setPropertyValue( +aMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight); +::chart::PropertyHelper::setPropertyValue( +aMap, ::chart::CharacterProperties::PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultCharHeight); +::chart::PropertyHelper::setPropertyValue( +aMap, ::chart::CharacterProperties::PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultCharHeight); } }; commit 0bf157a9c90546416e27aead961e02d46c413ec3 Author: Tomaž Vajngerl AuthorDate: Thu Jun 30 23:34:19 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Jun 30 23:41:54 2022 +0200 chart2: add "InsertDataTable" action to menu Change-Id: Ib60a2b061966eb61834480b63dc0653410a43a14 diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 505b109fdcc7..e8b78a309e12 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -440,6 +440,7 @@ private: void executeDispatch_OpenLegendDialog(); void executeDispatch_InsertAxes(); void executeDispatch_InsertGrid(); +void executeDispatch_InsertDataTable(); void executeDispatch_InsertMenu_DataLabels(); void executeDispatch_InsertMenu_Trendlines(); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index a4bd7a3972cc..79e05b77e885 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1169,6 +1169,8 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_InsertErrorBars(false); else if( aCommand == "InsertMenuYErrorBars" ) this->executeDispatch_InsertErrorBars(true); +else if( aCommand == "InsertDataTable" ) +this->executeDispatch_InsertDataTable(); else if( aCommand == "InsertSymbol" ) this->executeDispatch_InsertSpecialCharacter(); else if( aCommand == "InsertTrendline" ) @@ -1631,6 +1633,7 @@ const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommand "DeleteTrendline","DeleteMeanValue", "DeleteTrendlineEquation", "DeleteXErrorBars", "DeleteYErrorBars", "DeleteDataLabels", "DeleteDataLabel", +"InsertDataTable", //format objects "FormatSelection", "TransformDialog", "DiagramType","View3D", diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 4f39f1068cdb..7c660af86f81 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -155,6 +156,24 @@ void ChartController::executeDispatch_InsertGrid() } } +void ChartController::executeDispatch_InsertDataTable() +{ +rtl::Reference xDiagram = getFirstDiagram(); +SolarMutexGuard aGuard; +if (xDiagram->getDataTable().is()) +{ +xDiagram->setDataTable(uno::Reference()); +} +else +{ +uno::Reference xDataTable(new DataTable); +if (xDataTable.is()) +{ +xDiagram->setDataTable(xDataTable); +} +} +} + void ChartController::executeDispatch_InsertTitles() { UndoGuard aUndoGuard( diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index e5035b4f053c..b7872b93e708 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -584,6 +584,7 @@ void ControllerCommandDispatch::updateCommandAvailability() m_aCommandAvailability[ ".uno:InsertMenuXErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertMenuYErrorBars" ] = bIsWritable &&
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - chart2/source chart2/uiconfig officecfg/registry
chart2/source/controller/inc/ChartController.hxx |1 chart2/source/controller/main/ChartController.cxx |3 + chart2/source/controller/main/ChartController_Insert.cxx | 19 ++ chart2/source/controller/main/ControllerCommandDispatch.cxx|1 chart2/uiconfig/menubar/menubar.xml|1 officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu |5 ++ 6 files changed, 30 insertions(+) New commits: commit ad19d370708d9c4efabee1cb88eeb63452ec9f68 Author: Tomaž Vajngerl AuthorDate: Thu Jun 30 23:34:19 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Jun 30 23:34:19 2022 +0200 chart2: add "InsertDataTable" action to menu Change-Id: Ib60a2b061966eb61834480b63dc0653410a43a14 diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index 505b109fdcc7..e8b78a309e12 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -440,6 +440,7 @@ private: void executeDispatch_OpenLegendDialog(); void executeDispatch_InsertAxes(); void executeDispatch_InsertGrid(); +void executeDispatch_InsertDataTable(); void executeDispatch_InsertMenu_DataLabels(); void executeDispatch_InsertMenu_Trendlines(); diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index a4bd7a3972cc..79e05b77e885 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1169,6 +1169,8 @@ void SAL_CALL ChartController::dispatch( this->executeDispatch_InsertErrorBars(false); else if( aCommand == "InsertMenuYErrorBars" ) this->executeDispatch_InsertErrorBars(true); +else if( aCommand == "InsertDataTable" ) +this->executeDispatch_InsertDataTable(); else if( aCommand == "InsertSymbol" ) this->executeDispatch_InsertSpecialCharacter(); else if( aCommand == "InsertTrendline" ) @@ -1631,6 +1633,7 @@ const o3tl::sorted_vector< OUString >& ChartController::impl_getAvailableCommand "DeleteTrendline","DeleteMeanValue", "DeleteTrendlineEquation", "DeleteXErrorBars", "DeleteYErrorBars", "DeleteDataLabels", "DeleteDataLabel", +"InsertDataTable", //format objects "FormatSelection", "TransformDialog", "DiagramType","View3D", diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 4f39f1068cdb..7c660af86f81 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -155,6 +156,24 @@ void ChartController::executeDispatch_InsertGrid() } } +void ChartController::executeDispatch_InsertDataTable() +{ +rtl::Reference xDiagram = getFirstDiagram(); +SolarMutexGuard aGuard; +if (xDiagram->getDataTable().is()) +{ +xDiagram->setDataTable(uno::Reference()); +} +else +{ +uno::Reference xDataTable(new DataTable); +if (xDataTable.is()) +{ +xDiagram->setDataTable(xDataTable); +} +} +} + void ChartController::executeDispatch_InsertTitles() { UndoGuard aUndoGuard( diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index e5035b4f053c..b7872b93e708 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -584,6 +584,7 @@ void ControllerCommandDispatch::updateCommandAvailability() m_aCommandAvailability[ ".uno:InsertMenuXErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertMenuYErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics; m_aCommandAvailability[ ".uno:InsertSymbol" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsTextObject; +m_aCommandAvailability[ ".uno:InsertDataTable" ] = bIsWritable; // format objects bool bFormatObjectAvailable = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsFormateableObjectSelected; diff --git a/chart2/uiconfig/menubar/menubar.xml b/chart2/uiconfig/menubar/menubar.xml index 354ebbc1903a..581aff37153b 100644 --- a/chart2/uiconfig/menubar/menubar.xml +++ b/chart2/uiconfig/menubar/menubar.xml @@ -56,6 +56,7 @@ + diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu index d3a54a052c8e..7739522a866e 100644 ---
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - chart2/source
chart2/source/view/axes/VAxisBase.cxx |2 +- chart2/source/view/inc/ShapeFactory.hxx |2 +- chart2/source/view/main/DataTableView.cxx |5 - chart2/source/view/main/ShapeFactory.cxx |7 --- 4 files changed, 10 insertions(+), 6 deletions(-) New commits: commit a87ec5067a7228afb8c98eaeb517fc08c2a6febb Author: Tomaž Vajngerl AuthorDate: Wed Jun 29 19:25:47 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Jun 29 19:25:47 2022 +0200 chart2: allow to select the data table, fix object CID Change-Id: I0a8d3643fcaefe8105e935b929947174bd9bdc96 diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 7d985051a4a7..814d3afd7858 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -187,7 +187,7 @@ bool VAxisBase::prepareShapeCreation() if (m_aAxisProperties.m_bDisplayLabels) m_xTextTarget = ShapeFactory::createGroup2D( m_xFinalTarget, m_aCID ); if (m_aAxisProperties.m_bDisplayDataTable) -m_xDataTableTarget = ShapeFactory::createGroup2D(m_xFinalTarget, m_aCID); +m_xDataTableTarget = ShapeFactory::createGroup2D(m_xFinalTarget); return true; } diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index d6c05af04d18..b44612e74a4f 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -217,7 +217,7 @@ public: const css::uno::Reference< css::beans::XPropertySet > & xTextProperties, double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth ); -static rtl::Reference createTable(rtl::Reference const& xTarget); +static rtl::Reference createTable(rtl::Reference const& xTarget, OUString const& rName = OUString()); static rtl::Reference createInvisibleRectangle( diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index f899e724839e..210753bcb07e 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -191,7 +192,9 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV return; ShapeFactory::removeSubShapes(m_xTarget); -m_xTableShape = ShapeFactory::createTable(m_xTarget); +auto sParticle = ObjectIdentifier::createParticleForDataTable(m_xChartModel); +auto sCID = ObjectIdentifier::createClassifiedIdentifierForParticle(sParticle); +m_xTableShape = ShapeFactory::createTable(m_xTarget, sCID); uno::Reference xTable; try diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 7fddc5d018d5..8f9f29ced232 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2533,16 +2533,17 @@ void ShapeFactory::removeSubShapes( const rtl::Reference& xSh } rtl::Reference -ShapeFactory::createTable(rtl::Reference const& xTarget) +ShapeFactory::createTable(rtl::Reference const& xTarget, OUString const& rName) { -if( !xTarget.is() ) +if (!xTarget.is()) return nullptr; //create table shape rtl::Reference xShape = new SvxTableShape(nullptr); xShape->setShapeKind(SdrObjKind::Table); xTarget->addShape(*xShape); - +if (!rName.isEmpty()) +setShapeName(xShape, rName); return xShape; }
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 535 commits - android/source avmedia/source basctl/source basegfx/CppunitTest_basegfx.mk basegfx/test basic/qa basic/source binaryu
Rebased ref, commits from common ancestor: commit 4810b3b483d50b68aa7c8dd3be44e016b230a671 Author: Tomaž Vajngerl AuthorDate: Tue Jun 28 22:27:37 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 28 22:37:51 2022 +0200 svx: move SdrDropMarkerOverlay into it's own file Change-Id: Ia09dcba2b7b469912f4f3b72a3cc60ded05a03ca diff --git a/include/svx/sdr/view/DropMarkerOverlay.hxx b/include/svx/sdr/view/DropMarkerOverlay.hxx new file mode 100644 index ..03f1419c7413 --- /dev/null +++ b/include/svx/sdr/view/DropMarkerOverlay.hxx @@ -0,0 +1,42 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include +#include +#include + +// helper class for all D overlays +class SVXCORE_DLLPUBLIC SdrDropMarkerOverlay +{ +// The OverlayObjects +sdr::overlay::OverlayObjectList maObjects; + +void ImplCreateOverlays(const SdrView& rView, const basegfx::B2DPolyPolygon& rLinePolyPolygon); + +public: +SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject); +SdrDropMarkerOverlay(const SdrView& rView, const tools::Rectangle& rRectangle); +SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd); +~SdrDropMarkerOverlay(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx index 03afde95b00e..1e2627dc8807 100644 --- a/include/svx/svdview.hxx +++ b/include/svx/svdview.hxx @@ -52,24 +52,6 @@ namespace sdr::contact { class ObjectContact; } -// helper class for all D overlays -class SVXCORE_DLLPUBLIC SdrDropMarkerOverlay -{ -// The OverlayObjects -sdr::overlay::OverlayObjectList maObjects; - -void ImplCreateOverlays( -const SdrView& rView, -const basegfx::B2DPolyPolygon& rLinePolyPolygon); - -public: -SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject); -SdrDropMarkerOverlay(const SdrView& rView, const tools::Rectangle& rRectangle); -SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd); -~SdrDropMarkerOverlay(); -}; - - class SVXCORE_DLLPUBLIC SdrView : public SdrCreateView, public tools::WeakBase { friend class SdrPageView; diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index 816a3428aacf..669f12969ba6 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -22,6 +22,7 @@ #include #include +#include namespace com::sun::star::datatransfer { class XTransferable; } diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 4e530e3f9227..d26c5b261c38 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -26,6 +26,7 @@ #include #include #include +#include #include "smarttag.hxx" #include "fusearch.hxx" diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 5cacdf82ebcc..440ef4dc69aa 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -463,6 +463,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/unodraw/unoshtxt \ svx/source/unodraw/unottabl \ svx/source/unodraw/XPropertyTable \ +svx/source/view/DropMarkerOverlay \ svx/source/xml/xmleohlp \ svx/source/xml/xmlexport \ svx/source/xml/xmlgrhlp \ diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 7dc8ae174fc5..48850c6974c2 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -38,8 +38,6 @@ #include #include #include -#include -#include #include #include #include @@ -51,70 +49,7 @@ #include #include #include - -// helper class for all D overlays - -void SdrDropMarkerOverlay::ImplCreateOverlays( -const SdrView& rView, -const basegfx::B2DPolyPolygon& rLinePolyPolygon) -{ -for(sal_uInt32 a(0); a < rView.PaintWindowCount(); a++) -{ -SdrPaintWindow* pCandidate = rView.GetPaintWindow(a); -const rtl::Reference< sdr::overlay::OverlayManager >& xTargetOverlay = pCandidate->GetOverlayManager(); - -if (xTargetOverlay.is()) -{ -
[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 5 commits - include/svx sc/source sd/source svx/Library_svxcore.mk svx/source sw/source
include/svx/sdr/view/DropMarkerOverlay.hxx | 42 include/svx/sdr/view/Enums.hxx | 66 include/svx/sdr/view/ViewChangeHint.hxx| 30 + include/svx/sdr/view/ViewEvent.hxx | 82 + include/svx/svdpntv.hxx| 29 +--- include/svx/svdview.hxx| 95 - sc/source/ui/inc/drawview.hxx |1 sd/source/ui/inc/View.hxx |1 svx/Library_svxcore.mk |1 svx/source/svdraw/svdpntv.cxx |6 - svx/source/svdraw/svdview.cxx | 93 svx/source/view/DropMarkerOverlay.cxx | 84 + sw/source/core/frmedt/feshview.cxx |1 sw/source/core/frmedt/fews.cxx |1 sw/source/uibase/docvw/edtdd.cxx |1 sw/source/uibase/docvw/edtwin.cxx |1 16 files changed, 321 insertions(+), 213 deletions(-) New commits: commit 35279245d0db3523e7662004bba7330eb70eb5db Author: Tomaž Vajngerl AuthorDate: Tue Jun 28 22:27:37 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 28 22:27:37 2022 +0200 svx: move SdrDropMarkerOverlay into it's own file Change-Id: Ia09dcba2b7b469912f4f3b72a3cc60ded05a03ca diff --git a/include/svx/sdr/view/DropMarkerOverlay.hxx b/include/svx/sdr/view/DropMarkerOverlay.hxx new file mode 100644 index ..03f1419c7413 --- /dev/null +++ b/include/svx/sdr/view/DropMarkerOverlay.hxx @@ -0,0 +1,42 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include +#include +#include + +// helper class for all D overlays +class SVXCORE_DLLPUBLIC SdrDropMarkerOverlay +{ +// The OverlayObjects +sdr::overlay::OverlayObjectList maObjects; + +void ImplCreateOverlays(const SdrView& rView, const basegfx::B2DPolyPolygon& rLinePolyPolygon); + +public: +SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject); +SdrDropMarkerOverlay(const SdrView& rView, const tools::Rectangle& rRectangle); +SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd); +~SdrDropMarkerOverlay(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx index 03afde95b00e..1e2627dc8807 100644 --- a/include/svx/svdview.hxx +++ b/include/svx/svdview.hxx @@ -52,24 +52,6 @@ namespace sdr::contact { class ObjectContact; } -// helper class for all D overlays -class SVXCORE_DLLPUBLIC SdrDropMarkerOverlay -{ -// The OverlayObjects -sdr::overlay::OverlayObjectList maObjects; - -void ImplCreateOverlays( -const SdrView& rView, -const basegfx::B2DPolyPolygon& rLinePolyPolygon); - -public: -SdrDropMarkerOverlay(const SdrView& rView, const SdrObject& rObject); -SdrDropMarkerOverlay(const SdrView& rView, const tools::Rectangle& rRectangle); -SdrDropMarkerOverlay(const SdrView& rView, const Point& rStart, const Point& rEnd); -~SdrDropMarkerOverlay(); -}; - - class SVXCORE_DLLPUBLIC SdrView : public SdrCreateView, public tools::WeakBase { friend class SdrPageView; diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index 816a3428aacf..669f12969ba6 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -22,6 +22,7 @@ #include #include +#include namespace com::sun::star::datatransfer { class XTransferable; } diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 4e530e3f9227..d26c5b261c38 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -26,6 +26,7 @@ #include #include #include +#include #include "smarttag.hxx" #include "fusearch.hxx" diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 5cacdf82ebcc..440ef4dc69aa 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -463,6 +463,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/unodraw/unoshtxt \
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 16 commits - chart2/inc chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/source chart2/uiconfig chart2/UIConfig_ch
Rebased ref, commits from common ancestor: commit ff6d9841095b16973867bbebc6eaa03541ec2b4f Author: Tomaž Vajngerl AuthorDate: Tue Jun 28 07:48:45 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 28 08:25:26 2022 +0200 chart2: add UI to the data table This adds a new object type "Data Table", with all the object identifiers and converters of properties. The data table is now shown in the drop-down of chart elements. A properties dialog was added, which allows to change properties of a data table. This contains the area, line and font tab pages and a new tab page specific for data tables, to change if the horiz. or vert. borders, key or the outline should be show. Change-Id: I9b4cd58cffbcc952daaa2c0c8f8a5a17e38ac293 diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index b7c449cef582..4bc8c7497915 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -138,6 +138,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/tp_DataLabel \ chart2/source/controller/dialogs/tp_DataPointOption \ chart2/source/controller/dialogs/tp_DataSource \ +chart2/source/controller/dialogs/tp_DataTable \ chart2/source/controller/dialogs/tp_ErrorBars \ chart2/source/controller/dialogs/tp_LegendPosition \ chart2/source/controller/dialogs/tp_PointGeometry \ @@ -153,6 +154,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/itemsetwrapper/AxisItemConverter \ chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter \ chart2/source/controller/itemsetwrapper/DataPointItemConverter \ +chart2/source/controller/itemsetwrapper/DataTableItemConverter \ chart2/source/controller/itemsetwrapper/ErrorBarItemConverter \ chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter \ chart2/source/controller/itemsetwrapper/ItemConverter \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 67d64b18b597..59af510c5845 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -68,6 +68,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/tp_DataLabel \ chart2/uiconfig/ui/tp_DataPointOption \ chart2/uiconfig/ui/tp_DataSource \ + chart2/uiconfig/ui/tp_DataTable \ chart2/uiconfig/ui/tp_ErrorBars \ chart2/uiconfig/ui/tp_LegendPosition \ chart2/uiconfig/ui/tp_PolarOptions \ diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc index ab6ca48c8376..9a9943df1f3c 100644 --- a/chart2/inc/strings.hrc +++ b/chart2/inc/strings.hrc @@ -48,6 +48,7 @@ #define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance") #define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination") #define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography") +#define STR_PAGE_DATA_TABLE NC_("STR_PAGE_DATA_TABLE", "Data Table") #define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION") #define STR_OBJECT_AXIS NC_("STR_OBJECT_AXIS", "Axis") #define STR_OBJECT_AXIS_X NC_("STR_OBJECT_AXIS_X", "X Axis") @@ -97,6 +98,7 @@ #define STR_OBJECT_DIAGRAM_WALL NC_("STR_OBJECT_DIAGRAM_WALL", "Chart Wall") #define STR_OBJECT_DIAGRAM_FLOOR NC_("STR_OBJECT_DIAGRAM_FLOOR", "Chart Floor") #define STR_OBJECT_SHAPENC_("STR_OBJECT_SHAPE", "Drawing Object") +#define STR_OBJECT_DATA_TABLE NC_("STR_OBJECT_DATA_TABLE", "Data Table") #define STR_TIP_DATASERIES NC_("STR_TIP_DATASERIES", "Data Series '%SERIESNAME'") #define STR_TIP_DATAPOINT_INDEX NC_("STR_TIP_DATAPOINT_INDEX", "Data Point %POINTNUMBER") #define STR_TIP_DATAPOINT_VALUES NC_("STR_TIP_DATAPOINT_VALUES", "Values: %POINTVALUES") diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 07b7f3503e92..b105ecc61211 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -314,6 +314,9 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural ) case OBJECTTYPE_DATA_CURVE_EQUATION: aRet=SchResId(STR_OBJECT_CURVE_EQUATION); break; +case OBJECTTYPE_DATA_TABLE: +aRet=SchResId(STR_OBJECT_DATA_TABLE); +break; default: //OBJECTTYPE_UNKNOWN ; } diff --git
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 17 commits - chart2/inc chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/source chart2/uiconfig chart2/UIConfig_ch
Rebased ref, commits from common ancestor: commit 6489f0fbea689118b7d3bd0795549e5de484cfdf Author: Tomaž Vajngerl AuthorDate: Tue Jun 28 07:48:45 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 28 08:06:12 2022 +0200 chart2: add UI to the data table This adds a new object type "Data Table", with all the object identifiers and converters of properties. The data table is now shown in the drop-down of chart elements. A properties dialog was added, which allows to change properties of a data table. This contains the area, line and font tab pages and a new tab page specific for data tables, to change if the horiz. or vert. borders, key or the outline should be show. Change-Id: I9b4cd58cffbcc952daaa2c0c8f8a5a17e38ac293 diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index b7c449cef582..4bc8c7497915 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -138,6 +138,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/tp_DataLabel \ chart2/source/controller/dialogs/tp_DataPointOption \ chart2/source/controller/dialogs/tp_DataSource \ +chart2/source/controller/dialogs/tp_DataTable \ chart2/source/controller/dialogs/tp_ErrorBars \ chart2/source/controller/dialogs/tp_LegendPosition \ chart2/source/controller/dialogs/tp_PointGeometry \ @@ -153,6 +154,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/itemsetwrapper/AxisItemConverter \ chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter \ chart2/source/controller/itemsetwrapper/DataPointItemConverter \ +chart2/source/controller/itemsetwrapper/DataTableItemConverter \ chart2/source/controller/itemsetwrapper/ErrorBarItemConverter \ chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter \ chart2/source/controller/itemsetwrapper/ItemConverter \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 67d64b18b597..59af510c5845 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -68,6 +68,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/tp_DataLabel \ chart2/uiconfig/ui/tp_DataPointOption \ chart2/uiconfig/ui/tp_DataSource \ + chart2/uiconfig/ui/tp_DataTable \ chart2/uiconfig/ui/tp_ErrorBars \ chart2/uiconfig/ui/tp_LegendPosition \ chart2/uiconfig/ui/tp_PolarOptions \ diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc index ab6ca48c8376..9a9943df1f3c 100644 --- a/chart2/inc/strings.hrc +++ b/chart2/inc/strings.hrc @@ -48,6 +48,7 @@ #define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance") #define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination") #define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography") +#define STR_PAGE_DATA_TABLE NC_("STR_PAGE_DATA_TABLE", "Data Table") #define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION") #define STR_OBJECT_AXIS NC_("STR_OBJECT_AXIS", "Axis") #define STR_OBJECT_AXIS_X NC_("STR_OBJECT_AXIS_X", "X Axis") @@ -97,6 +98,7 @@ #define STR_OBJECT_DIAGRAM_WALL NC_("STR_OBJECT_DIAGRAM_WALL", "Chart Wall") #define STR_OBJECT_DIAGRAM_FLOOR NC_("STR_OBJECT_DIAGRAM_FLOOR", "Chart Floor") #define STR_OBJECT_SHAPENC_("STR_OBJECT_SHAPE", "Drawing Object") +#define STR_OBJECT_DATA_TABLE NC_("STR_OBJECT_DATA_TABLE", "Data Table") #define STR_TIP_DATASERIES NC_("STR_TIP_DATASERIES", "Data Series '%SERIESNAME'") #define STR_TIP_DATAPOINT_INDEX NC_("STR_TIP_DATAPOINT_INDEX", "Data Point %POINTNUMBER") #define STR_TIP_DATAPOINT_VALUES NC_("STR_TIP_DATAPOINT_VALUES", "Values: %POINTVALUES") diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 07b7f3503e92..b105ecc61211 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -314,6 +314,9 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural ) case OBJECTTYPE_DATA_CURVE_EQUATION: aRet=SchResId(STR_OBJECT_CURVE_EQUATION); break; +case OBJECTTYPE_DATA_TABLE: +aRet=SchResId(STR_OBJECT_DATA_TABLE); +break; default: //OBJECTTYPE_UNKNOWN ; } diff --git
[Libreoffice-commits] core.git: Branch 'feature/chartdatatable' - 292 commits - basctl/source basic/qa basic/source bin/crashreportScraper.py bin/update bridges/source chart2/inc chart2/Library_chartc
Rebased ref, commits from common ancestor: commit 8d8753c38f92d6041fed5e63864822e5b7918291 Author: Tomaž Vajngerl AuthorDate: Tue Jun 28 07:48:45 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jun 28 08:02:36 2022 +0200 chart2: add UI to the data table This adds a new object type "Data Table", with all the object identifiers and converters of properties. The data table is now shown in the drop-down of chart elements. A properties dialog was added, which allows to change properties of a data table. This contains the area, line and font tab pages and a new tab page specific for data tables, to change if the horiz. or vert. borders, key or the outline should be show. Change-Id: I9b4cd58cffbcc952daaa2c0c8f8a5a17e38ac293 diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk index b7c449cef582..4bc8c7497915 100644 --- a/chart2/Library_chartcontroller.mk +++ b/chart2/Library_chartcontroller.mk @@ -138,6 +138,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/dialogs/tp_DataLabel \ chart2/source/controller/dialogs/tp_DataPointOption \ chart2/source/controller/dialogs/tp_DataSource \ +chart2/source/controller/dialogs/tp_DataTable \ chart2/source/controller/dialogs/tp_ErrorBars \ chart2/source/controller/dialogs/tp_LegendPosition \ chart2/source/controller/dialogs/tp_PointGeometry \ @@ -153,6 +154,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\ chart2/source/controller/itemsetwrapper/AxisItemConverter \ chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter \ chart2/source/controller/itemsetwrapper/DataPointItemConverter \ +chart2/source/controller/itemsetwrapper/DataTableItemConverter \ chart2/source/controller/itemsetwrapper/ErrorBarItemConverter \ chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter \ chart2/source/controller/itemsetwrapper/ItemConverter \ diff --git a/chart2/UIConfig_chart2.mk b/chart2/UIConfig_chart2.mk index 67d64b18b597..59af510c5845 100644 --- a/chart2/UIConfig_chart2.mk +++ b/chart2/UIConfig_chart2.mk @@ -68,6 +68,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/schart,\ chart2/uiconfig/ui/tp_DataLabel \ chart2/uiconfig/ui/tp_DataPointOption \ chart2/uiconfig/ui/tp_DataSource \ + chart2/uiconfig/ui/tp_DataTable \ chart2/uiconfig/ui/tp_ErrorBars \ chart2/uiconfig/ui/tp_LegendPosition \ chart2/uiconfig/ui/tp_PolarOptions \ diff --git a/chart2/inc/strings.hrc b/chart2/inc/strings.hrc index ab6ca48c8376..9a9943df1f3c 100644 --- a/chart2/inc/strings.hrc +++ b/chart2/inc/strings.hrc @@ -48,6 +48,7 @@ #define STR_PAGE_APPEARANCE NC_("STR_PAGE_APPEARANCE", "Appearance") #define STR_PAGE_ILLUMINATION NC_("STR_PAGE_ILLUMINATION", "Illumination") #define STR_PAGE_ASIAN NC_("STR_PAGE_ASIAN", "Asian Typography") +#define STR_PAGE_DATA_TABLE NC_("STR_PAGE_DATA_TABLE", "Data Table") #define STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS NC_("STR_OBJECT_AVERAGE_LINE_WITH_PARAMETERS", "Mean value line with value %AVERAGE_VALUE and standard deviation %STD_DEVIATION") #define STR_OBJECT_AXIS NC_("STR_OBJECT_AXIS", "Axis") #define STR_OBJECT_AXIS_X NC_("STR_OBJECT_AXIS_X", "X Axis") @@ -97,6 +98,7 @@ #define STR_OBJECT_DIAGRAM_WALL NC_("STR_OBJECT_DIAGRAM_WALL", "Chart Wall") #define STR_OBJECT_DIAGRAM_FLOOR NC_("STR_OBJECT_DIAGRAM_FLOOR", "Chart Floor") #define STR_OBJECT_SHAPENC_("STR_OBJECT_SHAPE", "Drawing Object") +#define STR_OBJECT_DATA_TABLE NC_("STR_OBJECT_DATA_TABLE", "Data Table") #define STR_TIP_DATASERIES NC_("STR_TIP_DATASERIES", "Data Series '%SERIESNAME'") #define STR_TIP_DATAPOINT_INDEX NC_("STR_TIP_DATAPOINT_INDEX", "Data Point %POINTNUMBER") #define STR_TIP_DATAPOINT_VALUES NC_("STR_TIP_DATAPOINT_VALUES", "Values: %POINTVALUES") diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 07b7f3503e92..b105ecc61211 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -314,6 +314,9 @@ OUString ObjectNameProvider::getName( ObjectType eObjectType, bool bPlural ) case OBJECTTYPE_DATA_CURVE_EQUATION: aRet=SchResId(STR_OBJECT_CURVE_EQUATION); break; +case OBJECTTYPE_DATA_TABLE: +aRet=SchResId(STR_OBJECT_DATA_TABLE); +break; default: //OBJECTTYPE_UNKNOWN ; } diff --git