summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2022-06-09 17:41:15 +0200
committerAndras Timar <andras.timar@collabora.com>2022-06-09 21:12:48 +0200
commitb6b7b3a5a46790baf2266aaeb10976753dfe0fce (patch)
tree3863631f1a4a8e8eb9ca2453e5ac01488a67ffa8
parent7569ee7e7009bb2a4193090040a7f1a83e1090b0 (diff)
jsdialog: toggle toolbox buttons correctly
Change-Id: Ic02f9ceab29257ebc4cb6261aae10c4f1a7ef176 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135562 Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--vcl/jsdialog/executor.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 8662b246e5f9..8d3dd2d876d1 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -243,8 +243,9 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM
}
else if (sAction == "togglemenu")
{
- pToolbar->set_menu_item_active(
- OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US), true);
+ OString sId = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
+ bool bIsActive = pToolbar->get_menu_item_active(sId);
+ pToolbar->set_menu_item_active(sId, !bIsActive);
return true;
}
}