include/sax/fastattribs.hxx        |    2 +
 oox/source/core/xmlfilterbase.cxx  |   24 +++++++++------------
 oox/source/drawingml/textfield.cxx |   19 +++++++----------
 oox/source/export/chartexport.cxx  |    9 ++------
 oox/source/export/drawingml.cxx    |   37 +++++++++++++--------------------
 oox/source/export/vmlexport.cxx    |   41 +++++++++++++------------------------
 sax/source/tools/fastattribs.cxx   |   12 ++++++++++
 7 files changed, 66 insertions(+), 78 deletions(-)

New commits:
commit de81df1f3f9b7660db450c638925f90adf9c026b
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Mar 12 18:52:17 2022 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Mar 12 19:44:26 2022 +0100

    Introduce FastAttributeList::add(NS) taking std::u16string_view
    
    ... and simplify some places removing explicit conversions from
    OUString to OString.
    
    Change-Id: I4cdf9f3ee3101b3d00a0bbba53a983ed3bebce4f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131445
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index 452280782067..4ac958d882fc 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -89,7 +89,9 @@ public:
     void add( sal_Int32 nToken, const char* pValue );
     void add( sal_Int32 nToken, const char* pValue, size_t nValueLength );
     void add( sal_Int32 nToken, const OString& rValue );
+    void add( sal_Int32 nToken, std::u16string_view sValue ); // Converts to 
UTF-8
     void addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, const OString& 
rValue );
+    void addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, 
std::u16string_view sValue );
     // note: rQName is *namespace-prefixed*
     void addUnknown( const OUString& rNamespaceURL, const OString& rQName, 
const OString& value );
     void addUnknown( const OString& rName, const OString& value );
diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index fa9811f4e7fa..7c5fe9188b81 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -861,26 +861,24 @@ writeCustomProperties( XmlFilterBase& rSelf, const 
Reference< XDocumentPropertie
     {
         if ( !rProp.Name.isEmpty() )
         {
-            // tdf#127864 - export custom document properties using utf8 text 
encoding
-            OString aName = OUStringToOString(rProp.Name, 
RTL_TEXTENCODING_UTF8);
             // Skip storing these values in Custom Properties as it will be 
stored in Core/Extended Properties
-            if (( aName == "OOXMLCorePropertyCategory" ) || // stored in 
cp:category
-                ( aName == "OOXMLCorePropertyContentStatus" ) || // stored in 
cp:contentStatus
-                ( aName == "OOXMLCorePropertyContentType" ) || // stored in 
cp:contentType
-                ( aName == "OOXMLCorePropertyIdentifier" ) || // stored in 
dc:identifier
-                ( aName == "OOXMLCorePropertyVersion" ) || // stored in 
cp:version
-                ( aName == "HyperlinkBase" ) || // stored in Extended File 
Properties
-                ( aName == "AppVersion" ) || // stored in Extended File 
Properties
-                ( aName == "DocSecurity" ) || // stored in Extended File 
Properties
-                ( aName == "Manager" ) || // stored in Extended File Properties
-                ( aName == "Company" )) // stored in Extended File Properties
+            if (( rProp.Name == "OOXMLCorePropertyCategory" ) || // stored in 
cp:category
+                ( rProp.Name == "OOXMLCorePropertyContentStatus" ) || // 
stored in cp:contentStatus
+                ( rProp.Name == "OOXMLCorePropertyContentType" ) || // stored 
in cp:contentType
+                ( rProp.Name == "OOXMLCorePropertyIdentifier" ) || // stored 
in dc:identifier
+                ( rProp.Name == "OOXMLCorePropertyVersion" ) || // stored in 
cp:version
+                ( rProp.Name == "HyperlinkBase" ) || // stored in Extended 
File Properties
+                ( rProp.Name == "AppVersion" ) || // stored in Extended File 
Properties
+                ( rProp.Name == "DocSecurity" ) || // stored in Extended File 
Properties
+                ( rProp.Name == "Manager" ) || // stored in Extended File 
Properties
+                ( rProp.Name == "Company" )) // stored in Extended File 
Properties
                 continue;
 
             // pid starts from 2 not from 1 as MS supports pid from 2
             pAppProps->startElement( XML_property ,
                 XML_fmtid,  "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",
                 XML_pid,    OString::number(nIndex + 2),
-                XML_name,   aName);
+                XML_name,   rProp.Name);
 
             switch ( rProp.Value.getValueTypeClass() )
             {
diff --git a/oox/source/drawingml/textfield.cxx 
b/oox/source/drawingml/textfield.cxx
index 405a874d8e57..4fc86776ad1f 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -67,11 +67,10 @@ void lclCreateTextFields( std::vector< Reference< 
XTextField > > & aFields,
     Reference< XMultiServiceFactory > xFactory( xModel, UNO_QUERY_THROW );
     if( o3tl::starts_with(sType, u"datetime"))
     {
-        OString s = OUStringToOString( sType, RTL_TEXTENCODING_UTF8);
-        OString p( s.pData->buffer + 8 );
+        auto p = sType.substr(8);
         try
         {
-            if(p.startsWith("'"))
+            if (o3tl::starts_with(p, u"'"))
             {
                 xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.Custom" );
                 aFields.emplace_back( xIface, UNO_QUERY );
@@ -122,9 +121,7 @@ void lclCreateTextFields( std::vector< Reference< 
XTextField > > & aFields,
     }
     else if ( o3tl::starts_with(sType, u"file") )
     {
-        OString s = OUStringToOString( sType, RTL_TEXTENCODING_UTF8);
-        OString p( s.pData->buffer + 4 );
-        int idx = p.toInt32();
+        int idx = rtl_ustr_toInt32(sType.data() + 4, 10);
         xIface = xFactory->createInstance( 
"com.sun.star.text.TextField.FileName" );
         aFields.emplace_back( xIface, UNO_QUERY );
         Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW );
@@ -213,12 +210,12 @@ sal_Int32 TextField::insertAt(
 
 SvxDateFormat TextField::getLODateFormat(std::u16string_view rDateTimeType)
 {
-    OString aDateTimeNum = OUStringToOString(rDateTimeType.substr(8), 
RTL_TEXTENCODING_UTF8);
+    auto aDateTimeNum = rDateTimeType.substr(8);
 
-    if( aDateTimeNum.isEmpty() ) // "datetime"
+    if( aDateTimeNum.empty() ) // "datetime"
         return SvxDateFormat::StdSmall;
 
-    int nDateTimeNum = aDateTimeNum.toInt32();
+    int nDateTimeNum = rtl_ustr_toInt32(aDateTimeNum.data(), 10);
 
     switch( nDateTimeNum )
     {
@@ -246,8 +243,8 @@ SvxDateFormat 
TextField::getLODateFormat(std::u16string_view rDateTimeType)
 
 SvxTimeFormat TextField::getLOTimeFormat(std::u16string_view rDateTimeType)
 {
-    OString aDateTimeNum = OUStringToOString(rDateTimeType.substr(8), 
RTL_TEXTENCODING_UTF8);
-    int nDateTimeNum = aDateTimeNum.toInt32();
+    auto aDateTimeNum = rDateTimeType.substr(8);
+    int nDateTimeNum = rtl_ustr_toInt32(aDateTimeNum.data(), 10);
 
     switch( nDateTimeNum )
     {
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index 8dd99152aadf..dde654497cf8 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3350,9 +3350,8 @@ void ChartExport::_exportAxis(
         aNumberFormatString = getNumberFormatCode(nKey);
     }
 
-    OString sNumberFormatString = OUStringToOString(aNumberFormatString, 
RTL_TEXTENCODING_UTF8);
     pFS->singleElement(FSNS(XML_c, XML_numFmt),
-            XML_formatCode, sNumberFormatString.getStr(),
+            XML_formatCode, aNumberFormatString,
             XML_sourceLinked, bLinkedNumFmt ? "1" : "0");
 
     // majorTickMark
@@ -3881,10 +3880,9 @@ void ChartExport::exportDataLabels(
         mAny >>= nKey;
 
         OUString aNumberFormatString = getNumberFormatCode(nKey);
-        OString sNumberFormatString = OUStringToOString(aNumberFormatString, 
RTL_TEXTENCODING_UTF8);
 
         pFS->singleElement(FSNS(XML_c, XML_numFmt),
-            XML_formatCode, sNumberFormatString,
+            XML_formatCode, aNumberFormatString,
             XML_sourceLinked, ToPsz10(bLinkedNumFmt));
     }
 
@@ -3978,9 +3976,8 @@ void ChartExport::exportDataLabels(
             mAny >>= nKey;
 
             OUString aNumberFormatString = getNumberFormatCode(nKey);
-            OString sNumberFormatString = 
OUStringToOString(aNumberFormatString, RTL_TEXTENCODING_UTF8);
 
-            pFS->singleElement(FSNS(XML_c, XML_numFmt), XML_formatCode, 
sNumberFormatString.getStr(),
+            pFS->singleElement(FSNS(XML_c, XML_numFmt), XML_formatCode, 
aNumberFormatString,
                                XML_sourceLinked, ToPsz10(bLinkedNumFmt));
         }
 
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 835654d7f3a2..e723a27a3445 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -4375,7 +4375,7 @@ void DrawingML::WriteShapeEffect( std::u16string_view 
sName, const Sequence< Pro
                 {
                     OUString sVal;
                     rOuterShdwProp.Value >>= sVal;
-                    aOuterShdwAttrList->add( XML_algn, OUStringToOString( 
sVal, RTL_TEXTENCODING_UTF8 ) );
+                    aOuterShdwAttrList->add( XML_algn, sVal );
                 }
                 else if( rOuterShdwProp.Name == "blurRad" )
                 {
@@ -4786,7 +4786,7 @@ void DrawingML::Write3DEffects( const Reference< 
XPropertySet >& xPropSet, bool
         {
             OUString sVal;
             rEffectProp.Value >>= sVal;
-            aCameraAttrList->add(XML_prst, OUStringToOString(sVal, 
RTL_TEXTENCODING_UTF8));
+            aCameraAttrList->add(XML_prst, sVal);
         }
         else if( rEffectProp.Name == "fov" )
         {
@@ -4831,7 +4831,7 @@ void DrawingML::Write3DEffects( const Reference< 
XPropertySet >& xPropSet, bool
                 nToken = XML_rig;
             else if( rLightRigProp.Name == "dir" )
                 nToken = XML_dir;
-            aLightRigAttrList->add(nToken, OUStringToOString(sVal, 
RTL_TEXTENCODING_UTF8));
+            aLightRigAttrList->add(nToken, sVal);
         }
         else if( rLightRigProp.Name == "rotLat" ||
                 rLightRigProp.Name == "rotLon" ||
@@ -4910,7 +4910,7 @@ void DrawingML::Write3DEffects( const Reference< 
XPropertySet >& xPropSet, bool
         {
             OUString sVal;
             rShape3DProp.Value >>= sVal;
-            aShape3DAttrList->add(XML_prstMaterial, OUStringToOString(sVal, 
RTL_TEXTENCODING_UTF8));
+            aShape3DAttrList->add(XML_prstMaterial, sVal);
         }
         else if( rShape3DProp.Name == "extrusionClr" )
         {
@@ -4954,7 +4954,7 @@ void DrawingML::Write3DEffects( const Reference< 
XPropertySet >& xPropSet, bool
                 {
                     OUString sVal;
                     rBevelProp.Value >>= sVal;
-                    aBevelAttrList->add(XML_prst, OUStringToOString(sVal, 
RTL_TEXTENCODING_UTF8));
+                    aBevelAttrList->add(XML_prst, sVal);
                 }
             }
 
@@ -5159,8 +5159,8 @@ void DrawingML::WriteDiagram(const 
css::uno::Reference<css::drawing::XShape>& rX
     rtl::Reference<sax_fastparser::FastAttributeList> pDocPrAttrList
         = sax_fastparser::FastSerializerHelper::createAttrList();
     pDocPrAttrList->add(XML_id, OString::number(nDiagramId).getStr());
-    OUString sName = "Diagram" + OUString::number(nDiagramId);
-    pDocPrAttrList->add(XML_name, OUStringToOString(sName, 
RTL_TEXTENCODING_UTF8));
+    OString sName = "Diagram" + OString::number(nDiagramId);
+    pDocPrAttrList->add(XML_name, sName);
 
     if (GetDocumentType() == DOCUMENT_DOCX)
     {
@@ -5215,34 +5215,27 @@ void DrawingML::WriteDiagram(const 
css::uno::Reference<css::drawing::XShape>& rX
 
     // add data relation
     OUString dataFileName = "diagrams/data" + OUString::number(nDiagramId) + 
".xml";
-    OString dataRelId = OUStringToOString(
+    OUString dataRelId =
         mpFB->addRelation(mpFS->getOutputStream(), 
oox::getRelationship(Relationship::DIAGRAMDATA),
-                          OUStringConcatenation(sRelationCompPrefix + 
dataFileName)),
-        RTL_TEXTENCODING_UTF8);
+                          OUStringConcatenation(sRelationCompPrefix + 
dataFileName));
 
     // add layout relation
     OUString layoutFileName = "diagrams/layout" + OUString::number(nDiagramId) 
+ ".xml";
-    OString layoutRelId
-        = OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(),
+    OUString layoutRelId = mpFB->addRelation(mpFS->getOutputStream(),
                                               
oox::getRelationship(Relationship::DIAGRAMLAYOUT),
-                                              
OUStringConcatenation(sRelationCompPrefix + layoutFileName)),
-                            RTL_TEXTENCODING_UTF8);
+                                              
OUStringConcatenation(sRelationCompPrefix + layoutFileName));
 
     // add style relation
     OUString styleFileName = "diagrams/quickStyle" + 
OUString::number(nDiagramId) + ".xml";
-    OString styleRelId
-        = OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(),
+    OUString styleRelId = mpFB->addRelation(mpFS->getOutputStream(),
                                               
oox::getRelationship(Relationship::DIAGRAMQUICKSTYLE),
-                                              
OUStringConcatenation(sRelationCompPrefix + styleFileName)),
-                            RTL_TEXTENCODING_UTF8);
+                                              
OUStringConcatenation(sRelationCompPrefix + styleFileName));
 
     // add color relation
     OUString colorFileName = "diagrams/colors" + OUString::number(nDiagramId) 
+ ".xml";
-    OString colorRelId
-        = OUStringToOString(mpFB->addRelation(mpFS->getOutputStream(),
+    OUString colorRelId = mpFB->addRelation(mpFS->getOutputStream(),
                                               
oox::getRelationship(Relationship::DIAGRAMCOLORS),
-                                              
OUStringConcatenation(sRelationCompPrefix + colorFileName)),
-                            RTL_TEXTENCODING_UTF8);
+                                              
OUStringConcatenation(sRelationCompPrefix + colorFileName));
 
     OUString drawingFileName;
     if (drawingDom.is())
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index f00d59f4159e..c23604b6cb19 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -140,14 +140,14 @@ sal_uInt32 VMLExport::EnterGroup( const OUString& 
rShapeName, const tools::Recta
     pAttrList->add( XML_id, ShapeIdString( nShapeId ) );
 
     if ( rShapeName.getLength() )
-        pAttrList->add( XML_alt, OUStringToOString( rShapeName, 
RTL_TEXTENCODING_UTF8 ) );
+        pAttrList->add( XML_alt, rShapeName );
 
     bool rbAbsolutePos = true;
     //editAs
     OUString rEditAs = EscherEx::GetEditAs();
     if (!rEditAs.isEmpty())
     {
-        pAttrList->add(XML_editas, OUStringToOString( rEditAs, 
RTL_TEXTENCODING_UTF8 ));
+        pAttrList->add(XML_editas, rEditAs);
         rbAbsolutePos = false;
     }
 
@@ -197,7 +197,7 @@ void VMLExport::AddShape( sal_uInt32 nShapeType, ShapeFlag 
nShapeFlags, sal_uInt
     else
     {
         // A watermark object - store the optional shape ID
-        m_pShapeAttrList->add( XML_id, 
OUStringToOString(m_pSdrObject->GetName(), RTL_TEXTENCODING_UTF8) );
+        m_pShapeAttrList->add( XML_id, m_pSdrObject->GetName() );
         // also ('o:spid')
         m_pShapeAttrList->addNS( XML_o, XML_spid, m_sShapeId );
     }
@@ -675,41 +675,32 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
                         if (!pSdrGrafObj->getSignatureLineId().isEmpty())
                         {
                             pAttrListSignatureLine->add(
-                                XML_id, 
OUStringToOString(pSdrGrafObj->getSignatureLineId(),
-                                                          
RTL_TEXTENCODING_UTF8));
+                                XML_id, pSdrGrafObj->getSignatureLineId());
                         }
                         if 
(!pSdrGrafObj->getSignatureLineSuggestedSignerName().isEmpty())
                         {
                             pAttrListSignatureLine->add(
                                 FSNS(XML_o, XML_suggestedsigner),
-                                OUStringToOString(
-                                    
pSdrGrafObj->getSignatureLineSuggestedSignerName(),
-                                    RTL_TEXTENCODING_UTF8));
+                                
pSdrGrafObj->getSignatureLineSuggestedSignerName());
                         }
                         if 
(!pSdrGrafObj->getSignatureLineSuggestedSignerTitle().isEmpty())
                         {
                             pAttrListSignatureLine->add(
                                 FSNS(XML_o, XML_suggestedsigner2),
-                                OUStringToOString(
-                                    
pSdrGrafObj->getSignatureLineSuggestedSignerTitle(),
-                                    RTL_TEXTENCODING_UTF8));
+                                
pSdrGrafObj->getSignatureLineSuggestedSignerTitle());
                         }
                         if 
(!pSdrGrafObj->getSignatureLineSuggestedSignerEmail().isEmpty())
                         {
                             pAttrListSignatureLine->add(
                                 FSNS(XML_o, XML_suggestedsigneremail),
-                                OUStringToOString(
-                                    
pSdrGrafObj->getSignatureLineSuggestedSignerEmail(),
-                                    RTL_TEXTENCODING_UTF8));
+                                
pSdrGrafObj->getSignatureLineSuggestedSignerEmail());
                         }
                         if 
(!pSdrGrafObj->getSignatureLineSigningInstructions().isEmpty())
                         {
                             
pAttrListSignatureLine->add(XML_signinginstructionsset, "t");
                             pAttrListSignatureLine->add(
                                 FSNS(XML_o, XML_signinginstructions),
-                                OUStringToOString(
-                                    
pSdrGrafObj->getSignatureLineSigningInstructions(),
-                                    RTL_TEXTENCODING_UTF8));
+                                
pSdrGrafObj->getSignatureLineSigningInstructions());
                         }
                         pAttrListSignatureLine->add(
                             XML_showsigndate,
@@ -735,8 +726,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
                             aImageId = 
m_pTextExport->GetDrawingML().WriteImage(aGraphic, false, &aFileName);
                             m_pTextExport->CacheRelId(nChecksum, aImageId, 
aFileName);
                         }
-                        pAttrList->add(FSNS(XML_r, XML_id),
-                                       OUStringToOString(aImageId, 
RTL_TEXTENCODING_UTF8));
+                        pAttrList->add(FSNS(XML_r, XML_id), aImageId);
                         imageData = true;
                     }
                     else if (rProps.GetOpt(ESCHER_Prop_fillBlip, aStruct) && 
m_pTextExport)
@@ -758,8 +748,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
                             aImageId = 
m_pTextExport->GetDrawingML().WriteImage(aGraphic, false, &aFileName);
                             m_pTextExport->CacheRelId(nChecksum, aImageId, 
aFileName);
                         }
-                        pAttrList->add(FSNS(XML_r, XML_id),
-                                       OUStringToOString(aImageId, 
RTL_TEXTENCODING_UTF8));
+                        pAttrList->add(FSNS(XML_r, XML_id), aImageId);
                         imageData = true;
                     }
 
@@ -970,7 +959,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
                         rtl::Reference<sax_fastparser::FastAttributeList> 
pAttrList = FastSerializerHelper::createAttrList();
                         pAttrList->add(XML_on, "t");
                         pAttrList->add(XML_fitshape, "t");
-                        pAttrList->add(XML_string, 
OUStringToOString(aTextPathString, RTL_TEXTENCODING_UTF8));
+                        pAttrList->add(XML_string, aTextPathString);
                         EscherPropSortStruct aFont;
                         OUString aStyle;
                         if (rProps.GetOpt(ESCHER_Prop_gtextFont, aFont))
@@ -991,7 +980,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
                             pAttrList->add(XML_trim, "t");
 
                         if (!aStyle.isEmpty())
-                            pAttrList->add(XML_style, 
OUStringToOString(aStyle, RTL_TEXTENCODING_UTF8));
+                            pAttrList->add(XML_style, aStyle);
                         m_pSerializer->singleElementNS(XML_v, XML_textpath, 
pAttrList);
                     }
 
@@ -1026,7 +1015,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
                     OUString idStr = 
SvxMSDffManager::MSDFFReadZString(aStream, opt.nProp.size(), true);
                     aStream.Seek(0);
                     if (!IsWaterMarkShape(m_pSdrObject->GetName()) && 
!m_bSkipwzName)
-                         m_pShapeAttrList->add(XML_ID, 
OUStringToOString(idStr, RTL_TEXTENCODING_UTF8));
+                         m_pShapeAttrList->add(XML_ID, idStr);
 
                     bAlreadyWritten[ESCHER_Prop_wzName] = true;
                 }
@@ -1388,7 +1377,7 @@ sal_Int32 VMLExport::StartShape()
 
     if (!m_pSdrObject->getHyperlink().isEmpty())
         m_pShapeAttrList->add(
-            XML_href, OUStringToOString(m_pSdrObject->getHyperlink(), 
RTL_TEXTENCODING_UTF8));
+            XML_href, m_pSdrObject->getHyperlink());
 
     m_pShapeAttrList->addNS(XML_o, XML_allowincell, m_IsFollowingTextFlow ? 
"t" : "f");
 
@@ -1397,7 +1386,7 @@ sal_Int32 VMLExport::StartShape()
 
     OUString sAnchorId = lcl_getAnchorIdFromGrabBag(m_pSdrObject);
     if (!sAnchorId.isEmpty())
-        m_pShapeAttrList->addNS(XML_wp14, XML_anchorId, 
OUStringToOString(sAnchorId, RTL_TEXTENCODING_UTF8));
+        m_pShapeAttrList->addNS(XML_wp14, XML_anchorId, sAnchorId);
 
     if ( nShapeElement >= 0 && !m_pShapeAttrList->hasAttribute( XML_type ) && 
bReferToShapeType )
     {
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index 9bf4a3f4ae6e..1af7821cba24 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -126,12 +126,24 @@ void FastAttributeList::add( sal_Int32 nToken, const 
OString& rValue )
     add( nToken, rValue.getStr(), rValue.getLength() );
 }
 
+void FastAttributeList::add(sal_Int32 nToken, std::u16string_view sValue)
+{
+    add(nToken, OUStringToOString(sValue, RTL_TEXTENCODING_UTF8));
+}
+
 void FastAttributeList::addNS( sal_Int32 nNamespaceToken, sal_Int32 nToken, 
const OString& rValue )
 {
     sal_Int32 nCombinedToken = (nNamespaceToken << 16) | nToken;
     add( nCombinedToken, rValue );
 }
 
+void FastAttributeList::addNS(sal_Int32 nNamespaceToken, sal_Int32 nToken,
+                                     std::u16string_view sValue)
+{
+    sal_Int32 nCombinedToken = (nNamespaceToken << 16) | nToken;
+    add(nCombinedToken, sValue);
+}
+
 void FastAttributeList::addUnknown( const OUString& rNamespaceURL, const 
OString& rName, const OString& value )
 {
     maUnknownAttributes.emplace_back( rNamespaceURL, rName, value );

Reply via email to