Skip to content

Commit

Permalink
Merge d2e7a1e into fab295e
Browse files Browse the repository at this point in the history
  • Loading branch information
beru authored May 19, 2021
2 parents fab295e + d2e7a1e commit 83ad28c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 90 deletions.
8 changes: 4 additions & 4 deletions sakura_core/dlg/CDlgJump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ void CDlgJump::SetData( void )
if( m_pShareData->m_bLineNumIsCRLF_ForJump ){ /* 行番号の表示 false=折り返し単位/true=改行単位 */
auto_sprintf( szText, LS(STR_DLGJUMP_PSLQL),
cFuncInfoArr.GetAt( i )->m_nFuncLineCRLF,
cFuncInfoArr.GetAt( i )->m_cmemFuncName.GetStringPtr()
cFuncInfoArr.GetAt( i )->m_cmemFuncName.c_str()
);
}else{
auto_sprintf( szText, LS(STR_DLGJUMP_PSLQL),
cFuncInfoArr.GetAt( i )->m_nFuncLineLAYOUT,
cFuncInfoArr.GetAt( i )->m_cmemFuncName.GetStringPtr()
cFuncInfoArr.GetAt( i )->m_cmemFuncName.c_str()
);
}
nIndex = Combo_AddString( hwndCtrl, szText );
Expand All @@ -278,12 +278,12 @@ void CDlgJump::SetData( void )
if( m_pShareData->m_bLineNumIsCRLF_ForJump ){ /* 行番号の表示 false=折り返し単位/true=改行単位 */
auto_sprintf( szText, LS(STR_DLGJUMP_PSLQL),
cFuncInfoArr.GetAt( i )->m_nFuncLineCRLF,
cFuncInfoArr.GetAt( i )->m_cmemFuncName.GetStringPtr()
cFuncInfoArr.GetAt( i )->m_cmemFuncName.c_str()
);
}else{
auto_sprintf( szText, LS(STR_DLGJUMP_PSLQL),
cFuncInfoArr.GetAt( i )->m_nFuncLineLAYOUT,
cFuncInfoArr.GetAt( i )->m_cmemFuncName.GetStringPtr()
cFuncInfoArr.GetAt( i )->m_cmemFuncName.c_str()
);
}
nIndexCurSel = nIndex = Combo_AddString( hwndCtrl, szText );
Expand Down
44 changes: 22 additions & 22 deletions sakura_core/outline/CDlgFuncList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int CALLBACK CDlgFuncList::CompareFunc_Asc( LPARAM lParam1, LPARAM lParam2, LPAR
}
// Apr. 23, 2005 genta 行番号を左端へ
if( FL_COL_NAME == pcDlgFuncList->m_nSortCol){ /* 名前でソート */
return wmemicmp( pcFuncInfo1->m_cmemFuncName.GetStringPtr(), pcFuncInfo2->m_cmemFuncName.GetStringPtr() );
return wmemicmp( pcFuncInfo1->m_cmemFuncName.c_str(), pcFuncInfo2->m_cmemFuncName.c_str() );
}
// Apr. 23, 2005 genta 行番号を左端へ
if( FL_COL_ROW == pcDlgFuncList->m_nSortCol){ /* 行(+桁)でソート */
Expand Down Expand Up @@ -561,7 +561,7 @@ void CDlgFuncList::SetData()
int nBuffLen = 0;
for(int i = 0; i < nNum; ++i ){
const CFuncInfo* pcFuncInfo = m_pcFuncInfoArr->GetAt(i);
nBuffLen += pcFuncInfo->m_cmemFuncName.GetStringLength();
nBuffLen += pcFuncInfo->m_cmemFuncName.size();
}
m_cmemClipText.AllocStringBuffer( nBuffLen + nBuffLenTag * nNum );
}
Expand Down Expand Up @@ -600,7 +600,7 @@ void CDlgFuncList::SetData()
ListView_SetItem( hwndList, &item);

