Merge remote-tracking branch 'origin/AHK_RegrTest_Enh'

This commit is contained in:
Rainer Kottenhoff 2017-10-15 13:51:54 +02:00
commit efe1988d67
5 changed files with 78 additions and 40 deletions

28
.gitignore vendored
View File

@ -29,15 +29,21 @@ Thumbs.db
/Build/.vs
/Build/Packages
/Build/temp_zip*
/Build/Bin/Password.txt
/Build/Bin/Certum.cer
/Build/Bin/Certum.p12
/Build/sign.bat
/Build/Signing/Certum.cer
/Build/Signing/Certum.p12
/Build/Signing/kSign.exe
/Build/Signing/kSignCMD.exe
/Build/Signing/Password.txt
/distrib/Notepad3*.exe
Build/Bin/Password.txt
Build/Bin/Certum.cer
Build/Bin/Certum.p12
Build/sign.bat
Build/Signing/Certum.cer
Build/Signing/Certum.p12
Build/Signing/kSign.exe
Build/Signing/kSignCMD.exe
Build/Signing/Password.txt
Notepad3.VC.db
Notepad3.VC.VC.opendb
/res/Notepad3.exe.manifest.conf
/src/VersionEx.h
/Versions/build.txt
/Notepad3.VC.db
/Notepad3.VC.VC.opendb
/np3portableapp/Notepad3Portable/App/Notepad3
/np3portableapp/Notepad3Portable/Notepad3Portable.exe
/np3portableapp/Notepad3Portable/App/AppInfo/appinfo.ini

View File

@ -3940,10 +3940,10 @@ void EditPadWithSpaces(HWND hwnd,BOOL bSkipEmpty,BOOL bNoUndoGroup)
iRcAnchorLine = (int)SendMessage(hwnd,SCI_LINEFROMPOSITION,(WPARAM)iAnchorPos,0);
iRcCurCol = (int)SendMessage(hwnd,SCI_GETCOLUMN,(WPARAM)iCurPos,0);
//iRcCurCol += (int)SendMessage(hwnd, SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, 0, 0);
//iRcCurCol += (int)SendMessage(hwnd, SCI_GETSELECTIONNCARETVIRTUALSPACE, 0, 0);
iRcAnchorCol = (int)SendMessage(hwnd,SCI_GETCOLUMN,(WPARAM)iAnchorPos,0);
//iRcAnchorCol += (int)SendMessage(hwnd, SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, 0, 0);
//iRcAnchorCol += (int)SendMessage(hwnd, SCI_GETSELECTIONNANCHORVIRTUALSPACE, 0, 0);
bIsRectangular = TRUE;
@ -3955,7 +3955,7 @@ void EditPadWithSpaces(HWND hwnd,BOOL bSkipEmpty,BOOL bNoUndoGroup)
int iPos = (int)SendMessage(hwnd,SCI_GETLINESELENDPOSITION,(WPARAM)iLine,0);
if (iPos != INVALID_POSITION) {
int iCol = (int)SendMessage(hwnd, SCI_GETCOLUMN, (WPARAM)iPos, 0);
//iCol += (int)SendMessage(hwnd, SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, 0, 0);
//iCol += (int)SendMessage(hwndEdit, SCI_GETSELECTIONNCARETVIRTUALSPACE, 0, 0);
iMaxColumn = max(iMaxColumn, iCol);
}
}
@ -3986,7 +3986,7 @@ void EditPadWithSpaces(HWND hwnd,BOOL bSkipEmpty,BOOL bNoUndoGroup)
continue;
int iCol = (int)SendMessage(hwnd, SCI_GETCOLUMN, (WPARAM)iPos, 0);
//iCol += (int)SendMessage(hwnd, SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, 0, 0);
//iCol += (int)SendMessage(hwnd, SCI_GETSELECTIONNCARETVIRTUALSPACE, 0, 0);
iPadLen = iMaxColumn - iCol;
SendMessage(hwnd,SCI_SETTARGETSTART,(WPARAM)iPos,0);
@ -4768,10 +4768,10 @@ void EditSortLines(HWND hwnd,int iSortFlags)
iRcAnchorLine = (int)SendMessage(hwnd,SCI_LINEFROMPOSITION,(WPARAM)iAnchorPos,0);
iRcCurCol = (int)SendMessage(hwnd,SCI_GETCOLUMN,(WPARAM)iCurPos,0);
//iRcCurCol += (int)SendMessage(hwnd, SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, 0, 0);
//iRcCurCol += (int)SendMessage(hwnd, SCI_GETSELECTIONNCARETVIRTUALSPACE, 0, 0);
iRcAnchorCol = (int)SendMessage(hwnd, SCI_GETCOLUMN, (WPARAM)iAnchorPos, 0);
//iRcAnchorCol += (int)SendMessage(hwnd, SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, 0, 0);
//iRcAnchorCol += (int)SendMessage(hwnd, SCI_GETSELECTIONNANCHORVIRTUALSPACE, 0, 0);
bIsRectangular = TRUE;
@ -4796,7 +4796,7 @@ void EditSortLines(HWND hwnd,int iSortFlags)
iLineEnd--;
iSortColumn = (UINT)SendMessage(hwnd,SCI_GETCOLUMN,(WPARAM)SendMessage(hwnd,SCI_GETCURRENTPOS,0,0),0);
//iSortColumn += (int)SendMessage(hwnd, SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, 0, 0);
//iSortColumn += (int)SendMessage(hwnd, SCI_GETSELECTIONNCARETVIRTUALSPACE, 0, 0);
}
iLineCount = iLineEnd - iLineStart +1;

