1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00
Files
winscp/source/forms/License.cpp
Martin Prikryl 74fdf539de Clang imposed changes that should be noop and have no effect on classic compiler (2nd after 92ba1e3f0 + preceding commits)
Mostly
– explicit static global variables
– const, sign and down casts safety
– same-named variables in nested scopes
– incorrectly identified uninitialized variables
– semicolon after function implementation
– unused variables, fields, arguments and macros
– exact include filename case
– field initialization order
– typename use
– struct vs class declarations
– incorrectly identified uninitialized variables
– refactoring to solve Clang internal compiler error when using new variable in __finally block

Source commit: 3da995ff5169eefcfe3b3b7cc0d019c660096c07
2025-06-24 16:32:34 +02:00

52 lines
1.4 KiB
C++

//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <Common.h>
#include <TextsWin.h>
#include <VCLCommon.h>
#include "WinInterface.h"
#include "License.h"
#include "Tools.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
static UnicodeString LicenseStr[2] =
{ L"LICENSE", L"LICENSE_EXPAT" };
//---------------------------------------------------------------------------
void __fastcall DoLicenseDialog(TLicense License)
{
TLicenseDialog * LicenseDialog = NULL;
try
{
LicenseDialog = new TLicenseDialog(Application, License);
LicenseDialog->ShowModal();
}
__finally
{
delete LicenseDialog;
}
}
//---------------------------------------------------------------------------
__fastcall TLicenseDialog::TLicenseDialog(TComponent * Owner, TLicense License)
: TForm(Owner)
{
UseSystemSettings(this);
TStrings * LicenseList = new TStringList();
try
{
LicenseList->Text = ReadResource(LicenseStr[License]);
DebugAssert(LicenseList->Count > 0);
Caption = FMTLOAD(LICENSE_CAPTION, (LicenseList->Strings[0]));
LicenseList->Delete(0);
LicenseMemo->Lines->Text = LicenseList->Text;
}
__finally
{
delete LicenseList;
}
}