Kaydet (Commit) 9734a6e1 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

GetWasUsed can return by value, no need to be a special snowflake

Change-Id: I4ef22fa49ee883ff0bddb49d1711e8521905502f
Reviewed-on: https://gerrit.libreoffice.org/33658Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 8145a808
......@@ -114,7 +114,7 @@ public:
// get the style name that was generated for a key
OUString GetStyleName( sal_uInt32 nKey );
void GetWasUsed(css::uno::Sequence<sal_Int32>& rWasUsed);
css::uno::Sequence<sal_Int32> GetWasUsed();
void SetWasUsed(const css::uno::Sequence<sal_Int32>& rWasUsed);
......
......@@ -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()));
}
}
}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment