[Libreoffice-commits] core.git: shell/source

Caolán McNamara caolanm at redhat.com
Wed Mar 11 10:14:42 PDT 2015


 shell/source/win32/shlxthandler/columninfo/columninfo.cxx |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit 6617505ee19cd0fa1f19815f5a736755e488beae
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Mar 11 17:12:27 2015 +0000

    V512: we want the number of wide-chars here, not the number of bytes
    
    Change-Id: I121cdfd586562b9ce298448f51d0b2e3b2a52c39

diff --git a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
index 6f4129e..9eeb252 100644
--- a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
+++ b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx
@@ -110,10 +110,7 @@ HRESULT STDMETHODCALLTYPE CColumnInfo::Initialize(LPCSHCOLUMNINIT /*psci*/)
     return S_OK;
 }
 
-
 // Register all columns we support
-
-
 HRESULT STDMETHODCALLTYPE CColumnInfo::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci)
 {
     if (dwIndex >= ColumnInfoTableSize)
@@ -126,14 +123,12 @@ HRESULT STDMETHODCALLTYPE CColumnInfo::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO
     psci->scid.fmtid = ColumnInfoTable[dwIndex].scid.fmtid;
     psci->scid.pid   = ColumnInfoTable[dwIndex].scid.pid;
     ZeroMemory(psci->wszTitle, sizeof(psci->wszTitle));
-    wcsncpy(psci->wszTitle, ColumnInfoTable[dwIndex].wszTitle, (sizeof(psci->wszTitle) - 1));
-
+    wcsncpy(psci->wszTitle, ColumnInfoTable[dwIndex].wszTitle,
+            (sizeof(psci->wszTitle) / sizeof(psci->wszTitle[0]) - 1));
 
     return S_OK;
 }
 
-
-
 HRESULT STDMETHODCALLTYPE CColumnInfo::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData)
 {
     if (IsOOFileExtension(pscd->pwszExt))


More information about the Libreoffice-commits mailing list