sd/inc/pch/precompiled_sd.hxx | 4 - sd/source/ui/inc/SlideSorter.hxx | 16 ----- sd/source/ui/inc/ViewShell.hxx | 3 - sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx | 19 ------ sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx | 7 -- sd/source/ui/slidesorter/shell/SlideSorter.cxx | 15 +---- sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 3 - sd/source/ui/slidesorter/view/SlideSorterView.cxx | 1 sd/source/ui/view/drviews1.cxx | 1 sd/source/ui/view/outlnvsh.cxx | 1 sd/source/ui/view/viewshe2.cxx | 4 - sd/source/ui/view/viewshel.cxx | 28 ---------- 12 files changed, 10 insertions(+), 92 deletions(-)
New commits: commit d564d73673dc4dce43c988421397a6feae7620d5 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Aug 8 09:41:51 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Aug 8 14:56:30 2022 +0200 no need for ScrollBarBox if bg is already the desired color Change-Id: Ia471938bf0340bdef51b4a745814194f57893eac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137947 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index 13d31e340a9e..4018285cf363 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.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 2022-06-27 18:58:59 using: + Generated on 2022-08-08 10:27:15 using: ./bin/update_pch sd sd --cutoff=4 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -23,6 +23,7 @@ #include <sal/config.h> #if PCH_LEVEL >= 1 #include <algorithm> +#include <array> #include <cassert> #include <cstddef> #include <functional> @@ -98,7 +99,6 @@ #include <vcl/outdev.hxx> #include <vcl/ptrstyle.hxx> #include <vcl/region.hxx> -#include <vcl/scrbar.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <vcl/timer.hxx> diff --git a/sd/source/ui/inc/SlideSorter.hxx b/sd/source/ui/inc/SlideSorter.hxx index 4926e11583ec..ae51bd518c09 100644 --- a/sd/source/ui/inc/SlideSorter.hxx +++ b/sd/source/ui/inc/SlideSorter.hxx @@ -21,7 +21,6 @@ #include <cppuhelper/weakref.hxx> #include <svtools/scrolladaptor.hxx> -#include <vcl/scrbar.hxx> #include <sddllapi.h> #include <memory> @@ -87,16 +86,12 @@ public: Typically the horizontal scroll bar of the ViewShell. @param rpVerticalScrollBar Typically the vertical scroll bar of the ViewShell. - @param rpScrollBarBox - The little square enclosed by the two scroll bars. Typically - the one from the ViewShell. */ static std::shared_ptr<SlideSorter> CreateSlideSorter ( ViewShell& rViewShell, sd::Window* pContentWindow, ScrollAdaptor* pHorizontalScrollBar, - ScrollAdaptor* pVerticalScrollBar, - ScrollBarBox* pScrollBarBox); + ScrollAdaptor* pVerticalScrollBar); /** Create a new slide sorter that is loosely coupled to the given view shell. The view shell may even be missing. @@ -120,11 +115,6 @@ public: */ const VclPtr<ScrollAdaptor>& GetHorizontalScrollBar() const { return mpHorizontalScrollBar;} - /** Return the scroll bar filler that paints the little square that is - enclosed by the two scroll bars. - */ - const VclPtr<ScrollBarBox>& GetScrollBarFiller (void) const { return mpScrollBarBox;} - /** Return the content window. This is a sibling and is geometrically enclosed by the scroll bars. */ @@ -207,7 +197,6 @@ private: VclPtr<sd::Window> mpContentWindow; VclPtr<ScrollAdaptor> mpHorizontalScrollBar; VclPtr<ScrollAdaptor> mpVerticalScrollBar; - VclPtr<ScrollBarBox> mpScrollBarBox; /** Some slide sorter wide properties that are used in different classes. @@ -219,8 +208,7 @@ private: ViewShell& rViewShell, sd::Window* pContentWindow, ScrollAdaptor* pHorizontalScrollBar, - ScrollAdaptor* pVerticalScrollBar, - ScrollBarBox* pScrollBarBox); + ScrollAdaptor* pVerticalScrollBar); SlideSorter ( ViewShellBase& rBase, vcl::Window& rParentWindow); diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 17161c049007..5454639687ed 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -25,7 +25,6 @@ #include <svl/typedwhich.hxx> #include <svtools/scrolladaptor.hxx> #include <vcl/prntypes.hxx> -#include <vcl/scrbar.hxx> #include <o3tl/deleter.hxx> #include <pres.hxx> #include "View.hxx" @@ -442,8 +441,6 @@ protected: VclPtr<SvxRuler> mpHorizontalRuler; /// Vertical ruler is not shown by default. VclPtr<SvxRuler> mpVerticalRuler; - /// Filler of the little square enclosed by the two scroll bars. - VclPtr<ScrollBarBox> mpScrollBarBox; /// Layer tab bar. VclPtr<LayerTabBar> mpLayerTabBar; diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx index be3a85504af0..6ee20c8dd93c 100644 --- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx @@ -31,8 +31,6 @@ #include <sdpage.hxx> #include <osl/diagnose.h> -#include <vcl/scrbar.hxx> - namespace sd::slidesorter::controller { constexpr double gnHorizontalScrollFactor(0.15); @@ -45,7 +43,6 @@ ScrollBarManager::ScrollBarManager (SlideSorter& rSlideSorter) mnHorizontalPosition (0), mnVerticalPosition (0), maScrollBorder (20,20), - mpScrollBarFiller(mrSlideSorter.GetScrollBarFiller()), maAutoScrollTimer("sd ScrollBarManager maAutoScrollTimer"), maAutoScrollOffset(0,0), mbIsAutoScrollActive(false), @@ -58,7 +55,6 @@ ScrollBarManager::ScrollBarManager (SlideSorter& rSlideSorter) // ViewTabBar. mpHorizontalScrollBar->Hide(); mpVerticalScrollBar->Hide(); - mpScrollBarFiller->Hide(); maAutoScrollTimer.SetTimeout(25); maAutoScrollTimer.SetInvokeHandler ( @@ -122,9 +118,6 @@ void ScrollBarManager::Disconnect() if (mpVerticalScrollBar!=nullptr && mpVerticalScrollBar->IsVisible()) PlaceVerticalScrollBar (rAvailableArea); - if (mpScrollBarFiller!=nullptr && mpScrollBarFiller->IsVisible()) - PlaceFiller (rAvailableArea); - return aRemainingSpace; } @@ -162,17 +155,6 @@ void ScrollBarManager::PlaceVerticalScrollBar (const ::tools::Rectangle& aArea) mnVerticalPosition = nThumbPosition / double(mpVerticalScrollBar->GetRange().Len()); } -void ScrollBarManager::PlaceFiller (const ::tools::Rectangle& aArea) -{ - mpScrollBarFiller->SetPosSizePixel( - Point( - aArea.Right()-mpVerticalScrollBar->GetSizePixel().Width()+1, - aArea.Bottom()-mpHorizontalScrollBar->GetSizePixel().Height()+1), - Size ( - mpVerticalScrollBar->GetSizePixel().Width(), - mpHorizontalScrollBar->GetSizePixel().Height())); -} - void ScrollBarManager::UpdateScrollBars(bool bUseScrolling) { ::tools::Rectangle aModelArea (mrSlideSorter.GetView().GetModelArea()); @@ -327,7 +309,6 @@ void ScrollBarManager::SetWindowOrigin ( // Make the visibility of the scroll bars permanent. mpVerticalScrollBar->Show(bShowVertical); mpHorizontalScrollBar->Show(bShowHorizontal); - mpScrollBarFiller->Show(bShowVertical && bShowHorizontal); // Adapt the remaining space accordingly. ::tools::Rectangle aRemainingSpace (rAvailableArea); diff --git a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx index 9d94986d91e0..df04a3b5952f 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx @@ -23,7 +23,6 @@ #include <tools/gen.hxx> #include <svtools/scrolladaptor.hxx> #include <vcl/timer.hxx> -#include <vcl/scrbar.hxx> #include <vcl/vclptr.hxx> #include <functional> @@ -179,11 +178,6 @@ private: when entered while in drag mode leads to a scrolling of the window. */ Size maScrollBorder; - /** The only task of this little window is to paint the little square at - the bottom right corner left by the two scroll bars (when both are - visible). - */ - VclPtr<ScrollBarBox> mpScrollBarFiller; /** The auto scroll timer is used for keep scrolling the window when the mouse reaches its border while dragging a selection. When the mouse @@ -241,7 +235,6 @@ private: void PlaceHorizontalScrollBar (const ::tools::Rectangle& aArea); void PlaceVerticalScrollBar (const ::tools::Rectangle& aArea); - void PlaceFiller (const ::tools::Rectangle& aArea); }; } // end of namespace ::sd::slidesorter::controller diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx index 570f88348252..6fc906ded600 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx @@ -35,7 +35,6 @@ #include <Window.hxx> #include <tools/debug.hxx> -#include <vcl/scrbar.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -71,16 +70,14 @@ std::shared_ptr<SlideSorter> SlideSorter::CreateSlideSorter( ViewShell& rViewShell, sd::Window* pContentWindow, ScrollAdaptor* pHorizontalScrollBar, - ScrollAdaptor* pVerticalScrollBar, - ScrollBarBox* pScrollBarBox) + ScrollAdaptor* pVerticalScrollBar) { std::shared_ptr<SlideSorter> pSlideSorter( new SlideSorter( rViewShell, pContentWindow, pHorizontalScrollBar, - pVerticalScrollBar, - pScrollBarBox), + pVerticalScrollBar), o3tl::default_delete<SlideSorter>()); pSlideSorter->Init(); return pSlideSorter; @@ -103,15 +100,13 @@ SlideSorter::SlideSorter ( ViewShell& rViewShell, sd::Window* pContentWindow, ScrollAdaptor* pHorizontalScrollBar, - ScrollAdaptor* pVerticalScrollBar, - ScrollBarBox* pScrollBarBox) + ScrollAdaptor* pVerticalScrollBar) : mbIsValid(false), mpViewShell(&rViewShell), mpViewShellBase(&rViewShell.GetViewShellBase()), mpContentWindow(pContentWindow), mpHorizontalScrollBar(pHorizontalScrollBar), mpVerticalScrollBar(pVerticalScrollBar), - mpScrollBarBox(pScrollBarBox), mpProperties(std::make_shared<controller::Properties>()), mpTheme(std::make_shared<view::Theme>(mpProperties)) { @@ -126,7 +121,6 @@ SlideSorter::SlideSorter ( mpContentWindow(VclPtr<ContentWindow>::Create(rParentWindow,*this )), mpHorizontalScrollBar(VclPtr<ScrollAdaptor>::Create(&rParentWindow, true)), mpVerticalScrollBar(VclPtr<ScrollAdaptor>::Create(&rParentWindow, false)), - mpScrollBarBox(VclPtr<ScrollBarBox>::Create(&rParentWindow)), mpProperties(std::make_shared<controller::Properties>()), mpTheme(std::make_shared<view::Theme>(mpProperties)) { @@ -161,7 +155,7 @@ void SlideSorter::Init() vcl::Window* pParentWindow = pContentWindow->GetParent(); if (pParentWindow != nullptr) - pParentWindow->SetBackground(Wallpaper()); + pParentWindow->SetBackground(Application::GetSettings().GetStyleSettings().GetFaceColor()); pContentWindow->SetBackground(Wallpaper()); pContentWindow->SetViewOrigin (Point(0,0)); // We do our own scrolling while dragging a page selection. @@ -195,7 +189,6 @@ SlideSorter::~SlideSorter() mpHorizontalScrollBar.reset(); mpVerticalScrollBar.reset(); - mpScrollBarBox.reset(); } model::SlideSorterModel& SlideSorter::GetModel() const diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 4de3e6a1c095..88cf7e3fb793 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -172,8 +172,7 @@ void SlideSorterViewShell::Initialize() *this, mpContentWindow, mpHorizontalScrollBar, - mpVerticalScrollBar, - mpScrollBarBox); + mpVerticalScrollBar); mpView = &mpSlideSorter->GetView(); doShow(); diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index b3a1a815f13f..d15b2137451a 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -43,7 +43,6 @@ #include <comphelper/lok.hxx> #include <osl/diagnose.h> #include <vcl/svapp.hxx> -#include <vcl/scrbar.hxx> #include <vcl/settings.hxx> #include <vcl/graphicfilter.hxx> diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 085bc93f2a85..dd4c2e5b019b 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -33,7 +33,6 @@ #include <svx/svdoole2.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/module.hxx> -#include <vcl/scrbar.hxx> #include <svx/svdopage.hxx> #include <svx/fmshell.hxx> #include <tools/debug.hxx> diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 0e55c1f188a8..856c49748ea4 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -39,7 +39,6 @@ #include <sfx2/dispatch.hxx> #include <sfx2/viewfrm.hxx> #include <vcl/commandevent.hxx> -#include <vcl/scrbar.hxx> #include <vcl/settings.hxx> #include <sal/log.hxx> diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 26373b8eaba6..abb9b5f1db7a 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -27,7 +27,6 @@ #include <FactoryIds.hxx> #include <svx/svxids.hrc> -#include <vcl/scrbar.hxx> #include <svx/svdpagv.hxx> #include <sfx2/dispatch.hxx> #include <svx/ruler.hxx> @@ -852,9 +851,6 @@ void ViewShell::SetScrollBarsVisible(bool bVisible) if (mpHorizontalScrollBar) mpHorizontalScrollBar->Show( bVisible ); - - if (mpScrollBarBox) - mpScrollBarBox->Show(bVisible); } sal_Int8 ViewShell::AcceptDrop ( diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 9f28b2b47948..296b42d064c7 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -32,7 +32,6 @@ #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> #include <vcl/commandevent.hxx> -#include <vcl/scrbar.hxx> #include <svl/eitem.hxx> #include <svx/ruler.hxx> #include <svx/svxids.hrc> @@ -163,7 +162,6 @@ ViewShell::~ViewShell() mpContentWindow.disposeAndClear(); } - mpScrollBarBox.disposeAndClear(); mpVerticalRuler.disposeAndClear(); mpHorizontalRuler.disposeAndClear(); mpVerticalScrollBar.disposeAndClear(); @@ -197,7 +195,7 @@ void ViewShell::construct() mpContentWindow.reset(VclPtr< ::sd::Window >::Create(GetParentWindow())); SetActiveWindow (mpContentWindow.get()); - GetParentWindow()->SetBackground (Wallpaper()); + GetParentWindow()->SetBackground(Application::GetSettings().GetStyleSettings().GetFaceColor()); mpContentWindow->SetBackground (Wallpaper()); mpContentWindow->SetCenterAllowed(true); mpContentWindow->SetViewShell(this); @@ -215,8 +213,6 @@ void ViewShell::construct() mpVerticalScrollBar.reset (VclPtr<ScrollAdaptor>::Create(GetParentWindow(), false)); mpVerticalScrollBar->SetRange(Range(0, 32000)); mpVerticalScrollBar->SetScrollHdl(LINK(this, ViewShell, VScrollHdl)); - - mpScrollBarBox.reset(VclPtr<ScrollBarBox>::Create(GetParentWindow(), WB_SIZEABLE)); } SetName ("ViewShell"); @@ -256,8 +252,6 @@ void ViewShell::doShow() maScrBarWH = Size( mpVerticalScrollBar->GetSizePixel().Width(), mpHorizontalScrollBar->GetSizePixel().Height()); - - mpScrollBarBox->Show(); } GetParentWindow()->Show(); @@ -955,21 +949,6 @@ void ViewShell::ArrangeGUIElements() Size (maScrBarWH.Width(), nBottom-nTop)); } - // Filler in the lower right corner. - if (mpScrollBarBox) - { - if (mpHorizontalScrollBar - && mpHorizontalScrollBar->IsVisible() - && mpVerticalScrollBar - && mpVerticalScrollBar->IsVisible()) - { - mpScrollBarBox->Show(); - mpScrollBarBox->SetPosSizePixel(Point(nRight, nBottom), maScrBarWH); - } - else - mpScrollBarBox->Hide(); - } - // Place horizontal ruler below tab bar. if (mbHasRulers && mpContentWindow) { @@ -1504,9 +1483,6 @@ void ViewShell::ShowUIControls (bool bVisible) if (mpHorizontalScrollBar) mpHorizontalScrollBar->Show( bVisible ); - if (mpScrollBarBox) - mpScrollBarBox->Show(bVisible); - if (mpContentWindow) mpContentWindow->Show( bVisible ); } @@ -1524,8 +1500,6 @@ bool ViewShell::RelocateToParentWindow (vcl::Window* pParentWindow) mpHorizontalScrollBar->SetParent(mpParentWindow); if (mpVerticalScrollBar) mpVerticalScrollBar->SetParent(mpParentWindow); - if (mpScrollBarBox) - mpScrollBarBox->SetParent(mpParentWindow); return true; }