summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2013-02-08 15:52:41 +0100
committerRadek Doulik <rodo@novell.com>2013-02-08 15:58:54 +0100
commit2e14a8bf03cefe831eb7694ea903115bc4b61ecf (patch)
tree064206c800f63e716783c45d7e3c41091859d657 /oox
parent9e310cc32923ceb4b18d97ce68d54a339b935f01 (diff)
fix invalid USS macro use, the result is for immediate use in calls
- otherwise it will became invalid immediately as in this case and contain some random value from stack Change-Id: I9e9e9660ec5d391549b16c6a0510c97cc11e7442
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8389b3a2d0b0..ccf25b98d879 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -779,20 +779,15 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, sal_Bool bIs
}
if( GETAD( CharFontName ) ) {
- const char* typeface = NULL;
const char* pitch = NULL;
const char* charset = NULL;
OUString usTypeface;
mAny >>= usTypeface;
- String aSubstName( GetSubsFontName( usTypeface, SUBSFONT_ONLYONE | SUBSFONT_MS ) );
- if( aSubstName.Len() )
- typeface = USS( aSubstName );
- else
- typeface = USS( usTypeface );
+ OUString aSubstName( GetSubsFontName( usTypeface, SUBSFONT_ONLYONE | SUBSFONT_MS ) );
mpFS->singleElementNS( XML_a, XML_latin,
- XML_typeface, typeface,
+ XML_typeface, USS(aSubstName.getLength() ? aSubstName : usTypeface),
XML_pitchFamily, pitch,
XML_charset, charset,
FSEND );
@@ -805,14 +800,10 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, sal_Bool bIs
OUString usTypeface;
mAny >>= usTypeface;
- String aSubstName( GetSubsFontName( usTypeface, SUBSFONT_ONLYONE | SUBSFONT_MS ) );
- if( aSubstName.Len() )
- typeface = USS( aSubstName );
- else
- typeface = USS( usTypeface );
+ OUString aSubstName( GetSubsFontName( usTypeface, SUBSFONT_ONLYONE | SUBSFONT_MS ) );
mpFS->singleElementNS( XML_a, bComplex ? XML_cs : XML_ea,
- XML_typeface, typeface,
+ XML_typeface, USS(aSubstName.getLength() ? aSubstName : usTypeface),
XML_pitchFamily, pitch,
XML_charset, charset,
FSEND );