summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx10
2 files changed, 6 insertions, 6 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index ad6a3c4ac27e..6b64fdef8b19 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -117,7 +117,7 @@ class SW_DLLPUBLIC SwTextNode final
Needed to avoid duplicate handling of attribute change actions. */
bool mbInSetOrResetAttr;
- std::unique_ptr< OUString > m_pNumStringCache;
+ std::optional< OUString > m_oNumStringCache;
css::uno::WeakReference<css::text::XTextContent> m_wXParagraph;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 190b39a5a7fa..05548bb3e69b 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1971,9 +1971,9 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
if (pDest->GetDoc().IsClipBoard() && GetNum())
{
// #i111677# cache expansion of source (for clipboard)
- pDest->m_pNumStringCache.reset( (nTextStartIdx != 0)
- ? new OUString // fdo#49076: numbering only if copy from para start
- : new OUString(GetNumString()));
+ pDest->m_oNumStringCache = (nTextStartIdx != 0)
+ ? OUString() // fdo#49076: numbering only if copy from para start
+ : GetNumString();
}
if( !nLen )
@@ -3086,10 +3086,10 @@ OUString SwTextNode::GetNumString( const bool _bInclPrefixAndSuffixStrings,
const unsigned int _nRestrictToThisLevel,
SwRootFrame const*const pLayout) const
{
- if (GetDoc().IsClipBoard() && m_pNumStringCache)
+ if (GetDoc().IsClipBoard() && m_oNumStringCache)
{
// #i111677# do not expand number strings in clipboard documents
- return *m_pNumStringCache;
+ return *m_oNumStringCache;
}
const SwNumRule* pRule = GetNum(pLayout) ? GetNum(pLayout)->GetNumRule() : nullptr;
if ( pRule &&