summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2013-12-17 13:18:40 +0100
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2013-12-17 19:51:18 +0100
commit79aecccf048f98a187065fdfabbc911b0e499cdc (patch)
tree4a48f0e362935931ad6fc554b3bdef0fd1877248 /sw
parent64575a5b91b0fae6283b9ad8b1356e76caa34b45 (diff)
sw: Small code rewrite
The purpose is improve legibility of future patches Change-Id: I15bcfdc74feab25cf3ce4dcf246969f3d9f152d2
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx41
1 files changed, 19 insertions, 22 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index f113f3926434..8e5ebbbfbb8d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6124,33 +6124,30 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
{
const std::map< OUString, com::sun::star::uno::Any >& rMap = rItem.GetGrabBag();
- // get original font names and check if they have changed during the edition
+ // get original values of theme-derived properties to check if they have changed during the edition
sal_Bool bWriteCSTheme = sal_True;
sal_Bool bWriteAsciiTheme = sal_True;
sal_Bool bWriteEastAsiaTheme = sal_True;
- if ( m_pFontsAttrList )
+ OUString sOriginalValue;
+ for ( std::map< OUString, com::sun::star::uno::Any >::const_iterator i = rMap.begin(); i != rMap.end(); i++ )
{
- OUString sFontName;
- for ( std::map< OUString, com::sun::star::uno::Any >::const_iterator i = rMap.begin(); i != rMap.end(); ++i )
+ if ( m_pFontsAttrList && i->first == "CharThemeFontNameCs" )
{
- if ( i->first == "CharThemeFontNameCs" )
- {
- if ( i->second >>= sFontName )
- bWriteCSTheme =
- ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_cs ) ) == sFontName );
- }
- else if ( i->first == "CharThemeFontNameAscii" )
- {
- if ( i->second >>= sFontName )
- bWriteAsciiTheme =
- ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_ascii ) ) == sFontName );
- }
- else if ( i->first == "CharThemeFontNameEastAsia" )
- {
- if ( i->second >>= sFontName )
- bWriteEastAsiaTheme =
- ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_eastAsia ) ) == sFontName );
- }
+ if ( i->second >>= sOriginalValue )
+ bWriteCSTheme =
+ ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_cs ) ) == sOriginalValue );
+ }
+ else if ( m_pFontsAttrList && i->first == "CharThemeFontNameAscii" )
+ {
+ if ( i->second >>= sOriginalValue )
+ bWriteAsciiTheme =
+ ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_ascii ) ) == sOriginalValue );
+ }
+ else if ( m_pFontsAttrList && i->first == "CharThemeFontNameEastAsia" )
+ {
+ if ( i->second >>= sOriginalValue )
+ bWriteEastAsiaTheme =
+ ( m_pFontsAttrList->getOptionalValue( FSNS( XML_w, XML_eastAsia ) ) == sOriginalValue );
}
}