// go to the position at "*"
aCursor.Move(pOutputDevice, MoveRight); // select "* b" and then copy
aCursor.Move(pOutputDevice, MoveRight, false);
aCursor.Move(pOutputDevice, MoveRight, false);
aCursor.Copy(); // go to the right end and then paste
aCursor.Move(pOutputDevice, MoveRight);
aCursor.Move(pOutputDevice, MoveRight);
aCursor.Paste();
#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason
CPPUNIT_ASSERT_EQUAL(u"{ { a * b } + { c * b } }"_ustr, xDocShRef->GetText()); #endif
}
void Test::testCopySelectPaste()
{ auto xTree = SmParser5().Parse(u"a * b + c"_ustr);
xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
// go to the right end for (int i = 0; i < 5; i++)
aCursor.Move(pOutputDevice, MoveRight); // select "b + c" and then copy
aCursor.Move(pOutputDevice, MoveLeft, false);
aCursor.Move(pOutputDevice, MoveLeft, false);
aCursor.Move(pOutputDevice, MoveLeft, false);
aCursor.Copy(); // go to the left end
aCursor.Move(pOutputDevice, MoveLeft);
aCursor.Move(pOutputDevice, MoveLeft); // select "a" and then paste
aCursor.Move(pOutputDevice, MoveRight, false);
aCursor.Paste();
#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason
CPPUNIT_ASSERT_EQUAL(u"{ { b + { c * b } } + c }"_ustr, xDocShRef->GetText()); #endif
}
void Test::testCutPaste()
{ auto xTree = SmParser5().Parse(u"a * b + c"_ustr);
xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
// go to the position at "*"
aCursor.Move(pOutputDevice, MoveRight); // select "* b" and then cut
aCursor.Move(pOutputDevice, MoveRight, false);
aCursor.Move(pOutputDevice, MoveRight, false);
aCursor.Cut(); // go to the right end and then paste
aCursor.Move(pOutputDevice, MoveRight);
aCursor.Move(pOutputDevice, MoveRight);
aCursor.Paste();
#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason
CPPUNIT_ASSERT_EQUAL(u"{ a + { c * b } }"_ustr, xDocShRef->GetText()); #endif
}
void Test::testCutSelectPaste()
{ auto xTree = SmParser5().Parse(u"a * b + c"_ustr);
xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
// go to the right end for (int i = 0; i < 5; i++)
aCursor.Move(pOutputDevice, MoveRight); // select "b + c" and then cut
aCursor.Move(pOutputDevice, MoveLeft, false);
aCursor.Move(pOutputDevice, MoveLeft, false);
aCursor.Move(pOutputDevice, MoveLeft, false);
aCursor.Cut(); // go to the left end
aCursor.Move(pOutputDevice, MoveLeft);
aCursor.Move(pOutputDevice, MoveLeft); // select "a" and then paste
aCursor.Move(pOutputDevice, MoveRight, false);
aCursor.Paste();
#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason
CPPUNIT_ASSERT_EQUAL(u"{ b + { c * {} } }"_ustr, xDocShRef->GetText()); #endif
}
void Test::testSelectSurrogatePairs()
{ auto xTree = SmParser5().Parse(u"\U0001EE4E"_ustr);
xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0);
// select the first character, cut, then paste
aCursor.Move(pOutputDevice, MoveRight, false);
aCursor.Cut();
aCursor.Paste();
#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason
CPPUNIT_ASSERT_EQUAL(u"\U0001EE4E"_ustr, xDocShRef->GetText()); #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.