Gui: Use auto and range-based for (#7481)

* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
berniev
2022-09-15 04:25:13 +10:00
committed by GitHub
parent f7c84dfd09
commit ae53c9b0a4
175 changed files with 2051 additions and 2057 deletions

View File

@@ -93,7 +93,7 @@ void ViewProviderOrigin::setDisplayMode(const char* ModeName)
}
void ViewProviderOrigin::setTemporaryVisibility(bool axis, bool plane) {
App::Origin* origin = static_cast<App::Origin*>( getObject() );
auto origin = static_cast<App::Origin*>( getObject() );
bool saveState = tempVisMap.empty();
@@ -155,7 +155,7 @@ void ViewProviderOrigin::onChanged(const App::Property* prop) {
try {
Gui::Application *app = Gui::Application::Instance;
Base::Vector3d sz = Size.getValue ();
App::Origin* origin = static_cast<App::Origin*> ( getObject() );
auto origin = static_cast<App::Origin*> ( getObject() );
// Calculate axes and planes sizes
double szXY = std::max ( sz.x, sz.y );
@@ -199,7 +199,7 @@ void ViewProviderOrigin::onChanged(const App::Property* prop) {
}
bool ViewProviderOrigin::onDelete(const std::vector<std::string> &) {
App::Origin* origin = static_cast<App::Origin*>( getObject() );
auto origin = static_cast<App::Origin*>( getObject() );
if ( !origin->getInList().empty() ) {
return false;