diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-01-29 12:28:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-30 06:06:36 +0000 |
commit | 9734a6e1c3930c29aa3c7b80cb896d57c2bebe31 (patch) | |
tree | 52be08c9313f09f1d9d99d80b2db20e26b5ca4e6 /xmloff | |
parent | 8145a80868aeb2d81abdeb2918942911c6d128f4 (diff) |
GetWasUsed can return by value, no need to be a special snowflake
Change-Id: I4ef22fa49ee883ff0bddb49d1711e8521905502f
Reviewed-on: https://gerrit.libreoffice.org/33658
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfe.cxx | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index cd8a9c487c9c..077cb4f55dd4 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -557,9 +557,7 @@ SvXMLExport::~SvXMLExport() OUString sWrittenNumberFormats(XML_WRITTENNUMBERSTYLES); if (xPropertySetInfo->hasPropertyByName(sWrittenNumberFormats)) { - uno::Sequence<sal_Int32> aWasUsed; - mpNumExport->GetWasUsed(aWasUsed); - mxExportInfo->setPropertyValue(sWrittenNumberFormats, Any(aWasUsed)); + mxExportInfo->setPropertyValue(sWrittenNumberFormats, Any(mpNumExport->GetWasUsed())); } } } diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index bb5db1bea964..07e4ac23c126 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -106,7 +106,7 @@ public: bool GetFirstUsed(sal_uInt32& nKey); bool GetNextUsed(sal_uInt32& nKey); - void GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed); + uno::Sequence<sal_Int32> GetWasUsed(); void SetWasUsed(const uno::Sequence<sal_Int32>& rWasUsed); }; @@ -182,10 +182,10 @@ bool SvXMLNumUsedList_Impl::GetNextUsed(sal_uInt32& nKey) return bRet; } -void SvXMLNumUsedList_Impl::GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed) +uno::Sequence<sal_Int32> SvXMLNumUsedList_Impl::GetWasUsed() { - rWasUsed.realloc(nWasUsedCount); - sal_Int32* pWasUsed = rWasUsed.getArray(); + uno::Sequence<sal_Int32> ret(nWasUsedCount); + sal_Int32* pWasUsed = ret.getArray(); if (pWasUsed) { SvXMLuInt32Set::const_iterator aItr = aWasUsed.begin(); @@ -196,6 +196,7 @@ void SvXMLNumUsedList_Impl::GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed) ++pWasUsed; } } + return ret; } void SvXMLNumUsedList_Impl::SetWasUsed(const uno::Sequence<sal_Int32>& rWasUsed) @@ -1889,10 +1890,11 @@ void SvXMLNumFmtExport::SetUsed( sal_uInt32 nKey ) } } -void SvXMLNumFmtExport::GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed) +uno::Sequence<sal_Int32> SvXMLNumFmtExport::GetWasUsed() { if (pUsedList) - pUsedList->GetWasUsed(rWasUsed); + return pUsedList->GetWasUsed(); + return uno::Sequence<sal_Int32>(); } void SvXMLNumFmtExport::SetWasUsed(const uno::Sequence<sal_Int32>& rWasUsed) |