diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index f8023050b..0c1ac9dc5 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -2495,9 +2495,9 @@ void NppParameters::feedColumnEditorParameters(TiXmlNode *node) if (strVal) { if (lstrcmp(strVal, TEXT("text")) == 0) - _columnEditParam._mainChoice = false; + _columnEditParam._mainChoice = activeText; else - _columnEditParam._mainChoice = true; + _columnEditParam._mainChoice = activeNumeric; } TiXmlNode *childNode = columnEditorRoot->FirstChildElement(TEXT("text")); if (!childNode) return; @@ -4101,7 +4101,7 @@ bool NppParameters::writeColumnEditorSettings() const // Create the new ColumnEditor root TiXmlElement columnEditorRootNode{TEXT("ColumnEditor")}; - (columnEditorRootNode.ToElement())->SetAttribute(TEXT("choice"), _columnEditParam._mainChoice ? L"number" : L"text"); + (columnEditorRootNode.ToElement())->SetAttribute(TEXT("choice"), _columnEditParam._mainChoice == activeNumeric ? L"number" : L"text"); TiXmlElement textNode{ TEXT("text") }; (textNode.ToElement())->SetAttribute(TEXT("content"), _columnEditParam._insertedTextContent.c_str()); diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index f2f8ffb08..4a396c272 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -73,6 +73,8 @@ const int TAB_HIDE = 256; //0001 0000 0000 const int TAB_QUITONEMPTY = 512; //0010 0000 0000 const int TAB_ALTICONS = 1024; //0100 0000 0000 +const bool activeText = true; +const bool activeNumeric = false; enum class EolType: std::uint8_t { @@ -1211,7 +1213,7 @@ struct ColumnEditorParam final { enum leadingChoice : UCHAR { noneLeading, zeroLeading, spaceLeading }; - bool _mainChoice = true; // true (1): text false (0): number + bool _mainChoice = activeNumeric; std::wstring _insertedTextContent; diff --git a/PowerEditor/src/ScintillaComponent/columnEditor.cpp b/PowerEditor/src/ScintillaComponent/columnEditor.cpp index 945bcffa6..38f4f22f4 100644 --- a/PowerEditor/src/ScintillaComponent/columnEditor.cpp +++ b/PowerEditor/src/ScintillaComponent/columnEditor.cpp @@ -136,7 +136,7 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR if (NppDarkMode::isEnabled()) { const ColumnEditorParam& colEditParam = NppParameters::getInstance()._columnEditParam; - ::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_FORMAT_GRP_STATIC), !colEditParam._mainChoice); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_FORMAT_GRP_STATIC), colEditParam._mainChoice == activeNumeric); } NppDarkMode::autoThemeChildControls(_hSelf); return TRUE; diff --git a/PowerEditor/src/ScintillaComponent/columnEditor.h b/PowerEditor/src/ScintillaComponent/columnEditor.h index 8ed43851b..7183e48de 100644 --- a/PowerEditor/src/ScintillaComponent/columnEditor.h +++ b/PowerEditor/src/ScintillaComponent/columnEditor.h @@ -22,8 +22,6 @@ class ScintillaEditView; -const bool activeText = true; -const bool activeNumeric = false; class ColumnEditorDlg : public StaticDialog {