summaryrefslogtreecommitdiff
path: root/include/sax
diff options
context:
space:
mode:
authorMohammed Abdul Azeem <azeemmysore@gmail.com>2017-06-28 21:45:39 +0530
committerMohammed Abdul Azeem <azeemmysore@gmail.com>2017-06-29 06:03:38 +0200
commitd6da9e495d7ca32de6cda1a94cb4c8cd26b240cc (patch)
treec630017cf61a93395e534e80bccb483e7baccb84 /include/sax
parent803a17533f25d9174c6a19aa913a6713980c193d (diff)
Using range-for instead of iterator loop:
It's much easier to write and looks cleaner. And this doesn't affect performance, I think. Change-Id: Ia946b068979b9cef04ac2479c9179a70b6775dea Reviewed-on: https://gerrit.libreoffice.org/39370 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mohammed Abdul Azeem <azeemmysore@gmail.com>
Diffstat (limited to 'include/sax')
-rw-r--r--include/sax/fastattribs.hxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index 958899015372..70ddc4c8bb85 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -123,22 +123,27 @@ public:
return mnIdx != rhs.mnIdx;
}
- sal_Int32 getToken()
+ const FastAttributeIter& operator*() const
+ {
+ return *this;
+ }
+
+ sal_Int32 getToken() const
{
assert(mnIdx < mrList.maAttributeTokens.size());
return mrList.maAttributeTokens[mnIdx];
}
- bool isEmpty()
+ bool isEmpty() const
{
assert(mnIdx < mrList.maAttributeTokens.size());
return mrList.AttributeValueLength(mnIdx) < 1;
}
- sal_Int32 toInt32()
+ sal_Int32 toInt32() const
{
assert(mnIdx < mrList.maAttributeTokens.size());
return rtl_str_toInt32(mrList.getFastAttributeValue(mnIdx), 10);
}
- OUString toString()
+ OUString toString() const
{
assert(mnIdx < mrList.maAttributeTokens.size());
return OUString(mrList.getFastAttributeValue(mnIdx),
@@ -146,12 +151,12 @@ public:
RTL_TEXTENCODING_UTF8);
}
- const char* toCString()
+ const char* toCString() const
{
assert(mnIdx < mrList.maAttributeTokens.size());
return mrList.getFastAttributeValue(mnIdx);
}
- bool isString(const char *str)
+ bool isString(const char *str) const
{
assert(mnIdx < mrList.maAttributeTokens.size());
return !strcmp(str, mrList.getFastAttributeValue(mnIdx));