diff --git a/Common/3dParty/libvlc/build/win_arm64/lib/plugins/plugins.dat b/Common/3dParty/libvlc/build/win_arm64/lib/plugins/plugins.dat index 49fb6d4ac2..a75f2da575 100644 Binary files a/Common/3dParty/libvlc/build/win_arm64/lib/plugins/plugins.dat and b/Common/3dParty/libvlc/build/win_arm64/lib/plugins/plugins.dat differ diff --git a/Common/3dParty/libvlc/build/win_arm64/lib/plugins/video_output/libdirect3d11_plugin.dll b/Common/3dParty/libvlc/build/win_arm64/lib/plugins/video_output/libdirect3d11_plugin.dll deleted file mode 100644 index fa465ca3ec..0000000000 Binary files a/Common/3dParty/libvlc/build/win_arm64/lib/plugins/video_output/libdirect3d11_plugin.dll and /dev/null differ diff --git a/Common/base.pri b/Common/base.pri index 9447edebc0..1e69488952 100644 --- a/Common/base.pri +++ b/Common/base.pri @@ -33,8 +33,7 @@ OO_BUILD_BRANDING = $$(OO_BRANDING) OO_DESTDIR_BUILD_OVERRIDE = $$(DESTDIR_BUILD_OVERRIDE) win32 { - CURRENT_YEAR = $$system(wmic PATH Win32_LocalTime GET ^Year /FORMAT:VALUE | find \"=\") - CURRENT_YEAR = $$replace(CURRENT_YEAR, "Year=", "") + CURRENT_YEAR = $$system(powershell -NoLogo -NoProfile -Command "(Get-Date).Year") CURRENT_YEAR = $$replace(CURRENT_YEAR, "\r", "") CURRENT_YEAR = $$replace(CURRENT_YEAR, "\n", "") CURRENT_YEAR = $$replace(CURRENT_YEAR, "\t", "") diff --git a/DesktopEditor/common/Path.cpp b/DesktopEditor/common/Path.cpp index 02dbafcbde..a0e64687d3 100644 --- a/DesktopEditor/common/Path.cpp +++ b/DesktopEditor/common/Path.cpp @@ -246,6 +246,11 @@ namespace NSSystemPath wsNewPath.pop_back(); + #if !defined(_WIN32) && !defined(_WIN64) + if (L'/' == strPath[0] || L'\\' == strPath[0]) + return L'/' + wsNewPath; + #endif + return wsNewPath; } diff --git a/DesktopEditor/doctrenderer/embed/NativeControlEmbed.cpp b/DesktopEditor/doctrenderer/embed/NativeControlEmbed.cpp index e1bf018f6a..2da5e64aee 100644 --- a/DesktopEditor/doctrenderer/embed/NativeControlEmbed.cpp +++ b/DesktopEditor/doctrenderer/embed/NativeControlEmbed.cpp @@ -194,6 +194,9 @@ JSSmart CNativeControlEmbed::ZipOpenBase64(JSSmart name) JSSmart CNativeControlEmbed::ZipFileAsString(JSSmart name) { + if (m_pInternal->m_oZipWorker.m_sTmpFolder.empty()) + return CJSContext::createUndefined(); + BYTE* pData = NULL; DWORD len = 0; m_pInternal->m_oZipWorker.GetFileData(name->toStringW(), pData, len); @@ -202,6 +205,9 @@ JSSmart CNativeControlEmbed::ZipFileAsString(JSSmart name) JSSmart CNativeControlEmbed::ZipFileAsBinary(JSSmart name) { + if (m_pInternal->m_oZipWorker.m_sTmpFolder.empty()) + return CJSContext::createUndefined(); + return CJSContext::createUint8Array(m_pInternal->m_oZipWorker.m_sTmpFolder + L"/" + name->toStringW()); } diff --git a/DesktopEditor/fontengine/ApplicationFontsWorker.cpp b/DesktopEditor/fontengine/ApplicationFontsWorker.cpp index 3d1baddc8b..816c424f01 100644 --- a/DesktopEditor/fontengine/ApplicationFontsWorker.cpp +++ b/DesktopEditor/fontengine/ApplicationFontsWorker.cpp @@ -837,53 +837,63 @@ public: CSymbolSimpleChecker2 oAllChecker(arSymbolsAll, nMaxSymbol); std::map mapFontsPriorityStandard; - mapFontsPriorityStandard.insert(std::pair(L"ASCW3", 1)); - mapFontsPriorityStandard.insert(std::pair(L"Arial", 2)); - mapFontsPriorityStandard.insert(std::pair(L"Times New Roman", 3)); - mapFontsPriorityStandard.insert(std::pair(L"Tahoma", 4)); - mapFontsPriorityStandard.insert(std::pair(L"Cambria", 5)); - mapFontsPriorityStandard.insert(std::pair(L"Calibri", 6)); - mapFontsPriorityStandard.insert(std::pair(L"Verdana", 7)); - mapFontsPriorityStandard.insert(std::pair(L"Georgia", 8)); - mapFontsPriorityStandard.insert(std::pair(L"Open Sans", 9)); - mapFontsPriorityStandard.insert(std::pair(L"Liberation Sans", 10)); - mapFontsPriorityStandard.insert(std::pair(L"Helvetica", 11)); - mapFontsPriorityStandard.insert(std::pair(L"Nimbus Sans L", 12)); - mapFontsPriorityStandard.insert(std::pair(L"DejaVu Sans", 13)); - mapFontsPriorityStandard.insert(std::pair(L"Liberation Serif", 14)); - mapFontsPriorityStandard.insert(std::pair(L"Trebuchet MS", 15)); - mapFontsPriorityStandard.insert(std::pair(L"Courier New", 16)); - mapFontsPriorityStandard.insert(std::pair(L"Carlito", 17)); - mapFontsPriorityStandard.insert(std::pair(L"Segoe UI", 18)); - mapFontsPriorityStandard.insert(std::pair(L"SimSun", 19)); - mapFontsPriorityStandard.insert(std::pair(L"MS Gothic", 20)); - mapFontsPriorityStandard.insert(std::pair(L"Nirmala UI", 21)); - mapFontsPriorityStandard.insert(std::pair(L"Batang", 22)); - mapFontsPriorityStandard.insert(std::pair(L"MS Mincho", 23)); - mapFontsPriorityStandard.insert(std::pair(L"Wingdings", 24)); - mapFontsPriorityStandard.insert(std::pair(L"Microsoft JhengHei", 25)); - mapFontsPriorityStandard.insert(std::pair(L"Microsoft JhengHei UI", 26)); - mapFontsPriorityStandard.insert(std::pair(L"Microsoft YaHei", 27)); - mapFontsPriorityStandard.insert(std::pair(L"PMingLiU", 28)); - mapFontsPriorityStandard.insert(std::pair(L"MingLiU", 29)); - mapFontsPriorityStandard.insert(std::pair(L"DFKai-SB", 30)); - mapFontsPriorityStandard.insert(std::pair(L"FangSong", 31)); - mapFontsPriorityStandard.insert(std::pair(L"KaiTi", 32)); - mapFontsPriorityStandard.insert(std::pair(L"SimKai", 33)); - mapFontsPriorityStandard.insert(std::pair(L"SimHei", 34)); - mapFontsPriorityStandard.insert(std::pair(L"Meiryo", 35)); + int nCurrentPriority = 1; + + #define SET_FONT_PRIORITY(fontName) mapFontsPriorityStandard.insert(std::pair(fontName, nCurrentPriority++)) + + SET_FONT_PRIORITY(L"ASCW3"); + SET_FONT_PRIORITY(L"Arial"); + SET_FONT_PRIORITY(L"Times New Roman"); + SET_FONT_PRIORITY(L"Tahoma"); + SET_FONT_PRIORITY(L"Cambria"); + SET_FONT_PRIORITY(L"Calibri"); + SET_FONT_PRIORITY(L"Verdana"); + SET_FONT_PRIORITY(L"Georgia"); + SET_FONT_PRIORITY(L"Open Sans"); + SET_FONT_PRIORITY(L"Liberation Sans"); + SET_FONT_PRIORITY(L"Helvetica"); + SET_FONT_PRIORITY(L"Nimbus Sans L"); + SET_FONT_PRIORITY(L"DejaVu Sans"); + SET_FONT_PRIORITY(L"Liberation Serif"); + SET_FONT_PRIORITY(L"Trebuchet MS"); + SET_FONT_PRIORITY(L"Courier New"); + SET_FONT_PRIORITY(L"Carlito"); + SET_FONT_PRIORITY(L"Segoe UI"); + SET_FONT_PRIORITY(L"SimSun"); + SET_FONT_PRIORITY(L"MS Gothic"); + SET_FONT_PRIORITY(L"Nirmala UI"); + SET_FONT_PRIORITY(L"Batang"); + SET_FONT_PRIORITY(L"MS Mincho"); + SET_FONT_PRIORITY(L"Wingdings"); + SET_FONT_PRIORITY(L"Microsoft JhengHei"); + SET_FONT_PRIORITY(L"Microsoft JhengHei UI"); + SET_FONT_PRIORITY(L"Microsoft YaHei"); + SET_FONT_PRIORITY(L"PMingLiU"); + SET_FONT_PRIORITY(L"MingLiU"); + SET_FONT_PRIORITY(L"DFKai-SB"); + SET_FONT_PRIORITY(L"FangSong"); + SET_FONT_PRIORITY(L"KaiTi"); + SET_FONT_PRIORITY(L"SimKai"); + SET_FONT_PRIORITY(L"SimHei"); + SET_FONT_PRIORITY(L"Meiryo"); #ifdef _MAC - mapFontsPriorityStandard.insert(std::pair(L"PingFang SC", 36)); - mapFontsPriorityStandard.insert(std::pair(L"PingFang TC", 37)); - mapFontsPriorityStandard.insert(std::pair(L"PingFang HK", 38)); + SET_FONT_PRIORITY(L"PingFang SC"); + SET_FONT_PRIORITY(L"PingFang TC"); + SET_FONT_PRIORITY(L"PingFang HK"); - mapFontsPriorityStandard.insert(std::pair(L"Heiti SC", 39)); - mapFontsPriorityStandard.insert(std::pair(L"Heiti TC", 40)); - mapFontsPriorityStandard.insert(std::pair(L"Songti SC", 41)); - mapFontsPriorityStandard.insert(std::pair(L"Songti TC", 42)); + SET_FONT_PRIORITY(L"Heiti SC"); + SET_FONT_PRIORITY(L"Heiti TC"); + SET_FONT_PRIORITY(L"Songti SC"); + SET_FONT_PRIORITY(L"Songti TC"); #endif + SET_FONT_PRIORITY(L"Malgun Gothic"); + SET_FONT_PRIORITY(L"Nanum Gothic"); + SET_FONT_PRIORITY(L"NanumGothic"); + SET_FONT_PRIORITY(L"Noto Sans KR"); + SET_FONT_PRIORITY(L"TakaoGothic"); + NSFonts::CApplicationFontsSymbols oApplicationChecker; // приоритеты шрифтов. по имени (все стили) diff --git a/DesktopEditor/fontengine/ApplicationFontsWorker.h b/DesktopEditor/fontengine/ApplicationFontsWorker.h index 2d5951cc85..4c509b1820 100644 --- a/DesktopEditor/fontengine/ApplicationFontsWorker.h +++ b/DesktopEditor/fontengine/ApplicationFontsWorker.h @@ -36,7 +36,7 @@ #include #include "../graphics/pro/Fonts.h" -#define ONLYOFFICE_FONTS_VERSION 14 +#define ONLYOFFICE_FONTS_VERSION 15 #define ONLYOFFICE_ALL_FONTS_VERSION 2 class CApplicationFontsWorkerBreaker diff --git a/HtmlFile2/htmlfile2.cpp b/HtmlFile2/htmlfile2.cpp index 8ef049c24d..86776eb3ef 100644 --- a/HtmlFile2/htmlfile2.cpp +++ b/HtmlFile2/htmlfile2.cpp @@ -4396,41 +4396,42 @@ private: } } - if (sSrcM.empty()) { ImageAlternative(oXml, sSelectors, oTS, wsAlt, sSrcM, oImageData); return true; } + std::wstring sExtention; + + // Предполагаем картинку в Base64 + if (sSrcM.length() > 4 && sSrcM.substr(0, 4) == L"data" && sSrcM.find(L"/", 4) != std::wstring::npos) + bRes = readBase64(sSrcM, sExtention); + const bool bIsAllowExternalLocalFiles = GetStatusUsingExternalLocalFiles(); - bool bIsBase64 = false; - if (sSrcM.length() > 4 && sSrcM.substr(0, 4) == L"data" && sSrcM.find(L"/", 4) != std::wstring::npos) - bIsBase64 = true; - - if (!bIsBase64 && (sSrcM.length() <= 7 || L"http" != sSrcM.substr(0, 4))) + if (!bRes && (sSrcM.length() <= 7 || L"http" != sSrcM.substr(0, 4))) { sSrcM = NSSystemPath::ShortenPath(sSrcM); if (!CanUseThisPath(sSrcM, m_sSrc, m_sCore, bIsAllowExternalLocalFiles)) + { + ImageAlternative(oXml, sSelectors, oTS, wsAlt, sSrcM, oImageData); return true; + } } - int nImageId = -1; - std::wstring sExtention; - // Предполагаем картинку в Base64 - if (bIsBase64) - bRes = readBase64(sSrcM, sExtention); - // Проверка расширения - sExtention = NSFile::GetFileExtention(sSrcM); - std::transform(sExtention.begin(), sExtention.end(), sExtention.begin(), tolower); + if (!bRes) + { + sExtention = NSFile::GetFileExtention(sSrcM); + std::transform(sExtention.begin(), sExtention.end(), sExtention.begin(), tolower); - std::wstring::const_iterator itFound = std::find_if(sExtention.cbegin(), sExtention.cend(), [](wchar_t wChar){ return !iswalpha(wChar) && L'+' != wChar; }); + std::wstring::const_iterator itFound = std::find_if(sExtention.cbegin(), sExtention.cend(), [](wchar_t wChar){ return !iswalpha(wChar) && L'+' != wChar; }); - if (sExtention.cend() != itFound) - sExtention.erase(itFound, sExtention.cend()); + if (sExtention.cend() != itFound) + sExtention.erase(itFound, sExtention.cend()); + } // Предполагаем картинку в сети if (!bRes && @@ -4467,6 +4468,8 @@ private: } } + int nImageId = -1; + if (!bRes) { if (NotValidExtension(sExtention)) diff --git a/PdfFile/PdfFile.cpp b/PdfFile/PdfFile.cpp index 8c9193ea14..576f7e78d4 100644 --- a/PdfFile/PdfFile.cpp +++ b/PdfFile/PdfFile.cpp @@ -1380,7 +1380,7 @@ HRESULT CPdfFile::AdvancedCommand(IAdvancedCommand* command) } case IAdvancedCommand::AdvancedCommandType::Redact: { - if (m_pInternal->pEditor && m_pInternal->pEditor->IsEditPage()) + if (m_pInternal->pEditor) m_pInternal->pEditor->Redact((CRedact*)command); return S_OK; }