diff options
Diffstat (limited to 'chart2/source/controller/inc')
48 files changed, 355 insertions, 279 deletions
diff --git a/chart2/source/controller/inc/AccessibleBase.hxx b/chart2/source/controller/inc/AccessibleBase.hxx index 4bd51c342678..b7ccbac900da 100644 --- a/chart2/source/controller/inc/AccessibleBase.hxx +++ b/chart2/source/controller/inc/AccessibleBase.hxx @@ -29,7 +29,6 @@ #include <comphelper/accessibleeventnotifier.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> -#include <rtl/ref.hxx> #include <tools/color.hxx> #include <unotools/weakref.hxx> @@ -40,7 +39,6 @@ namespace com::sun::star::awt { class XWindow; } namespace com::sun::star::chart2 { class XChartDocument; } namespace com::sun::star::view { class XSelectionSupplier; } -namespace utl { class AccessibleStateSetHelper; } class SdrView; @@ -54,7 +52,9 @@ namespace chart { class AccessibleBase; +class ChartView; class ObjectHierarchy; +class ChartController; typedef ObjectIdentifier AccessibleUniqueId; @@ -63,8 +63,8 @@ struct AccessibleElementInfo AccessibleUniqueId m_aOID; unotools::WeakReference< ::chart::ChartModel > m_xChartDocument; - css::uno::WeakReference< css::view::XSelectionSupplier > m_xSelectionSupplier; - css::uno::WeakReference< css::uno::XInterface > m_xView; + unotools::WeakReference< ::chart::ChartController > m_xChartController; + unotools::WeakReference< ::chart::ChartView > m_xView; css::uno::WeakReference< css::awt::XWindow > m_xWindow; std::shared_ptr< ObjectHierarchy > m_spObjectHierarchy; @@ -99,7 +99,7 @@ public: LOST_SELECTION }; - AccessibleBase( const AccessibleElementInfo & rAccInfo, + AccessibleBase( AccessibleElementInfo aAccInfo, bool bMayHaveChildren, bool bAlwaysTransparent ); virtual ~AccessibleBase() override; @@ -135,14 +135,14 @@ protected: @throws css::uno::RuntimeException */ - void AddState( sal_Int16 aState ); + void AddState( sal_Int64 aState ); /** Removes a state from the set if the set contains the state, otherwise nothing is done. @throws css::uno::RuntimeException */ - void RemoveState( sal_Int16 aState ); + void RemoveState( sal_Int64 aState ); /** has to be overridden by derived classes that support child elements. With this method a rescan is initiated that should result in a correct @@ -185,14 +185,10 @@ protected: /** This method creates an AccessibleEventObject and sends it to all listeners that are currently listening to this object - - If bSendGlobally is true, the event is also broadcast via - vcl::unohelper::NotifyAccessibleStateEventGlobally() */ void BroadcastAccEvent( sal_Int16 nId, const css::uno::Any & rNew, - const css::uno::Any & rOld, - bool bSendGlobally = false ) const; + const css::uno::Any & rOld ) const; /** Removes all children from the internal lists and broadcasts child remove events. @@ -209,14 +205,14 @@ protected: @throws css::uno::RuntimeException */ virtual css::uno::Reference< css::accessibility::XAccessible > - ImplGetAccessibleChildById( sal_Int32 i ) const; + ImplGetAccessibleChildById( sal_Int64 i ) const; /** Is called from getAccessibleChildCount(). Before this method is called, an update of children is done if necessary. @throws css::uno::RuntimeException */ - virtual sal_Int32 ImplGetAccessibleChildCount() const; + virtual sal_Int64 ImplGetAccessibleChildCount() const; const AccessibleElementInfo& GetInfo() const { return m_aAccInfo;} void SetInfo( const AccessibleElementInfo & rNewInfo ); @@ -229,12 +225,12 @@ protected: virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override; // ________ XAccessibleContext ________ - virtual sal_Int32 SAL_CALL getAccessibleChildCount() override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL - getAccessibleChild( sal_Int32 i ) override; + getAccessibleChild( sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override; /// @return AccessibleRole.SHAPE virtual sal_Int16 SAL_CALL getAccessibleRole() override; // has to be implemented by derived classes @@ -242,8 +238,7 @@ protected: // throw (css::uno::RuntimeException); virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL - getAccessibleStateSet() override; + virtual sal_Int64 SAL_CALL getAccessibleStateSet() override; virtual css::lang::Locale SAL_CALL getLocale() override; // has to be implemented by derived classes // virtual OUString SAL_CALL getAccessibleDescription() @@ -305,11 +300,9 @@ private: ::comphelper::AccessibleEventNotifier::TClientId m_nEventNotifierId; - /** Implementation helper for getAccessibleStateSet() - - Note: This member must come before m_aStateSet! + /** for getAccessibleStateSet() */ - rtl::Reference<::utl::AccessibleStateSetHelper> m_xStateSetHelper; + sal_Int64 m_nStateSet; AccessibleElementInfo m_aAccInfo; const bool m_bAlwaysTransparent; diff --git a/chart2/source/controller/inc/AccessibleChartView.hxx b/chart2/source/controller/inc/AccessibleChartView.hxx index eb3367b205d6..793cdd69ab77 100644 --- a/chart2/source/controller/inc/AccessibleChartView.hxx +++ b/chart2/source/controller/inc/AccessibleChartView.hxx @@ -38,12 +38,12 @@ class IAccessibleViewForwarder; namespace chart { +class ChartView; namespace impl { typedef ::cppu::ImplInheritanceHelper< ::chart::AccessibleBase, - css::lang::XInitialization, css::view::XSelectionChangeListener > AccessibleChartView_Base; } @@ -52,7 +52,7 @@ class AccessibleChartView final : public impl::AccessibleChartView_Base { public: - AccessibleChartView(SdrView* pView ); + AccessibleChartView( SdrView* pView ); virtual ~AccessibleChartView() override; AccessibleChartView() = delete; @@ -60,15 +60,19 @@ public: // ____ WeakComponentHelper (called from XComponent::dispose()) ____ using AccessibleBase::disposing; - // ____ lang::XInitialization ____ // 0: view::XSelectionSupplier offers notifications for selection changes and access to the selection itself // 1: frame::XModel representing the chart model - offers access to object data // 2: lang::XInterface representing the normal chart view - offers access to some extra object data // 3: accessibility::XAccessible representing the parent accessible // 4: awt::XWindow representing the view's window (is a vcl Window) // all arguments are only valid until next initialization - don't keep them longer - virtual void SAL_CALL initialize( - const css::uno::Sequence< css::uno::Any >& aArguments ) override; + void initialize( ChartController& rChartController, + const rtl::Reference<::chart::ChartModel>& xChartModel, + const rtl::Reference<::chart::ChartView>& xChartView, + const css::uno::Reference< css::accessibility::XAccessible >& xParent, + const css::uno::Reference<css::awt::XWindow>& xViewWindow ); + // used to disconnect from view + void initialize(); // ____ view::XSelectionChangeListener ____ virtual void SAL_CALL selectionChanged( const css::lang::EventObject& aEvent ) override; @@ -79,7 +83,7 @@ public: // ________ XAccessibleContext ________ virtual OUString SAL_CALL getAccessibleDescription() override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override; - virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override; virtual OUString SAL_CALL getAccessibleName() override; virtual sal_Int16 SAL_CALL getAccessibleRole() override; @@ -101,9 +105,9 @@ private: // methods css::awt::Rectangle GetWindowPosSize() const; private: // members - css::uno::WeakReference< css::view::XSelectionSupplier > m_xSelectionSupplier; - unotools::WeakReference<::chart::ChartModel> m_xChartModel; - css::uno::WeakReference< css::uno::XInterface > m_xChartView; + unotools::WeakReference< ::chart::ChartController > m_xChartController; + unotools::WeakReference< ::chart::ChartModel > m_xChartModel; + unotools::WeakReference< ChartView > m_xChartView; css::uno::WeakReference< css::awt::XWindow > m_xWindow; css::uno::WeakReference< css::accessibility::XAccessible > m_xParent; diff --git a/chart2/source/controller/inc/AccessibleTextHelper.hxx b/chart2/source/controller/inc/AccessibleTextHelper.hxx index 075fbf0f9709..85fcb83dc3e4 100644 --- a/chart2/source/controller/inc/AccessibleTextHelper.hxx +++ b/chart2/source/controller/inc/AccessibleTextHelper.hxx @@ -18,16 +18,11 @@ */ #pragma once -#include <memory> #include <comphelper/compbase.hxx> -#include <com/sun/star/lang/XInitialization.hpp> +#include <svx/AccessibleTextHelper.hxx> #include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/awt/XWindow.hpp> -// forward declaration of helper class from svx -namespace accessibility -{ -class AccessibleTextHelper; -} namespace chart { @@ -37,7 +32,6 @@ class DrawViewWrapper; namespace impl { typedef comphelper::WeakComponentImplHelper< - css::lang::XInitialization, css::accessibility::XAccessibleContext > AccessibleTextHelper_Base; } @@ -49,7 +43,6 @@ public: explicit AccessibleTextHelper( DrawViewWrapper * pDrawViewWrapper ); virtual ~AccessibleTextHelper() override; - // ____ XInitialization ____ /** Must be called at least once for this helper class to work. mandatory parameter 0: type string. This is the CID that is used to find @@ -62,24 +55,25 @@ public: mandatory parameter 2: type awt::XWindow. The Window that shows the text currently. */ - virtual void SAL_CALL initialize( - const css::uno::Sequence< css::uno::Any >& aArguments ) override; + void initialize(const OUString& aCID, + const css::uno::Reference< css::accessibility::XAccessible >& xEventSource, + const css::uno::Reference< css::awt::XWindow >& xWindow ); // ____ XAccessibleContext ____ - virtual ::sal_Int32 SAL_CALL getAccessibleChildCount() override; + virtual sal_Int64 SAL_CALL getAccessibleChildCount() override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( - ::sal_Int32 i ) override; + sal_Int64 i ) override; virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override; - virtual ::sal_Int32 SAL_CALL getAccessibleIndexInParent() override; + virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override; virtual ::sal_Int16 SAL_CALL getAccessibleRole() override; virtual OUString SAL_CALL getAccessibleDescription() override; virtual OUString SAL_CALL getAccessibleName() override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override; + virtual sal_Int64 SAL_CALL getAccessibleStateSet() override; virtual css::lang::Locale SAL_CALL getLocale() override; private: - std::unique_ptr<::accessibility::AccessibleTextHelper> m_pTextHelper; + std::optional<::accessibility::AccessibleTextHelper> m_oTextHelper; DrawViewWrapper * m_pDrawViewWrapper; }; diff --git a/chart2/source/controller/inc/AxisItemConverter.hxx b/chart2/source/controller/inc/AxisItemConverter.hxx index cbb75d2a1db6..c14ef82bd595 100644 --- a/chart2/source/controller/inc/AxisItemConverter.hxx +++ b/chart2/source/controller/inc/AxisItemConverter.hxx @@ -19,14 +19,16 @@ #pragma once #include "ItemConverter.hxx" +#include <com/sun/star/awt/Size.hpp> #include <rtl/ref.hxx> +#include <optional> #include <vector> -namespace com::sun::star::awt { struct Size; } namespace com::sun::star::beans { class XPropertySet; } namespace com::sun::star::chart2 { class XAxis; } namespace com::sun::star::chart2 { class XChartDocument; } +namespace chart { class Axis; } namespace chart { struct ExplicitIncrementData; } namespace chart { struct ExplicitScaleData; } namespace chart { class ChartModel; } @@ -44,7 +46,7 @@ public: const rtl::Reference<::chart::ChartModel> & xChartDoc, ExplicitScaleData const * pScale, ExplicitIncrementData const * pIncrement, - const css::awt::Size* pRefSize ); + const std::optional<css::awt::Size>& pRefSize ); virtual ~AxisItemConverter() override; @@ -60,8 +62,7 @@ protected: private: std::vector< std::unique_ptr<ItemConverter> > m_aConverters; - css::uno::Reference< - css::chart2::XAxis > m_xAxis; + rtl::Reference<::chart::Axis> m_xAxis; rtl::Reference<::chart::ChartModel>m_xChartDoc; diff --git a/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx b/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx index 96138e237230..65ff58ea45ab 100644 --- a/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx +++ b/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx @@ -35,8 +35,8 @@ public: CharacterPropertyItemConverter( const css::uno::Reference<css::beans::XPropertySet>& rPropertySet, SfxItemPool& rItemPool, - const css::awt::Size* pRefSize, - const OUString & rRefSizePropertyName, + const std::optional<css::awt::Size>& pRefSize, + OUString aRefSizePropertyName, const css::uno::Reference<css::beans::XPropertySet>& rRefSizePropSet = css::uno::Reference<css::beans::XPropertySet>() ); virtual ~CharacterPropertyItemConverter() override; diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx index d50800fd67ad..737d0cf3768f 100644 --- a/chart2/source/controller/inc/ChartController.hxx +++ b/chart2/source/controller/inc/ChartController.hxx @@ -19,6 +19,7 @@ #pragma once #include <LifeTime.hxx> +#include <ReferenceSizeProvider.hxx> #include "CommandDispatchContainer.hxx" #include "SelectionHelper.hxx" @@ -34,10 +35,9 @@ #include <com/sun/star/util/XModeChangeListener.hpp> #include <com/sun/star/util/XCloseListener.hpp> #include <com/sun/star/util/XModifyListener.hpp> -#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/frame/XController2.hpp> #include <com/sun/star/frame/XLayoutManagerListener.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <memory> #include <string_view> @@ -61,7 +61,6 @@ namespace com::sun::star::uno { class XComponentContext; } namespace com::sun::star::util { class XCloseable; } namespace com::sun::star::view { class XSelectionSupplier; } - class SdrModel; namespace svt @@ -83,26 +82,27 @@ namespace chart { class UndoGuard; +class ChartView; class ChartWindow; class DrawModelWrapper; class DrawViewWrapper; -class ReferenceSizeProvider; +class ViewElementListProvider; class ViewElementListProvider; class Diagram; +class AccessibleChartView; +class AccessibleTextHelper; enum ChartDrawMode { CHARTDRAW_INSERT, CHARTDRAW_SELECT }; class ChartController final : public ::cppu::WeakImplHelper < - css::frame::XController //comprehends XComponent (required interface) + css::frame::XController2 //comprehends XComponent (css::frame::XController is required interface) ,css::frame::XDispatchProvider //(required interface) ,css::view::XSelectionSupplier //(optional interface) ,css::ui::XContextMenuInterception //(optional interface) ,css::util::XCloseListener //(needed for communication with XModel) - ,css::lang::XServiceInfo ,css::frame::XDispatch ,css::awt::XWindow //this is the Window Controller part of this Controller, that will be given to a Frame via setComponent - ,css::lang::XMultiServiceFactory ,css::util::XModifyListener ,css::util::XModeChangeListener ,css::frame::XLayoutManagerListener @@ -110,16 +110,11 @@ class ChartController final : public ::cppu::WeakImplHelper < { public: ChartController() = delete; - explicit ChartController(css::uno::Reference< css::uno::XComponentContext > const & xContext); + explicit ChartController(css::uno::Reference< css::uno::XComponentContext > xContext); virtual ~ChartController() override; OUString GetContextName(); - // css::lang::XServiceInfo - virtual OUString SAL_CALL getImplementationName() override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // css::frame::XController (required interface) virtual void SAL_CALL attachFrame( const css::uno::Reference< css::frame::XFrame > & xFrame ) override; @@ -142,6 +137,12 @@ public: virtual sal_Bool SAL_CALL suspend( sal_Bool bSuspend ) override; + // css::frame::XController2 + virtual css::uno::Reference<css::awt::XWindow> SAL_CALL getComponentWindow() override; + virtual OUString SAL_CALL getViewControllerName() override; + virtual css::uno::Sequence<css::beans::PropertyValue> SAL_CALL getCreationArguments() override; + virtual css::uno::Reference<css::ui::XSidebarProvider> SAL_CALL getSidebar() override; + // css::lang::XComponent (base of XController) virtual void SAL_CALL dispose() override; @@ -262,16 +263,6 @@ public: virtual void SAL_CALL removePaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override; - // css::lang XMultiServiceFactory - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL - createInstance( const OUString& aServiceSpecifier ) override; - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL - createInstanceWithArguments( const OUString& ServiceSpecifier, - const css::uno::Sequence< - css::uno::Any >& Arguments ) override; - virtual css::uno::Sequence< OUString > SAL_CALL - getAvailableServiceNames() override; - // css::util::XModifyListener virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override; @@ -318,11 +309,21 @@ public: css::uno::Reference< css::accessibility::XAccessible > CreateAccessible(); + /** Creates a helper accessibility class that must be initialized via initialize(). For + parameters see + + The returned object should not be used directly. Instead a proxy object + should use this helper to retrieve its children and add them to its own + children. + */ + rtl::Reference< ::chart::AccessibleTextHelper > createAccessibleTextContext(); + static bool isObjectDeleteable( const css::uno::Any& rSelection ); void setDrawMode( ChartDrawMode eMode ) { m_eDrawMode = eMode; } bool isShapeContext() const; + bool IsTextEdit() const; ViewElementListProvider getViewElementListProvider(); DrawModelWrapper* GetDrawModelWrapper(); @@ -335,7 +336,7 @@ public: void NotifyUndoActionHdl( std::unique_ptr<SdrUndoAction> ); - css::uno::Reference<css::uno::XInterface> const & getChartView() const; + rtl::Reference<::chart::ChartView> const & getChartView() const { return m_xChartView; } rtl::Reference<::chart::ChartModel> getChartModel(); rtl::Reference<::chart::Diagram> getFirstDiagram(); @@ -344,7 +345,7 @@ private: class TheModel : public salhelper::SimpleReferenceObject { public: - explicit TheModel( const rtl::Reference<::chart::ChartModel> & xModel ); + explicit TheModel( rtl::Reference<::chart::ChartModel> xModel ); virtual ~TheModel() override; @@ -389,7 +390,7 @@ private: //view css::uno::Reference<css::awt::XWindow> m_xViewWindow; - css::uno::Reference<css::uno::XInterface> m_xChartView; + rtl::Reference<::chart::ChartView> m_xChartView; std::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper; std::unique_ptr<DrawViewWrapper> m_pDrawViewWrapper; @@ -420,7 +421,7 @@ private: rtl::Reference<svx::sidebar::SelectionChangeHandler> mpSelectionChangeHandler; bool impl_isDisposedOrSuspended() const; - std::unique_ptr<ReferenceSizeProvider> impl_createReferenceSizeProvider(); + ReferenceSizeProvider impl_createReferenceSizeProvider(); void impl_adaptDataSeriesAutoResize(); void impl_createDrawViewController(); @@ -430,7 +431,7 @@ private: void executeDispatch_ObjectProperties(); void executeDispatch_FormatObject( std::u16string_view rDispatchCommand ); void executeDlg_ObjectProperties( const OUString& rObjectCID ); - bool executeDlg_ObjectProperties_withoutUndoGuard( const OUString& rObjectCID, bool bSuccessOnUnchanged ); + void executeDlg_ObjectProperties_withUndoGuard( std::shared_ptr<UndoGuard> aUndoGuard, const OUString& rObjectCID, bool bSuccessOnUnchanged ); void executeDispatch_ChartType(); @@ -441,6 +442,10 @@ private: void executeDispatch_InsertAxes(); void executeDispatch_InsertGrid(); + void executeDispatch_InsertDataTable(); + void executeDispatch_DeleteDataTable(); + void executeDispatch_OpenInsertDataTableDialog(); + void executeDispatch_InsertMenu_DataLabels(); void executeDispatch_InsertMenu_Trendlines(); void executeDispatch_InsertMenu_MeanValues(); @@ -480,6 +485,8 @@ private: void executeDispatch_MoveSeries( bool bForward ); bool EndTextEdit(); + css::uno::Sequence< css::uno::Reference<css::chart2::XFormattedString >> GetFormattedTitle( + const EditTextObject& aEdit, const css::uno::Reference< css::drawing::XShape >& xShape ); void executeDispatch_View3D(); void executeDispatch_PositionAndSize( const ::css::uno::Sequence< ::css::beans::PropertyValue >* pArgs = nullptr ); @@ -500,17 +507,17 @@ private: void executeDispatch_LOKSetTextSelection(int nType, int nX, int nY); void executeDispatch_LOKPieSegmentDragging(int nOffset); void executeDispatch_FillColor(sal_uInt32 nColor); - void executeDispatch_FillGradient(OUString sJSONGradient); + void executeDispatch_FillGradient(std::u16string_view sJSONGradient); void executeDispatch_LineColor(sal_uInt32 nColor); void executeDispatch_LineWidth(sal_uInt32 nWidth); - void sendPopupRequest(OUString const & rCID, tools::Rectangle aRectangle); + void sendPopupRequest(std::u16string_view rCID, tools::Rectangle aRectangle); void impl_ShapeControllerDispatch( const css::util::URL& rURL, const css::uno::Sequence< css::beans::PropertyValue >& rArgs ); DECL_LINK( DoubleClickWaitingHdl, Timer*, void ); - void execute_DoubleClick( const Point* pMousePixel ); + void execute_DoubleClick( const Point* pMousePixel, bool &bEditText ); void startDoubleClickWaiting(); void stopDoubleClickWaiting(); @@ -518,7 +525,7 @@ private: void impl_notifySelectionChangeListeners(); void impl_invalidateAccessible(); void impl_initializeAccessible(); - void impl_initializeAccessible( const css::uno::Reference< css::lang::XInitialization >& xInit ); + void impl_initializeAccessible( AccessibleChartView& xInit ); //sets the model member to null if it equals the parameter //returns true if successful @@ -532,20 +539,10 @@ private: /// @return </sal_True>, if resize/move was successful bool impl_moveOrResizeObject( const OUString & rCID, eMoveOrResizeType eType, double fAmountLogicX, double fAmountLogicY ); - bool impl_DragDataPoint( const OUString & rCID, double fOffset ); + bool impl_DragDataPoint( std::u16string_view rCID, double fOffset ); static const o3tl::sorted_vector< OUString >& impl_getAvailableCommands(); - /** Creates a helper accessibility class that must be initialized via XInitialization. For - parameters see - - The returned object should not be used directly. Instead a proxy object - should use this helper to retrieve its children and add them to its own - children. - */ - css::uno::Reference< css::accessibility::XAccessibleContext > - impl_createAccessibleTextContext(); - void impl_PasteGraphic( css::uno::Reference< css::graphic::XGraphic > const & xGraphic, const ::Point & aPosition ); void impl_PasteShapes( SdrModel* pModel ); diff --git a/chart2/source/controller/inc/ChartDocumentWrapper.hxx b/chart2/source/controller/inc/ChartDocumentWrapper.hxx index 04f76d705b6b..a5bded3c8fb7 100644 --- a/chart2/source/controller/inc/ChartDocumentWrapper.hxx +++ b/chart2/source/controller/inc/ChartDocumentWrapper.hxx @@ -139,6 +139,10 @@ protected: virtual std::vector< std::unique_ptr<WrappedProperty> > createWrappedProperties() override; virtual css::uno::Reference< css::beans::XPropertySet > getInnerPropertySet() override; + // ____ XPropertySet ____ + virtual void SAL_CALL setPropertyValue(const OUString& rPropertyName, + const css::uno::Any& rValue) override; + private: //methods void impl_resetAddIn(); diff --git a/chart2/source/controller/inc/ChartWindow.hxx b/chart2/source/controller/inc/ChartWindow.hxx index 4ab65ddd959e..918805cb3a8a 100644 --- a/chart2/source/controller/inc/ChartWindow.hxx +++ b/chart2/source/controller/inc/ChartWindow.hxx @@ -53,15 +53,8 @@ public: virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; virtual void RequestHelp( const HelpEvent& rHEvt ) override; - /// For LibreOfficeKit, we need to route these to the mouse events. - virtual void LogicMouseButtonDown(const MouseEvent&) override; - virtual void LogicMouseButtonUp(const MouseEvent&) override; - virtual void LogicMouseMove(const MouseEvent&) override; - void ForceInvalidate(); - virtual void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE ) override; - virtual void Invalidate( const tools::Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE ) override; - virtual void Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags = InvalidateFlags::NONE ) override; + virtual void ImplInvalidate( const vcl::Region* rRegion, InvalidateFlags nFlags ) override; /// Notify the LOK client about an invalidated area. virtual void LogicInvalidate( const tools::Rectangle* pRectangle ) override; diff --git a/chart2/source/controller/inc/ConfigurationAccess.hxx b/chart2/source/controller/inc/ConfigurationAccess.hxx deleted file mode 100644 index 2fb4636d2217..000000000000 --- a/chart2/source/controller/inc/ConfigurationAccess.hxx +++ /dev/null @@ -1,38 +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 . - */ - -#pragma once - -#include <tools/fldunit.hxx> - -namespace chart::ConfigurationAccess -{ -/** @descr Retrieve the FieldUnit to be used for the UI. This unit is retrieved - from the registry settings of the Calc application. - - If this setting can not be found there is a fallback to cm which is the most - common setting worldwide (or not?) - - @return the FieldUnit enum. See <vcl/fldunit.hxx> for definition - */ -FieldUnit getFieldUnit(); - -} //namespace chart - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx index 1cba4854d890..720cc0fef2e7 100644 --- a/chart2/source/controller/inc/DataPointItemConverter.hxx +++ b/chart2/source/controller/inc/DataPointItemConverter.hxx @@ -20,18 +20,19 @@ #include "ItemConverter.hxx" #include "GraphicPropertyItemConverter.hxx" +#include <com/sun/star/awt/Size.hpp> #include <com/sun/star/uno/Sequence.h> #include <tools/color.hxx> #include <rtl/ref.hxx> - +#include <optional> #include <vector> -namespace com::sun::star::awt { struct Size; } namespace com::sun::star::chart2 { class XDataSeries; } namespace com::sun::star::frame { class XModel; } namespace com::sun::star::uno { class XComponentContext; } namespace chart { class ChartModel; } +namespace chart { class DataSeries; } class SdrModel; namespace chart::wrapper { @@ -43,12 +44,12 @@ public: const rtl::Reference<::chart::ChartModel>& xChartModel, const css::uno::Reference<css::uno::XComponentContext>& xContext, const css::uno::Reference<css::beans::XPropertySet>& rPropertySet, - const css::uno::Reference<css::chart2::XDataSeries>& xSeries, + const rtl::Reference<::chart::DataSeries>& xSeries, SfxItemPool& rItemPool, SdrModel& rDrawModel, const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory, GraphicObjectType eMapTo, - const css::awt::Size* pRefSize = nullptr, + const std::optional<css::awt::Size>& pRefSize = std::nullopt, bool bDataSeries = false, bool bUseSpecialFillColor = false, sal_Int32 nSpecialFillColor = 0, @@ -81,7 +82,7 @@ private: bool m_bForbidPercentValue; bool m_bHideLegendEntry; sal_Int32 m_nPointIndex; - css::uno::Reference<css::chart2::XDataSeries> m_xSeries; + rtl::Reference<::chart::DataSeries> m_xSeries; }; } diff --git a/chart2/source/controller/inc/DataTableItemConverter.hxx b/chart2/source/controller/inc/DataTableItemConverter.hxx new file mode 100644 index 000000000000..f3809632f8a5 --- /dev/null +++ b/chart2/source/controller/inc/DataTableItemConverter.hxx @@ -0,0 +1,56 @@ +/* -*- 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/. + */ + +#pragma once + +#include "ItemConverter.hxx" +#include <rtl/ref.hxx> +#include <vector> + +namespace com::sun::star::awt +{ +struct Size; +} +namespace com::sun::star::beans +{ +class XPropertySet; +} +namespace chart +{ +class ChartModel; +} + +class SdrModel; + +namespace chart::wrapper +{ +/** Convert data table properties to and from ItemSet and UNO PropertySet */ +class DataTableItemConverter final : public ItemConverter +{ +public: + DataTableItemConverter(const css::uno::Reference<css::beans::XPropertySet>& rPropertySet, + SfxItemPool& rItemPool, SdrModel& rDrawModel, + const rtl::Reference<::chart::ChartModel>& xChartDoc); + + virtual ~DataTableItemConverter() override; + + virtual void FillItemSet(SfxItemSet& rOutItemSet) const override; + virtual bool ApplyItemSet(const SfxItemSet& rItemSet) override; + +protected: + virtual const WhichRangesContainer& GetWhichPairs() const override; + virtual bool GetItemProperty(tWhichIdType nWhichId, + tPropertyNameWithMemberId& rOutProperty) const override; + +private: + std::vector<std::unique_ptr<ItemConverter>> m_aConverters; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/inc/ErrorBarItemConverter.hxx b/chart2/source/controller/inc/ErrorBarItemConverter.hxx index 997bda7d269e..a53fbe18ef60 100644 --- a/chart2/source/controller/inc/ErrorBarItemConverter.hxx +++ b/chart2/source/controller/inc/ErrorBarItemConverter.hxx @@ -33,7 +33,7 @@ class ErrorBarItemConverter final : public ItemConverter { public: ErrorBarItemConverter( - const css::uno::Reference< css::frame::XModel > & xChartModel, + css::uno::Reference< css::frame::XModel > xChartModel, const css::uno::Reference< css::beans::XPropertySet > & rPropertySet, SfxItemPool& rItemPool, SdrModel& rDrawModel, diff --git a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx index 234e50751ab6..9d119d53ca3a 100644 --- a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx +++ b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx @@ -42,7 +42,7 @@ public: const css::uno::Reference< css::beans::XPropertySet > & rPropertySet, SfxItemPool& rItemPool, SdrModel& rDrawModel, - const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory, + css::uno::Reference< css::lang::XMultiServiceFactory > xNamedPropertyContainerFactory, GraphicObjectType eObjectType ); virtual ~GraphicPropertyItemConverter() override; diff --git a/chart2/source/controller/inc/ItemConverter.hxx b/chart2/source/controller/inc/ItemConverter.hxx index 865268a3abf9..031a633c22d8 100644 --- a/chart2/source/controller/inc/ItemConverter.hxx +++ b/chart2/source/controller/inc/ItemConverter.hxx @@ -73,7 +73,7 @@ public: reading/writing converted items */ ItemConverter( - const css::uno::Reference< css::beans::XPropertySet > & rPropertySet , + css::uno::Reference< css::beans::XPropertySet > xPropertySet , SfxItemPool& rItemPool ); virtual ~ItemConverter() override; diff --git a/chart2/source/controller/inc/LegendItemConverter.hxx b/chart2/source/controller/inc/LegendItemConverter.hxx index 3e9315acc20d..cbb657edf0d3 100644 --- a/chart2/source/controller/inc/LegendItemConverter.hxx +++ b/chart2/source/controller/inc/LegendItemConverter.hxx @@ -19,10 +19,10 @@ #pragma once #include "ItemConverter.hxx" - +#include <com/sun/star/awt/Size.hpp> +#include <optional> #include <vector> -namespace com::sun::star::awt { struct Size; } namespace com::sun::star::lang { class XMultiServiceFactory; } class SdrModel; @@ -38,7 +38,7 @@ public: SfxItemPool& rItemPool, SdrModel& rDrawModel, const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory, - const css::awt::Size* pRefSize ); + const std::optional<css::awt::Size>& pRefSize ); virtual ~LegendItemConverter() override; diff --git a/chart2/source/controller/inc/MultipleChartConverters.hxx b/chart2/source/controller/inc/MultipleChartConverters.hxx index 4fe1bb1de066..8fc9f33b4367 100644 --- a/chart2/source/controller/inc/MultipleChartConverters.hxx +++ b/chart2/source/controller/inc/MultipleChartConverters.hxx @@ -19,9 +19,10 @@ #pragma once #include "MultipleItemConverter.hxx" +#include <com/sun/star/awt/Size.hpp> #include <rtl/ref.hxx> +#include <optional> -namespace com::sun::star::awt { struct Size; } namespace com::sun::star::frame { class XModel; } namespace com::sun::star::lang { class XMultiServiceFactory; } namespace chart { class ChartModel; } @@ -36,7 +37,7 @@ public: const rtl::Reference<::chart::ChartModel> & xChartModel, SfxItemPool& rItemPool, SdrModel& rDrawModel, - const css::awt::Size* pRefSize ); + const std::optional<css::awt::Size>& pRefSize ); virtual ~AllAxisItemConverter() override; diff --git a/chart2/source/controller/inc/ObjectHierarchy.hxx b/chart2/source/controller/inc/ObjectHierarchy.hxx index d8f7747e8bc6..1531866aaf2b 100644 --- a/chart2/source/controller/inc/ObjectHierarchy.hxx +++ b/chart2/source/controller/inc/ObjectHierarchy.hxx @@ -18,6 +18,7 @@ */ #pragma once +#include <ChartModel.hxx> #include <ObjectIdentifier.hxx> #include <map> #include <vector> @@ -51,11 +52,10 @@ public: static bool isRootNode( const ObjectIdentifier& rOID ); /// equal to getChildren( getRootNodeOID()) - const tChildContainer & getTopLevelChildren() const; - bool hasChildren( const ObjectIdentifier& rParent ) const; - const tChildContainer & getChildren( const ObjectIdentifier& rParent ) const; - - const tChildContainer & getSiblings( const ObjectIdentifier& rNode ) const; + const tChildContainer& getTopLevelChildren() const; + bool hasChildren(const ObjectIdentifier& rParent) const; + const tChildContainer& getChildren(const ObjectIdentifier& rParent) const; + const tChildContainer& getSiblings(const ObjectIdentifier& rNode) const; /// The result is empty, if the node cannot be found in the tree ObjectIdentifier getParent( const ObjectIdentifier& rNode ) const; @@ -65,30 +65,29 @@ public: private: void createTree( const rtl::Reference<::chart::ChartModel> & xChartDocument ); void createAxesTree( - ObjectHierarchy::tChildContainer & rContainer, + tChildContainer & rContainer, const rtl::Reference<::chart::ChartModel> & xChartDoc, - const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); + const rtl::Reference< ::chart::Diagram > & xDiagram ); void createDiagramTree( - ObjectHierarchy::tChildContainer& rContainer, + tChildContainer& rContainer, const rtl::Reference<::chart::ChartModel>& xChartDoc, - const css::uno::Reference< css::chart2::XDiagram >& xDiagram ); + const rtl::Reference< ::chart::Diagram >& xDiagram ); void createDataSeriesTree( - ObjectHierarchy::tChildContainer & rOutDiagramSubContainer, - const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); + tChildContainer & rOutDiagramSubContainer, + const rtl::Reference< ::chart::Diagram > & xDiagram ); static void createWallAndFloor( - ObjectHierarchy::tChildContainer & rContainer, - const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); + tChildContainer & rContainer, + const rtl::Reference< ::chart::Diagram > & xDiagram ); void createLegendTree( - ObjectHierarchy::tChildContainer & rContainer, + tChildContainer & rContainer, const rtl::Reference<::chart::ChartModel> & xChartDoc, - const css::uno::Reference< css::chart2::XDiagram > & xDiagram ); - void createAdditionalShapesTree( ObjectHierarchy::tChildContainer& rContainer ); + const rtl::Reference< ::chart::Diagram > & xDiagram ); + void createAdditionalShapesTree(tChildContainer& rContainer); ObjectIdentifier getParentImpl( const ObjectIdentifier& rParentOID, const ObjectIdentifier& rOID ) const; - typedef std::map< ObjectIdentifier, ObjectHierarchy::tChildContainer > - tChildMap; + typedef std::map<ObjectIdentifier, tChildContainer> tChildMap; tChildMap m_aChildMap; ExplicitValueProvider* m_pExplicitValueProvider; bool m_bFlattenDiagram; @@ -98,8 +97,8 @@ private: class ObjectKeyNavigation { public: - explicit ObjectKeyNavigation( const ObjectIdentifier & rCurrentOID, - const rtl::Reference<::chart::ChartModel> & xChartDocument, + explicit ObjectKeyNavigation( ObjectIdentifier aCurrentOID, + rtl::Reference<::chart::ChartModel> xChartDocument, ExplicitValueProvider * pExplicitValueProvider ); bool handleKeyEvent( const css::awt::KeyEvent & rEvent ); diff --git a/chart2/source/controller/inc/ObjectNameProvider.hxx b/chart2/source/controller/inc/ObjectNameProvider.hxx index 276e58977d35..c613dd5ce855 100644 --- a/chart2/source/controller/inc/ObjectNameProvider.hxx +++ b/chart2/source/controller/inc/ObjectNameProvider.hxx @@ -35,33 +35,33 @@ class ObjectNameProvider { public: static OUString getName( ObjectType eObjectType, bool bPlural=false ); - static OUString getAxisName( const OUString& rObjectCID + static OUString getAxisName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); - static OUString getGridName( const OUString& rObjectCID + static OUString getGridName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); - static OUString getTitleName( const OUString& rObjectCID + static OUString getTitleName( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); static OUString getTitleNameByType( TitleHelper::eTitleType eType ); static OUString getNameForCID( - const OUString& rObjectCID, + std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ); static OUString getName_ObjectForSeries( ObjectType eObjectType, - const OUString& rSeriesCID, + std::u16string_view rSeriesCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ); static OUString getName_ObjectForAllSeries( ObjectType eObjectType ); /** Provides help texts for the various chart elements. The parameter rObjectCID has to be a ClassifiedIdentifier - see class ObjectIdentifier. */ - static OUString getHelpText( const OUString& rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose=false ); + static OUString getHelpText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartModel, bool bVerbose=false ); /** This is used for showing the currently selected object in the status bar (command "Context") */ - static OUString getSelectedObjectText( const OUString & rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ); + static OUString getSelectedObjectText( std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel>& xChartDocument ); }; } //namespace chart diff --git a/chart2/source/controller/inc/PositionAndSizeHelper.hxx b/chart2/source/controller/inc/PositionAndSizeHelper.hxx index f70ccf302f6d..0f79373d52f9 100644 --- a/chart2/source/controller/inc/PositionAndSizeHelper.hxx +++ b/chart2/source/controller/inc/PositionAndSizeHelper.hxx @@ -36,7 +36,7 @@ public: , const css::awt::Rectangle& rOldPositionAndSize , const css::awt::Rectangle& rPageRectangle ); - static bool moveObject( const OUString& rObjectCID + static bool moveObject( std::u16string_view rObjectCID , const rtl::Reference<::chart::ChartModel>& xChartModel , const css::awt::Rectangle& rNewPositionAndSize , const css::awt::Rectangle& rOldPositionAndSize diff --git a/chart2/source/controller/inc/RangeSelectionHelper.hxx b/chart2/source/controller/inc/RangeSelectionHelper.hxx index 02db335a1fc0..36fe0db99cce 100644 --- a/chart2/source/controller/inc/RangeSelectionHelper.hxx +++ b/chart2/source/controller/inc/RangeSelectionHelper.hxx @@ -42,7 +42,7 @@ class RangeSelectionHelper { public: explicit RangeSelectionHelper( - const rtl::Reference<::chart::ChartModel> & xChartDocument ); + rtl::Reference<::chart::ChartModel> xChartDocument ); ~RangeSelectionHelper(); bool hasRangeSelection(); diff --git a/chart2/source/controller/inc/RangeSelectionListener.hxx b/chart2/source/controller/inc/RangeSelectionListener.hxx index 29bea261c820..9117b4d9b2fc 100644 --- a/chart2/source/controller/inc/RangeSelectionListener.hxx +++ b/chart2/source/controller/inc/RangeSelectionListener.hxx @@ -47,7 +47,7 @@ class RangeSelectionListener final { public: explicit RangeSelectionListener( - RangeSelectionListenerParent& rParent, const OUString& rInitialRange, + RangeSelectionListenerParent& rParent, OUString aInitialRange, const rtl::Reference<::chart::ChartModel>& xModelToLockController); virtual ~RangeSelectionListener() override; diff --git a/chart2/source/controller/inc/RegressionCurveItemConverter.hxx b/chart2/source/controller/inc/RegressionCurveItemConverter.hxx index 63c296a3e3b1..8c4262b55ec5 100644 --- a/chart2/source/controller/inc/RegressionCurveItemConverter.hxx +++ b/chart2/source/controller/inc/RegressionCurveItemConverter.hxx @@ -19,10 +19,11 @@ #pragma once #include "ItemConverter.hxx" +#include <rtl/ref.hxx> namespace com::sun::star::chart2 { class XRegressionCurveContainer; } namespace com::sun::star::lang { class XMultiServiceFactory; } - +namespace chart { class DataSeries; } class SdrModel; namespace chart::wrapper @@ -33,7 +34,7 @@ class RegressionCurveItemConverter final : public ItemConverter public: RegressionCurveItemConverter( const css::uno::Reference< css::beans::XPropertySet > & rPropertySet, - const css::uno::Reference< css::chart2::XRegressionCurveContainer > & xRegCurveCnt, + rtl::Reference< ::chart::DataSeries > xRegCurveCnt, SfxItemPool& rItemPool, SdrModel& rDrawModel, const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory ); @@ -51,7 +52,7 @@ protected: private: std::shared_ptr< ItemConverter > m_spGraphicConverter; - css::uno::Reference< css::chart2::XRegressionCurveContainer > m_xCurveContainer; + rtl::Reference< ::chart::DataSeries > m_xCurveContainer; }; } // namespace chart::wrapper diff --git a/chart2/source/controller/inc/RegressionEquationItemConverter.hxx b/chart2/source/controller/inc/RegressionEquationItemConverter.hxx index 0b32e4b9ed7c..83394b1ea45d 100644 --- a/chart2/source/controller/inc/RegressionEquationItemConverter.hxx +++ b/chart2/source/controller/inc/RegressionEquationItemConverter.hxx @@ -19,10 +19,10 @@ #pragma once #include "ItemConverter.hxx" - +#include <com/sun/star/awt/Size.hpp> +#include <optional> #include <vector> -namespace com::sun::star::awt { struct Size; } namespace com::sun::star::beans { class XPropertySet; } namespace com::sun::star::lang { class XMultiServiceFactory; } @@ -38,7 +38,7 @@ public: SfxItemPool& rItemPool, SdrModel& rDrawModel, const css::uno::Reference< css::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory, - const css::awt::Size* pRefSize ); + const std::optional<css::awt::Size>& pRefSize ); virtual ~RegressionEquationItemConverter() override; diff --git a/chart2/source/controller/inc/SelectionHelper.hxx b/chart2/source/controller/inc/SelectionHelper.hxx index ae241d61ab42..119640bd4300 100644 --- a/chart2/source/controller/inc/SelectionHelper.hxx +++ b/chart2/source/controller/inc/SelectionHelper.hxx @@ -39,6 +39,7 @@ public: //methods bool isResizeableObjectSelected() const; bool isRotateableObjectSelected( const rtl::Reference<::chart::ChartModel>& xChartModel ) const; + bool isTitleObjectSelected() const; bool isDragableObjectSelected() const; bool isAdditionalShapeSelected() const; @@ -92,7 +93,7 @@ public: DrawViewWrapper const & rDrawViewWrapper, bool bGetDiagramInsteadOf_Wall=false ); - static bool isRotateableObject( const OUString& rCID + static bool isRotateableObject( std::u16string_view rCID , const rtl::Reference<::chart::ChartModel>& xChartModel ); explicit SelectionHelper( SdrObject* pSelectedObj ); diff --git a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx index c658b08fa7dc..b55457ac5b30 100644 --- a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx +++ b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx @@ -26,6 +26,8 @@ namespace com::sun::star::chart2 { class XCoordinateSystem; } namespace com::sun::star::frame { class XModel; } namespace com::sun::star::uno { class XComponentContext; } namespace chart { class ChartModel; } +namespace chart { class BaseCoordinateSystem; } +namespace chart { class DataSeries; } namespace chart::wrapper { @@ -35,8 +37,8 @@ class SeriesOptionsItemConverter final : public ItemConverter public: SeriesOptionsItemConverter( const rtl::Reference<::chart::ChartModel> & xChartModel, - const css::uno::Reference< css::uno::XComponentContext > & xContext, - const css::uno::Reference< css::beans::XPropertySet > & rPropertySet, + css::uno::Reference< css::uno::XComponentContext > xContext, + const rtl::Reference<::chart::DataSeries> & rPropertySet, SfxItemPool& rItemPool ); virtual ~SeriesOptionsItemConverter() override; @@ -66,7 +68,7 @@ private: sal_Int32 m_nStartingAngle; bool m_bClockwise; - css::uno::Reference< css::chart2::XCoordinateSystem > m_xCooSys; + rtl::Reference< ::chart::BaseCoordinateSystem > m_xCooSys; css::uno::Sequence< sal_Int32 > m_aSupportedMissingValueTreatments; sal_Int32 m_nMissingValueTreatment; diff --git a/chart2/source/controller/inc/ShapeController.h b/chart2/source/controller/inc/ShapeController.h deleted file mode 100644 index 392c28d2fe4c..000000000000 --- a/chart2/source/controller/inc/ShapeController.h +++ /dev/null @@ -1,38 +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 . - */ -#ifndef CHART_SHAPECONTROLLER_H -#define CHART_SHAPECONTROLLER_H - -//Command Ids: -#define COMMAND_ID_FORMAT_LINE 1 -#define COMMAND_ID_FORMAT_AREA 2 -#define COMMAND_ID_TEXT_ATTRIBUTES 3 -#define COMMAND_ID_TRANSFORM_DIALOG 4 -#define COMMAND_ID_OBJECT_TITLE_DESCRIPTION 5 -#define COMMAND_ID_RENAME_OBJECT 6 -#define COMMAND_ID_BRING_TO_FRONT 8 -#define COMMAND_ID_FORWARD 9 -#define COMMAND_ID_BACKWARD 10 -#define COMMAND_ID_SEND_TO_BACK 11 -#define COMMAND_ID_FONT_DIALOG 15 -#define COMMAND_ID_PARAGRAPH_DIALOG 16 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/inc/StatisticsItemConverter.hxx b/chart2/source/controller/inc/StatisticsItemConverter.hxx index b82c1c230ae8..a6c56a2691e7 100644 --- a/chart2/source/controller/inc/StatisticsItemConverter.hxx +++ b/chart2/source/controller/inc/StatisticsItemConverter.hxx @@ -31,7 +31,7 @@ class StatisticsItemConverter final : public ItemConverter { public: StatisticsItemConverter( - const rtl::Reference<::chart::ChartModel> & xChartModel, + rtl::Reference<::chart::ChartModel> xChartModel, const css::uno::Reference< css::beans::XPropertySet > & rPropertySet, SfxItemPool& rItemPool ); virtual ~StatisticsItemConverter() override; diff --git a/chart2/source/controller/inc/TabPageNotifiable.hxx b/chart2/source/controller/inc/TabPageNotifiable.hxx index 440cda2de9aa..c0b53972e546 100644 --- a/chart2/source/controller/inc/TabPageNotifiable.hxx +++ b/chart2/source/controller/inc/TabPageNotifiable.hxx @@ -18,6 +18,8 @@ */ #pragma once +#include <sal/types.h> + // color to use as foreground for an invalid range #define RANGE_SELECTION_INVALID_RANGE_FOREGROUND_COLOR COL_WHITE // color to use as background for an invalid range @@ -27,7 +29,7 @@ class BuilderPage; namespace chart { -class TabPageNotifiable +class SAL_LOPLUGIN_ANNOTATE("crosscast") TabPageNotifiable { public: virtual void setInvalidPage(BuilderPage* pTabPage) = 0; diff --git a/chart2/source/controller/inc/TextLabelItemConverter.hxx b/chart2/source/controller/inc/TextLabelItemConverter.hxx index d44138332798..cb5406cf6a01 100644 --- a/chart2/source/controller/inc/TextLabelItemConverter.hxx +++ b/chart2/source/controller/inc/TextLabelItemConverter.hxx @@ -20,14 +20,16 @@ #include "ItemConverter.hxx" +#include <com/sun/star/awt/Size.hpp> #include <com/sun/star/uno/Sequence.h> #include <rtl/ref.hxx> +#include <optional> #include <vector> -namespace com::sun::star::awt { struct Size; } namespace com::sun::star::chart2 { class XDataSeries; } namespace com::sun::star::frame { class XModel; } namespace chart { class ChartModel; } +namespace chart { class DataSeries; } namespace chart::wrapper { @@ -37,9 +39,9 @@ public: TextLabelItemConverter( const rtl::Reference<::chart::ChartModel>& xChartModel, const css::uno::Reference<css::beans::XPropertySet>& rPropertySet, - const css::uno::Reference<css::chart2::XDataSeries>& xSeries, + const rtl::Reference<::chart::DataSeries>& xSeries, SfxItemPool& rItemPool, - const css::awt::Size* pRefSize, + const std::optional<css::awt::Size>& pRefSize, bool bDataSeries, sal_Int32 nNumberFormat, sal_Int32 nPercentNumberFormat ); @@ -65,7 +67,7 @@ private: bool mbDataSeries:1; bool mbForbidPercentValue:1; - css::uno::Reference<css::chart2::XDataSeries> m_xSeries; + rtl::Reference<::chart::DataSeries> m_xSeries; }; } diff --git a/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx b/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx index 4952e112db88..49541b1552d4 100644 --- a/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx +++ b/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx @@ -19,7 +19,6 @@ #pragma once -#include <com/sun/star/uno/Reference.h> #include <vcl/timer.hxx> #include <rtl/ref.hxx> @@ -41,7 +40,7 @@ class ChartModel; class TimerTriggeredControllerLock final { public: - TimerTriggeredControllerLock(const rtl::Reference<::chart::ChartModel>& xModel); + TimerTriggeredControllerLock(rtl::Reference<::chart::ChartModel> xModel); ~TimerTriggeredControllerLock(); void startTimer(); diff --git a/chart2/source/controller/inc/TitleDialogData.hxx b/chart2/source/controller/inc/TitleDialogData.hxx index 5f398f34a1f0..123ae9d6d65f 100644 --- a/chart2/source/controller/inc/TitleDialogData.hxx +++ b/chart2/source/controller/inc/TitleDialogData.hxx @@ -19,7 +19,6 @@ #pragma once #include <ReferenceSizeProvider.hxx> -#include <memory> #include <com/sun/star/uno/Sequence.hxx> #include <rtl/ref.hxx> @@ -35,9 +34,9 @@ struct TitleDialogData css::uno::Sequence< sal_Bool > aPossibilityList; css::uno::Sequence< sal_Bool > aExistenceList; css::uno::Sequence< OUString > aTextList; - std::unique_ptr< ReferenceSizeProvider > apReferenceSizeProvider; + std::optional< ReferenceSizeProvider > apReferenceSizeProvider; - TitleDialogData(std::unique_ptr<ReferenceSizeProvider> pReferenzeSizeProvider = nullptr); + TitleDialogData(std::optional<ReferenceSizeProvider> pReferenzeSizeProvider = std::nullopt); void readFromModel( const rtl::Reference<::chart::ChartModel>& xChartModel ); /* return true if anything has changed; @@ -45,7 +44,7 @@ struct TitleDialogData */ bool writeDifferenceToModel( const rtl::Reference<::chart::ChartModel>& xChartModel , const css::uno::Reference< css::uno::XComponentContext >& xContext - , TitleDialogData* pOldState=nullptr ); + , const TitleDialogData* pOldState=nullptr ); }; } //namespace chart diff --git a/chart2/source/controller/inc/TitleItemConverter.hxx b/chart2/source/controller/inc/TitleItemConverter.hxx index 5a2686d62814..4a306b690363 100644 --- a/chart2/source/controller/inc/TitleItemConverter.hxx +++ b/chart2/source/controller/inc/TitleItemConverter.hxx @@ -20,9 +20,10 @@ #include "ItemConverter.hxx" +#include <com/sun/star/awt/Size.hpp> +#include <optional> #include <vector> -namespace com::sun::star::awt { struct Size; } namespace com::sun::star::lang { class XMultiServiceFactory; } class SdrModel; @@ -36,7 +37,7 @@ public: const css::uno::Reference<css::beans::XPropertySet>& rPropertySet, SfxItemPool& rItemPool, SdrModel& rDrawModel, const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory, - const css::awt::Size* pRefSize ); + const std::optional<css::awt::Size>& pRefSize ); virtual ~TitleItemConverter() override; diff --git a/chart2/source/controller/inc/dlg_ChartType.hxx b/chart2/source/controller/inc/dlg_ChartType.hxx index 7520869e86c4..02e6ac998bbc 100644 --- a/chart2/source/controller/inc/dlg_ChartType.hxx +++ b/chart2/source/controller/inc/dlg_ChartType.hxx @@ -34,7 +34,7 @@ class ChartTypeTabPage; class ChartTypeDialog final : public weld::GenericDialogController { public: - ChartTypeDialog(weld::Window* pWindow, const rtl::Reference<::chart::ChartModel>& xChartModel); + ChartTypeDialog(weld::Window* pWindow, rtl::Reference<::chart::ChartModel> xChartModel); virtual ~ChartTypeDialog() override; private: diff --git a/chart2/source/controller/inc/dlg_CreationWizard.hxx b/chart2/source/controller/inc/dlg_CreationWizard.hxx index a0fcc9dae6f9..1b782632f4d3 100644 --- a/chart2/source/controller/inc/dlg_CreationWizard.hxx +++ b/chart2/source/controller/inc/dlg_CreationWizard.hxx @@ -37,7 +37,6 @@ class XComponentContext; } using vcl::WizardTypes::WizardState; -using vcl::WizardTypes::CommitPageReason; namespace chart { @@ -49,7 +48,7 @@ class CreationWizard final : public vcl::RoadmapWizardMachine, public TabPageNot { public: CreationWizard(weld::Window* pParent, const rtl::Reference<::chart::ChartModel>& xChartModel, - const css::uno::Reference<css::uno::XComponentContext>& xContext); + css::uno::Reference<css::uno::XComponentContext> xContext); CreationWizard() = delete; virtual ~CreationWizard() override; diff --git a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx index 7e1792f087f1..89b8cb5a08f2 100644 --- a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx +++ b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx @@ -53,7 +53,7 @@ class CreationWizardUnoDlg final : public cppu::BaseMutex public: CreationWizardUnoDlg() = delete; - CreationWizardUnoDlg( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + CreationWizardUnoDlg( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~CreationWizardUnoDlg() override; // XInterface diff --git a/chart2/source/controller/inc/dlg_DataEditor.hxx b/chart2/source/controller/inc/dlg_DataEditor.hxx index 5156e0831b45..205e822a12a5 100644 --- a/chart2/source/controller/inc/dlg_DataEditor.hxx +++ b/chart2/source/controller/inc/dlg_DataEditor.hxx @@ -40,7 +40,7 @@ class DataEditor final : public weld::GenericDialogController { public: DataEditor(weld::Window* pParent, - const rtl::Reference<::chart::ChartModel> & xChartDoc, + rtl::Reference<::chart::ChartModel> xChartDoc, const css::uno::Reference<css::uno::XComponentContext> & xContext); virtual ~DataEditor() override; @@ -63,7 +63,7 @@ private: VclPtr<DataBrowser> m_xBrwData; /// handles actions of the toolbox - DECL_LINK( ToolboxHdl, const OString&, void ); + DECL_LINK( ToolboxHdl, const OUString&, void ); /// is called, if the cursor of the table has moved DECL_LINK( BrowserCursorMovedHdl, DataBrowser*, void); }; diff --git a/chart2/source/controller/inc/dlg_DataSource.hxx b/chart2/source/controller/inc/dlg_DataSource.hxx index 97eb659c7052..166131e30ec9 100644 --- a/chart2/source/controller/inc/dlg_DataSource.hxx +++ b/chart2/source/controller/inc/dlg_DataSource.hxx @@ -41,8 +41,7 @@ class DataSourceDialog final : public: explicit DataSourceDialog( weld::Window * pParent, - const rtl::Reference<::chart::ChartModel> & xChartDocument, - const css::uno::Reference< css::uno::XComponentContext > & xContext ); + const rtl::Reference<::chart::ChartModel> & xChartDocument ); virtual ~DataSourceDialog() override; // from GenericDialogController base @@ -53,8 +52,8 @@ public: virtual void setValidPage( BuilderPage * pTabPage ) override; private: - DECL_LINK(ActivatePageHdl, const OString&, void); - DECL_LINK(DeactivatePageHdl, const OString&, bool); + DECL_LINK(ActivatePageHdl, const OUString&, void); + DECL_LINK(DeactivatePageHdl, const OUString&, bool); std::unique_ptr< ChartTypeTemplateProvider > m_apDocTemplateProvider; std::unique_ptr< DialogModel > m_apDialogModel; diff --git a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx index b69ab70f64f3..2b265c7d6541 100644 --- a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx +++ b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx @@ -38,7 +38,6 @@ struct InsertAxisOrGridDialogData \************************************************************************/ class SchAxisDlg : public weld::GenericDialogController { -protected: std::unique_ptr<weld::CheckButton> m_xCbPrimaryX; std::unique_ptr<weld::CheckButton> m_xCbPrimaryY; std::unique_ptr<weld::CheckButton> m_xCbPrimaryZ; diff --git a/chart2/source/controller/inc/dlg_InsertDataTable.hxx b/chart2/source/controller/inc/dlg_InsertDataTable.hxx new file mode 100644 index 000000000000..cd77099864c4 --- /dev/null +++ b/chart2/source/controller/inc/dlg_InsertDataTable.hxx @@ -0,0 +1,52 @@ +/* -*- 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/. + */ + +#pragma once + +#include <vcl/weld.hxx> +#include "res_DataTableProperties.hxx" + +namespace chart +{ +/** The data table properties (data) used by the dialog */ +struct DataTableDialogData +{ + bool mbShow = true; + bool mbHorizontalBorders = false; + bool mbVerticalBorders = false; + bool mbOutline = false; + bool mbKeys = false; +}; + +/** The dialog to change the data table specific properties */ +class InsertDataTableDialog final : public weld::GenericDialogController +{ +private: + DataTablePropertiesResources m_aDataTablePropertiesResources; + std::unique_ptr<weld::CheckButton> m_xCbShowDataTable; + + DataTableDialogData m_aData; + + DECL_LINK(ShowDataTableToggle, weld::Toggleable&, void); + + void changeEnabled(); + +public: + InsertDataTableDialog(weld::Window* pParent); + + /** Set the initial state of the data table properties */ + void init(DataTableDialogData const& rData); + + /** Get the state of the data table properties from the dialog */ + DataTableDialogData& getDataTableDialogData(); +}; + +} //namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx index e68036153c10..4f8e8d094a34 100644 --- a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx +++ b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx @@ -31,6 +31,8 @@ class XModel; namespace chart { +class ChartView; + class InsertErrorBarsDialog final : public weld::GenericDialogController { public: @@ -40,10 +42,10 @@ public: void SetAxisMinorStepWidthForErrorBarDecimals(double fMinorStepWidth); - static double getAxisMinorStepWidthForErrorBarDecimals( - const rtl::Reference<::chart::ChartModel>& xChartModel, - const css::uno::Reference<css::uno::XInterface>& xChartView, - const OUString& rSelectedObjectCID); + static double + getAxisMinorStepWidthForErrorBarDecimals(const rtl::Reference<::chart::ChartModel>& xChartModel, + const rtl::Reference<::chart::ChartView>& xChartView, + std::u16string_view rSelectedObjectCID); void FillItemSet(SfxItemSet& rOutAttrs); diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx index 238ccc83b42f..621f096753e4 100644 --- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx +++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx @@ -20,9 +20,9 @@ #include <ObjectIdentifier.hxx> #include <sfx2/tabdlg.hxx> +#include <vcl/graph.hxx> namespace com::sun::star::util { class XNumberFormatsSupplier; } -class Graphic; namespace chart { @@ -30,7 +30,7 @@ namespace chart class ObjectPropertiesDialogParameter final { public: - ObjectPropertiesDialogParameter( const OUString& rObjectCID ); + ObjectPropertiesDialogParameter( OUString aObjectCID ); ~ObjectPropertiesDialogParameter(); void init( const rtl::Reference<::chart::ChartModel>& xModel ); @@ -115,14 +115,14 @@ private: SvNumberFormatter* m_pNumberFormatter; std::optional<SfxItemSet> m_oSymbolShapeProperties; - std::unique_ptr<Graphic> m_pAutoSymbolGraphic; + std::optional<Graphic> m_oAutoSymbolGraphic; double m_fAxisMinorStepWidthForErrorBarDecimals; bool m_bOKPressed; DECL_LINK(OKPressed, weld::Button&, void); - virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override; + virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override; public: SchAttribTabDlg(weld::Window* pParent, const SfxItemSet* pAttr, @@ -133,7 +133,7 @@ public: //pSymbolShapeProperties: Properties to be set on the symbollist shapes //pAutoSymbolGraphic: Graphic to be shown if AutoSymbol gets selected - void setSymbolInformation( SfxItemSet&& rSymbolShapeProperties, std::unique_ptr<Graphic> pAutoSymbolGraphic ); + void setSymbolInformation( SfxItemSet&& rSymbolShapeProperties, std::optional<Graphic> oAutoSymbolGraphic ); void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth ); diff --git a/chart2/source/controller/inc/dlg_ShapeFont.hxx b/chart2/source/controller/inc/dlg_ShapeFont.hxx index 6998ba47094b..cfeb002fb92d 100644 --- a/chart2/source/controller/inc/dlg_ShapeFont.hxx +++ b/chart2/source/controller/inc/dlg_ShapeFont.hxx @@ -33,7 +33,7 @@ public: const ViewElementListProvider* pViewElementListProvider); private: - virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override; + virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override; const ViewElementListProvider* m_pViewElementListProvider; }; diff --git a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx index 9d4d7496d64d..15d0c014d848 100644 --- a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx +++ b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx @@ -30,7 +30,7 @@ public: ShapeParagraphDialog(weld::Window* pParent, const SfxItemSet* pAttr); private: - virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override; + virtual void PageCreated(const OUString& rId, SfxTabPage& rPage) override; }; } // namespace chart diff --git a/chart2/source/controller/inc/dlg_View3D.hxx b/chart2/source/controller/inc/dlg_View3D.hxx index c165e828535e..66c4a8eaf41a 100644 --- a/chart2/source/controller/inc/dlg_View3D.hxx +++ b/chart2/source/controller/inc/dlg_View3D.hxx @@ -41,7 +41,7 @@ public: virtual short run() override; private: - DECL_LINK(ActivatePageHdl, const OString&, void); + DECL_LINK(ActivatePageHdl, const OUString&, void); ControllerLockHelper m_aControllerLocker; diff --git a/chart2/source/controller/inc/helpids.h b/chart2/source/controller/inc/helpids.h index 69a23771c8dd..775ec1489b42 100644 --- a/chart2/source/controller/inc/helpids.h +++ b/chart2/source/controller/inc/helpids.h @@ -19,14 +19,14 @@ #pragma once -#include <rtl/string.hxx> +#include <rtl/ustring.hxx> -inline constexpr OStringLiteral HID_SCH_WIN_DOCUMENT = "CHART2_HID_SCH_WIN_DOCUMENT"; -inline constexpr OStringLiteral HID_SCH_ERROR_BARS_FROM_DATA = "CHART2_SCH_ERROR_BARS_FROM_DATA"; +inline constexpr OUString HID_SCH_WIN_DOCUMENT = u"CHART2_HID_SCH_WIN_DOCUMENT"_ustr; +inline constexpr OUString HID_SCH_ERROR_BARS_FROM_DATA = u"CHART2_SCH_ERROR_BARS_FROM_DATA"_ustr; -inline constexpr OStringLiteral HID_SCH_WIZARD_ROADMAP = "CHART2_HID_SCH_WIZARD_ROADMAP"; -inline constexpr OStringLiteral HID_SCH_DATA_SERIES_LABEL = "CHART2_HID_SCH_DATA_SERIES_LABEL"; +inline constexpr OUString HID_SCH_WIZARD_ROADMAP = u"CHART2_HID_SCH_WIZARD_ROADMAP"_ustr; +inline constexpr OUString HID_SCH_DATA_SERIES_LABEL = u"CHART2_HID_SCH_DATA_SERIES_LABEL"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/inc/res_DataTableProperties.hxx b/chart2/source/controller/inc/res_DataTableProperties.hxx new file mode 100644 index 000000000000..4b2aaa4f2ef7 --- /dev/null +++ b/chart2/source/controller/inc/res_DataTableProperties.hxx @@ -0,0 +1,48 @@ +/* -*- 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/. + */ + +#pragma once + +#include <svl/itemset.hxx> +#include <vcl/weld.hxx> + +namespace chart +{ +/** The shared UI elements for the data table properties */ +class DataTablePropertiesResources final +{ +private: + std::unique_ptr<weld::CheckButton> m_xCbHorizontalBorder; + std::unique_ptr<weld::CheckButton> m_xCbVerticalBorder; + std::unique_ptr<weld::CheckButton> m_xCbOutilne; + std::unique_ptr<weld::CheckButton> m_xCbKeys; + +public: + DataTablePropertiesResources(weld::Builder& rBuilder); + + void initFromItemSet(SfxItemSet const& rInAttrs); + bool writeToItemSet(SfxItemSet& rOutAttrs) const; + void setChecksSensitive(bool bSensitive); + + bool getHorizontalBorder() { return m_xCbHorizontalBorder->get_active(); } + void setHorizontalBorder(bool bActive) { m_xCbHorizontalBorder->set_active(bActive); } + + bool getVerticalBorder() { return m_xCbVerticalBorder->get_active(); } + void setVerticalBorder(bool bActive) { m_xCbVerticalBorder->set_active(bActive); } + + bool getOutline() { return m_xCbOutilne->get_active(); } + void setOutline(bool bActive) { m_xCbOutilne->set_active(bActive); } + + bool getKeys() { return m_xCbKeys->get_active(); } + void setKeys(bool bActive) { m_xCbKeys->set_active(bActive); } +}; + +} //namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/inc/res_LegendPosition.hxx b/chart2/source/controller/inc/res_LegendPosition.hxx index d34c28cdd79c..80ccaa85da6e 100644 --- a/chart2/source/controller/inc/res_LegendPosition.hxx +++ b/chart2/source/controller/inc/res_LegendPosition.hxx @@ -40,8 +40,8 @@ public: //constructor without Display checkbox LegendPositionResources(weld::Builder& rBuilder); //constructor inclusive Display checkbox - LegendPositionResources(weld::Builder& rBuilder, const css::uno::Reference< - css::uno::XComponentContext>& xCC ); + LegendPositionResources(weld::Builder& rBuilder, css::uno::Reference< + css::uno::XComponentContext> xCC ); ~LegendPositionResources(); void writeToResources( const rtl::Reference<::chart::ChartModel>& xChartModel ); @@ -57,6 +57,7 @@ public: private: void impl_setRadioButtonToggleHdl(); + void PositionEnable(); private: css::uno::Reference< css::uno::XComponentContext> m_xCC; diff --git a/chart2/source/controller/inc/uiobject.hxx b/chart2/source/controller/inc/uiobject.hxx index b40fffb4451b..6de63f5d3fdf 100644 --- a/chart2/source/controller/inc/uiobject.hxx +++ b/chart2/source/controller/inc/uiobject.hxx @@ -19,7 +19,7 @@ class ChartUIObject final : public UIObject public: ChartUIObject(const VclPtr<chart::ChartWindow>& xChartWindow, - const OUString& rCID); + OUString aCID); StringMap get_state() override; @@ -32,6 +32,8 @@ public: virtual OUString get_type() const override; + virtual bool equals(const UIObject& rOther) const override; + private: OUString maCID; |