From 75ff1ae0ae9491cc90f16bd8e37df1fa5c13795f Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Fri, 28 May 1999 00:40:18 +0000 Subject: [PATCH] #3930 "file selection control displays complete path" git-svn-id: svn://10.0.0.236/trunk@33060 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsFileControlFrame.cpp | 6 +++++- mozilla/layout/html/forms/src/nsFileControlFrame.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 42e46dd75f4..9b11a653958 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -163,7 +163,11 @@ void nsFileControlFrame::MouseClicked(nsIPresContext* aPresContext) if (result) { nsFileSpec fileSpec; fileWidget->GetFile(fileSpec); - mTextFrame->SetProperty(nsHTMLAtoms::value,fileSpec.GetNativePathCString()); + char* leafName = fileSpec.GetLeafName(); + if (leafName) { + mTextFrame->SetProperty(nsHTMLAtoms::value,leafName); + nsCRT::free(leafName); + } } NS_RELEASE(fileWidget); } diff --git a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp index 42e46dd75f4..9b11a653958 100644 --- a/mozilla/layout/html/forms/src/nsFileControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFileControlFrame.cpp @@ -163,7 +163,11 @@ void nsFileControlFrame::MouseClicked(nsIPresContext* aPresContext) if (result) { nsFileSpec fileSpec; fileWidget->GetFile(fileSpec); - mTextFrame->SetProperty(nsHTMLAtoms::value,fileSpec.GetNativePathCString()); + char* leafName = fileSpec.GetLeafName(); + if (leafName) { + mTextFrame->SetProperty(nsHTMLAtoms::value,leafName); + nsCRT::free(leafName); + } } NS_RELEASE(fileWidget); }