summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2020-10-16 14:34:43 +0200
committerAndras Timar <andras.timar@collabora.com>2020-10-16 16:26:55 +0200
commitebd3d84ad58b31d325dbe17c35759d12ed7a4242 (patch)
tree14ae0a0da34e09628f1534a73d1173dd047b7bf3
parent60eefb146e4ad3fdac896400393b4e1cfaef7767 (diff)
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.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx20
-rw-r--r--desktop/source/lib/init.cxx12
2 files changed, 21 insertions, 11 deletions
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"];