/* `* Do not modify this code. */ int main(void) { printf("Int array addresses:\n"); intAddress(); printf("\n\nChar array addresses:\n"); charAddress(); printf("\n\nDouble array addresses:\n"); doubleAddress(); return 0; }
QTextCursor YFileCursor::qTextCursor(const YTextDocument * document) const { if(isNull()) { return QTextCursor(); } int anchor = fileToDocPos(charAddress(), document); int position = fileToDocPos(selectionEnd(), document); if(position < anchor) { std::swap(position, anchor); } QTextCursor cursor(document->begin()); cursor.setPosition(anchor); cursor.setPosition(position, QTextCursor::KeepAnchor); return cursor; }
void YFileCursor::setSelectionEnd(qint64 end) { m_length = end - charAddress(); }
qint64 YFileCursor::selectionEnd() const { return charAddress() + m_length; }