Updated for 1.1.0.7-3
This commit is contained in:
parent
084b2b0afb
commit
eaf4729051
|
@ -25,7 +25,7 @@ xmlcopyeditor_SOURCES = xmlcopyeditor.cpp associatedialog.cpp casehandler.cpp \
|
||||||
xmlparseschemans.cpp xmlshallowvalidator.cpp wrapxerces.cpp \
|
xmlparseschemans.cpp xmlshallowvalidator.cpp wrapxerces.cpp \
|
||||||
findreplacepanel.cpp commandpanel.cpp \
|
findreplacepanel.cpp commandpanel.cpp \
|
||||||
binaryfile.cpp xmlencodingspy.cpp wrapaspell.cpp \
|
binaryfile.cpp xmlencodingspy.cpp wrapaspell.cpp \
|
||||||
rulesets filters png rng xpm templates copying help po \
|
rulesets png rng xpm templates copying help po \
|
||||||
xmlcopyeditor.spec xmlcopyeditor.png custom.xpm \
|
xmlcopyeditor.spec xmlcopyeditor.png custom.xpm \
|
||||||
xmlcopyeditor.desktop
|
xmlcopyeditor.desktop
|
||||||
xmlcopyeditor_LDFLAGS = $(WX_LIBS) \
|
xmlcopyeditor_LDFLAGS = $(WX_LIBS) \
|
||||||
|
@ -33,7 +33,6 @@ xmlcopyeditor_LDFLAGS = $(WX_LIBS) \
|
||||||
|
|
||||||
nobase_xmlcopyeditor_DATA = png/*.png \
|
nobase_xmlcopyeditor_DATA = png/*.png \
|
||||||
rulesets/*.* \
|
rulesets/*.* \
|
||||||
filters/*.* \
|
|
||||||
rng/*.rng \
|
rng/*.rng \
|
||||||
rng/*.rnc \
|
rng/*.rnc \
|
||||||
rng/exclude/*.rng \
|
rng/exclude/*.rng \
|
||||||
|
|
|
@ -210,7 +210,7 @@ xmlcopyeditor_SOURCES = xmlcopyeditor.cpp associatedialog.cpp casehandler.cpp \
|
||||||
xmlparseschemans.cpp xmlshallowvalidator.cpp wrapxerces.cpp \
|
xmlparseschemans.cpp xmlshallowvalidator.cpp wrapxerces.cpp \
|
||||||
findreplacepanel.cpp commandpanel.cpp \
|
findreplacepanel.cpp commandpanel.cpp \
|
||||||
binaryfile.cpp xmlencodingspy.cpp wrapaspell.cpp \
|
binaryfile.cpp xmlencodingspy.cpp wrapaspell.cpp \
|
||||||
rulesets filters png rng xpm templates copying help po \
|
rulesets png rng xpm templates copying help po \
|
||||||
xmlcopyeditor.spec xmlcopyeditor.png custom.xpm \
|
xmlcopyeditor.spec xmlcopyeditor.png custom.xpm \
|
||||||
xmlcopyeditor.desktop
|
xmlcopyeditor.desktop
|
||||||
|
|
||||||
|
@ -219,7 +219,6 @@ xmlcopyeditor_LDFLAGS = $(WX_LIBS) \
|
||||||
|
|
||||||
nobase_xmlcopyeditor_DATA = png/*.png \
|
nobase_xmlcopyeditor_DATA = png/*.png \
|
||||||
rulesets/*.* \
|
rulesets/*.* \
|
||||||
filters/*.* \
|
|
||||||
rng/*.rng \
|
rng/*.rng \
|
||||||
rng/*.rnc \
|
rng/*.rnc \
|
||||||
rng/exclude/*.rng \
|
rng/exclude/*.rng \
|
||||||
|
|
|
@ -3250,53 +3250,12 @@ void MyFrame::OnSpelling ( wxCommandEvent& event )
|
||||||
|
|
||||||
std::string rawBufferUtf8;
|
std::string rawBufferUtf8;
|
||||||
getRawText ( doc, rawBufferUtf8 );
|
getRawText ( doc, rawBufferUtf8 );
|
||||||
|
bool success = true; // always true for now: well-formedness not req'd
|
||||||
// handle unusual encodings
|
|
||||||
if ( !XmlEncodingHandler::setUtf8 ( rawBufferUtf8 ) )
|
|
||||||
{
|
|
||||||
encodingMessage();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
WrapTempFileName tempFileName ( doc->getFullFileName() );
|
|
||||||
|
|
||||||
ofstream rawBufferStream ( tempFileName.name().c_str() );
|
|
||||||
if ( !rawBufferStream )
|
|
||||||
return;
|
|
||||||
|
|
||||||
rawBufferStream << rawBufferUtf8;
|
|
||||||
rawBufferStream.close();
|
|
||||||
|
|
||||||
auto_ptr<WrapLibxml> wl ( new WrapLibxml ( libxmlNetAccess, catalogPath ) );
|
|
||||||
|
|
||||||
bool success = wl->parse ( tempFileName.name(), true );
|
|
||||||
|
|
||||||
std::string bufferParameterUtf8;
|
|
||||||
|
|
||||||
if ( !success )
|
|
||||||
{
|
|
||||||
statusProgress ( wxEmptyString );
|
|
||||||
std::string error = wl->getLastError();
|
|
||||||
wxString wideError = wxString ( error.c_str(), wxConvUTF8, error.size() );
|
|
||||||
wideError.Prepend ( _ ( "Checking document in read-only mode: " ) );
|
|
||||||
messagePane ( wideError, CONST_WARNING );
|
|
||||||
|
|
||||||
if ( !ReadFile::run ( tempFileName.name(), bufferParameterUtf8 ) )
|
|
||||||
return;
|
|
||||||
std::auto_ptr<WrapExpat> we ( new WrapExpat() );
|
|
||||||
bufferParameterUtf8 = we->xmliseTextNode ( bufferParameterUtf8 );
|
|
||||||
bufferParameterUtf8.insert ( 0, "<root>" );
|
|
||||||
bufferParameterUtf8 += "</root>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bufferParameterUtf8 = wl->getOutput();
|
|
||||||
}
|
|
||||||
|
|
||||||
auto_ptr<StyleDialog> sd ( new StyleDialog (
|
auto_ptr<StyleDialog> sd ( new StyleDialog (
|
||||||
this,
|
this,
|
||||||
wxICON ( appicon ),
|
wxICON ( appicon ),
|
||||||
bufferParameterUtf8,
|
rawBufferUtf8,
|
||||||
doc->getShortFileName(),
|
doc->getShortFileName(),
|
||||||
ruleSetDir,
|
ruleSetDir,
|
||||||
filterDir,
|
filterDir,
|
||||||
|
|
Loading…
Reference in New Issue