OSDN Git Service

PATCH: [ 1804762 ] UI translation without compiled lang files
authorKimmo Varis <kimmov@gmail.com>
Sun, 14 Oct 2007 18:50:24 +0000 (18:50 +0000)
committerKimmo Varis <kimmov@gmail.com>
Sun, 14 Oct 2007 18:50:24 +0000 (18:50 +0000)
 Fix compile with VS2003

Src/DiffWrapper.cpp
Src/DirViewColHandler.cpp
Src/FileFiltersDlg.cpp
Src/FolderCmp.cpp
Src/paths.cpp

index 35ce086..ca0e668 100644 (file)
@@ -1289,7 +1289,7 @@ void CDiffWrapper::SetFilterList(LPCTSTR filterStr)
        FilterList::EncodingType type;
        
 #ifdef UNICODE
-       regexp_str = UCS2UTF8_ConvertToUtf8(filterStr.c_str());
+       regexp_str = UCS2UTF8_ConvertToUtf8(filterStr);
        type = FilterList::ENC_UTF8;
 #else
        CString tmp_str(filterStr);
index 0afabd5..7631cf2 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @date  Created: 2003-08-19
  */
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
 // $Id$
 
 
@@ -31,17 +31,23 @@ static char THIS_FILE[] = __FILE__;
 
 
 /**
- * @brief Get text for specified column (forwards to specific column handler)
+ * @brief Get text for specified column.
+ * This function retrieves the text for the specified colum. Text is
+ * retrieved by using column-specific handler functions.
+ * @param [in] pCtxt Compare context.
+ * @param [in] col Column number.
+ * @param [in] di Difference data.
+ * @return Text for the specified column.
  */
-String
-CDirView::ColGetTextToDisplay(const CDiffContext *pCtxt, int col, const DIFFITEM & di)
+String CDirView::ColGetTextToDisplay(const CDiffContext *pCtxt, int col,
+               const DIFFITEM & di)
 {
        // Custom properties have custom get functions
        const DirColInfo * pColInfo = DirViewColItems_GetDirColInfo(col);
        if (!pColInfo)
        {
                ASSERT(0); // fix caller, should not ask for nonexistent columns
-               return "???";
+               return _T("???");
        }
        ColGetFncPtrType fnc = pColInfo->getfnc;
        SIZE_T offset = pColInfo->offset;
@@ -49,10 +55,17 @@ CDirView::ColGetTextToDisplay(const CDiffContext *pCtxt, int col, const DIFFITEM
 }
 
 /**
- * @brief Sort two items on specified column (forwards to specific column handler)
+ * @brief Sort two items on specified column.
+ * This function determines order of two items in specified column. Order
+ * is determined by column-specific functions.
+ * @param [in] pCtxt Compare context.
+ * @param [in] col Column number to sort.
+ * @param [in] ldi Left difference item data.
+ * @param [in] rdi Right difference item data.
+ * @return Order of items.
  */
-int
-CDirView::ColSort(const CDiffContext *pCtxt, int col, const DIFFITEM & ldi, const DIFFITEM &rdi) const
+int CDirView::ColSort(const CDiffContext *pCtxt, int col, const DIFFITEM & ldi,
+               const DIFFITEM & rdi) const
 {
        // Custom properties have custom sort functions
        const DirColInfo * pColInfo = DirViewColItems_GetDirColInfo(col);
index b9b0602..9dbdc69 100644 (file)
@@ -393,7 +393,7 @@ void FileFiltersDlg::OnBnClickedFilterfileNewbutton()
        // Format path to template file
        String templatePath(globalPath);
        if (templatePath[templatePath.length() - 1] != '\\')
-               templatePath += "\\";
+               templatePath += '\\';
        templatePath += FILE_FILTER_TEMPLATE;
 
        if (paths_DoesPathExist(templatePath.c_str()) != IS_EXISTING_FILE)
index 6eb162f..087a31e 100644 (file)
@@ -49,7 +49,9 @@ bool FolderCmp::RunPlugins(CDiffContext * pCtxt, PluginsContext * plugCtxt, CStr
 
        // Transformation happens here
        // text used for automatic mode : plugin filter must match it
-       String filteredFilenames = plugCtxt->origFileName1 + "|" + plugCtxt->origFileName2;
+       String filteredFilenames(plugCtxt->origFileName1);
+       filteredFilenames += '|';
+       filteredFilenames += plugCtxt->origFileName2;
 
        // Get existing or new plugin infos
        pCtxt->FetchPluginInfos(filteredFilenames.c_str(), &plugCtxt->infoUnpacker,
index ca570ec..63eec99 100644 (file)
@@ -3,7 +3,7 @@
  *
  * @brief Path handling routines
  */
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
 // $Id$
 
 #include "stdafx.h"
@@ -219,7 +219,6 @@ String paths_GetLongPath(LPCTSTR szPath, BOOL bExpandEnvs)
        *end = 0;
        sLong += ptr;
        ptr = &end[1];
-       String sTemp; // used at each step to hold fully qualified short name
 
        // now walk down each directory and do short to long name conversion
        while (ptr)
@@ -230,7 +229,9 @@ String paths_GetLongPath(LPCTSTR szPath, BOOL bExpandEnvs)
                if (end)
                        *end = 0;
 
-               sTemp = sLong + '\\' + ptr;
+               String sTemp(sLong);
+               sTemp += '\\';
+               sTemp += ptr;
 
                // advance to next component (or set ptr==0 to flag end)
                ptr = (end ? end+1 : 0);