From 9a5e1b16eca0eb766dcb619fc07e5633301bc8ba Mon Sep 17 00:00:00 2001 From: Gerald Schmidt Date: Sun, 14 Oct 2007 18:12:55 +0000 Subject: [PATCH] Code cleanup ahead of 1.1.0.3 --- src/Makefile.in | 4 +--- src/xmlcopyeditor.cpp | 7 ++++--- src/xmlctrl.cpp | 29 +++-------------------------- 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index e0fde42..eab54a2 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -220,7 +220,7 @@ xmlcopyeditor_SOURCES = xmlcopyeditor.cpp associatedialog.cpp casehandler.cpp \ xmlassociatexsl.cpp xmlctrl.cpp xmldoc.cpp xmlencodinghandler.cpp xmlfilterreader.cpp \ xmlpromptgenerator.cpp xmlrulereader.cpp xmlschemalocator.cpp xmlutf8reader.cpp xsllocator.cpp \ wrapexpat.cpp mypropertysheet.cpp rule.cpp housestylewriter.cpp myipc.cpp aboutdialog.cpp pathresolver.cpp mynotebook.cpp \ - insertpanel.cpp mytoolbar.cpp mymenubar.cpp xmlwordcount.cpp getword.cpp locationpanel.cpp catalogresolver.cpp getlinuxappdir.cpp \ + insertpanel.cpp xmlwordcount.cpp getword.cpp locationpanel.cpp catalogresolver.cpp getlinuxappdir.cpp \ xmlparseschemans.cpp xmlshallowvalidator.cpp wrapxerces.cpp \ findreplacepanel.cpp xmlschemaparser.cpp commandpanel.cpp \ binaryfile.cpp xmlencodingspy.cpp \ @@ -350,10 +350,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locationpanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/myhtmlpane.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/myipc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mymenubar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mynotebook.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mypropertysheet.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mytoolbar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nocasecompare.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pathresolver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readfile.Po@am__quote@ diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index 26436cc..d10eea6 100755 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -4760,7 +4760,10 @@ bool MyFrame::saveFile ( XmlDoc *doc, wxString& fileName, bool checkLastModified doc->SetSavePoint(); if ( properties.validateAsYouType && isXml ) + { + doc->clearErrorIndicators(); doc->shallowValidate ( utf8Buffer.c_str(), utf8Buffer.size() ); + } if ( !unlimitedUndo ) doc->EmptyUndoBuffer(); @@ -4895,8 +4898,6 @@ wxMenuBar *MyFrame::getMenuBar() new wxMenuItem ( NULL, ID_GOTO, _ ( "G&o To...\tCtrl+G" ), _ ( "Go To..." ) ); gotoItem->SetBitmap ( wxNullBitmap ); - - editMenu->Append ( undoItem ); editMenu->Append ( redoItem ); editMenu->AppendSeparator(); @@ -5169,9 +5170,9 @@ wxMenuBar *MyFrame::getMenuBar() toolsMenu->Append ( wordCountItem ); toolsMenu->AppendSeparator(); toolsMenu->Append ( commandItem ); - toolsMenu->AppendSeparator(); #ifdef __WXMSW__ + toolsMenu->AppendSeparator(); wxMenuItem *optionsItem = new wxMenuItem ( NULL, diff --git a/src/xmlctrl.cpp b/src/xmlctrl.cpp index 414bd2b..0325823 100755 --- a/src/xmlctrl.cpp +++ b/src/xmlctrl.cpp @@ -59,8 +59,8 @@ XmlCtrl::XmlCtrl ( basePath ( basePathParameter ), auxPath ( auxPathParameter ) { - SetEOLMode ( wxSTC_EOL_LF ); - SetPasteConvertEndings ( true ); // essential to avoid double-spaced paste + //SetEOLMode ( wxSTC_EOL_LF ); + //SetPasteConvertEndings ( true ); currentMaxLine = 1; validationRequired = dtdFound = false; @@ -1969,7 +1969,7 @@ bool XmlCtrl::shallowValidate ( int maxLine, bool segmentOnly ) parentStartAngleBracket, memory; current = GetCurrentPos(); - line = LineFromPosition ( current );//PositionFromLine(current); + line = LineFromPosition ( current ); // try to include next line lineEnd = GetLineEndPosition ( line + 1 ); @@ -2022,29 +2022,6 @@ bool XmlCtrl::shallowValidate ( int maxLine, bool segmentOnly ) return shallowValidate ( bufferUtf8.c_str(), bufferUtf8.size(), startLine, maxLine, columnOffset, segmentOnly ); - /* - bool res = validator->parse(bufferUtf8, (segmentOnly) ? false : true); - if (!validator->getOverrideFailure() && (!res || !validator->isValid())) - { - std::vector > positionVector = validator->getPositionVector(); - - if (res == XML_STATUS_ERROR) - { - positionVector.push_back(validator->getErrorPosition()); - } - - std::vector >::iterator it; - for (it = positionVector.begin(); it != positionVector.end(); it++) - { - int line, column; - line = (it->first - 1) + startLine; - column = it->second + columnOffset; - setErrorIndicator(line, column); - } - return false; - } - return true; - */ } bool XmlCtrl::shallowValidate ( const char *buffer,