Cleanup measure function

Summary: Trivial diff that cleans up measure function in C++ and Android

Reviewed By: shergin

Differential Revision: D13200340

fbshipit-source-id: 6c0888439640241cdedf514898a1ba3dac231d6a
This commit is contained in:
David Vacca 2018-11-30 17:16:21 -08:00 committed by Facebook Github Bot
parent a2ead1c7b5
commit 3c50d04cf2
5 changed files with 4 additions and 9 deletions

View File

@ -36,8 +36,10 @@ void ParagraphShadowNode::updateLocalDataIfNeeded() {
ensureUnsealed();
auto attributedString = getAttributedString();
auto currentLocalData = std::static_pointer_cast<const ParagraphLocalData>(getLocalData());
if (currentLocalData && currentLocalData->getAttributedString() == attributedString) {
auto currentLocalData =
std::static_pointer_cast<const ParagraphLocalData>(getLocalData());
if (currentLocalData &&
currentLocalData->getAttributedString() == attributedString) {
return;
}
@ -51,7 +53,6 @@ void ParagraphShadowNode::updateLocalDataIfNeeded() {
Size ParagraphShadowNode::measure(LayoutConstraints layoutConstraints) const {
return textLayoutManager_->measure(
getTag(),
getAttributedString(),
getProps()->paragraphAttributes,
layoutConstraints);

View File

@ -23,7 +23,6 @@ void *TextLayoutManager::getNativeTextLayoutManager() const {
}
Size TextLayoutManager::measure(
Tag reactTag,
AttributedString attributedString,
ParagraphAttributes paragraphAttributes,
LayoutConstraints layoutConstraints) const {
@ -34,7 +33,6 @@ Size TextLayoutManager::measure(
auto clazz =
jni::findClassStatic("com/facebook/fbreact/fabric/FabricUIManager");
static auto measure = clazz->getMethod<jlong(
jint,
jstring,
ReadableNativeMap::javaobject,
ReadableNativeMap::javaobject,
@ -52,7 +50,6 @@ Size TextLayoutManager::measure(
local_ref<JString> componentName = make_jstring("RCTText");
return yogaMeassureToSize(measure(
fabricUIManager,
reactTag,
componentName.get(),
ReadableNativeMap::newObjectCxxArgs(toDynamic(attributedString)).get(),
ReadableNativeMap::newObjectCxxArgs(toDynamic(paragraphAttributes)).get(),

View File

@ -34,7 +34,6 @@ class TextLayoutManager {
* Measures `attributedString` using native text rendering infrastructure.
*/
Size measure(
Tag reactTag,
AttributedString attributedString,
ParagraphAttributes paragraphAttributes,
LayoutConstraints layoutConstraints) const;

View File

@ -33,7 +33,6 @@ class TextLayoutManager {
* Measures `attributedString` using native text rendering infrastructure.
*/
Size measure(
Tag reactTag,
AttributedString attributedString,
ParagraphAttributes paragraphAttributes,
LayoutConstraints layoutConstraints) const;

View File

@ -27,7 +27,6 @@ void *TextLayoutManager::getNativeTextLayoutManager() const {
}
Size TextLayoutManager::measure(
Tag reactTag,
AttributedString attributedString,
ParagraphAttributes paragraphAttributes,
LayoutConstraints layoutConstraints) const {