PixelFormatList::operator[] must return the pointer to
PixelFormatListElement structure.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@269 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfbplayer/PixelFormatList.cxx b/rfbplayer/PixelFormatList.cxx
index b2d7ab2..25996f6 100644
--- a/rfbplayer/PixelFormatList.cxx
+++ b/rfbplayer/PixelFormatList.cxx
@@ -59,8 +59,8 @@
PF_DEFAULT_COUNT = PFList.size();
}
-PixelFormatListElement PixelFormatList::operator[](int index) {
- return *getIterator(index);
+PixelFormatListElement *PixelFormatList::operator[](int index) {
+ return &(*getIterator(index));
}
void PixelFormatList::add(char *format_name, PixelFormat PF) {
@@ -146,14 +146,14 @@
for (i = 0; i < getUserPFCount(); i++) {
char upf_name[20] = "\0";
sprintf(upf_name, "%s%i", "Upf", i);
- regKey.setBinary(upf_name, (void *)&operator[](i+getDefaultPFCount()),
+ regKey.setBinary(upf_name, (void *)operator[](i+getDefaultPFCount()),
sizeof(PixelFormatListElement));
}
}
int PixelFormatList::getIndexByPFName(const char *format_name) {
for (int i = 0; i < PixelFormatList::count(); i++) {
- if (_stricmp(operator[](i).format_name, format_name) == 0) return i;
+ if (_stricmp(operator[](i)->format_name, format_name) == 0) return i;
}
return -1;
}
\ No newline at end of file