item.mask = LVIF_TEXT;
item.pszText = const_cast<WCHAR*>(pcFuncInfo->m_cmemFuncName.GetStringPtr());
item.pszText = const_cast<WCHAR*>(pcFuncInfo->m_cmemFuncName.c_str());
item.iItem = i;
item.iSubItem = FL_COL_NAME;
ListView_SetItem( hwndList, &item);
Expand Down Expand Up @@ -638,7 +638,7 @@ void CDlgFuncList::SetData()
);
m_cmemClipText.AppendString(szText);
// "%s(%s)\r\n"
m_cmemClipText.AppendNativeData(pcFuncInfo->m_cmemFuncName);
m_cmemClipText.AppendString(pcFuncInfo->m_cmemFuncName.c_str());
m_cmemClipText.AppendString(L"(");
m_cmemClipText.AppendString(item.pszText);
m_cmemClipText.AppendString(L")\r\n");
Expand All @@ -652,7 +652,7 @@ void CDlgFuncList::SetData()
pcFuncInfo->m_nFuncColCRLF /* 検出桁番号 */
);
m_cmemClipText.AppendString(szText);
m_cmemClipText.AppendNativeData(pcFuncInfo->m_cmemFuncName);
m_cmemClipText.AppendString(pcFuncInfo->m_cmemFuncName.c_str());
m_cmemClipText.AppendString(L"\r\n");
}
}
Expand Down Expand Up @@ -775,7 +775,7 @@ bool CDlgFuncList::GetTreeFileFullName(HWND hwndTree, HTREEITEM target, std::wst
TreeView_GetItem( hwndTree, &tvItem );
if( ((-tvItem.lParam) % 10) == 3 ){
*pnItem = (-tvItem.lParam) / 10;
std::wstring path = m_pcFuncInfoArr->GetAt(*pnItem)->m_cmemFileName.GetStringPtr();
std::wstring path = m_pcFuncInfoArr->GetAt(*pnItem)->m_cmemFileName;
path += L"\\";
path += *pPath;
*pPath = path;
Expand Down Expand Up @@ -928,7 +928,7 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, HTREEITEM hInsertAfter, BOOL bAddC
int nBuffLen = 0;
for( int i = 0; i < nNum; i++ ){
const CFuncInfo* pcFuncInfo = m_pcFuncInfoArr->GetAt(i);
nBuffLen += pcFuncInfo->m_cmemFuncName.GetStringLength();
nBuffLen += pcFuncInfo->m_cmemFuncName.size();
}
m_cmemClipText.AllocStringBuffer( nBuffLen + nBuffLenTag * nNum );
}
Expand All @@ -947,7 +947,7 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, HTREEITEM hInsertAfter, BOOL bAddC
bSelected = FALSE;
for( i = 0; i < m_pcFuncInfoArr->GetNum(); ++i ){
pcFuncInfo = m_pcFuncInfoArr->GetAt( i );
const WCHAR* pWork = pcFuncInfo->m_cmemFuncName.GetStringPtr();
const WCHAR* pWork = pcFuncInfo->m_cmemFuncName.c_str();
int m = 0;
vStrClasses.clear();
nClassNest = 0;
Expand Down Expand Up @@ -1146,7 +1146,7 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, HTREEITEM hInsertAfter, BOOL bAddC
);
m_cmemClipText.AppendString( szText ); /* クリップボードコピー用テキスト */
// "%s%ls\r\n"
m_cmemClipText.AppendNativeData(pcFuncInfo->m_cmemFuncName);
m_cmemClipText.AppendNativeData(pcFuncInfo->m_cmemFuncName.c_str());
m_cmemClipText.AppendString(FL_OBJ_DECLARE == pcFuncInfo->m_nInfo ? m_pcFuncInfoArr->GetAppendText( FL_OBJ_DECLARE ).c_str() : L"" ); // Jan. 04, 2001 genta C++で使用
m_cmemClipText.AppendString(L"\r\n");

Expand Down Expand Up @@ -1194,7 +1194,7 @@ void CDlgFuncList::SetListVB (void)
int nBuffLen = 0;
for( int i = 0; i < nNum; i++ ){
const CFuncInfo* pcFuncInfo = m_pcFuncInfoArr->GetAt(i);
nBuffLen += pcFuncInfo->m_cmemFuncName.GetStringLength();
nBuffLen += pcFuncInfo->m_cmemFuncName.size();
}
m_cmemClipText.AllocStringBuffer( nBuffLen + nBuffLenTag * nNum );
}
Expand Down Expand Up @@ -1232,7 +1232,7 @@ void CDlgFuncList::SetListVB (void)
ListView_SetItem( hwndList, &item);

