TechDraw: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:39:03 +02:00
parent 464ffa7e73
commit 1d8a51b47b
22 changed files with 56 additions and 58 deletions

View File

@@ -100,7 +100,7 @@ App::DocumentObjectExecReturn *DrawViewSpreadsheet::execute()
std::string scellend = CellEnd.getValue();
if (!link)
return new App::DocumentObjectExecReturn("No spreadsheet linked");
if (!link->getTypeId().isDerivedFrom(Spreadsheet::Sheet::getClassTypeId()))
if (!link->isDerivedFrom<Spreadsheet::Sheet>())
return new App::DocumentObjectExecReturn("The linked object is not a spreadsheet");
if (scellstart.empty() || scellend.empty())
return new App::DocumentObjectExecReturn("Empty cell value");