From f0ab15a4ccafd4e9324ebf732268a53da2e8d797 Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Thu, 18 Aug 2005 11:16:28 +0000 Subject: [PATCH] Make nsSharable[C]String writable by overriding appropriate methods. Ensure that it doesn't store null buffer handle pointer internally, and override get() on nsXPIDL[C]String for backwards-compatibility. Collapse nsSharedBufferHandle and nsFlexBufferHandle into nsSharedBufferHandle which knows its length but can't have a storage start distinct from its data start. Convert string users who were working around broken nsSharableString::Assign back to using it. b=104663, 100751, 74726 r=jag sr=scc --- docshell/shistory/src/nsSHTransaction.cpp | 2 +- docshell/shistory/src/nsSHTransaction.h | 2 +- docshell/shistory/src/nsSHistory.cpp | 15 +++++---------- docshell/shistory/src/nsSHistory.h | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docshell/shistory/src/nsSHTransaction.cpp b/docshell/shistory/src/nsSHTransaction.cpp index 110c774d55f6..d92a33991457 100644 --- a/docshell/shistory/src/nsSHTransaction.cpp +++ b/docshell/shistory/src/nsSHTransaction.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file diff --git a/docshell/shistory/src/nsSHTransaction.h b/docshell/shistory/src/nsSHTransaction.h index 543761c41c6c..a3df8719c6e7 100644 --- a/docshell/shistory/src/nsSHTransaction.h +++ b/docshell/shistory/src/nsSHTransaction.h @@ -1,4 +1,4 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file diff --git a/docshell/shistory/src/nsSHistory.cpp b/docshell/shistory/src/nsSHistory.cpp index f781631b855f..8f6cadef411f 100644 --- a/docshell/shistory/src/nsSHistory.cpp +++ b/docshell/shistory/src/nsSHistory.cpp @@ -1,4 +1,4 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file @@ -293,19 +293,14 @@ nsSHistory::PrintHistory() if (uri) uri->GetSpec(getter_Copies(url)); - #if 0 - char * titleCStr=nsnull; - - nsString titlestr(title); - titleCStr = ToNewCString(titlestr); +#if 0 printf("**** SH Transaction #%d, Entry = %x\n", index, entry.get()); printf("\t\t URL = %s\n", url); - printf("\t\t Title = %s\n", titleCStr); + printf("\t\t Title = %s\n", NS_LossyConvertUCS2toASCII(title).get()); printf("\t\t layout History Data = %x\n", layoutHistoryState); - Recycle(titleCStr); - #endif +#endif - Recycle(title); + nsMemory::Free(title); nsCOMPtr next; diff --git a/docshell/shistory/src/nsSHistory.h b/docshell/shistory/src/nsSHistory.h index baaa40ae6b7c..53c82ff9f642 100644 --- a/docshell/shistory/src/nsSHistory.h +++ b/docshell/shistory/src/nsSHistory.h @@ -1,4 +1,4 @@ -/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file