/* -*- 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_SW_INC_UNOCHART_HXX #define INCLUDED_SW_INC_UNOCHART_HXX #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include class SfxItemPropertySet; class SwDoc; class SwTable; class SwTableBox; struct SwRangeDescriptor; class SwSelBoxes; class SwFrameFormat; bool FillRangeDescriptor( SwRangeDescriptor &rDesc, const OUString &rCellRangeName ); class SwChartHelper { public: static void DoUpdateAllCharts( SwDoc* pDoc ); }; class SwChartLockController_Helper { SwDoc *pDoc; DECL_LINK( DoUnlockAllCharts, Timer *, void ); Timer aUnlockTimer; // timer to unlock chart controllers bool bIsLocked; SwChartLockController_Helper( const SwChartLockController_Helper & ) = delete; SwChartLockController_Helper & operator = ( const SwChartLockController_Helper & ) = delete; void LockUnlockAllCharts( bool bLock ); void LockAllCharts() { LockUnlockAllCharts( true ); }; void UnlockAllCharts() { LockUnlockAllCharts( false ); }; public: SwChartLockController_Helper( SwDoc *pDocument ); ~SwChartLockController_Helper(); void StartOrContinueLocking(); void Disconnect(); }; typedef cppu::WeakImplHelper < css::chart2::data::XDataProvider, css::chart2::data::XRangeXMLConversion, css::lang::XComponent, css::lang::XServiceInfo > SwChartDataProviderBaseClass; class SwChartDataProvider : public SwChartDataProviderBaseClass, public SwClient { // used to keep weak-references to all data-sequences of a single table // see set definition below... struct lt_DataSequenceRef { bool operator()( css::uno::WeakReference< css::chart2::data::XDataSequence > xWRef1, css::uno::WeakReference< css::chart2::data::XDataSequence > xWRef2 ) const { css::uno::Reference< css::chart2::data::XDataSequence > xRef1( xWRef1 ); css::uno::Reference< css::chart2::data::XDataSequence > xRef2( xWRef2 ); return xRef1.get() < xRef2.get(); } }; typedef std::set< css::uno::WeakReference < css::chart2::data::XDataSequence >, lt_DataSequenceRef > Set_DataSequenceRef_t; // map of data-sequence sets for each table typedef std::map< const SwTable *, Set_DataSequenceRef_t > Map_Set_DataSequenceRef_t; // map of all data-sequences provided directly or indirectly (e.g. via // data-source) by this object. Since there is only one object of this type // for each document it should hold references to all used data-sequences for // all tables of the document. mutable Map_Set_DataSequenceRef_t aDataSequences; ::comphelper::OInterfaceContainerHelper2 aEvtListeners; const SwDoc * pDoc; bool bDisposed; SwChartDataProvider( const SwChartDataProvider & ) = delete; SwChartDataProvider & operator = ( const SwChartDataProvider & ) = delete; /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException css::uno::Reference< css::chart2::data::XDataSource > SAL_CALL Impl_createDataSource( const css::uno::Sequence< css::beans::PropertyValue >& aArguments, bool bTestOnly = false ); /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException css::uno::Reference< css::chart2::data::XDataSequence > SAL_CALL Impl_createDataSequenceByRangeRepresentation( const OUString& aRangeRepresentation, bool bTestOnly = false ); static OUString GetBrokenCellRangeForExport( const OUString &rCellRangeRepresentation ); protected: //SwClient virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override; public: SwChartDataProvider( const SwDoc* pDoc ); virtual ~SwChartDataProvider() override; // XDataProvider virtual sal_Bool SAL_CALL createDataSourcePossible( const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override; virtual css::uno::Reference< css::chart2::data::XDataSource > SAL_CALL createDataSource( const css::uno::Sequence< css::beans::PropertyValue >& aArguments ) override; virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL detectArguments( const css::uno::Reference< css::chart2::data::XDataSource >& xDataSource ) override; virtual sal_Bool SAL_CALL createDataSequenceByRangeRepresentationPossible( const OUString& aRangeRepresentation ) override; virtual css::uno::Reference< css::chart2::data::XDataSequence > SAL_CALL createDataSequenceByRangeRepresentation( const OUString& aRangeRepresentation ) override; virtual css::uno::Reference< css::sheet::XRangeSelection > SAL_CALL getRangeSelection( ) override; virtual css::uno::Reference SAL_CALL createDataSequenceByValueArray( const OUString& aRole, const OUString& aRangeRepresentation ) override; // XRangeXMLConversion virtual OUString SAL_CALL convertRangeToXML( const OUString& aRangeRepresentation ) override; virtual OUString SAL_CALL convertRangeFromXML( const OUString& aXMLRange ) override; // XComponent virtual void SAL_CALL dispose( ) override; virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; // 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; void AddDataSequence( const SwTable &rTable, css::uno::Reference< css::chart2::data::XDataSequence > &rxDataSequence ); void RemoveDataSequence( const SwTable &rTable, css::uno::Reference< css::chart2::data::XDataSequence > &rxDataSequence ); // will send modified events for all data-sequences of the table void InvalidateTable( const SwTable *pTable ); bool DeleteBox( const SwTable *pTable, const SwTableBox &rBox ); void DisposeAllDataSequences( const SwTable *pTable ); // functionality needed to get notified about new added rows/cols void AddRowCols( const SwTable &rTable, const SwSelBoxes& rBoxes, sal_uInt16 nLines, bool bBehind ); }; typedef cppu::WeakImplHelper < css::chart2::data::XDataSource, css::lang::XServiceInfo > SwChartDataSourceBaseClass; class SwChartDataSource : public SwChartDataSourceBaseClass { css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > aLDS; SwChartDataSource( const SwChartDataSource & ) = delete; SwChartDataSource & operator = ( const SwChartDataSource & ) = delete; public: SwChartDataSource( const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > &rLDS ); virtual ~SwChartDataSource() override; // XDataSource virtual css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > SAL_CALL getDataSequences( ) override; // 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; }; typedef cppu::WeakImplHelper < css::chart2::data::XDataSequence, css::chart2::data::XTextualDataSequence, css::chart2::data::XNumericalDataSequence, css::util::XCloneable, css::beans::XPropertySet, css::lang::XServiceInfo, css::lang::XUnoTunnel, css::util::XModifiable, css::lang::XEventListener, css::lang::XComponent > SwChartDataSequenceBaseClass; class SwChartDataSequence : public SwChartDataSequenceBaseClass, public SwClient { ::comphelper::OInterfaceContainerHelper2 m_aEvtListeners; ::comphelper::OInterfaceContainerHelper2 m_aModifyListeners; css::chart2::data::DataSequenceRole m_aRole; OUString m_aRowLabelText; OUString m_aColLabelText; rtl::Reference m_xDataProvider; sw::UnoCursorPointer m_pTableCursor; // cursor spanned over cells to use const SfxItemPropertySet* m_pPropSet; bool m_bDisposed; SwChartDataSequence( const SwChartDataSequence &rObj ); SwChartDataSequence & operator = ( const SwChartDataSequence & ) = delete; protected: //SwClient virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) override; public: SwChartDataSequence( SwChartDataProvider &rProvider, SwFrameFormat &rTableFormat, std::shared_ptr pTableCursor ); virtual ~SwChartDataSequence() override; static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); //XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; // XDataSequence virtual css::uno::Sequence< css::uno::Any > SAL_CALL getData() override; virtual OUString SAL_CALL getSourceRangeRepresentation() override; virtual css::uno::Sequence< OUString > SAL_CALL generateLabel( css::chart2::data::LabelOrigin eLabelOrigin ) override; virtual ::sal_Int32 SAL_CALL getNumberFormatKeyByIndex( ::sal_Int32 nIndex ) override; // XTextualDataSequence virtual css::uno::Sequence< OUString > SAL_CALL getTextualData() override; // XNumericalDataSequence virtual css::uno::Sequence< double > SAL_CALL getNumericalData() override; // XCloneable virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; // 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; // XModifiable virtual sal_Bool SAL_CALL isModified( ) override; virtual void SAL_CALL setModified( sal_Bool bModified ) override; // XModifyBroadcaster virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override; virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override; // XEventListener virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; // XComponent virtual void SAL_CALL dispose( ) override; virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; SwFrameFormat* GetFrameFormat() const { return const_cast(static_cast(GetRegisteredIn())); } bool DeleteBox( const SwTableBox &rBox ); void FillRangeDesc( SwRangeDescriptor &rRangeDesc ) const; bool ExtendTo( bool bExtendCol, sal_Int32 nFirstNew, sal_Int32 nCount ); std::vector< css::uno::Reference< css::table::XCell > > GetCells(); }; typedef cppu::WeakImplHelper < css::chart2::data::XLabeledDataSequence2, css::lang::XServiceInfo, css::util::XModifyListener, css::lang::XComponent > SwChartLabeledDataSequenceBaseClass; class SwChartLabeledDataSequence : public SwChartLabeledDataSequenceBaseClass { ::comphelper::OInterfaceContainerHelper2 aEvtListeners; ::comphelper::OInterfaceContainerHelper2 aModifyListeners; css::uno::Reference< css::chart2::data::XDataSequence > xData; css::uno::Reference< css::chart2::data::XDataSequence > xLabels; bool bDisposed; SwChartLabeledDataSequence( const SwChartLabeledDataSequence & ) = delete; SwChartLabeledDataSequence & operator = ( const SwChartLabeledDataSequence & ) = delete; void SetDataSequence( css::uno::Reference< css::chart2::data::XDataSequence >& rxDest, const css::uno::Reference< css::chart2::data::XDataSequence >& rxSource ); public: SwChartLabeledDataSequence(); virtual ~SwChartLabeledDataSequence() override; // XLabeledDataSequence virtual css::uno::Reference< css::chart2::data::XDataSequence > SAL_CALL getValues( ) override; virtual void SAL_CALL setValues( const css::uno::Reference< css::chart2::data::XDataSequence >& xSequence ) override; virtual css::uno::Reference< css::chart2::data::XDataSequence > SAL_CALL getLabel( ) override; virtual void SAL_CALL setLabel( const css::uno::Reference< css::chart2::data::XDataSequence >& xSequence ) override; // XCloneable virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override; // 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; // XEventListener virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; // XModifyListener virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override; // XModifyBroadcaster virtual void SAL_CALL addModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override; virtual void SAL_CALL removeModifyListener( const css::uno::Reference< css::util::XModifyListener >& aListener ) override; // XComponent virtual void SAL_CALL dispose( ) override; virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ c-basic-ide-completion-and-other-bits LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-11-18Simplify containers iterations in svx/source/[s-u]*Arkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: I2ec3e58cc46c9286ef863c732912ca7a729bab62 Reviewed-on: https://gerrit.libreoffice.org/63522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-02pass OutlinerParaObject around by std::unique_ptrNoel Grandin
SdrText::SetOutlinerParaObject was modified to not check for self-assign, and instead assert because the existing check was no longer possible. Fix bug in SdrUndoObjSetText::Undo(), where it was calling SdrText::SetOutlinerParaObject unnecessarily, because NbcSetOutlinerParaObjectForText already does that. Optimise Outliner::GetEmptyParaObject by creating a new constructor for OutlinerParaObject, so we don't need to copy the new object we get back from GetEmptyTextObject, unnecessarily. Change-Id: I57c475583d6c31658c154e24992b3d587bad9841 Reviewed-on: https://gerrit.libreoffice.org/56730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-18rename Neu->New in svxNoel Grandin
Change-Id: I77a49d55dd49b0fd41f5335ac30a5484ac130250 Reviewed-on: https://gerrit.libreoffice.org/53050 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-07SOSAW080: Added first bunch of basic changes to helpersArmin Le Grand
SOSAW080: Make SdrModel& prerequisite to SdrObjects Added need for SdrModel& in constructors of SdrModel, SdrPage, SdrView and SdrObjList. Builds, not finished. SOSAW080: removed and replaced old SdrModel Removed and replaced GetModel()/SetModel() in all using classes (SdrObject, SdrPage, SdrView), added accessors to new referenced SdrModel, adapted all accessing places. Refactored/Extended ::Clone and ::operator== for these classes to allow cloning objects to a target SdrModel. Adapted places where this is done AFAP. Added quite some comments (tagged with 'TTTT') where possible further work is needed. Builds completely, thus checking in. This does not mean that this change is done yet. SOSAW080: Adapted SdrPage/SdrModel relationship Also needed to work on copy-construction of SdrPage and hierarchy, quite some stuff removed, no copy-constructor anymore, no MigrateItemPool stuff. Builds well, test stuck, will need some cleanup/finetunung SOSAW080: Smaller corrections/includes adapted SOSAW080: Smaller corrections/includes adapted SOSAW080: Debugging/Stabilizing/MakeUnitTestWork SOSAW080: Stabilized for UnitTests, cleanups SOSAW080: Adapted GetObjGraphic to just take a const SdrObject& SOSAW080: Removed ChangeModel from classes Classes SvxTextEditSource and SvxDrawPage (including TextEditSource stuff) do not need change of SdrModel anymore. SOSAW080: Adapted some comments to make more readable SOSAW080: Corrected constructor SOSAW080: getSdrModelFromUnoModel added override marks SOSAW080: Added missing includes SOSAW080: Corrected SdrPage constructor SOSAW080: Corrected some SdrObject::Clone scenarios Especially when cloning to another SdrModel and taking the sdr::properties into account. SOSAW080: Added include for Mac-Build SOSAW080: Added Scale to DefaultProperties If a SdrModel change happens in DefaultProperties copy constructor (used from Clone()), potentially a Scale for the SfxItems has to be done. SOSAW080: Added missing include for MacBuild SOSAW080: Corrected CppunitTest_sc_anchor_test An adaption of a SdrPathObj instantiation was missing, added that. Seems as if that test is no tpart of the usual 'make' scenario, but used/executed in gerrit builds SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Free SdrObjects when SdrModel goes down In an UNO API test problem is that SvxShapes reference SdrShapes, but these are not added to a SdrPage and not 'owned' by the SvxShape. Thus these do not get deleted at all (same in master, memory leak). I extended SvxShape::Notify the case for ModelCleared to also Free the SdrObject when not owner and it's not added to a SdrPage (in that case it gets deleted with deleting the SdrModel) SOSAW080: Solve UNO API calls that move SvxShapes to other Model Due to UNO API tests I got a call to insert an xShape to a xDrawPage which was constructed in another Model, this has now to be done by Cloning the SdrObject to the new SdrModel, getting rid of the old one and getting all the UNO implementation stuff right (referemces SdrObject <-> xShape). 1cb7d573d323e98a89761fe662c10c4a654fdec0 24617494a0ef79f6e33dfcb02782a833a81c6434 763f39094b6a48b529a6952d01468f8776c97679 242b9e228a9a042c3a5bdd38b1ea6600144276d5 242b9e228a9a042c3a5bdd38b1ea6600144276d5 33a6f3f306b70c223171aef796dd5ee041ad14df 6878b33f8b05738a44c0910e40a60a0f0d1d58ed 0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2 8c4626274a5cc531dad27f27c0c45d4c528fb2fb 446685a49a6d67aedd01cfbbd5e87b07f97a4d7b c1b5ed3c99bc7219a0061e4ece24ea42afd2889a 22de9a1c8af7c25be5c108671ddc548ba323ed47 4caf6b6fbbe6e8130741d793dffb560fd01d4ed5 488b9601735ec1822433f82f633990063951fe08 c366d60299f239e3df856ddffedb19e743e4be0c c5137ba8c597c7b5f90318df50e87b93a39a28dc f9e646242cf89f6fde1315046952252a2c429779 f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410 1694b54903df784385abaa8452e1201e12344238 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 7b5c241faec7488924e5935ae8b19f785846b5e4 bf097ee7467895823fbd158a2a9543da3b5a5078 Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c Reviewed-on: https://gerrit.libreoffice.org/52526 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2018-04-06Revert "SOSAW080: Added first bunch of basic changes to helpers"Armin Le Grand
This reverts commit 6c14c27c75a03e2363f2b363ddf0a6f2f46cfa91.
2018-04-06SOSAW080: Added first bunch of basic changes to helpersArmin Le Grand
SOSAW080: Make SdrModel& prerequisite to SdrObjects Added need for SdrModel& in constructors of SdrModel, SdrPage, SdrView and SdrObjList. Builds, not finished. SOSAW080: removed and replaced old SdrModel Removed and replaced GetModel()/SetModel() in all using classes (SdrObject, SdrPage, SdrView), added accessors to new referenced SdrModel, adapted all accessing places. Refactored/Extended ::Clone and ::operator== for these classes to allow cloning objects to a target SdrModel. Adapted places where this is done AFAP. Added quite some comments (tagged with 'TTTT') where possible further work is needed. Builds completely, thus checking in. This does not mean that this change is done yet. SOSAW080: Adapted SdrPage/SdrModel relationship Also needed to work on copy-construction of SdrPage and hierarchy, quite some stuff removed, no copy-constructor anymore, no MigrateItemPool stuff. Builds well, test stuck, will need some cleanup/finetunung SOSAW080: Smaller corrections/includes adapted SOSAW080: Smaller corrections/includes adapted SOSAW080: Debugging/Stabilizing/MakeUnitTestWork SOSAW080: Stabilized for UnitTests, cleanups SOSAW080: Adapted GetObjGraphic to just take a const SdrObject& SOSAW080: Removed ChangeModel from classes Classes SvxTextEditSource and SvxDrawPage (including TextEditSource stuff) do not need change of SdrModel anymore. SOSAW080: Adapted some comments to make more readable SOSAW080: Corrected constructor SOSAW080: getSdrModelFromUnoModel added override marks SOSAW080: Added missing includes SOSAW080: Corrected SdrPage constructor SOSAW080: Corrected some SdrObject::Clone scenarios Especially when cloning to another SdrModel and taking the sdr::properties into account. SOSAW080: Added include for Mac-Build SOSAW080: Added Scale to DefaultProperties If a SdrModel change happens in DefaultProperties copy constructor (used from Clone()), potentially a Scale for the SfxItems has to be done. SOSAW080: Added missing include for MacBuild SOSAW080: Corrected CppunitTest_sc_anchor_test An adaption of a SdrPathObj instantiation was missing, added that. Seems as if that test is no tpart of the usual 'make' scenario, but used/executed in gerrit builds SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Reworked SvxShape to use SdrObject's SdrModel SOSAW080: Free SdrObjects when SdrModel goes down In an UNO API test problem is that SvxShapes reference SdrShapes, but these are not added to a SdrPage and not 'owned' by the SvxShape. Thus these do not get deleted at all (same in master, memory leak). I extended SvxShape::Notify the case for ModelCleared to also Free the SdrObject when not owner and it's not added to a SdrPage (in that case it gets deleted with deleting the SdrModel) SOSAW080: Solve UNO API calls that move SvxShapes to other Model Due to UNO API tests I got a call to insert an xShape to a xDrawPage which was constructed in another Model, this has now to be done by Cloning the SdrObject to the new SdrModel, getting rid of the old one and getting all the UNO implementation stuff right (referemces SdrObject <-> xShape). Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c 1cb7d573d323e98a89761fe662c10c4a654fdec0 24617494a0ef79f6e33dfcb02782a833a81c6434 763f39094b6a48b529a6952d01468f8776c97679 242b9e228a9a042c3a5bdd38b1ea6600144276d5 242b9e228a9a042c3a5bdd38b1ea6600144276d5 33a6f3f306b70c223171aef796dd5ee041ad14df 6878b33f8b05738a44c0910e40a60a0f0d1d58ed 0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2 8c4626274a5cc531dad27f27c0c45d4c528fb2fb 446685a49a6d67aedd01cfbbd5e87b07f97a4d7b c1b5ed3c99bc7219a0061e4ece24ea42afd2889a 22de9a1c8af7c25be5c108671ddc548ba323ed47 4caf6b6fbbe6e8130741d793dffb560fd01d4ed5 488b9601735ec1822433f82f633990063951fe08 c366d60299f239e3df856ddffedb19e743e4be0c c5137ba8c597c7b5f90318df50e87b93a39a28dc f9e646242cf89f6fde1315046952252a2c429779 f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410 1694b54903df784385abaa8452e1201e12344238 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 17bcb44d2e29920c0c74430c2d9c703b36cfa0ad 7b5c241faec7488924e5935ae8b19f785846b5e4 bf097ee7467895823fbd158a2a9543da3b5a5078
2018-02-21loplugin:changetoolsgen in svxNoel Grandin
and fix the regex in the plugin for matching += operator Change-Id: I26b3e3fac1d4ef3e756cc9431b983b5f27ee76d6 Reviewed-on: https://gerrit.libreoffice.org/50037 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-16ofz#6311 still problems with SdrEdgeObj listening to same obj at start as endCaolán McNamara
Change-Id: Ibd80b484788779b73943b28a5f36e51ebcacec30 Reviewed-on: https://gerrit.libreoffice.org/49821 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-12More loplugin:cstylecast: svxStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I100e6c14cbf1d780f0e5ebca6b0c9e71ce1caaf7
2017-11-20TypedWhichId for SDRATTR* constants (1)Noel Grandin
Change-Id: I29bd18fea4dea531ae84ebc024d2aa87a5c7004d Reviewed-on: https://gerrit.libreoffice.org/44943 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-10editviewoverlay: Allow EditView to run in OverlayArmin Le Grand
This is the first basic functionality to get the active EditView with EditEngine work in the Overlay which all Apps support. Reason is that the current EditEngine 'plugs' into the Window and uses Invalidate() calls to repaint deeply everything under a text change. While this is acceptable for simple cases it can get very slow when there are excessive, expensive to paint objects in the background, e.g. MasterPages in Draw/Impress with gradients and other stuff. This was avoided in older versions (LO51) by 'guessing' a good BackgrundColor by the EditEngine, not invalidating but painting actively using that guess (with better or worse results) which someone removed. For the future it is anyways the better way to get the EditEngine functionality to Overlay and using Primitives, this will be a first step. This may enable Text Editing without repainting the Background (fast), using a non-XOR selection paint and more. It will need thorough testing and further experimenting due to EditEngine being used in many places (DrawObjects, Calc Cells, Formular Fields, Controls, ...) Change-Id: Ib9eb0f3999fd61a82ddf7a60ab1ea6ccda3a60da
2017-08-04rename Anz->Cnt in svxNoel Grandin
Change-Id: Idbe6849d36727c382ffd11d6bf04e78d6a66a878 Reviewed-on: https://gerrit.libreoffice.org/40740 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-06convert SdrTextAniKind to scoped enumNoel Grandin
Change-Id: Ie79aaf96a0d89c96c4ecd4ee8ccb0eabd3456bd0 Reviewed-on: https://gerrit.libreoffice.org/34916 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-20loplugin:expandablemethodds in svxNoel Grandin
Change-Id: I45447b6f5cf7e17d6e81e8c931b07b26d41b9a8c Reviewed-on: https://gerrit.libreoffice.org/30057 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-23perf: eliminate SfxSimpleHint and move to SfxHint, tdf#87101 relatedEike Rathke
There were over 150 places in *::Notify() functions that did some dynamic_cast<SfxSimpleHint*> of which ~98% were unnecessary because the base class SfxHint passed was an SfxSimpleHint anyway. dynamic_cast operations come with quite some cost, so avoid if possible. Specifically for ScFormulaCell::Notify() that created a bottleneck in scenarios where cells were notified that already handled a previous notification. In mass operations doing the dynamic_cast before it could be decided whether having to act on it or not this made 2/3 of all time spent in the Notify() call. To get rid of that rename/move SfxSimpleHint to SfxHint and let classes derive from SfxHint instead of SfxSimpleHint. This comes only with a slight cost that an additional sal_uInt32 is transported in such hints, initialized to 0, but this is neglectable compared to the huge gain. For the rare cases where a Notify() actually expects both, an SfxHint (formerly SfxSimpleHint) and a derived hint, this changed order of the dynamic_cast involved so the simple SfxHint::GetId() is handled last. Modules using such combinations can further optimize by treating the simple SfxHint::GetId() first once verified that none of the other derived hints use an ID not equal to zero respectively none of the ID values the simple hint uses. Change-Id: I9fcf723e3a4487ceb92336189d23a62c344cf0ce Reviewed-on: https://gerrit.libreoffice.org/29205 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-08-24convert SdrTextAniDirection to scoped enumNoel Grandin
Change-Id: I67d1ffb1169e9faf4df90dd70a5496aa485979cf
2016-08-19convert SdrUserCallType to scoped enumNoel Grandin
Change-Id: I0121b17242faee4238d82836453cec695f508db0
2016-03-04loplugin:unuseddefaultparam in svxNoel Grandin
Change-Id: Iacd4ed12c6c5dfdc2f31f85c8c1ce2cee8a8641f
2016-03-01loplugin:unuseddefaultparam in svx (part1)Noel Grandin
Change-Id: I0fc8d00447491e8474508952c21d07aa22b6f055
2015-11-115th step to remove tools/rtti.hxxOliver Specht
tools/rtti.hxx removed completed the interface of some Sdr.* Items and removed pseudo items Change-Id: I0cdcd01494be35b97a27d5985aa908affa96048a Reviewed-on: https://gerrit.libreoffice.org/19837 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I71682f28c6a54d33da6b0c971f34d0a705ff04f5
2015-10-01tdf#94559: third step to remove rtti.hxxOliver Specht
replaced use of PTR_CAST, IS_TYPE, ISA in oox, reportdesign, svl, svtools, svx, tools Change-Id: I1f85ff92267a0668eba625fa61b4f07feb8f3d4e Reviewed-on: https://gerrit.libreoffice.org/19002 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-06-26loplugin:stringconstant: handle OUString+=OUString(literal)Stephan Bergmann
Change-Id: If1ad4df75f592c5f9bfedb490243526007fff35f
2014-11-04Rename aRect -> maRect for a member variable.Kohei Yoshida
Conflicts: svx/source/svdraw/svdoashp.cxx svx/source/svdraw/svdocirc.cxx svx/source/svdraw/svdograf.cxx svx/source/svdraw/svdoole2.cxx svx/source/svdraw/svdorect.cxx svx/source/svdraw/svdotext.cxx svx/source/svdraw/svdotxdr.cxx svx/source/svdraw/svdotxtr.cxx Change-Id: I12dc6c12ee44753c63b15f03276cdaa24e57d395
2014-10-24loplugin: cstylecastNoel Grandin
Change-Id: Ia0f5f0d0efbe4693aba347bff32cd694117251fe
2014-10-22Reduce scopes and add some whitespaces.Kohei Yoshida
Conflicts: svx/source/svdraw/svdotxat.cxx Change-Id: Ie1c94a4c241352c580d2509529919806f01ed6c0
2014-10-20loplugin: cstylecastNoel Grandin
Change-Id: Ia3055b00c20a885dfa0584f864f0e91ccad1e9c9
2014-10-15nDrehWink -> nRotationAngleMiklos Vajna
Change-Id: I33ca88f38210140931b12a05e426d1373243156e
2014-09-19fdo#84061 Fix setting text style sheet listeners in SdrTextObjTobias Lippert
The code in SdrTextObj::ImpSetTextStyleSheetListeners is obviously not working correctly. The families of the stylesheets are appended to the name of the family for further usage. An encoded string looks like "STYLE_NAME|3 " The family is then extracted by copying the first (length-6) bytes, e.g., "STYLE_NAME" in this example. Then another copy starting a position 1 is created, e.g., "TYLE_NAME". This string is cast to an Int32. Since this is not possible, 0 is returned, and the originally stored family is lost. This patch corrects this behavior, and adds a unit test. Change-Id: I60c0add6e4b670acbbc264cc77672452f282f737 Reviewed-on: https://gerrit.libreoffice.org/10818 Reviewed-by: Matúš Kukan <matus.kukan@collabora.com> Tested-by: Matúš Kukan <matus.kukan@collabora.com>
2014-04-15svx: sal_Bool->boolNoel Grandin
Change-Id: I464eba5fd5521c31868c6fc8a2137f17428d421e
2014-02-27editeng: sal_Bool->boolNoel Grandin
Change-Id: Id4174904487fc153d8e80471da7c829c52092f78
2014-02-20svl: sal_Bool -> boolStephan Bergmann
Change-Id: Ic31455a1f5ffffa35d4fdde901dd70734207b6f4
2014-01-28bool improvementsStephan Bergmann
Change-Id: Ic32faa81bfbb66a9d8632fb3db187e33c31188ed
2013-10-22Bin comments that claim to say why some header is includedTor Lillqvist
They are practically always useless, often misleading or obsolete. Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c