item.mask = LVIF_TEXT;
item.pszText = const_cast<WCHAR*>(pcFuncInfo->m_cmemFuncName.GetStringPtr());
item.pszText = const_cast<WCHAR*>(pcFuncInfo->m_cmemFuncName.c_str());
item.iItem = i;
item.iSubItem = FL_COL_NAME;
ListView_SetItem( hwndList, &item);
Expand Down Expand Up @@ -1336,7 +1336,7 @@ void CDlgFuncList::SetListVB (void)
);
m_cmemClipText.AppendString(szText);
// "%s(%s)\r\n"
m_cmemClipText.AppendNativeData(pcFuncInfo->m_cmemFuncName);
m_cmemClipText.AppendNativeData(pcFuncInfo->m_cmemFuncName.c_str());
m_cmemClipText.AppendString(L"(");
m_cmemClipText.AppendString(item.pszText);
m_cmemClipText.AppendString(L")\r\n");
Expand All @@ -1351,7 +1351,7 @@ void CDlgFuncList::SetListVB (void)
);
m_cmemClipText.AppendString(szText);
// "%s\r\n"
m_cmemClipText.AppendNativeData(pcFuncInfo->m_cmemFuncName);
m_cmemClipText.AppendNativeData(pcFuncInfo->m_cmemFuncName.c_str());
m_cmemClipText.AppendString(L"\r\n");
}
}
Expand Down Expand Up @@ -1405,7 +1405,7 @@ void CDlgFuncList::SetTree(HTREEITEM hInsertAfter, bool tagjump, bool nolabel)
for( int i = 0; i < nFuncInfoArrNum; i++ ){
const CFuncInfo* pcFuncInfo = m_pcFuncInfoArr->GetAt(i);
if( pcFuncInfo->IsAddClipText() ){
nBuffLen += pcFuncInfo->m_cmemFuncName.GetStringLength() + pcFuncInfo->m_nDepth * 2;
nBuffLen += pcFuncInfo->m_cmemFuncName.size() + pcFuncInfo->m_nDepth * 2;
nCount++;
}
}
Expand All @@ -1423,7 +1423,7 @@ void CDlgFuncList::SetTree(HTREEITEM hInsertAfter, bool tagjump, bool nolabel)
cTVInsertStruct.hParent = phParentStack[ nStackPointer ];
cTVInsertStruct.hInsertAfter = hInsertAfter;
cTVInsertStruct.item.mask = TVIF_TEXT | TVIF_PARAM;
cTVInsertStruct.item.pszText = pcFuncInfo->m_cmemFuncName.GetStringPtr();
cTVInsertStruct.item.pszText = const_cast<WCHAR*>(pcFuncInfo->m_cmemFuncName.c_str());
cTVInsertStruct.item.lParam = i; // あとでこの数値(=m_pcFuncInfoArrの何番目のアイテムか)を見て、目的地にジャンプするぜ!!。

