[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - oox/source xmloff/source

Gabor Kelemen (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 23 19:18:40 UTC 2020


 oox/source/drawingml/chart/seriesconverter.cxx |   37 -------------------------
 xmloff/source/chart/SchXMLSeries2Context.cxx   |   20 -------------
 2 files changed, 57 deletions(-)

New commits:
commit 5532934ce5ec1c1abf4bf8befea70e65b6032521
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Wed Sep 23 21:16:39 2020 +0200
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Wed Sep 23 21:18:06 2020 +0200

    Revert "tdf#131175 oox chart import: fix char color of <dLbl>, inherited from <dLbls>"
    
    This reverts commit 437b6fe9a499987d9d31bd1515e2b8a9ff574041.
    
    Reason for revert: Regression potential is too much
    
    Change-Id: Ib8d8c03e731eab145ea5ad70fda60073b56c86d1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103202
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index ea13f93982bf..2acf265847dc 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -366,42 +366,6 @@ DataLabelsConverter::~DataLabelsConverter()
 {
 }
 
-namespace
-{
-/// Inherit <c:dLbl> text props (if not set) from <c:dLbls> text props (if set).
-void InheritFromDataLabelsTextProps(const DataLabelsModel& rLabels, const DataLabelModel& rLabel)
-{
-    // See if <c:dLbls> contains text properties to inherit.
-    if (!rLabels.mxTextProp.is() || rLabels.mxTextProp->getParagraphs().empty())
-    {
-        return;
-    }
-
-    const std::shared_ptr<TextParagraph>& rLabelsParagraph = rLabels.mxTextProp->getParagraphs()[0];
-
-    // See if <c:dLbl> lacks text properties.
-    if (rLabel.mxTextProp.is())
-    {
-        return;
-    }
-
-    if (!rLabel.mxText || !rLabel.mxText->mxTextBody
-        || rLabel.mxText->mxTextBody->getParagraphs().empty())
-    {
-        return;
-    }
-
-    const std::shared_ptr<TextParagraph>& rLabelParagraph
-        = rLabel.mxText->mxTextBody->getParagraphs()[0];
-
-    // Inherit rLabel.mxText's char props from rLabels.mxTextProp's char props.
-    TextCharacterProperties aCharProps;
-    aCharProps.assignUsed(rLabelsParagraph->getProperties().getTextCharacterProperties());
-    aCharProps.assignUsed(rLabelParagraph->getProperties().getTextCharacterProperties());
-    rLabelParagraph->getProperties().getTextCharacterProperties().assignUsed(aCharProps);
-}
-}
-
 void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries, const TypeGroupConverter& rTypeGroup )
 {
     PropertySet aPropSet( rxDataSeries );
@@ -423,7 +387,6 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
     {
         if (pointLabel->maNumberFormat.maFormatCode.isEmpty())
             pointLabel->maNumberFormat = mrModel.maNumberFormat;
-        InheritFromDataLabelsTextProps(mrModel, *pointLabel);
 
         DataLabelConverter aLabelConv(*this, *pointLabel);
         aLabelConv.convertFromModel( rxDataSeries, rTypeGroup );
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 85711d9ffa9c..ef6cd0249a7e 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -1119,26 +1119,6 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri
                         xLabels[j] = xCustomLabel;
                         xCustomLabel->setString(seriesStyle.mCustomLabels[j]);
                         xCustomLabel->setFieldType(chart2::DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT);
-
-                        // Restore character properties on the text span manually, till
-                        // SchXMLExportHelper_Impl::exportCustomLabel() does not write the style.
-                        uno::Reference<beans::XPropertySetInfo> xPointPropInfo
-                            = xPointProp->getPropertySetInfo();
-                        if (xPointPropInfo.is())
-                        {
-                            uno::Sequence<beans::Property> aProperties = xPointPropInfo->getProperties();
-                            for (const auto& rProperty : std::as_const(aProperties))
-                            {
-                                if (!rProperty.Name.startsWith("Char")
-                                    || rProperty.Name.startsWith("Chart"))
-                                {
-                                    continue;
-                                }
-
-                                xCustomLabel->setPropertyValue(
-                                    rProperty.Name, xPointProp->getPropertyValue(rProperty.Name));
-                            }
-                        }
                     }
                     xPointProp->setPropertyValue("CustomLabelFields", uno::Any(xLabels));
                 }


More information about the Libreoffice-commits mailing list