[Uml-devel] kdesdk/umbrello/umbrello/dialogs

Brian Thomas thomas at mail630.gsfc.nasa.gov
Mon Apr 19 09:33:06 UTC 2004


CVS commit by thomas: 

bug fix: codeeditor has 2 problems : 1. only first edit was being saved by the editor. 2. Incorrect indentation being passed to unformat comment block text in some cases. Both issues fixed


  M +6 -4      codeeditor.cpp   1.19


--- kdesdk/umbrello/umbrello/dialogs/codeeditor.cpp  #1.18:1.19
@@ -697,4 +697,5 @@ QPopupMenu * CodeEditor::createPopupMenu
                         menu->setItemEnabled (4, false);
 
+                m_selectedTextBlock->insertCodeEditMenuItems(menu);
         }
 
@@ -814,5 +815,6 @@ void CodeEditor::updateTextBlockFromText
 
                 CodeMethodBlock * cmb = dynamic_cast<CodeMethodBlock*>(block);
-                QString baseIndent = block->getNewEditorLine(block->getIndentationLevel()+(cmb ? 1 : 0));
+                //QString baseIndent = block->getNewEditorLine(block->getIndentationLevel()+(cmb ? 1 : 0));
+                QString baseIndent = block->getIndentationString(block->getIndentationLevel()+(cmb ? 1 : 0));
 
                 TextBlockInfo *info = (*m_tbInfoMap)[block];
@@ -894,5 +896,5 @@ void CodeEditor::cursorPositionChanged(i
                 QString currentParaText = text(para);
                 QString baseIndent = tBlock->getNewEditorLine(tBlock->getIndentationLevel()+(cmb ? 1 : 0));
-//cerr<<"AUTO INDENT:["<<baseIndent.latin1()<<"] isMethod?"<<(cmb?"true":"false")<<endl;
+// cerr<<"AUTO INDENT:["<<baseIndent.latin1()<<"] isMethod?"<<(cmb?"true":"false")<<endl;
                 int minPos = baseIndent.length();
 
@@ -960,5 +962,5 @@ void CodeEditor::cursorPositionChanged(i
         // look for changes in editability, if they occur, we need to record
         // the edits which have been made
-        if((editPara && !lastParaIsEditable) || (!editPara && lastParaIsEditable)) {
+        if((editPara && !m_lastTextBlockToBeEdited) || (!editPara && m_lastTextBlockToBeEdited)) {
 
                 setReadOnly(editPara ? false : true);






More information about the umbrello-devel mailing list