diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-05 14:29:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-10 12:31:43 +0200 |
commit | 0fb5ca6cc9cc55a4436a36c533461769b1fc8526 (patch) | |
tree | 30e21bfcb0a6ad46f52a4e664728753c03d7a837 /writerfilter/source/dmapper/TableData.hxx | |
parent | 1a33947a91685808fd5f6d4903b6ae896686066d (diff) |
tdf#79877 perf loading docx file, writerfilter/ improvements
this improves load time by 20%.
We switch from shared_ptr to tools::SvRef to manage the objects
I noticed some double inheritance like this:
DomainMapper
LoggedProperties
Properties
SvRefBase
LoggedTable
Table
SvRefBase
so to be safe I made all the ref-count-base-class inheritance
virtual.
Change-Id: Ia3de9733f5c6966e8171f43d083dcc087040b8cd
Reviewed-on: https://gerrit.libreoffice.org/57022
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerfilter/source/dmapper/TableData.hxx')
-rw-r--r-- | writerfilter/source/dmapper/TableData.hxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx index a3614b953605..44805a070d75 100644 --- a/writerfilter/source/dmapper/TableData.hxx +++ b/writerfilter/source/dmapper/TableData.hxx @@ -33,7 +33,7 @@ namespace dmapper /** Class containing the data to describe a table cell. */ -class CellData final +class CellData final : public virtual SvRefBase { /** Handle to start of cell. @@ -53,7 +53,7 @@ class CellData final bool mbOpen; public: - typedef std::shared_ptr<CellData> Pointer_t; + typedef tools::SvRef<CellData> Pointer_t; CellData(css::uno::Reference<css::text::XTextRange> const & start, TablePropertyMapPtr pProps) : mStart(start), mEnd(start), mpProps(pProps), mbOpen(true) @@ -75,7 +75,7 @@ public: void insertProperties(TablePropertyMapPtr pProps) { if( mpProps.get() ) - mpProps->InsertProps(pProps); + mpProps->InsertProps(pProps.get()); else mpProps = pProps; } @@ -101,7 +101,7 @@ public: /** Class to handle data of a table row. */ -class RowData final +class RowData final : public virtual SvRefBase { typedef ::std::vector<CellData::Pointer_t> Cells; @@ -116,12 +116,12 @@ class RowData final mutable TablePropertyMapPtr mpProperties; public: - typedef std::shared_ptr<RowData> Pointer_t; + typedef tools::SvRef<RowData> Pointer_t; RowData() {} RowData(const RowData& rRowData) - : mCells(rRowData.mCells), mpProperties(rRowData.mpProperties) + : SvRefBase(), mCells(rRowData.mCells), mpProperties(rRowData.mpProperties) { } @@ -161,7 +161,7 @@ public: if( !mpProperties.get() ) mpProperties = pProperties; else - mpProperties->InsertProps(pProperties); + mpProperties->InsertProps(pProperties.get()); } } @@ -235,7 +235,7 @@ public: /** Class that holds the data of a table. */ -class TableData +class TableData : public virtual SvRefBase { typedef RowData::Pointer_t RowPointer_t; typedef ::std::vector<RowPointer_t> Rows; @@ -261,7 +261,7 @@ class TableData void newRow() { mpRow = RowPointer_t(new RowData()); } public: - typedef std::shared_ptr<TableData> Pointer_t; + typedef tools::SvRef<TableData> Pointer_t; explicit TableData(unsigned int nDepth) : mnDepth(nDepth) { newRow(); } |