summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/ndtxt.hxx6
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx12
2 files changed, 16 insertions, 2 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 868340edc800..ff6082043b0d 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _NDTXT_HXX
-#define _NDTXT_HXX
+#ifndef SW_NDTXT_HXX
+#define SW_NDTXT_HXX
#include <cppuhelper/weakref.hxx>
@@ -133,6 +133,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable
// pointer to the list, to whose the text node is added to
SwList* mpList;
// <--
+ /// #i111677# cached expansion (for clipboard)
+ ::std::auto_ptr< ::rtl::OUString > m_pNumStringCache;
::com::sun::star::uno::WeakReference<
::com::sun::star::text::XTextContent> m_wXParagraph;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index dd66bcbef379..25b1e913c82e 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1486,6 +1486,13 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
xub_StrLen nTxtStartIdx = rStart.GetIndex();
xub_StrLen nDestStart = rDestStart.GetIndex(); // alte Pos merken
+ if (pDest->GetDoc()->IsClipBoard() && this->GetNum())
+ {
+ // #i111677# cache expansion of source (for clipboard)
+ pDest->m_pNumStringCache.reset(
+ new ::rtl::OUString(this->GetNumString()));
+ }
+
if( !nLen )
{
// wurde keine Laenge angegeben, dann Kopiere die Attribute
@@ -2771,6 +2778,11 @@ BOOL SwTxtNode::HasBullet() const
//i53420 added max outline parameter
XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, const unsigned int _nRestrictToThisLevel ) const
{
+ if (GetDoc()->IsClipBoard() && m_pNumStringCache.get())
+ {
+ // #i111677# do not expand number strings in clipboard documents
+ return *m_pNumStringCache;
+ }
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule &&
IsCountedInList() &&