/* 親子関係をチェック
Expand Down Expand Up @@ -1455,12 +1455,12 @@ void CDlgFuncList::SetTree(HTREEITEM hInsertAfter, bool tagjump, bool nolabel)
if( pcFuncInfo->IsAddClipText() ){
CNativeW text;
if( tagjump ){
const WCHAR* pszFileName = pcFuncInfo->m_cmemFileName.GetStringPtr();
const WCHAR* pszFileName = pcFuncInfo->m_cmemFileName.c_str();
if( pszFileName == NULL ){
pszFileName = m_pcFuncInfoArr->m_szFilePath;
}
text.AllocStringBuffer(
pcFuncInfo->m_cmemFuncName.GetStringLength()
pcFuncInfo->m_cmemFuncName.size()
+ nStackPointer * 2 + 1
+ wcslen( pszFileName )
+ 20
Expand All @@ -1484,7 +1484,7 @@ void CDlgFuncList::SetTree(HTREEITEM hInsertAfter, bool tagjump, bool nolabel)
}
text.AppendString(L" ");

text.AppendNativeData( pcFuncInfo->m_cmemFuncName );
text.AppendNativeData( pcFuncInfo->m_cmemFuncName.c_str() );
}
text.AppendString( L"\r\n" );
m_cmemClipText.AppendNativeData( text ); /* クリップボードコピー用テキスト */
Expand Down Expand Up @@ -2464,15 +2464,15 @@ BOOL CDlgFuncList::OnJump( bool bCheckAutoClose, bool bFileJump ) //2002.02.08 h
bFileJumpSelf = TagJumpTimer(m_sJumpFile.c_str(), poCaret, bCheckAutoClose);
}
}else
if( m_cFuncInfo != NULL && 0 < m_cFuncInfo->m_cmemFileName.GetStringLength() ){
if( m_cFuncInfo != NULL && 0 < m_cFuncInfo->m_cmemFileName.size() ){
if( bFileJump ){
nLineTo = m_cFuncInfo->m_nFuncLineCRLF;
nColTo = m_cFuncInfo->m_nFuncColCRLF;
// 別のファイルへジャンプ
CMyPoint poCaret; // TagJumpSubも1開始
poCaret.x = nColTo;
poCaret.y = nLineTo;
bFileJumpSelf = TagJumpTimer(m_cFuncInfo->m_cmemFileName.GetStringPtr(), poCaret, bCheckAutoClose);
bFileJumpSelf = TagJumpTimer(m_cFuncInfo->m_cmemFileName.c_str(), poCaret, bCheckAutoClose);
}
}else{
nLineTo = m_cFuncInfo->m_nFuncLineCRLF;
Expand Down Expand Up @@ -4091,8 +4091,8 @@ bool CDlgFuncList::GetFuncInfoIndex( CLayoutInt nCurLine, CLayoutInt nCurCol, in
for( i = 0; i < m_pcFuncInfoArr->GetNum(); ++i ){
pcFuncInfo = m_pcFuncInfoArr->GetAt( i );

if( (pcFuncInfo->m_cmemFileName.GetStringPtr() && m_pcFuncInfoArr->m_szFilePath[0]) ){
if( 0 != wmemicmp( pcFuncInfo->m_cmemFileName.GetStringPtr(), m_pcFuncInfoArr->m_szFilePath.c_str() ) ){
if( (!pcFuncInfo->m_cmemFileName.empty() && m_pcFuncInfoArr->m_szFilePath[0]) ){
if( 0 != wmemicmp( pcFuncInfo->m_cmemFileName.c_str(), m_pcFuncInfoArr->m_szFilePath.c_str() ) ){
continue;
}
}
Expand Down
10 changes: 5 additions & 5 deletions sakura_core/outline/CFuncInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ CFuncInfo::CFuncInfo(
CLayoutInt nFuncColLAYOUT, //!< 関数のある桁(折り返し単位)
const WCHAR* pszFuncName, //!< 関数名
const WCHAR* pszFileName,
int nInfo //!< 付加情報
int nInfo, //!< 付加情報
int nDepth //!< 深さ
)
: m_nDepth(0) // 深さ
{
m_nFuncLineCRLF = nFuncLineCRLF; /* 関数のある行(CRLF単位) */
m_nFuncColCRLF = nFuncColCRLF; /* 関数のある桁(CRLF単位) */
m_nFuncLineLAYOUT = nFuncLineLAYOUT; /* 関数のある行(折り返し単位) */
m_nFuncColLAYOUT = nFuncColLAYOUT; /* 関数のある桁(折り返し単位) */
m_cmemFuncName.SetString( pszFuncName );
m_cmemFuncName = pszFuncName;
if( pszFileName ){
m_cmemFileName.SetString( pszFileName );
m_cmemFileName = pszFileName;
}

m_nInfo = nInfo;
m_nDepth = nDepth;
return;
}

Expand Down
6 changes: 3 additions & 3 deletions sakura_core/outline/CFuncInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CFuncInfo {
CFuncInfo( CLogicInt nFuncLineCRLF, CLogicInt nFuncColCRLF,
CLayoutInt nFuncLineLAYOUT, CLayoutInt nFuncColLAYOUT,
const WCHAR* pszFuncName, const WCHAR* pszFileName,
int nInfo ); /* CFuncInfoクラス構築 */
int nInfo, int nDepth ); /* CFuncInfoクラス構築 */
~CFuncInfo(); /* CFuncInfoクラス消滅 */

//! クリップボードに追加する要素か?
Expand All @@ -49,8 +49,8 @@ class CFuncInfo {
CLayoutInt m_nFuncLineLAYOUT; /*!< 関数のある行(折り返し単位) */
CLogicInt m_nFuncColCRLF; /*!< 関数のある桁(CRLF単位) */
CLayoutInt m_nFuncColLAYOUT; /*!< 関数のある桁(折り返し単位) */
CNativeW m_cmemFuncName; /*!< 関数名 */
CNativeW m_cmemFileName; /*!< ファイル名 */
std::wstring m_cmemFuncName; /*!< 関数名 */
std::wstring m_cmemFileName; /*!< ファイル名 */
int m_nInfo; /*!< 付加情報 */
int m_nDepth; /*!< 深さ */
};
Expand Down
63 changes: 14 additions & 49 deletions sakura_core/outline/CFuncInfoArr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,9 @@
#include "outline/CFuncInfoArr.h"
#include "outline/CFuncInfo.h"

/* CFuncInfoArrクラス構築 */
CFuncInfoArr::CFuncInfoArr()
void CFuncInfoArr::Empty(void)
{
m_nFuncInfoArrNum = 0; /* 配列要素数 */
m_ppcFuncInfoArr = NULL; /* 配列 */
m_nAppendTextLenMax = 0;
return;
}

/* CFuncInfoArrクラス消滅 */
CFuncInfoArr::~CFuncInfoArr()
{
Empty();
return;
}

void CFuncInfoArr::Empty( void )
{
int i;
if( m_nFuncInfoArrNum > 0 && NULL != m_ppcFuncInfoArr ){
for( i = 0; i < m_nFuncInfoArrNum; ++i ){
delete m_ppcFuncInfoArr[i];
m_ppcFuncInfoArr[i] = NULL;
}
m_nFuncInfoArrNum = 0;
free( m_ppcFuncInfoArr );
m_ppcFuncInfoArr = NULL;
}
m_cFuncInfoArr.clear();
m_AppendTextArr.clear();
m_nAppendTextLenMax = 0;
return;
Expand All @@ -55,23 +30,16 @@ void CFuncInfoArr::Empty( void )
/* データがない場合はNULLを返す */
CFuncInfo* CFuncInfoArr::GetAt( int nIdx )
{
if( nIdx >= m_nFuncInfoArrNum ){
if( nIdx >= m_cFuncInfoArr.size() ){
return NULL;
}
return m_ppcFuncInfoArr[nIdx];
return &m_cFuncInfoArr[nIdx];
}

/*! 配列の最後にデータを追加する */
void CFuncInfoArr::AppendData( CFuncInfo* pcFuncInfo )
void CFuncInfoArr::AppendData( CFuncInfo&& cFuncInfo )
{
if( 0 == m_nFuncInfoArrNum){
m_ppcFuncInfoArr = (CFuncInfo**)malloc( sizeof(CFuncInfo*) * (m_nFuncInfoArrNum + 1) );
}else{
m_ppcFuncInfoArr = (CFuncInfo**)realloc( m_ppcFuncInfoArr, sizeof(CFuncInfo*) * (m_nFuncInfoArrNum + 1) );
}
m_ppcFuncInfoArr[m_nFuncInfoArrNum] = pcFuncInfo;
m_nFuncInfoArrNum++;
return;
m_cFuncInfoArr.emplace_back(cFuncInfo);
}

/*! 配列の最後にデータを追加する
Expand All @@ -89,10 +57,8 @@ void CFuncInfoArr::AppendData(
int nDepth //!< 深さ
)
{
CFuncInfo* pcFuncInfo = new CFuncInfo( nFuncLineCRLF, nFuncColCRLF, nFuncLineLAYOUT, nFuncColLAYOUT,
pszFuncName, pszFileName, nInfo );
pcFuncInfo->m_nDepth = nDepth;
AppendData( pcFuncInfo );
AppendData(CFuncInfo(nFuncLineCRLF, nFuncColCRLF, nFuncLineLAYOUT, nFuncColLAYOUT,
pszFuncName, pszFileName, nInfo, nDepth));
return;
}

Expand All @@ -113,14 +79,13 @@ void CFuncInfoArr::DUMP( void )
#ifdef _DEBUG
int i;
MYTRACE( L"=============================\n" );
for( i = 0; i < m_nFuncInfoArrNum; i++ ){
for( i = 0; i < m_cFuncInfoArr.size(); i++ ){
MYTRACE( L"[%d]------------------\n", i );
MYTRACE( L"m_nFuncLineCRLF =%d\n", m_ppcFuncInfoArr[i]->m_nFuncLineCRLF );
MYTRACE( L"m_nFuncLineLAYOUT =%d\n", m_ppcFuncInfoArr[i]->m_nFuncLineLAYOUT );
MYTRACE( L"m_cmemFuncName =[%s]\n", m_ppcFuncInfoArr[i]->m_cmemFuncName.GetStringPtr() );
MYTRACE( L"m_cmemFileName =[%s]\n",
(m_ppcFuncInfoArr[i]->m_cmemFileName.GetStringPtr() ? m_ppcFuncInfoArr[i]->m_cmemFileName.GetStringPtr() : L"NULL") );
MYTRACE( L"m_nInfo =%d\n", m_ppcFuncInfoArr[i]->m_nInfo );
MYTRACE( L"m_nFuncLineCRLF =%d\n", m_cFuncInfoArr[i].m_nFuncLineCRLF );
MYTRACE( L"m_nFuncLineLAYOUT =%d\n", m_cFuncInfoArr[i].m_nFuncLineLAYOUT );
MYTRACE( L"m_cmemFuncName =[%s]\n", m_cFuncInfoArr[i].m_cmemFuncName.c_str() );
MYTRACE( L"m_cmemFileName =[%s]\n", m_cFuncInfoArr[i].m_cmemFileName.c_str() );
MYTRACE( L"m_nInfo =%d\n", m_cFuncInfoArr[i].m_nInfo );
}
MYTRACE( L"=============================\n" );
#endif
Expand Down
Loading

0 comments on commit 83ad28c

Please sign in to comment.