dbertoni    00/06/14 14:47:28

  Modified:    c/src/PlatformSupport AttributeListImpl.cpp
               c/src/TestXSLT process.cpp
               c/src/XSLT StylesheetHandler.cpp
  Log:
  Fixes for using auto_ptrs after release.
  
  Revision  Changes    Path
  1.8       +2 -2      xml-xalan/c/src/PlatformSupport/AttributeListImpl.cpp
  
  Index: AttributeListImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/AttributeListImpl.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AttributeListImpl.cpp     2000/06/01 17:41:01     1.7
  +++ AttributeListImpl.cpp     2000/06/14 21:47:23     1.8
  @@ -169,7 +169,7 @@
                                AttributeVectorEntry* const             entry = 
theEntry.release();
   
                                // Create an entry in the index map...
  -                             
tempMap.insert(AttributeKeyMapType::value_type(theEntry->m_Name.begin(),
  +                             
tempMap.insert(AttributeKeyMapType::value_type(entry->m_Name.begin(),
                                                                                
                                           entry));
                        }
                }
  @@ -428,7 +428,7 @@
                AttributeVectorEntry* const             entry = 
theEntry.release();
   
                // Create an entry in the index map.
  -             
m_AttributeKeyMap.insert(AttributeKeyMapType::value_type(theEntry->m_Name.begin(),
 entry));
  +             
m_AttributeKeyMap.insert(AttributeKeyMapType::value_type(entry->m_Name.begin(), 
entry));
   
                fResult = true;
        }
  
  
  
  1.21      +23 -8     xml-xalan/c/src/TestXSLT/process.cpp
  
  Index: process.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/TestXSLT/process.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- process.cpp       2000/05/26 19:27:38     1.20
  +++ process.cpp       2000/06/14 21:47:25     1.21
  @@ -81,14 +81,14 @@
   
   
   
  -#include <dom/DOM_Node.hpp>
  -#include <dom/DOM_Element.hpp>
  -#include <dom/DOM_NodeList.hpp>
   #include <util/PlatformUtils.hpp>
   #include <sax/SAXException.hpp>
   
   
   
  +#include <XalanDOM/XalanDOMException.hpp>
  +
  +
   #include <PlatformSupport/DOMStringHelper.hpp>
   #include <PlatformSupport/DOMStringPrintWriter.hpp>
   #include <PlatformSupport/NullPrintWriter.hpp>
  @@ -126,7 +126,8 @@
   #include <XSLT/XSLTProcessorEnvSupportDefault.hpp>
   
   
  -//#define XALAN_USE_ICU
  +
  +#define XALAN_USE_ICU
   #if defined(XALAN_USE_ICU)
   #include <ICUBridge/ICUBridge.hpp>
   #include <ICUBridge/FunctionICUFormatNumber.hpp>
  @@ -336,6 +337,10 @@
                {
                        p.traceTemplateChildren = true;
                }
  +             else
  +             {
  +                     cout << endl << "Warning: Ignoring unknown option \"" 
<< argv[i] << "\"" << endl << endl;
  +             }
        }
   }
   
  @@ -825,12 +830,22 @@
   
                                theResult = -1;
                        }
  +                     catch(const XalanDOMException&  e)
  +                     {
  +                             cout << endl
  +                                      << "XalanDOMException caught.  The 
code is "
  +                                      << e.getExceptionCode()
  +                                      << "."
  +                                      << endl;
  +
  +                             theResult = -1;
  +                     }
                        catch (...)
                        {
                                cout << "\nUnhandled Exception\n";
                        }
   
  -     #if !defined(NDEBUG)
  +#if !defined(NDEBUG)
                        const unsigned long             theInstanceCount =
                                XalanNode::getInstanceCount();
   
  @@ -868,17 +883,17 @@
                                                         << "\"  Node value: \""
                                                         << 
theInstance->getNodeValue()
                                                         << "\""
  -     #if defined(XALAN_RTTI_AVAILABLE) && !defined(XALAN_NO_TYPEINFO)
  +#if defined(XALAN_RTTI_AVAILABLE) && !defined(XALAN_NO_TYPEINFO)
                                                         << "  Type: \""
                                                         << 
typeid(*theInstance).name()
                                                         << "\""
  -     #endif
  +#endif
                                                         << endl
                                                         << endl;
                                        }
                                }
                        }
  -     #endif
  +#endif
   
                }
        }
  
  
  
  1.32      +7 -5      xml-xalan/c/src/XSLT/StylesheetHandler.cpp
  
  Index: StylesheetHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.cpp,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- StylesheetHandler.cpp     2000/06/07 18:35:01     1.31
  +++ StylesheetHandler.cpp     2000/06/14 21:47:26     1.32
  @@ -1156,10 +1156,11 @@
                        }
   
                        importStack.push_back(hrefUrl.get());
  -                     hrefUrl.release();
   
  -                     const XalanDOMString    
theImportURI(hrefUrl->getURLText());
  +                     const XMLURL* const             hrefUrlptr = 
hrefUrl.release();
   
  +                     const XalanDOMString    
theImportURI(hrefUrlptr->getURLText());
  +
                        // This will take care of cleaning up the stylesheet if 
an exception
                        // is thrown.
                        auto_ptr<Stylesheet>    importedStylesheet( 
  @@ -1169,7 +1170,7 @@
   
                        StylesheetHandler tp(*importedStylesheet.get(), 
m_constructionContext);
   
  -                     m_constructionContext.parseXML(*hrefUrl, &tp, 
importedStylesheet.get());
  +                     m_constructionContext.parseXML(*hrefUrlptr, &tp, 
importedStylesheet.get());
   
                        // Add it to the front of the imports
                        m_stylesheet.addImport(importedStylesheet.get(), true);
  @@ -1230,9 +1231,10 @@
                        }
   
                        m_stylesheet.getIncludeStack().push_back(hrefUrl.get());
  -                     hrefUrl.release();
  +
  +                     const XMLURL* const             hrefUrlptr = 
hrefUrl.release();
   
  -                     m_constructionContext.parseXML(*hrefUrl, this, 
&m_stylesheet);
  +                     m_constructionContext.parseXML(*hrefUrlptr, this, 
&m_stylesheet);
   
                        m_stylesheet.getIncludeStack().pop_back();
                }
  
  
  

Reply via email to