summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorKenneth Venken <kenneth.venken@gmail.com>2010-10-18 12:28:33 +0200
committerDavid Tardon <dtardon@redhat.com>2010-10-18 12:28:33 +0200
commitbbe30ed8144fbfee7500b98a67224731c581663e (patch)
tree69c3c4238eb51d2be523c9eb9e1e2a498c36b9cf /svl
parent309b89b93489c785a7ed2460ad5064ff0422dfd3 (diff)
replace sizeof(foo)/sizeof(foo[0]) by SAL_N_ELEMENTS
Diffstat (limited to 'svl')
-rw-r--r--svl/qa/test_URIHelper.cxx5
-rw-r--r--svl/source/items/srchitem.cxx3
2 files changed, 5 insertions, 3 deletions
diff --git a/svl/qa/test_URIHelper.cxx b/svl/qa/test_URIHelper.cxx
index cbd7eaaede66..06b2eb27d234 100644
--- a/svl/qa/test_URIHelper.cxx
+++ b/svl/qa/test_URIHelper.cxx
@@ -64,6 +64,7 @@
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "sal/types.h"
+#include <sal/macros.h>
#include "tools/solar.h"
#include "unotools/charclass.hxx"
@@ -285,7 +286,7 @@ void Test::testNormalizedMakeRelative() {
"nonex3/nonex4" }
#endif
};
- for (std::size_t i = 0; i < sizeof tests / sizeof tests[0]; ++i) {
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) {
css::uno::Reference< css::uri::XUriReference > ref(
URIHelper::normalizedMakeRelative(
m_context, rtl::OUString::createFromAscii(tests[i].base),
@@ -415,7 +416,7 @@ void Test::testFindFirstURLInText() {
com::sun::star::lang::Locale(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")), rtl::OUString()));
- for (std::size_t i = 0; i < sizeof tests / sizeof tests[0]; ++i) {
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) {
rtl::OUString input(rtl::OUString::createFromAscii(tests[i].input));
xub_StrLen begin = 0;
xub_StrLen end = static_cast< xub_StrLen >(input.getLength());
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index 96ee35ae92c5..91ca71f180fe 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -32,6 +32,7 @@
// include ---------------------------------------------------------------
#include <svl/srchitem.hxx>
+#include <sal/macros.h>
#include <unotools/searchopt.hxx>
#include <com/sun/star/util/XReplaceable.hpp>
@@ -98,7 +99,7 @@ static Sequence< ::rtl::OUString > lcl_GetNotifyNames()
"Japanese/IsIgnoreMiddleDot" // 18
};
- const int nCount = sizeof( aTranslitNames ) / sizeof( aTranslitNames[0] );
+ const int nCount = SAL_N_ELEMENTS( aTranslitNames );
Sequence< ::rtl::OUString > aNames( nCount );
::rtl::OUString* pNames = aNames.getArray();
for (INT32 i = 0; i < nCount; ++i)