Fix plugin button hidings being ignored bug in toolbar button conf

Fix plugin button hidings settings being ignored bug in toolbar button config,
if the value of "hideAll" attribute of "Standard" node in "toolbarButtonsConf.xml" is set to "yes".

Fix #16280, close #16285
This commit is contained in:
Don Ho 2025-03-15 21:28:42 +01:00
parent 0ead95eb86
commit 659330e81a

View File

@ -87,29 +87,30 @@ void ToolBar::initHideButtonsConf(TiXmlDocument* toolButtonsDocRoot, ToolBarButt
{
for (int i = 0; i < arraySize; ++i)
_toolbarStdButtonsConfArray[i] = false;
return;
}
for (int i = 0; i < arraySize; ++i)
_toolbarStdButtonsConfArray[i] = true;
for (TiXmlNode* childNode = standardToolButtons->FirstChildElement(L"Button");
childNode;
childNode = childNode->NextSibling(L"Button"))
else
{
TiXmlElement* element = childNode->ToElement();
int cmdID =0;
const wchar_t* cmdIDStr = element->Attribute(L"id", &cmdID);
for (int i = 0; i < arraySize; ++i)
_toolbarStdButtonsConfArray[i] = true;
int index = 0;
const wchar_t* orderStr = element->Attribute(L"index", &index);
const wchar_t* isHide = element->Attribute(L"hide");
if (cmdIDStr && orderStr && isHide && (lstrcmp(isHide, L"yes") == 0))
for (TiXmlNode* childNode = standardToolButtons->FirstChildElement(L"Button");
childNode;
childNode = childNode->NextSibling(L"Button"))
{
if (index < arraySize && buttonUnitArray[index]._cmdID == cmdID)
_toolbarStdButtonsConfArray[index] = false;
TiXmlElement* element = childNode->ToElement();
int cmdID = 0;
const wchar_t* cmdIDStr = element->Attribute(L"id", &cmdID);
int index = 0;
const wchar_t* orderStr = element->Attribute(L"index", &index);
const wchar_t* isHide = element->Attribute(L"hide");
if (cmdIDStr && orderStr && isHide && (lstrcmp(isHide, L"yes") == 0))
{
if (index < arraySize && buttonUnitArray[index]._cmdID == cmdID)
_toolbarStdButtonsConfArray[index] = false;
}
}
}
}