if (r != E_SUCCESS)
{
- //?? need log
return r;
}
int left = 0;
int right = 0;
+ int determinedCount = -1;
for (GapList::Iterator i = gapList.Begin(); i != gapList.End(); ++i)
{
left = (i->first < left) ? i->first : left;
right = (i->second > right) ? i->second : right;
+
+ if (determinedCount < 0 && i->first < width && i->second >= width)\r
+ {\r
+ if (i != gapList.Begin())\r
+ {\r
+ if (i - gapList.Begin() - 1 < text.length)\r
+ {\r
+ determinedCount = bidiProperty.pBidiIndex[i - gapList.Begin() - 1];\r
+ }\r
+ else\r
+ {\r
+ determinedCount = text.length;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ determinedCount = 0;\r
+ }\r
+ }\r
}
if (right - left <= width)
pcDim.SetSize(right - left, __fontAttrib.size.ToInt());
count = text.length;
}
- else
+ else
{
- return this->GetTextExtent(width, _Util::String(text.pStart, text.length - 1), outline, count, pcDim);
+ _TextBidiPropertyWithReorder determinedBidiProperty(text.pStart, text.length);\r
+\r
+ GapList determinedGapList;
+
+ result r = this->__GetTextExtentList(determinedBidiProperty, determinedGapList);
+
+ if (r != E_SUCCESS)
+ {
+ return r;
+ }
+
+ for (GapList::Iterator i = determinedGapList.Begin(); i != determinedGapList.End(); ++i)
+ {
+ left = (i->first < left) ? i->first : left;
+ right = (i->second > right) ? i->second : right;
+ }\r
+\r
+ pcDim.SetSize(right - left, __fontAttrib.size.ToInt());\r
+ count = (determinedCount >= 0) ? determinedCount : 0;
}
return E_SUCCESS;