1. mst
  2. ooo340

Commits

kso  committed ecbd93b

#i115050# - Drop support for neon < 0.26.0

  • Participants
  • Parent commits fff7de6
  • Branches default

Comments (0)

Files changed (8)

File ucb/source/ucp/webdav/LinkSequence.cxx

View file
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
                       rInData.getStr() + nStart,
                       nEnd - nStart + TOKEN_LENGTH );
 
-#if NEON_VERSION >= 0x0250
         success = !ne_xml_failed( parser );
-#else
-        success = !!ne_xml_valid( parser );
-#endif
 
         ne_xml_destroy( parser );
 

File ucb/source/ucp/webdav/LockEntrySequence.cxx

View file
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
                       rInData.getStr() + nStart,
                       nEnd - nStart + TOKEN_LENGTH );
 
-#if NEON_VERSION >= 0x0250
         success = !ne_xml_failed( parser );
-#else
-        success = !!ne_xml_valid( parser );
-#endif
 
         ne_xml_destroy( parser );
 

File ucb/source/ucp/webdav/LockSequence.cxx

View file
                       rInData.getStr() + nStart,
                       nEnd - nStart + TOKEN_LENGTH );
 
-#if NEON_VERSION >= 0x0250
         success = !ne_xml_failed( parser );
-#else
-        success = !!ne_xml_valid( parser );
-#endif
 
         ne_xml_destroy( parser );
 

File ucb/source/ucp/webdav/NeonHeadRequest.cxx

View file
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
 namespace {
 
-#if NEON_VERSION >= 0x0250
-void process_headers(ne_request *req,
-                     DAVResource &rResource,
-                     const std::vector< ::rtl::OUString > &rHeaderNames)
+void process_headers( ne_request * req,
+                      DAVResource & rResource,
+                      const std::vector< ::rtl::OUString > & rHeaderNames )
 {
-    void *cursor = NULL;
-    const char *name, *value;
+    void * cursor = NULL;
+    const char * name, *value;
 
-    while ((cursor = ne_response_header_iterate(req, cursor,
-                                                &name, &value)) != NULL) {
+    while ( ( cursor = ne_response_header_iterate( req, cursor,
+                                                   &name, &value ) ) != NULL ) {
         rtl::OUString aHeaderName( rtl::OUString::createFromAscii( name ) );
         rtl::OUString aHeaderValue( rtl::OUString::createFromAscii( value ) );
 
         }
     }
 }
-#else
-struct NeonHeadRequestContext
-{
-    DAVResource * pResource;
-    const std::vector< ::rtl::OUString > * pHeaderNames;
-
-    NeonHeadRequestContext( DAVResource * p,
-                            const std::vector< ::rtl::OUString > * pHeaders )
-    : pResource( p ), pHeaderNames( pHeaders ) {}
-};
-
-extern "C" void NHR_ResponseHeaderCatcher( void * userdata,
-                                           const char * value )
-{
-    rtl::OUString aHeader( rtl::OUString::createFromAscii( value ) );
-    sal_Int32 nPos = aHeader.indexOf( ':' );
-
-    if ( nPos != -1 )
-    {
-        rtl::OUString aHeaderName( aHeader.copy( 0, nPos ) );
-
-        NeonHeadRequestContext * pCtx
-            = static_cast< NeonHeadRequestContext * >( userdata );
-
-        // Note: Empty vector means that all headers are requested.
-        bool bIncludeIt = ( pCtx->pHeaderNames->size() == 0 );
-
-        if ( !bIncludeIt )
-        {
-            // Check whether this header was requested.
-            std::vector< ::rtl::OUString >::const_iterator it(
-                pCtx->pHeaderNames->begin() );
-            const std::vector< ::rtl::OUString >::const_iterator end(
-                pCtx->pHeaderNames->end() );
-
-            while ( it != end )
-            {
-                if ( (*it) == aHeaderName )
-                    break;
-
-                ++it;
-            }
-
-            if ( it != end )
-                bIncludeIt = true;
-        }
-
-        if ( bIncludeIt )
-        {
-            // Create & set the PropertyValue
-            DAVPropertyValue thePropertyValue;
-            thePropertyValue.Name = aHeaderName;
-            thePropertyValue.IsCaseSensitive = false;
-
-            if ( nPos < aHeader.getLength() )
-                thePropertyValue.Value <<= aHeader.copy( nPos + 1 ).trim();
-
-            // Add the newly created PropertyValue
-            pCtx->pResource->properties.push_back( thePropertyValue );
-        }
-    }
-}
-#endif
 
 } // namespace
 
 // Constructor
 // -------------------------------------------------------------------
 
-NeonHeadRequest::NeonHeadRequest( HttpSession* inSession,
+NeonHeadRequest::NeonHeadRequest( HttpSession * inSession,
                                   const rtl::OUString & inPath,
                                   const std::vector< ::rtl::OUString > &
                                     inHeaderNames,
                                             inPath,
                                             RTL_TEXTENCODING_UTF8 ) );
 
-#if NEON_VERSION < 0x0250
-    NeonHeadRequestContext aCtx( &ioResource, &inHeaderNames );
-    ne_add_response_header_catcher( req, NHR_ResponseHeaderCatcher, &aCtx );
-#endif
-
     nError = ne_request_dispatch( req );
 
-#if NEON_VERSION >= 0x0250
-    process_headers(req, ioResource, inHeaderNames);
-#endif
+    process_headers( req, ioResource, inHeaderNames );
 
     if ( nError == NE_OK && ne_get_status( req )->klass != 2 )
         nError = NE_ERROR;

File ucb/source/ucp/webdav/NeonPropFindRequest.cxx

