chart2/source/controller/sidebar/ChartElementsPanel.cxx |   20 +++++++++-------
 desktop/source/lib/init.cxx                             |   12 +++++++--
 2 files changed, 21 insertions(+), 11 deletions(-)

New commits:
commit ebd3d84ad58b31d325dbe17c35759d12ed7a4242
Author:     Jan Holesovsky <ke...@collabora.com>
AuthorDate: Fri Oct 16 14:34:43 2020 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Fri Oct 16 16:26:55 2020 +0200

    lok: Make the chart (sub)title work even from the mobile-wizard.
    
    Change-Id: Ic6346a403639e283ade47429f581f91e7a468f63
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104436
    Tested-by: Andras Timar <andras.ti...@collabora.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx 
b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 4026b22d9898..ce3827aa20e2 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -434,19 +434,23 @@ void ChartElementsPanel::updateData()
 
     bool hasTitle = isTitleVisisble(mxModel, TitleHelper::MAIN_TITLE);
     mpCBTitle->Check(hasTitle);
-    if (!mpEditTitle->HasFocus())
-    {
-        
mpEditTitle->SetText(TitleHelper::getCompleteString(TitleHelper::getTitle(TitleHelper::MAIN_TITLE,
 mxModel)));
+
+    OUString title = mpEditTitle->GetText();
+    OUString newTitle = 
TitleHelper::getCompleteString(TitleHelper::getTitle(TitleHelper::MAIN_TITLE, 
mxModel));
+    if (title != newTitle)
+        mpEditTitle->SetText(newTitle);
+    if (mpEditTitle->IsEnabled() != hasTitle)
         mpEditTitle->Enable(hasTitle);
-    }
 
     bool hasSubtitle = isTitleVisisble(mxModel, TitleHelper::SUB_TITLE);
     mpCBSubtitle->Check(hasSubtitle);
-    if (!mpEditSubtitle->HasFocus())
-    {
-        
mpEditSubtitle->SetText(TitleHelper::getCompleteString(TitleHelper::getTitle(TitleHelper::SUB_TITLE,
 mxModel)));
+
+    OUString subtitle = mpEditSubtitle->GetText();
+    OUString newSubtitle = 
TitleHelper::getCompleteString(TitleHelper::getTitle(TitleHelper::SUB_TITLE, 
mxModel));
+    if (subtitle != newSubtitle)
+        mpEditSubtitle->SetText(newSubtitle);
+    if (mpEditSubtitle->IsEnabled() != hasSubtitle)
         mpEditSubtitle->Enable(hasSubtitle);
-    }
 
     mpCBXAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::X_AXIS_TITLE));
     mpCBYAxisTitle->Check(isTitleVisisble(mxModel, TitleHelper::Y_AXIS_TITLE));
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c8971182893f..89cf49dbf6f7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3641,6 +3641,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
     {
         static const OUString sClickAction("CLICK");
         static const OUString sSelectAction("SELECT");
+        static const OUString sSetAction("SET");
         static const OUString sClearAction("CLEAR");
         static const OUString sTypeAction("TYPE");
         static const OUString sUpAction("UP");
@@ -3656,12 +3657,11 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
 
             bIsWeldedDialog = pWidget != nullptr;
             bool bContinueWithLOKWindow = false;
+            OUString sControlType = aMap["type"];
             OUString sAction = aMap["cmd"];
 
             if (bIsWeldedDialog)
             {
-                OUString sControlType = aMap["type"];
-
                 if (sControlType == "tabcontrol")
                 {
                     auto pNotebook = dynamic_cast<weld::Notebook*>(pWidget);
@@ -3765,9 +3765,15 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned nWin
                     {
                         aMap["TEXT"] = aMap["data"];
 
-                        pUIWindow->execute(sClearAction, aMap);
+                        pUIWindow->execute(sClearAction, aMap); // FIXME - 
change the "CLEAR"&"TYPE" to "SET" and test thoroughly; the "TYPE" really types 
a character by character
                         pUIWindow->execute(sTypeAction, aMap);
                     }
+                    else if (sControlType == "edit" && sAction == "change") // 
FIXME - shouldn't "edit" issue "set" instead of "change"?
+                    {
+                        aMap["TEXT"] = aMap["data"];
+
+                        pUIWindow->execute(sSetAction, aMap);
+                    }
                     else if (sAction == "value")
                     {
                         aMap["VALUE"] = aMap["data"];
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to