diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-11-18 09:08:03 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-11-19 08:51:43 +0100 |
commit | 9e3ba7c3036c4d21e01d6f75ed29a1e8c4208141 (patch) | |
tree | c648a26f2445955be14aa6e96815c14ec193dddc /sc | |
parent | b234743dd26e0be4be272d2d2c82f90c67e192b7 (diff) |
tdf#97926 Add UNO API for Infobar
This allows creating, updating and removing infobars from macros/extensions.
It also extends the infobar with a primary and a secondary text, so there can
be a bold summary at the beginning at the infobar with a longer text following
in normal letters.
Macro sample:
------------------------------------------------------------
Sub AddInfobar
dim buttons(1) as new com.sun.star.beans.StringPair
buttons(0).first = "Close doc"
buttons(0).second = ".uno:CloseDoc"
buttons(1).first = "Paste into doc"
buttons(1).second = ".uno:Paste"
ThisComponent.getCurrentController().appendInfobar("my", "Hello world", "Things happened. What now?", com.sun.star.frame.InfobarType.INFO, buttons, true)
End Sub
Sub UpdateInfobar
ThisComponent.getCurrentController().updateInfobar("my", "WARNING","Do not read this message.", com.sun.star.frame.InfobarType.WARNING)
End Sub
Sub RemoveInfobar
ThisComponent.getCurrentController().removeInfobar("my")
End Sub
------------------------------------------------------------
Change-Id: I5d0a223525845d23ffab17acdaa431e0eb783fec
Reviewed-on: https://gerrit.libreoffice.org/29816
Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de>
Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index e1c9332b0c4e..ced26c3261d2 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -495,7 +495,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) if (pViewFrame) { pViewFrame->RemoveInfoBar("enablecontent"); - auto pInfoBar = pViewFrame->AppendInfoBar("enablecontent", ScResId(STR_RELOAD_TABLES), InfoBarType::Warning); + auto pInfoBar = pViewFrame->AppendInfoBar("enablecontent", "", ScResId(STR_RELOAD_TABLES), InfobarType::WARNING); if (pInfoBar) { VclPtrInstance<PushButton> xBtn(&pViewFrame->GetWindow()); |