Skip to content

Commit

Permalink
fix issue with older GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
ptahmose committed Dec 2, 2023
1 parent eb9e7a8 commit 7971e00
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Src/libCZI/CziMetadataDocumentInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ CCziMetadataDocumentInfo::CCziMetadataDocumentInfo(std::shared_ptr<CCziMetadata>

static const struct
{
char dimChar;
wchar_t dimChar;
double(ScalingInfoEx::* scaleVarPtr);
std::wstring(ScalingInfoEx::* defaultUnit);
} dimScalingData[] =
{
{'X', &ScalingInfoEx::scaleX, &ScalingInfoEx::defaultUnitFormatX},
{'Y', &ScalingInfoEx::scaleY, &ScalingInfoEx::defaultUnitFormatY},
{'Z', &ScalingInfoEx::scaleZ, &ScalingInfoEx::defaultUnitFormatZ},
{L'X', &ScalingInfoEx::scaleX, &ScalingInfoEx::defaultUnitFormatX},
{L'Y', &ScalingInfoEx::scaleY, &ScalingInfoEx::defaultUnitFormatY},
{L'Z', &ScalingInfoEx::scaleZ, &ScalingInfoEx::defaultUnitFormatZ},
};

for (const auto d : dimScalingData)
Expand All @@ -114,12 +114,13 @@ CCziMetadataDocumentInfo::CCziMetadataDocumentInfo(std::shared_ptr<CCziMetadata>
scalingInfo.*d.scaleVarPtr = nodeScalingValue.node().text().as_double();
}

ss = wstringstream();
ss.clear();
ss.str(L"");
ss << L"Items/Distance[@Id='" << d.dimChar << L"']/DefaultUnitFormat";
auto nodeScalingDefaultUnit = np.select_node(ss.str().c_str());
if (!nodeScalingDefaultUnit.node().empty())
{
scalingInfo.*d.defaultUnit = nodeScalingDefaultUnit.node().text().as_string();
scalingInfo.*d.defaultUnit = nodeScalingDefaultUnit.node().text().get();
}
}

Expand Down

0 comments on commit 7971e00

Please sign in to comment.