Index: src/ch/PropertyListCtrl.cpp =================================================================== diff -u -r4c272b19c74694c428c943011f279ec064fbd894 -rb6b8ac5b0a1ab85b4ac788e5429be860d2f20bd5 --- src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision 4c272b19c74694c428c943011f279ec064fbd894) +++ src/ch/PropertyListCtrl.cpp (.../PropertyListCtrl.cpp) (revision b6b8ac5b0a1ab85b4ac788e5429be860d2f20bd5) @@ -1,23 +1,21 @@ -/************************************************************************ - Copy Handler 1.x - program for copying data in Microsoft Windows - systems. - Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) - - 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 2 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*************************************************************************/ - +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* 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 Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ #include "stdafx.h" #include "ch.h" #include "PropertyListCtrl.h" @@ -991,18 +989,30 @@ { case ID_PROPERTY_BOOL: case ID_PROPERTY_COMBO_LIST: - pDC->DrawText( m_pCurDrawItem->csProperties.GetAt(m_pCurDrawItem->nPropertySelected), m_pCurDrawItem->csProperties.GetAt(m_pCurDrawItem->nPropertySelected).GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); + { + CString strText; + INT_PTR iCount = m_pCurDrawItem->csProperties.GetCount(); + if(m_pCurDrawItem->nPropertySelected >= 0 && m_pCurDrawItem->nPropertySelected < iCount) + strText = m_pCurDrawItem->csProperties.GetAt(m_pCurDrawItem->nPropertySelected); + + pDC->DrawText( strText, strText.GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); break; + } case ID_PROPERTY_TEXT: case ID_PROPERTY_PATH: case ID_PROPERTY_DIR: case ID_PROPERTY_CUSTOM: - pDC->DrawText( m_pCurDrawItem->csProperties.GetAt(0), m_pCurDrawItem->csProperties.GetAt(0).GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); - break; case ID_PROPERTY_STATIC: - pDC->DrawText( m_pCurDrawItem->csProperties.GetAt(0), m_pCurDrawItem->csProperties.GetAt(0).GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); + { + CString strText; + INT_PTR iCount = m_pCurDrawItem->csProperties.GetCount(); + if(iCount > 0) + strText = m_pCurDrawItem->csProperties.GetAt(0); + + pDC->DrawText( strText, strText.GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); break; + } case ID_PROPERTY_FONT: if(m_pCurDrawItem->LogFont.lfHeight)