[Libreoffice-commits] core.git: include/oox oox/source sd/source sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 4 13:25:19 UTC 2019


 include/oox/export/utils.hxx                 |    2 -
 oox/source/export/chartexport.cxx            |   11 ++++---
 oox/source/export/drawingml.cxx              |   38 ++++++++++++++-------------
 oox/source/export/shapes.cxx                 |   17 +++++++-----
 sd/source/filter/eppt/pptx-animations.cxx    |   23 ++++++++--------
 sd/source/filter/eppt/pptx-epptooxml.cxx     |   22 +++++++--------
 sw/source/filter/ww8/docxattributeoutput.cxx |    2 -
 7 files changed, 61 insertions(+), 54 deletions(-)

New commits:
commit 4a4b1df72909fe96acdbcb95f90e30bd1a79c5eb
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed Mar 27 10:07:31 2019 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Apr 4 15:24:49 2019 +0200

    Get rid of USS macro
    
    The helper marco is used in export code to convert UTF-16 internal
    string representation to UTF-8 used in XML encoding. I suppose that all
    strings here should be already valid UTF-16 (an invalid input should
    have been validated at import/input stage). An invalid string at this
    stage means a programming error in another part of code that breaks this
    precondition, and should not be handled at export stage.
    (See also commit 0267a2326b5282023e8b08a147eca178c5db1980.)
    
    This effectively changes flags used in conversion from UTF-16 to UTF-8,
    so that now RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR is used instead of
    RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT, so that the result would be
    truncated on invalid bytes instead of inserting U+FFFD, and would fail
    assertion in debug builds.
    Other changed flags don't affect UTF-16-to-UTF-8 conversion.
    
    Change-Id: I12b2cc5378208904c3266924187d6402700ed6f3
    Reviewed-on: https://gerrit.libreoffice.org/69801
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx
index fbe4c806dd70..fa758089136e 100644
--- a/include/oox/export/utils.hxx
+++ b/include/oox/export/utils.hxx
@@ -59,8 +59,6 @@ static constexpr const char* ToPsz10(bool b)
     return b ? "1" : "0";
 }
 
