[TechDraw] Simplify return logic
Easy warmup
This commit is contained in:
committed by
WandererFan
parent
122ab14d92
commit
70c9cf0fc0
@@ -695,8 +695,6 @@ long int TechDraw::mapGeometryTypeToDimType(long int dimType, DimensionGeometryT
|
||||
return DrawViewDimension::Angle;
|
||||
case isAngle3Pt:
|
||||
return DrawViewDimension::Angle3Pt;
|
||||
default:
|
||||
return dimType;
|
||||
}
|
||||
} else if (geometry2d != isViewReference) {
|
||||
switch (geometry2d) {
|
||||
@@ -710,8 +708,6 @@ long int TechDraw::mapGeometryTypeToDimType(long int dimType, DimensionGeometryT
|
||||
return DrawViewDimension::Angle;
|
||||
case isAngle3Pt:
|
||||
return DrawViewDimension::Angle3Pt;
|
||||
default:
|
||||
return dimType;
|
||||
}
|
||||
}
|
||||
return dimType;
|
||||
|
||||
@@ -59,8 +59,7 @@ void DlgTemplateField::setFieldContent(std::string content)
|
||||
|
||||
QString DlgTemplateField::getFieldContent()
|
||||
{
|
||||
QString result = ui->leInput->text();
|
||||
return result;
|
||||
return ui->leInput->text();
|
||||
}
|
||||
|
||||
void DlgTemplateField::accept()
|
||||
|
||||
@@ -434,6 +434,5 @@ std::pair<Base::Vector3d, Base::Vector3d> DrawGuiUtil::getProjDirFromFace(App::D
|
||||
}
|
||||
}
|
||||
|
||||
dirs = std::make_pair(projDir, rotVec);
|
||||
return dirs;
|
||||
return std::make_pair(projDir, rotVec);
|
||||
}
|
||||
|
||||
@@ -82,8 +82,7 @@ bool QGCustomImage::load(QPixmap map)
|
||||
|
||||
QSize QGCustomImage::imageSize()
|
||||
{
|
||||
QSize result = m_px.size() * scale();
|
||||
return result;
|
||||
return m_px.size() * scale();
|
||||
}
|
||||
|
||||
void QGCustomImage::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {
|
||||
|
||||
@@ -111,9 +111,7 @@ int QGIMatting::getHoleStyle()
|
||||
//need this because QQGIG only updates BR when items added/deleted.
|
||||
QRectF QGIMatting::boundingRect() const
|
||||
{
|
||||
QRectF result ;
|
||||
result = childrenBoundingRect().adjusted(-1, -1, 1,1);
|
||||
return result;
|
||||
return childrenBoundingRect().adjusted(-1, -1, 1,1);
|
||||
}
|
||||
|
||||
void QGIMatting::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {
|
||||
|
||||
@@ -293,8 +293,7 @@ double QGIRichAnno::prefPointSize()
|
||||
// double mmToPts = 2.83; //theoretical value
|
||||
double mmToPts = 2.00; //practical value. seems to be reasonable for common fonts.
|
||||
|
||||
double ptsSize = round(fontSize * mmToPts);
|
||||
return ptsSize;
|
||||
return round(fontSize * mmToPts);
|
||||
}
|
||||
|
||||
void QGIRichAnno::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) {
|
||||
|
||||
@@ -414,8 +414,7 @@ QPointF QGISectionLine::getArrowPosition(Base::Vector3d arrowDir, QPointF refPoi
|
||||
double offsetLength = m_extLen + Rez::guiX(QGIArrow::getPrefArrowSize());
|
||||
QPointF offsetVec = offsetLength * qArrowDir;
|
||||
|
||||
QPointF arrowPos = refPoint + offsetVec;
|
||||
return arrowPos;
|
||||
return QPointF(refPoint + offsetVec);
|
||||
}
|
||||
|
||||
void QGISectionLine::setFont(QFont f, double fsize)
|
||||
|
||||
@@ -52,8 +52,7 @@ double Rez::guiX(double x)
|
||||
|
||||
Base::Vector3d Rez::guiX(Base::Vector3d v)
|
||||
{
|
||||
Base::Vector3d result(guiX(v.x), guiX(v.y), guiX(v.z));
|
||||
return result;
|
||||
return Base::Vector3d(guiX(v.x), guiX(v.y), guiX(v.z));
|
||||
}
|
||||
|
||||
Base::Vector2d Rez::guiX(Base::Vector3d v, bool planar)
|
||||
@@ -75,8 +74,7 @@ double Rez::appX(double x)
|
||||
|
||||
Base::Vector3d Rez::appX(Base::Vector3d v)
|
||||
{
|
||||
Base::Vector3d result(appX(v.x), appX(v.y), appX(v.z));
|
||||
return result;
|
||||
return Base::Vector3d(appX(v.x), appX(v.y), appX(v.z));
|
||||
}
|
||||
|
||||
QPointF Rez::appX(QPointF p)
|
||||
@@ -89,36 +87,30 @@ QPointF Rez::appX(QPointF p)
|
||||
//Misc conversions
|
||||
QPointF Rez::guiPt(QPointF p)
|
||||
{
|
||||
QPointF result = p;
|
||||
result *= getRezFactor();
|
||||
return result;
|
||||
return p * getRezFactor();
|
||||
}
|
||||
|
||||
QPointF Rez::appPt(QPointF p)
|
||||
{
|
||||
QPointF result(appX(p.x()), appX(p.y()));
|
||||
return result;
|
||||
return QPointF(appX(p.x()), appX(p.y()));
|
||||
}
|
||||
|
||||
QRectF Rez::guiRect(QRectF r)
|
||||
{
|
||||
QRectF result(guiX(r.left()),
|
||||
return QRectF(guiX(r.left()),
|
||||
guiX(r.top()),
|
||||
guiX(r.width()),
|
||||
guiX(r.height()));
|
||||
return result;
|
||||
}
|
||||
|
||||
QSize Rez::guiSize(QSize s)
|
||||
{
|
||||
QSize result((int)guiX(s.width()), (int)guiX(s.height()));
|
||||
return result;
|
||||
return QSize((int)guiX(s.width()), (int)guiX(s.height()));
|
||||
}
|
||||
|
||||
QSize Rez::appSize(QSize s)
|
||||
{
|
||||
QSize result((int)appX(s.width()), (int)appX(s.height()));
|
||||
return result;
|
||||
return QSize((int)appX(s.width()), (int)appX(s.height()));
|
||||
}
|
||||
|
||||
double Rez::getParameter()
|
||||
|
||||
@@ -531,8 +531,7 @@ QPointF TaskDetail::getAnchorScene()
|
||||
Base::Vector3d xyScene = Rez::guiX(basePos);
|
||||
Base::Vector3d anchorOffsetScene = Rez::guiX(anchorPos) * scale;
|
||||
Base::Vector3d netPos = xyScene + anchorOffsetScene;
|
||||
QPointF qAnchor(netPos.x, netPos.y);
|
||||
return qAnchor;
|
||||
return QPointF(netPos.x, netPos.y);
|
||||
}
|
||||
|
||||
// protects against stale pointers
|
||||
|
||||
@@ -82,13 +82,10 @@ float lineAttributes::getWidthValue()
|
||||
switch(EdgeWidth(width)) {
|
||||
case EdgeWidth::small:
|
||||
return 0.18f;
|
||||
break;
|
||||
case EdgeWidth::middle:
|
||||
return 0.35f;
|
||||
break;
|
||||
case EdgeWidth::thick:
|
||||
return 0.5f;
|
||||
break;
|
||||
default:
|
||||
return 0.35f;
|
||||
}
|
||||
|
||||
@@ -151,8 +151,7 @@ std::vector<App::DocumentObject*> ViewProviderLeader::claimChildren() const
|
||||
return temp;
|
||||
}
|
||||
catch (...) {
|
||||
std::vector<App::DocumentObject*> tmp;
|
||||
return tmp;
|
||||
return std::vector<App::DocumentObject*>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -796,15 +796,13 @@ int MRichTextEdit::getDefFontSizeNum()
|
||||
// double mmToPts = 2.83; //theoretical value
|
||||
double mmToPts = 2.00; //practical value. seems to be reasonable for common fonts.
|
||||
|
||||
int ptsSize = round(fontSize * mmToPts);
|
||||
return ptsSize;
|
||||
return round(fontSize * mmToPts);
|
||||
}
|
||||
|
||||
QString MRichTextEdit::getDefFontSize()
|
||||
{
|
||||
// Base::Console().Message("MRTE::getDefFontSize()\n");
|
||||
QString result = QString::number(getDefFontSizeNum());
|
||||
return result;
|
||||
return QString::number(getDefFontSizeNum());
|
||||
}
|
||||
|
||||
//not used.
|
||||
|
||||
Reference in New Issue
Block a user