From f07e14bdc4a7915efc8adc65f8dd2194c13d4e6e Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Thu, 16 May 2024 12:53:23 +0900 Subject: [PATCH] sync --- CMakeLists.txt | 1 + README.txt | 73 +++++++++++++++++++++++++++++++++++++++++++++++ lang/ro-RO.rc | 21 ++++++++------ reactos/buildno.h | 12 ++++---- reactos/version.h | 2 +- wordpad.c | 18 ++++++++---- 6 files changed, 107 insertions(+), 20 deletions(-) create mode 100644 README.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index f6f2ca7..1b6479d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,7 @@ add_executable(wordpad WIN32 target_compile_definitions(wordpad PRIVATE UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS STRSAFE_NO_DEPRECATE __REACTOS__ + __RWORDPAD__ RICHEDIT_CLASS20W=RICHEDIT_CLASSW LANGUAGE_BG_BG LANGUAGE_CS_CZ diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..d091663 --- /dev/null +++ b/README.txt @@ -0,0 +1,73 @@ +# Independent ReactOS WordPad + +This is "Independent ReactOS WordPad"` from WineHQ and ReactOS. + +It's a free and open source software for Windows XP and later. + +- Donate ReactOS: https://reactos.org/donate/ +- Follow on Twitter: https://twitter.com/reactos + +## Main code contributors + +- Copyright 1993-2023 the Wine project authors +- Copyright ReactOS Development Team +- Copyright 2004 Krzysztof Foltman +- Copyright 2007 Alexander N. Sørnes (alex@thehandofagony.com) +- Copyright 2007-2008 Alexander N. Sørnes (alex@thehandofagony.com) +- Copyright 2010 Dylan Smith (dylan.ah.smith@gmail.com) +- Copyright 2020 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com) +- and more! + +## Translators + +- Copyright 2004 Krzysztof Foltman +- Copyright 2006 Andras Kovacs +- Copyright 2006 Fatih Aşıcı (fasici [at] linux-sevenler [dot] org) +- Copyright 2006 Hans Leidekker +- Copyright 2006 Henning Gerhardt +- Copyright 2006 Mikolaj Zalewski +- Copyright 2006 Phil Krylov +- Copyright 2006,2007 YunSong Hwang +- Copyright 2006-2009 Jonathan Ernst +- Copyright 2006-2010 Alexander N. Sørnes (alex@thehandofagony.com) +- Copyright 2008 Frans Kool +- Copyright 2008 Hongbo Ni (hongbo.at.njstar.com) +- Copyright 2008 Jens Albretsen (jens@albretsen.dk) +- Copyright 2008 Katayama Hirofumi MZ +- Copyright 2008 Ricardo Filipe +- Copyright 2008 Rok Mandeljc +- Copyright 2009 Anders Jonsson +- Copyright 2009 Aurimas Fišeras (aurimas@gmail.com) +- Copyright 2010 Cheer Xiao (xiaqqaix.at.gmail.com) +- Copyright 2010 Claudia Cotună +- Copyright 2010 Frédéric Delanoy +- Copyright 2010 Gustavo Henrique Milaré +- Copyright 2010 Igor Paliychuk +- Copyright 2010 Luca Bennati +- Copyright 2010 Thomas Larsen +- Copyright 2010 Łukasz Wojniłowicz +- Copyright 2011 Ștefan Fulea +- Copyright 2013-2016, 2019 Erdem Ersoy (eersoy93) (erdemersoy [at] erdemersoy [dot] net) +- Copyright 2014 Ismael Ferreras Morezuelas +- Copyright 2017 Li Keqing (auroracloud4096.at.gmail.com) +- Copyright 2020 Tibor Lajos Füzi +- Copyright 2020-2021 Chan Chilung (eason066.at.gmail.com) +- Copyright Ardit Dani +- Copyright Michael Stefaniuc +- and more! + +## How to build? + +Please use ReactOS Build Environment (RosBE). + + git clone https://github.com/katahiromz/RWordPad + cd RWordPad + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release . + ninja + strip wordpad.exe + +Tested on RosBE, Visual Studio 2015, and Visual Studio 2019. + +## License + +- LGPL 2.1 and later diff --git a/lang/ro-RO.rc b/lang/ro-RO.rc index d8f3587..9e29dbd 100644 --- a/lang/ro-RO.rc +++ b/lang/ro-RO.rc @@ -1,8 +1,13 @@ /* - * Copyright 2004 Krzysztof Foltman - * Copyright 2010 Claudia Cotună - * Michael Stefaniuc - * 2011 Ștefan Fulea + * PROJECT: ReactOS Wordpad + * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) + * PURPOSE: Romanian resource file + * TRANSLATORS: Copyright 2004 Krzysztof Foltman + * Copyright 2010 Claudia Cotună + * Copyright 2010 Michael Stefaniuc + * Copyright 2011 Ștefan Fulea + * Copyright 2023 Andrei Miloiu + * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,8 +32,8 @@ BEGIN BEGIN MENUITEM "&Nou…\tCtrl+N", ID_FILE_NEW MENUITEM "&Deschidere…\tCtrl+O", ID_FILE_OPEN - MENUITEM "&Pătrează\tCtrl+S", ID_FILE_SAVE - MENUITEM "Păst&rare în…", ID_FILE_SAVEAS + MENUITEM "S&alvează\tCtrl+S", ID_FILE_SAVE + MENUITEM "Salvea&ză ca…", ID_FILE_SAVEAS MENUITEM SEPARATOR MENUITEM "I&mprimare…\tCtrl+P", ID_PRINT MENUITEM "Pre&vizionare imprimare…", ID_PREVIEW @@ -178,13 +183,13 @@ END STRINGTABLE BEGIN STRING_DEFAULT_FILENAME, "Document" - STRING_PROMPT_SAVE_CHANGES, "Păstrați modificările la „%s”?" + STRING_PROMPT_SAVE_CHANGES, "Salvați modificările la „%s”?" STRING_SEARCH_FINISHED, "Căutarea în document a fost finalizată." STRING_LOAD_RICHED_FAILED, "Biblioteca RichEdit nu a putut fi încărcată." STRING_SAVE_LOSEFORMATTING, "Ați ales să salvați în formatul de text simplu, care va pierde formatarea. Sigur doriți să continuați?" STRING_INVALID_NUMBER, "Formatul de număr nu este valid." STRING_OLE_STORAGE_NOT_SUPPORTED, "Documentele de depozitare OLE nu sunt suportate." - STRING_WRITE_FAILED, "Fișierul nu a putut fi păstrat." + STRING_WRITE_FAILED, "Fișierul nu a putut fi salvat." STRING_WRITE_ACCESS_DENIED, "Nu aveți permisiunea să salvați fișierul." STRING_OPEN_FAILED, "Fișierul nu a putut fi deschis." STRING_OPEN_ACCESS_DENIED, "Nu aveți permisiunea de a deschide fișierul." diff --git a/reactos/buildno.h b/reactos/buildno.h index 4a7de8b..93883e9 100644 --- a/reactos/buildno.h +++ b/reactos/buildno.h @@ -2,17 +2,17 @@ #ifndef _INC_REACTOS_BUILDNO #define _INC_REACTOS_BUILDNO -#define KERNEL_VERSION_BUILD 20230905 -#define KERNEL_VERSION_BUILD_STR "20230905-0.4.15-dev-6584-g2508cdf" -#define KERNEL_VERSION_BUILD_RC "20230905-0.4.15-dev-6584-g2508cdf\0" +#define KERNEL_VERSION_BUILD 20240515 +#define KERNEL_VERSION_BUILD_STR "20240515-0.4.15-dev-8089-g48a0d8e" +#define KERNEL_VERSION_BUILD_RC "20240515-0.4.15-dev-8089-g48a0d8e\0" #define KERNEL_VERSION_RC "0.4.15-x86-dev\0" #define KERNEL_VERSION_STR "0.4.15-x86-dev" -#define KERNEL_VERSION_REVISION_RC "0.4.15-dev-6584-g2508cdf\0" -#define KERNEL_VERSION_REVISION_STR "0.4.15-dev-6584-g2508cdf" +#define KERNEL_VERSION_REVISION_RC "0.4.15-dev-8089-g48a0d8e\0" +#define KERNEL_VERSION_REVISION_STR "0.4.15-dev-8089-g48a0d8e" -#define KERNEL_VERSION_COMMIT_HASH "2508cdfe2e4e99ef76a060dff58d8a136112890d" +#define KERNEL_VERSION_COMMIT_HASH "48a0d8e012f77b5d7fb11d58141e1fdd5de27254" #define REACTOS_DLL_VERSION_MAJOR 42 #define REACTOS_DLL_VERSION_RC "42.4.15-dev\0" diff --git a/reactos/version.h b/reactos/version.h index d5ed15a..b574873 100644 --- a/reactos/version.h +++ b/reactos/version.h @@ -20,7 +20,7 @@ #define KERNEL_VERSION_MINOR 4 #define KERNEL_VERSION_PATCH_LEVEL 15 -#define COPYRIGHT_YEAR "2023" +#define COPYRIGHT_YEAR "2024" #endif diff --git a/wordpad.c b/wordpad.c index 23e3c0a..c576ac9 100644 --- a/wordpad.c +++ b/wordpad.c @@ -34,9 +34,6 @@ #include #include #include -#ifdef __REACTOS__ -#include -#endif #include "wordpad.h" @@ -846,8 +843,15 @@ static BOOL DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format) EDITSTREAM stream; LRESULT ret; +#ifdef __REACTOS__ + /* Use OPEN_ALWAYS instead of CREATE_ALWAYS in order to succeed + * even if the file has HIDDEN or SYSTEM attributes */ + hFile = CreateFileW(wszSaveFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); +#else hFile = CreateFileW(wszSaveFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); +#endif if(hFile == INVALID_HANDLE_VALUE) { @@ -873,6 +877,10 @@ static BOOL DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format) ret = SendMessageW(hEditorWnd, EM_STREAMOUT, format, (LPARAM)&stream); +#ifdef __REACTOS__ + /* Truncate the file and close it */ + SetEndOfFile(hFile); +#endif CloseHandle(hFile); SetFocus(hEditorWnd); @@ -1386,8 +1394,8 @@ static void number_with_units(LPWSTR buffer, int number) static const WCHAR fmt[] = {'%','.','2','f',' ','%','s','\0'}; float converted = (float)number / (float)TWIPS_PER_INCH *(float)CENTMM_PER_INCH / 1000.0; -#ifdef __REACTOS__ - StringCchPrintfW(buffer, MAX_STRING_LEN, fmt, converted, units_cmW); +#ifdef __RWORDPAD__ + _swprintf(buffer, fmt, converted, units_cmW); #else sprintfW(buffer, fmt, converted, units_cmW); #endif