Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24903 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Henning Kiel committed Mar 4, 2015
1 parent 68ccca1 commit 5ba9112
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 2 additions & 0 deletions OMNotebook/OMNotebookGUI/textcursorcommands.cpp
Expand Up @@ -392,6 +392,8 @@ namespace IAEX
rule = new Rule( "TextAlignment", "Center" );
else if( (Qt::Alignment)alignment_ == Qt::AlignJustify )
rule = new Rule( "TextAlignment", "Justify" );
else
rule = new Rule( "TextAlignment", "Left" );

document()->getCursor()->currentCell()->addRule( rule );

Expand Down
40 changes: 20 additions & 20 deletions OMNotebook/OMSketch/Graph_Scene.cpp
Expand Up @@ -264,19 +264,19 @@ void Graph_Scene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
poly2->setPolygonDrawn(true);
mode=true;
poly2->lines.clear();
poly2->isObjectSelected=true;
for(int i=0;i<polygons.size();i++)
polygons[i]->isObjectSelected=false;
polygons.push_back(poly2);
poly2->isObjectSelected=true;
for(int i=0;i<polygons.size();i++)
polygons[i]->isObjectSelected=false;
polygons.push_back(poly2);
QRectF poly_rect=poly2->item->boundingRect();
object1->ObjectStrtPnt=poly_rect.topLeft();
object1->ObjectEndPnt=poly_rect.bottomRight();
object1->pnts=poly2->poly_pnts;
object1->setObjects(4,polygons.size()-1);
object1->ObjectIndx=polygons.size()-1;
objects.push_back(object1);
objectToDraw=0;
objectToEdit=4;
objectToDraw=0;
objectToEdit=4;
}

Draw_Line *line2 = new Draw_Line();
Expand Down Expand Up @@ -632,7 +632,7 @@ void Graph_Scene::draw_arc()

if(!arcs.isEmpty() && objectToDraw==6)
{
if(!k && arcs[arcs.size()-1]->getMode()==true && arc)
if(!k && arcs[arcs.size()-1]->getMode()==true && arc)
{
if(arc->click==0)
{
Expand All @@ -645,7 +645,7 @@ void Graph_Scene::draw_arc()
addItem(arc->item);
}
}
if(arc->click==1)
if(arc && arc->click==1)
{
arc->setCurvePoint(strt_pnt);
arc->item->setPath(arc->getArc());
Expand Down Expand Up @@ -2608,7 +2608,7 @@ void Graph_Scene::draw_polygon_state(QPointF pnt,QPointF pnt1)
polygon->setEndPoint(pnt1);
}

if((polygons.size()>=1)&&!polygon->getPolygonDrawn() && objectToDraw==4)
if(polygon && (polygons.size()>=1)&&!polygon->getPolygonDrawn() && objectToDraw==4)
{
qDebug()<<"entered polyon state\n";
polygon->setEndPoint(pnt1);
Expand All @@ -2623,7 +2623,7 @@ void Graph_Scene::draw_polygon_state(QPointF pnt,QPointF pnt1)
object4->setBoundPos(polygon->item->boundingRect().topLeft(),polygon->item->boundingRect().bottomRight());
object4->pnts=polygon->poly_pnts;
polygon->setState(0);
objectToEdit=4;
objectToEdit=4;
}

if(polygon->getState()==2)
Expand All @@ -2632,14 +2632,14 @@ void Graph_Scene::draw_polygon_state(QPointF pnt,QPointF pnt1)
object4->setBoundPos(polygon->item->boundingRect().topLeft(),polygon->item->boundingRect().bottomRight());
object4->pnts=polygon->poly_pnts;
polygon->setState(0);
objectToEdit=4;
objectToEdit=4;
}

if(polygon->getState()==3)
{
polygon->setState(0);
objectToEdit=4;
}
if(polygon->getState()==3)
{
polygon->setState(0);
objectToEdit=4;
}

}

Expand Down Expand Up @@ -3184,7 +3184,7 @@ void Graph_Scene::draw_text_state(QPointF pnt,QPointF pnt1)
objectToDraw=10;
}

if(text->getMode()==true)
if(text && text->getMode()==true)
{
if(text->getState()==1)
{
Expand Down Expand Up @@ -5461,7 +5461,7 @@ void Graph_Scene::setPen(const QPen Pen)
if(linearrow && linearrow->getMode()&&(linearrow->Strt_Rect->isVisible()))
{
linearrow->setPen(Pen.color());
if(!linearrows.isEmpty())
if(arc && !linearrows.isEmpty())
{
for(int i=0;i<linearrows.size();i++)
{
Expand Down Expand Up @@ -5863,7 +5863,7 @@ void Graph_Scene::setBrush(const QBrush brush)
if(triangle && triangle->getMode()&&(triangle->Strt_Rect->isVisible()))
{
triangle->setBrush(brush);
if(!triangles.isEmpty())
if(round_rect && !triangles.isEmpty())
{
for(int i=0;i<triangles.size();i++)
{
Expand Down Expand Up @@ -6958,4 +6958,4 @@ void Graph_Scene::deleteShapes()
}

}//end of ObjectToEdit condition
}
}

0 comments on commit 5ba9112

Please sign in to comment.