Skip to content

Commit

Permalink
Merge branch 'release/2.7beta1'
Browse files Browse the repository at this point in the history
  • Loading branch information
evpobr committed Dec 3, 2017
2 parents 0824903 + 59cb8fa commit 5afa14b
Show file tree
Hide file tree
Showing 1,662 changed files with 1,730 additions and 704,814 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*]
indent_style = tab
tab_width = 4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,6 @@ __pycache__/
# Misc ignores

FBE.h

/Installer/Input
/Installer/*.exe
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# FictionBook Editor Changelog

## v.2.7beta1

* Drop Windows XP support
* High DPI fixes
* Use MUI as localization system
* Replace NuGet package system with Vcpkg. PCRE, Hunspell, Scintilla sources removed.
* Update Scintilla to v3.7.6
* Update PCRE to v8.41
* Update Hunspell to v1.6.1
* Use dynamic VCRuntime to reduce installation size and allow CRT updates via Windows Update

## v.2.6.13

* Fix v2.6.12 bug then document cannot be loaded and new images cannot be
Expand Down
12 changes: 9 additions & 3 deletions FBE/AboutBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,15 @@ LRESULT CAboutDlg::OnUpdate(WORD, WORD wID, HWND, BOOL&)
delete[] p;
}
// if checksums are equal
if (readMD5.CompareNoCase (m_UpdateMD5) == 0)
if (U::MessageBox(MB_YESNO | MB_ICONEXCLAMATION, IDR_MAINFRAME, IDS_UPDATEEXISTS, filename) == IDYES)
if (readMD5.CompareNoCase(m_UpdateMD5) == 0)
{
CString strMessage;
strMessage.Format(IDS_UPDATEEXISTS, (LPCTSTR)filename);
if (AtlTaskDialog(*this, IDR_MAINFRAME, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_YES_BUTTON | TDCBF_YES_BUTTON, TD_WARNING_ICON) == IDYES)
{
RunUpdate(filename);
}
}
}
}

Expand Down Expand Up @@ -523,7 +527,9 @@ CString CAboutDlg::GetUpdateFileName()

void CAboutDlg::RunUpdate(CString filename)
{
if (U::MessageBox(MB_YESNO | MB_ICONEXCLAMATION, IDR_MAINFRAME, IDS_UPDATE_CLOSE, filename) == IDYES)
CString strMessage;
strMessage.Format(IDS_UPDATE_CLOSE, (LPCTSTR)filename);
if (AtlTaskDialog(*this, IDR_MAINFRAME, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_YES_BUTTON | TDCBF_YES_BUTTON, TD_WARNING_ICON) == IDYES)
{
HINSTANCE hInst = ShellExecute(0, L"open", filename, 0, 0, SW_SHOW);
::PostMessage(GetParent().m_hWnd, WM_CLOSE, 0, 0);
Expand Down
28 changes: 24 additions & 4 deletions FBE/ExportHTML/ExportHTML.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "atlres.h"
#include "wtl/atlres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
Expand Down Expand Up @@ -107,9 +107,9 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Dialog
//

IDD_CUSTOMSAVEDLG DIALOG 0, 0, 330, 32
STYLE DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg"
IDD_CUSTOMSAVEDLG DIALOGEX 0, 0, 330, 32
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "XSL Template:",IDC_STATIC,68,2,53,8
EDITTEXT IDC_TEMPLATE,130,0,164,12,ES_AUTOHSCROLL
Expand Down Expand Up @@ -145,6 +145,17 @@ END
#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// AFX_DIALOG_LAYOUT
//

IDD_CUSTOMSAVEDLG AFX_DIALOG_LAYOUT
BEGIN
0
END


/////////////////////////////////////////////////////////////////////////////
//
// String Table
Expand All @@ -160,6 +171,15 @@ BEGIN
IDS_WARNING_FILE_ALREADY_EXISTS
"%s already exists.\nDo you want to replace it?"
IDS_SAVE_FILE_FILTER "Web Page, complete (*.html;*.htm)|*.htm;*.html|Web Archive, single file (*.mht)|*.mht|Web Page, HTML only (*.html;*.htm)|*.htm;*.html|"
IDS_XML_PARSE_ERROR "XML Parse Error"
IDS_AT_LINE_COLUMN "At %s, line %d, column %d: %s"
IDS_AT_S_S "At %s: %s"
IDS_ERROR "Error"
END

STRINGTABLE
BEGIN
IDS_COM_ERROR "COM Error"
END

#endif // English (United States) resources
Expand Down
47 changes: 29 additions & 18 deletions FBE/ExportHTML/ExportHTML.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,36 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{F15BE191-947B-40DB-934C-507D5011441C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand All @@ -67,29 +70,31 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;EXPORTHTML_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<AdditionalOptions>/Zc:threadSafeInit-</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ModuleDefinitionFile>ExportHTML.def</ModuleDefinitionFile>
<ImportLibrary />
<ImageHasSafeExceptionHandlers>
</ImageHasSafeExceptionHandlers>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand All @@ -105,21 +110,24 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;EXPORTHTML_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<AdditionalOptions>/Zc:threadSafeInit-</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<Link>
<TargetMachine>MachineX86</TargetMachine>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>ExportHTML.def</ModuleDefinitionFile>
<ImportLibrary />
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
Expand All @@ -142,18 +150,25 @@
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/Zc:threadSafeInit-</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<ModuleDefinitionFile>ExportHTML.def</ModuleDefinitionFile>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
<ClCompile>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/Zc:threadSafeInit-</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -175,7 +190,6 @@
<ItemGroup>
<None Include="ExportHTML.def" />
<None Include="ExportHTMLPlugin.rgs" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="CustomFileSaveDialog.h" />
Expand Down Expand Up @@ -208,7 +222,4 @@
<Midl Include="ExportHTML.idl" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\packages\wtl.9.1\build\native\wtl.targets" Condition="Exists('..\..\packages\wtl.9.1\build\native\wtl.targets')" />
</ImportGroup>
</Project>
1 change: 0 additions & 1 deletion FBE/ExportHTML/ExportHTML.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<None Include="ExportHTML.def">
<Filter>Source Files</Filter>
</None>
<None Include="packages.config" />
<None Include="html.xsl" />
<None Include="ExportHTMLPlugin.rgs">
<Filter>Resource Files</Filter>
Expand Down
29 changes: 14 additions & 15 deletions FBE/ExportHTML/ExportHTMLPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
{
HANDLE hOut = INVALID_HANDLE_VALUE;
CString strTitle;
strTitle.LoadString(IDR_EXPORTHTML);
CString strMessage;

try {
Expand Down Expand Up @@ -54,8 +52,9 @@ HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
hOut = ::CreateFile(dlg.m_szFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
if (hOut == INVALID_HANDLE_VALUE)
{
CString strMessage;
strMessage.Format(IDS_ERROR_OPEN_FILE, dlg.m_szFileName, (LPCTSTR)U::Win32ErrMsg(::GetLastError()));
MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
return S_FALSE;
}

Expand Down Expand Up @@ -88,7 +87,7 @@ HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
CloseHandle(hOut);
::DeleteFile(dlg.m_szFileName);
strMessage.Format(IDS_ERROR_CREATE_DIRECTORY, (LPCTSTR)dfile, (LPCTSTR)U::Win32ErrMsg(de));
::MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
return S_FALSE;
}
}
Expand Down Expand Up @@ -138,12 +137,12 @@ HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
if (!fWr)
{
strMessage.Format(IDS_ERROR_WRITE_FILE, dlg.m_szFileName, (LPCTSTR)U::Win32ErrMsg(::GetLastError()));
::MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
else
{
strMessage.Format(IDS_ERROR_WRITE_FILE2, dlg.m_szFileName);
::MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
::CloseHandle(hOut);
::DeleteFile(dlg.m_szFileName);
Expand Down Expand Up @@ -188,7 +187,7 @@ HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
continue;

// construct a MIME header
_snprintf(buffer, 1024,
_snprintf_s(buffer, 1024, _TRUNCATE,
"\r\n"
"%s\r\n"
"Content-Type: %S\r\n"
Expand All @@ -215,12 +214,12 @@ HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
if (!fWr)
{
strMessage.Format(IDS_ERROR_WRITE_FILE, dlg.m_szFileName, (LPCTSTR)U::Win32ErrMsg(de));
::MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
else
{
strMessage.Format(IDS_ERROR_WRITE_FILE2, dlg.m_szFileName);
::MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
::CloseHandle(hOut);
::DeleteFile(dlg.m_szFileName);
Expand All @@ -243,7 +242,7 @@ HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
if (hFile == INVALID_HANDLE_VALUE && ::GetLastError() == ERROR_FILE_EXISTS)
{
strMessage.Format(IDS_WARNING_FILE_ALREADY_EXISTS, (LPCTSTR)fname);
if (::MessageBox(GetActiveWindow(), strMessage, strTitle, MB_YESNO | MB_ICONEXCLAMATION) != IDYES)
if (AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_YES_BUTTON | TDCBF_NO_BUTTON, TD_WARNING_ICON) != IDYES)
goto skip;
hFile = ::CreateFile(fname, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
}
Expand All @@ -258,20 +257,20 @@ HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
if (!fWr)
{
strMessage.Format(IDS_ERROR_WRITE_FILE, (LPCTSTR)fname, (LPCTSTR)U::Win32ErrMsg(de));
::MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
else
{
strMessage.Format(IDS_ERROR_WRITE_FILE2, (LPCTSTR)fname);
::MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
::DeleteFile(fname);
}
}
else
{
strMessage.Format(IDS_ERROR_OPEN_FILE, (LPCTSTR)fname, (LPCTSTR)U::Win32ErrMsg(::GetLastError()));
::MessageBox(::GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
skip:
::SafeArrayUnaccessData(V_ARRAY(&data));
Expand All @@ -295,12 +294,12 @@ HRESULT CExportHTMLPlugin::Export(long hWnd, BSTR filename, IDispatch *doc)
if (!fWr)
{
strMessage.Format(IDS_ERROR_WRITE_FILE, dlg.m_szFileName, (LPCTSTR)U::Win32ErrMsg(::GetLastError()));
::MessageBox(GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
else
{
strMessage.Format(IDS_ERROR_WRITE_FILE2, dlg.m_szFileName);
::MessageBox(GetActiveWindow(), strMessage, strTitle, MB_ICONERROR);
AtlTaskDialog(::GetActiveWindow(), IDR_EXPORTHTML, (LPCTSTR)strMessage, (LPCTSTR)NULL, TDCBF_OK_BUTTON, TD_ERROR_ICON);
}
::CloseHandle(hOut);
::DeleteFile(dlg.m_szFileName);
Expand Down
Loading

0 comments on commit 5afa14b

Please sign in to comment.