View file
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
 // -------------------------------------------------------------------
 extern "C" void NPFR_propfind_results( void* userdata,
-#if NEON_VERSION >= 0x0260
                                        const ne_uri* uri,
-#else
-                                       const char* href,
-#endif
                                        const NeonPropFindResultSet* set )
 {
     // @@@ href is not the uri! DAVResource ctor wants uri!
 
-#if NEON_VERSION >= 0x0260
     DAVResource theResource(
         OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) );
-#else
-    DAVResource theResource(
-        OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) );
-#endif
 
     ne_propset_iterate( set, NPFR_propfind_iter, &theResource );
 
 
 // -------------------------------------------------------------------
 extern "C" void NPFR_propnames_results( void* userdata,
-#if NEON_VERSION >= 0x0260
                                         const ne_uri* uri,
-#else
-                                        const char* href,
-#endif
                                         const NeonPropFindResultSet* results )
 {
     // @@@ href is not the uri! DAVResourceInfo ctor wants uri!
     // Create entry for the resource.
-#if NEON_VERSION >= 0x0260
     DAVResourceInfo theResource(
         OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) );
-#else
-    DAVResourceInfo theResource(
-        OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) );
-#endif
 
     // Fill entry.
     ne_propset_iterate( results, NPFR_propnames_iter, &theResource );

File ucb/source/ucp/webdav/NeonSession.cxx

View file
 // A simple Neon response_block_reader for use with an XInputStream
 // -------------------------------------------------------------------
 
-#if NEON_VERSION >= 0x0250
 extern "C" int NeonSession_ResponseBlockReader(void * inUserData,
-#else
-extern "C" void NeonSession_ResponseBlockReader(void * inUserData,
-#endif
                                                const char * inBuf,
                                                size_t inLen )
 {
         if ( xInputStream.is() )
             xInputStream->AddToStream( inBuf, inLen );
     }
-#if NEON_VERSION >= 0x0250
     return 0;
-#endif
 }
 
 // -------------------------------------------------------------------
 // A simple Neon response_block_reader for use with an XOutputStream
 // -------------------------------------------------------------------
 
-#if NEON_VERSION >= 0x0250
 extern "C" int NeonSession_ResponseBlockWriter( void * inUserData,
-#else
-extern "C" void NeonSession_ResponseBlockWriter( void * inUserData,
-#endif
                                                 const char * inBuf,
                                                 size_t inLen )
 {
             xOutputStream->writeBytes( aSeq );
         }
     }
-#if NEON_VERSION >= 0x0250
     return 0;
-#endif
 }
 
 // -------------------------------------------------------------------
     void *cursor = NULL;
     const char *name, *value;
 
-#if NEON_VERSION < 0x0250
-    if ( getheaders )
-        ne_add_response_header_catcher(
-            req, runResponseHeaderHandler, userdata );
-#endif
     ne_decompress * dc
         = ne_decompress_reader( req, ne_accept_2xx, reader, userdata );
 
     ret = ne_request_dispatch( req );
 
-#if NEON_VERSION >= 0x0250
     if ( getheaders )
     {
         while ( ( cursor = ne_response_header_iterate(
             runResponseHeaderHandler(userdata, buffer);
         }
     }
-#endif
+
     if ( ret == NE_OK && ne_get_status( req )->klass != 2 )
         ret = NE_ERROR;
 

File ucb/source/ucp/webdav/NeonUri.cxx

View file
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 namespace {
 
 const ne_uri g_sUriDefaultsHTTP  = { "http",
-#if NEON_VERSION >= 0x0260
                                      NULL,
-#endif
                                      NULL,
                                      DEFAULT_HTTP_PORT,
-#if NEON_VERSION >= 0x0260
                                      NULL,
-#endif
                                      NULL,
                                      NULL };
 const ne_uri g_sUriDefaultsHTTPS = { "https",
-#if NEON_VERSION >= 0x0260
                                      NULL,
-#endif
                                      NULL,
                                      DEFAULT_HTTPS_PORT,
-#if NEON_VERSION >= 0x0260
                                      NULL,
-#endif
                                      NULL,
                                      NULL };
 const ne_uri g_sUriDefaultsFTP   = { "ftp",
-#if NEON_VERSION >= 0x0260
                                      NULL,
-#endif
                                      NULL,
                                      DEFAULT_FTP_PORT,
-#if NEON_VERSION >= 0x0260
                                      NULL,
-#endif
                                      NULL,
                                      NULL };
 } // namespace
                     pUri->scheme ? pUri->scheme : pUriDefs->scheme,
                     RTL_TEXTENCODING_UTF8 );
     mUserInfo = rtl::OStringToOUString(
-#if NEON_VERSION >= 0x0260
                     pUri->userinfo ? pUri->userinfo : pUriDefs->userinfo,
-#else
-                    pUri->authinfo ? pUri->authinfo : pUriDefs->authinfo,
-#endif
                     RTL_TEXTENCODING_UTF8 );
     mHostName = rtl::OStringToOUString(
                     pUri->host ? pUri->host : pUriDefs->host,
                     pUri->path ? pUri->path : pUriDefs->path,
                     RTL_TEXTENCODING_UTF8 );
 
-#if NEON_VERSION >= 0x0260
     if ( pUri->query )
     {
         mPath += rtl::OUString::createFromAscii( "?" );
         mPath += rtl::OStringToOUString(
             pUri->fragment,  RTL_TEXTENCODING_UTF8 );
     }
-#endif
 }
 
 // -------------------------------------------------------------------

File ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx

View file
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
         ne_xml_parse( parser, rInData.getStr(), rInData.getLength() );
 
-#if NEON_VERSION >= 0x0250
         success = !ne_xml_failed( parser );
-#else
-        success = !!ne_xml_valid( parser );
-#endif
 
         ne_xml_destroy( parser );