Have SharedSolver return the solver result from Validate*() methods.
This commit is contained in:
@@ -152,11 +152,11 @@ SharedSolver::LayoutLeaving(BALMLayout* layout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
ResultType
|
||||||
SharedSolver::ValidateMinSize()
|
SharedSolver::ValidateMinSize()
|
||||||
{
|
{
|
||||||
if (fMinValid)
|
if (fMinValid)
|
||||||
return;
|
return fMinResult;
|
||||||
|
|
||||||
_ValidateConstraints();
|
_ValidateConstraints();
|
||||||
|
|
||||||
@@ -167,14 +167,15 @@ SharedSolver::ValidateMinSize()
|
|||||||
|
|
||||||
fMinValid = true;
|
fMinValid = true;
|
||||||
fLayoutValid = false;
|
fLayoutValid = false;
|
||||||
|
return fMinResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
ResultType
|
||||||
SharedSolver::ValidateMaxSize()
|
SharedSolver::ValidateMaxSize()
|
||||||
{
|
{
|
||||||
if (fMaxValid)
|
if (fMaxValid)
|
||||||
return;
|
return fMaxResult;
|
||||||
|
|
||||||
_ValidateConstraints();
|
_ValidateConstraints();
|
||||||
|
|
||||||
@@ -185,14 +186,16 @@ SharedSolver::ValidateMaxSize()
|
|||||||
|
|
||||||
fMaxValid = true;
|
fMaxValid = true;
|
||||||
fLayoutValid = false;
|
fLayoutValid = false;
|
||||||
|
|
||||||
|
return fMaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
ResultType
|
||||||
SharedSolver::ValidateLayout(BLayoutContext* context)
|
SharedSolver::ValidateLayout(BLayoutContext* context)
|
||||||
{
|
{
|
||||||
if (fLayoutValid && fLayoutContext == context)
|
if (fLayoutValid && fLayoutContext == context)
|
||||||
return;
|
return fLayoutResult;
|
||||||
|
|
||||||
_SetContext(context);
|
_SetContext(context);
|
||||||
_ValidateConstraints();
|
_ValidateConstraints();
|
||||||
@@ -206,6 +209,7 @@ SharedSolver::ValidateLayout(BLayoutContext* context)
|
|||||||
|
|
||||||
fLayoutResult = fLinearSpec.Solve();
|
fLayoutResult = fLinearSpec.Solve();
|
||||||
fLayoutValid = true;
|
fLayoutValid = true;
|
||||||
|
return fLayoutResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ public:
|
|||||||
void RegisterLayout(BALM::BALMLayout* layout);
|
void RegisterLayout(BALM::BALMLayout* layout);
|
||||||
void LayoutLeaving(BALM::BALMLayout* layout);
|
void LayoutLeaving(BALM::BALMLayout* layout);
|
||||||
|
|
||||||
void ValidateMinSize();
|
ResultType ValidateMinSize();
|
||||||
void ValidateMaxSize();
|
ResultType ValidateMaxSize();
|
||||||
void ValidateLayout(BLayoutContext* context);
|
ResultType ValidateLayout(BLayoutContext* context);
|
||||||
private:
|
private:
|
||||||
struct MinSizeValidator;
|
struct MinSizeValidator;
|
||||||
struct MaxSizeValidator;
|
struct MaxSizeValidator;
|
||||||
|
|||||||
Reference in New Issue
Block a user