chart2/source/controller/main/ChartController_Tools.cxx     |    6 +++---
 chart2/source/controller/main/ControllerCommandDispatch.cxx |    3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 654150ffd05f43813332eedb969ab07fffa51b21
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Wed May 8 17:22:24 2024 +0200
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Thu May 9 09:54:53 2024 +0200

    tdf#58038 - chart: make available format characters toolbar for
    
    text boxes or shapes *inside* charts (as created with the Drawing toolbar).
    
    follow-up commit: 4f994cec388377cc5c2bddb804bd92eb4cd7dc8d
    (tdf#39052 - Chart: make characters formatable in editable chart textshapes)
    
    Change-Id: Iccc5ee350ea0a37d8bda9652e09d3d61339f1d71
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167366
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/chart2/source/controller/main/ChartController_Tools.cxx 
b/chart2/source/controller/main/ChartController_Tools.cxx
index 67ea64a11fb9..ded134db24c6 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -582,9 +582,9 @@ bool ChartController::isShapeContext() const
 
 bool ChartController::IsTextEdit() const
 {
-    // only Title objects are editable textshapes
-    return m_aSelection.isTitleObjectSelected() &&
-        m_pDrawViewWrapper && m_pDrawViewWrapper->IsTextEdit();
+    // only Title objects and additional shapes are editable textshapes in 
chart
+    return m_pDrawViewWrapper && m_pDrawViewWrapper->IsTextEdit() &&
+        (m_aSelection.isTitleObjectSelected() || 
m_aSelection.isAdditionalShapeSelected());
 }
 
 void ChartController::impl_ClearSelection()
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx 
b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 787968b3f13b..ee9d7d480de3 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -599,7 +599,8 @@ void ControllerCommandDispatch::updateCommandAvailability()
     // format objects
     bool bFormatObjectAvailable = bIsWritable && bControllerStateIsValid && 
m_apControllerState->bIsFormateableObjectSelected;
     m_aCommandAvailability[ u".uno:FormatSelection"_ustr ] = 
bFormatObjectAvailable && !bIsTextEdit;
-    m_aCommandAvailability[ u".uno:FontDialog"_ustr ] = bFormatObjectAvailable 
&& bIsTextEdit;
+    m_aCommandAvailability[ u".uno:FontDialog"_ustr ] = (bShapeContext ? 
isShapeControllerCommandAvailable(u".uno:FontDialog"_ustr) :
+        bFormatObjectAvailable) && bIsTextEdit;
     m_aCommandAvailability[ u".uno:FormatAxis"_ustr ] = bFormatObjectAvailable;
     m_aCommandAvailability[ u".uno:FormatTitle"_ustr ] = 
bFormatObjectAvailable && !bIsTextEdit;
     m_aCommandAvailability[ u".uno:FormatDataSeries"_ustr ] = 
bFormatObjectAvailable;

Reply via email to