summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoros <os@openoffice.org>2010-11-19 08:02:17 +0100
committeros <os@openoffice.org>2010-11-19 08:02:17 +0100
commit772e57adce746f4c3e42c2333828d6c068f30fbb (patch)
treedca2f02c4777f8ee8dbacbe0e5ab2df72f9fbc73
parentc6f4c90e0228a389aa08a3f7c39c965e8ae0fc0f (diff)
SfxItemPool access
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx26
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx10
2 files changed, 22 insertions, 14 deletions
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index f4f3f7166fe0..f899d2160e86 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -525,8 +525,8 @@ void RtfExport::ExportDocument_Impl()
// protected section in the document.
{
const SfxItemPool& rPool = pDoc->GetAttrPool();
- USHORT nMaxItem = rPool.GetItemCount2(RES_PROTECT);
- for( USHORT n = 0; n < nMaxItem; ++n )
+ sal_uInt32 const nMaxItem = rPool.GetItemCount2(RES_PROTECT);
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem2(RES_PROTECT, n);
if (pProtect && pProtect->IsCntntProtected())
@@ -997,7 +997,7 @@ void RtfExport::OutColorTable()
{
// Build the table from rPool since the colors provided to
// RtfAttributeOutput callbacks are too late.
- USHORT n, nMaxItem;
+ sal_uInt32 nMaxItem;
const SfxItemPool& rPool = pDoc->GetAttrPool();
// char color
@@ -1009,7 +1009,7 @@ void RtfExport::OutColorTable()
RES_CHRATR_COLOR ) ))
InsColor( pCol->GetValue() );
nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR);
- for( n = 0; n < nMaxItem; ++n )
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
if( 0 != (pCol = (const SvxColorItem*)rPool.GetItem2(
RES_CHRATR_COLOR, n ) ) )
@@ -1019,7 +1019,7 @@ void RtfExport::OutColorTable()
const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr( RES_CHRATR_UNDERLINE );
InsColor( pUnder->GetColor() );
nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE);
- for( n = 0; n < nMaxItem;n++)
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
if( 0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem2( RES_CHRATR_UNDERLINE, n ) ) )
InsColor( pUnder->GetColor() );
@@ -1029,7 +1029,7 @@ void RtfExport::OutColorTable()
const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr( RES_CHRATR_OVERLINE );
InsColor( pOver->GetColor() );
nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE);
- for( n = 0; n < nMaxItem;n++)
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
if( 0 != (pOver = (const SvxOverlineItem*)rPool.GetItem2( RES_CHRATR_OVERLINE, n ) ) )
InsColor( pOver->GetColor() );
@@ -1052,12 +1052,14 @@ void RtfExport::OutColorTable()
InsColor( pBkgrd->GetColor() );
}
nMaxItem = rPool.GetItemCount2( *pIds );
- for( n = 0; n < nMaxItem; ++n )
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
+ {
if( 0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem2(
*pIds , n ) ))
{
InsColor( pBkgrd->GetColor() );
}
+ }
}
// shadow color
@@ -1071,12 +1073,14 @@ void RtfExport::OutColorTable()
InsColor( pShadow->GetColor() );
}
nMaxItem = rPool.GetItemCount2(RES_SHADOW);
- for( n = 0; n < nMaxItem; ++n )
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
+ {
if( 0 != (pShadow = (const SvxShadowItem*)rPool.GetItem2(
RES_SHADOW, n ) ) )
{
InsColor( pShadow->GetColor() );
}
+ }
}
// frame border color
@@ -1086,12 +1090,14 @@ void RtfExport::OutColorTable()
RES_BOX ) ))
InsColorLine( *pBox );
nMaxItem = rPool.GetItemCount2(RES_BOX);
- for( n = 0; n < nMaxItem; ++n )
+ for (sal_uInt32 n = 0; n < nMaxItem; ++n)
+ {
if( 0 != (pBox = (const SvxBoxItem*)rPool.GetItem2( RES_BOX, n ) ))
InsColorLine( *pBox );
+ }
}
- for( n = 0; n < m_aColTbl.size(); n++ )
+ for (size_t n = 0; n < m_aColTbl.size(); ++n)
{
const Color& rCol = m_aColTbl[ n ];
if( n || COL_AUTO != rCol.GetColor() )
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 4d16a5646536..ab7a8c4e3a0e 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -784,14 +784,16 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc)
const USHORT aTypes[] = { RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_FONT, 0 };
for (const USHORT* pId = aTypes; *pId; ++pId)
{
- USHORT nMaxItem = rPool.GetItemCount2( *pId );
- for( USHORT nGet = 0; nGet < nMaxItem; ++nGet )
- if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem2(
- *pId, nGet )) )
+ sal_uInt32 const nMaxItem = rPool.GetItemCount2( *pId );
+ for (sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet)
+ {
+ pFont = (const SvxFontItem*)rPool.GetItem2( *pId, nGet );
+ if (0 != pFont)
{
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8));
}
+ }
}
}