Commit MetaInfo

Revision38b426a8b495cc1ac501ff2fe33816c2c093114a (tree)
Time2017-09-02 23:43:39
Author <exeal@user...>

Log Message

Updated Boost to 1.65.

Change Summary

Incremental Difference

diff -r 9c2e3f015a61 -r 38b426a8b495 ascension/ascension/graphics/geometry/affine-transform.hpp
--- a/ascension/ascension/graphics/geometry/affine-transform.hpp Tue Aug 22 01:07:32 2017 +0900
+++ b/ascension/ascension/graphics/geometry/affine-transform.hpp Sat Sep 02 23:43:39 2017 +0900
@@ -38,24 +38,36 @@
3838 */
3939
4040 /// Represents 2D affine transform.
41- typedef boost::geometry::strategy::transform::ublas_transformer<double, 2, 2> AffineTransform;
41+ typedef boost::geometry::strategy::transform::matrix_transformer<double, 2, 2> AffineTransform;
4242
4343 /**
4444 * @defgroup affine_transform_accesors Accesors
4545 * @{
4646 */
4747 /// Returns the X coordinate scaling element.
48- inline double scaleX(const AffineTransform& tx) BOOST_NOEXCEPT { return tx.matrix()(0, 0); }
48+ inline double scaleX(const AffineTransform& tx) BOOST_NOEXCEPT {
49+ return boost::qvm::A<0, 0>(tx.matrix());
50+ }
4951 /// Returns the Y coordinate scaling element.
50- inline double scaleY(const AffineTransform& tx) BOOST_NOEXCEPT { return tx.matrix()(1, 1); }
52+ inline double scaleY(const AffineTransform& tx) BOOST_NOEXCEPT {
53+ return boost::qvm::A<1, 1>(tx.matrix());
54+ }
5155 /// Returns the X coordinate shearing element.
52- inline double shearX(const AffineTransform& tx) BOOST_NOEXCEPT { return tx.matrix()(0, 1); }
56+ inline double shearX(const AffineTransform& tx) BOOST_NOEXCEPT {
57+ return boost::qvm::A<0, 1>(tx.matrix());
58+ }
5359 /// Returns the Y coordinate shearing element.
54- inline double shearY(const AffineTransform& tx) BOOST_NOEXCEPT { return tx.matrix()(1, 0); }
60+ inline double shearY(const AffineTransform& tx) BOOST_NOEXCEPT {
61+ return boost::qvm::A<1, 0>(tx.matrix());
62+ }
5563 /// Returns the X coordinate translation element.
56- inline double translateX(const AffineTransform& tx) BOOST_NOEXCEPT { return tx.matrix()(0, 2); }
64+ inline double translateX(const AffineTransform& tx) BOOST_NOEXCEPT {
65+ return boost::qvm::A<0, 2>(tx.matrix());
66+ }
5767 /// Returns the Y coordinate translation element.
58- inline double translateY(const AffineTransform& tx) BOOST_NOEXCEPT { return tx.matrix()(1, 2); }
68+ inline double translateY(const AffineTransform& tx) BOOST_NOEXCEPT {
69+ return boost::qvm::A<1, 2>(tx.matrix());
70+ }
5971 /// @}
6072
6173 /**
@@ -238,7 +250,7 @@
238250
239251 /// Returns @c true if the two represents the same affine coordinate transform.
240252 inline bool equals(const AffineTransform& lhs, const AffineTransform& rhs) {
241- return boost::equal(lhs.matrix().data(), rhs.matrix().data());
253+ return lhs.matrix() == rhs.matrix();
242254 }
243255
244256 /// Implements the hash function for @c AffineTransform.
diff -r 9c2e3f015a61 -r 38b426a8b495 ascension/src/graphics/font/text-layout-uniscribe.cpp
--- a/ascension/src/graphics/font/text-layout-uniscribe.cpp Tue Aug 22 01:07:32 2017 +0900
+++ b/ascension/src/graphics/font/text-layout-uniscribe.cpp Sat Sep 02 23:43:39 2017 +0900
@@ -2763,9 +2763,8 @@
27632763 if(isVertical(wm.blockFlowDirection)) {
27642764 // geometry::quadrantRotate(typographicalToPhysicalMapping, (resolveTextOrientation(writingMode()) != presentation::SIDEWAYS_LEFT) ? -1 : +1);
27652765 typographicalToPhysicalMapping = AffineTransform(
2766- boost::numeric::ublas::prod(
2767- typographicalToPhysicalMapping.matrix(),
2768- geometry::makeQuadrantRotationTransform((resolveTextOrientation(wm) != presentation::SIDEWAYS_LEFT) ? -1 : +1).matrix()));
2766+ typographicalToPhysicalMapping.matrix()
2767+ * geometry::makeQuadrantRotationTransform((resolveTextOrientation(wm) != presentation::SIDEWAYS_LEFT) ? -1 : +1).matrix());
27692768 }
27702769 BOOST_FOREACH(const graphics::Rectangle& typographicBounds, runBlackBoxBounds) {
27712770 // map typographic rectangle into physical coordinates
diff -r 9c2e3f015a61 -r 38b426a8b495 ascension/src/graphics/font/text-layout.cpp
--- a/ascension/src/graphics/font/text-layout.cpp Tue Aug 22 01:07:32 2017 +0900
+++ b/ascension/src/graphics/font/text-layout.cpp Sat Sep 02 23:43:39 2017 +0900
@@ -28,6 +28,7 @@
2828 #include <ascension/graphics/rendering-device.hpp>
2929 #include <ascension/presentation/writing-mode-mappings.hpp>
3030 #include <boost/foreach.hpp>
31+#include <boost/geometry/algorithms/intersection.hpp>
3132 #include <boost/range/algorithm/sort.hpp>
3233 #include <boost/range/numeric.hpp> // boost.accumulate
3334 #include <limits> // std.numeric_limits
diff -r 9c2e3f015a61 -r 38b426a8b495 ascension/src/graphics/font/text-run.cpp
--- a/ascension/src/graphics/font/text-run.cpp Tue Aug 22 01:07:32 2017 +0900
+++ b/ascension/src/graphics/font/text-run.cpp Sat Sep 02 23:43:39 2017 +0900
@@ -9,6 +9,7 @@
99 #include <ascension/graphics/font/font.hpp>
1010 #include <ascension/graphics/font/text-run.hpp>
1111 #include <ascension/graphics/geometry/point-xy.hpp>
12+#include <boost/geometry/algorithms/make.hpp>
1213
1314 namespace ascension {
1415 namespace graphics {
diff -r 9c2e3f015a61 -r 38b426a8b495 ascension/test/src/document-test.cpp
--- a/ascension/test/src/document-test.cpp Tue Aug 22 01:07:32 2017 +0900
+++ b/ascension/test/src/document-test.cpp Sat Sep 02 23:43:39 2017 +0900
@@ -29,10 +29,18 @@
2929 BOOST_TEST(boost::equal(d.accessibleRegion(), k::Region::zero()));
3030 BOOST_TEST(d.length() == 0u);
3131 BOOST_TEST(d.lineContent(0u).revisionNumber() == 0u);
32- BOOST_TEST(d.lineContent(0u).text() == ascension::String());
32+#if 1
33+ BOOST_TEST(d.lineContent(0u).text().empty());
34+#else
35+ BOOST_TEST(d.lineContent(0u).text() == ascension::String()); // C2338 at VS14
36+#endif
3337 BOOST_TEST(d.lineLength(0u) == 0u);
3438 BOOST_TEST(d.lineOffset(0u) == 0u);
35- BOOST_TEST(d.lineString(0u) == ascension::String());
39+#if 1
40+ BOOST_TEST(d.lineString(0u).empty());
41+#else
42+ BOOST_TEST(d.lineString(0u) == ascension::String()); // C2338 at VS14
43+#endif
3644 BOOST_TEST(d.numberOfLines() == 1u);
3745 BOOST_TEST(boost::equal(d.region(), k::Region::zero()));
3846 BOOST_TEST(d.revisionNumber() == 0u);
@@ -59,7 +67,7 @@
5967 BOOST_TEST(e == k::Position(0u, 5u));
6068 BOOST_TEST(d.accessibleRegion().equal(k::Region::makeSingleLine(0u, boost::irange(0u, 5u))));
6169 BOOST_TEST(d.length() == 5u);
62- BOOST_TEST(d.lineContent(0u).text() == fromLatin1("first"));
70+ BOOST_CHECK_EQUAL(d.lineContent(0u).text(), fromLatin1("first"));
6371 BOOST_TEST(d.lineLength(0u) == 5u);
6472 BOOST_TEST(d.lineOffset(0u) == 0u);
6573 BOOST_TEST(d.lineString(0u) == fromLatin1("first"));
@@ -459,49 +467,3 @@
459467 BOOST_REQUIRE(d.isReadOnly());
460468 BOOST_REQUIRE(d.revisionNumber() > 0u);
461469 }
462-
463-BOOST_AUTO_TEST_CASE(positions_api_test) {
464- k::Document d;
465- k::insert(d, k::Position::zero(), fromLatin1(
466- "abc\n"
467- "d[e\r\n"
468- "f]g\n"
469- "hij"
470- ));
471- d.narrowToRegion(k::Region(k::Position(1u, 1u), k::Position(2u, 2u)));
472- const k::Position before(0u, 2u), middle(2u, 0u), after(3u, 1u), outside(9u, 9u);
473-
474- // absoluteOffset
475- BOOST_TEST(k::positions::absoluteOffset(d, before, false) == 2u);
476- BOOST_CHECK_THROW(k::positions::absoluteOffset(d, before, true), k::DocumentAccessViolationException);
477- BOOST_TEST(k::positions::absoluteOffset(d, after, false) == 13u);
478- BOOST_TEST(k::positions::absoluteOffset(d, after, true) == 8u);
479- BOOST_CHECK_THROW(k::positions::absoluteOffset(d, outside, false), k::BadPositionException);
480-
481- // isOutsideOfDocumentRegion
482- BOOST_TEST(!k::positions::isOutsideOfDocumentRegion(d, *boost::const_begin(d.region())));
483- BOOST_TEST(!k::positions::isOutsideOfDocumentRegion(d, before));
484- BOOST_TEST(!k::positions::isOutsideOfDocumentRegion(d, after));
485- BOOST_TEST(!k::positions::isOutsideOfDocumentRegion(d, *boost::const_end(d.region())));
486- BOOST_TEST( k::positions::isOutsideOfDocumentRegion(d, outside));
487-
488- // shrinkToAccessibleRegion(Position)
489- BOOST_TEST(k::positions::shrinkToAccessibleRegion(d, before) == *boost::const_begin(d.accessibleRegion()));
490- BOOST_TEST(k::positions::shrinkToAccessibleRegion(d, middle) == middle);
491- BOOST_TEST(k::positions::shrinkToAccessibleRegion(d, after) == *boost::const_end(d.accessibleRegion()));
492- BOOST_TEST(k::positions::shrinkToAccessibleRegion(d, outside) == *boost::const_end(d.accessibleRegion()));
493-
494- // shrinkToAccessibleRegion(Region)
495- BOOST_TEST((k::positions::shrinkToAccessibleRegion(d, k::Region(before, after)) == d.accessibleRegion()));
496- BOOST_TEST((k::positions::shrinkToAccessibleRegion(d, k::Region(middle, outside)) == k::Region(middle, *boost::const_end(d.accessibleRegion()))));
497-
498- // shrinkToDocumentRegion(Position)
499- BOOST_TEST(k::positions::shrinkToDocumentRegion(d, before) == before);
500- BOOST_TEST(k::positions::shrinkToDocumentRegion(d, middle) == middle);
501- BOOST_TEST(k::positions::shrinkToDocumentRegion(d, after) == after);
502- BOOST_TEST(k::positions::shrinkToDocumentRegion(d, outside) == *boost::const_end(d.region()));
503-
504- // shrinkToDocumentRegion(Region)
505- BOOST_TEST((k::positions::shrinkToDocumentRegion(d, k::Region(before, after)) == k::Region(before, after)));
506- BOOST_TEST((k::positions::shrinkToDocumentRegion(d, k::Region(middle, outside)) == k::Region(middle, *boost::const_end(d.region()))));
507-}
diff -r 9c2e3f015a61 -r 38b426a8b495 ascension/test/src/locations-test.cpp
--- a/ascension/test/src/locations-test.cpp Tue Aug 22 01:07:32 2017 +0900
+++ b/ascension/test/src/locations-test.cpp Sat Sep 02 23:43:39 2017 +0900
@@ -160,3 +160,49 @@
160160 BOOST_REQUIRE((result != boost::none));
161161 BOOST_TEST(boost::get(result) == k::Position(2u, 0u));
162162 }
163+
164+BOOST_AUTO_TEST_CASE(positions_api_test) {
165+ k::Document d;
166+ k::insert(d, k::Position::zero(), fromLatin1(
167+ "abc\n"
168+ "d[e\r\n"
169+ "f]g\n"
170+ "hij"
171+ ));
172+ d.narrowToRegion(k::Region(k::Position(1u, 1u), k::Position(2u, 2u)));
173+ const k::Position before(0u, 2u), middle(2u, 0u), after(3u, 1u), outside(9u, 9u);
174+
175+ // absoluteOffset
176+ BOOST_TEST(k::locations::absoluteOffset(k::locations::makePointProxy(d, before), false) == 2u);
177+ BOOST_CHECK_THROW(k::locations::absoluteOffset(k::locations::makePointProxy(d, before), true), k::DocumentAccessViolationException);
178+ BOOST_TEST(k::locations::absoluteOffset(k::locations::makePointProxy(d, after), false) == 13u);
179+ BOOST_TEST(k::locations::absoluteOffset(k::locations::makePointProxy(d, after), true) == 8u);
180+ BOOST_CHECK_THROW(k::locations::absoluteOffset(k::locations::makePointProxy(d, outside), false), k::BadPositionException);
181+
182+ // isOutsideOfDocumentRegion
183+ BOOST_TEST(!k::locations::isOutsideOfDocumentRegion(k::locations::makePointProxy(d, *boost::const_begin(d.region()))));
184+ BOOST_TEST(!k::locations::isOutsideOfDocumentRegion(k::locations::makePointProxy(d, before)));
185+ BOOST_TEST(!k::locations::isOutsideOfDocumentRegion(k::locations::makePointProxy(d, after)));
186+ BOOST_TEST(!k::locations::isOutsideOfDocumentRegion(k::locations::makePointProxy(d, *boost::const_end(d.region()))));
187+ BOOST_TEST(k::locations::isOutsideOfDocumentRegion(k::locations::makePointProxy(d, outside)));
188+
189+ // shrinkToAccessibleRegion(Position)
190+ BOOST_TEST(k::locations::shrinkToAccessibleRegion(k::locations::makePointProxy(d, before)) == *boost::const_begin(d.accessibleRegion()));
191+ BOOST_TEST(k::locations::shrinkToAccessibleRegion(k::locations::makePointProxy(d, middle)) == middle);
192+ BOOST_TEST(k::locations::shrinkToAccessibleRegion(k::locations::makePointProxy(d, after)) == *boost::const_end(d.accessibleRegion()));
193+ BOOST_TEST(k::locations::shrinkToAccessibleRegion(k::locations::makePointProxy(d, outside)) == *boost::const_end(d.accessibleRegion()));
194+
195+ // shrinkToAccessibleRegion(Region)
196+ BOOST_TEST((k::locations::shrinkToAccessibleRegion(d, k::Region(before, after)) == d.accessibleRegion()));
197+ BOOST_TEST((k::locations::shrinkToAccessibleRegion(d, k::Region(middle, outside)) == k::Region(middle, *boost::const_end(d.accessibleRegion()))));
198+
199+ // shrinkToDocumentRegion(Position)
200+ BOOST_TEST(k::locations::shrinkToDocumentRegion(k::locations::makePointProxy(d, before)) == before);
201+ BOOST_TEST(k::locations::shrinkToDocumentRegion(k::locations::makePointProxy(d, middle)) == middle);
202+ BOOST_TEST(k::locations::shrinkToDocumentRegion(k::locations::makePointProxy(d, after)) == after);
203+ BOOST_TEST(k::locations::shrinkToDocumentRegion(k::locations::makePointProxy(d, outside)) == *boost::const_end(d.region()));
204+
205+ // shrinkToDocumentRegion(Region)
206+ BOOST_TEST((k::locations::shrinkToDocumentRegion(d, k::Region(before, after)) == k::Region(before, after)));
207+ BOOST_TEST((k::locations::shrinkToDocumentRegion(d, k::Region(middle, outside)) == k::Region(middle, *boost::const_end(d.region()))));
208+}
Show on old repository browser