From 2fd7d760969d8eecc49672b3c8f4c58a5ea1bd4a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 23 Dec 2019 16:13:34 +0000 Subject: SidebarDialControl is now unused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I949276018ed1867ce2a450c013c7fa41206fe68c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85765 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svx/Library_svx.mk | 1 - .../sidebar/possize/PosSizePropertyPanel.cxx | 2 +- .../sidebar/possize/PosSizePropertyPanel.hxx | 2 - svx/source/sidebar/possize/SidebarDialControl.cxx | 74 ---------------------- 4 files changed, 1 insertion(+), 78 deletions(-) delete mode 100644 svx/source/sidebar/possize/SidebarDialControl.cxx (limited to 'svx') diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index af4264047401..66138648dca0 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -207,7 +207,6 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/sidebar/line/LineWidthPopup \ $(call gb_Helper_optional,AVMEDIA,svx/source/sidebar/media/MediaPlaybackPanel) \ svx/source/sidebar/possize/PosSizePropertyPanel \ - svx/source/sidebar/possize/SidebarDialControl \ svx/source/sidebar/shapes/DefaultShapesPanel \ svx/source/sidebar/shapes/ShapesUtil \ svx/source/sidebar/tools/ValueSetWithTextControl \ diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 7d1982dbdca1..d6c300be6a8d 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -23,7 +23,6 @@ #include #include "PosSizePropertyPanel.hxx" -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index 2e957b66a648..c5a0f3c92479 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -41,8 +41,6 @@ class SvxDialControl; namespace svx { namespace sidebar { -class SidebarDialControl; - class PosSizePropertyPanel : public PanelLayout, public ::sfx2::sidebar::IContextChangeReceiver, diff --git a/svx/source/sidebar/possize/SidebarDialControl.cxx b/svx/source/sidebar/possize/SidebarDialControl.cxx deleted file mode 100644 index ee2923c3cedd..000000000000 --- a/svx/source/sidebar/possize/SidebarDialControl.cxx +++ /dev/null @@ -1,74 +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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#include - -#include -#include -#include -#include - -namespace svx { namespace sidebar { - -SidebarDialControl::SidebarDialControl (vcl::Window* pParent, WinBits nBits) - : svx::DialControl(pParent, nBits) -{ - Init(GetOutputSizePixel()); -} - -VCL_BUILDER_FACTORY_ARGS(SidebarDialControl, WB_TABSTOP) - -Size SidebarDialControl::GetOptimalSize() const -{ - return LogicToPixel(Size(10, 10), MapMode(MapUnit::MapAppFont)); -} - -void SidebarDialControl::MouseButtonDown( const MouseEvent& rMEvt ) -{ - if( rMEvt.IsLeft() ) - { - GrabFocus(); - CaptureMouse(); - mpImpl->mnOldAngle = mpImpl->mnAngle; - HandleMouseEvent( rMEvt.GetPosPixel(), true ); - } -} - -void SidebarDialControl::HandleMouseEvent( const Point& rPos, bool bInitial ) -{ - long nX = rPos.X() - mpImpl->mnCenterX; - long nY = mpImpl->mnCenterY - rPos.Y(); - double fH = sqrt( static_cast< double >( nX ) * nX + static_cast< double >( nY ) * nY ); - if( fH != 0.0 ) - { - double fAngle = acos( nX / fH ); - sal_Int32 nAngle = static_cast(basegfx::rad2deg(fAngle) * 100.0); - if( nY < 0 ) - nAngle = 36000 - nAngle; - if( bInitial ) // round to entire 15 degrees - nAngle = ((nAngle + 750) / 1500) * 1500; - - if (AllSettings::GetLayoutRTL()) - nAngle = 18000 - nAngle; - SetRotation( nAngle, true ); - } -} - -} } // end of namespace svx::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit