[Libreoffice] [PATCH] eliminate SvUShorts type

Daniel Di Marco d.dimarco at gmx.de
Sat Oct 29 10:33:59 PDT 2011


Hi all,

attached is a (unfortunately rather long) patch that removes the 
SvUShorts data type from the LibreOffice sources.

Mostly, the changes are obvious replacements (Count() methods -> size(), 
etc.) but a more experienced hacker may want to check some of my choices:

* SvSUhorts.GetData(): I replaced calls of vec.GetData() with 
&(*vec.begin()), e.g. in editeng/source/rtf/rtfitem.cxx:
-#define PARDID      ((RTFPardAttrMapIds*)aPardMap.GetData())
+#define PARDID      ((RTFPardAttrMapIds*)&(*aPardMap.begin()))

* sorting: qsort -> std::sort, e.g. in cui/source/dialogs/iconcdlg.cxx:
-qsort( (void*)aUS.GetData(), aUS.Count(), sizeof(sal_uInt16), 
IconcDlgCmpUS_Impl );
+std::sort( aUS.begin(), aUS.end() );

* copying: memcpy -> std::copy, e.g. in cui/source/dialogs/iconcdlg.cxx:
-memcpy(pRanges, aUS.GetData(), sizeof(sal_uInt16) * aUS.Count());
+std::copy( aUS.begin(), aUS.end(), pRanges );


Best regards,
Daniel


More information about the LibreOffice mailing list