summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMarco Cecchetti <mrcekets@gmail.com>2011-08-21 17:18:12 +0200
committerThorsten Behrens <tbehrens@novell.com>2011-08-26 18:25:21 +0200
commitf4a08a55702231acd782ad827f9ef2c2a8bc64d8 (patch)
tree7a9abeb7996812586987f022904c95601a6658d4 /filter
parent6a74d13cc200a1177b48c5cd390d55eec4ee007a (diff)
Fixed a bug about exporting page number placeholder fields
Diffstat (limited to 'filter')
-rw-r--r--filter/source/svg/svgexport.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 0f5d890fbeec..0bddfb3e3057 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1834,11 +1834,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
OSL_FAIL( "error: !mCreateOjectsCurrentMasterPage.is()" );
return 0;
}
- if( mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) == mTextFieldCharSets.end() )
- {
- OSL_FAIL( "error: mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) == mTextFieldCharSets.end()" );
- return 0;
- }
+ sal_Bool bHasCharSetMap = !( mTextFieldCharSets.find( mCreateOjectsCurrentMasterPage ) == mTextFieldCharSets.end() );
static const ::rtl::OUString aHeaderId( B2UCONST( aOOOAttrHeaderField ) );
static const ::rtl::OUString aFooterId( B2UCONST( aOOOAttrFooterField ) );
@@ -1846,26 +1842,30 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
static const ::rtl::OUString aVariableDateTimeId( B2UCONST( aOOOAttrDateTimeField ) + B2UCONST( "-variable" ) );
const UCharSet * pCharSet = NULL;
- UCharSetMap & aCharSetMap = mTextFieldCharSets[ mCreateOjectsCurrentMasterPage ];
+ UCharSetMap * pCharSetMap = NULL;
+ if( bHasCharSetMap )
+ {
+ pCharSetMap = &( mTextFieldCharSets[ mCreateOjectsCurrentMasterPage ] );
+ }
const SvxFieldData* pField = pInfo->GetField().GetField();
- if( ( pField->GetClassId() == SVX_HEADERFIELD ) && ( aCharSetMap.find( aHeaderId ) != aCharSetMap.end() ) )
+ if( bHasCharSetMap && ( pField->GetClassId() == SVX_HEADERFIELD ) && ( pCharSetMap->find( aHeaderId ) != pCharSetMap->end() ) )
{
- pCharSet = &( aCharSetMap[ aHeaderId ] );
+ pCharSet = &( (*pCharSetMap)[ aHeaderId ] );
}
- else if( ( pField->GetClassId() == SVX_FOOTERFIELD ) && ( aCharSetMap.find( aFooterId ) != aCharSetMap.end() ) )
+ else if( bHasCharSetMap && ( pField->GetClassId() == SVX_FOOTERFIELD ) && ( pCharSetMap->find( aFooterId ) != pCharSetMap->end() ) )
{
- pCharSet = &( aCharSetMap[ aFooterId ] );
+ pCharSet = &( (*pCharSetMap)[ aFooterId ] );
}
else if( pField->GetClassId() == SVX_DATEFIMEFIELD )
{
- if( aCharSetMap.find( aDateTimeId ) != aCharSetMap.end() )
+ if( bHasCharSetMap && ( pCharSetMap->find( aDateTimeId ) != pCharSetMap->end() ) )
{
- pCharSet = &( aCharSetMap[ aDateTimeId ] );
+ pCharSet = &( (*pCharSetMap)[ aDateTimeId ] );
}
- if( ( aCharSetMap.find( aVariableDateTimeId ) != aCharSetMap.end() ) && !aCharSetMap[ aVariableDateTimeId ].empty() )
+ if( bHasCharSetMap && ( pCharSetMap->find( aVariableDateTimeId ) != pCharSetMap->end() ) && !(*pCharSetMap)[ aVariableDateTimeId ].empty() )
{
SvxDateFormat eDateFormat = SVXDATEFORMAT_B, eCurDateFormat;
- const UCharSet & aCharSet = aCharSetMap[ aVariableDateTimeId ];
+ const UCharSet & aCharSet = (*pCharSetMap)[ aVariableDateTimeId ];
UCharSet::const_iterator aChar = aCharSet.begin();
// we look for the most verbose date format
for( ; aChar != aCharSet.end(); ++aChar )