summaryrefslogtreecommitdiff
path: root/ucb/source
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2001-02-20 15:20:44 +0000
committerKai Sommerfeld <kso@openoffice.org>2001-02-20 15:20:44 +0000
commitd926e6be6d815ecfc3b5051eec7185141b5b9b64 (patch)
tree483601f5b5dda8a7bda4505026b935c388584ef5 /ucb/source
parentf78462eda7827563bb31aa209b5c0b7eef89afd7 (diff)
#84155# - Fixed memory leaks in class DAVResource and NeonPropFindRequest.
Diffstat (limited to 'ucb/source')
-rw-r--r--ucb/source/ucp/webdav/DAVResource.hxx15
-rw-r--r--ucb/source/ucp/webdav/NeonPropFindRequest.cxx31
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.cxx56
3 files changed, 46 insertions, 56 deletions
diff --git a/ucb/source/ucp/webdav/DAVResource.hxx b/ucb/source/ucp/webdav/DAVResource.hxx
index 0e3b3784fcbc..87e8eb947b57 100644
--- a/ucb/source/ucp/webdav/DAVResource.hxx
+++ b/ucb/source/ucp/webdav/DAVResource.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: DAVResource.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: kso $ $Date: 2000-10-16 14:55:20 $
+ * last change: $Author: kso $ $Date: 2001-02-20 16:20:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,19 +70,12 @@ namespace webdav_ucp
class DAVResource
{
- private:
- bool canDelete;
-
public:
::rtl::OUString uri;
- std::vector < com::sun::star::beans::PropertyValue* > properties;
+ std::vector < com::sun::star::beans::PropertyValue > properties;
public:
- DAVResource(const DAVResource & inDAVResource);
- DAVResource(const ::rtl::OUString & inUri, bool incanDelete = true );
-
- void deletePropertyValues( void );
- void operator=( const DAVResource & inDAVResource );
+ DAVResource(const ::rtl::OUString & inUri );
};
}; // namespace webdav_ucp
diff --git a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
index 71e1e5f99754..09a30ceae4b4 100644
--- a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: NeonPropFindRequest.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: kso $ $Date: 2001-02-15 11:04:48 $
+ * last change: $Author: kso $ $Date: 2001-02-20 16:20:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -252,8 +252,7 @@ NeonPropFindRequest::NeonPropFindRequest( HttpSession * inSession,
// -------------------------------------------------------------------
NeonPropFindRequest::~NeonPropFindRequest( )
{
-// Crash in neon -> hip_xml_destroy(...) is buggy!
-// dav_propfind_destroy( mPropFindHandler );
+ dav_propfind_destroy( mPropFindHandler );
}
#ifdef OLD_NEON_PROPFIND_INTERFACE
@@ -266,12 +265,11 @@ NeonPropFindRequest::~NeonPropFindRequest( )
void * NeonPropFindRequest::StartResource( void * inUserData,
const char * inHref )
{
- DAVResource * theResource = new DAVResource(
- OStringToOUString( inHref, RTL_TEXTENCODING_UTF8 ),
- false );
+ DAVResource theResource(
+ OStringToOUString( inHref, RTL_TEXTENCODING_UTF8 ) );
//theResource->uri = OStringToOUString( inHref, RTL_TEXTENCODING_UTF8 );
vector< DAVResource > * theResources = (vector< DAVResource > * )inUserData;
- theResources->push_back( *theResource );
+ theResources->push_back( theResource );
return theResources;
}
@@ -297,8 +295,7 @@ void * NeonPropFindRequest::CreatePrivate( void * userdata,
const char * uri )
{
DAVResource theResource(
- OStringToOUString( uri, RTL_TEXTENCODING_UTF8 ),
- false );
+ OStringToOUString( uri, RTL_TEXTENCODING_UTF8 ) );
vector< DAVResource > * theResources = (vector< DAVResource > * )userdata;
theResources->push_back( theResource );
return theResources;
@@ -329,23 +326,23 @@ int NeonPropFindRequest::EndElement( void * inUserData,
if ( inXmlElem->id != ELM_resourcetype )
{
// Create & set the PropertyValue
- PropertyValue *thePropertyValue = new PropertyValue;
+ PropertyValue thePropertyValue;
// Warning: What should Handle be?
- thePropertyValue->Handle = 0;
- thePropertyValue->State = PropertyState_DIRECT_VALUE;
+ thePropertyValue.Handle = -1;
+ thePropertyValue.State = PropertyState_DIRECT_VALUE;
if ( inXmlElem->id == ELM_collection )
{
- thePropertyValue->Name = OStringToOUString( "resourcetype",
+ thePropertyValue.Name = OStringToOUString( "resourcetype",
RTL_TEXTENCODING_UTF8 );
- thePropertyValue->Value <<= OStringToOUString( "collection",
+ thePropertyValue.Value <<= OStringToOUString( "collection",
RTL_TEXTENCODING_UTF8 );
}
else
{
- thePropertyValue->Name = OStringToOUString( inXmlElem->name,
+ thePropertyValue.Name = OStringToOUString( inXmlElem->name,
RTL_TEXTENCODING_UTF8 );
- thePropertyValue->Value <<= OStringToOUString( inCdata,
+ thePropertyValue.Value <<= OStringToOUString( inCdata,
RTL_TEXTENCODING_UTF8 );
}
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index 960278d12981..336018fb5dcd 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: webdavcontent.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: kso $ $Date: 2001-02-15 11:11:45 $
+ * last change: $Author: kso $ $Date: 2001-02-20 16:20:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -230,60 +230,60 @@ void ContentProperties::setValues(DAVResource& resource)
bIsDocument = sal_True;
bIsFolder = sal_False;
- std::vector< com::sun::star::beans::PropertyValue* >::iterator it;
+ std::vector< com::sun::star::beans::PropertyValue >::iterator it;
for ( it=resource.properties.begin(); it!=resource.properties.end(); ++it) {
- if ( (*it) == 0 ) {
- continue;
- }
+// if ( (*it) == 0 ) {
+// continue;
+// }
- if ( (*it)->Name.equals(DAVProperties::CREATIONDATE) ) {
- (*it)->Value >>= creationdate;
+ if ( (*it).Name.equals(DAVProperties::CREATIONDATE) ) {
+ (*it).Value >>= creationdate;
// Map the DAV:creationdate to UCP:DateCreated
//
DateTimeHelper::convert (creationdate, dateCreated);
}
- else if ( (*it)->Name.equals(DAVProperties::DISPLAYNAME) ) {
- (*it)->Value >>= displayname;
+ else if ( (*it).Name.equals(DAVProperties::DISPLAYNAME) ) {
+ (*it).Value >>= displayname;
}
- else if ( (*it)->Name.equals(DAVProperties::GETCONTENTLANGUAGE) ) {
- (*it)->Value >>= getcontentlanguage;
+ else if ( (*it).Name.equals(DAVProperties::GETCONTENTLANGUAGE) ) {
+ (*it).Value >>= getcontentlanguage;
}
- else if ( (*it)->Name.equals(DAVProperties::GETCONTENTLENGTH) ) {
- (*it)->Value >>= getcontentlength;
+ else if ( (*it).Name.equals(DAVProperties::GETCONTENTLENGTH) ) {
+ (*it).Value >>= getcontentlength;
// Map the DAV:getcontentlength to UCP:Size
//
size = getcontentlength.toInt64 ();
}
- else if ( (*it)->Name.equals(DAVProperties::GETCONTENTTYPE) ) {
- (*it)->Value >>= getcontenttype;
+ else if ( (*it).Name.equals(DAVProperties::GETCONTENTTYPE) ) {
+ (*it).Value >>= getcontenttype;
}
- else if ( (*it)->Name.equals(DAVProperties::GETETAG) ) {
- (*it)->Value >>= getetag;
+ else if ( (*it).Name.equals(DAVProperties::GETETAG) ) {
+ (*it).Value >>= getetag;
}
- else if ( (*it)->Name.equals(DAVProperties::GETLASTMODIFIED) ) {
- (*it)->Value >>= getlastmodified;
+ else if ( (*it).Name.equals(DAVProperties::GETLASTMODIFIED) ) {
+ (*it).Value >>= getlastmodified;
// Map the DAV:getlastmodified to UCP:DateModified
//
DateTimeHelper::convert (getlastmodified, dateModified);
}
- else if ( (*it)->Name.equals(DAVProperties::LOCKDISCOVERY) ) {
- (*it)->Value >>= lockdiscovery;
+ else if ( (*it).Name.equals(DAVProperties::LOCKDISCOVERY) ) {
+ (*it).Value >>= lockdiscovery;
}
- else if ( (*it)->Name.equals(DAVProperties::RESOURCETYPE) ) {
- (*it)->Value >>= resourcetype;
+ else if ( (*it).Name.equals(DAVProperties::RESOURCETYPE) ) {
+ (*it).Value >>= resourcetype;
if (resourcetype.getLength()>0) {
bIsDocument = sal_False;
bIsFolder = sal_True;
}
}
- else if ( (*it)->Name.equals(DAVProperties::SOURCE) ) {
- (*it)->Value >>= source;
+ else if ( (*it).Name.equals(DAVProperties::SOURCE) ) {
+ (*it).Value >>= source;
}
- else if ( (*it)->Name.equals(DAVProperties::SUPPORTEDLOCK) ) {
- (*it)->Value >>= supportedlock;
+ else if ( (*it).Name.equals(DAVProperties::SUPPORTEDLOCK) ) {
+ (*it).Value >>= supportedlock;
}
}
}