-#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr()
-
 static constexpr sal_Int64 PPTtoEMU( sal_Int32 nPPT )
 {
     return static_cast<sal_Int64>( static_cast<double>(nPPT) * 1587.5 );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 062636c91d62..5641d62119a1 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -457,7 +457,7 @@ void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nI
 
     pFS->singleElementNS( mnXmlNamespace, XML_cNvPr,
                           XML_id,     I32S( nID ),
-                          XML_name,   USS( sName ),
+                          XML_name,   sName.toUtf8(),
                           FSEND );
 
     pFS->singleElementNS( mnXmlNamespace, XML_cNvGraphicFramePr,
@@ -526,9 +526,9 @@ void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nI
 
     XmlFilterBase* pFB = GetFB();
     pFS->singleElement(  FSNS( XML_c, XML_chart ),
-            FSNS( XML_xmlns, XML_c ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(dmlChart)), RTL_TEXTENCODING_UTF8).getStr(),
-            FSNS( XML_xmlns, XML_r ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(),
-            FSNS( XML_r, XML_id ), USS( sId ),
+            FSNS(XML_xmlns, XML_c), pFB->getNamespaceURL(OOX_NS(dmlChart)).toUtf8(),
+            FSNS(XML_xmlns, XML_r), pFB->getNamespaceURL(OOX_NS(officeRel)).toUtf8(),
+            FSNS(XML_r, XML_id), sId.toUtf8(),
             FSEND );
 
     pFS->endElement( FSNS( XML_a, XML_graphicData ) );
@@ -3082,7 +3082,8 @@ void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport,
         else
         {
             // Field
-            pFS->startElement(FSNS(XML_a, XML_fld), XML_id, USS(rField->getGuid()), XML_type, USS(sFieldType), FSEND);
+            pFS->startElement(FSNS(XML_a, XML_fld), XML_id, rField->getGuid().toUtf8(), XML_type,
+                              sFieldType.toUtf8(), FSEND);
             writeRunProperties(pChartExport, xPropertySet);
 
             pFS->startElement(FSNS(XML_a, XML_t), FSEND);
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 4c1077b265f8..b5047b80eb15 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -190,7 +190,7 @@ bool DrawingML::GetProperty( const Reference< XPropertySet >& rXPropertySet, con
     }
     catch( const Exception& )
     {
-        /* printf ("exception when trying to get value of property: %s\n", USS(aName)); */
+        /* printf ("exception when trying to get value of property: %s\n", aName.toUtf8()); */
     }
     return false;
 }
@@ -208,7 +208,7 @@ bool DrawingML::GetPropertyAndState( const Reference< XPropertySet >& rXProperty
     }
     catch( const Exception& )
     {
-        /* printf ("exception when trying to get value of property: %s\n", USS(aName)); */
+        /* printf ("exception when trying to get value of property: %s\n", aName.toUtf8()); */
     }
     return false;
 }
@@ -254,7 +254,7 @@ void DrawingML::WriteColor( const OUString& sColorSchemeName, const Sequence< Pr
     if( aTransformations.hasElements() )
     {
         mpFS->startElementNS( XML_a, XML_schemeClr,
-                              XML_val, USS( sColorSchemeName ),
+                              XML_val, sColorSchemeName.toUtf8(),
                               FSEND );
         WriteColorTransformations( aTransformations );
         mpFS->endElementNS( XML_a, XML_schemeClr );
@@ -262,7 +262,7 @@ void DrawingML::WriteColor( const OUString& sColorSchemeName, const Sequence< Pr
     else
     {
         mpFS->singleElementNS( XML_a, XML_schemeClr,
-                              XML_val, USS( sColorSchemeName ),
+                              XML_val, sColorSchemeName.toUtf8(),
                               FSEND );
     }
 }
@@ -1176,7 +1176,7 @@ void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::dra
     GetFS()->startElementNS(XML_p, XML_nvPr, FSEND);
 
     GetFS()->singleElementNS(XML_a, eMediaType == Relationship::VIDEO ? XML_videoFile : XML_audioFile,
-                    FSNS(XML_r, XML_link), USS(aVideoFileRelId),
+                    FSNS(XML_r, XML_link), aVideoFileRelId.toUtf8(),
                     FSEND);
 
     GetFS()->startElementNS(XML_p, XML_extLst, FSEND);
@@ -1185,7 +1185,7 @@ void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::dra
             FSEND);
 
     GetFS()->singleElementNS(XML_p14, XML_media,
-            bEmbed? FSNS(XML_r, XML_embed): FSNS(XML_r, XML_link), USS(aMediaRelId),
+            bEmbed? FSNS(XML_r, XML_embed): FSNS(XML_r, XML_link), aMediaRelId.toUtf8(),
             FSEND);
 
     GetFS()->endElementNS(XML_p, XML_ext);
@@ -1734,7 +1734,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
     mpFS->startElementNS( XML_a, nElement,
                           XML_b, bold,
                           XML_i, italic,
-                          XML_lang, usLanguage.isEmpty() ? nullptr : USS( usLanguage ),
+                          XML_lang, usLanguage.isEmpty() ? nullptr : usLanguage.toUtf8().getStr(),
                           XML_sz, IS( nSize ),
             // For Condensed character spacing spc value is negative.
                           XML_spc, nCharKerning ? IS(nCharKerning) : nullptr,
@@ -1790,9 +1790,11 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
 
         mAny >>= usTypeface;
         OUString aSubstName( GetSubsFontName( usTypeface, SubsFontFlags::ONLYONE | SubsFontFlags::MS ) );
+        if (!aSubstName.isEmpty())
+            usTypeface = aSubstName;
 
         mpFS->singleElementNS( XML_a, XML_latin,
-                               XML_typeface, USS(aSubstName.getLength() ? aSubstName : usTypeface),
+                               XML_typeface, usTypeface.toUtf8(),
                                XML_pitchFamily, pitch,
                                XML_charset, charset,
                                FSEND );
@@ -1811,9 +1813,11 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
 
         mAny >>= usTypeface;
         OUString aSubstName( GetSubsFontName( usTypeface, SubsFontFlags::ONLYONE | SubsFontFlags::MS ) );
+        if (!aSubstName.isEmpty())
+            usTypeface = aSubstName;
 
         mpFS->singleElementNS( XML_a, bComplex ? XML_cs : XML_ea,
-                               XML_typeface, USS(aSubstName.getLength() ? aSubstName : usTypeface),
+                               XML_typeface, usTypeface.toUtf8(),
                                XML_pitchFamily, pitch,
                                XML_charset, charset,
                                FSEND );
@@ -1840,7 +1844,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
                                   sURL, true );
 
             mpFS->singleElementNS( XML_a, XML_hlinkClick,
-                       FSNS( XML_r,XML_id ), USS( sRelId ),
+                       FSNS(XML_r, XML_id), sRelId.toUtf8(),
                        FSEND );
         }
     }
