Browse Source

Fix docking panel crash due to messing up config.xml

Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13084#issuecomment-1783787209
pull/14291/head
Don Ho 1 year ago
parent
commit
e2fb15a703
  1. 4
      PowerEditor/src/Notepad_plus.cpp
  2. 7
      PowerEditor/src/Parameters.cpp

4
PowerEditor/src/Notepad_plus.cpp

@ -1063,9 +1063,9 @@ void Notepad_plus::saveDockingParams()
{
int floatCont = 0;
if (nppGUI._dockingData._pluginDockInfo[i]._currContainer >= DOCKCONT_MAX)
if (nppGUI._dockingData._pluginDockInfo[i]._currContainer <= DOCKCONT_MAX)
floatCont = nppGUI._dockingData._pluginDockInfo[i]._currContainer;
else
else if (nppGUI._dockingData._pluginDockInfo[i]._prevContainer <= DOCKCONT_MAX)
floatCont = nppGUI._dockingData._pluginDockInfo[i]._prevContainer;
if (floatCont >= 0)

7
PowerEditor/src/Parameters.cpp

@ -6582,12 +6582,11 @@ void NppParameters::feedDockingManager(TiXmlNode *node)
const TCHAR *idStr = dlgElement->Attribute(TEXT("id"), &id);
if (name && idStr)
{
int curr = 0; // on left
int current = 0; // on left
int prev = 0; // on left
dlgElement->Attribute(TEXT("curr"), &curr);
dlgElement->Attribute(TEXT("curr"), &current);
dlgElement->Attribute(TEXT("prev"), &prev);
bool isVisible = false;
const TCHAR *val = dlgElement->Attribute(TEXT("isVisible"));
if (val)
@ -6595,7 +6594,7 @@ void NppParameters::feedDockingManager(TiXmlNode *node)
isVisible = (lstrcmp(val, TEXT("yes")) == 0);
}
_nppGUI._dockingData._pluginDockInfo.push_back(PluginDlgDockingInfo(name, id, curr, prev, isVisible));
_nppGUI._dockingData._pluginDockInfo.push_back(PluginDlgDockingInfo(name, id, current, prev, isVisible));
}
}

Loading…
Cancel
Save