sw/source/filter/ww8/docxattributeoutput.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 9263a8bae05356e241af0b6b53d0dbc315bf7669
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Jan 29 10:28:18 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Feb 2 22:42:02 2025 +0100

    Speed up the iteration further
    
    ... after commit 1a938482fbe10065d670e05257a62d8fcfff3793 (use
    getFastAttributeTokens and getValueByIndex, 2025-01-29), which
    has avoided Sequence construction overhead.
    
    This avoids conversion of value strings from UTF-8 to UTF-16
    and back.
    
    Change-Id: Ie832002c5ef4fb6e5390e4b17b752714c09cf471
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180889
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index f2b611b9e2a9..68e8e4f48489 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -775,11 +775,9 @@ void SdtBlockHelper::WriteSdtBlock(const 
::sax_fastparser::FSHelperPtr& pSeriali
         }
 
         if (m_nSdtPrToken == FSNS(XML_w, XML_date) || m_nSdtPrToken == 
FSNS(XML_w, XML_docPartObj) || m_nSdtPrToken == FSNS(XML_w, XML_docPartList) || 
m_nSdtPrToken == FSNS(XML_w14, XML_checkbox)) {
-            const std::vector<sal_Int32>& rAttributeTokens = 
m_pTokenChildren->getFastAttributeTokens();
-            for (size_t i = 0, n = rAttributeTokens.size(); i < n; ++i)
+            for (auto& it : *m_pTokenChildren)
             {
-                pSerializer->singleElement(rAttributeTokens[i], FSNS(XML_w, 
XML_val),
-                                           
m_pTokenChildren->getValueByIndex(i));
+                pSerializer->singleElement(it.getToken(), FSNS(XML_w, 
XML_val), it.toCString());
             }
         }
 

Reply via email to