- Timestamp:
- 08/20/10 15:06:58 (21 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
cafu/branches/cafu_to_wx/CaWE/GuiEditor/Commands/Paste.cpp
r36 r124 23 23 24 24 #include "Paste.hpp" 25 26 25 #include "../GuiDocument.hpp" 27 28 26 #include "../EditorData/Window.hpp" 29 30 27 #include "GuiSys/Window.hpp" 31 28 … … 78 75 { 79 76 wxASSERT(!m_Done); 80 81 77 if (m_Done) return false; 82 78 … … 84 80 { 85 81 m_Windows[WinNr]->Parent=m_NewParent; 86 87 82 m_NewParent->Children.PushBack(m_Windows[WinNr]); 88 83 89 // If current window name is not unique within the window structure it was pasted into, 90 // create a new unique name. 91 wxString CurrentWindowName=m_Windows[WinNr]->Name; 92 unsigned long Counter=1; 93 94 while (!(((EditorDataWindowT*)m_Windows[WinNr]->EditorData)->CheckNameUniqueness(m_Windows[WinNr]->Name))) 95 { 96 std::ostringstream NameStream; 97 NameStream << CurrentWindowName << "_" << Counter; 98 Counter++; 99 100 m_Windows[WinNr]->Name=NameStream.str(); 101 } 84 // If the name of the window is not unique among its siblings, find a new unique name. 85 ((EditorDataWindowT*)m_Windows[WinNr]->EditorData)->RepairNameUniqueness(); 102 86 } 103 87 … … 105 89 106 90 m_Done=true; 107 108 91 return true; 109 92 } … … 113 96 { 114 97 wxASSERT(m_Done); 115 116 98 if (!m_Done) return; 117 99
