summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-02-06 12:50:59 +0200
committerEike Rathke <erack@redhat.com>2012-02-08 13:15:30 +0100
commit0979307bbf769399f97da10a29f04936a6cf117c (patch)
treef04aea01ba738e29902aceaeeb720fc73a00a408 /sc
parent809fd00863026cdff4bf2de7d02956d39e867eeb (diff)
tools/table.hxx to std::map conversion in SV, SVL and SVX modules
This patch converts one use of tools/table.hxx in svl/inc/svl/zforlist.hxx, whose use in turn spans 3 modules.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/document.cxx2
-rw-r--r--sc/source/core/data/patattr.cxx18
-rw-r--r--sc/source/core/data/stlpool.cxx9
3 files changed, 19 insertions, 10 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 13ccc623e536..a7e66cd504c6 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2163,7 +2163,7 @@ void ScDocument::MergeNumberFormatter(ScDocument* pSrcDoc)
{
SvNumberFormatterIndexTable* pExchangeList =
pThisFormatter->MergeFormatter(*(pOtherFormatter));
- if (pExchangeList->Count() > 0)
+ if (!pExchangeList->empty())
pFormatExchangeList = pExchangeList;
}
}
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 6de3e0a26741..5dfa7bef0440 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -970,9 +970,12 @@ SfxStyleSheetBase* lcl_CopyStyleToPool
rSrcSet.GetItemState( ATTR_VALUE_FORMAT, false, &pSrcItem ) == SFX_ITEM_SET )
{
sal_uLong nOldFormat = static_cast<const SfxUInt32Item*>(pSrcItem)->GetValue();
- sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pFormatExchangeList->Get( nOldFormat ));
- if (pNewFormat)
- rDestSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, *pNewFormat ) );
+ SvNumberFormatterIndexTable::const_iterator it = pFormatExchangeList->find(nOldFormat);
+ if (it != pFormatExchangeList->end())
+ {
+ sal_uInt32 nNewFormat = it->second;
+ rDestSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) );
+ }
}
// ggF. abgeleitete Styles erzeugen, wenn nicht vorhanden:
@@ -1075,9 +1078,12 @@ ScPatternAttr* ScPatternAttr::PutInPool( ScDocument* pDestDoc, ScDocument* pSrcD
// Zahlformate nach Exchange-Liste
sal_uLong nOldFormat = ((const SfxUInt32Item*)pSrcItem)->GetValue();
- sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pDestDoc->GetFormatExchangeList()->Get(nOldFormat));
- if (pNewFormat)
- pNewItem = new SfxUInt32Item( ATTR_VALUE_FORMAT, (sal_uInt32) (*pNewFormat) );
+ SvNumberFormatterIndexTable::const_iterator it = pDestDoc->GetFormatExchangeList()->find(nOldFormat);
+ if (it != pDestDoc->GetFormatExchangeList()->end())
+ {
+ sal_uInt32 nNewFormat = it->second;
+ pNewItem = new SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat );
+ }
}
if ( pNewItem )
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index f9dbef0014ce..e98f33ecd57b 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -198,9 +198,12 @@ void ScStyleSheetPool::CopyStyleFrom( ScStyleSheetPool* pSrcPool,
rSourceSet.GetItemState( ATTR_VALUE_FORMAT, false, &pItem ) == SFX_ITEM_SET )
{
sal_uLong nOldFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
- sal_uInt32* pNewFormat = static_cast<sal_uInt32*>(pDoc->GetFormatExchangeList()->Get( nOldFormat ));
- if (pNewFormat)
- rDestSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, *pNewFormat ) );
+ SvNumberFormatterIndexTable::const_iterator it = pDoc->GetFormatExchangeList()->find(nOldFormat);
+ if (it != pDoc->GetFormatExchangeList()->end())
+ {
+ sal_uInt32 nNewFormat = it->second;
+ rDestSet.Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nNewFormat ) );
+ }
}
}
}