summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorKshitij Pathania <kshitijpathania@gmail.com>2018-07-02 18:48:19 +0530
committerSzymon Kłos <szymon.klos@collabora.com>2018-07-10 12:10:30 +0200
commit2cad889d498bf48bdcf88138c53cb9d601ba17ec (patch)
tree6ba6b09e9d1b57380e34bdc4e3a45fb5c7adf6ee /vcl/source/control
parentd8911b6848fccf92a8310c77eef40eafab0325f0 (diff)
Notebookbar:Context for printpreview is working.
This is a combination of 3 commits. Notebookbar:Context for printpreview is now working Also the context stuff is now working well even after print preview is set Change-Id: Ia43f512394cf4d162b4019257c039aecb664df22 Reviewed-on: https://gerrit.libreoffice.org/56740 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> tdf#118546: GetNotebookBar() may return nullptr Change-Id: I411ea0abcb5fd5fac0db7fe0c4bad16a0c1b9d77 Reviewed-on: https://gerrit.libreoffice.org/57006 Reviewed-by: Kshitij Pathania <kshitijpathania@gmail.com> Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Conserved the alphabetical order in contexts. ThreeDObject is remained on top as its entry begin with 3. All others are sorted now except the generalised ones in last. Change-Id: Id56550da450f0d2a0dd770a78360d20ada90f048 Reviewed-on: https://gerrit.libreoffice.org/56984 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/57190
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/notebookbar.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx
index 6c04bcaf7423..9b2381e2cc95 100644
--- a/vcl/source/control/notebookbar.cxx
+++ b/vcl/source/control/notebookbar.cxx
@@ -14,7 +14,7 @@
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/implbase.hxx>
#include <vcl/vclevent.hxx>
-
+#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp>
/**
* split from the main class since it needs different ref-counting mana
*/
@@ -37,7 +37,7 @@ NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rU
{
SetStyle(GetStyle() | WB_DIALOGCONTROL);
m_pUIBuilder.reset( new VclBuilder(this, getUIRootDir(), rUIXMLDescription, rID, rFrame) );
-
+ mxFrame = rFrame;
// In the Notebookbar's .ui file must exist control handling context
// - implementing NotebookbarContextControl interface with id "ContextContainer"
// or "ContextContainerX" where X is a number >= 1
@@ -154,6 +154,23 @@ void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(co
}
}
+void NotebookBar::ControlListener(bool bListen)
+{
+ if(bListen)
+ {
+ // remove listeners
+ css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (css::ui::ContextChangeEventMultiplexer::get(
+ ::comphelper::getProcessComponentContext()));
+ xMultiplexer->removeContextChangeEventListener(getContextChangeEventListener(),mxFrame->getController());
+ }
+ else
+ {
+ // add listeners
+ css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (css::ui::ContextChangeEventMultiplexer::get(
+ ::comphelper::getProcessComponentContext()));
+ xMultiplexer->addContextChangeEventListener(getContextChangeEventListener(),mxFrame->getController());
+ }
+}
void SAL_CALL NotebookBarContextChangeEventListener::disposing(const ::css::lang::EventObject&)
{