/* -*- 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 . */ #ifndef INCLUDED_SVX_GRAPHCTL_HXX #define INCLUDED_SVX_GRAPHCTL_HXX #include #include #include #include #include class GraphCtrl; class GraphCtrlUserCall final : public SdrObjUserCall { GraphCtrl& rWin; public: GraphCtrlUserCall(GraphCtrl& rGraphWin) : rWin(rGraphWin) {} virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& rOldBoundRect) override; }; class SvxGraphCtrlAccessibleContext; class SAL_DLLPUBLIC_RTTI GraphCtrl : public weld::CustomWidgetController { friend class GraphCtrlView; friend class GraphCtrlUserCall; Graphic aGraphic; ScopedVclPtrInstance xVD; Idle aUpdateIdle; Link aMousePosLink; Link aGraphSizeLink; Link aUpdateLink; MapMode aMap100; Size aGraphSize; Point aMousePos; std::unique_ptr pUserCall; SdrObjKind eObjKind; sal_uInt16 nPolyEdit; bool bEditMode; bool mbSdrMode; bool mbInIdleUpdate; weld::Dialog* mpDialog; DECL_LINK( UpdateHdl, Timer*, void ); rtl::Reference mpAccContext; protected: std::unique_ptr pModel; std::unique_ptr pView; virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; virtual void Resize() override; virtual bool KeyInput(const KeyEvent& rKEvt) override; virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; virtual bool MouseButtonUp(const MouseEvent& rMEvt) override; virtual bool MouseMove(const MouseEvent& rMEvt) override; virtual void InitSdrModel(); virtual void SdrObjCreated( const SdrObject& rObj ); virtual void SdrObjChanged( const SdrObject& rObj ); virtual void MarkListHasChanged(); void GraphicToVD(); SdrObjUserCall* GetSdrUserCall() { return pUserCall.get(); } public: SVX_DLLPUBLIC GraphCtrl(weld::Dialog* pDialog); virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; SVX_DLLPUBLIC virtual ~GraphCtrl() override; SVX_DLLPUBLIC void SetGraphic( const Graphic& rGraphic, bool bNewModel = true ); const Graphic& GetGraphic() const { return aGraphic; } const Size& GetGraphicSize() const { return aGraphSize; } const Point& GetMousePos() const { return aMousePos; } void SetEditMode( const bool bEditMode ); void SetPolyEditMode( const sal_uInt16 nPolyEdit ); sal_uInt16 GetPolyEditMode() const { return nPolyEdit; } void SetObjKind( const SdrObjKind eObjKind ); SdrModel* GetSdrModel() const { return pModel.get(); } SdrView* GetSdrView() const { return pView.get(); } SdrObject* GetSelectedSdrObject() const; bool IsChanged() const { return mbSdrMode && pModel->IsChanged(); } void SetMousePosLink( const Link& rLink ) { aMousePosLink = rLink; } void SetGraphSizeLink( const Link& rLink ) { aGraphSizeLink = rLink; } void SetUpdateLink( const Link& rLink ) { aUpdateLink = rLink; } void QueueIdleUpdate(); void SetSdrMode(bool b); Point GetPositionInDialog() const; virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; }; class GraphCtrlView final : public SdrView { GraphCtrl& rGraphCtrl; virtual void MarkListHasChanged() override { SdrView::MarkListHasChanged(); rGraphCtrl.MarkListHasChanged(); } public: GraphCtrlView(SdrModel& rSdrModel, GraphCtrl* pWindow) : SdrView(rSdrModel, &pWindow->GetDrawingArea()->get_ref_device()) , rGraphCtrl(*pWindow) { } virtual ~GraphCtrlView() override; // override these so we can get the occasions SdrPaintView would call Window::Invalidate on its vcl::Window // if it had one, and route to WidgetController::Invalidate instead virtual rtl::Reference CreateOverlayManager(OutputDevice& rDevice) const override; virtual void InvalidateOneWin(OutputDevice& rWin) override; virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect) override; }; #endif // INCLUDED_SVX_GRAPHCTL_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ abora/viewer'>distro/collabora/viewer LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-09tdf#151424 Spider web chart drawing errorNoel Grandin
regression from commit 333ccb081b4ab62adce50ca4c93162b9baf984d0 Author: Noel Grandin <noelgrandin@gmail.com> Date: Sat Feb 5 14:58:07 2022 +0200 use more concrete types in chart2, Axis Change-Id: Ib80bbec9f08b9fafa6ee1c8d0cace8b44fdadabc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-22use more concrete types in chart2, ChartTypeNoel Grandin
Change-Id: Ibd299e2e8d82169706d810af98c29d684809c320 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128741 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-05speed up property access in chartsNoel Grandin
uno::Any copy and assign is fairly hot, so try and do those operations in one step Change-Id: I110566ba98788d5a658d229433de291c8cdf146c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126377 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-04tdf#124176 Use #pragma once in chart2George Bateman
This commit was carried out mostly by a Python script, source of which is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97. Change-Id: Ifee23b494264f895e5612952d0875cac064e4132 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100181 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-06-16tdf#42949 Fix IWYU warnings in chart2/source/model/{main,template}/*hxxGabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I53b8ac58e5f5a3778835e06a73b5f6e11dce4357 Reviewed-on: https://gerrit.libreoffice.org/55569 Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-03-08loplugin:unusedfieldsNoel Grandin
Change-Id: Id332557cbe7fb42d3d794612f26aa3ac161548d9 Reviewed-on: https://gerrit.libreoffice.org/50902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-10loplugin:finalclasses in chart2Noel Grandin
Change-Id: I35afa226beb6fe4319313125c323d9f059837357 Reviewed-on: https://gerrit.libreoffice.org/44534 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-11-11loplugin:expandablemethods in chart2Noel Grandin
Change-Id: Ie6650628683ec7c67359351eec0e09033f2b50cb Reviewed-on: https://gerrit.libreoffice.org/30750 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-03-14com::sun::star->css in chart2Noel Grandin
Change-Id: I04320d32d6d5c54e461cfabef58645f8b772bc69