本文整理汇总了C++中FramePtr::insert_line方法的典型用法代码示例。如果您正苦于以下问题:C++ FramePtr::insert_line方法的具体用法?C++ FramePtr::insert_line怎么用?C++ FramePtr::insert_line使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FramePtr
的用法示例。
在下文中一共展示了FramePtr::insert_line方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rebuild_lines
//.........这里部分代码省略.........
printf("old [%d to %d] vs. new [%d to %d]\n",
old_line.w_start, old_line.w_end,
lp->w_start, lp->w_end);
#endif
if (old_line.baseline != -1)
{
add_line_refresh_extent(frame, &old_line);
}
}
else
{
#ifdef DEBUG_RL
printf("Line %d stayed the same\n", l_index);
#endif
/* We can end now! */
if (w_index > wrange.w_end)
{
break;
}
}
/* See if we're done. */
if (w_index >= word_count)
{
/* Run out of words. Finished. */
break;
}
/*
// Move to a new line.
// Add one if there are no more left.
*/
line_top = baseline + lp->descend;
if (++l_index == frame->number_of_lines())
{
/* Create a new dummy line. */
LINE line;
#ifdef DEBUG_RL
printf("(Create a new line)\n");
#endif
line.w_start = line.w_end = 0; /* In case. */
line.baseline = -1;
frame->insert_line(l_index, &line);
lp = frame->get_line(l_index);
}
else
{
/* Add a refresh extent for the old line in case it's changing. */
#ifdef DEBUG_RL
printf("(Move onto existing line)\n");
#endif
lp++;
}
}
#ifdef DEBUG_RL
printf("Done (final l_index:%d, w_index:%d)...\n", l_index, w_index);
#endif
/* If we flowed all words, delete any trailing lines. */
if (w_index == word_count)
{
if (++l_index < frame->number_of_lines())
{
while (l_index < frame->number_of_lines())
{
#ifdef DEBUG_RL
printf("{Delete line}");
#endif
add_line_refresh_extent(frame, frame->get_line(l_index));
frame->delete_line(l_index);
}
#ifdef DEBUG_RL
printf("\n");
#endif
}
}
if (frame_flags & FRAME_FLAG_ystretch_frame)
{
position_lines(frame, style.get_vertical_alignment());
object->ystretch_frame();
}
position_lines(frame, style.get_vertical_alignment());
/*
// Release our objects.
*/
paragraph->release(TRUE);
frame->release(TRUE);
return ERRORCODE_None;
}