|
From: <mbe...@us...> - 2010-09-13 13:19:41
|
Revision: 916
http://scstudio.svn.sourceforge.net/scstudio/?rev=916&view=rev
Author: mbezdeka
Date: 2010-09-13 13:19:34 +0000 (Mon, 13 Sep 2010)
Log Message:
-----------
- bugs fixed
Modified Paths:
--------------
trunk/src/view/visio/addon/addon.cpp
trunk/src/view/visio/addon/document.cpp
trunk/src/view/visio/addon/enums.h
trunk/src/view/visio/addon/messageJump.cpp
trunk/src/view/visio/addon/messageJump.h
trunk/src/view/visio/addon/messageSnapping.cpp
trunk/src/view/visio/addon/messageSnapping.h
trunk/src/view/visio/addon/numberingGlobalDlg.cpp
trunk/src/view/visio/addon/shapeutils.cpp
trunk/src/view/visio/addon/snapGlobalDlg.cpp
Modified: trunk/src/view/visio/addon/addon.cpp
===================================================================
--- trunk/src/view/visio/addon/addon.cpp 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/addon.cpp 2010-09-13 13:19:34 UTC (rev 916)
@@ -589,7 +589,6 @@
}
}
- //FIXME: Change to (vsoCell->Column == visXFormPinX)
if((_tcsicmp(vsoCell->Name,_T("PinX")) == 0 || _tcsicmp(vsoCell->Name,_T("PinY")) == 0))
{
if(isMessageShape(vsoCell->Shape))
@@ -685,9 +684,9 @@
{
Visio::IVShapePtr shape = selection->Item[1];
//If message isn't connected to both endpoints(not for LOST/FOUND), snap unplugged end to nearest instance
- MsgConnectedEndpoints conn = CShapeUtils::getConnectedEndpoints(shape);
- if(conn != MSCE_BOTH && conn != MSCE_NONE)
- CMessageSnapping::snapEndPointToClosestInstance(shape, (conn == MSCE_BEGIN) ? "EndX" : "BeginX", CMessageSnapping::getMsgDirection(shape));
+ /* MsgConnectedEndpoints conn = CShapeUtils::getConnectedEndpoints(shape);
+ if(conn != MSCE_BOTH && conn != MSCE_NONE && get_shape_type(shape) == ST_BMSC_MESSAGE)
+ CMessageSnapping::snapEndPointToClosestInstance(shape, (conn == MSCE_BEGIN) ? "EndX" : "BeginX", CMessageSnapping::getMsgDirection(shape));*/
//Get connected instances
instances = CMessageSnapping::getConnectedInstances(shape);
m_iJumpType = (keyCode == 0x25) ? 1 : 2;
@@ -803,8 +802,8 @@
}
if(CMessageJump::getMsgNeedsResnap(shape))
CMessageSnapping::resnap(shape, shapes, 0.0001);
- instances.clear();
m_iJumpType = 0;
+ instances.clear();
vsoApp->EndUndoScope(scopeId, true);
}
////////////////////////////////////////////////////
Modified: trunk/src/view/visio/addon/document.cpp
===================================================================
--- trunk/src/view/visio/addon/document.cpp 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/document.cpp 2010-09-13 13:19:34 UTC (rev 916)
@@ -1173,14 +1173,14 @@
CMessageSnapping::snap(shape, CShapeUtils::getShapeCell(shape, "PinX"), CShapeUtils::getShapeCell(shape, "PinY"), MSSNAP_PRESERVE_VERTICAL);
instances = CMessageSnapping::getConnectedInstances(shape);
}
- else if(conn != MSCE_BOTH) //If message isn't connected to both endpoints(not for LOST/FOUND), snap unplugged end to nearest instance
- {
- CMessageSnapping::snapEndPointToClosestInstance(shape, (conn == MSCE_BEGIN) ? "EndX" : "BeginX", CMessageSnapping::getMsgDirection(shape));
- instances = CMessageSnapping::getConnectedInstances(shape);
- }
-
- CMessageJump::jump(shape, instances, (MsgJumpDirection)left, asCopy);
-
+ //else if(conn != MSCE_BOTH) //If message isn't connected to both endpoints(not for LOST/FOUND), snap unplugged end to nearest instance
+ //{
+ // CMessageSnapping::snapEndPointToClosestInstance(shape, (conn == MSCE_BEGIN) ? "EndX" : "BeginX", CMessageSnapping::getMsgDirection(shape));
+ // instances = CMessageSnapping::getConnectedInstances(shape);
+ //}
+ if(!CMessageJump::jump(shape, instances, (MsgJumpDirection)left, asCopy) && CShapeUtils::getConnectedEndpoints(shape) == MSCE_NONE)
+ CMessageSnapping::resnap(shape, vsoApp->ActivePage->Shapes, 0.001);
+
if(CMessageJump::getMsgNeedsResnap(shape))
CMessageSnapping::resnap(shape, vsoApp->ActivePage->Shapes, 0.0001);
vsoApp->EndUndoScope(scopeId, true);
Modified: trunk/src/view/visio/addon/enums.h
===================================================================
--- trunk/src/view/visio/addon/enums.h 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/enums.h 2010-09-13 13:19:34 UTC (rev 916)
@@ -64,6 +64,7 @@
MSCE_BEGIN,
MSCE_END,
MSCE_BOTH,
+ MSCE_UNKNOWN,
};
// $Id$
Modified: trunk/src/view/visio/addon/messageJump.cpp
===================================================================
--- trunk/src/view/visio/addon/messageJump.cpp 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/messageJump.cpp 2010-09-13 13:19:34 UTC (rev 916)
@@ -31,7 +31,7 @@
return GetRegistry<int>(SNAP_REG_PATH, NULL, _T("EdgeTreatmentType"), 0);
}
-bool CMessageJump::jump(Visio::IVShapePtr msgShape, std::vector<Visio::IVShapePtr> connectedInstances, MsgJumpDirection direction, bool asCopy)
+bool CMessageJump::jump(Visio::IVShapePtr& msgShape, std::vector<Visio::IVShapePtr> connectedInstances, MsgJumpDirection direction, bool asCopy)
{
if(!msgShape || !connectedInstances.size())
return false;
@@ -66,10 +66,19 @@
return false;
}
+ //UNDONE: Copy message when jumping isn't implemented yet
//Duplicate message (creates a new instance of shape)
- if(asCopy)
+ /*if(asCopy)
+ {
+ msgShape->Application->EventsEnabled = false;
msgShape = CShapeUtils::duplicateShape(msgShape, get_shape_type(msgShape));
+ msgShape->Application->EventsEnabled = true;
+ */
+ //Erase information about re-snaping
+ if(origIntsLeft && origIntsRight && getMsgNeedsResnap(msgShape))
+ setMsgNeedsResnap(msgShape, 0);
+
std::vector<Visio::IVShapePtr> intersIntsBegin, intersIntsEnd;
intersIntsBegin = CMessageSnapping::getIntersectInstances(msgShape, CShapeUtils::getShapeCell(msgShape,left ? "EndY" : "BeginY"), MSSNAP_STRAIGHTEN);
intersIntsEnd = CMessageSnapping::getIntersectInstances(msgShape, CShapeUtils::getShapeCell(msgShape,left ? "BeginY" : "EndY"), MSSNAP_STRAIGHTEN);
@@ -82,7 +91,6 @@
MscPoint msgVec;
CMessageSnapping::getMsgVector(msgShape, &msgVec);
-
if(left)
CShapeUtils::swapShape(closestLeft, closestRight);
@@ -95,20 +103,21 @@
TShapeType shapeType = closestLeft ? ST_BMSC_MESSAGE_LOST : ST_BMSC_MESSAGE_FOUND;
changeMsgType(msgShape, (getEdgeInstanceTreatment() == 1) ? shapeType : ST_BMSC_MESSAGE);
+ if(getEdgeInstanceTreatment() == 0)
+ setMsgNeedsResnap(msgShape, true);
}
//Glue messages to instances
CMessageSnapping::glueMsgToInstancesPair(msgShape, closestLeft, closestRight, PinY, MSSNAP_PRESERVE_VERTICAL, false);
+
//Preserve its length (If message is snapped only to one instance, preserve its length)
- if(closestLeft ^ closestRight)
- {
- if(closestLeft) //LEFT point is snapped, adjust right point
- CMessageSnapping::setMsgLength(msgShape, msgVec, vis1DBeginX);
- if(closestRight) //RIGHT point is snapped, adjust left point
- CMessageSnapping::setMsgLength(msgShape, msgVec, vis1DEndX);
- }
-
- if(!closestLeft && !closestRight)
+ MsgConnectedEndpoints conn = CShapeUtils::getConnectedEndpoints(msgShape);
+
+ if(conn == MSCE_BEGIN) //LEFT point is snapped, adjust right point
+ CMessageSnapping::setMsgLength(msgShape, msgVec, vis1DBeginX);
+ else if(conn == MSCE_END) //RIGHT point is snapped, adjust left point
+ CMessageSnapping::setMsgLength(msgShape, msgVec, vis1DEndX);
+ else if(conn == MSCE_NONE)
return false;
return true;
@@ -129,10 +138,12 @@
if(*it == shape)
continue;
- MscPoint* intPoint = CMessageSnapping::getIntersectionWithInstance(MscPoint(pointOnShape.get_x()-1, pointOnShape.get_y()),
- MscPoint(pointOnShape.get_x(), pointOnShape.get_y()), *it);
+ boost::shared_ptr<MscPoint> intPoint (CMessageSnapping::getIntersectionWithInstance(MscPoint(pointOnShape.get_x()-1, pointOnShape.get_y()),
+ MscPoint(pointOnShape.get_x(), pointOnShape.get_y()), *it));
if(!intPoint || !CMessageSnapping::isPointOnInstancesLine(*intPoint, *it))
- { delete intPoint; continue; }
+ continue;
+ if(CMessageSnapping::pointsEqual(*intPoint, pointOnShape, 0.001))
+ return *it;
double xVector = pointOnShape.get_x() - intPoint->get_x();
if((xVector * ((direction == MSJUMP_LEFT) ? 1 : -1)) < 0)
@@ -140,14 +151,12 @@
double distance = sqrt(pow(xVector,2) + pow((pointOnShape.get_y() - intPoint->get_y()),2));
- if(!closestInstance || distance < closestDistance)
+ if(!closestInstance || distance <= closestDistance)
{
closestDistance = distance;
closestInstance = *it;
}
- delete intPoint;
}
-
return closestInstance;
}
@@ -179,9 +188,8 @@
if(!msgShape || !isMessageShape(msgShape))
return false;
+ msgShape->Application->EventsEnabled = false;
Visio::IVShapePtr newShape = CShapeUtils::duplicateShape(msgShape, shapeType);
-
- msgShape->Application->EventsEnabled = false;
msgShape->Delete();
msgShape = newShape;
msgShape->Application->EventsEnabled = true;
Modified: trunk/src/view/visio/addon/messageJump.h
===================================================================
--- trunk/src/view/visio/addon/messageJump.h 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/messageJump.h 2010-09-13 13:19:34 UTC (rev 916)
@@ -30,18 +30,18 @@
static bool isEnabled();
static int getEdgeInstanceTreatment();
- static bool jump(Visio::IVShapePtr msgShape, std::vector<Visio::IVShapePtr> connectedInstances, MsgJumpDirection direction, bool asCopy);
+ static bool jump(Visio::IVShapePtr& msgShape, std::vector<Visio::IVShapePtr> connectedInstances, MsgJumpDirection direction, bool asCopy);
/*
* Finds closest instance from shape in horiyontal direction
*/
static Visio::IVShapePtr getClosestInstanceFromShape(const MscPoint& pointOnShape, Visio::IVShapePtr shape,
std::vector<Visio::IVShapePtr> instances, MsgJumpDirection direction);
/*
- * !Obsolete - will be deleted
+ *
*/
static bool getMsgNeedsResnap(Visio::IVShapePtr msgShape);
/*
- * !Obsolete - will be deleted
+ *
*/
static void setMsgNeedsResnap(Visio::IVShapePtr msgShape, bool bTrueIfNeeds);
/*
Modified: trunk/src/view/visio/addon/messageSnapping.cpp
===================================================================
--- trunk/src/view/visio/addon/messageSnapping.cpp 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/messageSnapping.cpp 2010-09-13 13:19:34 UTC (rev 916)
@@ -184,12 +184,12 @@
return std::pair<Visio::IVShapePtr, Visio::IVShapePtr>(leftClosestInstance,rightClosestInstance);
}
-void CMessageSnapping::glueMsgToInstancesPair(Visio::IVShapePtr msgShape, Visio::IVShapePtr leftInstance, Visio::IVShapePtr rightInstance,
+bool CMessageSnapping::glueMsgToInstancesPair(Visio::IVShapePtr msgShape, Visio::IVShapePtr leftInstance, Visio::IVShapePtr rightInstance,
double yPos, MsgSnapType snapType, bool dontGlueIfConnected)
{
//if there are no instances, return
if(!leftInstance && !rightInstance)
- return;
+ return false;
double yLeftPos, yRightPos;
@@ -213,36 +213,35 @@
}
MsgJumpDirection msgDir = getMsgDirection(msgShape);
- //Glue to left instance
- if(leftInstance)
- glueMsgToInstance(msgShape, leftInstance, "BeginX", yLeftPos, msgDir, dontGlueIfConnected);
- //Glue to right instance
- if(rightInstance)
- glueMsgToInstance(msgShape, rightInstance, "EndX", yRightPos, msgDir, dontGlueIfConnected);
+ //Glue to left instance or to right instance (at least one endpoint must be snapped to return true)
+ glueMsgToInstance(msgShape, leftInstance, "BeginX", yLeftPos, msgDir, dontGlueIfConnected);
+ glueMsgToInstance(msgShape, rightInstance, "EndX", yRightPos, msgDir, dontGlueIfConnected);
+
+ return true;
}
-void CMessageSnapping::glueMsgToInstance(Visio::IVShapePtr msgShape, Visio::IVShapePtr instanceShape,
+bool CMessageSnapping::glueMsgToInstance(Visio::IVShapePtr msgShape, Visio::IVShapePtr instanceShape,
const _bstr_t & msgCell, double yPos, VisUnitCodes units)
{
- glueMsgToInstance(msgShape, instanceShape, msgCell, yPos, getMsgDirection(msgShape), true, units);
+ return glueMsgToInstance(msgShape, instanceShape, msgCell, yPos, getMsgDirection(msgShape), true, units);
}
-void CMessageSnapping::glueMsgToInstance(Visio::IVShapePtr msgShape, Visio::IVShapePtr instanceShape,
+bool CMessageSnapping::glueMsgToInstance(Visio::IVShapePtr msgShape, Visio::IVShapePtr instanceShape,
const _bstr_t & msgCell, double yPos, MsgJumpDirection msgDirection, bool dontGlueIfConnected, VisUnitCodes units)
{
if(!msgShape || !instanceShape)
- return;
+ return false;
bool isBegin = _tcsicmp(msgCell,_T("BeginX")) == 0;
//NOTE: If user snap message by himself (using red rectangle), we are done
if(dontGlueIfConnected)
if(msgShape->GetCells(isBegin ? "BegTrigger" : "EndTrigger")->ResultInt[visNone][visTruncate] == 2)
- return;
+ return false;
//NOTE: Return if endpoint is found or lost message
TShapeType shapeType = get_shape_type(msgShape);
if( (shapeType == 2 && _tcsicmp(msgCell,_T("EndX")) == 0) || (shapeType == 3 && isBegin) )
- return;
+ return false;
bool posX = 0;
MscPoint InstBeg(CShapeUtils::getShapeCell(instanceShape, "BeginX", units), CShapeUtils::getShapeCell(instanceShape, "BeginY", units));
@@ -257,8 +256,7 @@
double corEndY = CShapeUtils::getShapeCell(instanceShape, "EndY", units);
posX = (msgDirection == MSJUMP_RIGHT) ? (isBegin ? 1 : 0) : (isBegin ? 0 : 1);
double corSide = (InstBeg.get_y() < InstEnd.get_y()) ? !posX : posX;
- boost::shared_ptr<MscPoint> normalVec =
- boost::shared_ptr<MscPoint>(CPageUtils::getNormalVec(InstBeg-InstEnd, CShapeUtils::getCoregionHeight(instanceShape, units) * (corSide ? 1 : -1)));
+ boost::shared_ptr<MscPoint> normalVec (CPageUtils::getNormalVec(InstBeg-InstEnd, CShapeUtils::getCoregionHeight(instanceShape, units) * (corSide ? 1 : -1)));
InstBeg.set_y(corBegY + normalVec->get_y());
InstEnd.set_y(corEndY + normalVec->get_y());
@@ -266,16 +264,42 @@
posX = !posX;
}
+ //NOTE: IMPLEMENT
+ //std::vector<Visio::IVShapePtr> coregs = CShapeUtils::getConnectedShapes(instanceShape, ST_BMSC_COREGION);
+ //for(u_int i = 0; i < coregs.size(); i++)
+ //{
+ // double corBegY = CShapeUtils::getShapeCell(coregs.at(i), "BeginY", units);
+ // double corEndY = CShapeUtils::getShapeCell(coregs.at(i), "EndY", units);
+ // posX = (msgDirection == MSJUMP_RIGHT) ? (isBegin ? 1 : 0) : (isBegin ? 0 : 1);
+ // double corSide = (InstBeg.get_y() < InstEnd.get_y()) ? !posX : posX;
+ // boost::shared_ptr<MscPoint> normalVec (CPageUtils::getNormalVec(InstBeg-InstEnd, CShapeUtils::getCoregionHeight(coregs.at(i), units) * (corSide ? 1 : -1)));
+ // corBegY += normalVec->get_y();
+ // corEndY += normalVec->get_y();
+
+ // if(yPos <= corBegY && yPos >= corEndY)
+ // {
+ // instanceShape = coregs.at(i);
+ // InstBeg.set_y(corBegY);
+ // InstEnd.set_y(corEndY);
+
+ // if(corBegY < corEndY)
+ // posX = !posX;
+ // break;
+ // }
+ // }
+
double sizeOfInstance = fabs(InstBeg.get_y() - InstEnd.get_y());
double msgOffset = fabs(InstBeg.get_y() - yPos);
//avoid division by zero - when instances are in horizontal position
if(sizeOfInstance == 0 || msgOffset > sizeOfInstance)
- return;
+ return false;
msgShape->Application->EventsEnabled = false;
msgShape->Cells[msgCell]->GlueToPos(instanceShape,msgOffset/sizeOfInstance,(double)posX);
msgShape->Application->EventsEnabled = true;
+
+ return true;
}
MscPoint* CMessageSnapping::getIntersectionWithInstance(const MscPoint& beginPoint,const MscPoint& endPoint, Visio::IVShapePtr instanceShape, VisUnitCodes units)
@@ -353,17 +377,24 @@
bool CMessageSnapping::getMsgVector(Visio::IVShapePtr msgShape, MscPoint* resultVector, VisUnitCodes units)
{
- if(!resultVector)
+ if(!msgShape || !resultVector || !isMessageShape(msgShape))
return false;
+ try {
resultVector->set_x(msgShape->Cells["EndX"]->Result[units] - msgShape->Cells["BeginX"]->Result[units]);
resultVector->set_y(msgShape->Cells["EndY"]->Result[units] - msgShape->Cells["BeginY"]->Result[units]);
+ } catch(_com_error err) {
+ MessageBox(GetActiveWindow(), L"getMsgVector:: exception occurred", L"", MB_ICONERROR);
+ }
return true;
}
void CMessageSnapping::snap(Visio::IVShapePtr msgShape, double posX, double posY, MsgSnapType snapType)
{
+ if(!msgShape)
+ return;
+
long scopeID = msgShape->Application->BeginUndoScope(_T("snap"));
#define _sp(x) CShapeUtils::getShapeCell(msgShape, x)
@@ -448,6 +479,8 @@
std::vector<Visio::IVShapePtr> CMessageSnapping::getConnectedInstances(Visio::IVShapePtr msgShape)
{
std::vector<Visio::IVShapePtr> instances;
+ if(!msgShape)
+ return instances;
Visio::IVConnectsPtr conns = msgShape->Connects;
for(int i=1; i<=conns->Count; i++)
@@ -463,7 +496,7 @@
bool CMessageSnapping::resnap(Visio::IVShapePtr msgShape, Visio::IVShapesPtr shapes, double precision)
{
- if(!msgShape || !shapes)
+ if(!msgShape || !shapes || !isMessageShape(msgShape))
return false;
long scopeId = msgShape->Application->BeginUndoScope(_T("Re-snap"));
@@ -563,7 +596,6 @@
msgShape->Application->EventsEnabled = false;
int sign = (fixedColumnX == vis1DBeginX) ? 1 : -1;
-
try {
msgShape->GetCellsSRC(visSectionObject,visRowXForm1D, fixedColumnX+(2*sign))->Formula =
stringize() << msgShape->GetCellsSRC(visSectionObject,
Modified: trunk/src/view/visio/addon/messageSnapping.h
===================================================================
--- trunk/src/view/visio/addon/messageSnapping.h 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/messageSnapping.h 2010-09-13 13:19:34 UTC (rev 916)
@@ -49,16 +49,16 @@
* designed only for horizontal messages (diagonal messages will be snapped according their PinX point and reformed to horizontal messages)
* @param onlyOnInstanceLine if true avoid connection message on instace's "rectangles" on the top and the bottom
*/
- static void glueMsgToInstancesPair(Visio::IVShapePtr msgShape, Visio::IVShapePtr leftInstance, Visio::IVShapePtr rightInstance,
+ static bool glueMsgToInstancesPair(Visio::IVShapePtr msgShape, Visio::IVShapePtr leftInstance, Visio::IVShapePtr rightInstance,
double yPos, MsgSnapType snapType, bool dontGlueIfConnected = true);
/*
* Glue given message to instance, but only to "line" of instance, rectangles at the bottom and top are ignored
* @param msgCell message cell which should be glued (e.g. BeginX, EndX)
* @param yPos vertical position where to glue message to instance (in page units - visPageUnits)
*/
- static void glueMsgToInstance(Visio::IVShapePtr msgShape, Visio::IVShapePtr instanceShape, const _bstr_t & msgCell, double yPos,
+ static bool glueMsgToInstance(Visio::IVShapePtr msgShape, Visio::IVShapePtr instanceShape, const _bstr_t & msgCell, double yPos,
VisUnitCodes units = visPageUnits);
- static void glueMsgToInstance(Visio::IVShapePtr msgShape, Visio::IVShapePtr instanceShape, const _bstr_t & msgCell, double yPos,
+ static bool glueMsgToInstance(Visio::IVShapePtr msgShape, Visio::IVShapePtr instanceShape, const _bstr_t & msgCell, double yPos,
MsgJumpDirection msgDirection, bool dontGlueIfConnected = true, VisUnitCodes units = visPageUnits);
/*
*
Modified: trunk/src/view/visio/addon/numberingGlobalDlg.cpp
===================================================================
--- trunk/src/view/visio/addon/numberingGlobalDlg.cpp 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/numberingGlobalDlg.cpp 2010-09-13 13:19:34 UTC (rev 916)
@@ -137,24 +137,10 @@
void CNumberingGlobalDlg::OnHelp()
{
- //FIXME: Doesn't work in VIsio 2007
std::basic_string<TCHAR> path = GetVisioModulePath();
path += _T("\\help\\frontend\\message-numbering.html");
- ShellExecute(NULL, L"open", path.c_str() , NULL, NULL, SW_SHOWNORMAL);
- return;
-
-
- path += _T("scstudio.chm::/frontend/message-numbering.html");
-
- try
- {
- m_vsoApp->InvokeHelp(path.c_str(), HH_DISPLAY_TOPIC, 1);
- }
- catch (_com_error &err)
- {
- std::wstring text = stringize() << _T("Cannot display help due to internal error: ") << err.ErrorMessage();
- MessageBox(text.c_str());
- }
+ MessageBox(path.c_str());
+ ShellExecuteW(NULL, L"open", path.c_str() , NULL, NULL, SW_SHOWNORMAL);
}
void CNumberingGlobalDlg::EnableAllControls(bool bEnable)
Modified: trunk/src/view/visio/addon/shapeutils.cpp
===================================================================
--- trunk/src/view/visio/addon/shapeutils.cpp 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/shapeutils.cpp 2010-09-13 13:19:34 UTC (rev 916)
@@ -94,6 +94,9 @@
MsgConnectedEndpoints CShapeUtils::getConnectedEndpoints(Visio::IVShapePtr shape)
{
+ if(!shape || !isMessageShape(shape))
+ MSCE_UNKNOWN;
+
bool begSnapped = shape->GetCells("BegTrigger")->ResultInt[visNone][visTruncate] == 2;
bool endSnapped = shape->GetCells("EndTrigger")->ResultInt[visNone][visTruncate] == 2;
@@ -118,9 +121,7 @@
CMessageSnapping::setEnabled(false);
//Create new shapge
CDrawingVisualizer visualizer(origShape->Application);
- origShape->Application->EventsEnabled = false;
Visio::IVShapePtr newShape = page->Drop(visualizer.find_master(newShapeType),0,0);
- origShape->Application->EventsEnabled = true;
//Copy shape internal data (for message numbering)
newShape->Text = origShape->Text;
newShape->Data1 = origShape->Data1;
@@ -153,7 +154,6 @@
catch (_com_error err) {
MessageBox(GetActiveWindow(), _T("changeMsgType: exception occurred."), L"", MB_OK);
}
- origShape->Application->EventsEnabled = true;
//Enable snapping back
CMessageSnapping::setEnabled(snapStatus);
@@ -167,6 +167,7 @@
std::vector<Visio::IVShapePtr> CShapeUtils::getConnectedShapes(Visio::IVShapePtr shape, TShapeType connectedShapeType)
{
+ //FIXME: Each coregion is twice in vector
std::vector<Visio::IVShapePtr> shapes;
Visio::IVConnectsPtr connects = shape->FromConnects;
Modified: trunk/src/view/visio/addon/snapGlobalDlg.cpp
===================================================================
--- trunk/src/view/visio/addon/snapGlobalDlg.cpp 2010-09-13 12:24:46 UTC (rev 915)
+++ trunk/src/view/visio/addon/snapGlobalDlg.cpp 2010-09-13 13:19:34 UTC (rev 916)
@@ -57,19 +57,6 @@
std::basic_string<TCHAR> path = GetVisioModulePath();
path += _T("\\help\\frontend\\message-snapping.html");
ShellExecute(NULL, L"open", path.c_str() , NULL, NULL, SW_SHOWNORMAL);
-
- return;
- path += _T("scstudio.chm::/frontend/message-snapping.html");
-
- try
- {
- m_vsoApp->InvokeHelp(path.c_str(), HH_DISPLAY_TOPIC, 1);
- }
- catch (_com_error &err)
- {
- std::wstring text = stringize() << _T("Cannot display help due to internal error: ") << err.Description();
- MessageBox(text.c_str());
- }
}
int CSnapGlobalDlg::LoadRegistryData()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|