Updated for 1.2.0.6

This commit is contained in:
Gerald Schmidt 2009-10-04 22:54:47 +00:00
parent ed7abc9dd5
commit 5ff7b1f7ef
14 changed files with 296 additions and 165 deletions

View File

@ -1,5 +1,5 @@
# these are the headers for your project # these are the headers for your project
noinst_HEADERS = $(srcdir)/*.h noinst_HEADERS = *.h
######################################################################### #########################################################################
# APPLICATION SECTION # APPLICATION SECTION
@ -8,9 +8,9 @@ noinst_HEADERS = $(srcdir)/*.h
# of the other Makefile.am variables # of the other Makefile.am variables
bin_PROGRAMS = xmlcopyeditor bin_PROGRAMS = xmlcopyeditor
bindir = ${prefix}/bin bindir = ${prefix}/bin
xmlcopyeditordir = ${datarootdir}/xmlcopyeditor xmlcopyeditordir = ${prefix}/share/xmlcopyeditor
pixmapdir = ${datarootdir}/pixmaps pixmapdir = /usr/share/pixmaps
desktopdir = ${datarootdir}/applications applicationsdir = /usr/share/applications
# the application source, library search path, and link libraries # the application source, library search path, and link libraries
xmlcopyeditor_SOURCES = xmlcopyeditor.cpp associatedialog.cpp casehandler.cpp \ xmlcopyeditor_SOURCES = xmlcopyeditor.cpp associatedialog.cpp casehandler.cpp \
@ -25,55 +25,55 @@ xmlcopyeditor_SOURCES = xmlcopyeditor.cpp associatedialog.cpp casehandler.cpp \
xmlparseschemans.cpp xmlshallowvalidator.cpp wrapxerces.cpp \ xmlparseschemans.cpp xmlshallowvalidator.cpp wrapxerces.cpp \
findreplacepanel.cpp commandpanel.cpp xercescatalogresolver.cpp \ findreplacepanel.cpp commandpanel.cpp xercescatalogresolver.cpp \
binaryfile.cpp xmlencodingspy.cpp wrapaspell.cpp validationthread.cpp \ binaryfile.cpp xmlencodingspy.cpp wrapaspell.cpp validationthread.cpp \
wrapdaisy.cpp exportdialog.cpp mp3album.cpp xmlprodnote.cpp \
rulesets png rng xpm templates copying help po \
xmlcopyeditor.spec xmlcopyeditor.png custom.xpm \ xmlcopyeditor.spec xmlcopyeditor.png custom.xpm \
xmlcopyeditor.desktop xmlcopyeditor.desktop
# rulesets png rng xpm templates copying help po
xmlcopyeditor_LDFLAGS = $(WX_LIBS) \ xmlcopyeditor_LDFLAGS = $(WX_LIBS) \
-lexpat -lxslt -lxml2 -lpcre -lxerces-c -laspell -lexpat -lxslt -lxml2 -lpcre -lxerces-c $(ASPELL_LIBS) $(ENCHANT_LIBS)
nobase_xmlcopyeditor_DATA = $(srcdir)/png/*.png\ nobase_xmlcopyeditor_DATA = png/*.png \
$(srcdir)/rulesets/*.* \ rulesets/*.* \
$(srcdir)/rng/*.rng \ rng/*.rng \
$(srcdir)/rng/*.rnc \ rng/*.rnc \
$(srcdir)/rng/exclude/*.rng \ rng/exclude/*.rng \
$(srcdir)/rng/modules/*.rng \ rng/modules/*.rng \
$(srcdir)/xpm/*.xpm \ xpm/*.xpm \
$(srcdir)/templates/*.xml \ templates/*.xml \
$(srcdir)/templates/*.dtd \ templates/*.dtd \
$(srcdir)/templates/*.xsl \ templates/*.xsl \
$(srcdir)/templates/*.rss \ templates/*.rss \
$(srcdir)/templates/*.html \ templates/*.html \
$(srcdir)/templates/*.xtm \ templates/*.xtm \
$(srcdir)/templates/*.xsd \ templates/*.xsd \
$(srcdir)/templates/*.rng \ templates/*.rng \
$(srcdir)/templates/*.lzx \ templates/*.lzx \
$(srcdir)/templates/*.xlf \ templates/*.xlf \
$(srcdir)/help/*.* $(srcdir)/help/html/*.* \ help/*.* help/html/*.* \
$(srcdir)/copying/*.txt $(srcdir)/copying/boost_shared_ptr/* \ copying/*.txt copying/boost_shared_ptr/* \
$(srcdir)/copying/Expat/* $(srcdir)/copying/libxml2/* $(srcdir)/copying/libxslt/* \ copying/Expat/* copying/libxml2/* copying/libxslt/* \
$(srcdir)/copying/PCRE/* $(srcdir)/copying/Scintilla/* \ copying/PCRE/* copying/Scintilla/* \
$(srcdir)/copying/wxStyledTextCtrl/* \ copying/wxStyledTextCtrl/* \
$(srcdir)/copying/wxStEditor/* \ copying/wxStEditor/* \
$(srcdir)/copying/xmlcopyeditor/* \ copying/xmlcopyeditor/* \
$(srcdir)/copying/Aspell/* \ copying/Aspell/* \
$(srcdir)/copying/Apache/LICENSE-2.0 \ copying/Apache/LICENSE-2.0 \
$(srcdir)/copying/Apache/LICENSE-2_files/* \ copying/Apache/LICENSE-2_files/* \
$(srcdir)/po/sk/messages.mo \ po/sk/messages.mo \
$(srcdir)/po/sv/messages.mo \ po/sv/messages.mo \
$(srcdir)/po/fr/messages.mo \ po/fr/messages.mo \
$(srcdir)/po/de/messages.mo \ po/de/messages.mo \
$(srcdir)/po/ru/messages.mo \ po/ru/messages.mo \
$(srcdir)/po/es/messages.mo \ po/es/messages.mo \
$(srcdir)/po/zh_CN/messages.mo \ po/zh_CN/messages.mo \
$(srcdir)/po/zh_TW/messages.mo \ po/zh_TW/messages.mo \
$(srcdir)/po/uk_UA/messages.mo \ po/uk_UA/messages.mo \
$(srcdir)/po/uk_UA/messages.mo \ po/uk_UA/messages.mo \
$(srcdir)/po/en_us/messages.po po/en_us/messages.po
pixmap_DATA = xmlcopyeditor.png pixmap_DATA = xmlcopyeditor.png
desktop_DATA = xmlcopyeditor.desktop applications_DATA = xmlcopyeditor.desktop
INCLUDES = -I/usr/include/libxml2 INCLUDES = -I/usr/include/libxml2 $(ENCHANT_CFLAGS)

View File

@ -20,11 +20,6 @@
#include "myhtmlpane.h" #include "myhtmlpane.h"
#include "xmlcopyeditor.h" #include "xmlcopyeditor.h"
#include <string>
#include <sstream>
#include <iostream>
BEGIN_EVENT_TABLE ( MyHtmlPane, wxHtmlWindow ) BEGIN_EVENT_TABLE ( MyHtmlPane, wxHtmlWindow )
EVT_LEFT_DCLICK ( MyHtmlPane::OnLeftDoubleClick ) EVT_LEFT_DCLICK ( MyHtmlPane::OnLeftDoubleClick )
END_EVENT_TABLE() END_EVENT_TABLE()
@ -57,32 +52,4 @@ void MyHtmlPane::OnCellClicked(
*/ */
void MyHtmlPane::OnLeftDoubleClick ( wxMouseEvent& WXUNUSED ( event ) ) void MyHtmlPane::OnLeftDoubleClick ( wxMouseEvent& WXUNUSED ( event ) )
{ { }
}
bool MyHtmlPane::OnCellClicked(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& event)
{
//since the error description was hardcoded, make use of this error string
//parse the get the line number, then jump to that line
if(error_message.find("Validation stopped at line") != -1 ||
error_message.find("Error at line")!= -1){
string substring = error_message.substr(error_message.find("at line ")+8);
string number = substring.substr(0,substring.find(", "));
istringstream iss(substring);
int line ;
iss >> line;
if (--line >= 0 && (doc))
{
doc->GotoLine ( ( int ) line );
doc->SetFocus();
}
return true;
}
return false;
}
void MyHtmlPane::SetCurrentDocument(XmlDoc *xdoc)
{
doc = xdoc;
}

