summaryrefslogtreecommitdiffstats
path: root/sw/source/core/text/frmpaint.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/text/frmpaint.cxx')
-rw-r--r--sw/source/core/text/frmpaint.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 217615337e37..5cbc6dbd38c5 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -45,6 +45,7 @@
#include <tabfrm.hxx>
#include <numrule.hxx>
#include <SwGrammarMarkUp.hxx>
+#include <wrong.hxx>
#include <EnhancedPDFExportHelper.hxx>
@@ -651,9 +652,21 @@ void SwTextFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const&
SwitchRTLtoLTR( const_cast<SwRect&>(rRect) );
SwTextPaintInfo aInf( const_cast<SwTextFrame*>(this), rRect );
- aInf.SetWrongList( const_cast<SwTextNode*>(GetTextNode())->GetWrong() );
- aInf.SetGrammarCheckList( const_cast<SwTextNode*>(GetTextNode())->GetGrammarCheck() );
- aInf.SetSmartTags( const_cast<SwTextNode*>(GetTextNode())->GetSmartTags() );
+ sw::WrongListIterator iterWrong(*this, &SwTextNode::GetWrong);
+ sw::WrongListIterator iterGrammar(*this, &SwTextNode::GetGrammarCheck);
+ sw::WrongListIterator iterSmartTags(*this, &SwTextNode::GetSmartTags);
+ if (iterWrong.LooksUseful())
+ {
+ aInf.SetWrongList( &iterWrong );
+ }
+ if (iterGrammar.LooksUseful())
+ {
+ aInf.SetGrammarCheckList( &iterGrammar );
+ }
+ if (iterSmartTags.LooksUseful())
+ {
+ aInf.SetSmartTags( &iterSmartTags );
+ }
aInf.GetTextFly().SetTopRule();
SwTextPainter aLine( const_cast<SwTextFrame*>(this), &aInf );