sw/source/uibase/app/docstyle.cxx | 24 ++++++++++++------------ sw/source/writerfilter/ooxml/factoryimpl.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-)
New commits: commit 3c483a3ac8f96c90ab84f37941b52ddbc8661910 Author: Noel Grandin <[email protected]> AuthorDate: Wed Feb 4 13:55:03 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat Feb 7 12:37:40 2026 +0100 tdf#170595 use more string literal avoid runtime heap allocation Change-Id: I14b45f0ec4949d724e765112958dfc1b6f442e6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198725 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> (cherry picked from commit ea7b817b2779dc514cc0908f94a1b13fce2e6ff9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198825 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/sw/source/writerfilter/ooxml/factoryimpl.py b/sw/source/writerfilter/ooxml/factoryimpl.py index f88e48b094c2..73086ccf6843 100644 --- a/sw/source/writerfilter/ooxml/factoryimpl.py +++ b/sw/source/writerfilter/ooxml/factoryimpl.py @@ -159,7 +159,7 @@ def getFastParser(): xInit->initialize(args); """) for url in sorted(ooxUrlAliases.keys()): - print(""" mxFastParser->registerNamespace("%s", oox::NMSP_%s);""" % (url, ooxUrlAliases[url])) + print(""" mxFastParser->registerNamespace(u"%s"_ustr, oox::NMSP_%s);""" % (url, ooxUrlAliases[url])) print(""" } return mxFastParser; commit 3b1f94491f2d4ece4063493c1236463f7d612b25 Author: Noel Grandin <[email protected]> AuthorDate: Wed Feb 4 13:50:23 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat Feb 7 12:37:30 2026 +0100 tdf#170595 avoid some heap allocation Change-Id: I32ebf57789333abb4cf80364cf8225c9e4829c03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198724 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> (cherry picked from commit 6f3cd396721aa89253ce18de6b11dda5208aa5e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198824 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index e29e7bfb4d98..7021bbb919ab 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -1651,7 +1651,7 @@ void SwDocStyleSheet::SetItemSet(const SfxItemSet& rSet, const bool bBroadcast, SwFormat* pFormat = nullptr; std::vector<sal_uInt16> aWhichIdsToReset; - std::unique_ptr<SwPageDesc> pNewDsc; + std::optional<SwPageDesc> oNewDsc; size_t nPgDscPos = 0; switch(nFamily) @@ -1808,13 +1808,13 @@ void SwDocStyleSheet::SetItemSet(const SfxItemSet& rSet, const bool bBroadcast, if (m_rDoc.FindPageDesc(m_pDesc->GetName(), &nPgDscPos)) { - pNewDsc.reset( new SwPageDesc( *m_pDesc ) ); + oNewDsc.emplace( *m_pDesc ); // #i48949# - no undo actions for the // copy of the page style ::sw::UndoGuard const ug(m_rDoc.GetIDocumentUndoRedo()); - m_rDoc.CopyPageDesc(*m_pDesc, *pNewDsc); // #i7983# + m_rDoc.CopyPageDesc(*m_pDesc, *oNewDsc); // #i7983# - pFormat = &pNewDsc->GetMaster(); + pFormat = &oNewDsc->GetMaster(); // tdf#134166: Changing page style can affect toolbar button state. if (SwEditShell* pSh = m_rDoc.GetEditShell()) @@ -1900,14 +1900,14 @@ void SwDocStyleSheet::SetItemSet(const SfxItemSet& rSet, const bool bBroadcast, m_aCoreSet.ClearItem(); - if( pNewDsc ) + if( oNewDsc ) { const bool bApplyToAllFormatFrames = bParam1; - ::ItemSetToPageDesc(aSet, *pNewDsc, bApplyToAllFormatFrames); - m_rDoc.ChgPageDesc( nPgDscPos, *pNewDsc ); + ::ItemSetToPageDesc(aSet, *oNewDsc, bApplyToAllFormatFrames); + m_rDoc.ChgPageDesc( nPgDscPos, *oNewDsc ); m_pDesc = &m_rDoc.GetPageDesc( nPgDscPos ); - m_rDoc.PreDelPageDesc(pNewDsc.get()); // #i7983# - pNewDsc.reset(); + m_rDoc.PreDelPageDesc(&*oNewDsc); // #i7983# + oNewDsc.reset(); } else { @@ -1919,10 +1919,10 @@ void SwDocStyleSheet::SetItemSet(const SfxItemSet& rSet, const bool bBroadcast, else { m_aCoreSet.ClearItem(); - if( pNewDsc ) // we still need to delete it + if( oNewDsc ) // we still need to delete it { - m_rDoc.PreDelPageDesc(pNewDsc.get()); // #i7983# - pNewDsc.reset(); + m_rDoc.PreDelPageDesc(&*oNewDsc); // #i7983# + oNewDsc.reset(); } }
