Skip to content

Commit

Permalink
Refactor: rename param for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
ebruchez committed Jan 18, 2025
1 parent 7851455 commit c77547e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ class XFormsControl(
def hasJavaScriptInitialization = false

def compareExternalMaybeClientValue(
previousValueOpt : Option[String],
previousControlOpt : Option[XFormsControl],
collector : ErrorEventCollector
clientValueOpt : Option[String],
previousControlOpt: Option[XFormsControl],
collector : ErrorEventCollector
): Boolean =
// NOTE: See https://github.com/orbeon/orbeon-forms/issues/2857. We might consider removing this
// optimization as it is dangerous. `XFormsValueControl` works around it by calling
// `compareExternalUseExternalValue` directly.
(previousControlOpt exists (_ eq self)) && (getInitialLocal eq getCurrentLocal) ||
compareExternalUseExternalValue(previousValueOpt, previousControlOpt, collector)
compareExternalUseExternalValue(clientValueOpt, previousControlOpt, collector)

// Compare this control with another control, as far as the comparison is relevant for the external world.
def compareExternalUseExternalValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,14 @@ trait XFormsValueControl extends XFormsSingleNodeControl {
}

final override def compareExternalMaybeClientValue(
previousValueOpt : Option[String],
previousControlOpt : Option[XFormsControl],
collector : ErrorEventCollector
clientValueOpt : Option[String],
previousControlOpt: Option[XFormsControl],
collector : ErrorEventCollector
): Boolean =
// NOTE: Call `compareExternalUseExternalValue` directly so as to avoid check on
// `(previousControlOpt exists (_ eq this)) && (getInitialLocal eq getCurrentLocal)` which
// causes part of https://github.com/orbeon/orbeon-forms/issues/2857.
compareExternalUseExternalValue(previousValueOpt orElse (previousControlOpt flatMap (_.asInstanceOf[XFormsValueControl].externalValueOpt(collector))), previousControlOpt, collector)
compareExternalUseExternalValue(clientValueOpt orElse (previousControlOpt flatMap (_.asInstanceOf[XFormsValueControl].externalValueOpt(collector))), previousControlOpt, collector)

override def compareExternalUseExternalValue(
previousExternalValue: Option[String],
Expand Down

0 comments on commit c77547e

Please sign in to comment.