TD: [skip ci] fix warnings of checkers about whitespaces

This commit is contained in:
wmayer
2022-08-22 08:37:08 +02:00
parent 1b322aa612
commit 70cdbcb9ad
4 changed files with 21 additions and 22 deletions

View File

@@ -132,7 +132,7 @@ void DrawView::onChanged(const App::Property* prop)
if (prop == &ScaleType) {
auto page = findParentPage();
if (ScaleType.isValue("Page")) {
Scale.setStatus(App::Property::ReadOnly,true);
Scale.setStatus(App::Property::ReadOnly, true);
if (page) {
if(std::abs(page->Scale.getValue() - getScale()) > FLT_EPSILON) {
Scale.setValue(page->Scale.getValue());
@@ -140,11 +140,11 @@ void DrawView::onChanged(const App::Property* prop)
}
} else if ( ScaleType.isValue("Custom") ) {
//don't change Scale
Scale.setStatus(App::Property::ReadOnly,false);
Scale.setStatus(App::Property::ReadOnly, false);
} else if ( ScaleType.isValue("Automatic") ) {
Scale.setStatus(App::Property::ReadOnly,true);
Scale.setStatus(App::Property::ReadOnly, true);
if (!checkFit(page)) {
double newScale = autoScale(page->getPageWidth(),page->getPageHeight());
double newScale = autoScale(page->getPageWidth(), page->getPageHeight());
if(std::abs(newScale - getScale()) > FLT_EPSILON) { //stops onChanged/execute loop
Scale.setValue(newScale);
}
@@ -153,7 +153,7 @@ void DrawView::onChanged(const App::Property* prop)
} else if (prop == &LockPosition) {
handleXYLock();
requestPaint(); //change lock icon
LockPosition.purgeTouched();
LockPosition.purgeTouched();
} else if ((prop == &Caption) ||
(prop == &Label)) {
requestPaint();
@@ -180,20 +180,20 @@ void DrawView::handleXYLock()
{
if (isLocked()) {
if (!X.testStatus(App::Property::ReadOnly)) {
X.setStatus(App::Property::ReadOnly,true);
X.setStatus(App::Property::ReadOnly, true);
X.purgeTouched();
}
if (!Y.testStatus(App::Property::ReadOnly)) {
Y.setStatus(App::Property::ReadOnly,true);
Y.setStatus(App::Property::ReadOnly, true);
Y.purgeTouched();
}
} else {
if (X.testStatus(App::Property::ReadOnly)) {
X.setStatus(App::Property::ReadOnly,false);
X.setStatus(App::Property::ReadOnly, false);
X.purgeTouched();
}
if (Y.testStatus(App::Property::ReadOnly)) {
Y.setStatus(App::Property::ReadOnly,false);
Y.setStatus(App::Property::ReadOnly, false);
Y.purgeTouched();
}
}
@@ -360,7 +360,7 @@ double DrawView::autoScale() const
return autoScale(w,h);
}
//compare 1:1 rect of view to pagesize(pw,h)
//compare 1:1 rect of view to pagesize(pw,h)
double DrawView::autoScale(double pw, double ph) const
{
// Base::Console().Message("DV::autoScale(Page: %.3f, %.3f) - %s\n", pw, ph, getNameInDocument());
@@ -374,7 +374,7 @@ double DrawView::autoScale(double pw, double ph) const
double vbh = viewBox.height()/getScale();
double xScale = pw/vbw; // > 1 page bigger than figure
double yScale = ph/vbh; // < 1 page is smaller than figure
double newScale = std::min(xScale,yScale) * fudgeFactor;
double newScale = std::min(xScale,yScale) * fudgeFactor;
double sensibleScale = DrawUtil::sensibleScale(newScale);
return sensibleScale;
}
@@ -457,8 +457,7 @@ std::vector<TechDraw::DrawLeaderLine*> DrawView::getLeaders() const
return result;
}
void DrawView::handleChangedPropertyType(
Base::XMLReader &reader, const char * TypeName, App::Property * prop)
void DrawView::handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop)
{
if (prop == &Scale) {
App::PropertyFloat tmp;
@@ -472,7 +471,7 @@ void DrawView::handleChangedPropertyType(
Scale.setValue(1.0);
}
} else {
// has Scale prop that isn't Float!
// has Scale prop that isn't Float!
Base::Console().Log("DrawPage::Restore - old Document Scale is Not Float!\n");
// no idea
}
@@ -524,7 +523,7 @@ void DrawView::handleChangedPropertyType(
Y2Property.Restore(reader);
Y.setValue(Y2Property.getValue());
}
// property Rotation had App::PropertyFloat and was changed to App::PropertyAngle
else if (prop == &Rotation && strcmp(TypeName, "App::PropertyFloat") == 0) {
App::PropertyFloat RotationProperty;
@@ -561,7 +560,7 @@ int DrawView::prefScaleType()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
int result = hGrp->GetInt("DefaultScaleType", 0);
int result = hGrp->GetInt("DefaultScaleType", 0);
return result;
}