summaryrefslogtreecommitdiffstats
path: root/sfx2/source/sidebar/SidebarDockingWindow.cxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:03:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:03:24 +0000
commite3cf16e6fbf8d39cad8762f002b6db1d4f61ed36 (patch)
tree3c1753125149dcf36ba42a57f1574369e8524225 /sfx2/source/sidebar/SidebarDockingWindow.cxx
parentAdding debian version 4:24.2.2-3. (diff)
downloadlibreoffice-e3cf16e6fbf8d39cad8762f002b6db1d4f61ed36.tar.xz
libreoffice-e3cf16e6fbf8d39cad8762f002b6db1d4f61ed36.zip
Merging upstream version 4:24.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sfx2/source/sidebar/SidebarDockingWindow.cxx')
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx117
1 files changed, 60 insertions, 57 deletions
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 23c3b459c3..d0edf80663 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -136,75 +136,78 @@ SfxChildAlignment SidebarDockingWindow::CheckAlignment (
bool SidebarDockingWindow::EventNotify(NotifyEvent& rEvent)
{
- NotifyEventType nType = rEvent.GetType();
- if (NotifyEventType::KEYINPUT == nType)
+ if (mpSidebarController)
{
- const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode();
- switch (rKeyCode.GetCode())
+ NotifyEventType nType = rEvent.GetType();
+ if (NotifyEventType::KEYINPUT == nType)
{
- case KEY_UP:
- case KEY_DOWN:
- case KEY_PAGEUP:
- case KEY_PAGEDOWN:
- case KEY_HOME:
- case KEY_END:
- case KEY_LEFT:
- case KEY_RIGHT:
- case KEY_BACKSPACE:
- case KEY_DELETE:
- case KEY_INSERT:
- case KEY_RETURN:
- case KEY_ESCAPE:
+ const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode();
+ switch (rKeyCode.GetCode())
{
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_PAGEUP:
+ case KEY_PAGEDOWN:
+ case KEY_HOME:
+ case KEY_END:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ case KEY_BACKSPACE:
+ case KEY_DELETE:
+ case KEY_INSERT:
+ case KEY_RETURN:
+ case KEY_ESCAPE:
+ {
+ return true;
+ }
+ default:
+ break;
+ }
+ if (!mpAccel)
+ {
+ mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
+ mpAccel->init(comphelper::getProcessComponentContext(), mpSidebarController->getXFrame());
+ }
+ const OUString aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
+ if (".uno:DesignerDialog" == aCommand)
+ {
+ std::shared_ptr<PanelDescriptor> xPanelDescriptor =
+ mpSidebarController->GetResourceManager()->GetPanelDescriptor( u"StyleListPanel" );
+ if ( xPanelDescriptor && mpSidebarController->IsDeckVisible( xPanelDescriptor->msDeckId ) )
+ Close();
+ return true;
+ }
+ if (".uno:Undo" == aCommand || ".uno:Redo" == aCommand)
+ {
+ comphelper::dispatchCommand(aCommand, {});
return true;
}
- default:
- break;
- }
- if (!mpAccel)
- {
- mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
- mpAccel->init(comphelper::getProcessComponentContext(), mpSidebarController->getXFrame());
- }
- const OUString aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
- if (".uno:DesignerDialog" == aCommand)
- {
- std::shared_ptr<PanelDescriptor> xPanelDescriptor =
- mpSidebarController->GetResourceManager()->GetPanelDescriptor( u"StyleListPanel" );
- if ( xPanelDescriptor && mpSidebarController->IsDeckVisible( xPanelDescriptor->msDeckId ) )
- Close();
- return true;
}
- if (".uno:Undo" == aCommand || ".uno:Redo" == aCommand)
+ else if (NotifyEventType::MOUSEBUTTONDOWN == nType)
{
- comphelper::dispatchCommand(aCommand, {});
- return true;
+ const MouseEvent *mEvt = rEvent.GetMouseEvent();
+ if (mEvt->IsLeft())
+ {
+ tools::Rectangle aGrip = mpSidebarController->GetDeckDragArea();
+ if ( aGrip.Contains( mEvt->GetPosPixel() ) )
+ mbIsReadyToDrag = true;
+ }
}
- }
- else if (NotifyEventType::MOUSEBUTTONDOWN == nType)
- {
- const MouseEvent *mEvt = rEvent.GetMouseEvent();
- if (mEvt->IsLeft())
+ else if (NotifyEventType::MOUSEMOVE == nType)
{
+ const MouseEvent *mEvt = rEvent.GetMouseEvent();
tools::Rectangle aGrip = mpSidebarController->GetDeckDragArea();
- if ( aGrip.Contains( mEvt->GetPosPixel() ) )
- mbIsReadyToDrag = true;
- }
- }
- else if (NotifyEventType::MOUSEMOVE == nType)
- {
- const MouseEvent *mEvt = rEvent.GetMouseEvent();
- tools::Rectangle aGrip = mpSidebarController->GetDeckDragArea();
- if (mEvt->IsLeft() && aGrip.Contains( mEvt->GetPosPixel() ) && mbIsReadyToDrag )
- {
- Point aPos = mEvt->GetPosPixel();
- vcl::Window* pWindow = rEvent.GetWindow();
- if ( pWindow != this )
+ if (mEvt->IsLeft() && aGrip.Contains( mEvt->GetPosPixel() ) && mbIsReadyToDrag )
{
- aPos = pWindow->OutputToScreenPixel( aPos );
- aPos = ScreenToOutputPixel( aPos );
+ Point aPos = mEvt->GetPosPixel();
+ vcl::Window* pWindow = rEvent.GetWindow();
+ if ( pWindow != this )
+ {
+ aPos = pWindow->OutputToScreenPixel( aPos );
+ aPos = ScreenToOutputPixel( aPos );
+ }
+ ImplStartDocking( aPos );
}
- ImplStartDocking( aPos );
}
}