diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-04-26 15:47:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-04-26 22:00:38 +0200 |
commit | a77eaf8aa893ccac27563fdc4373dc5c36254a9e (patch) | |
tree | 39f7440c79c543c760381ccc5fc3992836dbd043 /svx | |
parent | 218ad66010fdba3c28564e2038876b6822752243 (diff) |
move PanelLayout to sfx2
Change-Id: If29ccb67835adba3ff6cf2eb53f348bbe71d6463
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92933
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/Library_svxcore.mk | 1 | ||||
-rw-r--r-- | svx/inc/GalleryControl.hxx | 2 | ||||
-rw-r--r-- | svx/inc/pch/precompiled_svx.hxx | 4 | ||||
-rw-r--r-- | svx/source/inc/DefaultShapesPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/EmptyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/PanelLayout.cxx | 120 | ||||
-rw-r--r-- | svx/source/sidebar/glow/GlowPropertyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/graphic/GraphicPropertyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/lists/ListsPropertyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/media/MediaPlaybackPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/possize/PosSizePropertyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/shadow/ShadowPropertyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/styles/StylesPropertyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/text/TextPropertyPanel.hxx | 2 |
15 files changed, 14 insertions, 135 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 80fcdae920f3..222d69bb6c8a 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -272,7 +272,6 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/sdr/properties/connectorproperties \ svx/source/sdr/properties/e3dcompoundproperties \ svx/source/sdr/properties/oleproperties \ - svx/source/sidebar/PanelLayout \ svx/source/svdraw/clonelist \ svx/source/svdraw/charthelper \ svx/source/svdraw/gradtrns \ diff --git a/svx/inc/GalleryControl.hxx b/svx/inc/GalleryControl.hxx index 0c88de8317ec..7a8d6d040c0f 100644 --- a/svx/inc/GalleryControl.hxx +++ b/svx/inc/GalleryControl.hxx @@ -20,7 +20,7 @@ #define INCLUDED_SVX_INC_GALLERYCONTROL_HXX #include <config_options.h> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <svx/svxdllapi.h> class SfxBindings; diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index b419cb4343cf..e692c3de4f25 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-04-25 20:55:32 using: + Generated on 2020-04-26 15:54:56 using: ./bin/update_pch svx svx --cutoff=3 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -290,6 +290,7 @@ #include <sfx2/module.hxx> #include <sfx2/objsh.hxx> #include <sfx2/request.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <sfx2/stbitem.hxx> #include <sfx2/tabdlg.hxx> #include <sfx2/tbxctrl.hxx> @@ -405,7 +406,6 @@ #include <svx/sdtaditm.hxx> #include <svx/sdtaitm.hxx> #include <svx/sdtakitm.hxx> -#include <svx/sidebar/PanelLayout.hxx> #include <svx/srchdlg.hxx> #include <svx/strarray.hxx> #include <svx/svddef.hxx> diff --git a/svx/source/inc/DefaultShapesPanel.hxx b/svx/source/inc/DefaultShapesPanel.hxx index 9e888fe4e0cd..c60876ba8a0b 100644 --- a/svx/source/inc/DefaultShapesPanel.hxx +++ b/svx/source/inc/DefaultShapesPanel.hxx @@ -20,7 +20,7 @@ #define INCLUDED_SVX_SOURCE_INC_DEFAULTSHAPESPANEL_HXX #include <com/sun/star/frame/XFrame.hpp> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <svtools/valueset.hxx> #include <map> #include "ShapesUtil.hxx" diff --git a/svx/source/sidebar/EmptyPanel.hxx b/svx/source/sidebar/EmptyPanel.hxx index aa3e1a5b2f7b..91eee1209696 100644 --- a/svx/source/sidebar/EmptyPanel.hxx +++ b/svx/source/sidebar/EmptyPanel.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_EMPTYPANEL_HXX #define INCLUDED_SVX_SOURCE_SIDEBAR_EMPTYPANEL_HXX -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> namespace svx { namespace sidebar { diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx deleted file mode 100644 index 39659687d218..000000000000 --- a/svx/source/sidebar/PanelLayout.cxx +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include <sfx2/sidebar/SidebarController.hxx> -#include <sfx2/sidebar/TabBar.hxx> -#include <svx/sidebar/PanelLayout.hxx> -#include <vcl/layout.hxx> -#include <vcl/accel.hxx> - -using namespace sfx2::sidebar; - -PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, - const css::uno::Reference<css::frame::XFrame> &rFrame) - : Control(pParent) - , m_bInClose(false) - , mxFrame(rFrame) -{ - SetStyle(GetStyle() | WB_DIALOGCONTROL); - m_aPanelLayoutIdle.SetPriority(TaskPriority::RESIZE); - m_aPanelLayoutIdle.SetInvokeHandler( LINK( this, PanelLayout, ImplHandlePanelLayoutTimerHdl ) ); - m_aPanelLayoutIdle.SetDebugName("svx::PanelLayout m_aPanelLayoutIdle"); - - // Builder will trigger resize and start Idle - m_xVclContentArea = VclPtr<VclVBox>::Create(this); - m_xVclContentArea->Show(); - m_xBuilder.reset(Application::CreateInterimBuilder(m_xVclContentArea, rUIXMLDescription)); - m_xContainer = m_xBuilder->weld_container(rID); -} - -PanelLayout::~PanelLayout() -{ - disposeOnce(); -} - -void PanelLayout::dispose() -{ - m_bInClose = true; - m_aPanelLayoutIdle.Stop(); - m_xContainer.reset(); - m_xBuilder.reset(); - m_xVclContentArea.disposeAndClear(); - Control::dispose(); -} - -Size PanelLayout::GetOptimalSize() const -{ - Size aSize = m_xContainer->get_preferred_size(); - - if (mxFrame) - { - SidebarController* pController - = SidebarController::GetSidebarControllerForFrame(mxFrame); - if (pController) - aSize.setWidth(std::min<long>( - aSize.Width(), (pController->getMaximumWidth() - TabBar::GetDefaultWidth()) - * GetDPIScaleFactor())); - } - - return aSize; -} - -void PanelLayout::queue_resize(StateChangedType /*eReason*/) -{ - if (m_bInClose) - return; - if (m_aPanelLayoutIdle.IsActive()) - return; - InvalidateSizeCache(); - m_aPanelLayoutIdle.Start(); -} - -IMPL_LINK_NOARG( PanelLayout, ImplHandlePanelLayoutTimerHdl, Timer*, void ) -{ - vcl::Window *pChild = GetWindow(GetWindowType::FirstChild); - assert(pChild); - VclContainer::setLayoutAllocation(*pChild, Point(0, 0), GetSizePixel()); -} - -void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags) -{ - bool bCanHandleSmallerWidth = false; - bool bCanHandleSmallerHeight = false; - - vcl::Window *pChild = GetWindow(GetWindowType::FirstChild); - - if (pChild->GetType() == WindowType::SCROLLWINDOW) - { - WinBits nStyle = pChild->GetStyle(); - if (nStyle & (WB_AUTOHSCROLL | WB_HSCROLL)) - bCanHandleSmallerWidth = true; - if (nStyle & (WB_AUTOVSCROLL | WB_VSCROLL)) - bCanHandleSmallerHeight = true; - } - - Size aSize(GetOptimalSize()); - if (!bCanHandleSmallerWidth) - nWidth = std::max(nWidth,aSize.Width()); - if (!bCanHandleSmallerHeight) - nHeight = std::max(nHeight,aSize.Height()); - - Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags); - - if (nFlags & PosSizeFlags::Size) - VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight)); -} - -bool PanelLayout::EventNotify(NotifyEvent& rNEvt) -{ - if (rNEvt.GetType() == MouseNotifyEvent::COMMAND) - Accelerator::ToggleMnemonicsOnHierarchy(*rNEvt.GetCommandEvent(), this); - return Control::EventNotify( rNEvt ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/glow/GlowPropertyPanel.hxx b/svx/source/sidebar/glow/GlowPropertyPanel.hxx index d7afea8913ee..7cdf772cbf1a 100644 --- a/svx/source/sidebar/glow/GlowPropertyPanel.hxx +++ b/svx/source/sidebar/glow/GlowPropertyPanel.hxx @@ -11,7 +11,7 @@ #include <vcl/vclptr.hxx> #include <sfx2/sidebar/ControllerItem.hxx> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> class ColorListBox; diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx index c587b1719f8b..c9bb0d0597c4 100644 --- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx +++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx @@ -20,7 +20,7 @@ #define INCLUDED_SVX_SOURCE_SIDEBAR_GRAPHIC_GRAPHICPROPERTYPANEL_HXX #include <sfx2/sidebar/ControllerItem.hxx> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <vcl/weld.hxx> namespace svx { namespace sidebar { diff --git a/svx/source/sidebar/lists/ListsPropertyPanel.hxx b/svx/source/sidebar/lists/ListsPropertyPanel.hxx index ec8fc2817799..350891684eda 100644 --- a/svx/source/sidebar/lists/ListsPropertyPanel.hxx +++ b/svx/source/sidebar/lists/ListsPropertyPanel.hxx @@ -20,7 +20,7 @@ #define INCLUDED_SVX_SOURCE_SIDEBAR_LISTS_LISTSPROPERTYPANEL_HXX #include <sfx2/weldutils.hxx> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <com/sun/star/frame/XFrame.hpp> namespace svx diff --git a/svx/source/sidebar/media/MediaPlaybackPanel.hxx b/svx/source/sidebar/media/MediaPlaybackPanel.hxx index a510d2fbe24e..ed434b8da80e 100644 --- a/svx/source/sidebar/media/MediaPlaybackPanel.hxx +++ b/svx/source/sidebar/media/MediaPlaybackPanel.hxx @@ -22,7 +22,7 @@ #include <memory> #include <com/sun/star/frame/XFrame.hpp> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <avmedia/mediaitem.hxx> #include <sfx2/bindings.hxx> #include <sfx2/sidebar/ControllerItem.hxx> diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index 5fe8095ad061..52c5176710e7 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -21,7 +21,7 @@ #include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <svx/relfld.hxx> #include <com/sun/star/frame/XFrame.hpp> diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index 0defd5292a52..99213bac6dff 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -22,7 +22,7 @@ #include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx> #include <sfx2/weldutils.hxx> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <svl/poolitem.hxx> #include <tools/fldunit.hxx> #include <tools/fract.hxx> diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx index 8ad3871af1ee..5af32f088056 100644 --- a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx +++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx @@ -11,7 +11,7 @@ #include <vcl/vclptr.hxx> #include <sfx2/sidebar/ControllerItem.hxx> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> class ColorListBox; diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.hxx b/svx/source/sidebar/styles/StylesPropertyPanel.hxx index 357634504f2a..51001aa12e77 100644 --- a/svx/source/sidebar/styles/StylesPropertyPanel.hxx +++ b/svx/source/sidebar/styles/StylesPropertyPanel.hxx @@ -1,7 +1,7 @@ #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_STYLES_STYLESPROPERTYPANEL_HXX #define INCLUDED_SVX_SOURCE_SIDEBAR_STYLES_STYLESPROPERTYPANEL_HXX -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> #include <sfx2/weldutils.hxx> namespace svx { namespace sidebar{ diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx index bfa905446785..343822451e1f 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.hxx +++ b/svx/source/sidebar/text/TextPropertyPanel.hxx @@ -22,7 +22,7 @@ #include <sfx2/sidebar/IContextChangeReceiver.hxx> #include <sfx2/weldutils.hxx> #include <vcl/EnumContext.hxx> -#include <svx/sidebar/PanelLayout.hxx> +#include <sfx2/sidebar/PanelLayout.hxx> namespace svx { namespace sidebar { |