mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1173876 - make getText{At,After,Before}OffsetCB work with proxies r=lsocks
This commit is contained in:
parent
f036df8e47
commit
6fb3a347e0
@ -163,22 +163,24 @@ getTextAfterOffsetCB(AtkText *aText, gint aOffset,
|
|||||||
AtkTextBoundary aBoundaryType,
|
AtkTextBoundary aBoundaryType,
|
||||||
gint *aStartOffset, gint *aEndOffset)
|
gint *aStartOffset, gint *aEndOffset)
|
||||||
{
|
{
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
nsAutoString autoStr;
|
||||||
if (!accWrap)
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
HyperTextAccessible* text = accWrap->AsHyperText();
|
|
||||||
if (!text || !text->IsTextRole())
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
nsAutoString autoStr;
|
|
||||||
int32_t startOffset = 0, endOffset = 0;
|
int32_t startOffset = 0, endOffset = 0;
|
||||||
text->TextAfterOffset(aOffset, aBoundaryType, &startOffset, &endOffset, autoStr);
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||||
|
if (accWrap) {
|
||||||
|
HyperTextAccessible* text = accWrap->AsHyperText();
|
||||||
|
if (!text || !text->IsTextRole())
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
text->TextAfterOffset(aOffset, aBoundaryType, &startOffset, &endOffset, autoStr);
|
||||||
|
ConvertTexttoAsterisks(accWrap, autoStr);
|
||||||
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
|
||||||
|
proxy->GetTextAfterOffset(aOffset, aBoundaryType, autoStr, &startOffset,
|
||||||
|
&endOffset);
|
||||||
|
}
|
||||||
|
|
||||||
*aStartOffset = startOffset;
|
*aStartOffset = startOffset;
|
||||||
*aEndOffset = endOffset;
|
*aEndOffset = endOffset;
|
||||||
|
|
||||||
ConvertTexttoAsterisks(accWrap, autoStr);
|
|
||||||
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
|
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
|
||||||
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
|
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
|
||||||
}
|
}
|
||||||
@ -188,23 +190,26 @@ getTextAtOffsetCB(AtkText *aText, gint aOffset,
|
|||||||
AtkTextBoundary aBoundaryType,
|
AtkTextBoundary aBoundaryType,
|
||||||
gint *aStartOffset, gint *aEndOffset)
|
gint *aStartOffset, gint *aEndOffset)
|
||||||
{
|
{
|
||||||
|
nsAutoString autoStr;
|
||||||
|
int32_t startOffset = 0, endOffset = 0;
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||||
if (!accWrap)
|
if (accWrap) {
|
||||||
return nullptr;
|
HyperTextAccessible* text = accWrap->AsHyperText();
|
||||||
|
if (!text || !text->IsTextRole())
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
HyperTextAccessible* text = accWrap->AsHyperText();
|
|
||||||
if (!text || !text->IsTextRole())
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
nsAutoString autoStr;
|
|
||||||
int32_t startOffset = 0, endOffset = 0;
|
|
||||||
text->TextAtOffset(aOffset, aBoundaryType, &startOffset, &endOffset, autoStr);
|
text->TextAtOffset(aOffset, aBoundaryType, &startOffset, &endOffset, autoStr);
|
||||||
*aStartOffset = startOffset;
|
|
||||||
*aEndOffset = endOffset;
|
|
||||||
|
|
||||||
ConvertTexttoAsterisks(accWrap, autoStr);
|
ConvertTexttoAsterisks(accWrap, autoStr);
|
||||||
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
|
||||||
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
|
proxy->GetTextAtOffset(aOffset, aBoundaryType, autoStr, &startOffset,
|
||||||
|
&endOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
*aStartOffset = startOffset;
|
||||||
|
*aEndOffset = endOffset;
|
||||||
|
|
||||||
|
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
|
||||||
|
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gunichar
|
static gunichar
|
||||||
@ -233,22 +238,25 @@ getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
|
|||||||
AtkTextBoundary aBoundaryType,
|
AtkTextBoundary aBoundaryType,
|
||||||
gint *aStartOffset, gint *aEndOffset)
|
gint *aStartOffset, gint *aEndOffset)
|
||||||
{
|
{
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
|
||||||
if (!accWrap)
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
HyperTextAccessible* text = accWrap->AsHyperText();
|
|
||||||
if (!text || !text->IsTextRole())
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
nsAutoString autoStr;
|
nsAutoString autoStr;
|
||||||
int32_t startOffset = 0, endOffset = 0;
|
int32_t startOffset = 0, endOffset = 0;
|
||||||
text->TextBeforeOffset(aOffset, aBoundaryType,
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
|
||||||
&startOffset, &endOffset, autoStr);
|
if (accWrap) {
|
||||||
|
HyperTextAccessible* text = accWrap->AsHyperText();
|
||||||
|
if (!text || !text->IsTextRole())
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
text->TextBeforeOffset(aOffset, aBoundaryType,
|
||||||
|
&startOffset, &endOffset, autoStr);
|
||||||
|
ConvertTexttoAsterisks(accWrap, autoStr);
|
||||||
|
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
|
||||||
|
proxy->GetTextBeforeOffset(aOffset, aBoundaryType, autoStr, &startOffset,
|
||||||
|
&endOffset);
|
||||||
|
}
|
||||||
|
|
||||||
*aStartOffset = startOffset;
|
*aStartOffset = startOffset;
|
||||||
*aEndOffset = endOffset;
|
*aEndOffset = endOffset;
|
||||||
|
|
||||||
ConvertTexttoAsterisks(accWrap, autoStr);
|
|
||||||
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
|
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
|
||||||
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
|
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user