summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/ndtxt.hxx3
-rw-r--r--sw/source/core/doc/doccomp.cxx13
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx11
3 files changed, 24 insertions, 3 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 2bcc64bd4684..b7af846bbf88 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -277,6 +277,9 @@ public:
// delete all attributes from SwpHintsArray.
void ClearSwpHintsArr( bool bDelFields );
+ /// initialize the hints after file loading (which takes shortcuts)
+ void FileLoadedInitHints();
+
/// Insert pAttr into hints array. @return true iff inserted successfully
bool InsertHint( SwTxtAttr * const pAttr,
const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 2472cab44e9b..3a6e4f349c32 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1757,12 +1757,23 @@ void SwCompareData::SetRedlinesToDoc( bool bUseDocInfo )
}
}
+static bool lcl_MergePortions(SwNode *const& pNode, void *)
+{
+ if (pNode->IsTxtNode())
+ {
+ pNode->GetTxtNode()->FileLoadedInitHints();
+ }
+ return true;
+}
+
// Returns (the difference count?) if something is different
long SwDoc::CompareDoc( const SwDoc& rDoc )
{
if( &rDoc == this )
return 0;
+ const_cast<SwDoc&>(rDoc).GetNodes().ForEach(&lcl_MergePortions);
+
long nRet = 0;
// Get comparison options
@@ -2004,6 +2015,8 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
long nRet = 0;
+ const_cast<SwDoc&>(rDoc).GetNodes().ForEach(&lcl_MergePortions);
+
GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
SwDoc& rSrcDoc = (SwDoc&)rDoc;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index d6de6d509696..fa123156eac7 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -255,14 +255,19 @@ SwTxtNode::~SwTxtNode()
InitSwParaStatistics( false );
}
-SwCntntFrm *SwTxtNode::MakeFrm( SwFrm* pSib )
+void SwTxtNode::FileLoadedInitHints()
{
- // fdo#52028: ODF file import does not result in MergePortions being called
- // for every attribute, since that would be inefficient. So call it here.
if (m_pSwpHints)
{
m_pSwpHints->MergePortions(*this);
}
+}
+
+SwCntntFrm *SwTxtNode::MakeFrm( SwFrm* pSib )
+{
+ // fdo#52028: ODF file import does not result in MergePortions being called
+ // for every attribute, since that would be inefficient. So call it here.
+ FileLoadedInitHints();
SwCntntFrm *pFrm = new SwTxtFrm( this, pSib );
return pFrm;
}