"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/MainUI/MainWindow.cpp" between
Sigil-1.4.1.tar.gz and Sigil-1.4.2.tar.gz

About: Sigil is a multi-platform EPUB ebook editor that supports both WYSIWYG and code-based editing of EPUB files, as well as the import of HTML and plain text files.

MainWindow.cpp  (Sigil-1.4.1):MainWindow.cpp  (Sigil-1.4.2)
skipping to change at line 2984 skipping to change at line 2984
html_resources.append(resource); html_resources.append(resource);
} }
foreach(Resource * resource, resources) { foreach(Resource * resource, resources) {
html_resources.append(resource); html_resources.append(resource);
if (resource->ShortPathName() == current_html_filename) { if (resource->ShortPathName() == current_html_filename) {
break; break;
} }
} }
// Search for the word. // Search for the word.
QString default_lang = m_Book->GetConstOPF()->GetPrimaryBookLanguage();
default_lang.replace('_','-');
bool done_current = false; bool done_current = false;
foreach (Resource *resource, html_resources) { foreach (Resource *resource, html_resources) {
HTMLResource *html_resource = qobject_cast<HTMLResource *>(resource); HTMLResource *html_resource = qobject_cast<HTMLResource *>(resource);
if (!html_resource) { if (!html_resource) {
continue; continue;
} }
int start_pos = 0; int start_pos = 0;
// Reset the start to current cursor position only if this is the // Reset the start to current cursor position only if this is the
// first time we are in the current file. // first time we are in the current file.
if (resource->ShortPathName() == current_html_filename) { if (resource->ShortPathName() == current_html_filename) {
if (!done_current) { if (!done_current) {
FlowTab *flow_tab = GetCurrentFlowTab(); FlowTab *flow_tab = GetCurrentFlowTab();
if (flow_tab) { if (flow_tab) {
start_pos = flow_tab->GetCursorPosition(); start_pos = flow_tab->GetCursorPosition();
} }
} }
done_current = true; done_current = true;
} }
QString text = html_resource->GetText(); QString text = html_resource->GetText();
int found_pos = HTMLSpellCheckML::WordPosition(text, word, start_pos, de
int found_pos = HTMLSpellCheckML::WordPosition(text, word, start_pos); fault_lang);
// int found_pos = HTMLSpellCheck::WordPosition(text, word, start_pos); // int found_pos = HTMLSpellCheck::WordPosition(text, word, start_pos);
if (found_pos >= 0) { if (found_pos >= 0) {
if (resource->ShortPathName() != current_html_filename) { if (resource->ShortPathName() != current_html_filename) {
OpenResourceAndWaitUntilLoaded(resource, -1, found_pos); OpenResourceAndWaitUntilLoaded(resource, -1, found_pos);
} }
FlowTab *flow_tab = GetCurrentFlowTab(); FlowTab *flow_tab = GetCurrentFlowTab();
if (flow_tab) { if (flow_tab) {
flow_tab->HighlightWord(HTMLSpellCheckML::textOf(word), found_po s); flow_tab->HighlightWord(HTMLSpellCheckML::textOf(word), found_po s);
break; break;
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)