Commit 4c20b361 authored by Kartik Mistry's avatar Kartik Mistry 🇮🇳

New upstream version 1.31

parent bbaedb73
......@@ -404,3 +404,7 @@
+ 1.30:
+ install icons to $(datadir)/icons/hicolor/<RESOLUTION>/apps/.
+ 1.31:
+ the toolbar is now togglable.
+ fixed a crash caused by a search corner case.
......@@ -38,7 +38,7 @@ PROJECT_NAME = xCHM
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.30
PROJECT_NUMBER = 1.31
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
......
AC_INIT([xchm], [1.30])
AC_INIT([xchm], [1.31])
AC_CONFIG_SRCDIR(src/chmfile.cpp)
AC_CONFIG_HEADERS(config.h)
......
......@@ -384,12 +384,10 @@ bool CHMFile::GetItem(UCharVector& topics, UCharVector& strings, UCharVector& ur
parents[level] = tree->AppendItem(parents[parentIndex], tname, 2, 2, new URLTreeItem(tvalue));
if (level) {
if (tree->GetItemImage(parents[parentIndex]) != 0) {
tree->SetItemImage(parents[parentIndex], 0, wxTreeItemIcon_Normal);
tree->SetItemImage(parents[parentIndex], 0, wxTreeItemIcon_Selected);
tree->SetItemImage(parents[parentIndex], 1, wxTreeItemIcon_Expanded);
}
if (level && tree->GetItemImage(parents[parentIndex]) != 0) {
tree->SetItemImage(parents[parentIndex], 0, wxTreeItemIcon_Normal);
tree->SetItemImage(parents[parentIndex], 0, wxTreeItemIcon_Selected);
tree->SetItemImage(parents[parentIndex], 1, wxTreeItemIcon_Expanded);
}
}
......@@ -772,7 +770,6 @@ uint32_t CHMFile::GetLeafNodeOffset(const wxString& text, uint32_t initialOffset
chmUnitInfo* ui)
{
uint32_t test_offset {0};
uint32_t i {sizeof(uint16_t)};
wxString word;
if (!buffSize)
......@@ -788,8 +785,9 @@ uint32_t CHMFile::GetLeafNodeOffset(const wxString& text, uint32_t initialOffset
if (chm_retrieve_object(_chmFile, ui, &buffer[0], initialOffset, buffSize) == 0)
return 0;
auto cursor16 = &buffer[0];
auto free_space = UINT16_FROM_ARRAY(cursor16);
auto cursor16 = &buffer[0];
auto free_space = UINT16_FROM_ARRAY(cursor16);
uint32_t i {sizeof(uint16_t)};
while (i < buffSize - free_space) {
auto word_len = buffer[i];
......
......@@ -53,6 +53,7 @@
#define COPY_HELP _("Copy selection.")
#define FIND_HELP _("Find word in page.")
#define FULLSCREEN_HELP _("Toggle fullscreen mode.")
#define TOGGLE_TOOLBAR_HELP _("Toggle toolbar.")
#define CLOSETAB_HELP _("Close the current tab")
#define NEWTAB_HELP _("Open a new tab")
#define REGISTER_EXTENSION_HELP _("Associate the .chm file extension with xCHM.")
......@@ -346,6 +347,11 @@ void CHMFrame::OnToggleFullScreen(wxCommandEvent&)
ShowFullScreen(_fullScreen, wxFULLSCREEN_ALL);
}
void CHMFrame::OnToggleToolbar(wxCommandEvent&)
{
_tb->Show(!_tb->IsShown());
}
void CHMFrame::OnAddBookmark(wxCommandEvent&)
{
auto id = _tcl->GetSelection();
......@@ -669,6 +675,7 @@ wxMenuBar* CHMFrame::CreateMenu()
auto menuView = new wxMenu;
menuView->Append(ID_FullScreen, _("Toggle &fullscreen\tF11"), FULLSCREEN_HELP);
menuView->Append(ID_ToggleToolbar, _("Toggle &toolbar\tAlt-T"), TOGGLE_TOOLBAR_HELP);
auto menuBar = new wxMenuBar;
menuBar->Append(_menuFile, _("&File"));
......@@ -919,6 +926,7 @@ EVT_MENU(ID_CloseTab, CHMFrame::OnCloseTab)
EVT_MENU(ID_NewTab, CHMFrame::OnNewTab)
EVT_MENU(ID_CopySelection, CHMFrame::OnCopySelection)
EVT_MENU(ID_FullScreen, CHMFrame::OnToggleFullScreen)
EVT_MENU(ID_ToggleToolbar, CHMFrame::OnToggleToolbar)
EVT_BUTTON(ID_Add, CHMFrame::OnAddBookmark)
EVT_BUTTON(ID_Remove, CHMFrame::OnRemoveBookmark)
EVT_TREE_SEL_CHANGED(ID_TreeCtrl, CHMFrame::OnSelectionChanged)
......
......@@ -75,6 +75,7 @@ enum {
ID_CloseTab,
ID_NewTab,
ID_FullScreen,
ID_ToggleToolbar,
ID_TreeCtrl = 1000,
};
......@@ -177,6 +178,9 @@ protected:
//! Called when fullscreen mode is being toggled
void OnToggleFullScreen(wxCommandEvent& event);
//! Called when the toolbar is being toggled
void OnToggleToolbar(wxCommandEvent& event);
//! Called when the user clicks on the Add button.
void OnAddBookmark(wxCommandEvent& event);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment