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

New commits:
commit c5bd74c0ace401812be416a295c71a6604f8240d
Author:     Jan Holesovsky <ke...@collabora.com>
AuthorDate: Fri Oct 16 14:34:43 2020 +0200
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Wed Nov 18 19:52:08 2020 +0100

    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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105617
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx 
b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 68175acd46d2..a4771b76ee0c 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -427,19 +427,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 f527656333b6..b37c85ffbc63 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3724,6 +3724,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned long
     {
         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");
@@ -3749,6 +3750,7 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned long
 
             if (!bIsWeldedDialog)
             {
+                OUString sControlType = aMap["type"];
                 OUString sAction((aMap.find("cmd") != aMap.end())? 
aMap["cmd"]: "");
                 WindowUIObject aUIObject(pWindow);
                 std::unique_ptr<UIObject> 
pUIWindow(aUIObject.get_visible_child(aMap["id"]));
@@ -3774,9 +3776,15 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned long
                     {
                         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