summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-03 22:25:47 +0200
committerMichael Stahl <mstahl@redhat.com>2015-09-04 11:55:47 +0200
commit9b5d96d7e074dd9ea26f835351ac6d36fe01b086 (patch)
tree179ab63b3727d6e0aae47e76cfffaacf2ab7e5b8 /sw
parent5fba3a9a0022c3647d098c00ea63593bd1e78e65 (diff)
sw: avoid asserts from RsidOnlyAutoFormats check
This happens with a document that has a header or footer that is not displayed after loading, for example 1-page document with separate left/right or first page header. The SwTextNode::FileLoadedInitHints() is not called for these headers because they are not visible so MakeFrm() is not called. If they are not visible the RSID related flags don't matter. Change-Id: Ie3bd1ce3bc0ac2ff1c429386149294e0c8fd3cb6
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index d8e8698030c9..331736926478 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -102,8 +102,12 @@ TYPEINIT1( SwTextNode, SwContentNode )
#define CHECK_SWPHINTS(pNd) { if( pNd->GetpSwpHints() && \
!pNd->GetDoc()->IsInReading() ) \
pNd->GetpSwpHints()->Check(true); }
+#define CHECK_SWPHINTS_IF_FRM(pNd) { if( pNd->GetpSwpHints() && \
+ !pNd->GetDoc()->IsInReading() ) \
+ pNd->GetpSwpHints()->Check(getLayoutFrm(nullptr, nullptr, nullptr, false) != nullptr); }
#else
#define CHECK_SWPHINTS(pNd)
+#define CHECK_SWPHINTS_IF_FRM(pNd)
#endif
SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
@@ -1643,6 +1647,8 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
sal_Int32 nLen,
const bool bForceCopyOfAllAttrs )
{
+ CHECK_SWPHINTS_IF_FRM(this);
+ CHECK_SWPHINTS(pDest);
sal_Int32 nTextStartIdx = rStart.GetIndex();
sal_Int32 nDestStart = rDestStart.GetIndex(); // alte Pos merken
@@ -1896,7 +1902,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest,
}
}
- CHECK_SWPHINTS(this);
+ CHECK_SWPHINTS_IF_FRM(this);
CHECK_SWPHINTS(pDest);
}