[Libreoffice-commits] core.git: 2 commits - include/registry reportdesign/inc reportdesign/source sc/source
Noel Grandin
noel.grandin at collabora.co.uk
Tue Oct 31 13:38:22 UTC 2017
include/registry/registry.hxx | 9 +--
reportdesign/inc/RptObject.hxx | 65 ++++++++++-------------
reportdesign/source/filter/xml/xmlComponent.hxx | 3 -
reportdesign/source/filter/xml/xmlFunction.hxx | 3 -
reportdesign/source/filter/xml/xmlGroup.hxx | 3 -
reportdesign/source/ui/inc/ColorChanger.hxx | 3 -
reportdesign/source/ui/inc/DefaultInspection.hxx | 12 +---
reportdesign/source/ui/inc/metadata.hxx | 20 +++----
reportdesign/source/ui/inc/propbrw.hxx | 4 -
sc/source/core/data/compressedarray.cxx | 2
10 files changed, 57 insertions(+), 67 deletions(-)
New commits:
commit 2bf2541c6b849a5153462327f8d167a386464dda
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Oct 30 17:09:51 2017 +0200
loplugin:finalclasses in reportdesign
Change-Id: I6fab8ce7d1c9a5e52a981dc7530fafb2373e27f6
Reviewed-on: https://gerrit.libreoffice.org/44098
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx
index 36b7d77858d3..2036c730fa9e 100644
--- a/include/registry/registry.hxx
+++ b/include/registry/registry.hxx
@@ -80,7 +80,7 @@ class RegistryKey;
The class is implemented inline and use a C-Api.
*/
-class Registry
+class Registry final
{
public:
/** Default constructor.
@@ -180,8 +180,8 @@ public:
/// returns the used registry Api.
const Registry_Api* getApi() const { return m_pApi; }
-protected:
+private:
/// stores the used and initialized registry Api.
const Registry_Api* m_pApi;
/// stores the handle of the underlying registry file on which most of the functions work.
@@ -270,7 +270,7 @@ protected:
RegistryValueList is a helper class to work with a list value.
*/
template<class ValueType>
-class RegistryValueList
+class RegistryValueList final
{
public:
/// Default constructor
@@ -308,7 +308,8 @@ public:
}
friend class RegistryKey;
-protected:
+
+private:
/** sets the data of the value list.
@param registry specifies the registry files where the appropriate key is located.
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
index fd4cba36923f..5a8e53d912d2 100644
--- a/reportdesign/inc/RptObject.hxx
+++ b/reportdesign/inc/RptObject.hxx
@@ -122,30 +122,16 @@ public:
// OCustomShape
-class REPORTDESIGN_DLLPUBLIC OCustomShape: public SdrObjCustomShape , public OObjectBase
+class REPORTDESIGN_DLLPUBLIC OCustomShape final : public SdrObjCustomShape , public OObjectBase
{
friend class OReportPage;
friend class DlgEdFactory;
-
public:
static OCustomShape* Create( const css::uno::Reference< css::report::XReportComponent>& _xComponent )
{
return new OCustomShape( _xComponent );
}
-protected:
- OCustomShape(const css::uno::Reference< css::report::XReportComponent>& _xComponent);
- OCustomShape(const OUString& _sComponentName);
-
- virtual void NbcMove( const Size& rSize ) override;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
- virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
- virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
-
- virtual SdrPage* GetImplPage() const override;
-
-public:
-
virtual ~OCustomShape() override;
virtual css::uno::Reference< css::beans::XPropertySet> getAwtComponent() override;
@@ -156,39 +142,30 @@ public:
private:
virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override;
+
+ OCustomShape(const css::uno::Reference< css::report::XReportComponent>& _xComponent);
+ OCustomShape(const OUString& _sComponentName);
+
+ virtual void NbcMove( const Size& rSize ) override;
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
+ virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
+
+ virtual SdrPage* GetImplPage() const override;
};
// OOle2Obj
-class REPORTDESIGN_DLLPUBLIC OOle2Obj: public SdrOle2Obj , public OObjectBase
+class REPORTDESIGN_DLLPUBLIC OOle2Obj final : public SdrOle2Obj , public OObjectBase
{
friend class OReportPage;
friend class DlgEdFactory;
-
- sal_uInt16 m_nType;
- bool m_bOnlyOnce;
- void impl_createDataProvider_nothrow( const css::uno::Reference< css::frame::XModel>& _xModel);
- virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override;
-
public:
static OOle2Obj* Create( const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType )
{
return new OOle2Obj( _xComponent,_nType );
}
-protected:
- OOle2Obj(const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType);
- OOle2Obj(const OUString& _sComponentName,sal_uInt16 _nType);
-
-
- virtual void NbcMove( const Size& rSize ) override;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
- virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
- virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
-
- virtual SdrPage* GetImplPage() const override;
-
-public:
virtual ~OOle2Obj() override;
@@ -204,6 +181,24 @@ public:
OOle2Obj& operator=(const OOle2Obj& rObj);
void initializeChart( const css::uno::Reference< css::frame::XModel>& _xModel);
+
+private:
+ OOle2Obj(const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType);
+ OOle2Obj(const OUString& _sComponentName,sal_uInt16 _nType);
+
+
+ virtual void NbcMove( const Size& rSize ) override;
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
+ virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override;
+ virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) override;
+
+ virtual SdrPage* GetImplPage() const override;
+
+ void impl_createDataProvider_nothrow( const css::uno::Reference< css::frame::XModel>& _xModel);
+ virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override;
+
+ sal_uInt16 m_nType;
+ bool m_bOnlyOnce;
};
diff --git a/reportdesign/source/filter/xml/xmlComponent.hxx b/reportdesign/source/filter/xml/xmlComponent.hxx
index 1f3abc948006..1ab4d2c8e986 100644
--- a/reportdesign/source/filter/xml/xmlComponent.hxx
+++ b/reportdesign/source/filter/xml/xmlComponent.hxx
@@ -26,9 +26,8 @@
namespace rptxml
{
class ORptFilter;
- class OXMLComponent : public SvXMLImportContext
+ class OXMLComponent final : public SvXMLImportContext
{
- protected:
css::uno::Reference< css::report::XReportComponent > m_xComponent;
OUString m_sTextStyleName;
diff --git a/reportdesign/source/filter/xml/xmlFunction.hxx b/reportdesign/source/filter/xml/xmlFunction.hxx
index b327b753c114..6f03bfa58133 100644
--- a/reportdesign/source/filter/xml/xmlFunction.hxx
+++ b/reportdesign/source/filter/xml/xmlFunction.hxx
@@ -28,9 +28,8 @@
namespace rptxml
{
class ORptFilter;
- class OXMLFunction : public SvXMLImportContext
+ class OXMLFunction final : public SvXMLImportContext
{
- protected:
css::uno::Reference< css::report::XFunctions > m_xFunctions;
css::uno::Reference< css::report::XFunction > m_xFunction;
bool m_bAddToReport;
diff --git a/reportdesign/source/filter/xml/xmlGroup.hxx b/reportdesign/source/filter/xml/xmlGroup.hxx
index ce0667f765e8..ba1fc508dece 100644
--- a/reportdesign/source/filter/xml/xmlGroup.hxx
+++ b/reportdesign/source/filter/xml/xmlGroup.hxx
@@ -26,9 +26,8 @@
namespace rptxml
{
class ORptFilter;
- class OXMLGroup : public SvXMLImportContext
+ class OXMLGroup final : public SvXMLImportContext
{
- protected:
css::uno::Reference< css::report::XGroups > m_xGroups;
css::uno::Reference< css::report::XGroup > m_xGroup;
diff --git a/reportdesign/source/ui/inc/ColorChanger.hxx b/reportdesign/source/ui/inc/ColorChanger.hxx
index 06ecf7cd7bae..16cf429f24f5 100644
--- a/reportdesign/source/ui/inc/ColorChanger.hxx
+++ b/reportdesign/source/ui/inc/ColorChanger.hxx
@@ -24,9 +24,8 @@ namespace rptui
//= ColorChanger
- class ColorChanger
+ class ColorChanger final
{
- protected:
VclPtr<OutputDevice> m_pDev;
public:
diff --git a/reportdesign/source/ui/inc/DefaultInspection.hxx b/reportdesign/source/ui/inc/DefaultInspection.hxx
index 0dfbb46af1cb..e11e366d8b13 100644
--- a/reportdesign/source/ui/inc/DefaultInspection.hxx
+++ b/reportdesign/source/ui/inc/DefaultInspection.hxx
@@ -39,7 +39,7 @@ namespace rptui
, css::lang::XServiceInfo
, css::lang::XInitialization
> DefaultComponentInspectorModel_Base;
- class DefaultComponentInspectorModel : public DefaultComponentInspectorModel_Base
+ class DefaultComponentInspectorModel final : public DefaultComponentInspectorModel_Base
{
private:
::osl::Mutex m_aMutex;
@@ -53,7 +53,7 @@ namespace rptui
DefaultComponentInspectorModel(const DefaultComponentInspectorModel&) = delete;
DefaultComponentInspectorModel& operator=(const DefaultComponentInspectorModel&) = delete;
- protected:
+
virtual ~DefaultComponentInspectorModel() override;
// XServiceInfo
@@ -75,6 +75,9 @@ namespace rptui
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
+ // Service constructors
+ void createWithHelpSection( sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines );
+
public:
// XServiceInfo - static versions
/// @throws css::uno::RuntimeException
@@ -84,12 +87,7 @@ namespace rptui
static css::uno::Reference< css::uno::XInterface > SAL_CALL
create(const css::uno::Reference< css::uno::XComponentContext >&);
- public:
DefaultComponentInspectorModel( const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
-
- protected:
- // Service constructors
- void createWithHelpSection( sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines );
};
diff --git a/reportdesign/source/ui/inc/metadata.hxx b/reportdesign/source/ui/inc/metadata.hxx
index 812a4bc0c9f0..fd2594c11c14 100644
--- a/reportdesign/source/ui/inc/metadata.hxx
+++ b/reportdesign/source/ui/inc/metadata.hxx
@@ -45,16 +45,8 @@ namespace rptui
//= OPropertyInfoService
- class OPropertyInfoService
+ class OPropertyInfoService final
{
- OPropertyInfoService(const OPropertyInfoService&) = delete;
- void operator =(const OPropertyInfoService&) = delete;
- OPropertyInfoService() = delete;
- protected:
- static sal_uInt16 s_nCount;
- static OPropertyInfoImpl* s_pPropertyInfos;
- // TODO: a real structure which allows quick access by name as well as by id
-
public:
// IPropertyInfoService
static sal_Int32 getPropertyId(const OUString& _rName);
@@ -68,11 +60,19 @@ namespace rptui
const css::uno::Reference< css::inspection::XPropertyHandler >& _xFormComponentHandler
);
- protected:
+ private:
static const OPropertyInfoImpl* getPropertyInfo();
static const OPropertyInfoImpl* getPropertyInfo(const OUString& _rName);
static const OPropertyInfoImpl* getPropertyInfo(sal_Int32 _nId);
+
+ OPropertyInfoService(const OPropertyInfoService&) = delete;
+ void operator =(const OPropertyInfoService&) = delete;
+ OPropertyInfoService() = delete;
+
+ static sal_uInt16 s_nCount;
+ static OPropertyInfoImpl* s_pPropertyInfos;
+ // TODO: a real structure which allows quick access by name as well as by id
};
diff --git a/reportdesign/source/ui/inc/propbrw.hxx b/reportdesign/source/ui/inc/propbrw.hxx
index 6d4c6351704a..2fce13d76dc0 100644
--- a/reportdesign/source/ui/inc/propbrw.hxx
+++ b/reportdesign/source/ui/inc/propbrw.hxx
@@ -40,9 +40,8 @@ class OObjectBase;
// PropBrw
-class PropBrw : public DockingWindow , public SfxListener, public SfxBroadcaster
+class PropBrw final : public DockingWindow , public SfxListener, public SfxBroadcaster
{
-private:
css::uno::Reference< css::uno::XComponentContext >
m_xInspectorContext;
css::uno::Reference< css::uno::XComponentContext >
@@ -62,7 +61,6 @@ private:
PropBrw(PropBrw&) = delete;
void operator =(PropBrw&) = delete;
-protected:
virtual void Resize() override;
virtual bool Close() override;
commit e54f4cc24d29fe133a5eaae90515f74c64644159
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Tue Oct 31 10:51:23 2017 +0200
tdf#113530 LibreOffice hangs when pasting a few columns
regression from
commit d6fb5ca5661195520ca7a7ca2d0145a1e11be099
dyncolcontainer: use ScCompressedArray for pColWidth
Change-Id: I3d8b71e7df581346d4a52204cb1230fb80c6e8bb
Reviewed-on: https://gerrit.libreoffice.org/44099
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx
index 28c06d9d87e4..6e8ca59bf5ac 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -215,6 +215,7 @@ template< typename A, typename D >
void ScCompressedArray<A,D>::CopyFrom( const ScCompressedArray<A,D>& rArray, A nDestStart,
A nDestEnd, A nSrcStart )
{
+ assert( this != &rArray && "cannot copy self->self" );
size_t nIndex = 0;
A nRegionEnd;
for (A j=nDestStart; j<=nDestEnd; ++j)
@@ -222,6 +223,7 @@ void ScCompressedArray<A,D>::CopyFrom( const ScCompressedArray<A,D>& rArray, A n
const D& rValue = (j==nDestStart ?
rArray.GetValue( j - nDestStart + nSrcStart, nIndex, nRegionEnd) :
rArray.GetNextValue( nIndex, nRegionEnd));
+ nRegionEnd = nRegionEnd - nSrcStart + nDestStart;
if (nRegionEnd > nDestEnd)
nRegionEnd = nDestEnd;
this->SetValue( j, nRegionEnd, rValue);
More information about the Libreoffice-commits
mailing list