@@ -2208,7 +2212,7 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS
         mpFS->singleElementNS( XML_a, XML_buSzPct,
                                XML_val, IS( std::min(static_cast<sal_Int32>(std::lround(100000.f * fBulletSizeRel)), static_cast<sal_Int32>(400000))), FSEND);
         mpFS->startElementNS( XML_a, XML_buBlip, FSEND );
-        mpFS->singleElementNS( XML_a, XML_blip, FSNS( XML_r, XML_embed ), USS( sRelationId ), FSEND );
+        mpFS->singleElementNS(XML_a, XML_blip, FSNS(XML_r, XML_embed), sRelationId.toUtf8(), FSEND);
         mpFS->endElementNS( XML_a, XML_buBlip );
     }
     else
@@ -2248,7 +2252,7 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS
         }
         else
         {
-            mpFS->singleElementNS(XML_a, XML_buChar, XML_char, USS( OUString( aBulletChar ) ), FSEND);
+            mpFS->singleElementNS(XML_a, XML_buChar, XML_char, OUString(aBulletChar).toUtf8(), FSEND);
         }
     }
 }
@@ -2791,13 +2795,13 @@ void DrawingML::WritePresetShape( const char* pShape, MSO_SPT eShapeType, bool b
                 if( EscherPropertyContainer::GetAdjustmentValue( aAdjustmentSeq[ i ], i, nAdjustmentsWhichNeedsToBeConverted, nValue ) )
                 {
                     // If the document model doesn't have an adjustment name (e.g. shape was created from VML), then take it from the predefined list.
-                    OString aAdjName;
-                    if (aAdjustmentSeq[i].Name.isEmpty())
-                        aAdjName = aAdjustments[i];
+                    OString aAdjName = aAdjustmentSeq[i].Name.isEmpty()
+                                           ? aAdjustments[i]
+                                           : aAdjustmentSeq[i].Name.toUtf8();
 
                     mpFS->singleElementNS( XML_a, XML_gd,
-                                       XML_name, aAdjustmentSeq[ i ].Name.getLength() > 0 ? USS(aAdjustmentSeq[ i ].Name) : aAdjName.getStr(),
-                                       XML_fmla, OString("val " + OString::number( nValue )).getStr(),
+                                       XML_name, aAdjName,
+                                       XML_fmla, OString("val " + OString::number(nValue)),
                                        FSEND );
                 }
             }
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index d94183a207b2..d615d2ec32da 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -728,7 +728,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
         EscherPropertyContainer::IsDefaultObject(
             rSdrObjCustomShape,
             eShapeType));
-    const char* sPresetShape = msfilter::util::GetOOXMLPresetGeometry( USS( sShapeType ) );
+    const char* sPresetShape = msfilter::util::GetOOXMLPresetGeometry(sShapeType.toUtf8().getStr());
     SAL_INFO("oox.shape", "custom shape type: " << sShapeType << " ==> " << sPresetShape);
     Sequence< PropertyValue > aGeometrySeq;
     sal_Int32 nAdjustmentValuesIndex = -1;
@@ -806,7 +806,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
                         mpURLTransformer->isExternalURL(sURL));
 
                 mpFS->singleElementNS( XML_a, XML_hlinkClick,
-                        FSNS( XML_r,XML_id ), USS( sRelId ),
+                        FSNS(XML_r,XML_id), sRelId.toUtf8(),
                         FSEND );
             }
         }
