From e3a637893f7343ee9965c0096f9f5dc63607804c Mon Sep 17 00:00:00 2001
From: Stephanie Anderl <46726333+sanderl@users.noreply.github.com>
Date: Thu, 20 Aug 2020 14:36:48 -0700
Subject: [PATCH] Fixed spacing and updated the moved the variableIsNotX check
up into the parent if statement
---
src/Calculator/Resources/en-US/Resources.resw | 2 +-
src/GraphControl/Control/Grapher.cpp | 5 ++---
src/GraphingInterfaces/IGraphAnalyzer.h | 8 ++++----
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/Calculator/Resources/en-US/Resources.resw b/src/Calculator/Resources/en-US/Resources.resw
index 349da060..3ce82104 100644
--- a/src/Calculator/Resources/en-US/Resources.resw
+++ b/src/Calculator/Resources/en-US/Resources.resw
@@ -4071,7 +4071,7 @@
Analysis is not supported for this function.
Error displayed when graph analysis is not supported or had an error.
-
+
Analysis is only supported for functions in the f(x) format. Example: y=x
Error displayed when graph analysis detects the function format is not f(x).
diff --git a/src/GraphControl/Control/Grapher.cpp b/src/GraphControl/Control/Grapher.cpp
index ee132953..1132edad 100644
--- a/src/GraphControl/Control/Grapher.cpp
+++ b/src/GraphControl/Control/Grapher.cpp
@@ -255,12 +255,11 @@ namespace GraphControl
equationVector.push_back(equation);
UpdateGraphOptions(graph->GetOptions(), equationVector);
bool variableIsNotX;
- if (analyzer->CanFunctionAnalysisBePerformed(variableIsNotX))
+ if (analyzer->CanFunctionAnalysisBePerformed(variableIsNotX) && !variableIsNotX)
{
if (S_OK
== analyzer->PerformFunctionAnalysis(
- (Graphing::Analyzer::NativeAnalysisType)Graphing::Analyzer::PerformAnalysisType::PerformAnalysisType_All)
- && !variableIsNotX)
+ (Graphing::Analyzer::NativeAnalysisType)Graphing::Analyzer::PerformAnalysisType::PerformAnalysisType_All))
{
Graphing::IGraphFunctionAnalysisData functionAnalysisData = m_solver->Analyze(analyzer.get());
return KeyGraphFeaturesInfo::Create(functionAnalysisData);
diff --git a/src/GraphingInterfaces/IGraphAnalyzer.h b/src/GraphingInterfaces/IGraphAnalyzer.h
index 5754080b..5b5e012f 100644
--- a/src/GraphingInterfaces/IGraphAnalyzer.h
+++ b/src/GraphingInterfaces/IGraphAnalyzer.h
@@ -15,10 +15,10 @@ namespace Graphing::Analyzer
struct IGraphAnalyzer : public NonCopyable, public NonMoveable
{
- virtual ~IGraphAnalyzer() = default;
+ virtual ~IGraphAnalyzer() = default;
virtual bool CanFunctionAnalysisBePerformed(bool& variableIsNotX) = 0;
- virtual HRESULT PerformFunctionAnalysis(NativeAnalysisType analysisType) = 0;
- virtual HRESULT GetAnalysisTypeCaption(const AnalysisType type, std::wstring& captionOut) const = 0;
- virtual HRESULT GetMessage(const GraphAnalyzerMessage msg, std::wstring& msgOut) const = 0;
+ virtual HRESULT PerformFunctionAnalysis(NativeAnalysisType analysisType) = 0;
+ virtual HRESULT GetAnalysisTypeCaption(const AnalysisType type, std::wstring& captionOut) const = 0;
+ virtual HRESULT GetMessage(const GraphAnalyzerMessage msg, std::wstring& msgOut) const = 0;
};
}