[Libreoffice-commits] .: 2 commits - Repository.mk udm/Makefile udm/Module_udm.mk udm/Package_inc.mk udm/prj udm/source udm/StaticLibrary_udm.mk udm/util unusedcode.easy xmloff/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Aug 2 03:34:50 PDT 2012


 Repository.mk                    |    1 
 udm/Makefile                     |    7 
 udm/Module_udm.mk                |   16 +
 udm/Package_inc.mk               |   14 +
 udm/StaticLibrary_udm.mk         |   23 ++
 udm/prj/build.lst                |   10 -
 udm/prj/d.lst                    |    9 
 udm/source/html/makefile.mk      |   47 -----
 udm/source/mkinc/fullcpp.mk      |   38 ----
 udm/source/xml/makefile.mk       |   47 -----
 udm/util/makefile.mk             |   45 ----
 unusedcode.easy                  |    2 
 xmloff/source/style/impastp1.cxx |   22 --
 xmloff/source/style/impastp2.cxx |   17 +
 xmloff/source/style/impastp3.cxx |   16 -
 xmloff/source/style/impastp4.cxx |  359 +++++++++++++++++----------------------
 xmloff/source/style/impastpl.hxx |   13 -
 17 files changed, 250 insertions(+), 436 deletions(-)

New commits:
commit 5cd8770cbe39f124c69cbceaf745453b7fd63839
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 2 11:00:20 2012 +0100

    convert XMLFamilyDataList_Impl to boost::ptr_set
    
    Change-Id: I2a23787091828415cf814eb7091f3fa926b5876c

diff --git a/unusedcode.easy b/unusedcode.easy
index 74d4aa0..c3b1905 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -51,8 +51,6 @@ VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer(Size const&, Fraction cons
 Window::PostUserEvent(unsigned long&, unsigned long, void*)
 X11SalGraphics::SetMask(int&, int&, unsigned int&, unsigned int&, int&, int&, unsigned long)
 X509Certificate_NssImpl::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>)
-XMLFamilyDataList_Impl::GetPos(XMLFamilyData_Impl const*) const
-XMLFamilyDataList_Impl::Remove(XMLFamilyData_Impl*)
 XMLFontAutoStylePool_Impl::GetPos(XMLFontAutoStylePoolEntry_Impl const*) const
 XMLFontAutoStylePool_Impl::Remove(XMLFontAutoStylePoolEntry_Impl*)
 XMLTextListAutoStylePool_Impl::GetPos(XMLTextListAutoStylePoolEntry_Impl const*) const
diff --git a/xmloff/source/style/impastp1.cxx b/xmloff/source/style/impastp1.cxx
index 4eeffef..b1a0bd6 100644
--- a/xmloff/source/style/impastp1.cxx
+++ b/xmloff/source/style/impastp1.cxx
@@ -82,26 +82,4 @@ void XMLFamilyData_Impl::ClearEntries()
     }
 }
 
-///////////////////////////////////////////////////////////////////////////////
-//
-// friendfunction of class XMLFamilyData_Impl for sorting listelements
-//
-
-int XMLFamilyDataSort_Impl( const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2 )
-{
-    int nRet = 0;
-
-    if( r1.mnFamily != r2.mnFamily )
-        nRet = ( r1.mnFamily > r2.mnFamily ? 1 : -1 );
-
-    return nRet;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Implementation of sorted list of XMLFamilyData_Impl - elements
-//
-
-IMPL_CONTAINER_SORT( XMLFamilyDataList_Impl, XMLFamilyData_Impl, XMLFamilyDataSort_Impl )
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/impastp2.cxx b/xmloff/source/style/impastp2.cxx
index b5d3c94..6de03bd 100644
--- a/xmloff/source/style/impastp2.cxx
+++ b/xmloff/source/style/impastp2.cxx
@@ -44,21 +44,26 @@ using ::rtl::OUStringBuffer;
 // ctor class SvXMLAutoStylePoolProperties_Impl
 //
 
-SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties )
+SvXMLAutoStylePoolPropertiesP_Impl::SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl& rFamilyData, const vector< XMLPropertyState >& rProperties )
 : maProperties( rProperties ),