View File

@ -3093,7 +3093,7 @@ LRESULT MsgCommand(HWND hwnd,WPARAM wParam,LPARAM lParam)
int iCurPos = (int)SendMessage(hwndEdit,SCI_GETCURRENTPOS,0,0);
int iCurrLine = (int)SendMessage(hwndEdit,SCI_LINEFROMPOSITION,(WPARAM)iCurPos,0);
int iCurColumn = (int)SendMessage(hwndEdit,SCI_GETCOLUMN,(WPARAM)iCurPos,0);
int iCurVSpace = (int)SendMessage(hwndEdit, SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, 0, 0);
int iCurVSpace = (int)SendMessage(hwndEdit, SCI_GETSELECTIONNCARETVIRTUALSPACE, 0, 0);
SendMessage(hwndEdit, SCI_PASTE, 0, 0);
@ -5481,8 +5481,8 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
if (scn->updated & ~(SC_UPDATE_V_SCROLL | SC_UPDATE_H_SCROLL)) {
UpdateToolbar();
UpdateStatusbar();
UpdateToolbar();
InvalidateSelections();
@ -7124,7 +7124,7 @@ void UpdateStatusbar()
FormatNumberStr(tchLines);
int iCol = (int)SendMessage(hwndEdit,SCI_GETCOLUMN,iPos,0) + 1;
iCol += (int)SendMessage(hwndEdit,SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE,0,0);
iCol += (int)SendMessage(hwndEdit, SCI_GETSELECTIONNCARETVIRTUALSPACE, 0, 0);
StringCchPrintf(tchCol,COUNTOF(tchCol),L"%i",iCol);
FormatNumberStr(tchCol);

View File

@ -3979,7 +3979,7 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
LOGFONT lf;
WCHAR szNewStyle[512] = { L'\0' };
int iValue;
WCHAR tch[64] = { L'\0' };
WCHAR tch[LF_FACESIZE+1] = { L'\0' };
HDC hdc;
ZeroMemory(&cf,sizeof(CHOOSEFONT));
@ -3996,14 +3996,20 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
ReleaseDC(hwnd,hdc);
}
lf.lfWeight = (StrStrI(lpszStyle,L"bold")) ? FW_BOLD : FW_NORMAL;
lf.lfItalic = (StrStrI(lpszStyle,L"italic")) ? 1 : 0;
lf.lfItalic = (StrStrI(lpszStyle,L"italic")) ? TRUE : FALSE;
COLORREF color = 0L;
if (Style_StrGetColor(TRUE, lpszStyle, &iValue)) {
color = RGB(GetRValue(iValue),GetGValue(iValue),GetBValue(iValue));
}
// Init cf
cf.lStructSize = sizeof(CHOOSEFONT);
cf.hwndOwner = hwnd;
cf.rgbColors = color;
cf.lpLogFont = &lf;
cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_NOSCRIPTSEL*/ | CF_SCREENFONTS;
cf.Flags = CF_INITTOLOGFONTSTRUCT /*| CF_EFFECTS | CF_NOSCRIPTSEL*/ | CF_SCREENFONTS | CF_FORCEFONTEXIST;
if (HIBYTE(GetKeyState(VK_SHIFT)))
cf.Flags |= CF_FIXEDPITCHONLY;
@ -4029,21 +4035,21 @@ BOOL Style_SelectFont(HWND hwnd,LPWSTR lpszStyle,int cchStyle,BOOL bDefaultStyle
StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; size:");
StringCchPrintf(tch,COUNTOF(tch),L"%i",cf.iPointSize/10);
StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch);
if (cf.nFontType & BOLD_FONTTYPE)
if ((cf.nFontType & BOLD_FONTTYPE) || (lf.lfWeight >= FW_SEMIBOLD))
StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; bold");
if (cf.nFontType & ITALIC_FONTTYPE)
if ((cf.nFontType & ITALIC_FONTTYPE) || lf.lfItalic)
StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; italic");
if (StrStrI(lpszStyle,L"underline"))
StringCchCat(szNewStyle,COUNTOF(szNewStyle),L"; underline");
// save colors
if (Style_StrGetColor(TRUE,lpszStyle,&iValue))
if (color != 0)
{
StringCchPrintf(tch,COUNTOF(tch),L"; fore:#%02X%02X%02X",
(int)GetRValue(iValue),
(int)GetGValue(iValue),
(int)GetBValue(iValue));
(int)GetRValue(cf.rgbColors),
(int)GetGValue(cf.rgbColors),
(int)GetBValue(cf.rgbColors));
StringCchCat(szNewStyle,COUNTOF(szNewStyle),tch);
}
if (Style_StrGetColor(FALSE,lpszStyle,&iValue))

