summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2017-01-29 12:28:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-30 06:06:36 +0000
commit9734a6e1c3930c29aa3c7b80cb896d57c2bebe31 (patch)
tree52be08c9313f09f1d9d99d80b2db20e26b5ca4e6 /xmloff/source/style
parent8145a80868aeb2d81abdeb2918942911c6d128f4 (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/source/style')
-rw-r--r--xmloff/source/style/xmlnumfe.cxx14
1 files changed, 8 insertions, 6 deletions
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)