summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-05-11 12:26:11 +0900
committerAndras Timar <andras.timar@collabora.com>2022-06-01 10:03:53 +0200
commit38d00152374e3df465fff78e379cecb4b0be2985 (patch)
tree6c00b8fff3b6930b0f8132e4ef44f2decdc5ab34 /sc/source
parentd236341c6aab90d7d4097d6ff535e1bbeb656f3a (diff)
tdf#148835 don't write any sparkline xml elements if none exists
Change-Id: Idd4058a88639cebceded13110dc367e74b6f7097 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134141 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 2c4330b3570f16d6668936fd05e1ab2ade597bae) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135171 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/filter/excel/export/SparklineExt.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/filter/excel/export/SparklineExt.cxx b/sc/source/filter/excel/export/SparklineExt.cxx
index 5202c3e92449..487698e19ba1 100644
--- a/sc/source/filter/excel/export/SparklineExt.cxx
+++ b/sc/source/filter/excel/export/SparklineExt.cxx
@@ -230,7 +230,12 @@ void SparklineExt::addSparklineGroup(XclExpXmlStream& rStream, sc::SparklineGrou
SparklineBuffer::SparklineBuffer(const XclExpRoot& rRoot, XclExtLstRef const& xExtLst)
: XclExpRoot(rRoot)
{
- xExtLst->AddRecord(new xcl::exp::SparklineExt(GetRoot()));
+ auto& rDocument = GetDoc();
+ auto* pSparklineList = rDocument.GetSparklineList(GetCurrScTab());
+ if (pSparklineList && !pSparklineList->getSparklineGroups().empty())
+ {
+ xExtLst->AddRecord(new xcl::exp::SparklineExt(GetRoot()));
+ }
}
} // end namespace xcl::exp