-  mnPos       ( pFamilyData->mnCount )
+  mnPos       ( rFamilyData.mnCount )
 {
     // create a name that hasn't been used before. The created name has not
     // to be added to the array, because it will never tried again
     OUStringBuffer sBuffer( 7 );
     do
     {
-        pFamilyData->mnName++;
-        sBuffer.append( pFamilyData->maStrPrefix );
-        sBuffer.append( OUString::valueOf( (sal_Int32)pFamilyData->mnName ) );
+        rFamilyData.mnName++;
+        sBuffer.append( rFamilyData.maStrPrefix );
+        sBuffer.append( OUString::valueOf( (sal_Int32)rFamilyData.mnName ) );
         msName = sBuffer.makeStringAndClear();
     }
-    while( pFamilyData->mpNameList->find(msName) != pFamilyData->mpNameList->end() );
+    while( rFamilyData.mpNameList->find(msName) != rFamilyData.mpNameList->end() );
+}
+
+bool operator<( const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2)
+{
+    return r1.mnFamily < r2.mnFamily;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx
index 20b1cf0..eceed9e 100644
--- a/xmloff/source/style/impastp3.cxx
+++ b/xmloff/source/style/impastp3.cxx
@@ -56,7 +56,7 @@ SvXMLAutoStylePoolParentP_Impl::~SvXMLAutoStylePoolParentP_Impl()
 // if not added, yet.
 //
 
-sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek )
+sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl& rFamilyData, const vector< XMLPropertyState >& rProperties, OUString& rName, bool bDontSeek )
 {
     sal_Bool bAdded = sal_False;
     SvXMLAutoStylePoolPropertiesP_Impl *pProperties = 0;
@@ -75,7 +75,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
         {
             break;
         }
-        else if( !bDontSeek && pFamilyData->mxMapper->Equals( pIS->GetProperties(), rProperties ) )
+        else if( !bDontSeek && rFamilyData.mxMapper->Equals( pIS->GetProperties(), rProperties ) )
         {
             pProperties = pIS;
             break;
@@ -84,7 +84,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
 
     if( !pProperties )
     {
-        pProperties = new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
+        pProperties = new SvXMLAutoStylePoolPropertiesP_Impl( rFamilyData, rProperties );
         SvXMLAutoStylePoolPropertiesPList_Impl::iterator it = maPropertiesList.begin();
         ::std::advance( it, i );
         maPropertiesList.insert( it, pProperties );
@@ -103,7 +103,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
 // the same properties exists, a new one is added (like with bDontSeek).
 //
 
-sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName )
+sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl& rFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName )
 {
     sal_Bool bAdded = sal_False;
     size_t i = 0;
@@ -123,10 +123,10 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyDa
         }
     }
 