View File

@ -18,20 +18,37 @@ set VERSHOULD=2.%YY%.%MM%%DD%.%BUILD%
:: --------------------------------------------------------------------------------------------------------------------
set TEST_SUCCEEDED=false
set TEST_RESULT=failure
set FILEVER=
set FILEVER32=
if exist "%NP3_WIN32_DIR%Notepad3.exe" call :GETFILEVER "%NP3_WIN32_DIR%Notepad3.exe"
if defined FILEVER set FILEVER32=%FILEVER%
set FILEVER=
set FILEVER64=
if exist "%NP3_X64_DIR%Notepad3.exe" call :GETFILEVER "%NP3_X64_DIR%Notepad3.exe"
if defined FILEVER call :COMPAREVER "%VERSHOULD%" "%FILEVER%"
if defined FILEVER set FILEVER64=%FILEVER%
if defined FILEVER32 set TEST_RESULT=success
if defined FILEVER64 set TEST_RESULT=success
call :COMPAREVER "%VERSHOULD%" "%FILEVER32%" "%FILEVER64%"
:: ====================================================================================================================
goto :END
:: --------------------------------------------------------------------------------------------------------------------
:COMPAREVER
if ["%~1"] EQU ["%~2"] (
set TEST_SUCCEEDED=true
if ["%~2"] NEQ [""] (
if ["%~1"] NEQ ["%~2"] (
echo ERROR: Expected version "%~1", found version "%~2" in 32-bit exe
set TEST_RESULT=failure
)
)
if ["%~3"] NEQ [""] (
if ["%~1"] NEQ ["%~3"] (
echo ERROR: Expected version "%~1", found version "%~3" in 64-bit exe
set TEST_RESULT=failure
)
)
goto:EOF
:: --------------------------------------------------------------------------------------------------------------------
@ -76,11 +93,20 @@ goto:EOF
:: ====================================================================================================================
:END
echo.VERSHOULD = %VERSHOULD%
echo.FILEVER = %FILEVER%
echo.TEST_SUCCEEDED = %TEST_SUCCEEDED%
:: - make TEST_SUCCEEDED survive 'endlocal'
endlocal & set TEST_SUCCEEDED=%TEST_SUCCEEDED%
echo Expected Version = %VERSHOULD%
if ["%FILEVER32%"] NEQ [""] (
echo 32-bit exe Version = %FILEVER32%
) else (
echo No 32-bit exe Version found
)
if ["%FILEVER64%"] NEQ [""] (
echo 64-bit exe Version = %FILEVER64%
) else (
echo No 64-bit exe Version found
)
echo Version Test Result: %TEST_RESULT%
:: - make TEST_RESULT survive 'endlocal'
endlocal & set TEST_RESULT=%TEST_RESULT%
::pause
if [%TEST_SUCCEEDED%] NEQ [true] exit /B 1
if [%TEST_RESULT%] NEQ [success] exit /B 1
:: ====================================================================================================================