Skip to content

Commit

Permalink
Added PVS-Studio comments.
Browse files Browse the repository at this point in the history
Bumped version 1.0.0.8.
Added lang-file structure preservation.
  • Loading branch information
raspopov committed Mar 23, 2017
1 parent cb4d02b commit aa856fd
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 235 deletions.
98 changes: 50 additions & 48 deletions BrowseCtrl.cpp
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
/*
Polang
Copyright (C) 2017 Nikolay Raspopov <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "stdafx.h"
#include "Polang.h"
#include "BrowseCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CBrowseCtrl

IMPLEMENT_DYNAMIC(CBrowseCtrl, CMFCEditBrowseCtrl)

BEGIN_MESSAGE_MAP(CBrowseCtrl, CMFCEditBrowseCtrl)
ON_WM_DROPFILES()
END_MESSAGE_MAP()

// CBrowseCtrl message handlers

void CBrowseCtrl::OnDropFiles( HDROP hDropInfo )
{
TCHAR szItem[ 1024 ] = {};
if ( DragQueryFile( hDropInfo, 0, szItem, _countof( szItem ) ) && ( GetFileAttributes( szItem ) & FILE_ATTRIBUTE_DIRECTORY ) == 0 )
{
SetWindowText( szItem );
}

DragFinish( hDropInfo );
}
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
/*
Polang
Copyright (C) 2017 Nikolay Raspopov <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "stdafx.h"
#include "Polang.h"
#include "BrowseCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CBrowseCtrl

IMPLEMENT_DYNAMIC(CBrowseCtrl, CMFCEditBrowseCtrl)

BEGIN_MESSAGE_MAP(CBrowseCtrl, CMFCEditBrowseCtrl)
ON_WM_DROPFILES()
END_MESSAGE_MAP()

// CBrowseCtrl message handlers

void CBrowseCtrl::OnDropFiles( HDROP hDropInfo )
{
TCHAR szItem[ 1024 ] = {};
if ( DragQueryFile( hDropInfo, 0, szItem, _countof( szItem ) ) && ( GetFileAttributes( szItem ) & FILE_ATTRIBUTE_DIRECTORY ) == 0 )
{
SetWindowText( szItem );
}

DragFinish( hDropInfo );
}
130 changes: 66 additions & 64 deletions Polang.cpp
Original file line number Diff line number Diff line change
@@ -1,64 +1,66 @@
/*
Polang
Copyright (C) 2017 Nikolay Raspopov <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "stdafx.h"
#include "Polang.h"
#include "PolangDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CPolangApp

BEGIN_MESSAGE_MAP(CPolangApp, CWinAppEx)
END_MESSAGE_MAP()

// CPolangApp construction

CPolangApp::CPolangApp()
{
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
}

// The one and only CPolangApp object

CPolangApp theApp;

// CPolangApp initialization

BOOL CPolangApp::InitInstance()
{
INITCOMMONCONTROLSEX InitCtrls = { sizeof( InitCtrls ), ICC_WIN95_CLASSES };
InitCommonControlsEx( &InitCtrls );

CWinApp::InitInstance();

// Activate "Windows Native" visual manager for enabling themes in MFC controls
CMFCVisualManager::SetDefaultManager( RUNTIME_CLASS( CMFCVisualManagerWindows ) );

SetRegistryKey( AFX_IDS_COMPANY_NAME );

CPolangDlg dlg;
m_pMainWnd = &dlg;
dlg.DoModal();

return FALSE;
}
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
/*
Polang
Copyright (C) 2017 Nikolay Raspopov <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "stdafx.h"
#include "Polang.h"
#include "PolangDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CPolangApp

BEGIN_MESSAGE_MAP(CPolangApp, CWinAppEx)
END_MESSAGE_MAP()

// CPolangApp construction

CPolangApp::CPolangApp()
{
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
}

// The one and only CPolangApp object

CPolangApp theApp;

// CPolangApp initialization

BOOL CPolangApp::InitInstance()
{
INITCOMMONCONTROLSEX InitCtrls = { sizeof( InitCtrls ), ICC_WIN95_CLASSES };
InitCommonControlsEx( &InitCtrls );

CWinApp::InitInstance();

// Activate "Windows Native" visual manager for enabling themes in MFC controls
CMFCVisualManager::SetDefaultManager( RUNTIME_CLASS( CMFCVisualManagerWindows ) );

SetRegistryKey( AFX_IDS_COMPANY_NAME );

CPolangDlg dlg;
m_pMainWnd = &dlg;
dlg.DoModal();

return FALSE;
}
100 changes: 50 additions & 50 deletions Polang.h
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
/*
Polang
Copyright (C) 2017 Nikolay Raspopov <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif

#include "resource.h" // main symbols


// CPolangApp

class CPolangApp : public CWinAppEx
{
public:
CPolangApp();

protected:
virtual BOOL InitInstance();

DECLARE_MESSAGE_MAP()
};

extern CPolangApp theApp;

inline CString LoadString(UINT nId)
{
CString str;
str.LoadString( nId );
return str;
}
/*
Polang
Copyright (C) 2017 Nikolay Raspopov <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif

#include "resource.h" // main symbols


// CPolangApp

class CPolangApp : public CWinAppEx
{
public:
CPolangApp();

protected:
virtual BOOL InitInstance();

DECLARE_MESSAGE_MAP()
};

extern CPolangApp theApp;

inline CString LoadString(UINT nId)
{
CString str;
VERIFY( str.LoadString( nId ) );
return str;
}
Binary file modified Polang.rc
Binary file not shown.
Loading

0 comments on commit aa856fd

Please sign in to comment.