Show
Ignore:
Timestamp:
08/20/10 15:06:58 (21 months ago)
Author:
Carsten
Message:

Merged latest changes from trunk into branches/cafu_to_wx.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/branches/cafu_to_wx/CaWE/GuiEditor/Commands/Paste.cpp

    r36 r124  
    2323 
    2424#include "Paste.hpp" 
    25  
    2625#include "../GuiDocument.hpp" 
    27  
    2826#include "../EditorData/Window.hpp" 
    29  
    3027#include "GuiSys/Window.hpp" 
    3128 
     
    7875{ 
    7976    wxASSERT(!m_Done); 
    80  
    8177    if (m_Done) return false; 
    8278 
     
    8480    { 
    8581        m_Windows[WinNr]->Parent=m_NewParent; 
    86  
    8782        m_NewParent->Children.PushBack(m_Windows[WinNr]); 
    8883 
    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(); 
    10286    } 
    10387 
     
    10589 
    10690    m_Done=true; 
    107  
    10891    return true; 
    10992} 
     
    11396{ 
    11497    wxASSERT(m_Done); 
    115  
    11698    if (!m_Done) return; 
    11799