@@ -1143,8 +1143,10 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
 
     pFS->startElementNS( mnXmlNamespace, XML_cNvPr,
                           XML_id,     I32S( GetNewShapeID( xShape ) ),
-                          XML_name,   bHaveName ? USS( sName ) : OString( "Picture " + OString::number( mnPictureIdMax++ )).getStr(),
-                          XML_descr,  bHaveDesc ? USS( sDescr ) : nullptr,
+                          XML_name,   bHaveName
+                                          ? sName.toUtf8()
+                                          : OString("Picture " + OString::number(mnPictureIdMax++)),
+                          XML_descr,  bHaveDesc ? sDescr.toUtf8().getStr() : nullptr,
                           FSEND );
 
     // OOXTODO: //cNvPr children: XML_extLst, XML_hlinkClick, XML_hlinkHover
@@ -1481,7 +1483,8 @@ ShapeExport& ShapeExport::WriteShape( const Reference< XShape >& xShape )
 {
     OUString sShapeType = xShape->getShapeType();
     SAL_INFO("oox.shape", "write shape: " << sShapeType);
-    NameToConvertMapType::const_iterator aConverter = lcl_GetConverters().find(USS(sShapeType));
+    NameToConvertMapType::const_iterator aConverter
+        = lcl_GetConverters().find(sShapeType.toUtf8().getStr());
     if (aConverter == lcl_GetConverters().end())
     {
         SAL_INFO("oox.shape", "unknown shape");
@@ -2061,7 +2064,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
     {
         mpFS->startElementNS( mnXmlNamespace, XML_oleObj,
                           XML_progId, pProgID,
-                          FSNS(XML_r, XML_id), USS( sRelId ),
+                          FSNS(XML_r, XML_id), sRelId.toUtf8(),
                           XML_spid, "",
                           FSEND );
     }
@@ -2069,7 +2072,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )
     {
         mpFS->startElementNS( mnXmlNamespace, XML_oleObj,
 //?                                              XML_name, "Document",
-                          FSNS(XML_r, XML_id), USS( sRelId ),
+                          FSNS(XML_r, XML_id), sRelId.toUtf8(),
                           // The spec says that this is a required attribute, but PowerPoint can only handle an empty value.
                           XML_spid, "",
                           FSEND );
diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx
index d484fcc91cb0..d62b6214e898 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -123,8 +123,8 @@ void WriteAnimationProperty(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 n
             pFS->singleElementNS(XML_p, XML_fltVal, XML_val, DS(fDouble), FSEND);
             break;
         case TypeClass_STRING:
-            pFS->singleElementNS(XML_p, XML_strVal, XML_val, USS(*o3tl::doAccess<OUString>(rAny)),
-                                 FSEND);
+            pFS->singleElementNS(XML_p, XML_strVal, XML_val,
+                                 (*o3tl::doAccess<OUString>(rAny)).toUtf8(), FSEND);
             break;
         default:
             break;
@@ -184,7 +184,7 @@ void WriteAnimateTo(const FSHelperPtr& pFS, const Any& rValue, const OUString& r
     if (!rValue.hasValue())
         return;
 
-    SAL_INFO("sd.eppt", "to attribute name: " << USS(rAttributeName));
+    SAL_INFO("sd.eppt", "to attribute name: " << rAttributeName.toUtf8());
 
     WriteAnimationProperty(pFS, AnimationExporter::convertAnimateValue(rValue, rAttributeName),
                            XML_to);
@@ -199,7 +199,7 @@ void WriteAnimateValues(const FSHelperPtr& pFS, const Reference<XAnimate>& rXAni
     const OUString& sFormula = rXAnimate->getFormula();
     const OUString& rAttributeName = rXAnimate->getAttributeName();
 
-    SAL_INFO("sd.eppt", "animate values, formula: " << USS(sFormula));
+    SAL_INFO("sd.eppt", "animate values, formula: " << sFormula.toUtf8());
 
     pFS->startElementNS(XML_p, XML_tavLst, FSEND);
 
@@ -209,7 +209,7 @@ void WriteAnimateValues(const FSHelperPtr& pFS, const Reference<XAnimate>& rXAni
         if (aValues[i].hasValue())
         {
             pFS->startElementNS(XML_p, XML_tav, XML_fmla,
-                                sFormula.isEmpty() ? nullptr : USS(sFormula), XML_tm,
+                                sFormula.isEmpty() ? nullptr : sFormula.toUtf8().getStr(), XML_tm,
                                 I32S(static_cast<sal_Int32>(aKeyTimes[i] * 100000.0)), FSEND);
             pFS->startElementNS(XML_p, XML_val, FSEND);
             ValuePair aPair;
@@ -295,7 +295,7 @@ void WriteAnimationAttributeName(const FSHelperPtr& pFS, const OUString& rAttrib
 
     pFS->startElementNS(XML_p, XML_attrNameLst, FSEND);
 
-    SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName));
+    SAL_INFO("sd.eppt", "write attribute name: " << rAttributeName.toUtf8());
 
     if (rAttributeName == "X;Y")
     {
@@ -885,9 +885,10 @@ void PPTXAnimationExport::WriteAnimationNodeAnimate(sal_Int32 nXmlNodeType)
         }
 
         mpFS->startElementNS(XML_p, nXmlNodeType, XML_calcmode, pCalcMode, XML_valueType,
-                             pValueType, XML_from, sFrom.getLength() ? USS(sFrom) : nullptr, XML_to,
-                             sTo.getLength() ? USS(sTo) : nullptr, XML_by,
-                             sBy.getLength() ? USS(sBy) : nullptr, FSEND);
+                             pValueType, XML_from,
+                             sFrom.isEmpty() ? nullptr : sFrom.toUtf8().getStr(), XML_to,
+                             sTo.isEmpty() ? nullptr : sTo.toUtf8().getStr(), XML_by,
+                             sBy.isEmpty() ? nullptr : sBy.toUtf8().getStr(), FSEND);
         bTo = sTo.isEmpty() && sFrom.isEmpty() && sBy.isEmpty();
     }
 
@@ -1174,8 +1175,8 @@ void PPTXAnimationExport::WriteAnimationNodeAudio()
 
     mpFS->startElementNS(XML_p, XML_tgtEl, FSEND);
     mpFS->singleElementNS(XML_p, XML_sndTgt, FSNS(XML_r, XML_embed),
-                          sRelId.isEmpty() ? nullptr : USS(sRelId), XML_name,
-                          sUrl.isEmpty() ? nullptr : USS(sName), FSEND);
+                          sRelId.isEmpty() ? nullptr : sRelId.toUtf8().getStr(), XML_name,
+                          sUrl.isEmpty() ? nullptr : sName.toUtf8().getStr(), FSEND);
     mpFS->endElementNS(XML_p, XML_tgtEl);
 
     mpFS->endElementNS(XML_p, XML_cMediaNode);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 2d244f2fb523..0ac1ca406f06 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -123,8 +123,8 @@ void WriteSndAc(const FSHelperPtr& pFS, const OUString& sSoundRelId, const OUStr
         pFS->startElementNS(XML_p, XML_sndAc, FSEND);
         pFS->startElementNS(XML_p, XML_stSnd, FSEND);
         pFS->singleElementNS(XML_p, XML_snd,
-                FSNS(XML_r, XML_embed), sSoundRelId.isEmpty() ? nullptr : USS(sSoundRelId),
-                XML_name, sSoundName.isEmpty() ? nullptr : USS(sSoundName), FSEND);
+            FSNS(XML_r, XML_embed), sSoundRelId.isEmpty() ? nullptr : sSoundRelId.toUtf8().getStr(),
+            XML_name, sSoundName.isEmpty() ? nullptr : sSoundName.toUtf8().getStr(), FSEND);
         pFS->endElement(FSNS(XML_p, XML_stSnd));
         pFS->endElement(FSNS(XML_p, XML_sndAc));
 }
@@ -253,7 +253,7 @@ ShapeExport& PowerPointShapeExport::WriteTextShape(const Reference< XShape >& xS
 {
     OUString sShapeType = xShape->getShapeType();
 
-    SAL_INFO("sd.eppt", "shape(text) : " << USS(sShapeType));
+    SAL_INFO("sd.eppt", "shape(text) : " << sShapeType.toUtf8());
 
     if (sShapeType == "com.sun.star.drawing.TextShape" || sShapeType == "com.sun.star.drawing.GraphicObjectShape")
     {
@@ -306,7 +306,7 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape(const Reference< XShape >&
 {
     OUString sShapeType = xShape->getShapeType();
 
-    SAL_INFO("sd.eppt", "shape(unknown): " << USS(sShapeType));
+    SAL_INFO("sd.eppt", "shape(unknown): " << sShapeType.toUtf8());
 
     if (sShapeType == "com.sun.star.presentation.PageShape")
     {
@@ -321,7 +321,7 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape(const Reference< XShape >&
         }
     }
     else
-        SAL_WARN("sd.eppt", "unknown shape not handled: " << USS(sShapeType));
+        SAL_WARN("sd.eppt", "unknown shape not handled: " << sShapeType.toUtf8());
 
     return *this;
 }
@@ -963,8 +963,8 @@ void PowerPointExport::WriteAuthors()
     {
         pFS->singleElementNS(XML_p, XML_cmAuthor,
                              XML_id, I32S(i.second.nId),
-                             XML_name, USS(i.first),
-                             XML_initials, USS(lcl_GetInitials(i.first)),
+                             XML_name, i.first.toUtf8(),
+                             XML_initials, lcl_GetInitials(i.first).toUtf8(),
                              XML_lastIdx, I32S(i.second.nLastIndex),
                              XML_clrIdx, I32S(i.second.nId),
                              FSEND);
@@ -1099,7 +1099,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum
 
     mPresentationFS->singleElementNS(XML_p, XML_sldId,
                                      XML_id, I32S(GetNewSlideId()),
-                                     FSNS(XML_r, XML_id), USS(sRelId),
+                                     FSNS(XML_r, XML_id), sRelId.toUtf8(),
                                      FSEND);
 
     if (nPageNum == mnPages - 1)
@@ -1232,7 +1232,7 @@ void PowerPointExport::AddLayoutIdAndRelation(const FSHelperPtr& pFS, sal_Int32
 
     pFS->singleElementNS(XML_p, XML_sldLayoutId,
                          XML_id, I64S(GetNewSlideMasterId()),
-                         FSNS(XML_r, XML_id), USS(sRelId),
+                         FSNS(XML_r, XML_id), sRelId.toUtf8(),
                          FSEND);
 }
 
@@ -1254,7 +1254,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro
 
     mPresentationFS->singleElementNS(XML_p, XML_sldMasterId,
                                      XML_id, OString::number(GetNewSlideMasterId()).getStr(),
-                                     FSNS(XML_r, XML_id), USS(sRelId),
+                                     FSNS(XML_r, XML_id), sRelId.toUtf8(),
                                      FSEND);
 
     if (nPageNum == mnMasterPages - 1)
@@ -1909,7 +1909,7 @@ void PowerPointExport::WriteNotesMaster()
                                   "notesMasters/notesMaster1.xml");
 
     mPresentationFS->singleElementNS(XML_p, XML_notesMasterId,
-                                     FSNS(XML_r, XML_id), USS(sRelId),
+                                     FSNS(XML_r, XML_id), sRelId.toUtf8(),
                                      FSEND);
 
     mPresentationFS->endElementNS(XML_p, XML_notesMasterIdLst);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 91d80fed6091..c1a20445fc09 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5073,7 +5073,7 @@ void DocxAttributeOutput::WritePostponedChart()
                */
             m_pSerializer->singleElementNS( XML_wp, XML_docPr,
                     XML_id, I32S( m_anchorId++ ),
-                    XML_name, USS( sName ),
+                    XML_name, sName.toUtf8(),
                     FSEND );
 
             m_pSerializer->singleElementNS( XML_wp, XML_cNvGraphicFramePr,


More information about the Libreoffice-commits mailing list