|
From: <got...@us...> - 2010-01-13 22:34:19
|
Revision: 551
http://scstudio.svn.sourceforge.net/scstudio/?rev=551&view=rev
Author: gotthardp
Date: 2010-01-13 22:34:09 +0000 (Wed, 13 Jan 2010)
Log Message:
-----------
'Find Flow' dialog now displays only applicable drawings.
Modified Paths:
--------------
trunk/src/view/visio/addon/extract.cpp
trunk/src/view/visio/addon/extract.h
trunk/src/view/visio/addon/finddlg.cpp
trunk/src/view/visio/addon/finddlg.h
Modified: trunk/src/view/visio/addon/extract.cpp
===================================================================
--- trunk/src/view/visio/addon/extract.cpp 2010-01-11 19:10:35 UTC (rev 550)
+++ trunk/src/view/visio/addon/extract.cpp 2010-01-13 22:34:09 UTC (rev 551)
@@ -192,7 +192,7 @@
return ST_UNKNOWN;
}
-CDrawingExtractor::TDrawingType CDrawingExtractor::get_drawing_type(Visio::IVPagePtr vsoPage)
+TDrawingType get_drawing_type(Visio::IVPagePtr vsoPage)
{
Visio::IVShapesPtr vsoShapes = vsoPage->Shapes;
Modified: trunk/src/view/visio/addon/extract.h
===================================================================
--- trunk/src/view/visio/addon/extract.h 2010-01-11 19:10:35 UTC (rev 550)
+++ trunk/src/view/visio/addon/extract.h 2010-01-13 22:34:09 UTC (rev 551)
@@ -51,6 +51,16 @@
//! determine MSC symbol represented by the given shape
TShapeType get_shape_type(Visio::IVShapePtr shape);
+enum TDrawingType
+{
+ DT_UNKNOWN = 0,
+ DT_BMSC = 1,
+ DT_HMSC = 2
+};
+
+//! determine type of the drawing on the given page
+TDrawingType get_drawing_type(Visio::IVPagePtr vsoPage);
+
class CDrawingExtractor
{
public:
@@ -93,16 +103,6 @@
typedef std::map<std::wstring,MscPtr,nocase_comparator<wchar_t> > MscCacheMap;
MscCacheMap m_msc_cache;
- enum TDrawingType
- {
- DT_UNKNOWN = 0,
- DT_BMSC = 1,
- DT_HMSC = 2
- };
-
- //! determine type of the drawing on the given page
- TDrawingType get_drawing_type(Visio::IVPagePtr vsoPage);
-
//! 2D coordinates in visio internal units, having [0,0] bottom left
struct SPoint
{
Modified: trunk/src/view/visio/addon/finddlg.cpp
===================================================================
--- trunk/src/view/visio/addon/finddlg.cpp 2010-01-11 19:10:35 UTC (rev 550)
+++ trunk/src/view/visio/addon/finddlg.cpp 2010-01-13 22:34:09 UTC (rev 551)
@@ -17,6 +17,7 @@
*/
#include "stdafx.h"
+#include "extract.h"
#include "finddlg.h"
CFindDlg::CFindDlg(Visio::IVApplicationPtr vsoApp)
@@ -30,8 +31,8 @@
CenterWindow(GetParent());
DoDataExchange();
- InitializeTree(m_drawing1);
- InitializeTree(m_drawing2);
+ InitializeTree(m_drawing1, true); // pattern
+ InitializeTree(m_drawing2, false);
return bHandled = FALSE;
}
@@ -51,7 +52,7 @@
return 0;
}
-void CFindDlg::InitializeTree(CTreeViewCtrl& tree)
+void CFindDlg::InitializeTree(CTreeViewCtrl& tree, bool isPattern)
{
for(int i = 1; i <= m_vsoApp->Windows->Count; i++)
{
@@ -63,8 +64,15 @@
for(int j = 1; j <= vsoDocument->Pages->Count; j++)
{
Visio::IVPagePtr vsoPage = vsoDocument->Pages->Item[j];
- HTREEITEM pageitem = tree.InsertItem(vsoPage->Name, docitem, 0);
- tree.SetItemData(pageitem, vsoPage->ID);
+
+ TDrawingType dtype = get_drawing_type(vsoPage);
+ // check the drawing type
+ if(isPattern && dtype == DT_BMSC ||
+ !isPattern && (dtype == DT_BMSC || dtype == DT_HMSC))
+ {
+ HTREEITEM pageitem = tree.InsertItem(vsoPage->Name, docitem, 0);
+ tree.SetItemData(pageitem, vsoPage->ID);
+ }
}
tree.Expand(docitem);
Modified: trunk/src/view/visio/addon/finddlg.h
===================================================================
--- trunk/src/view/visio/addon/finddlg.h 2010-01-11 19:10:35 UTC (rev 550)
+++ trunk/src/view/visio/addon/finddlg.h 2010-01-13 22:34:09 UTC (rev 551)
@@ -56,7 +56,7 @@
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnCloseCmd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
- void InitializeTree(CTreeViewCtrl& tree);
+ void InitializeTree(CTreeViewCtrl& tree, bool isPattern);
Visio::IVPagePtr GetTreeSelection(CTreeViewCtrl& tree);
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|