summaryrefslogtreecommitdiffstats
path: root/writerfilter
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-10-30 22:33:45 +0100
committerMichael Stahl <mstahl@redhat.com>2012-10-30 22:54:18 +0100
commit4d13a68d75bc7e125d57ec34322c54967d12ecbb (patch)
tree1c5ea6fcc2c41daf70b49fef4be5333b4ce18917 /writerfilter
parentpostgresql: forgot to change include path for openldap (diff)
downloadcore-4d13a68d75bc7e125d57ec34322c54967d12ecbb.tar.gz
core-4d13a68d75bc7e125d57ec34322c54967d12ecbb.zip
writerfilter: clean up PropertyMap::insert mess:
Rumor has it that MSVC 2010 has problems choosing the right overload in PropertyMap::insert call, which is no surprise as that is a ridiculous piece of garbage. Special bonus points for having another class TablePropsRef that must have a call compatible method because it's used as parameter to the same templates, and for the call with a pointer converted to boolean implicitly in StyleSheetTable.cxx:163. Also remove the silly boolean parameter while at it, just have 2 methods instead. Change-Id: I022d5dd7008f3e6c510d94e19fbacbf04bcf1986
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/inc/resourcemodel/TableData.hxx4
-rw-r--r--writerfilter/inc/resourcemodel/TableManager.hxx6
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx4
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx14
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx6
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.hxx8
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx14
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx4
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx13
-rw-r--r--writerfilter/source/dmapper/TablePropertiesHandler.cxx2
-rw-r--r--writerfilter/source/dmapper/TablePropertiesHandler.hxx8
-rw-r--r--writerfilter/source/resourcemodel/resourcemodel.cxx2
12 files changed, 47 insertions, 38 deletions
diff --git a/writerfilter/inc/resourcemodel/TableData.hxx b/writerfilter/inc/resourcemodel/TableData.hxx
index d251b8fb11e4..61efa41b9c25 100644
--- a/writerfilter/inc/resourcemodel/TableData.hxx
+++ b/writerfilter/inc/resourcemodel/TableData.hxx
@@ -90,7 +90,7 @@ public:
void insertProperties(PropertiesPointer pProps)
{
if( mpProps.get() )
- mpProps->insert(pProps);
+ mpProps->InsertProps(pProps);
else
mpProps = pProps;
}
@@ -182,7 +182,7 @@ public:
if( !mpProperties.get() )
mpProperties = pProperties;
else
- mpProperties->insert( pProperties );
+ mpProperties->InsertProps(pProperties);
}
}
diff --git a/writerfilter/inc/resourcemodel/TableManager.hxx b/writerfilter/inc/resourcemodel/TableManager.hxx
index c601adf32b31..71d9a819a61d 100644
--- a/writerfilter/inc/resourcemodel/TableManager.hxx
+++ b/writerfilter/inc/resourcemodel/TableManager.hxx
@@ -890,7 +890,7 @@ void TableManager<T, PropertiesPointer>::cellProps(PropertiesPointer pProps)
#endif
if(getCellProps().get())
- getCellProps()->insert( pProps );
+ getCellProps()->InsertProps(pProps);
else
setCellProps(pProps);
@@ -926,7 +926,7 @@ void TableManager<T, PropertiesPointer>::insertRowProps(PropertiesPointer pProps
#endif
if( getRowProps().get() )
- getRowProps()->insert( pProps );
+ getRowProps()->InsertProps(pProps);
else
setRowProps(pProps);
@@ -945,7 +945,7 @@ void TableManager<T, PropertiesPointer>::insertTableProps(PropertiesPointer pPro
#endif
if( getTableProps().get() )
- getTableProps()->insert( pProps );
+ getTableProps()->InsertProps(pProps);
else
setTableProps(pProps);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 2676d5c0cecd..1f531bd1ab30 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1807,7 +1807,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
pCellColorHandler->setOutputFormat( CellColorHandler::Paragraph );
pProperties->resolve(*pCellColorHandler);
- rContext->insert( pCellColorHandler->getProperties(), true );
+ rContext->InsertProps(pCellColorHandler->getProperties());
}
}
break;
@@ -2285,7 +2285,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
CellColorHandlerPtr pCellColorHandler( new CellColorHandler );
pCellColorHandler->setOutputFormat( CellColorHandler::Character );
pProperties->resolve(*pCellColorHandler);
- rContext->insert( pCellColorHandler->getProperties(), true );
+ rContext->InsertProps(pCellColorHandler->getProperties());
}
break;
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index e6d63f5d69e1..b5c993bb789b 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -120,7 +120,7 @@ PropertyMapPtr lcl_SearchParentStyleSheetAndMergeProperties(const StyleSheetEntr
pRet.reset( new PropertyMap );
}
- pRet->insert( pStyleSheet->pProperties, true );
+ pRet->InsertProps(pStyleSheet->pProperties);
return pRet;
}
@@ -347,8 +347,8 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
dmapper_logger->endElement();
#endif
- m_aTableProperties->insert( pMergedProperties );
- m_aTableProperties->insert( pTableProps );
+ m_aTableProperties->InsertProps(pMergedProperties);
+ m_aTableProperties->InsertProps(pTableProps);
#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("TableProperties");
@@ -359,7 +359,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
}
// Set the table default attributes for the cells
- rInfo.pTableDefaults->insert( m_aTableProperties );
+ rInfo.pTableDefaults->InsertProps(m_aTableProperties);
#ifdef DEBUG_DMAPPER_TABLE_HANDLER
dmapper_logger->startElement("TableDefaults");
@@ -543,7 +543,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
if( aCellIterator->get() )
{
if ( rInfo.pTableDefaults->size( ) )
- pAllCellProps->insert( rInfo.pTableDefaults );
+ pAllCellProps->InsertProps(rInfo.pTableDefaults);
// Fill the cell properties with the ones of the style
sal_Int32 nCellStyleMask = 0;
@@ -562,7 +562,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
if ( rInfo.pTableStyle )
{
PropertyMapPtr pStyleProps = rInfo.pTableStyle->GetProperties( nCellStyleMask + nRowStyleMask );
- pAllCellProps->insert( pStyleProps );
+ pAllCellProps->InsertProps(pStyleProps);
}
// Remove properties from style/row that aren't allowed in cells
@@ -573,7 +573,7 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
pAllCellProps->erase( aDefaultRepeatIt );
// Then add the cell properties
- pAllCellProps->insert( *aCellIterator );
+ pAllCellProps->InsertProps(*aCellIterator);
aCellIterator->get( )->swap( *pAllCellProps.get( ) );
#ifdef DEBUG_DMAPPER_TABLE_HANDLER
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 2753d7f2a65a..0416b1ddd86a 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -142,7 +142,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
pProperties->resolve( *pTDefTableHandler );
TablePropertyMapPtr pRowPropMap( new TablePropertyMap );
- pRowPropMap->insert( pTDefTableHandler->getRowProperties() );
+ pRowPropMap->InsertProps(pTDefTableHandler->getRowProperties());
insertRowProps( pRowPropMap );
if( !m_nTableWidth )
{
@@ -171,7 +171,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
BorderHandlerPtr pBorderHandler( new BorderHandler(m_bOOXML) );
pProperties->resolve(*pBorderHandler);
TablePropertyMapPtr pCellPropMap( new TablePropertyMap() );
- pCellPropMap->insert( pBorderHandler->getProperties() );
+ pCellPropMap->InsertProps(pBorderHandler->getProperties());
cellPropsByCell( m_nCellBorderIndex, pCellPropMap );
++m_nCellBorderIndex;
}
@@ -569,7 +569,7 @@ void DomainMapperTableManager::CopyTextProperties(PropertyMapPtr pContext, Style
OSL_ENSURE( pStyleSheetEntry, "table style not found" );
lcl_CopyTextProperties(m_pTableStyleTextProperies, pStyleSheetEntry.get( ), pStyleSheetTable);
}
- pContext->insert( m_pTableStyleTextProperies );
+ pContext->InsertProps(m_pTableStyleTextProperies);
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index e9255f7afaca..daba8cec62af 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -82,7 +82,7 @@ public:
inline virtual void cellProps(TablePropertyMapPtr pProps)
{
if ( m_pStyleProps.get( ) )
- m_pStyleProps->insert( pProps, true );
+ m_pStyleProps->InsertProps(pProps);
else
DomainMapperTableManager_Base_t::cellProps( pProps );
};
@@ -90,7 +90,7 @@ public:
inline virtual void cellPropsByCell(unsigned int i, TablePropertyMapPtr pProps)
{
if ( m_pStyleProps.get( ) )
- m_pStyleProps->insert( pProps, true );
+ m_pStyleProps->InsertProps(pProps);
else
DomainMapperTableManager_Base_t::cellPropsByCell( i, pProps );
};
@@ -98,7 +98,7 @@ public:
inline virtual void insertRowProps(TablePropertyMapPtr pProps)
{
if ( m_pStyleProps.get( ) )
- m_pStyleProps->insert( pProps, true );
+ m_pStyleProps->InsertProps(pProps);
else
DomainMapperTableManager_Base_t::insertRowProps( pProps );
};
@@ -106,7 +106,7 @@ public:
inline virtual void insertTableProps(TablePropertyMapPtr pProps)
{
if ( m_pStyleProps.get( ) )
- m_pStyleProps->insert( pProps, true );
+ m_pStyleProps->InsertProps(pProps);
else
DomainMapperTableManager_Base_t::insertTableProps( pProps );
};
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 22f680b18e8f..4ea094b6c19a 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -224,12 +224,20 @@ template<class T>
};
-void PropertyMap::insert( const PropertyMapPtr pMap, bool bOverwrite )
+void PropertyMap::InsertProps(const PropertyMapPtr pMap)
+{
+ if( pMap.get() )
+ {
+ ::std::for_each( pMap->begin(), pMap->end(),
+ removeExistingElements<PropertyMap::value_type>(*this) );
+ InsertPropsNoOverwrite(pMap);
+ }
+}
+
+void PropertyMap::InsertPropsNoOverwrite(const PropertyMapPtr pMap)
{
if( pMap.get() )
{
- if( bOverwrite )
- ::std::for_each( pMap->begin(), pMap->end(), removeExistingElements<PropertyMap::value_type>(*this) );
_PropertyMap::insert(pMap->begin(), pMap->end());
insertTableProperties(pMap.get());
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index 6d622800bf8d..90fb5c45ca00 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -105,8 +105,8 @@ public:
/** Add property, usually overwrites already available attributes. It shouldn't overwrite in case of default attributes
*/
void Insert( PropertyIds eId, bool bIsTextProperty, const ::com::sun::star::uno::Any& rAny, bool bOverwrite = true );
- using _PropertyMap::insert;
- void insert(const boost::shared_ptr<PropertyMap> pMap, bool bOverwrite = true);
+ void InsertPropsNoOverwrite(const boost::shared_ptr<PropertyMap> pMap);
+ void InsertProps(const boost::shared_ptr<PropertyMap> pMap);
const ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote>& GetFootnote() const;
void SetFootnote( ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote> xF ) { m_xFootnote = xF; }
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 044b53c54423..b5413b8973bb 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -160,14 +160,14 @@ PropertyMapPtr TableStyleSheetEntry::GetProperties( sal_Int32 nMask, StyleSheetE
pStack->push_back(pEntry);
TableStyleSheetEntry* pParent = static_cast<TableStyleSheetEntry *>( pEntry.get( ) );
- pProps->insert( pParent->GetProperties( nMask ), pStack );
+ pProps->InsertProps(pParent->GetProperties(nMask));
pStack->pop_back();
}
}
// And finally get the mask ones
- pProps->insert( GetLocalPropertiesFromMask( nMask ) );
+ pProps->InsertProps(GetLocalPropertiesFromMask(nMask));
return pProps;
}
@@ -211,7 +211,7 @@ void lcl_mergeProps( PropertyMapPtr pToFill, PropertyMapPtr pToAdd, TblStyleTyp
}
}
- pToFill->insert( pToAdd );
+ pToFill->InsertProps(pToAdd);
}
PropertyMapPtr TableStyleSheetEntry::GetLocalPropertiesFromMask( sal_Int32 nMask )
@@ -517,7 +517,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
if (nType == TBL_STYLE_UNKNOWN)
{
- pEntry->pProperties->insert(pProps);
+ pEntry->pProperties->InsertProps(pProps);
}
else
{
@@ -556,7 +556,8 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
{
BorderHandlerPtr pBorderHandler( new BorderHandler(m_pImpl->m_rDMapper.IsOOXMLImport()) );
pProperties->resolve(*pBorderHandler);
- m_pImpl->m_pCurrentEntry->pProperties->insert( pBorderHandler->getProperties(), true );
+ m_pImpl->m_pCurrentEntry->pProperties->InsertProps(
+ pBorderHandler->getProperties());
}
}
break;
@@ -595,7 +596,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
PropertyMapPtr pProps(new PropertyMap());
m_pImpl->m_rDMapper.sprmWithProps( rSprm, pProps );
- m_pImpl->m_pCurrentEntry->pProperties->insert(pProps);
+ m_pImpl->m_pCurrentEntry->pProperties->InsertProps(pProps);
m_pImpl->m_rDMapper.PopStyleSheetProperties( );
}
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index 4899a14f5010..17e1a84d39d6 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -146,7 +146,7 @@ namespace dmapper {
BorderHandlerPtr pBorderHandler( new BorderHandler(m_bOOXML) );
pProperties->resolve(*pBorderHandler);
TablePropertyMapPtr pTablePropMap( new TablePropertyMap );
- pTablePropMap->insert( pBorderHandler->getProperties() );
+ pTablePropMap->InsertProps(pBorderHandler->getProperties());
#ifdef DEBUG_DOMAINMAPPER
pTablePropMap->dumpXml( dmapper_logger );
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.hxx b/writerfilter/source/dmapper/TablePropertiesHandler.hxx
index c72effa88b3b..4c3056940834 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.hxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.hxx
@@ -68,7 +68,7 @@ private:
if ( m_pTableManager )
m_pTableManager->cellProps( pProps );
else
- m_pCurrentProperties->insert( pProps, true );
+ m_pCurrentProperties->InsertProps(pProps);
};
inline void cellPropsByCell( unsigned int i, TablePropertyMapPtr pProps )
@@ -76,7 +76,7 @@ private:
if ( m_pTableManager )
m_pTableManager->cellPropsByCell( i, pProps );
else
- m_pCurrentProperties->insert( pProps, true );
+ m_pCurrentProperties->InsertProps(pProps);
};
inline void insertRowProps( TablePropertyMapPtr pProps )
@@ -84,7 +84,7 @@ private:
if ( m_pTableManager )
m_pTableManager->insertRowProps( pProps );
else
- m_pCurrentProperties->insert( pProps, true );
+ m_pCurrentProperties->InsertProps(pProps);
};
inline void insertTableProps( TablePropertyMapPtr pProps )
@@ -92,7 +92,7 @@ private:
if ( m_pTableManager )
m_pTableManager->insertTableProps( pProps );
else
- m_pCurrentProperties->insert( pProps, true );
+ m_pCurrentProperties->InsertProps(pProps);
};
};
typedef boost::shared_ptr<TablePropertiesHandler> TablePropertiesHandlerPtr;
diff --git a/writerfilter/source/resourcemodel/resourcemodel.cxx b/writerfilter/source/resourcemodel/resourcemodel.cxx
index 1c9d89b66052..f873072f1ed5 100644
--- a/writerfilter/source/resourcemodel/resourcemodel.cxx
+++ b/writerfilter/source/resourcemodel/resourcemodel.cxx
@@ -87,7 +87,7 @@ public:
virtual string getType() const { return "TableProps"; }
void reset() {}
- void insert(Pointer_t /* pTablePropsRef */) {}
+ void InsertProps(Pointer_t /* pTablePropsRef */) {}
};
typedef TablePropsRef::Pointer_t TablePropsRef_t;