summaryrefslogtreecommitdiffstats
path: root/oox/source/drawingml/chart/chartspaceconverter.cxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
commita2baea7faff31d26459dab3668a39eae85e4991b (patch)
treeeaa2048ce9c715481f932dcfe20368e252b77d2f /oox/source/drawingml/chart/chartspaceconverter.cxx
parentAdding upstream version 4:24.2.0. (diff)
downloadlibreoffice-upstream/4%24.2.1.tar.xz
libreoffice-upstream/4%24.2.1.zip
Adding upstream version 4:24.2.1.upstream/4%24.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'oox/source/drawingml/chart/chartspaceconverter.cxx')
-rw-r--r--oox/source/drawingml/chart/chartspaceconverter.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index c83ed37e9c..9280d42ff2 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -38,6 +38,7 @@
#include <drawingml/chart/titleconverter.hxx>
#include <ooxresid.hxx>
#include <strings.hrc>
+#include <drawingml/textbody.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -183,7 +184,19 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern
OUString aAutoTitle = aPlotAreaConv.getAutomaticTitle();
if( mrModel.mxTitle.is() || !aAutoTitle.isEmpty() )
{
- if( aAutoTitle.isEmpty() )
+ // tdf#146487 In some cases, we need to show the empty title
+ bool bShowEmptyTitle = aAutoTitle.isEmpty() && !mrModel.mbAutoTitleDel
+ && aPlotAreaConv.isSingleSeriesTitle()
+ && mrModel.mxTitle->mxShapeProp.is()
+ && mrModel.mxTitle->mxTextProp.is()
+ && mrModel.mxTitle->mxTextProp->isEmpty();
+ // Also for tdf#146487
+ bool bEmptyRichText = mrModel.mxTitle
+ && mrModel.mxTitle->mxText.is()
+ && mrModel.mxTitle->mxText->mxTextBody.is()
+ && mrModel.mxTitle->mxText->mxTextBody->isEmpty();
+
+ if (aAutoTitle.isEmpty() && !bShowEmptyTitle && !bEmptyRichText)
aAutoTitle = OoxResId(STR_DIAGRAM_TITLE);
Reference< XTitled > xTitled( getChartDocument(), UNO_QUERY_THROW );
TitleConverter aTitleConv( *this, mrModel.mxTitle.getOrCreate() );