Commit MetaInfo

Revisiona29b7837b494e1d220191e9d8984b6744bed91a3 (tree)
Time2017-10-27 00:20:30
Author <exeal@user...>

Log Message

Removed kernel.locations.characterAt free function.

Change Summary

Incremental Difference

diff -r f6d5836b3609 -r a29b7837b494 ascension/ascension/kernel/locations.hpp
--- a/ascension/ascension/kernel/locations.hpp Fri Oct 27 00:19:09 2017 +0900
+++ b/ascension/ascension/kernel/locations.hpp Fri Oct 27 00:20:30 2017 +0900
@@ -80,7 +80,6 @@
8080 /// @defgroup miscellaneous_locational_functions Miscellaneous Locational Functions
8181 /// @{
8282 Index absoluteOffset(const PointProxy& p, bool fromAccessibleStart);
83- CodePoint characterAt(const PointProxy& p, bool useLineFeed = false);
8483 Position updatePosition(const Position& position, const DocumentChange& change, Direction gravity) BOOST_NOEXCEPT;
8584 /// @}
8685
diff -r f6d5836b3609 -r a29b7837b494 ascension/src/kernel/locations.cpp
--- a/ascension/src/kernel/locations.cpp Fri Oct 27 00:19:09 2017 +0900
+++ b/ascension/src/kernel/locations.cpp Fri Oct 27 00:20:30 2017 +0900
@@ -80,20 +80,6 @@
8080 }
8181
8282 /**
83- * Returns the code point of the current character.
84- * @param p The base point
85- * @param useLineFeed Set @c true to return LF (U+000A) when the current position is the end of the line.
86- * Otherwise LS (U+2008)
87- * @return The code point of the character, or @c INVALID_CODE_POINT if @a p is the end of the document
88- */
89- CodePoint characterAt(const PointProxy& p, bool useLineFeed /* = false */) {
90- const auto& lineString = document(p).lineString(line(p));
91- if(offsetInLine(p) == lineString.length())
92- return (line(p) == document(p).numberOfLines() - 1) ? text::INVALID_CODE_POINT : (useLineFeed ? text::LINE_FEED : text::LINE_SEPARATOR);
93- return text::utf::decodeFirst(std::begin(lineString) + offsetInLine(p), std::end(lineString));
94- }
95-
96- /**
9783 * Returns the end of the document.
9884 * @param p The base point
9985 * @return The destination
diff -r f6d5836b3609 -r a29b7837b494 ascension/src/viewer/caret-functions.cpp
--- a/ascension/src/viewer/caret-functions.cpp Fri Oct 27 00:19:09 2017 +0900
+++ b/ascension/src/viewer/caret-functions.cpp Fri Oct 27 00:20:30 2017 +0900
@@ -384,7 +384,7 @@
384384 kernel::Position pos[3];
385385 const kernel::Region region(caret.document().accessibleRegion());
386386
387- if(text::ucd::BinaryProperty::is<text::ucd::BinaryProperty::GRAPHEME_EXTEND>(kernel::locations::characterAt(caret))) // not the start of a grapheme
387+ if(text::ucd::BinaryProperty::is<text::ucd::BinaryProperty::GRAPHEME_EXTEND>(*kernel::DocumentCharacterIterator(caret))) // not the start of a grapheme
388388 return false;
389389 const auto ip(insertionPosition(caret));
390390 if(!encompasses(region, ip)) // inaccessible
Show on old repository browser