Skip to content

Commit aa144a0

Browse files
committed
Fix setting DWrite rendering mode on Windows 7, plus some comment updates
1 parent 6141043 commit aa144a0

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

source/Attributes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ struct AttributeValue
200200
Attribute::Variant data; // Room for one element, which is the common case.
201201
std::vector<uint8_t> dataArray; // Variable length data in case the fixed size variant is too small.
202202
std::u16string stringValue; // string representation, typed by user or read from data file.
203-
uint32_t cookieValue = 0; // useful to compare for value changes, incremented each time.
203+
uint32_t cookieValue = 0; // useful to compare for value changes, incremented each time data is changed.
204204

205205
array_ref<uint8_t> Get(); // Get the data.
206206
HRESULT Set(Attribute const& attribute, _In_z_ char16_t const* newStringValue);
@@ -249,8 +249,8 @@ struct IAttributeSource
249249

250250
// Get single value of specific type (not binary data).
251251
// If the actual type is incompatible with the desired type or the value
252-
// is empty, it returns the default value and HRESULT for
253-
// ERROR_UNMAPPED_SUBSTITUTION_STRING.
252+
// is empty or it gets ERROR_UNMAPPED_SUBSTITUTION_STRING, then it returns
253+
// the default value.
254254
template <typename T>
255255
T GetValue(uint32_t id, T defaultValue)
256256
{
@@ -319,7 +319,7 @@ struct IAttributeSource
319319

320320
// Get an array of specific data types.
321321
// If the actual type is incompatible with the desired type, it returns
322-
// an empty array and HRESULT for ERROR_UNMAPPED_SUBSTITUTION_STRING.
322+
// an empty array.
323323
template <typename T>
324324
array_ref<T> GetValues(uint32_t id)
325325
{

source/Attributes.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ array_ref<uint8_t> AttributeValue::Get()
702702
}
703703

704704

705-
// Return a wstring copy of the string as a wstring rather than
705+
// Return a UTF-16 string copy of the string as a wstring rather than
706706
// a lightweight view into the text.
707707
HRESULT IAttributeSource::GetString(uint32_t id, _Out_ std::u16string& s)
708708
{

source/Common.OptionalValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class optional_value
7676
T const& operator*() const { return value(); }
7777

7878
// Container compatible helpers to accomodate generic template algorithms,
79-
// treating std::optional like an std::vecto of size 0 or 1.
79+
// treating std::optional like an std::vector of size 0 or 1.
8080
bool empty() { return !valueExists_; }
8181
T* data() { return &value(); }
8282
T const* data() const { return &value(); }

source/DrawableObject.ixx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,7 @@ HRESULT CachedDWriteRenderingParams::Update(IAttributeSource& attributeSource, D
19931993
// Otherwise create custom one, using the default one as a template for any unspecified parameters.
19941994
auto* dwriteFactory = drawingCanvas.GetDWriteFactoryWeakRef();
19951995
ComPtr<IDWriteFactory2> dwriteFactory2;
1996-
IFR(drawingCanvas.GetDWriteFactoryWeakRef()->QueryInterface(OUT &dwriteFactory2));
1996+
drawingCanvas.GetDWriteFactoryWeakRef()->QueryInterface(OUT &dwriteFactory2);
19971997

19981998
// Get defaults for gamma, contrast, CT level, pixel geometry...
19991999
ComPtr<IDWriteRenderingParams> defaultRenderingParams;

source/MainWindow.ixx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,10 @@ void MainWindow::FillAttributesListView()
700700
auto weight = substringPrioritizer.GetStringWeight(ToChar16ArrayRef(attribute.display));
701701
substringPrioritizer.SetItemWeight(i, weight);
702702
}
703-
auto clampedListIndices = substringPrioritizer.GetItemIndices(OUT listIndices, /*excludeMismatches*/true);
703+
auto listIndicesSubset = substringPrioritizer.GetItemIndices(OUT listIndices, /*excludeMismatches*/false);
704704

705705
// Add matching items to the ListView.
706-
for (auto& index : clampedListIndices)
706+
for (auto& index : listIndicesSubset)
707707
{
708708
auto& attribute = DrawableObject::attributeList[index];
709709
lw.lParam = attribute.id;

0 commit comments

Comments
 (0)