-    if(pFamilyData->mpNameList->find(rName) == pFamilyData->mpNameList->end())
+    if(rFamilyData.mpNameList->find(rName) == rFamilyData.mpNameList->end())
     {
         SvXMLAutoStylePoolPropertiesP_Impl* pProperties =
-                new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
+                new SvXMLAutoStylePoolPropertiesP_Impl( rFamilyData, rProperties );
         // ignore the generated name
         pProperties->SetName( rName );
         SvXMLAutoStylePoolPropertiesPList_Impl::iterator it = maPropertiesList.begin();
@@ -143,7 +143,7 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyDa
 // Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list
 //
 
-OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties ) const
+OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl& rFamilyData, const vector< XMLPropertyState >& rProperties ) const
 {
     OUString sName;
     vector< XMLPropertyState>::size_type nItems = rProperties.size();
@@ -159,7 +159,7 @@ OUString SvXMLAutoStylePoolParentP_Impl::Find( const XMLFamilyData_Impl* pFamily
         {
             break;
         }
-        else if( pFamilyData->mxMapper->Equals( pIS->GetProperties(), rProperties ) )
+        else if( rFamilyData.mxMapper->Equals( pIS->GetProperties(), rProperties ) )
         {
             sName = pIS->GetName();
             break;
diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx
index 47793ec..02b380f 100644
--- a/xmloff/source/style/impastp4.cxx
+++ b/xmloff/source/style/impastp4.cxx
@@ -56,20 +56,12 @@ using namespace ::xmloff::token;
 //
 
 SvXMLAutoStylePoolP_Impl::SvXMLAutoStylePoolP_Impl( SvXMLExport& rExp)
-    :   rExport( rExp ),
-        maFamilyList( 5, 5 )
+    :   rExport( rExp )
 {
 }
 
 SvXMLAutoStylePoolP_Impl::~SvXMLAutoStylePoolP_Impl()
 {
-    for (;;) {
-        XMLFamilyData_Impl* pData = maFamilyList.Remove( sal_uLong(0) );
-        if (pData == NULL) {
-            break;
-        }
-        delete pData;
-    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -85,8 +77,6 @@ void SvXMLAutoStylePoolP_Impl::AddFamily(
         sal_Bool bAsFamily )
 {
     // store family in a list if not already stored
-    sal_uLong nPos;
-
     sal_uInt16 nExportFlags = GetExport().getExportFlags();
     sal_Bool bStylesOnly = (nExportFlags & EXPORT_STYLES) != 0 && (nExportFlags & EXPORT_CONTENT) == 0;
 
@@ -98,10 +88,7 @@ void SvXMLAutoStylePoolP_Impl::AddFamily(
     }
 
     XMLFamilyData_Impl *pFamily = new XMLFamilyData_Impl( nFamily, rStrName, rMapper, aPrefix, bAsFamily );
-    if( !maFamilyList.Seek_Entry( pFamily, &nPos ) )
-        maFamilyList.Insert( pFamily );
-    else
-        delete pFamily;
+    maFamilyList.insert(pFamily);
 }
 
 void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper(
@@ -110,14 +97,9 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper(
 {
 
     XMLFamilyData_Impl aTemporary( nFamily );
-    sal_uLong nPos;
-
-    if( maFamilyList.Seek_Entry( &aTemporary, &nPos ) )
-    {
-        XMLFamilyData_Impl* pFamily = maFamilyList.GetObject( nPos );
-        if ( pFamily )
-            pFamily-> mxMapper = rMapper;
-    }
+    XMLFamilyDataList_Impl::iterator aFind = maFamilyList.find(aTemporary);
+    if (aFind != maFamilyList.end())
+        aFind->mxMapper = rMapper;
 }
 ///////////////////////////////////////////////////////////////////////////////
 //
@@ -126,17 +108,12 @@ void SvXMLAutoStylePoolP_Impl::SetFamilyPropSetMapper(
 
 void SvXMLAutoStylePoolP_Impl::RegisterName( sal_Int32 nFamily, const OUString& rName )
 {
-    SvXMLAutoStylePoolNamesP_Impl *pNames = 0;
-
-    sal_uLong nPos;
     XMLFamilyData_Impl aTmp( nFamily );
-    if( maFamilyList.Seek_Entry( &aTmp, &nPos ) )
-        pNames = maFamilyList.GetObject( nPos )->mpNameList;
-
-    DBG_ASSERT( pNames,
+    XMLFamilyDataList_Impl::iterator aFind = maFamilyList.find(aTmp);
+    DBG_ASSERT( aFind != maFamilyList.end(),
                 "SvXMLAutoStylePool_Impl::RegisterName: unknown family" );
-    if( pNames )
-        pNames->insert(rName);
+    if (aFind != maFamilyList.end())
+        aFind->mpNameList->insert(rName);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -153,18 +130,17 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames(
     vector<OUString> aNames;
 
     // iterate over families
-    sal_uInt32 nCount = maFamilyList.Count();
-    for( sal_uInt32 i = 0; i < nCount; i++ )
+    for(XMLFamilyDataList_Impl::iterator aJ = maFamilyList.begin(); aJ != maFamilyList.end(); ++aJ)
     {
-        XMLFamilyData_Impl* pFamily = maFamilyList.GetObject( i );
+        XMLFamilyData_Impl &rFamily = *aJ;
 
         // iterate over names
-        SvXMLAutoStylePoolNamesP_Impl* pNames = pFamily->mpNameList;
+        SvXMLAutoStylePoolNamesP_Impl* pNames = rFamily.mpNameList;
         if (!pNames)
             continue;
         for (SvXMLAutoStylePoolNamesP_Impl::const_iterator aI = pNames->begin(); aI != pNames->end(); ++aI)
         {
-            aFamilies.push_back( pFamily->mnFamily );
+            aFamilies.push_back( rFamily.mnFamily );
             aNames.push_back( *aI );
         }
     }
@@ -192,22 +168,20 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily,
                 bool bDontSeek )
 {
     sal_Bool bRet(sal_False);
-    sal_uLong nPos;
 
-    XMLFamilyData_Impl *pFamily = 0;
     XMLFamilyData_Impl aTemporary( nFamily );
-    if( maFamilyList.Seek_Entry( &aTemporary, &nPos ) )
-    {
-        pFamily = maFamilyList.GetObject( nPos );
-    }
+    XMLFamilyDataList_Impl::iterator aFind = maFamilyList.find(aTemporary);
+    DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Add: unknown family");
 
-    DBG_ASSERT( pFamily, "SvXMLAutoStylePool_Impl::Add: unknown family" );
-    if( pFamily )
+    if (aFind != maFamilyList.end())
     {
+        XMLFamilyData_Impl &rFamily = *aFind;
+
         SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
         SvXMLAutoStylePoolParentP_Impl *pParent = 0;
 
-        SvXMLAutoStylePoolParentsP_Impl *pParents = pFamily->mpParentList;
+        SvXMLAutoStylePoolParentsP_Impl *pParents = rFamily.mpParentList;
+        sal_uLong nPos;
         if( pParents->Seek_Entry( &aTmp, &nPos ) )
         {
             pParent = pParents->GetObject( nPos );
@@ -218,18 +192,18 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily,
             pParents->Insert( pParent );
         }
 
-        if( pParent->Add( pFamily, rProperties, rName, bDontSeek ) )
+        if( pParent->Add( rFamily, rProperties, rName, bDontSeek ) )
         {
-            pFamily->mnCount++;
+            rFamily.mnCount++;
             bRet = sal_True;
         }
 
         if( bCache )
         {
-            if( !pFamily->pCache )
-                pFamily->pCache = new SvXMLAutoStylePoolCache_Impl();
-            if( pFamily->pCache->size() < MAX_CACHE_SIZE )
-                pFamily->pCache->push_back( new OUString( rName ) );
+            if( !rFamily.pCache )
+                rFamily.pCache = new SvXMLAutoStylePoolCache_Impl();
+            if( rFamily.pCache->size() < MAX_CACHE_SIZE )
+                rFamily.pCache->push_back( new OUString( rName ) );
         }
     }
 
@@ -241,22 +215,20 @@ sal_Bool SvXMLAutoStylePoolP_Impl::AddNamed(const OUString& rName, sal_Int32 nFa
 {
     // get family and parent the same way as in Add()
     sal_Bool bRet(sal_False);
-    sal_uLong nPos;
 
-    XMLFamilyData_Impl *pFamily = 0;
     XMLFamilyData_Impl aTemporary( nFamily );
-    if( maFamilyList.Seek_Entry( &aTemporary, &nPos ) )
-    {
-        pFamily = maFamilyList.GetObject( nPos );
-    }
+    XMLFamilyDataList_Impl::iterator aFind = maFamilyList.find(aTemporary);
+    DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Add: unknown family");
 
-    DBG_ASSERT( pFamily, "SvXMLAutoStylePool_Impl::Add: unknown family" );
-    if( pFamily )
+    if (aFind != maFamilyList.end())
     {
+        XMLFamilyData_Impl &rFamily = *aFind;
+
         SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
         SvXMLAutoStylePoolParentP_Impl *pParent = 0;
 
-        SvXMLAutoStylePoolParentsP_Impl *pParents = pFamily->mpParentList;
+        SvXMLAutoStylePoolParentsP_Impl *pParents = rFamily.mpParentList;
+        sal_uLong nPos;
         if( pParents->Seek_Entry( &aTmp, &nPos ) )
         {
             pParent = pParents->GetObject( nPos );
@@ -267,9 +239,9 @@ sal_Bool SvXMLAutoStylePoolP_Impl::AddNamed(const OUString& rName, sal_Int32 nFa
             pParents->Insert( pParent );
         }
 
-        if( pParent->AddNamed( pFamily, rProperties, rName ) )
+        if( pParent->AddNamed( rFamily, rProperties, rName ) )
         {
-            pFamily->mnCount++;
+            rFamily.mnCount++;
             bRet = sal_True;
         }
     }
@@ -288,24 +260,20 @@ OUString SvXMLAutoStylePoolP_Impl::Find( sal_Int32 nFamily,
 {
     OUString sName;
 
-    sal_uLong nPos;
     XMLFamilyData_Impl aTemporary( nFamily );
-    XMLFamilyData_Impl *pFamily = 0;
-    if( maFamilyList.Seek_Entry( &aTemporary, &nPos ) )
-    {
-        pFamily = maFamilyList.GetObject( nPos );
-    }
+    XMLFamilyDataList_Impl::iterator aFind = maFamilyList.find(aTemporary);
+    DBG_ASSERT(aFind != maFamilyList.end(), "SvXMLAutoStylePool_Impl::Find: unknown family");
 
-    DBG_ASSERT( pFamily, "SvXMLAutoStylePool_Impl::Find: unknown family" );
-
-    if( pFamily )
+    if (aFind != maFamilyList.end())
     {
-        SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
-
+        XMLFamilyData_Impl &rFamily = *aFind;
         const SvXMLAutoStylePoolParentsP_Impl* pParents =
-            pFamily->mpParentList;
+            rFamily.mpParentList;
+
+        SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
+        sal_uLong nPos;
         if( pParents->Seek_Entry( &aTmp, &nPos ) )
-            sName = pParents->GetObject( nPos )->Find( pFamily, rProperties );
+            sName = pParents->GetObject( nPos )->Find( rFamily, rProperties );
     }
 
     return sName;
@@ -323,156 +291,153 @@ void SvXMLAutoStylePoolP_Impl::exportXML(
         const SvXMLNamespaceMap&,
         const SvXMLAutoStylePoolP *pAntiImpl) const
 {
-    sal_uInt32 nCount = 0;
-
     // Get list of parents for current family (nFamily)
-    sal_uLong nPos;
     XMLFamilyData_Impl aTmp( nFamily );
-    XMLFamilyData_Impl *pFamily = 0;
-    if( maFamilyList.Seek_Entry( &aTmp, &nPos ) )
+    XMLFamilyDataList_Impl::iterator aFind = maFamilyList.find(aTmp);
+    DBG_ASSERT( aFind != maFamilyList.end(),
+                "SvXMLAutoStylePool_Impl::exportXML: unknown family" );
+    if (aFind == maFamilyList.end())
+        return;
+
+    XMLFamilyData_Impl &rFamily = *aFind;
+    sal_uInt32 nCount = rFamily.mnCount;
+
+    if (!nCount)
+        return;
+
+    /////////////////////////////////////////////////////////////////////////////////////
+    // create, initialize and fill helper-structure (SvXMLAutoStylePoolProperties_Impl)
+    // wich contains a parent-name and a SvXMLAutoStylePoolProperties_Impl
+    //
+    const SvXMLAutoStylePoolParentsP_Impl *pParents =
+        rFamily.mpParentList;
+
+    SvXMLAutoStylePoolPExport_Impl* aExpStyles =
+        new SvXMLAutoStylePoolPExport_Impl[nCount];
+
+    sal_uInt32 i;
+    for( i=0; i < nCount; i++ )
     {
-        pFamily = maFamilyList.GetObject( nPos );
-        nCount         = pFamily->mnCount;
+        aExpStyles[i].mpParent = 0;
+        aExpStyles[i].mpProperties = 0;
     }
 
-    DBG_ASSERT( pFamily,
-                "SvXMLAutoStylePool_Impl::exportXML: unknown family" );
-    if( pFamily && nCount > 0 )
+    sal_uInt32 nParents = pParents->Count();
+    for( i=0; i < nParents; i++ )
     {
-        /////////////////////////////////////////////////////////////////////////////////////
-        // create, initialize and fill helper-structure (SvXMLAutoStylePoolProperties_Impl)
-        // wich contains a parent-name and a SvXMLAutoStylePoolProperties_Impl
-        //
-        const SvXMLAutoStylePoolParentsP_Impl *pParents =
-            pFamily->mpParentList;
-
-        SvXMLAutoStylePoolPExport_Impl* aExpStyles =
-            new SvXMLAutoStylePoolPExport_Impl[nCount];
-
-        sal_uInt32 i;
-        for( i=0; i < nCount; i++ )
+        const SvXMLAutoStylePoolParentP_Impl* pParent =
+            pParents->GetObject( i );
+        size_t nProperties = pParent->GetPropertiesList().size();
+        for( size_t j = 0; j < nProperties; j++ )
         {
-            aExpStyles[i].mpParent = 0;
-            aExpStyles[i].mpProperties = 0;
-        }
-
-        sal_uInt32 nParents = pParents->Count();
-        for( i=0; i < nParents; i++ )
-        {
-            const SvXMLAutoStylePoolParentP_Impl* pParent =
-                pParents->GetObject( i );
-            size_t nProperties = pParent->GetPropertiesList().size();
-            for( size_t j = 0; j < nProperties; j++ )
+            const SvXMLAutoStylePoolPropertiesP_Impl* pProperties =
+                pParent->GetPropertiesList()[ j ];
+            sal_uLong nPos = pProperties->GetPos();
+            DBG_ASSERT( nPos < nCount,
+                    "SvXMLAutoStylePool_Impl::exportXML: wrong position" );
+            if( nPos < nCount )
             {
-                const SvXMLAutoStylePoolPropertiesP_Impl* pProperties =
-                    pParent->GetPropertiesList()[ j ];
-                nPos = pProperties->GetPos();
-                DBG_ASSERT( nPos < nCount,
-                        "SvXMLAutoStylePool_Impl::exportXML: wrong position" );
-                if( nPos < nCount )
-                {
-                    DBG_ASSERT( !aExpStyles[nPos].mpProperties,
-                        "SvXMLAutoStylePool_Impl::exportXML: double position" );
-                    aExpStyles[nPos].mpProperties = pProperties;
-                    aExpStyles[nPos].mpParent = &pParent->GetParent();
-                }
+                DBG_ASSERT( !aExpStyles[nPos].mpProperties,
+                    "SvXMLAutoStylePool_Impl::exportXML: double position" );
+                aExpStyles[nPos].mpProperties = pProperties;
+                aExpStyles[nPos].mpParent = &pParent->GetParent();
             }
         }
+    }
+
+    /////////////////////////////////////////////////////////////////////////////////////
+    //
+    // create string to export for each XML-style. That means for each property-list
+    //
+    OUString aStrFamilyName = rFamily.maStrFamilyName;
 
-        /////////////////////////////////////////////////////////////////////////////////////
-        //
-        // create string to export for each XML-style. That means for each property-list
-        //
-        OUString aStrFamilyName = pFamily->maStrFamilyName;
+    for( i=0; i<nCount; i++ )
+    {
+        DBG_ASSERT( aExpStyles[i].mpProperties,
+                    "SvXMLAutoStylePool_Impl::exportXML: empty position" );
 
-        for( i=0; i<nCount; i++ )
+        if( aExpStyles[i].mpProperties )
         {
-            DBG_ASSERT( aExpStyles[i].mpProperties,
-                        "SvXMLAutoStylePool_Impl::exportXML: empty position" );
+            GetExport().AddAttribute(
+                XML_NAMESPACE_STYLE, XML_NAME,
+                aExpStyles[i].mpProperties->GetName() );
 
-            if( aExpStyles[i].mpProperties )
+            if( rFamily.bAsFamily )
             {
                 GetExport().AddAttribute(
-                    XML_NAMESPACE_STYLE, XML_NAME,
-                    aExpStyles[i].mpProperties->GetName() );
+                    XML_NAMESPACE_STYLE, XML_FAMILY, aStrFamilyName );
+            }
 
-                if( pFamily->bAsFamily )
-                {
-                    GetExport().AddAttribute(
-                        XML_NAMESPACE_STYLE, XML_FAMILY, aStrFamilyName );
-                }
+            if( !aExpStyles[i].mpParent->isEmpty() )
+            {
+                GetExport().AddAttribute(
+                    XML_NAMESPACE_STYLE, XML_PARENT_STYLE_NAME,
+                    GetExport().EncodeStyleName(
+                        *aExpStyles[i].mpParent ) );
+            }
 
-                if( !aExpStyles[i].mpParent->isEmpty() )
-                {
-                    GetExport().AddAttribute(
-                        XML_NAMESPACE_STYLE, XML_PARENT_STYLE_NAME,
-                        GetExport().EncodeStyleName(
-                            *aExpStyles[i].mpParent ) );
-                }
+            OUString sName;
+            if( rFamily.bAsFamily )
+                sName = GetXMLToken(XML_STYLE);
+            else
+                sName = rFamily.maStrFamilyName;
+
+            pAntiImpl->exportStyleAttributes(
+                GetExport().GetAttrList(),
+                nFamily,
+                aExpStyles[i].mpProperties->GetProperties(),
+                *rFamily.mxMapper.get()
+                    , GetExport().GetMM100UnitConverter(),
+                    GetExport().GetNamespaceMap()
+                );
+
+            SvXMLElementExport aElem( GetExport(),
+                                      XML_NAMESPACE_STYLE, sName,
+                                      sal_True, sal_True );
 
-                OUString sName;
-                if( pFamily->bAsFamily )
-                    sName = GetXMLToken(XML_STYLE);
-                else
-                    sName = pFamily->maStrFamilyName;
-
-                pAntiImpl->exportStyleAttributes(
-                    GetExport().GetAttrList(),
-                    nFamily,
-                    aExpStyles[i].mpProperties->GetProperties(),
-                    *pFamily->mxMapper.get()
-                        , GetExport().GetMM100UnitConverter(),
-                        GetExport().GetNamespaceMap()
-                    );
-
-                SvXMLElementExport aElem( GetExport(),
-                                          XML_NAMESPACE_STYLE, sName,
-                                          sal_True, sal_True );
-
-                sal_Int32 nStart(-1);
-                sal_Int32 nEnd(-1);
-                if (nFamily == XML_STYLE_FAMILY_PAGE_MASTER)
+            sal_Int32 nStart(-1);
+            sal_Int32 nEnd(-1);
+            if (nFamily == XML_STYLE_FAMILY_PAGE_MASTER)
+            {
+                nStart = 0;
+                sal_Int32 nIndex = 0;
+                UniReference< XMLPropertySetMapper > aPropMapper =
+                    rFamily.mxMapper->getPropertySetMapper();
+                sal_Int16 nContextID;
+                while(nIndex < aPropMapper->GetEntryCount() && nEnd == -1)
                 {
-                    nStart = 0;
-                    sal_Int32 nIndex = 0;
-                    UniReference< XMLPropertySetMapper > aPropMapper =
-                        pFamily->mxMapper->getPropertySetMapper();
-                    sal_Int16 nContextID;
-                    while(nIndex < aPropMapper->GetEntryCount() && nEnd == -1)
-                    {
-                        nContextID = aPropMapper->GetEntryContextId( nIndex );
-                        if (nContextID && ((nContextID & CTF_PM_FLAGMASK) != XML_PM_CTF_START))
-                            nEnd = nIndex;
-                        nIndex++;
-                    }
-                    if (nEnd == -1)
+                    nContextID = aPropMapper->GetEntryContextId( nIndex );
+                    if (nContextID && ((nContextID & CTF_PM_FLAGMASK) != XML_PM_CTF_START))
                         nEnd = nIndex;
+                    nIndex++;
                 }
-
-                pFamily->mxMapper->exportXML(
-                    GetExport(),
-                    aExpStyles[i].mpProperties->GetProperties(),
-                    nStart, nEnd, XML_EXPORT_FLAG_IGN_WS );
-
-                pAntiImpl->exportStyleContent(
-                    GetExport().GetDocHandler(),
-                    nFamily,
-                    aExpStyles[i].mpProperties->GetProperties(),
-                    *pFamily->mxMapper.get(),
-                    GetExport().GetMM100UnitConverter(),
-                    GetExport().GetNamespaceMap()
-                    );
+                if (nEnd == -1)
+                    nEnd = nIndex;
             }
-        }
 
-        delete[] aExpStyles;
+            rFamily.mxMapper->exportXML(
+                GetExport(),
+                aExpStyles[i].mpProperties->GetProperties(),
+                nStart, nEnd, XML_EXPORT_FLAG_IGN_WS );
+
+            pAntiImpl->exportStyleContent(
+                GetExport().GetDocHandler(),
+                nFamily,
+                aExpStyles[i].mpProperties->GetProperties(),
+                *rFamily.mxMapper.get(),
+                GetExport().GetMM100UnitConverter(),
+                GetExport().GetNamespaceMap()
+                );
+        }
     }
+
+    delete[] aExpStyles;
 }
 
 void SvXMLAutoStylePoolP_Impl::ClearEntries()
 {
-    for(sal_uInt32 a = 0L; a < maFamilyList.Count(); a++)
-        maFamilyList[a]->ClearEntries();
+    for(XMLFamilyDataList_Impl::iterator aI = maFamilyList.begin(); aI != maFamilyList.end(); ++aI)
+        aI->ClearEntries();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx
index 659211f..941471d 100644
--- a/xmloff/source/style/impastpl.hxx
+++ b/xmloff/source/style/impastpl.hxx
@@ -29,6 +29,7 @@
 #ifndef _XMLOFF_XMLASTPL_IMPL_HXX
 #define _XMLOFF_XMLASTPL_IMPL_HXX
 
+#include <boost/ptr_container/ptr_set.hpp>
 #include <sal/types.h>
 #include <svl/cntnrsrt.hxx>
 #include <rtl/ustring.hxx>
@@ -84,12 +85,12 @@ public:
     {}
     ~XMLFamilyData_Impl();
 
-    friend int XMLFamilyDataSort_Impl( const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2 );
+    friend bool operator<(const XMLFamilyData_Impl& r1, const XMLFamilyData_Impl& r2);
 
     void ClearEntries();
 };
 
-DECLARE_CONTAINER_SORT( XMLFamilyDataList_Impl, XMLFamilyData_Impl )
+typedef boost::ptr_set<XMLFamilyData_Impl> XMLFamilyDataList_Impl;
 
 ///////////////////////////////////////////////////////////////////////////////
 //
@@ -104,7 +105,7 @@ class SvXMLAutoStylePoolPropertiesP_Impl
 
 public:
 
-    SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties );
+    SvXMLAutoStylePoolPropertiesP_Impl( XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties );
 
     ~SvXMLAutoStylePoolPropertiesP_Impl()
     {
@@ -139,11 +140,11 @@ public:
 
     ~SvXMLAutoStylePoolParentP_Impl();
 
-    sal_Bool Add( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, ::rtl::OUString& rName, bool bDontSeek = false );
+    sal_Bool Add( XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, ::rtl::OUString& rName, bool bDontSeek = false );
 
-    sal_Bool AddNamed( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const ::rtl::OUString& rName );
+    sal_Bool AddNamed( XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const ::rtl::OUString& rName );
 
-    ::rtl::OUString Find( const XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const;
+    ::rtl::OUString Find( const XMLFamilyData_Impl& rFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const;
 
     const ::rtl::OUString& GetParent() const { return msParent; }
 
commit b90a897069536c571969a917a6b474ebb69a9828
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 2 08:54:08 2012 +0100

    gbuildize udm
    
    Change-Id: Id6cf22a19de3ae52ffc1e42a7d4114b1e417f2b3

diff --git a/Repository.mk b/Repository.mk
index f485593..4f41824 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -658,6 +658,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \
     salcpprt \
     testtools_bridgetest_s \
     transex \
+    udm \
     ulingu \
     vclmain \
     writerperfect \
diff --git a/udm/Makefile b/udm/Makefile
new file mode 100644
index 0000000..ccb1c85
--- /dev/null
+++ b/udm/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/udm/Module_udm.mk b/udm/Module_udm.mk
new file mode 100644
index 0000000..e346c87
--- /dev/null
+++ b/udm/Module_udm.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+$(eval $(call gb_Module_Module,udm))
+
+$(eval $(call gb_Module_add_targets,udm,\
+    Package_inc \
+    StaticLibrary_udm \
+))
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/udm/Package_inc.mk b/udm/Package_inc.mk
new file mode 100644
index 0000000..87e6b65
--- /dev/null
+++ b/udm/Package_inc.mk
@@ -0,0 +1,14 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+$(eval $(call gb_Package_Package,udm_inc,$(SRCDIR)/udm/inc))
+
+$(eval $(call gb_Package_add_file,udm_inc,inc/udm/html/htmlitem.hxx,udm/html/htmlitem.hxx))
+$(eval $(call gb_Package_add_file,udm_inc,inc/udm/xml/xmlitem.hxx,udm/xml/xmlitem.hxx))
+
+# vim: set noet sw=4 ts=4:
diff --git a/udm/StaticLibrary_udm.mk b/udm/StaticLibrary_udm.mk
new file mode 100644
index 0000000..6077a47
--- /dev/null
+++ b/udm/StaticLibrary_udm.mk
@@ -0,0 +1,23 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,udm))
+
+$(eval $(call gb_StaticLibrary_set_include,udm,\
+    -I$(SRCDIR)/udm/inc \
+    -I$(SRCDIR)/udm/source/inc \
+    $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_exception_objects,udm,\
+	udm/source/html/htmlitem \
+	udm/source/xml/xmlitem \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/udm/prj/build.lst b/udm/prj/build.lst
index 3ede458..7a1de18 100644
--- a/udm/prj/build.lst
+++ b/udm/prj/build.lst
@@ -1,11 +1,3 @@
 ud	udm	:  cosv NULL
 ud	udm								usr1	-	all	ud_mkout NULL
-ud	udm\prj							get		-	all	ud_prj NULL
-ud	udm\inc							get		-	all	ud_inc NULL
-ud	udm\inc\udm		  				get		-	all	udi_udm NULL
-ud	udm\inc\udm\html  				get		-	all	udiu_html NULL
-ud	udm\inc\udm\xml	  				get		-	all	udiu_xml NULL
-ud	udm\source						get	    -	all	ud_src NULL
-ud	udm\source\html					nmake	-	all	uds_html NULL
-ud	udm\source\xml					nmake	-	all	uds_xml NULL
-ud	udm\util						nmake	-	all ud_util uds_xml uds_html NULL
+ud	udm\prj							nmake		-	all	ud_prj NULL
diff --git a/udm/prj/d.lst b/udm/prj/d.lst
index 5dfe7a1..e69de29 100644
--- a/udm/prj/d.lst
+++ b/udm/prj/d.lst
@@ -1,9 +0,0 @@
-mkdir: %_DEST%\inc\udm
-mkdir: %_DEST%\inc\udm\html
-mkdir: %_DEST%\inc\udm\xml
-
-..\%__SRC%\lib\udm.lib %_DEST%\lib\udm.lib
-..\%__SRC%\lib\libudm.a %_DEST%\lib\libudm.a
-..\inc\udm\html\*.hxx %_DEST%\inc\udm\html\*.hxx
-..\inc\udm\xml\*.hxx %_DEST%\inc\udm\xml\*.hxx
-
diff --git a/udm/prj/dmake b/udm/prj/dmake
deleted file mode 100644
index e69de29..0000000
diff --git a/udm/source/html/makefile.mk b/udm/source/html/makefile.mk
deleted file mode 100644
index 34076b9..0000000
--- a/udm/source/html/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-PRJ=..$/..
-
-PRJNAME=udm
-TARGET=csi_html
-
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=true
-
-
-.INCLUDE :  settings.mk
-.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk
-
-
-# --- Files --------------------------------------------------------
-
-OBJFILES= \
-    $(OBJ)$/htmlitem.obj	
-
-
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE :  target.mk
-
-
-
diff --git a/udm/source/mkinc/fullcpp.mk b/udm/source/mkinc/fullcpp.mk
deleted file mode 100644
index 1c4d949..0000000
--- a/udm/source/mkinc/fullcpp.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-
-
-# --- Settings -----------------------------------------------------
-# Has to be included AFTER settings.mk !
-
-
-.IF "$(GUI)"=="WNT"
-
-# RTTI
-.IF "$(COM)"=="MSC"
-CFLAGS+= -GR
-.ENDIF
-
-.ENDIF
-
-# Or should we simple check for $(COM)==GCC ?
-.IF "$(OS)"=="LINUX" || "$(OS)"=="FREEBSD" || "$(OS)"=="NETBSD" || "$(OS)$(COM)"=="WNTGCC"
-CFLAGSCXX+= -frtti
-.ENDIF
-
diff --git a/udm/source/xml/makefile.mk b/udm/source/xml/makefile.mk
deleted file mode 100644
index 0b7c3b8..0000000
--- a/udm/source/xml/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-PRJ=..$/..
-
-PRJNAME=udm
-TARGET=csi_xml
-
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=true
-
-
-.INCLUDE :  settings.mk
-.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk
-
-
-# --- Files --------------------------------------------------------
-
-OBJFILES= \
-    $(OBJ)$/xmlitem.obj
-
-
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE :  target.mk
-
-
-
diff --git a/udm/util/makefile.mk b/udm/util/makefile.mk
deleted file mode 100644
index 0021a7a..0000000
--- a/udm/util/makefile.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-PRJ=..
-
-PRJNAME=udm
-TARGET=udm
-
-ENABLE_EXCEPTIONS=true
-
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :  settings.mk
-
-
-# --- Files --------------------------------------------------------
-
-LIB1FILES= 	\
-        $(LB)$/csi_html.lib     \
-        $(LB)$/csi_xml.lib
-
-
-# --- Targets ------------------------------------------------------
-
-LIB1TARGET= 	$(LB)$/$(TARGET).lib
-LIB1ARCHIV= 	$(LB)$/lib$(TARGET).a
-
-
-.INCLUDE :  target.mk


More information about the Libreoffice-commits mailing list