mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1139972 - IPC Proxy for charAt, r=tbsaunde
This commit is contained in:
parent
da2f7bc6c1
commit
af5f6aae1a
@ -183,15 +183,21 @@ static gunichar
|
||||
getCharacterAtOffsetCB(AtkText* aText, gint aOffset)
|
||||
{
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||
if (!accWrap)
|
||||
return 0;
|
||||
if (accWrap) {
|
||||
HyperTextAccessible* text = accWrap->AsHyperText();
|
||||
if (!text || !text->IsTextRole()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
HyperTextAccessible* text = accWrap->AsHyperText();
|
||||
if (!text || !text->IsTextRole())
|
||||
return 0;
|
||||
// char16_t is unsigned short in Mozilla, gnuichar is guint32 in glib.
|
||||
return static_cast<gunichar>(text->CharAt(aOffset));
|
||||
}
|
||||
|
||||
// char16_t is unsigned short in Mozilla, gnuichar is guint32 in glib.
|
||||
return static_cast<gunichar>(text->CharAt(aOffset));
|
||||
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
|
||||
return static_cast<gunichar>(proxy->CharAt(aOffset));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gchar*
|
||||
|
@ -292,5 +292,16 @@ DocAccessibleChild::RecvGetTextBeforeOffset(const uint64_t& aID,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
DocAccessibleChild::RecvCharAt(const uint64_t& aID,
|
||||
const int32_t& aOffset,
|
||||
uint16_t* aChar)
|
||||
{
|
||||
HyperTextAccessible* acc = IdToHyperTextAccessible(aID);
|
||||
*aChar = acc && acc->IsTextRole() ?
|
||||
static_cast<uint16_t>(acc->CharAt(aOffset)) : 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,10 @@ public:
|
||||
nsString* aText, int32_t* aStartOffset,
|
||||
int32_t* aEndOffset) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvCharAt(const uint64_t& aID,
|
||||
const int32_t& aOffset,
|
||||
uint16_t* aChar) MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
DocAccessible* mDoc;
|
||||
};
|
||||
|
@ -75,6 +75,7 @@ child:
|
||||
returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset);
|
||||
prio(high) sync GetTextBeforeOffset(uint64_t aID, int32_t aOffset, int32_t aBoundaryType)
|
||||
returns(nsString aText, int32_t aStartOffset, int32_t aEndOffset);
|
||||
prio(high) sync CharAt(uint64_t aID, int32_t aOffset) returns(uint16_t aChar);
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -202,5 +202,13 @@ ProxyAccessible::GetTextBeforeOffset(int32_t aOffset,
|
||||
&aText, aStartOffset, aEndOffset);
|
||||
}
|
||||
|
||||
char16_t
|
||||
ProxyAccessible::CharAt(int32_t aOffset)
|
||||
{
|
||||
uint16_t retval = 0;
|
||||
unused << mDoc->SendCharAt(mID, aOffset, &retval);
|
||||
return static_cast<char16_t>(retval);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -120,6 +120,8 @@ public:
|
||||
nsString& aText, int32_t* aStartOffset,
|
||||
int32_t* aEndOffset);
|
||||
|
||||
char16_t CharAt(int32_t aOffset);
|
||||
|
||||
/**
|
||||
* Allow the platform to store a pointers worth of data on us.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user