View File

@ -19,23 +19,18 @@
#ifndef MY_HTML_PANE_H #ifndef MY_HTML_PANE_H
#define MY_HTML_PANE_H #define MY_HTML_PANE_H
#include "xmldoc.h"
#include <wx/wx.h> #include <wx/wx.h>
#include <wx/wxhtml.h> #include <wx/wxhtml.h>
class MyHtmlPane : public wxHtmlWindow class MyHtmlPane : public wxHtmlWindow
{ {
public: public:
std::string error_message;
MyHtmlPane ( MyHtmlPane (
wxWindow *parent, wxWindow *parent,
wxWindowID id = wxID_ANY, wxWindowID id = wxID_ANY,
const wxPoint& position = wxDefaultPosition, const wxPoint& position = wxDefaultPosition,
const wxSize& size = wxDefaultSize ); const wxSize& size = wxDefaultSize );
void SetCurrentDocument(XmlDoc *xdoc);
private: private:
/* /*
void OnCellClicked( void OnCellClicked(
@ -44,9 +39,7 @@ class MyHtmlPane : public wxHtmlWindow
wxCoord y, wxCoord y,
const wxMouseEvent& event); const wxMouseEvent& event);
*/ */
XmlDoc *doc;
void OnLeftDoubleClick ( wxMouseEvent& event ); void OnLeftDoubleClick ( wxMouseEvent& event );
bool OnCellClicked(wxHtmlCell *cell, wxCoord x, wxCoord y, const wxMouseEvent& event);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@ -188,6 +188,7 @@ MyPropertySheet::MyPropertySheet (
languageBox->Insert ( _T ( "Chinese Simplified" ), INDEX_CHINESE_SIMPLIFIED ); languageBox->Insert ( _T ( "Chinese Simplified" ), INDEX_CHINESE_SIMPLIFIED );
languageBox->Insert ( _T ( "Chinese Traditional" ), INDEX_CHINESE_TRADITIONAL ); languageBox->Insert ( _T ( "Chinese Traditional" ), INDEX_CHINESE_TRADITIONAL );
languageBox->Insert ( _T ( "Dutch" ), INDEX_DUTCH );
languageBox->Insert ( _T ( "English (US)" ), INDEX_ENGLISH_US ); languageBox->Insert ( _T ( "English (US)" ), INDEX_ENGLISH_US );
languageBox->Insert ( _T ( "French" ), INDEX_FRENCH ); languageBox->Insert ( _T ( "French" ), INDEX_FRENCH );
languageBox->Insert ( _T ( "German" ), INDEX_GERMAN ); languageBox->Insert ( _T ( "German" ), INDEX_GERMAN );
@ -203,6 +204,9 @@ MyPropertySheet::MyPropertySheet (
case wxLANGUAGE_GERMAN: case wxLANGUAGE_GERMAN:
languageBox->SetSelection ( INDEX_GERMAN ); languageBox->SetSelection ( INDEX_GERMAN );
break; break;
case wxLANGUAGE_DUTCH:
languageBox->SetSelection ( INDEX_DUTCH );
break;
case wxLANGUAGE_FRENCH: case wxLANGUAGE_FRENCH:
languageBox->SetSelection ( INDEX_FRENCH ); languageBox->SetSelection ( INDEX_FRENCH );
break; break;
@ -337,7 +341,10 @@ void MyPropertySheet::OnOk ( wxCommandEvent& e )
int languageChoice = languageBox->GetSelection(); int languageChoice = languageBox->GetSelection();
switch ( languageChoice ) switch ( languageChoice )
{ {
case INDEX_ITALIAN: case INDEX_DUTCH:
lang = wxLANGUAGE_DUTCH;
break;
case INDEX_ITALIAN:
lang = wxLANGUAGE_ITALIAN; lang = wxLANGUAGE_ITALIAN;
break; break;
case INDEX_GERMAN: case INDEX_GERMAN:

View File

@ -36,6 +36,7 @@ enum langIndex
{ {
INDEX_CHINESE_SIMPLIFIED = 0, INDEX_CHINESE_SIMPLIFIED = 0,
INDEX_CHINESE_TRADITIONAL, INDEX_CHINESE_TRADITIONAL,
INDEX_DUTCH,
INDEX_ENGLISH_US, INDEX_ENGLISH_US,
INDEX_FRENCH, INDEX_FRENCH,
INDEX_GERMAN, INDEX_GERMAN,

View File

@ -18,15 +18,18 @@
*/ */
#include <wx/intl.h> #include <wx/intl.h>
#include "aspell.h" #ifdef USE_ENCHANT
# include <enchant.h>
#else
# include "aspell.h"
# ifdef __WXMSW__
# include "aspellpaths.h"
# endif
#endif
#include "styledialog.h" #include "styledialog.h"
#include "nocasecompare.h" #include "nocasecompare.h"
#define ngettext wxGetTranslation #define ngettext wxGetTranslation
#ifdef __WXMSW__
#include "aspellpaths.h"
#endif
BEGIN_EVENT_TABLE ( StyleDialog, wxDialog ) BEGIN_EVENT_TABLE ( StyleDialog, wxDialog )
EVT_BUTTON ( ID_STYLE_REPORT, StyleDialog::OnReport ) EVT_BUTTON ( ID_STYLE_REPORT, StyleDialog::OnReport )
EVT_BUTTON ( ID_STYLE_IGNORE_ALL, StyleDialog::OnStyleIgnoreAll ) EVT_BUTTON ( ID_STYLE_IGNORE_ALL, StyleDialog::OnStyleIgnoreAll )
@ -47,6 +50,38 @@ BEGIN_EVENT_TABLE ( StyleDialog, wxDialog )
EVT_UPDATE_UI_RANGE ( ID_STYLE_EDIT, ID_STYLE_CHANGE_ALL, StyleDialog::OnUpdateTableRange ) EVT_UPDATE_UI_RANGE ( ID_STYLE_EDIT, ID_STYLE_CHANGE_ALL, StyleDialog::OnUpdateTableRange )
END_EVENT_TABLE() END_EVENT_TABLE()
#ifdef USE_ENCHANT
class dictdetect
{
public:
dictdetect(wxComboBox *aCombo) : ruleSetCombo(aCombo), anyFound(false) {}
void add(const char *lang_tag);
bool empty() const { return !anyFound; }
private:
wxComboBox *ruleSetCombo;
bool anyFound;
};
void dictdetect::add(const char *lang_tag)
{
anyFound = true;
std::string stdEntry = lang_tag;
wxString entry = wxString ( stdEntry.c_str(), wxConvUTF8, stdEntry.size() );
ruleSetCombo->Append ( entry );
}
void EnchantDictDescribe(const char * const lang_tag,
const char * const provider_name,
const char * const provider_desc,
const char * const provider_file,
void * user_data)
{
dictdetect *detected = (dictdetect*)user_data;
detected->add(lang_tag);
}
#endif
StyleDialog::StyleDialog ( StyleDialog::StyleDialog (
wxWindow *parent, wxWindow *parent,
wxIcon icon, wxIcon icon,
@ -57,7 +92,7 @@ StyleDialog::StyleDialog (
const wxString& browserParameter, const wxString& browserParameter,
const wxString& ruleSetPresetParameter, const wxString& ruleSetPresetParameter,
const wxString& filterPresetParameter, const wxString& filterPresetParameter,
#ifdef __WXMSW__ #if !defined(USE_ENCHANT) && defined(__WXMSW__)
const std::string& aspellDataPathParameter, const std::string& aspellDataPathParameter,
const std::string& aspellDictPathParameter, const std::string& aspellDictPathParameter,
#endif #endif
@ -79,7 +114,7 @@ StyleDialog::StyleDialog (
browser ( browserParameter ), browser ( browserParameter ),
ruleSetPreset ( ruleSetPresetParameter ), ruleSetPreset ( ruleSetPresetParameter ),
filterPreset ( filterPresetParameter ), filterPreset ( filterPresetParameter ),
#ifdef __WXMSW__ #if !defined(USE_ENCHANT) && defined(__WXMSW__)
aspellDataPath ( aspellDataPathParameter ), aspellDataPath ( aspellDataPathParameter ),
aspellDictPath ( aspellDictPathParameter ), aspellDictPath ( aspellDictPathParameter ),
#endif #endif
@ -235,6 +270,12 @@ StyleDialog::StyleDialog (
// special case spellcheck // special case spellcheck
if (type == ID_TYPE_SPELL) if (type == ID_TYPE_SPELL)
{ {
#ifdef USE_ENCHANT
EnchantBroker *broker = enchant_broker_init();
dictdetect adetected(ruleSetCombo);
enchant_broker_list_dicts(broker, EnchantDictDescribe, &adetected);
bool anyFound = !adetected.empty();
#else
AspellConfig *config; AspellConfig *config;
AspellDictInfoList *dlist; AspellDictInfoList *dlist;
AspellDictInfoEnumeration *dels; AspellDictInfoEnumeration *dels;
@ -243,10 +284,10 @@ StyleDialog::StyleDialog (
config = new_aspell_config(); config = new_aspell_config();
#ifdef __WXMSW__ #ifdef __WXMSW__
aspell_config_replace ( config, "data-dir", aspellDataPath.c_str() ); //ASPELL_DATA_PATH ); aspell_config_replace ( config, "data-dir", aspellDataPath.c_str() ); //ASPELL_DATA_PATH );
aspell_config_replace ( config, "dict-dir", aspellDictPath.c_str() ); //ASPELL_DICT_PATH ); aspell_config_replace ( config, "dict-dir", aspellDictPath.c_str() ); //ASPELL_DICT_PATH );
#endif #endif
dlist = get_aspell_dict_info_list( config ); dlist = get_aspell_dict_info_list( config );
delete_aspell_config ( config ); delete_aspell_config ( config );
@ -260,6 +301,7 @@ StyleDialog::StyleDialog (
wxString entry = wxString ( stdEntry.c_str(), wxConvUTF8, stdEntry.size() ); wxString entry = wxString ( stdEntry.c_str(), wxConvUTF8, stdEntry.size() );
ruleSetCombo->Append ( entry ); ruleSetCombo->Append ( entry );
} }
#endif
if ( anyFound ) if ( anyFound )
{ {

View File

@ -20,7 +20,9 @@
#include <iostream> #include <iostream>
#include <stdexcept> #include <stdexcept>
#include "wrapaspell.h" #include "wrapaspell.h"
#include "aspell.h" #ifdef USE_ENCHANT
#include <enchant++.h>
#endif
#include "casehandler.h" #include "casehandler.h"
#include "contexthandler.h" #include "contexthandler.h"
#include "getword.h" #include "getword.h"
@ -31,13 +33,17 @@
WrapAspell::WrapAspell ( WrapAspell::WrapAspell (
std::string lang std::string lang
#ifdef __WXMSW__ #if !defined(USE_ENCHANT) && defined(__WXMSW__)
, ,
const std::string& aspellDataPathParameter, const std::string& aspellDataPathParameter,
const std::string& aspellDictPathParameter const std::string& aspellDictPathParameter
#endif #endif
) )
{ {
#ifdef USE_ENCHANT
spell_broker = enchant::Broker::instance();
spell_checker = spell_broker->request_dict( lang );
#else
spell_config = new_aspell_config(); spell_config = new_aspell_config();
#ifdef __WXMSW__ #ifdef __WXMSW__
@ -55,26 +61,41 @@ WrapAspell::WrapAspell (
} }
else else
spell_checker = to_aspell_speller ( possible_err ); spell_checker = to_aspell_speller ( possible_err );
#endif
} }
WrapAspell::~WrapAspell() WrapAspell::~WrapAspell()
{ {
#ifdef USE_ENCHANT
delete spell_checker;
#else
delete_aspell_speller ( spell_checker ); delete_aspell_speller ( spell_checker );
delete_aspell_config ( spell_config ); delete_aspell_config ( spell_config );
#endif
} }
bool WrapAspell::checkWord ( std::string &s ) bool WrapAspell::checkWord ( const std::string &s )
{ {
#ifdef USE_ENCHANT
return spell_checker->check(s);
#else
return checkWord ( (char *) s.c_str(), s.size() ); return checkWord ( (char *) s.c_str(), s.size() );
#endif
} }
std::string WrapAspell::getSuggestion ( std::string WrapAspell::getSuggestion (
std::string &s ) std::string &s )
{ {
#ifdef USE_ENCHANT
std::vector<std::string> out_suggestions;
spell_checker->suggest(s, out_suggestions);
return out_suggestions.empty() ? "----" : out_suggestions[0];
#else
const AspellWordList *suggestions = aspell_speller_suggest ( spell_checker, s.c_str(), s.size() ); const AspellWordList *suggestions = aspell_speller_suggest ( spell_checker, s.c_str(), s.size() );
AspellStringEnumeration *elements = aspell_word_list_elements ( suggestions ); AspellStringEnumeration *elements = aspell_word_list_elements ( suggestions );
const char *word = aspell_string_enumeration_next ( elements ); // no iteration req'd const char *word = aspell_string_enumeration_next ( elements ); // no iteration req'd
return (word) ? word : "----"; return (word) ? word : "----";
#endif
} }
void WrapAspell::checkString ( void WrapAspell::checkString (
@ -104,7 +125,11 @@ void WrapAspell::checkString (
} }
} }
bool WrapAspell::checkWord ( char *s, size_t len ) bool WrapAspell::checkWord ( const char *s, size_t len )
{ {
#ifdef USE_ENCHANT
return checkWord( std::string(s, len) );
#else
return aspell_speller_check ( spell_checker, s, len ); return aspell_speller_check ( spell_checker, s, len );
#endif
} }

View File

@ -23,20 +23,28 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "contexthandler.h" #include "contexthandler.h"
#if !defined(USE_ENCHANT)
#include "aspell.h" #include "aspell.h"
#else
namespace enchant
{
class Broker;
class Dict;
}
#endif
class WrapAspell class WrapAspell
{ {
public: public:
WrapAspell ( WrapAspell (
std::string lang// = "en_US", std::string lang// = "en_US",
#ifdef __WXMSW__ #if !defined(USE_ENCHANT) && defined(__WXMSW__)
, const std::string& aspellDataPathParameter, , const std::string& aspellDataPathParameter,
const std::string& aspellDictPath const std::string& aspellDictPath
#endif #endif
); );
~WrapAspell(); ~WrapAspell();
inline bool checkWord ( std::string &s ); inline bool checkWord ( const std::string &s );
void checkString ( void checkString (
std::string &s, std::string &s,
std::vector<ContextMatch> &v, std::vector<ContextMatch> &v,
@ -44,8 +52,13 @@ class WrapAspell
std::string getSuggestion ( std::string &s ); std::string getSuggestion ( std::string &s );
std::string getVersion(); std::string getVersion();
private: private:
#ifdef USE_ENCHANT
enchant::Broker *spell_broker;
enchant::Dict *spell_checker;
#else
AspellConfig *spell_config; AspellConfig *spell_config;
AspellSpeller *spell_checker; AspellSpeller *spell_checker;
bool checkWord ( char *s, size_t len ); #endif
bool checkWord ( const char *s, size_t len );
}; };
#endif #endif

View File

@ -339,6 +339,7 @@ bool WrapLibxml::xslt (
cur = xsltParseStylesheetFile ( ( const xmlChar * ) styleFileName.c_str() ); cur = xsltParseStylesheetFile ( ( const xmlChar * ) styleFileName.c_str() );
if ( !cur ) if ( !cur )
{ {
nonParserError = "Cannot parse stylesheet";
return false; return false;
} }
@ -346,6 +347,7 @@ bool WrapLibxml::xslt (
doc = xmlParseFile ( fileName.c_str() ); doc = xmlParseFile ( fileName.c_str() );
if ( !doc ) if ( !doc )
{ {
nonParserError = "Cannot parse file";
xsltFreeStylesheet ( cur ); xsltFreeStylesheet ( cur );
return false; return false;
} }
@ -361,6 +363,7 @@ bool WrapLibxml::xslt (
res = xsltApplyStylesheet ( cur, doc, NULL ); res = xsltApplyStylesheet ( cur, doc, NULL );
if ( !res ) if ( !res )
{ {
nonParserError = "Cannot apply stylesheet";
xmlFreeDoc ( doc ); xmlFreeDoc ( doc );
xsltFreeStylesheet ( cur ); xsltFreeStylesheet ( cur );
return false; return false;
@ -493,7 +496,9 @@ std::string WrapLibxml::getLastError()
xmlErrorPtr err = xmlGetLastError(); xmlErrorPtr err = xmlGetLastError();
if ( !err ) if ( !err )
return ""; {
return ( nonParserError.empty() ) ? "" : nonParserError;
}
std::stringstream ss; std::stringstream ss;
ss << "Error at line "; ss << "Error at line ";

View File

@ -70,7 +70,7 @@ class WrapLibxml
std::string lookupPublicId ( const std::string& id ); std::string lookupPublicId ( const std::string& id );
private: private:
bool netAccess; bool netAccess;
std::string catalogPath, output; std::string catalogPath, output, nonParserError;
int errorLine; int errorLine;
void loadCatalog(); void loadCatalog();
}; };

View File

@ -37,6 +37,7 @@ XmlAssociateXsd::XmlAssociateXsd (
d->rootElementSeen = false; d->rootElementSeen = false;
XML_SetElementHandler ( p, start, end ); XML_SetElementHandler ( p, start, end );
XML_SetDefaultHandlerExpand ( p, defaulthandler ); XML_SetDefaultHandlerExpand ( p, defaulthandler );
XML_SetUserData ( p, d.get() );
std::auto_ptr<XmlParseSchemaNs> parser ( new XmlParseSchemaNs() ); std::auto_ptr<XmlParseSchemaNs> parser ( new XmlParseSchemaNs() );
std::string normalisedPath, buffer; std::string normalisedPath, buffer;
@ -66,7 +67,6 @@ XmlAssociateXsd::XmlAssociateXsd (
} }
} }
d->namespaceMap = namespaceMap; d->namespaceMap = namespaceMap;
XML_SetUserData ( p, d.get() );
} }
XmlAssociateXsd::~XmlAssociateXsd() XmlAssociateXsd::~XmlAssociateXsd()
@ -77,18 +77,24 @@ void XMLCALL XmlAssociateXsd::defaulthandler (
const XML_Char *s, const XML_Char *s,
int len ) int len )
{ {
if ( !data || !s )
return;
AssociateXsdData *d; AssociateXsdData *d;
d = ( AssociateXsdData * ) data; d = ( AssociateXsdData * ) data;
d->buffer.append ( s, len ); if ( d )
d->buffer.append ( s, len );
} }
void XMLCALL XmlAssociateXsd::start ( void *data, void XMLCALL XmlAssociateXsd::start ( void *data,
const XML_Char *el, const XML_Char *el,
const XML_Char **attr ) const XML_Char **attr )
{ {
if ( !data )
return;
AssociateXsdData *d; AssociateXsdData *d;
d = ( AssociateXsdData * ) data; d = ( AssociateXsdData * ) data;
d->buffer += "<"; d->buffer += "<";
d->buffer += el; d->buffer += el;
@ -141,6 +147,8 @@ void XMLCALL XmlAssociateXsd::start ( void *data,
void XMLCALL XmlAssociateXsd::end ( void *data, const XML_Char *el ) void XMLCALL XmlAssociateXsd::end ( void *data, const XML_Char *el )
{ {
if ( !data )
return;
AssociateXsdData *d; AssociateXsdData *d;
d = ( AssociateXsdData * ) data; d = ( AssociateXsdData * ) data;
d->buffer += "</"; d->buffer += "</";

View File

@ -40,6 +40,7 @@
#include "xmlassociatexsd.h" #include "xmlassociatexsd.h"
#include "xmlassociatexsl.h" #include "xmlassociatexsl.h"
#include "xmlassociatedtd.h" #include "xmlassociatedtd.h"
#include "wrapdaisy.h"
#include "aboutdialog.h" #include "aboutdialog.h"
#include "pathresolver.h" #include "pathresolver.h"
#include "locationpanel.h" #include "locationpanel.h"
@ -49,6 +50,7 @@
#include "getlinuxappdir.h" #include "getlinuxappdir.h"
#include "commandpanel.h" #include "commandpanel.h"
#include "binaryfile.h" #include "binaryfile.h"
#include "exportdialog.h"
#include <wx/aui/auibook.h> #include <wx/aui/auibook.h>
#include <wx/richtext/richtextsymboldlg.h> #include <wx/richtext/richtextsymboldlg.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
@ -103,6 +105,7 @@ BEGIN_EVENT_TABLE ( MyFrame, wxFrame )
EVT_MENU ( ID_WORD_COUNT, MyFrame::OnWordCount ) EVT_MENU ( ID_WORD_COUNT, MyFrame::OnWordCount )
EVT_MENU ( ID_IMPORT_MSWORD, MyFrame::OnImportMSWord ) EVT_MENU ( ID_IMPORT_MSWORD, MyFrame::OnImportMSWord )
EVT_MENU ( ID_EXPORT_MSWORD, MyFrame::OnExportMSWord ) EVT_MENU ( ID_EXPORT_MSWORD, MyFrame::OnExportMSWord )
EVT_MENU ( ID_EXPORT, MyFrame::OnExport )
EVT_MENU ( ID_HIDE_PANE, MyFrame::OnClosePane ) EVT_MENU ( ID_HIDE_PANE, MyFrame::OnClosePane )
EVT_MENU ( ID_COMMAND, MyFrame::OnCommand ) EVT_MENU ( ID_COMMAND, MyFrame::OnCommand )
EVT_MENU ( ID_FIND, MyFrame::OnFind ) EVT_MENU ( ID_FIND, MyFrame::OnFind )
@ -174,7 +177,6 @@ BEGIN_EVENT_TABLE ( MyFrame, wxFrame )
EVT_UPDATE_UI ( ID_RELOAD, MyFrame::OnUpdateReload ) EVT_UPDATE_UI ( ID_RELOAD, MyFrame::OnUpdateReload )
EVT_IDLE ( MyFrame::OnIdle ) EVT_IDLE ( MyFrame::OnIdle )
EVT_AUINOTEBOOK_PAGE_CLOSE ( wxID_ANY, MyFrame::OnPageClosing ) EVT_AUINOTEBOOK_PAGE_CLOSE ( wxID_ANY, MyFrame::OnPageClosing )
EVT_AUI_PANE_CLOSE ( MyFrame::OnPaneClose )
#ifdef __WXMSW__ #ifdef __WXMSW__
EVT_DROP_FILES ( MyFrame::OnDropFiles ) EVT_DROP_FILES ( MyFrame::OnDropFiles )
#endif #endif
@ -254,6 +256,9 @@ MyApp::MyApp() : checker ( NULL ), server ( NULL ), connection ( NULL ),
case wxLANGUAGE_RUSSIAN: case wxLANGUAGE_RUSSIAN:
systemLocale = wxLANGUAGE_RUSSIAN; systemLocale = wxLANGUAGE_RUSSIAN;
break; break;
case wxLANGUAGE_DUTCH:
systemLocale = wxLANGUAGE_DUTCH;
break;
default: default:
systemLocale = wxLANGUAGE_ENGLISH_US; systemLocale = wxLANGUAGE_ENGLISH_US;
break; break;
@ -609,6 +614,12 @@ MyFrame::MyFrame (
lastXslStylesheet.Replace ( _T ( " " ), _T ( "%20" ), true ); lastXslStylesheet.Replace ( _T ( " " ), _T ( "%20" ), true );
lastRelaxNGSchema.Replace ( _T ( " " ), _T ( "%20" ), true ); lastRelaxNGSchema.Replace ( _T ( " " ), _T ( "%20" ), true );
exportQuiet =
config->Read ( _T ( "exportQuiet" ), (long)false );
exportMp3Album =
config->Read ( _T ( "exportMp3Album" ), (long)false );
applicationDir = applicationDir =
config->Read ( _T ( "applicationDir" ), wxEmptyString ); config->Read ( _T ( "applicationDir" ), wxEmptyString );
@ -648,6 +659,9 @@ MyFrame::MyFrame (
commandSync = config->Read ( _T ( "commandSync" ), longFalse ); commandSync = config->Read ( _T ( "commandSync" ), longFalse );
commandOutput = config->Read ( _T ( "commandOutput" ), ID_COMMAND_OUTPUT_IGNORE ); commandOutput = config->Read ( _T ( "commandOutput" ), ID_COMMAND_OUTPUT_IGNORE );
commandString = config->Read ( _T ( "commandString" ), wxEmptyString ); commandString = config->Read ( _T ( "commandString" ), wxEmptyString );
exportStylesheet = config->Read ( _T ( "exportStylesheet" ), wxEmptyString );
exportFolder = config->Read ( _T ( "exportFolder" ), wxEmptyString );
ruleSetPreset = ruleSetPreset =
config->Read ( _T ( "ruleSetPreset" ), _ ( "Default style" ) ); config->Read ( _T ( "ruleSetPreset" ), _ ( "Default style" ) );
@ -731,6 +745,9 @@ MyFrame::MyFrame (
commandSync = false; commandSync = false;
commandOutput = ID_COMMAND_OUTPUT_IGNORE; commandOutput = ID_COMMAND_OUTPUT_IGNORE;
commandString = wxEmptyString; commandString = wxEmptyString;
exportStylesheet = exportFolder = wxEmptyString;
exportQuiet = exportMp3Album = false;
} }
@ -891,7 +908,7 @@ MyFrame::MyFrame (
manager.AddPane ( manager.AddPane (
( wxWindow * ) findReplacePanel, ( wxWindow * ) findReplacePanel,
wxAuiPaneInfo().Bottom().Hide().Caption ( wxEmptyString ). wxAuiPaneInfo().Bottom().Hide().Caption ( wxEmptyString ).
Name( _T ( "FindReplacePanel" ) ).DestroyOnClose ( false ).Layer ( 2 ) ); DestroyOnClose ( false ).Layer ( 2 ) );
#endif #endif
commandPanel = new CommandPanel ( commandPanel = new CommandPanel (
@ -983,7 +1000,6 @@ MyFrame::~MyFrame()
config->Write ( _T ( "protectTags" ), protectTags ); config->Write ( _T ( "protectTags" ), protectTags );
config->Write ( _T ( "visibilityState" ), visibilityState ); config->Write ( _T ( "visibilityState" ), visibilityState );
config->Write ( _T ( "browserCommand" ), browserCommand ); config->Write ( _T ( "browserCommand" ), browserCommand );
// config->Write ( _T ( "layout" ), layout ); // omit while unused
config->Write ( _T ( "showLocationPane" ), manager.GetPane ( locationPanel ).IsShown() ); config->Write ( _T ( "showLocationPane" ), manager.GetPane ( locationPanel ).IsShown() );
config->Write ( _T ( "showInsertChildPane" ), manager.GetPane ( insertChildPanel ).IsShown() ); config->Write ( _T ( "showInsertChildPane" ), manager.GetPane ( insertChildPanel ).IsShown() );
config->Write ( _T ( "showInsertSiblingPane" ), manager.GetPane ( insertSiblingPanel ).IsShown() ); config->Write ( _T ( "showInsertSiblingPane" ), manager.GetPane ( insertSiblingPanel ).IsShown() );
@ -994,12 +1010,13 @@ MyFrame::~MyFrame()
config->Write ( _T ( "commandSync" ), commandPanel->getSync() ); config->Write ( _T ( "commandSync" ), commandPanel->getSync() );
config->Write ( _T ( "commandOutput" ), commandPanel->getOutput() ); config->Write ( _T ( "commandOutput" ), commandPanel->getOutput() );
config->Write ( _T ( "commandString" ), commandPanel->getCommand() ); config->Write ( _T ( "commandString" ), commandPanel->getCommand() );
config->Write ( _T ( "restoreLayout" ), restoreLayout ); config->Write ( _T ( "restoreLayout" ), restoreLayout );
config->Write ( _T ( "lastXslStylesheet" ), lastXslStylesheet ); config->Write ( _T ( "lastXslStylesheet" ), lastXslStylesheet );
config->Write ( _T ( "lastRelaxNGSchema" ), lastRelaxNGSchema ); config->Write ( _T ( "lastRelaxNGSchema" ), lastRelaxNGSchema );
config->Write ( _T ( "exportStylesheet" ), exportStylesheet );
config->Write ( _T ( "exportFolder" ), exportFolder );
config->Write ( _T ( "exportQuiet" ), exportQuiet );
config->Write ( _T ( "exportMp3Album" ), exportMp3Album );
GetPosition ( &framePosX, &framePosY ); GetPosition ( &framePosX, &framePosY );
config->Write ( _T ( "framePosX" ), framePosX ); config->Write ( _T ( "framePosX" ), framePosX );
@ -1018,6 +1035,7 @@ MyFrame::~MyFrame()
config->Write ( _T ( "saveBom" ), saveBom ); config->Write ( _T ( "saveBom" ), saveBom );
config->Write ( _T ( "unlimitedUndo" ), unlimitedUndo ); config->Write ( _T ( "unlimitedUndo" ), unlimitedUndo );
manager.UnInit(); manager.UnInit();
wxTheClipboard->Flush();
} }
wxString MyFrame::getLinuxBrowser() wxString MyFrame::getLinuxBrowser()
@ -1220,6 +1238,7 @@ void MyFrame::OnAbout ( wxCommandEvent& WXUNUSED ( event ) )
info.AddTranslator ( _ ( "Antonio Angelo (Italian) <aangelo at users.sourceforge.net>" ) ); info.AddTranslator ( _ ( "Antonio Angelo (Italian) <aangelo at users.sourceforge.net>" ) );
info.AddTranslator ( _ ( "Siarhei Kuchuk (Russian) <Cuchuk.Sergey at gmail.com>" ) ); info.AddTranslator ( _ ( "Siarhei Kuchuk (Russian) <Cuchuk.Sergey at gmail.com>" ) );
info.AddTranslator ( _ ( "Marcos Pérez González (Spanish) <marcos_pg at yahoo.com>" ) ); info.AddTranslator ( _ ( "Marcos Pérez González (Spanish) <marcos_pg at yahoo.com>" ) );
info.AddTranslator ( _ ( "Rob Elemans (Dutch) <relemans at gmail.com>" ) );
info.SetLicense ( ABOUT_LICENSE ); info.SetLicense ( ABOUT_LICENSE );
info.SetDescription ( description ); info.SetDescription ( description );
wxAboutBox ( info ); wxAboutBox ( info );
@ -2015,11 +2034,6 @@ void MyFrame::OnImportMSWord ( wxCommandEvent& event )
_T ( "" ), _T ( "" ),
_T ( "Microsoft Word (*.doc)|*.doc" ), _T ( "Microsoft Word (*.doc)|*.doc" ),
wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR wxOPEN | wxFILE_MUST_EXIST | wxCHANGE_DIR
/*
#ifdef __WXMSW__
| wxHIDE_READONLY
#endif
*/
) ); ) );
if ( fd->ShowModal() == wxID_CANCEL ) if ( fd->ShowModal() == wxID_CANCEL )
return; return;
@ -2032,6 +2046,67 @@ void MyFrame::OnImportMSWord ( wxCommandEvent& event )
importMSWord ( path ); importMSWord ( path );
} }
void MyFrame::OnExport ( wxCommandEvent& event )
{
statusProgress ( wxEmptyString );
closePane();
XmlDoc *doc;
if ( ( doc = getActiveDocument() ) == NULL )
return;
wxString testDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "daisy" );
bool downloadLink = !wxDirExists ( testDir );
std::auto_ptr<ExportDialog> ed ( new ExportDialog (
this,
exportStylesheet,
exportFolder,
exportQuiet,
true, //suppressOptional
true, //epub
true, //rtf
true, //doc
true, //fullDaisy
exportMp3Album,
downloadLink ) );
int ret = ed->ShowModal();
if ( ret == wxID_CANCEL )
return;
exportStylesheet = ed->getUrlString();
exportFolder = ed->getFolderString();
exportQuiet = ed->getQuiet();
exportMp3Album = ed->getMp3Album();
std::string rawBufferUtf8;
getRawText ( doc, rawBufferUtf8 );
if ( !XmlEncodingHandler::setUtf8 ( rawBufferUtf8 ) )
{
encodingMessage();
return;
}
WrapTempFileName tempFileName ( doc->getFullFileName() );
ofstream rawBufferStream ( tempFileName.name().c_str() );
if ( !rawBufferStream )
return;
rawBufferStream << rawBufferUtf8;
rawBufferStream.close();
wxString tempFile= tempFileName.wideName();
WrapDaisy wd ( daisyDir );
if ( !wd.run ( tempFile, exportStylesheet, exportFolder, exportQuiet, exportMp3Album, true, true, true, true ) )
{
messagePane ( _ ("DAISY Talking Book export stopped: ") + wd.getLastError(), CONST_STOP );
return;
}
messagePane ( _ ( "DAISY Talking Book export completed. Output files are stored in " ) + exportFolder + _T ( "." ), CONST_INFO );
}
void MyFrame::importMSWord ( const wxString& path ) void MyFrame::importMSWord ( const wxString& path )
{ {
#ifndef __WXMSW__ #ifndef __WXMSW__
@ -2254,6 +2329,7 @@ void MyFrame::OnHelp ( wxCommandEvent& event )
void MyFrame::OnSplitTab ( wxCommandEvent& event ) void MyFrame::OnSplitTab ( wxCommandEvent& event )
{ {
/*
int id = event.GetId(); int id = event.GetId();
XmlDoc *doc = getActiveDocument(); XmlDoc *doc = getActiveDocument();
if ( !doc ) if ( !doc )
@ -2262,7 +2338,6 @@ void MyFrame::OnSplitTab ( wxCommandEvent& event )
// mainBook->GetSelection() is currently unreliable, so fetch by title // mainBook->GetSelection() is currently unreliable, so fetch by title
/*
int pageCount = mainBook->GetPageCount(); int pageCount = mainBook->GetPageCount();
XmlDoc *currentDoc; XmlDoc *currentDoc;
int currentSelection = -1; int currentSelection = -1;
@ -2282,6 +2357,7 @@ void MyFrame::OnSplitTab ( wxCommandEvent& event )
int currentSelection, direction; int currentSelection, direction;
currentSelection = mainBook->GetSelection(); currentSelection = mainBook->GetSelection();
direction = wxAUI_NB_RIGHT; direction = wxAUI_NB_RIGHT;
/*
switch ( id ) switch ( id )
{ {
ID_SPLIT_TAB_TOP: ID_SPLIT_TAB_TOP:
@ -2300,6 +2376,7 @@ void MyFrame::OnSplitTab ( wxCommandEvent& event )
direction = wxAUI_NB_RIGHT; direction = wxAUI_NB_RIGHT;
break; break;
} }
*/
mainBook->Split ( currentSelection, direction ); mainBook->Split ( currentSelection, direction );
} }
@ -2609,7 +2686,6 @@ void MyFrame::OnGlobalReplace ( wxCommandEvent& event )
void MyFrame::OnFrameClose ( wxCloseEvent& event ) void MyFrame::OnFrameClose ( wxCloseEvent& event )
{ {
std::cout<<"MyFrame::OnFrameClose\n";
wxCommandEvent e; wxCommandEvent e;
OnCloseAll ( e ); OnCloseAll ( e );
if ( mainBook->GetPageCount() ) if ( mainBook->GetPageCount() )
@ -5288,6 +5364,9 @@ void MyFrame::updateFileMenu ( bool deleteExisting )
wxMenuItem *saveAsItem = wxMenuItem *saveAsItem =
new wxMenuItem ( NULL, wxID_SAVEAS, _ ( "S&ave As...\tF12" ), _ ( "Save As..." ) ); new wxMenuItem ( NULL, wxID_SAVEAS, _ ( "S&ave As...\tF12" ), _ ( "Save As..." ) );
saveAsItem->SetBitmap ( wxNullBitmap ); saveAsItem->SetBitmap ( wxNullBitmap );
wxMenuItem *exportItem =
new wxMenuItem ( NULL, ID_EXPORT, _ ( "Export &DAISY Talking Book..." ), _ ( "Export DAISY Talking Book..." ) );
exportItem->SetBitmap ( wxNullBitmap );
wxMenuItem *reloadItem = wxMenuItem *reloadItem =
new wxMenuItem ( NULL, ID_RELOAD, _ ( "&Reload" ), _ ( "Reload" ) ); new wxMenuItem ( NULL, ID_RELOAD, _ ( "&Reload" ), _ ( "Reload" ) );
reloadItem->SetBitmap ( wxNullBitmap ); reloadItem->SetBitmap ( wxNullBitmap );
@ -5309,7 +5388,7 @@ void MyFrame::updateFileMenu ( bool deleteExisting )
importMSWordItem->SetBitmap ( wxNullBitmap ); importMSWordItem->SetBitmap ( wxNullBitmap );
wxMenuItem *exportMSWordItem = wxMenuItem *exportMSWordItem =
new wxMenuItem ( new wxMenuItem (
NULL, ID_EXPORT_MSWORD, _ ( "&Export Microsoft Word Document..." ) ); NULL, ID_EXPORT_MSWORD, _ ( "Expor&t Microsoft Word Document..." ) );
exportMSWordItem->SetBitmap ( wxNullBitmap ); exportMSWordItem->SetBitmap ( wxNullBitmap );
wxMenuItem *exitItem = wxMenuItem *exitItem =
@ -5324,15 +5403,16 @@ void MyFrame::updateFileMenu ( bool deleteExisting )
fileMenu->Append ( closeAllItem ); fileMenu->Append ( closeAllItem );
fileMenu->Append ( saveItem ); fileMenu->Append ( saveItem );
fileMenu->Append ( saveAsItem ); fileMenu->Append ( saveAsItem );
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append ( reloadItem ); fileMenu->Append ( reloadItem );
fileMenu->Append ( revertItem ); fileMenu->Append ( revertItem );
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append ( printSetupItem ); fileMenu->Append ( printSetupItem );
fileMenu->Append ( printPreviewItem ); fileMenu->Append ( printPreviewItem );
fileMenu->Append ( printItem ); fileMenu->Append ( printItem );
#ifdef __WXMSW__
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append ( exportItem );
#ifdef __WXMSW__
fileMenu->Append ( importMSWordItem ); fileMenu->Append ( importMSWordItem );
fileMenu->Append ( exportMSWordItem ); fileMenu->Append ( exportMSWordItem );
#endif #endif
@ -5452,14 +5532,14 @@ void MyFrame::messagePane ( const wxString& s, int iconType, bool forcePane )
switch ( iconType ) switch ( iconType )
{ {
case ( CONST_INFO ) : case ( CONST_INFO ) :
/* /*
if ( !forcePane && s.Length() < 50 ) // magic no. necessary? if ( !forcePane && s.Length() < 50 ) // magic no. necessary?
{ {
statusProgress ( s ); statusProgress ( s );
return; return;
} }
*/ */
paneTitle = _ ( "Information" ); paneTitle = _ ( "Information" );
break; break;
case ( CONST_WARNING ) : case ( CONST_WARNING ) :
paneTitle = _ ( "Warning" ); paneTitle = _ ( "Warning" );
@ -5477,7 +5557,7 @@ void MyFrame::messagePane ( const wxString& s, int iconType, bool forcePane )
wxAuiPaneInfo info = manager.GetPane ( htmlReport ); wxAuiPaneInfo info = manager.GetPane ( htmlReport );
if ( !info.IsShown() ) if ( !info.IsShown() )
{ {
manager.GetPane ( htmlReport ).Show ( true ); manager.GetPane ( htmlReport ).Show ( true );
manager.Update(); manager.Update();
} }
@ -5494,19 +5574,19 @@ void MyFrame::messagePane ( const wxString& s, int iconType, bool forcePane )
switch ( iconType ) switch ( iconType )
{ {
case ( CONST_INFO ) : case ( CONST_INFO ) :
htmlBuffer += pngDir; htmlBuffer += pngDir;
htmlBuffer += _T ( "stock_dialog-info-32.png" ); htmlBuffer += _T ( "stock_dialog-info-32.png" );
break; break;
case ( CONST_WARNING ) : case ( CONST_WARNING ) :
htmlBuffer += pngDir; htmlBuffer += pngDir;
htmlBuffer += _T ( "stock_dialog-warning-32.png" ); htmlBuffer += _T ( "stock_dialog-warning-32.png" );
break; break;
case ( CONST_STOP ) : case ( CONST_STOP ) :
htmlBuffer += pngDir; htmlBuffer += pngDir;
htmlBuffer += _T ( "stock_dialog-stop-32.png" ); htmlBuffer += _T ( "stock_dialog-stop-32.png" );
break; break;
case ( CONST_QUESTION ) : case ( CONST_QUESTION ) :
htmlBuffer += pngDir; htmlBuffer += pngDir;
htmlBuffer += _T ( "stock_dialog-question-32.png" ); htmlBuffer += _T ( "stock_dialog-question-32.png" );
break; break;
default: default:
@ -5517,8 +5597,7 @@ void MyFrame::messagePane ( const wxString& s, int iconType, bool forcePane )
htmlBuffer += _T ( "</td></tr></table></body></html>" ); htmlBuffer += _T ( "</td></tr></table></body></html>" );
htmlReport->SetPage ( htmlBuffer ); htmlReport->SetPage ( htmlBuffer );
htmlReport->error_message = htmlString.mb_str(wxConvUTF8);
htmlReport->SetCurrentDocument(getActiveDocument());
manager.Update(); manager.Update();
} }
@ -5635,6 +5714,8 @@ void MyFrame::updatePaths()
wxFileName::GetPathSeparator(); wxFileName::GetPathSeparator();
pngDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "png" ) + pngDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "png" ) +
wxFileName::GetPathSeparator(); wxFileName::GetPathSeparator();
daisyDir = applicationDir + wxFileName::GetPathSeparator() + _T ( "daisy" ) +
wxFileName::GetPathSeparator();
wxString wideCatalogPath = wxString wideCatalogPath =
applicationDir + wxFileName::GetPathSeparator() + _T ( "catalog" ) + applicationDir + wxFileName::GetPathSeparator() + _T ( "catalog" ) +
wxFileName::GetPathSeparator() + _T ( "catalog" ); wxFileName::GetPathSeparator() + _T ( "catalog" );
@ -5863,8 +5944,6 @@ void MyFrame::getRawText ( XmlDoc *doc, std::string& buffer )
buffer = ""; buffer = "";
return; return;
} }
//wxString wideBuffer = doc->GetText();
//buffer = wideBuffer.mb_str(wxConvUTF8);
buffer = doc->myGetTextRaw(); buffer = doc->myGetTextRaw();
} }
@ -6046,17 +6125,3 @@ void MyFrame::addToFileQueue ( wxString& fileName )
{ {
fileQueue.push_back ( fileName ); fileQueue.push_back ( fileName );
} }
void MyFrame::OnPaneClose ( wxAuiManagerEvent& event )
{
wxAuiPaneInfo* closedPane=event.GetPane();
if (closedPane->name== _T ( "FindReplacePanel" ) )
{
// Find pane was closed - set focus back to document pane
XmlDoc *doc;
if ( ( doc = getActiveDocument() ) == NULL )
return;
doc->SetFocus();
}
}

View File

@ -157,6 +157,7 @@ enum
ID_VALIDATE_PRESET7, ID_VALIDATE_PRESET7,
ID_VALIDATE_PRESET8, ID_VALIDATE_PRESET8,
ID_VALIDATE_PRESET9, ID_VALIDATE_PRESET9,
ID_EXPORT,
ID_EXPORT_MSWORD, ID_EXPORT_MSWORD,
// icon constants // icon constants
CONST_WARNING, CONST_WARNING,
@ -234,6 +235,7 @@ class MyFrame : public wxFrame
void OnFontMedium ( wxCommandEvent& event ); void OnFontMedium ( wxCommandEvent& event );
void OnFontLarger ( wxCommandEvent& event ); void OnFontLarger ( wxCommandEvent& event );
void OnImportMSWord ( wxCommandEvent& event ); void OnImportMSWord ( wxCommandEvent& event );
void OnExport ( wxCommandEvent& event );
void OnInsertChild ( wxCommandEvent& event ); void OnInsertChild ( wxCommandEvent& event );
void OnInsertSibling ( wxCommandEvent& event ); void OnInsertSibling ( wxCommandEvent& event );
void OnInsertTwin ( wxCommandEvent& event ); void OnInsertTwin ( wxCommandEvent& event );
@ -398,6 +400,7 @@ class MyFrame : public wxFrame
rngDir, rngDir,
htmlDir, htmlDir,
pngDir, pngDir,
daisyDir,
xpathExpression, xpathExpression,
lastDtdPublic, lastDtdPublic,
lastDtdSystem, lastDtdSystem,
@ -413,7 +416,9 @@ class MyFrame : public wxFrame
defaultLayout, defaultLayout,
lastParent, lastParent,
lastGrandparent, lastGrandparent,
commandString; commandString,
exportStylesheet,
exportFolder;
bool globalReplaceAllDocuments, bool globalReplaceAllDocuments,
toolbarVisible, toolbarVisible,
protectTags, protectTags,
@ -437,7 +442,9 @@ class MyFrame : public wxFrame
restoreFocusToNotebook, restoreFocusToNotebook,
showFullPathOnFrame, showFullPathOnFrame,
findRegex, findRegex,
commandSync; commandSync,
exportQuiet,
exportMp3Album;
wxBitmap newBitmap, wxBitmap newBitmap,
new16Bitmap, new16Bitmap,
openBitmap, openBitmap,
@ -507,7 +514,6 @@ class MyFrame : public wxFrame
bool ignoreEncoding = false, bool ignoreEncoding = false,
bool isXml = true ); bool isXml = true );
void removeUtf8Bom ( std::string& buffer ); void removeUtf8Bom ( std::string& buffer );
void OnPaneClose ( wxAuiManagerEvent& event );
std::string getAuxPath ( const std::string& fileName ); std::string getAuxPath ( const std::string& fileName );
wxMenuBar *getMenuBar(); wxMenuBar *getMenuBar();
wxToolBar *getToolBar(); wxToolBar *getToolBar();
@ -516,4 +522,3 @@ class MyFrame : public wxFrame
}; };
#endif #endif

View File

@ -25,7 +25,7 @@
#endif #endif
#define ABOUT_COPYRIGHT _("Copyright © 2005-2009 Gerald Schmidt <gnschmidt@users.sourceforge.net>") #define ABOUT_COPYRIGHT _("Copyright © 2005-2009 Gerald Schmidt <gnschmidt@users.sourceforge.net>")
#define ABOUT_DESCRIPTION _("\nXML Copy Editor is free software released under the GNU\nGeneral Public License.\n\nMany thanks are due to Tim van Niekerk, Matt Smigielski,\nDavid Scholl, Jan Merka, Marcus Bingenheimer, Roberto\nRosselli Del Turco, Ken Zalewski, C.J. Meidlinger,\nThomas Zajic, Viliam Búr, David Håsäther, François\nBadier, Thomas Wenzel, Roger Sperberg, SHiNE CsyFeK,\nHSU PICHAN, YANG SHUFUN, CHENG PAULIAN,\nCHUANG KUO-PING, Justin Dearing, Serhij Dubyk,\nAntonio Angelo, Jose Luis Rivero, Siarhei Kuchuk,\nIan Abbott, Kev James, Marcos Pérez González\nand Anh Trinh.") #define ABOUT_DESCRIPTION _("\nXML Copy Editor is free software released under the GNU\nGeneral Public License.\n\nMany thanks are due to Tim van Niekerk, Matt Smigielski,\nDavid Scholl, Jan Merka, Marcus Bingenheimer, Roberto\nRosselli Del Turco, Ken Zalewski, C.J. Meidlinger,\nThomas Zajic, Viliam Búr, David Håsäther, François\nBadier, Thomas Wenzel, Roger Sperberg, SHiNE CsyFeK,\nHSU PICHAN, YANG SHUFUN, CHENG PAULIAN,\nCHUANG KUO-PING, Justin Dearing, Serhij Dubyk,\nAntonio Angelo, Jose Luis Rivero, Siarhei Kuchuk,\nIan Abbott, Kev James, Marcos Pérez González, Anh\nTrinh and Rob Elemans.")
#define ABOUT_LICENSE _T(\ #define ABOUT_LICENSE _T(\
"This program is free software; you can redistribute it\n"\ "This program is free software; you can redistribute it\n"\
"and/or modify it under the terms of the GNU General Public\n"\ "and/or modify it under the terms of the GNU General Public\n"\
@ -41,5 +41,5 @@
"License along with this program; if not, write to the Free\n"\ "License along with this program; if not, write to the Free\n"\
"Software Foundation, Inc., 59 Temple Place, Suite 330,\n"\ "Software Foundation, Inc., 59 Temple Place, Suite 330,\n"\
"Boston, MA 02111-1307 USA.") "Boston, MA 02111-1307 USA.")
#define ABOUT_VERSION _T("1.2.0.4") #define ABOUT_VERSION _T("1.2.0.6")
#define XMLCE_VAR _T("XMLCE_VAR") #define XMLCE_VAR _T("XMLCE_VAR")