Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–25 unchanged (25 lines)
26 auto fontInfo{ winrt::make_self<FontConfig>(std::move(sourceProfile)) };
27
28#define FONT_SETTINGS_COPY(type, name, jsonKey, ...) \
29 fontInfo->_##name = source->_##name;
30 MTSM_FONT_SETTINGS(FONT_SETTINGS_COPY)
31#undef FONT_SETTINGS_COPY
32
33 return fontInfo;
34}
35
36Json::Value FontConfig::ToJson() const
37{
38 Json::Value json{ Json::ValueType::objectValue };
…lines 39–85 unchanged (47 lines)

After

…lines 1–26 unchanged (26 lines)
27
28#define FONT_SETTINGS_COPY(type, name, jsonKey, ...) \
29 fontInfo->_##name = source->_##name;
30 MTSM_FONT_SETTINGS(FONT_SETTINGS_COPY)
31#undef FONT_SETTINGS_COPY
32
33 // We cannot simply copy the font axes and features with `fontInfo->_FontAxes = source->_FontAxes;`
34 // since that'll just create a reference; we have to manually copy the values.
35 if (source->_FontAxes)
36 {
37 std::map<winrt::hstring, float> fontAxes;
38 for (const auto keyValuePair : source->_FontAxes.value())
39 {
40 fontAxes.insert(std::pair<winrt::hstring, float>(keyValuePair.Key(), keyValuePair.Value()));
41 }
42 fontInfo->_FontAxes = winrt::single_threaded_map(std::move(fontAxes));
43 }
44
45 return fontInfo;
46}
47
48Json::Value FontConfig::ToJson() const
49{
…lines 50–97 unchanged (48 lines)

Before

translation_unit
comment "// Copyright (c) Microsoft Corporation.\r"
comment "// Licensed under the MIT license.\r"
preproc_include
#include "#include"
string_literal
" "\""
string_content "pch.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "FontConfig.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "FontConfig.g.cpp"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "TerminalSettingsSerializationHelpers.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "JsonUtils.h"
" "\""
using_declaration
using "using"
namespace "namespace"
qualified_identifier
namespace_identifier "Microsoft"
:: "::"
qualified_identifier
namespace_identifier "Terminal"
:: "::"
qualified_identifier
namespace_identifier "Settings"
:: "::"
identifier "Model"
; ";"
using_declaration
using "using"
namespace "namespace"
qualified_identifier
namespace_identifier "winrt"
:: "::"
qualified_identifier
namespace_identifier "Microsoft"
:: "::"
qualified_identifier
namespace_identifier "Terminal"
:: "::"
qualified_identifier
namespace_identifier "Settings"
:: "::"
qualified_identifier
namespace_identifier "Model"
:: "::"
identifier "implementation"
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
constexpr "constexpr"
qualified_identifier
namespace_identifier "std"
:: "::"
type_identifier "string_view"
init_declarator
identifier "FontInfoKey"
initializer_list
{ "{"
string_literal
" "\""
string_content "font"
" "\""
} "}"
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
constexpr "constexpr"
qualified_identifier
namespace_identifier "std"
:: "::"
type_identifier "string_view"
init_declarator
identifier "LegacyFontFaceKey"
initializer_list
{ "{"
string_literal
" "\""
string_content "fontFace"
" "\""
} "}"
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
constexpr "constexpr"
qualified_identifier
namespace_identifier "std"
:: "::"
type_identifier "string_view"
init_declarator
identifier "LegacyFontSizeKey"
initializer_list
{ "{"
string_literal
" "\""
string_content "fontSize"
" "\""
} "}"
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
constexpr "constexpr"
qualified_identifier
namespace_identifier "std"
:: "::"
type_identifier "string_view"
init_declarator
identifier "LegacyFontWeightKey"
initializer_list
{ "{"
string_literal
" "\""
string_content "fontWeight"
" "\""
} "}"
; ";"
function_definition (+57 nodes collapsed)
function_definition
qualified_identifier
namespace_identifier "winrt"
:: "::"
template_type
type_identifier "com_ptr"
template_argument_list
< "<"
type_descriptor
type_identifier "FontConfig"
> ">"
function_declarator (+28 nodes collapsed)
compound_statement
{ "{"
declaration (+32 nodes collapsed)
preproc_function_def
#define "#define"
identifier "FONT_SETTINGS_COPY"
preproc_params
( "("
identifier "type"
, ","
identifier "name"
, ","
identifier "jsonKey"
, ","
... "..."
) ")"
preproc_arg "fontInfo->_##name = source->_##name;\r"
expression_statement
call_expression
identifier "MTSM_FONT_SETTINGS"
argument_list
( "("
identifier "FONT_SETTINGS_COPY"
) ")"
; ""
preproc_call
preproc_directive "#undef"
preproc_arg "FONT_SETTINGS_COPY\r"
return_statement
return "return"
identifier "fontInfo"
; ";"
} "}"
function_definition (+65 nodes collapsed)
comment "// Method Description:\r"
comment "// - Layer values from the given json object on top of the e"...
comment "// of this object. For any keys we're expecting to be able"...
comment "// given object, we'll parse them and replace our settings"...
comment "// the new json object. Properties that _aren't_ in the js"...
comment "// be replaced.\r"
comment "// - Optional values that are set to `null` in the json obje"...
comment "// will be set to nullopt.\r"
comment "// - This is similar to Profile::LayerJson but for FontConfi"...
comment "// Arguments:\r"
comment "// - json: an object which should be a partial serialization"...
function_definition (+144 nodes collapsed)
function_definition (+39 nodes collapsed)

After

translation_unit
comment "// Copyright (c) Microsoft Corporation.\r"
comment "// Licensed under the MIT license.\r"
preproc_include
#include "#include"
string_literal
" "\""
string_content "pch.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "FontConfig.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "FontConfig.g.cpp"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "TerminalSettingsSerializationHelpers.h"
" "\""
preproc_include
#include "#include"
string_literal
" "\""
string_content "JsonUtils.h"
" "\""
using_declaration
using "using"
namespace "namespace"
qualified_identifier
namespace_identifier "Microsoft"
:: "::"
qualified_identifier
namespace_identifier "Terminal"
:: "::"
qualified_identifier
namespace_identifier "Settings"
:: "::"
identifier "Model"
; ";"
using_declaration
using "using"
namespace "namespace"
qualified_identifier
namespace_identifier "winrt"
:: "::"
qualified_identifier
namespace_identifier "Microsoft"
:: "::"
qualified_identifier
namespace_identifier "Terminal"
:: "::"
qualified_identifier
namespace_identifier "Settings"
:: "::"
qualified_identifier
namespace_identifier "Model"
:: "::"
identifier "implementation"
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
constexpr "constexpr"
qualified_identifier
namespace_identifier "std"
:: "::"
type_identifier "string_view"
init_declarator
identifier "FontInfoKey"
initializer_list
{ "{"
string_literal
" "\""
string_content "font"
" "\""
} "}"
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
constexpr "constexpr"
qualified_identifier
namespace_identifier "std"
:: "::"
type_identifier "string_view"
init_declarator
identifier "LegacyFontFaceKey"
initializer_list
{ "{"
string_literal
" "\""
string_content "fontFace"
" "\""
} "}"
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
constexpr "constexpr"
qualified_identifier
namespace_identifier "std"
:: "::"
type_identifier "string_view"
init_declarator
identifier "LegacyFontSizeKey"
initializer_list
{ "{"
string_literal
" "\""
string_content "fontSize"
" "\""
} "}"
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
constexpr "constexpr"
qualified_identifier
namespace_identifier "std"
:: "::"
type_identifier "string_view"
init_declarator
identifier "LegacyFontWeightKey"
initializer_list
{ "{"
string_literal
" "\""
string_content "fontWeight"
" "\""
} "}"
; ";"
function_definition (+57 nodes collapsed)
function_definition
qualified_identifier
namespace_identifier "winrt"
:: "::"
template_type
type_identifier "com_ptr"
template_argument_list
< "<"
type_descriptor
type_identifier "FontConfig"
> ">"
function_declarator (+28 nodes collapsed)
compound_statement
{ "{"
declaration (+32 nodes collapsed)
preproc_function_def
#define "#define"
identifier "FONT_SETTINGS_COPY"
preproc_params
( "("
identifier "type"
, ","
identifier "name"
, ","
identifier "jsonKey"
, ","
... "..."
) ")"
preproc_arg "fontInfo->_##name = source->_##name;\r"
expression_statement
call_expression
identifier "MTSM_FONT_SETTINGS"
argument_list
( "("
identifier "FONT_SETTINGS_COPY"
) ")"
; ""
preproc_call
preproc_directive "#undef"
preproc_arg "FONT_SETTINGS_COPY\r"
comment "// We cannot simply copy the font axes and features with `fo"...
comment "// since that'll just create a reference; we have to manuall"...
if_statement
if "if"
condition_clause
( "("
field_expression
identifier "source"
-> "->"
field_identifier "_FontAxes"
) ")"
compound_statement
{ "{"
declaration
qualified_identifier
namespace_identifier "std"
:: "::"
template_type
type_identifier "map"
template_argument_list
< "<"
type_descriptor
qualified_identifier
namespace_identifier "winrt"
:: "::"
type_identifier "hstring"
, ","
type_descriptor
primitive_type "float"
> ">"
identifier "fontAxes"
; ";"
for_range_loop
for "for"
( "("
type_qualifier
const "const"
placeholder_type_specifier
auto "auto"
identifier "keyValuePair"
: ":"
call_expression
field_expression
field_expression
identifier "source"
-> "->"
field_identifier "_FontAxes"
. "."
field_identifier "value"
argument_list
( "("
) ")"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
field_expression
identifier "fontAxes"
. "."
field_identifier "insert"
argument_list
( "("
call_expression
qualified_identifier
namespace_identifier "std"
:: "::"
template_function
identifier "pair"
template_argument_list
< "<"
type_descriptor
qualified_identifier
namespace_identifier "winrt"
:: "::"
type_identifier "hstring"
, ","
type_descriptor
primitive_type "float"
> ">"
argument_list
( "("
call_expression
field_expression
identifier "keyValuePair"
. "."
field_identifier "Key"
argument_list
( "("
) ")"
, ","
call_expression
field_expression
identifier "keyValuePair"
. "."
field_identifier "Value"
argument_list
( "("
) ")"
) ")"
) ")"
; ";"
} "}"
expression_statement
assignment_expression
field_expression
identifier "fontInfo"
-> "->"
field_identifier "_FontAxes"
= "="
call_expression
qualified_identifier
namespace_identifier "winrt"
:: "::"
identifier "single_threaded_map"
argument_list
( "("
call_expression
qualified_identifier
namespace_identifier "std"
:: "::"
identifier "move"
argument_list
( "("
identifier "fontAxes"
) ")"
) ")"
; ";"
} "}"
return_statement
return "return"
identifier "fontInfo"
; ";"
} "}"
function_definition (+65 nodes collapsed)
comment "// Method Description:\r"
comment "// - Layer values from the given json object on top of the e"...
comment "// of this object. For any keys we're expecting to be able"...
comment "// given object, we'll parse them and replace our settings"...
comment "// the new json object. Properties that _aren't_ in the js"...
comment "// be replaced.\r"
comment "// - Optional values that are set to `null` in the json obje"...
comment "// will be set to nullopt.\r"
comment "// - This is similar to Profile::LayerJson but for FontConfi"...
comment "// Arguments:\r"
comment "// - json: an object which should be a partial serialization"...
function_definition (+144 nodes collapsed)
function_definition (+39 nodes collapsed)