diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-22 11:39:18 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-03-22 14:44:29 +0100 |
commit | d0c73ce13c02c37fcc094ac6612d6a8eee2a4026 (patch) | |
tree | c8264adcf3aae0e83878a48629116b127c951ae8 /sfx2 | |
parent | cc4228b028d969a9bb49a5d2451eaa88aa400eae (diff) |
tdf#124263 Respect XSidebarPanel::getMinimalWidth
even if it's larger than max sidebar width (increase max sidebar width in that case).
Change-Id: I2efbd546596f756df205196fae3e545beddd2f7c
Reviewed-on: https://gerrit.libreoffice.org/69551
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/DeckLayouter.cxx | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx index 3d40cd13a59e..c3649aaab106 100644 --- a/sfx2/source/sidebar/DeckLayouter.cxx +++ b/sfx2/source/sidebar/DeckLayouter.cxx @@ -22,10 +22,17 @@ #include <sfx2/sidebar/Panel.hxx> #include <sfx2/sidebar/PanelTitleBar.hxx> #include <sfx2/sidebar/Deck.hxx> +#include <sfx2/sidebar/SidebarController.hxx> +#include <comphelper/processfactory.hxx> #include <vcl/window.hxx> #include <vcl/scrbar.hxx> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/frame/Desktop.hpp> +#include <com/sun/star/frame/XDesktop2.hpp> +#include <com/sun/star/frame/XFrame.hpp> + using namespace css; using namespace css::uno; @@ -369,8 +376,23 @@ void GetRequestedSizes ( if (xPanel.is()) { aLayoutSize = xPanel->getHeightForWidth(rContentBox.GetWidth()); - sal_Int32 nWidth = xPanel->getMinimalWidth(); + + uno::Reference<frame::XDesktop2> xDesktop + = frame::Desktop::create(comphelper::getProcessComponentContext()); + uno::Reference<frame::XFrame> xFrame = xDesktop->getActiveFrame(); + if (xFrame.is()) + { + SidebarController* pController + = SidebarController::GetSidebarControllerForFrame(xFrame); + if (pController && pController->getMaximumWidth() < nWidth) + { + // Add 100 extra pixels to still have the sidebar resizable + // (See also documentation of XSidebarPanel::getMinimalWidth) + pController->setMaximumWidth(nWidth + 100); + } + } + if (nWidth > rMinimalWidth) rMinimalWidth = nWidth; } |